Implement an automatic GL posting service for payment applications
------------------------------------------------------------------ Key: OFBIZ-1492 URL: https://issues.apache.org/jira/browse/OFBIZ-1492 Project: OFBiz Issue Type: Sub-task Components: accounting Affects Versions: SVN trunk Reporter: Jacopo Cappellato Name of the service: "createAcctgTransAndEntriesForPaymentApplication" or similar Service definition: <service name="createAcctgTransAndEntriesForPaymentApplication" engine="simple" auth="true" location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForPaymentApplication"> <description>Create an accounting transaction for a payment application</description> <attribute name="paymentApplicationId" type="String" mode="IN" optional="false"/> <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/> </service> 1) get the PaymentApplication and Payment records if (UtilAccounting.isReceipt(payment)) then { 2) prepare the debit AcctgTransEntry entry: debitCreditFlag=D organizationPartyId=payment.partyIdTo partyId=payment.partyIdFrom roleTypeId=BILL_TO_CUSTOMER origAmount=paymentApplication.amountApplied origCurrencyUomId=payment.currencyUomId glAccountId=payment.overrideGlAccountId glAccountTypeId=get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId and use the PaymentGlAccountTypeMap.glAccountTypeId 3) prepare the credit AcctgTransEntry entry: debitCreditFlag=C organizationPartyId=payment.partyIdTo partyId=payment.partyIdFrom roleTypeId=BILL_TO_CUSTOMER origAmount=paymentApplication.amountApplied origCurrencyUomId=payment.currencyUomId glAccountTypeId=ACCOUNTS_RECEIVABLE } else { 4) prepare the credit AcctgTransEntry entry: debitCreditFlag=C organizationPartyId=payment.partyIdFrom partyId=payment.partyIdTo roleTypeId=BILL_FROM_VENDOR origAmount=paymentApplication.amountApplied origCurrencyUomId=payment.currencyUomId glAccountId=payment.overrideGlAccountId glAccountTypeId=get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId and use the PaymentGlAccountTypeMap.glAccountTypeId 5) prepare the debit AcctgTransEntry entry: debitCreditFlag=D organizationPartyId=payment.partyIdFrom partyId=payment.partyIdTo roleTypeId=BILL_FROM_VENDOR origAmount=paymentApplication.amountApplied origCurrencyUomId=payment.currencyUomId glAccountTypeId=ACCOUNTS_PAYABLE } 6) call the createAcctgTransAndEntries with the following fields acctgTransEntries= entries prepared at points 2 and 3 or 4 and 5 acctgTransTypeId="PAYMENT_APPL" paymentId=paymentApplication.paymentId invoiceId=paymentApplication.invoiceId if (UtilAccounting.isReceipt(payment)) then { partyId=payment.partyIdFrom roleTypeId=BILL_TO_CUSTOMER } else{ partyId=payment.partyIdTo roleTypeId=BILL_FROM_VENDOR } The service is triggered by the following seca: <eca service="createPaymentApplication" event="commit"> <condition field-name="invoiceId" operator="is-not-empty" /> <action service="createAcctgTransAndEntriesForPaymentApplication" mode="sync"/> </eca> -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
[ https://issues.apache.org/jira/browse/OFBIZ-1492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] SACHIN CHOURASIYA updated OFBIZ-1492: ------------------------------------- Attachment: ofBiz1492.patch Implemented an automatic GL posting service for payment applications > Implement an automatic GL posting service for payment applications > ------------------------------------------------------------------ > > Key: OFBIZ-1492 > URL: https://issues.apache.org/jira/browse/OFBIZ-1492 > Project: OFBiz > Issue Type: Sub-task > Components: accounting > Affects Versions: SVN trunk > Reporter: Jacopo Cappellato > Attachments: ofBiz1492.patch > > > Name of the service: "createAcctgTransAndEntriesForPaymentApplication" or similar > Service definition: > <service name="createAcctgTransAndEntriesForPaymentApplication" engine="simple" auth="true" > location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForPaymentApplication"> > <description>Create an accounting transaction for a payment application</description> > <attribute name="paymentApplicationId" type="String" mode="IN" optional="false"/> > <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/> > </service> > 1) get the PaymentApplication and Payment records > if (UtilAccounting.isReceipt(payment)) then { > 2) prepare the debit AcctgTransEntry entry: > debitCreditFlag=D > organizationPartyId=payment.partyIdTo > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountId=payment.overrideGlAccountId > glAccountTypeId=get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId > and use the PaymentGlAccountTypeMap.glAccountTypeId > 3) prepare the credit AcctgTransEntry entry: > debitCreditFlag=C > organizationPartyId=payment.partyIdTo > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountTypeId=ACCOUNTS_RECEIVABLE > } > else { > 4) prepare the credit AcctgTransEntry entry: > debitCreditFlag=C > organizationPartyId=payment.partyIdFrom > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountId=payment.overrideGlAccountId > glAccountTypeId=get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId > and use the PaymentGlAccountTypeMap.glAccountTypeId > 5) prepare the debit AcctgTransEntry entry: > debitCreditFlag=D > organizationPartyId=payment.partyIdFrom > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountTypeId=ACCOUNTS_PAYABLE > } > 6) call the createAcctgTransAndEntries with the following fields > acctgTransEntries= entries prepared at points 2 and 3 or 4 and 5 > acctgTransTypeId="PAYMENT_APPL" > paymentId=paymentApplication.paymentId > invoiceId=paymentApplication.invoiceId > if (UtilAccounting.isReceipt(payment)) then { > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > } else{ > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > } > The service is triggered by the following seca: > <eca service="createPaymentApplication" event="commit"> > <condition field-name="invoiceId" operator="is-not-empty" /> > <action service="createAcctgTransAndEntriesForPaymentApplication" mode="sync"/> > </eca> -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549278 ] Pranay Pandey commented on OFBIZ-1492: -------------------------------------- Sachin, I have reviewed your patch according to the description given in the issue and i think it is fullfilling the requirement. --- Pranay > Implement an automatic GL posting service for payment applications > ------------------------------------------------------------------ > > Key: OFBIZ-1492 > URL: https://issues.apache.org/jira/browse/OFBIZ-1492 > Project: OFBiz > Issue Type: Sub-task > Components: accounting > Affects Versions: SVN trunk > Reporter: Jacopo Cappellato > Attachments: ofBiz1492.patch > > > Name of the service: "createAcctgTransAndEntriesForPaymentApplication" or similar > Service definition: > <service name="createAcctgTransAndEntriesForPaymentApplication" engine="simple" auth="true" > location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForPaymentApplication"> > <description>Create an accounting transaction for a payment application</description> > <attribute name="paymentApplicationId" type="String" mode="IN" optional="false"/> > <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/> > </service> > 1) get the PaymentApplication and Payment records > if (UtilAccounting.isReceipt(payment)) then { > 2) prepare the debit AcctgTransEntry entry: > debitCreditFlag=D > organizationPartyId=payment.partyIdTo > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountId=payment.overrideGlAccountId > glAccountTypeId=get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId > and use the PaymentGlAccountTypeMap.glAccountTypeId > 3) prepare the credit AcctgTransEntry entry: > debitCreditFlag=C > organizationPartyId=payment.partyIdTo > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountTypeId=ACCOUNTS_RECEIVABLE > } > else { > 4) prepare the credit AcctgTransEntry entry: > debitCreditFlag=C > organizationPartyId=payment.partyIdFrom > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountId=payment.overrideGlAccountId > glAccountTypeId=get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId > and use the PaymentGlAccountTypeMap.glAccountTypeId > 5) prepare the debit AcctgTransEntry entry: > debitCreditFlag=D > organizationPartyId=payment.partyIdFrom > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountTypeId=ACCOUNTS_PAYABLE > } > 6) call the createAcctgTransAndEntries with the following fields > acctgTransEntries= entries prepared at points 2 and 3 or 4 and 5 > acctgTransTypeId="PAYMENT_APPL" > paymentId=paymentApplication.paymentId > invoiceId=paymentApplication.invoiceId > if (UtilAccounting.isReceipt(payment)) then { > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > } else{ > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > } > The service is triggered by the following seca: > <eca service="createPaymentApplication" event="commit"> > <condition field-name="invoiceId" operator="is-not-empty" /> > <action service="createAcctgTransAndEntriesForPaymentApplication" mode="sync"/> > </eca> -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacopo Cappellato updated OFBIZ-1492: ------------------------------------- Summary: Auto posting: Implement an automatic GL posting service for payment applications (was: Implement an automatic GL posting service for payment applications) > Auto posting: Implement an automatic GL posting service for payment applications > -------------------------------------------------------------------------------- > > Key: OFBIZ-1492 > URL: https://issues.apache.org/jira/browse/OFBIZ-1492 > Project: OFBiz > Issue Type: Sub-task > Components: accounting > Affects Versions: SVN trunk > Reporter: Jacopo Cappellato > Attachments: ofBiz1492.patch > > > Name of the service: "createAcctgTransAndEntriesForPaymentApplication" or similar > Service definition: > <service name="createAcctgTransAndEntriesForPaymentApplication" engine="simple" auth="true" > location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForPaymentApplication"> > <description>Create an accounting transaction for a payment application</description> > <attribute name="paymentApplicationId" type="String" mode="IN" optional="false"/> > <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/> > </service> > 1) get the PaymentApplication and Payment records > if (UtilAccounting.isReceipt(payment)) then { > 2) prepare the debit AcctgTransEntry entry: > debitCreditFlag=D > organizationPartyId=payment.partyIdTo > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountId=payment.overrideGlAccountId > glAccountTypeId=get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId > and use the PaymentGlAccountTypeMap.glAccountTypeId > 3) prepare the credit AcctgTransEntry entry: > debitCreditFlag=C > organizationPartyId=payment.partyIdTo > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountTypeId=ACCOUNTS_RECEIVABLE > } > else { > 4) prepare the credit AcctgTransEntry entry: > debitCreditFlag=C > organizationPartyId=payment.partyIdFrom > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountId=payment.overrideGlAccountId > glAccountTypeId=get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId > and use the PaymentGlAccountTypeMap.glAccountTypeId > 5) prepare the debit AcctgTransEntry entry: > debitCreditFlag=D > organizationPartyId=payment.partyIdFrom > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountTypeId=ACCOUNTS_PAYABLE > } > 6) call the createAcctgTransAndEntries with the following fields > acctgTransEntries= entries prepared at points 2 and 3 or 4 and 5 > acctgTransTypeId="PAYMENT_APPL" > paymentId=paymentApplication.paymentId > invoiceId=paymentApplication.invoiceId > if (UtilAccounting.isReceipt(payment)) then { > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > } else{ > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > } > The service is triggered by the following seca: > <eca service="createPaymentApplication" event="commit"> > <condition field-name="invoiceId" operator="is-not-empty" /> > <action service="createAcctgTransAndEntriesForPaymentApplication" mode="sync"/> > </eca> -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ashish Vijaywargiya reassigned OFBIZ-1492: ------------------------------------------ Assignee: Ashish Vijaywargiya > Auto posting: Implement an automatic GL posting service for payment applications > -------------------------------------------------------------------------------- > > Key: OFBIZ-1492 > URL: https://issues.apache.org/jira/browse/OFBIZ-1492 > Project: OFBiz > Issue Type: Sub-task > Components: accounting > Affects Versions: SVN trunk > Reporter: Jacopo Cappellato > Assignee: Ashish Vijaywargiya > Attachments: ofBiz1492.patch > > > Name of the service: "createAcctgTransAndEntriesForPaymentApplication" or similar > Service definition: > <service name="createAcctgTransAndEntriesForPaymentApplication" engine="simple" auth="true" > location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForPaymentApplication"> > <description>Create an accounting transaction for a payment application</description> > <attribute name="paymentApplicationId" type="String" mode="IN" optional="false"/> > <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/> > </service> > 1) get the PaymentApplication and Payment records > if (UtilAccounting.isReceipt(payment)) then { > 2) prepare the debit AcctgTransEntry entry: > debitCreditFlag=D > organizationPartyId=payment.partyIdTo > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountId=payment.overrideGlAccountId > glAccountTypeId=get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId > and use the PaymentGlAccountTypeMap.glAccountTypeId > 3) prepare the credit AcctgTransEntry entry: > debitCreditFlag=C > organizationPartyId=payment.partyIdTo > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountTypeId=ACCOUNTS_RECEIVABLE > } > else { > 4) prepare the credit AcctgTransEntry entry: > debitCreditFlag=C > organizationPartyId=payment.partyIdFrom > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountId=payment.overrideGlAccountId > glAccountTypeId=get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId > and use the PaymentGlAccountTypeMap.glAccountTypeId > 5) prepare the debit AcctgTransEntry entry: > debitCreditFlag=D > organizationPartyId=payment.partyIdFrom > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountTypeId=ACCOUNTS_PAYABLE > } > 6) call the createAcctgTransAndEntries with the following fields > acctgTransEntries= entries prepared at points 2 and 3 or 4 and 5 > acctgTransTypeId="PAYMENT_APPL" > paymentId=paymentApplication.paymentId > invoiceId=paymentApplication.invoiceId > if (UtilAccounting.isReceipt(payment)) then { > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > } else{ > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > } > The service is triggered by the following seca: > <eca service="createPaymentApplication" event="commit"> > <condition field-name="invoiceId" operator="is-not-empty" /> > <action service="createAcctgTransAndEntriesForPaymentApplication" mode="sync"/> > </eca> -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556207#action_12556207 ] Sumit Porwal commented on OFBIZ-1492: ------------------------------------- Hi All, I have reviewed and tested the attached patch, its working properly. > Auto posting: Implement an automatic GL posting service for payment applications > -------------------------------------------------------------------------------- > > Key: OFBIZ-1492 > URL: https://issues.apache.org/jira/browse/OFBIZ-1492 > Project: OFBiz > Issue Type: Sub-task > Components: accounting > Affects Versions: SVN trunk > Reporter: Jacopo Cappellato > Assignee: Ashish Vijaywargiya > Attachments: ofBiz1492.patch > > > Name of the service: "createAcctgTransAndEntriesForPaymentApplication" or similar > Service definition: > <service name="createAcctgTransAndEntriesForPaymentApplication" engine="simple" auth="true" > location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForPaymentApplication"> > <description>Create an accounting transaction for a payment application</description> > <attribute name="paymentApplicationId" type="String" mode="IN" optional="false"/> > <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/> > </service> > 1) get the PaymentApplication and Payment records > if (UtilAccounting.isReceipt(payment)) then { > 2) prepare the debit AcctgTransEntry entry: > debitCreditFlag=D > organizationPartyId=payment.partyIdTo > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountId=payment.overrideGlAccountId > glAccountTypeId=get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId > and use the PaymentGlAccountTypeMap.glAccountTypeId > 3) prepare the credit AcctgTransEntry entry: > debitCreditFlag=C > organizationPartyId=payment.partyIdTo > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountTypeId=ACCOUNTS_RECEIVABLE > } > else { > 4) prepare the credit AcctgTransEntry entry: > debitCreditFlag=C > organizationPartyId=payment.partyIdFrom > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountId=payment.overrideGlAccountId > glAccountTypeId=get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId > and use the PaymentGlAccountTypeMap.glAccountTypeId > 5) prepare the debit AcctgTransEntry entry: > debitCreditFlag=D > organizationPartyId=payment.partyIdFrom > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountTypeId=ACCOUNTS_PAYABLE > } > 6) call the createAcctgTransAndEntries with the following fields > acctgTransEntries= entries prepared at points 2 and 3 or 4 and 5 > acctgTransTypeId="PAYMENT_APPL" > paymentId=paymentApplication.paymentId > invoiceId=paymentApplication.invoiceId > if (UtilAccounting.isReceipt(payment)) then { > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > } else{ > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > } > The service is triggered by the following seca: > <eca service="createPaymentApplication" event="commit"> > <condition field-name="invoiceId" operator="is-not-empty" /> > <action service="createAcctgTransAndEntriesForPaymentApplication" mode="sync"/> > </eca> -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ashish Vijaywargiya closed OFBIZ-1492. -------------------------------------- Resolution: Fixed Thanks to all contributed in this work. Patch is in rev # 609252. -- Ashish > Auto posting: Implement an automatic GL posting service for payment applications > -------------------------------------------------------------------------------- > > Key: OFBIZ-1492 > URL: https://issues.apache.org/jira/browse/OFBIZ-1492 > Project: OFBiz > Issue Type: Sub-task > Components: accounting > Affects Versions: SVN trunk > Reporter: Jacopo Cappellato > Assignee: Ashish Vijaywargiya > Attachments: ofBiz1492.patch > > > Name of the service: "createAcctgTransAndEntriesForPaymentApplication" or similar > Service definition: > <service name="createAcctgTransAndEntriesForPaymentApplication" engine="simple" auth="true" > location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForPaymentApplication"> > <description>Create an accounting transaction for a payment application</description> > <attribute name="paymentApplicationId" type="String" mode="IN" optional="false"/> > <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/> > </service> > 1) get the PaymentApplication and Payment records > if (UtilAccounting.isReceipt(payment)) then { > 2) prepare the debit AcctgTransEntry entry: > debitCreditFlag=D > organizationPartyId=payment.partyIdTo > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountId=payment.overrideGlAccountId > glAccountTypeId=get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId > and use the PaymentGlAccountTypeMap.glAccountTypeId > 3) prepare the credit AcctgTransEntry entry: > debitCreditFlag=C > organizationPartyId=payment.partyIdTo > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountTypeId=ACCOUNTS_RECEIVABLE > } > else { > 4) prepare the credit AcctgTransEntry entry: > debitCreditFlag=C > organizationPartyId=payment.partyIdFrom > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountId=payment.overrideGlAccountId > glAccountTypeId=get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId > and use the PaymentGlAccountTypeMap.glAccountTypeId > 5) prepare the debit AcctgTransEntry entry: > debitCreditFlag=D > organizationPartyId=payment.partyIdFrom > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > origAmount=paymentApplication.amountApplied > origCurrencyUomId=payment.currencyUomId > glAccountTypeId=ACCOUNTS_PAYABLE > } > 6) call the createAcctgTransAndEntries with the following fields > acctgTransEntries= entries prepared at points 2 and 3 or 4 and 5 > acctgTransTypeId="PAYMENT_APPL" > paymentId=paymentApplication.paymentId > invoiceId=paymentApplication.invoiceId > if (UtilAccounting.isReceipt(payment)) then { > partyId=payment.partyIdFrom > roleTypeId=BILL_TO_CUSTOMER > } else{ > partyId=payment.partyIdTo > roleTypeId=BILL_FROM_VENDOR > } > The service is triggered by the following seca: > <eca service="createPaymentApplication" event="commit"> > <condition field-name="invoiceId" operator="is-not-empty" /> > <action service="createAcctgTransAndEntriesForPaymentApplication" mode="sync"/> > </eca> -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
Free forum by Nabble | Edit this page |