This is an automated email from the ASF dual-hosted git repository.
pawan pushed a commit to branch release18.12 in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git The following commit(s) were added to refs/heads/release18.12 by this push: new ca08d3f Fixed: service 'loadSalesOrderItemFact' has hard coded currencyUomId (OFBIZ-11033) ca08d3f is described below commit ca08d3f8bb6774956434349c6922c3ea04c0851e Author: Pawan Verma <[hidden email]> AuthorDate: Thu Jan 30 18:55:01 2020 +0530 Fixed: service 'loadSalesOrderItemFact' has hard coded currencyUomId (OFBIZ-11033) Used PartyAccountingPreference.baseCurrencyUomId instead of hard coded USD. Thanks: Pierre Smits for your contribution. --- bi/minilang/FactServices.xml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/bi/minilang/FactServices.xml b/bi/minilang/FactServices.xml index 3993573..408b93c 100644 --- a/bi/minilang/FactServices.xml +++ b/bi/minilang/FactServices.xml @@ -354,6 +354,16 @@ under the License. <!-- =============== --> <!-- facts handling --> <!-- =============== --> + <script>groovy: + import org.apache.ofbiz.order.order.OrderReadHelper + + orderReadHelper = new OrderReadHelper(orderHeader) + billFromParty = orderReadHelper.getBillFromParty() + </script> + <set field="partyAccountingPreferencesCallMap.organizationPartyId" from-field="billFromParty.partyId"/> + <call-service service-name="getPartyAccountingPreferences" in-map-name="partyAccountingPreferencesCallMap"> + <result-to-field result-name="partyAccountingPreference" field="accPref"/> + </call-service> <set field="fact.quantity" from-field="orderItem.quantity" type="BigDecimal"/> <set field="fact.extGrossAmount" value="0" type="BigDecimal"/> <set field="fact.extGrossCost" value="0" type="BigDecimal"/> @@ -374,7 +384,7 @@ under the License. <!-- extGrossAmount --> <set field="convertUomCurrencyMap.uomId" from-field="orderHeader.currencyUom"/> - <set field="convertUomCurrencyMap.uomIdTo" value="USD"/> + <set field="convertUomCurrencyMap.uomIdTo" from-field="accPref.baseCurrencyUomId"/> <set field="convertUomCurrencyMap.nowDate" from-field="orderStatus.statusDatetime"/> <call-service service-name="convertUomCurrency" in-map-name="convertUomCurrencyMap"> <result-to-field result-name="conversionFactor" field="exchangeRate"/> @@ -406,7 +416,7 @@ under the License. <first-from-list list="costs" entry="cost"/> <set field="convertUomCurrencyMap.uomId" from-field="cost.currencyUomId"/> - <set field="convertUomCurrencyMap.uomIdTo" value="USD"/> + <set field="convertUomCurrencyMap.uomIdTo" from-field="accPref.baseCurrencyUomId"/> <set field="convertUomCurrencyMap.nowDate" from-field="orderStatus.statusDatetime"/> <call-service service-name="convertUomCurrency" in-map-name="convertUomCurrencyMap"> <result-to-field result-name="conversionFactor" field="exchangeRate"/> @@ -492,7 +502,7 @@ under the License. </iterate> <if-compare field="countGS" operator="equals" value="0"> <set field="convertUomCurrencyMap.uomId" from-field="orderHeader.currencyUom"/> - <set field="convertUomCurrencyMap.uomIdTo" value="USD"/> + <set field="convertUomCurrencyMap.uomIdTo" from-field="accPref.baseCurrencyUomId"/> <set field="convertUomCurrencyMap.nowDate" from-field="orderStatus.statusDatetime"/> <call-service service-name="convertUomCurrency" in-map-name="convertUomCurrencyMap"> <result-to-field result-name="conversionFactor" field="exchangeRate"/> @@ -555,7 +565,7 @@ under the License. </calculate> <set field="convertUomCurrencyMap.uomId" from-field="orderHeader.currencyUom"/> - <set field="convertUomCurrencyMap.uomIdTo" value="USD"/> + <set field="convertUomCurrencyMap.uomIdTo" from-field="accPref.baseCurrencyUomId"/> <set field="convertUomCurrencyMap.nowDate" from-field="orderStatus.statusDatetime"/> <call-service service-name="convertUomCurrency" in-map-name="convertUomCurrencyMap"> <result-to-field result-name="conversionFactor" field="exchangeRate"/> |
Free forum by Nabble | Edit this page |