Author: apatel
Date: Sat Jul 25 09:37:39 2009 New Revision: 797731 URL: http://svn.apache.org/viewvc?rev=797731&view=rev Log: Show currency with running total. Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml ofbiz/trunk/applications/accounting/servicedef/services_payment.xml Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml?rev=797731&r1=797730&r2=797731&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml (original) +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml Sat Jul 25 09:37:39 2009 @@ -636,7 +636,7 @@ <simple-method method-name="getInvoiceRunningTotal" short-description="calculate running total for Invoices"> <set field="invoiceIds" from-field="parameters.invoiceIds"/> - <set field="invoiceRunningTotal" type="BigDecimal" value="0"/> + <set field="runningTotal" type="BigDecimal" value="0"/> <entity-condition entity-name="Invoice" list="invoiceList"> <condition-expr field-name="invoiceId" operator="in" from-field="invoiceIds"/> </entity-condition> @@ -646,8 +646,17 @@ <result-to-field result-name="invoicePaymentInfoList"/> </call-service> <first-from-list list="invoicePaymentInfoList" entry="invoicePaymentInfo"/> - <set field="invoiceRunningTotal" value="${invoiceRunningTotal + invoicePaymentInfo.outstandingAmount}" type="BigDecimal"/> + <set field="runningTotal" value="${runningTotal + invoicePaymentInfo.outstandingAmount}" type="BigDecimal"/> </iterate> + <set-service-fields service-name="getPartyAccountingPreferences" map="parameters" to-map="getPartyAccountingPreferencesMap"/> + <call-service service-name="getPartyAccountingPreferences" in-map-name="getPartyAccountingPreferencesMap"> + <result-to-field result-name="partyAccountingPreference"/> + </call-service> + <set field="currencyUomId" from-field="partyAccountingPreference.baseCurrencyUomId"/> + <if-empty field="currencyUomId"> + <property-to-field resource="general" property="currency.uom.id.default" field="currencyUomId"/> + </if-empty> + <set field="invoiceRunningTotal" value="${groovy:org.ofbiz.base.util.UtilFormatOut.formatCurrency(runningTotal, currencyUomId, parameters.locale)}"/> <field-to-result field="invoiceRunningTotal"/> </simple-method> Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml?rev=797731&r1=797730&r2=797731&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml (original) +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml Sat Jul 25 09:37:39 2009 @@ -445,13 +445,22 @@ <simple-method method-name="getPaymentRunningTotal" short-description="calculate running total for payments"> <set field="paymentIds" from-field="parameters.paymentIds"/> - <set field="paymentRunningTotal" type="BigDecimal" value="0"/> + <set field="runningTotal" type="BigDecimal" value="0"/> <entity-condition entity-name="Payment" list="payments"> <condition-expr field-name="paymentId" operator="in" from-field="paymentIds"/> </entity-condition> <iterate list="payments" entry="payment"> - <set field="paymentRunningTotal" value="${paymentRunningTotal + payment.amount}" type="BigDecimal"/> + <set field="runningTotal" value="${runningTotal + payment.amount}" type="BigDecimal"/> </iterate> + <set-service-fields service-name="getPartyAccountingPreferences" map="parameters" to-map="getPartyAccountingPreferencesMap"/> + <call-service service-name="getPartyAccountingPreferences" in-map-name="getPartyAccountingPreferencesMap"> + <result-to-field result-name="partyAccountingPreference"/> + </call-service> + <set field="currencyUomId" from-field="partyAccountingPreference.baseCurrencyUomId"/> + <if-empty field="currencyUomId"> + <property-to-field resource="general" property="currency.uom.id.default" field="currencyUomId"/> + </if-empty> + <set field="paymentRunningTotal" value="${groovy:org.ofbiz.base.util.UtilFormatOut.formatCurrency(runningTotal, currencyUomId, parameters.locale)}"/> <field-to-result field="paymentRunningTotal"/> </simple-method> <simple-method method-name="cancelPaymentBatch" short-description="cancel payment batch"> Modified: ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml?rev=797731&r1=797730&r2=797731&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml (original) +++ ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml Sat Jul 25 09:37:39 2009 @@ -303,7 +303,8 @@ location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml" invoke="getInvoiceRunningTotal" auth="true"> <description>calculate running total for selected Invoices</description> <attribute name="invoiceIds" type="List" mode="IN" optional="false"/> - <attribute name="invoiceRunningTotal" type="BigDecimal" mode="OUT" optional="false"/> + <attribute name="organizationPartyId" type="String" mode="IN" optional="true"/> + <attribute name="invoiceRunningTotal" type="String" mode="OUT" optional="false"/> </service> <service name="getInvoicesFilterByAssocType" engine="simple" Modified: ofbiz/trunk/applications/accounting/servicedef/services_payment.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_payment.xml?rev=797731&r1=797730&r2=797731&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/servicedef/services_payment.xml (original) +++ ofbiz/trunk/applications/accounting/servicedef/services_payment.xml Sat Jul 25 09:37:39 2009 @@ -152,7 +152,8 @@ location="component://accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml" invoke="getPaymentRunningTotal" auth="true"> <description>calculate running total for payments</description> <attribute name="paymentIds" type="List" mode="IN" optional="false"/> - <attribute name="paymentRunningTotal" type="BigDecimal" mode="OUT" optional="false"/> + <attribute name="organizationPartyId" type="String" mode="IN" optional="true"/> + <attribute name="paymentRunningTotal" type="String" mode="OUT" optional="false"/> </service> <service name="cancelPaymentBatch" engine="simple" location="component://accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml" invoke="cancelPaymentBatch" auth="true"> |
Free forum by Nabble | Edit this page |