[ofbiz-framework] branch release18.12 updated: Fixed: Financial account transaction (OFBIZ-10308)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch release18.12 updated: Fixed: Financial account transaction (OFBIZ-10308)

mbrohl
This is an automated email from the ASF dual-hosted git repository.

mbrohl pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release18.12 by this push:
     new 98faab3  Fixed: Financial account transaction (OFBIZ-10308)
98faab3 is described below

commit 98faab300113d0b6335dd2e94cb140579a4700ae
Author: Wiebke Pätzold <[hidden email]>
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"/>