Completed support to foreign exchange rate gain/losses when a purchase invoice is posted at a different time of the receipt.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1658662 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacopo Cappellato
2015-02-10 10:44:02 +00:00
parent 56894499a8
commit 441fa3a2be
@@ -321,6 +321,7 @@ under the License.
<simple-method method-name="createAcctgTransAndEntries" short-description="Verifies and posts a set of AcctgTransEntries">
<!-- retrieve ledger rounding properties -->
<call-simple-method method-name="getGlArithmeticSettingsInline"/>
<set-service-fields service-name="createAcctgTrans" map="parameters" to-map="createAcctgTransParams"/>
<!-- first loop through and make sure all the entries are valid -->
<iterate list="parameters.acctgTransEntries" entry="acctgTransEntry">
@@ -352,7 +353,10 @@ under the License.
<set field="convertUomInMap.originalValue" from-field="acctgTransEntry.origAmount"/>
<set field="convertUomInMap.uomId" from-field="acctgTransEntry.origCurrencyUomId"/>
<set field="convertUomInMap.uomIdTo" from-field="acctgTransEntry.currencyUomId"/>
<!-- TODO: set the optional asOfDate input parameter -->
<if-not-empty field="createAcctgTransParams.transactionDate">
<!-- set the optional asOfDate input parameter -->
<set field="convertUomInMap.asOfDate" from-field="createAcctgTransParams.transactionDate"/>
</if-not-empty>
<call-service service-name="convertUom" in-map-name="convertUomInMap">
<result-to-field result-name="convertedValue" field="acctgTransEntry.amount"/>
</call-service>
@@ -397,7 +401,6 @@ under the License.
<if-not-empty field="normalizedAcctgTransEntries">
<!-- now do the posting. First, create the AcctgTrans entity -->
<set-service-fields service-name="createAcctgTrans" map="parameters" to-map="createAcctgTransParams"/>
<if-empty field="createAcctgTransParams.transactionDate">
<now-timestamp field="createAcctgTransParams.transactionDate"/>
</if-empty>
@@ -2171,6 +2174,7 @@ under the License.
<set field="createAcctgTransAndEntriesInMap.invoiceId" from-field="invoice.invoiceId"/>
<set field="createAcctgTransAndEntriesInMap.partyId" from-field="invoice.partyIdFrom"/>
<set field="createAcctgTransAndEntriesInMap.roleTypeId" value="BILL_FROM_VENDOR"/>
<set field="createAcctgTransAndEntriesInMap.transactionDate" from-field="invoice.invoiceDate"/>
<set field="createAcctgTransAndEntriesInMap.acctgTransEntries" from-field="acctgTransEntries"/>
<call-service service-name="createAcctgTransAndEntries" in-map-name="createAcctgTransAndEntriesInMap">
<result-to-field result-name="acctgTransId"/>