Author: jleroux
Date: Wed Jun 27 14:11:22 2007 New Revision: 551332 URL: http://svn.apache.org/viewvc?view=rev&rev=551332 Log: A patch from Chris Lombardi "Sale discounts are not shown in the Journal" (https://issues.apache.org/jira/browse/OFBIZ-1107) I slightly changed to improve the information : not only "(adjustement)" for both sale and item discount but "(sale discount)" and "(item discount)" So I put in other properties file the english tokens. People will just have to translate it... For instance in french I put (ItemDiscount)=Remise sur l'article (SalesDiscount)=Remise sur la vente Note that I did not use parenthesis as they are redundant here because of the sign in price Also I got rid of the dash in column quantity for other lines that product (useless) Modified: ofbiz/trunk/specialpurpose/pos/config/pos.properties ofbiz/trunk/specialpurpose/pos/config/pos_es.properties ofbiz/trunk/specialpurpose/pos/config/pos_fr.properties ofbiz/trunk/specialpurpose/pos/config/pos_it.properties ofbiz/trunk/specialpurpose/pos/config/pos_ro.properties ofbiz/trunk/specialpurpose/pos/config/pos_zh.properties ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java Modified: ofbiz/trunk/specialpurpose/pos/config/pos.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/config/pos.properties?view=diff&rev=551332&r1=551331&r2=551332 ============================================================================== --- ofbiz/trunk/specialpurpose/pos/config/pos.properties (original) +++ ofbiz/trunk/specialpurpose/pos/config/pos.properties Wed Jun 27 14:11:22 2007 @@ -75,3 +75,5 @@ CreateOrChooseReasonInOut=You have to create or choose a reason PaidInTitle=Enter amount to paid in and create or choose a reason PaidOutTitle=Enter amount to withdraw and create or choose a reason +(ItemDiscount)=(Item discount) +(SalesDiscount)=(Sales discount) \ No newline at end of file Modified: ofbiz/trunk/specialpurpose/pos/config/pos_es.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/config/pos_es.properties?view=diff&rev=551332&r1=551331&r2=551332 ============================================================================== --- ofbiz/trunk/specialpurpose/pos/config/pos_es.properties (original) +++ ofbiz/trunk/specialpurpose/pos/config/pos_es.properties Wed Jun 27 14:11:22 2007 @@ -67,3 +67,5 @@ draw=Dr. term=Terminal: total_report=REPORTE TOTAL: +(ItemDiscount)=(Item discount) +(SalesDiscount)=(Sales discount) \ No newline at end of file Modified: ofbiz/trunk/specialpurpose/pos/config/pos_fr.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/config/pos_fr.properties?view=diff&rev=551332&r1=551331&r2=551332 ============================================================================== --- ofbiz/trunk/specialpurpose/pos/config/pos_fr.properties (original) +++ ofbiz/trunk/specialpurpose/pos/config/pos_fr.properties Wed Jun 27 14:11:22 2007 @@ -76,3 +76,5 @@ CreateOrChooseReasonInOut=Vous devez créer ou choisir une raison pour ce mouvement de caisse PaidInTitle=Entrez le montant \u00E0 remettre en caisse et créer ou choisissez une raison PaidOutTitle=Entrez le montant \u00E0 retirer et créer ou choisissez une raison +(ItemDiscount)=Remise sur l'article +(SalesDiscount)=Remise sur la vente \ No newline at end of file Modified: ofbiz/trunk/specialpurpose/pos/config/pos_it.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/config/pos_it.properties?view=diff&rev=551332&r1=551331&r2=551332 ============================================================================== --- ofbiz/trunk/specialpurpose/pos/config/pos_it.properties (original) +++ ofbiz/trunk/specialpurpose/pos/config/pos_it.properties Wed Jun 27 14:11:22 2007 @@ -69,3 +69,5 @@ draw=Cass.: term=Termine: total_report=TOTALI STAMPA +(ItemDiscount)=(Item discount) +(SalesDiscount)=(Sales discount) \ No newline at end of file Modified: ofbiz/trunk/specialpurpose/pos/config/pos_ro.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/config/pos_ro.properties?view=diff&rev=551332&r1=551331&r2=551332 ============================================================================== --- ofbiz/trunk/specialpurpose/pos/config/pos_ro.properties (original) +++ ofbiz/trunk/specialpurpose/pos/config/pos_ro.properties Wed Jun 27 14:11:22 2007 @@ -69,4 +69,5 @@ draw=Cas: term=Term: total_report=TOTAL REPORT - +(ItemDiscount)=(Item discount) +(SalesDiscount)=(Sales discount) \ No newline at end of file Modified: ofbiz/trunk/specialpurpose/pos/config/pos_zh.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/config/pos_zh.properties?view=diff&rev=551332&r1=551331&r2=551332 ============================================================================== --- ofbiz/trunk/specialpurpose/pos/config/pos_zh.properties (original) +++ ofbiz/trunk/specialpurpose/pos/config/pos_zh.properties Wed Jun 27 14:11:22 2007 @@ -69,3 +69,5 @@ draw=\u949E\u7BB1: term=\u7EC8\u7AEF: total_report=\u5408\u8BA1\u62A5\u8868 +(ItemDiscount)=(Item discount) +(SalesDiscount)=(Sales discount) \ No newline at end of file Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java?view=diff&rev=551332&r1=551331&r2=551332 ============================================================================== --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java (original) +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java Wed Jun 27 14:11:22 2007 @@ -724,8 +724,8 @@ // append the promo info XModel promo = Journal.appendNode(model, "tr", "", ""); Journal.appendNode(promo, "td", "sku", ""); - Journal.appendNode(promo, "td", "desc", UtilProperties.getMessage("pos","(adjustment)",defaultLocale)); - Journal.appendNode(promo, "td", "qty", "-"); + Journal.appendNode(promo, "td", "desc", UtilProperties.getMessage("pos","(ItemDiscount)",defaultLocale)); + Journal.appendNode(promo, "td", "qty", ""); Journal.appendNode(promo, "td", "price", UtilFormatOut.formatPrice(adjustment)); } } @@ -736,18 +736,33 @@ if (cart != null) { double taxAmount = cart.getTotalSalesTax(); double total = cart.getGrandTotal(); + List adjustments = cart.getAdjustments(); + + if (adjustments != null && adjustments.size() > 0) { + Iterator iter = adjustments.iterator(); + while(iter.hasNext()){ + GenericValue orderAdjustment = (GenericValue) iter.next(); + XModel adjustmentLine = Journal.appendNode(model, "tr", "", ""); + Journal.appendNode(adjustmentLine, "td", "sku", ""); + Journal.appendNode(adjustmentLine, "td", "desc", + UtilProperties.getMessage("pos", "(SalesDiscount)",defaultLocale)); + Journal.appendNode(adjustmentLine, "td", "qty", ""); + Journal.appendNode(adjustmentLine, "td", "price", + UtilFormatOut.formatPrice(orderAdjustment.getDouble("amount"))); + } + } XModel taxLine = Journal.appendNode(model, "tr", "", ""); Journal.appendNode(taxLine, "td", "sku", ""); Journal.appendNode(taxLine, "td", "desc", UtilProperties.getMessage("pos","Sales_Tax",defaultLocale)); - Journal.appendNode(taxLine, "td", "qty", "-"); + Journal.appendNode(taxLine, "td", "qty", ""); Journal.appendNode(taxLine, "td", "price", UtilFormatOut.formatPrice(taxAmount)); XModel totalLine = Journal.appendNode(model, "tr", "", ""); Journal.appendNode(totalLine, "td", "sku", ""); Journal.appendNode(totalLine, "td", "desc", UtilProperties.getMessage("pos","Grand_Total",defaultLocale)); - Journal.appendNode(totalLine, "td", "qty", "-"); + Journal.appendNode(totalLine, "td", "qty", ""); Journal.appendNode(totalLine, "td", "price", UtilFormatOut.formatPrice(total)); } } |
Free forum by Nabble | Edit this page |