Author: bibryam
Date: Thu Feb 5 08:52:24 2009 New Revision: 741049 URL: http://svn.apache.org/viewvc?rev=741049&view=rev Log: Changed Double parameters to BigDecimal in convertUom and convertUomCustom services. Modified: ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml ofbiz/trunk/framework/common/servicedef/services.xml ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/actions/ConvertInvoiceCurrency.groovy ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/actions/ConvertInvoiceCurrency.groovy Modified: ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml?rev=741049&r1=741048&r2=741049&view=diff ============================================================================== --- ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml (original) +++ ofbiz/trunk/framework/common/script/org/ofbiz/common/CommonServices.xml Thu Feb 5 08:52:24 2009 @@ -132,7 +132,7 @@ <log level="verbose" message="Custom UoM conversion returning convertedValue=${convertedValue}"/> <else> <!-- not custom conversion --> <!-- do the conversion --> - <calculate field="convertedValue" type="Double" decimal-scale="15"> + <calculate field="convertedValue" type="BigDecimal" decimal-scale="15"> <calcop operator="multiply"> <calcop operator="get" field="parameters.originalValue"/> <calcop operator="get" field="uomConversion.conversionFactor"/> @@ -144,7 +144,7 @@ <!-- round result, if UomConversion[Dated] so specifies --> <set field="roundingMode" from-field="uomConversion.roundingMode"/> <if-not-empty field="uomConversion.roundingMode"> - <calculate field="roundedValue" type="Double" decimal-scale="${uomConversion.decimalScale}" rounding-mode="${roundingMode}"> + <calculate field="roundedValue" type="BigDecimal" decimal-scale="${uomConversion.decimalScale}" rounding-mode="${roundingMode}"> <calcop operator="get" field="convertedValue"/> </calculate> <set field="convertedValue" from-field="roundedValue"/> Modified: ofbiz/trunk/framework/common/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services.xml?rev=741049&r1=741048&r2=741049&view=diff ============================================================================== --- ofbiz/trunk/framework/common/servicedef/services.xml (original) +++ ofbiz/trunk/framework/common/servicedef/services.xml Thu Feb 5 08:52:24 2009 @@ -318,18 +318,18 @@ <description>Make a unit of measure conversion, first using UomConversion, then with UomConversionDated</description> <auto-attributes include="pk" mode="IN" optional="false"/> <attribute name="asOfDate" mode="IN" type="Timestamp" optional="true"/> - <attribute name="originalValue" mode="IN" type="Double" optional="false"/> + <attribute name="originalValue" mode="IN" type="BigDecimal" optional="false"/> <attribute name="conversionParameters" mode="IN" type="Map" optional="true"/> - <attribute name="convertedValue" mode="OUT" type="Double" optional="true"/> + <attribute name="convertedValue" mode="OUT" type="BigDecimal" optional="true"/> </service> <service name="convertUomCustom" default-entity-name="UomConversion" engine="simple" location="org/ofbiz/common/CommonServices.xml" invoke="convertUomCustom" auth="false"> <description>Make a unit of measure conversion, using CustomMethod entity</description> <auto-attributes include="pk" mode="IN" optional="false"/> - <attribute name="originalValue" mode="IN" type="Double" optional="false"/> + <attribute name="originalValue" mode="IN" type="BigDecimal" optional="false"/> <attribute name="uomConversion" mode="IN" type="Map" optional="false"/> <attribute name="conversionParameters" mode="IN" type="Map" optional="true"/> - <attribute name="convertedValue" mode="OUT" type="Double" optional="true"/> + <attribute name="convertedValue" mode="OUT" type="BigDecimal" optional="true"/> </service> <service name="getFileUploadProgressStatus" engine="simple" location="org/ofbiz/common/CommonServices.xml" invoke="getFileUploadProgressStatus" auth="false"> <description>Look up progress made in File Upload process</description> Modified: ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/actions/ConvertInvoiceCurrency.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/actions/ConvertInvoiceCurrency.groovy?rev=741049&r1=741048&r2=741049&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/actions/ConvertInvoiceCurrency.groovy (original) +++ ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/actions/ConvertInvoiceCurrency.groovy Thu Feb 5 08:52:24 2009 @@ -42,12 +42,12 @@ if (currencyUomId && otherCurrency && otherCurrency != currencyUomId && !otherCurrency.equals(currencyUomId)) { result = dispatcher.runSync("convertUom", [uomId : currencyUomId, uomIdTo : otherCurrency, - originalValue : new Double("1.00"), + originalValue : BigDecimal.ONE), asOfDate : invoiceDate]); if (result.convertedValue != null) { - context.total = (org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId)).multiply(new BigDecimal(result.convertedValue.toString())).setScale(decimals, rounding); - context.amountToApply = org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId).multiply(new BigDecimal(result.convertedValue.toString())).setScale(decimals, rounding); + context.total = (org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId)).multiply((BigDecimal)result.convertedValue).setScale(decimals, rounding); + context.amountToApply = org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId).multiply((BigDecimal)result.convertedValue).setScale(decimals, rounding); context.currencyUomId = otherCurrency; } } else { Modified: ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/actions/ConvertInvoiceCurrency.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/actions/ConvertInvoiceCurrency.groovy?rev=741049&r1=741048&r2=741049&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/actions/ConvertInvoiceCurrency.groovy (original) +++ ofbiz/trunk/specialpurpose/myportal/webapp/myportal/WEB-INF/actions/ConvertInvoiceCurrency.groovy Thu Feb 5 08:52:24 2009 @@ -42,12 +42,12 @@ if (currencyUomId && otherCurrency && otherCurrency != currencyUomId && !otherCurrency.equals(currencyUomId)) { result = dispatcher.runSync("convertUom", [uomId : currencyUomId, uomIdTo : otherCurrency, - originalValue : new Double("1.00"), + originalValue : BigDecimal.ONE), asOfDate : invoiceDate]); if (result.convertedValue != null) { - context.total = (org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId)).multiply(new BigDecimal(result.convertedValue.toString())).setScale(decimals, rounding); - context.amountToApply = org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId).multiply(new BigDecimal(result.convertedValue.toString())).setScale(decimals, rounding); + context.total = (org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceTotal(delegator,invoiceId)).multiply((BigDecimal)result.convertedValue).setScale(decimals, rounding); + context.amountToApply = org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(delegator,invoiceId).multiply((BigDecimal)result.convertedValue).setScale(decimals, rounding); context.currencyUomId = otherCurrency; } } else { |
Free forum by Nabble | Edit this page |