This is an automated email from the ASF dual-hosted git repository. mbrohl pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push: new 785be8a Fixed: Financial account transaction (OFBIZ-10308) 785be8a is described below commit 785be8abe4a292d761bfb5bba967989ab7d37fe4 Author: Wiebke Pätzold <wiebke.paetz...@ecomify.de> AuthorDate: Fri Feb 12 11:19:32 2021 +0100 Fixed: Financial account transaction (OFBIZ-10308) Fixes the direction of some accounting transactions. Thanks Ingo Wolfmayr for the patch --- .../minilang/finaccount/FinAccountGlPostServices.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/applications/accounting/minilang/finaccount/FinAccountGlPostServices.xml b/applications/accounting/minilang/finaccount/FinAccountGlPostServices.xml index 0f969d6..ecbe0de 100644 --- a/applications/accounting/minilang/finaccount/FinAccountGlPostServices.xml +++ b/applications/accounting/minilang/finaccount/FinAccountGlPostServices.xml @@ -78,8 +78,8 @@ under the License. <!-- TODO: somehow determine if this is an order placed against the account or some other type of withdrawal --> <!-- TODO: handle order placed against (paid for with) the account --> - <set field="quickCreateAcctgTransAndEntries.debitGlAccountId" from-field="glAccountId"/> - <set field="quickCreateAcctgTransAndEntries.creditGlAccountId" from-field="parameters.glAccountId"/> + <set field="quickCreateAcctgTransAndEntries.debitGlAccountId" from-field="parameters.glAccountId"/> + <set field="quickCreateAcctgTransAndEntries.creditGlAccountId" from-field="glAccountId"/> <set field="quickCreateAcctgTransAndEntries.acctgTransTypeId" value="PAYMENT_ACCTG_TRANS"/> </then> </else-if> @@ -89,6 +89,12 @@ under the License. <!-- if positive will go to one account for write-off, if negative will go to another account for a fee --> <!-- these will reverse depending on positive/negative amount --> <if-compare field="finAccountTrans.amount" operator="less" value="0"> + <calculate field="quickCreateAcctgTransAndEntries.amount" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}"> + <calcop operator="multiply"> + <calcop operator="get" field="quickCreateAcctgTransAndEntries.amount"/> + <number value="-1"/> + </calcop> + </calculate> <set field="quickCreateAcctgTransAndEntries.debitGlAccountId" from-field="parameters.glAccountId"/> <set field="quickCreateAcctgTransAndEntries.creditGlAccountId" from-field="glAccountId"/> <set field="quickCreateAcctgTransAndEntries.acctgTransTypeId" value="OUTGOING_PAYMENT"/>