You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Jacopo Cappellato (JIRA)" <ji...@apache.org> on 2007/12/05 15:52:43 UTC

[jira] Created: (OFBIZ-1490) Implement an automatic GL posting service for incoming payments

Implement an automatic GL posting service for incoming payments
---------------------------------------------------------------

                 Key: OFBIZ-1490
                 URL: https://issues.apache.org/jira/browse/OFBIZ-1490
             Project: OFBiz
          Issue Type: Sub-task
          Components: accounting
    Affects Versions: SVN trunk
            Reporter: Jacopo Cappellato


Name of the service: "createAcctgTransAndEntriesForIncomingPayment" or similar
Service definition:
    <service name="createAcctgTransAndEntriesForIncomingPayment" engine="simple" auth="true"
        location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForIncomingPayment">
        <description>Create an accounting transaction for a purchase invoice</description>
        <attribute name="paymentId" type="String" mode="IN" optional="false"/>
        <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
    </service>

1) get the Payment by paymentId
2) if (!UtilAccounting.isReceipt(payment)) then return; (hint: in Minilang, use the "call-class-method" operation)
3) organizationPartyId = payment.partyIdTo
4) partyId = payment.partyIdFrom and roleTypeId = "BILL_TO_CUSTOMER"
5) create an AcctgTransEntry with:
5.1) debitCreditFlag=D, glAccountTypeId: do not set for now (<!--TODO-->), origAmount=payment.amount, origCurrencyUomId=payment.currencyUomId

6) get the creditGlAccountTypeId in the following way:
6.1) get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId
6.2) creditGlAccountTypeId = PaymentGlAccountTypeMap.glAccountTypeId

7) for the credit entries: select the PaymentApplications associated to the Payment and for each one:
7.1) create a AcctgTransEntry with: debitCreditFlag=C, origAmount=paymentApplication.amountApplied, origCurrencyUomId=payment.currencyUomId, glAccountId=paymentApplication.overrideGlAccountId or (if empty) payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
7.2) amountAppliedTotal = amountAppliedTotal + paymentApplication.amountApplied
8) if ((payment.amount - amountAppliedTotal) > 0) then create another credit entry with: debitCreditFlag=C, origAmount=(payment.amount - amountAppliedTotal), origCurrencyUomId=payment.currencyUomId, glAccountId=payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId

9) call the createAcctgTransAndEntries with the following fields
9.1) acctgTransEntries prepared at points 5, 7 and 8
9.2) acctgTransTypeId="INCOMING_PAYMENT"
9.3) partyId e roleTypeId (point 4), paymentId

Add the following secas to trigger the service:

<eca service="createPayment" event="commit">
    <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
    <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
</eca>
<eca service="setPaymentStatus" event="commit">
    <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
    <condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
    <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
</eca>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OFBIZ-1490) Implement an automatic GL posting service for incoming payments

Posted by "Brajesh Patel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brajesh Patel updated OFBIZ-1490:
---------------------------------

    Attachment: Jira_issue_1490.patch

I have done work for service "createAcctgTransAndEntriesForIncomingPayment" and resolve all comment related to issue .

> Implement an automatic GL posting service for incoming payments
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-1490
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1490
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>            Assignee: Ashish Vijaywargiya
>         Attachments: Jira_issue_1490.patch, Jira_issue_1490.patch, Jira_issue_1490.patch
>
>
> Name of the service: "createAcctgTransAndEntriesForIncomingPayment" or similar
> Service definition:
>     <service name="createAcctgTransAndEntriesForIncomingPayment" engine="simple" auth="true"
>         location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForIncomingPayment">
>         <description>Create an accounting transaction for an outgoing payment</description>
>         <attribute name="paymentId" type="String" mode="IN" optional="false"/>
>         <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
>     </service>
> 1) get the Payment by paymentId
> 2) if (!UtilAccounting.isReceipt(payment)) then return; (hint: in Minilang, use the "call-class-method" operation)
> 3) organizationPartyId = payment.partyIdTo
> 4) partyId = payment.partyIdFrom and roleTypeId = "BILL_TO_CUSTOMER"
> 5) create an AcctgTransEntry with:
> 5.1) debitCreditFlag=D, glAccountTypeId: do not set for now (<!--TODO-->), origAmount=payment.amount, origCurrencyUomId=payment.currencyUomId
> 6) get the creditGlAccountTypeId in the following way:
> 6.1) get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId
> 6.2) creditGlAccountTypeId = PaymentGlAccountTypeMap.glAccountTypeId
> 7) for the credit entries: select the PaymentApplications associated to the Payment and for each one:
> 7.1) create a AcctgTransEntry with: debitCreditFlag=C, origAmount=paymentApplication.amountApplied, origCurrencyUomId=payment.currencyUomId, glAccountId=paymentApplication.overrideGlAccountId or (if empty) payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 7.2) amountAppliedTotal = amountAppliedTotal + paymentApplication.amountApplied
> 8) if ((payment.amount - amountAppliedTotal) > 0) then create another credit entry with: debitCreditFlag=C, origAmount=(payment.amount - amountAppliedTotal), origCurrencyUomId=payment.currencyUomId, glAccountId=payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 9) call the createAcctgTransAndEntries with the following fields
> 9.1) acctgTransEntries prepared at points 5, 7 and 8
> 9.2) acctgTransTypeId="INCOMING_PAYMENT"
> 9.3) partyId e roleTypeId (point 4), paymentId
> Add the following secas to trigger the service:
> <eca service="createPayment" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>
> <eca service="setPaymentStatus" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OFBIZ-1490) Implement an automatic GL posting service for incoming payments

Posted by "Brajesh Patel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brajesh Patel updated OFBIZ-1490:
---------------------------------

    Attachment:     (was: Jira_issue_1490.patch)

> Implement an automatic GL posting service for incoming payments
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-1490
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1490
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>            Assignee: Ashish Vijaywargiya
>         Attachments: Jira_issue_1490.patch, Jira_issue_1490.patch
>
>
> Name of the service: "createAcctgTransAndEntriesForIncomingPayment" or similar
> Service definition:
>     <service name="createAcctgTransAndEntriesForIncomingPayment" engine="simple" auth="true"
>         location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForIncomingPayment">
>         <description>Create an accounting transaction for an outgoing payment</description>
>         <attribute name="paymentId" type="String" mode="IN" optional="false"/>
>         <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
>     </service>
> 1) get the Payment by paymentId
> 2) if (!UtilAccounting.isReceipt(payment)) then return; (hint: in Minilang, use the "call-class-method" operation)
> 3) organizationPartyId = payment.partyIdTo
> 4) partyId = payment.partyIdFrom and roleTypeId = "BILL_TO_CUSTOMER"
> 5) create an AcctgTransEntry with:
> 5.1) debitCreditFlag=D, glAccountTypeId: do not set for now (<!--TODO-->), origAmount=payment.amount, origCurrencyUomId=payment.currencyUomId
> 6) get the creditGlAccountTypeId in the following way:
> 6.1) get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId
> 6.2) creditGlAccountTypeId = PaymentGlAccountTypeMap.glAccountTypeId
> 7) for the credit entries: select the PaymentApplications associated to the Payment and for each one:
> 7.1) create a AcctgTransEntry with: debitCreditFlag=C, origAmount=paymentApplication.amountApplied, origCurrencyUomId=payment.currencyUomId, glAccountId=paymentApplication.overrideGlAccountId or (if empty) payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 7.2) amountAppliedTotal = amountAppliedTotal + paymentApplication.amountApplied
> 8) if ((payment.amount - amountAppliedTotal) > 0) then create another credit entry with: debitCreditFlag=C, origAmount=(payment.amount - amountAppliedTotal), origCurrencyUomId=payment.currencyUomId, glAccountId=payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 9) call the createAcctgTransAndEntries with the following fields
> 9.1) acctgTransEntries prepared at points 5, 7 and 8
> 9.2) acctgTransTypeId="INCOMING_PAYMENT"
> 9.3) partyId e roleTypeId (point 4), paymentId
> Add the following secas to trigger the service:
> <eca service="createPayment" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>
> <eca service="setPaymentStatus" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OFBIZ-1490) Implement an automatic GL posting service for incoming payments

Posted by "Brajesh Patel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brajesh Patel updated OFBIZ-1490:
---------------------------------

    Attachment:     (was: Jira_issue_1490.patch)

> Implement an automatic GL posting service for incoming payments
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-1490
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1490
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>            Assignee: Ashish Vijaywargiya
>         Attachments: Jira_issue_1490.patch, Jira_issue_1490.patch
>
>
> Name of the service: "createAcctgTransAndEntriesForIncomingPayment" or similar
> Service definition:
>     <service name="createAcctgTransAndEntriesForIncomingPayment" engine="simple" auth="true"
>         location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForIncomingPayment">
>         <description>Create an accounting transaction for an outgoing payment</description>
>         <attribute name="paymentId" type="String" mode="IN" optional="false"/>
>         <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
>     </service>
> 1) get the Payment by paymentId
> 2) if (!UtilAccounting.isReceipt(payment)) then return; (hint: in Minilang, use the "call-class-method" operation)
> 3) organizationPartyId = payment.partyIdTo
> 4) partyId = payment.partyIdFrom and roleTypeId = "BILL_TO_CUSTOMER"
> 5) create an AcctgTransEntry with:
> 5.1) debitCreditFlag=D, glAccountTypeId: do not set for now (<!--TODO-->), origAmount=payment.amount, origCurrencyUomId=payment.currencyUomId
> 6) get the creditGlAccountTypeId in the following way:
> 6.1) get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId
> 6.2) creditGlAccountTypeId = PaymentGlAccountTypeMap.glAccountTypeId
> 7) for the credit entries: select the PaymentApplications associated to the Payment and for each one:
> 7.1) create a AcctgTransEntry with: debitCreditFlag=C, origAmount=paymentApplication.amountApplied, origCurrencyUomId=payment.currencyUomId, glAccountId=paymentApplication.overrideGlAccountId or (if empty) payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 7.2) amountAppliedTotal = amountAppliedTotal + paymentApplication.amountApplied
> 8) if ((payment.amount - amountAppliedTotal) > 0) then create another credit entry with: debitCreditFlag=C, origAmount=(payment.amount - amountAppliedTotal), origCurrencyUomId=payment.currencyUomId, glAccountId=payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 9) call the createAcctgTransAndEntries with the following fields
> 9.1) acctgTransEntries prepared at points 5, 7 and 8
> 9.2) acctgTransTypeId="INCOMING_PAYMENT"
> 9.3) partyId e roleTypeId (point 4), paymentId
> Add the following secas to trigger the service:
> <eca service="createPayment" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>
> <eca service="setPaymentStatus" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OFBIZ-1490) Implement an automatic GL posting service for incoming payments

Posted by "Brajesh Patel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brajesh Patel updated OFBIZ-1490:
---------------------------------

    Attachment: Jira_issue_1490.patch

Updated patech .

> Implement an automatic GL posting service for incoming payments
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-1490
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1490
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>            Assignee: Ashish Vijaywargiya
>         Attachments: Jira_issue_1490.patch, Jira_issue_1490.patch, Jira_issue_1490.patch, Jira_issue_1490.patch
>
>
> Name of the service: "createAcctgTransAndEntriesForIncomingPayment" or similar
> Service definition:
>     <service name="createAcctgTransAndEntriesForIncomingPayment" engine="simple" auth="true"
>         location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForIncomingPayment">
>         <description>Create an accounting transaction for an outgoing payment</description>
>         <attribute name="paymentId" type="String" mode="IN" optional="false"/>
>         <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
>     </service>
> 1) get the Payment by paymentId
> 2) if (!UtilAccounting.isReceipt(payment)) then return; (hint: in Minilang, use the "call-class-method" operation)
> 3) organizationPartyId = payment.partyIdTo
> 4) partyId = payment.partyIdFrom and roleTypeId = "BILL_TO_CUSTOMER"
> 5) create an AcctgTransEntry with:
> 5.1) debitCreditFlag=D, glAccountTypeId: do not set for now (<!--TODO-->), origAmount=payment.amount, origCurrencyUomId=payment.currencyUomId
> 6) get the creditGlAccountTypeId in the following way:
> 6.1) get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId
> 6.2) creditGlAccountTypeId = PaymentGlAccountTypeMap.glAccountTypeId
> 7) for the credit entries: select the PaymentApplications associated to the Payment and for each one:
> 7.1) create a AcctgTransEntry with: debitCreditFlag=C, origAmount=paymentApplication.amountApplied, origCurrencyUomId=payment.currencyUomId, glAccountId=paymentApplication.overrideGlAccountId or (if empty) payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 7.2) amountAppliedTotal = amountAppliedTotal + paymentApplication.amountApplied
> 8) if ((payment.amount - amountAppliedTotal) > 0) then create another credit entry with: debitCreditFlag=C, origAmount=(payment.amount - amountAppliedTotal), origCurrencyUomId=payment.currencyUomId, glAccountId=payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 9) call the createAcctgTransAndEntries with the following fields
> 9.1) acctgTransEntries prepared at points 5, 7 and 8
> 9.2) acctgTransTypeId="INCOMING_PAYMENT"
> 9.3) partyId e roleTypeId (point 4), paymentId
> Add the following secas to trigger the service:
> <eca service="createPayment" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>
> <eca service="setPaymentStatus" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (OFBIZ-1490) Implement an automatic GL posting service for incoming payments

Posted by "Ashish Vijaywargiya (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashish Vijaywargiya closed OFBIZ-1490.
--------------------------------------

    Resolution: Fixed

Thanks Brajesh for your valuable patch.
Your patch is in rev # 604505.

--
Ashish Vijaywargiya

> Implement an automatic GL posting service for incoming payments
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-1490
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1490
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>            Assignee: Ashish Vijaywargiya
>         Attachments: Jira_issue_1490.patch, Jira_issue_1490.patch, Jira_issue_1490.patch
>
>
> Name of the service: "createAcctgTransAndEntriesForIncomingPayment" or similar
> Service definition:
>     <service name="createAcctgTransAndEntriesForIncomingPayment" engine="simple" auth="true"
>         location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForIncomingPayment">
>         <description>Create an accounting transaction for an outgoing payment</description>
>         <attribute name="paymentId" type="String" mode="IN" optional="false"/>
>         <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
>     </service>
> 1) get the Payment by paymentId
> 2) if (!UtilAccounting.isReceipt(payment)) then return; (hint: in Minilang, use the "call-class-method" operation)
> 3) organizationPartyId = payment.partyIdTo
> 4) partyId = payment.partyIdFrom and roleTypeId = "BILL_TO_CUSTOMER"
> 5) create an AcctgTransEntry with:
> 5.1) debitCreditFlag=D, glAccountTypeId: do not set for now (<!--TODO-->), origAmount=payment.amount, origCurrencyUomId=payment.currencyUomId
> 6) get the creditGlAccountTypeId in the following way:
> 6.1) get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId
> 6.2) creditGlAccountTypeId = PaymentGlAccountTypeMap.glAccountTypeId
> 7) for the credit entries: select the PaymentApplications associated to the Payment and for each one:
> 7.1) create a AcctgTransEntry with: debitCreditFlag=C, origAmount=paymentApplication.amountApplied, origCurrencyUomId=payment.currencyUomId, glAccountId=paymentApplication.overrideGlAccountId or (if empty) payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 7.2) amountAppliedTotal = amountAppliedTotal + paymentApplication.amountApplied
> 8) if ((payment.amount - amountAppliedTotal) > 0) then create another credit entry with: debitCreditFlag=C, origAmount=(payment.amount - amountAppliedTotal), origCurrencyUomId=payment.currencyUomId, glAccountId=payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 9) call the createAcctgTransAndEntries with the following fields
> 9.1) acctgTransEntries prepared at points 5, 7 and 8
> 9.2) acctgTransTypeId="INCOMING_PAYMENT"
> 9.3) partyId e roleTypeId (point 4), paymentId
> Add the following secas to trigger the service:
> <eca service="createPayment" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>
> <eca service="setPaymentStatus" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OFBIZ-1490) Implement an automatic GL posting service for incoming payments

Posted by "Jacopo Cappellato (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacopo Cappellato updated OFBIZ-1490:
-------------------------------------

    Description: 
Name of the service: "createAcctgTransAndEntriesForIncomingPayment" or similar
Service definition:
    <service name="createAcctgTransAndEntriesForIncomingPayment" engine="simple" auth="true"
        location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForIncomingPayment">
        <description>Create an accounting transaction for an outgoing payment</description>
        <attribute name="paymentId" type="String" mode="IN" optional="false"/>
        <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
    </service>

1) get the Payment by paymentId
2) if (!UtilAccounting.isReceipt(payment)) then return; (hint: in Minilang, use the "call-class-method" operation)
3) organizationPartyId = payment.partyIdTo
4) partyId = payment.partyIdFrom and roleTypeId = "BILL_TO_CUSTOMER"
5) create an AcctgTransEntry with:
5.1) debitCreditFlag=D, glAccountTypeId: do not set for now (<!--TODO-->), origAmount=payment.amount, origCurrencyUomId=payment.currencyUomId

6) get the creditGlAccountTypeId in the following way:
6.1) get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId
6.2) creditGlAccountTypeId = PaymentGlAccountTypeMap.glAccountTypeId

7) for the credit entries: select the PaymentApplications associated to the Payment and for each one:
7.1) create a AcctgTransEntry with: debitCreditFlag=C, origAmount=paymentApplication.amountApplied, origCurrencyUomId=payment.currencyUomId, glAccountId=paymentApplication.overrideGlAccountId or (if empty) payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
7.2) amountAppliedTotal = amountAppliedTotal + paymentApplication.amountApplied
8) if ((payment.amount - amountAppliedTotal) > 0) then create another credit entry with: debitCreditFlag=C, origAmount=(payment.amount - amountAppliedTotal), origCurrencyUomId=payment.currencyUomId, glAccountId=payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId

9) call the createAcctgTransAndEntries with the following fields
9.1) acctgTransEntries prepared at points 5, 7 and 8
9.2) acctgTransTypeId="INCOMING_PAYMENT"
9.3) partyId e roleTypeId (point 4), paymentId

Add the following secas to trigger the service:

<eca service="createPayment" event="commit">
    <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
    <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
</eca>
<eca service="setPaymentStatus" event="commit">
    <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
    <condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
    <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
</eca>


  was:
Name of the service: "createAcctgTransAndEntriesForIncomingPayment" or similar
Service definition:
    <service name="createAcctgTransAndEntriesForIncomingPayment" engine="simple" auth="true"
        location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForIncomingPayment">
        <description>Create an accounting transaction for a purchase invoice</description>
        <attribute name="paymentId" type="String" mode="IN" optional="false"/>
        <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
    </service>

1) get the Payment by paymentId
2) if (!UtilAccounting.isReceipt(payment)) then return; (hint: in Minilang, use the "call-class-method" operation)
3) organizationPartyId = payment.partyIdTo
4) partyId = payment.partyIdFrom and roleTypeId = "BILL_TO_CUSTOMER"
5) create an AcctgTransEntry with:
5.1) debitCreditFlag=D, glAccountTypeId: do not set for now (<!--TODO-->), origAmount=payment.amount, origCurrencyUomId=payment.currencyUomId

6) get the creditGlAccountTypeId in the following way:
6.1) get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId
6.2) creditGlAccountTypeId = PaymentGlAccountTypeMap.glAccountTypeId

7) for the credit entries: select the PaymentApplications associated to the Payment and for each one:
7.1) create a AcctgTransEntry with: debitCreditFlag=C, origAmount=paymentApplication.amountApplied, origCurrencyUomId=payment.currencyUomId, glAccountId=paymentApplication.overrideGlAccountId or (if empty) payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
7.2) amountAppliedTotal = amountAppliedTotal + paymentApplication.amountApplied
8) if ((payment.amount - amountAppliedTotal) > 0) then create another credit entry with: debitCreditFlag=C, origAmount=(payment.amount - amountAppliedTotal), origCurrencyUomId=payment.currencyUomId, glAccountId=payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId

9) call the createAcctgTransAndEntries with the following fields
9.1) acctgTransEntries prepared at points 5, 7 and 8
9.2) acctgTransTypeId="INCOMING_PAYMENT"
9.3) partyId e roleTypeId (point 4), paymentId

Add the following secas to trigger the service:

<eca service="createPayment" event="commit">
    <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
    <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
</eca>
<eca service="setPaymentStatus" event="commit">
    <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
    <condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
    <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
</eca>



> Implement an automatic GL posting service for incoming payments
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-1490
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1490
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>
> Name of the service: "createAcctgTransAndEntriesForIncomingPayment" or similar
> Service definition:
>     <service name="createAcctgTransAndEntriesForIncomingPayment" engine="simple" auth="true"
>         location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForIncomingPayment">
>         <description>Create an accounting transaction for an outgoing payment</description>
>         <attribute name="paymentId" type="String" mode="IN" optional="false"/>
>         <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
>     </service>
> 1) get the Payment by paymentId
> 2) if (!UtilAccounting.isReceipt(payment)) then return; (hint: in Minilang, use the "call-class-method" operation)
> 3) organizationPartyId = payment.partyIdTo
> 4) partyId = payment.partyIdFrom and roleTypeId = "BILL_TO_CUSTOMER"
> 5) create an AcctgTransEntry with:
> 5.1) debitCreditFlag=D, glAccountTypeId: do not set for now (<!--TODO-->), origAmount=payment.amount, origCurrencyUomId=payment.currencyUomId
> 6) get the creditGlAccountTypeId in the following way:
> 6.1) get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId
> 6.2) creditGlAccountTypeId = PaymentGlAccountTypeMap.glAccountTypeId
> 7) for the credit entries: select the PaymentApplications associated to the Payment and for each one:
> 7.1) create a AcctgTransEntry with: debitCreditFlag=C, origAmount=paymentApplication.amountApplied, origCurrencyUomId=payment.currencyUomId, glAccountId=paymentApplication.overrideGlAccountId or (if empty) payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 7.2) amountAppliedTotal = amountAppliedTotal + paymentApplication.amountApplied
> 8) if ((payment.amount - amountAppliedTotal) > 0) then create another credit entry with: debitCreditFlag=C, origAmount=(payment.amount - amountAppliedTotal), origCurrencyUomId=payment.currencyUomId, glAccountId=payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 9) call the createAcctgTransAndEntries with the following fields
> 9.1) acctgTransEntries prepared at points 5, 7 and 8
> 9.2) acctgTransTypeId="INCOMING_PAYMENT"
> 9.3) partyId e roleTypeId (point 4), paymentId
> Add the following secas to trigger the service:
> <eca service="createPayment" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>
> <eca service="setPaymentStatus" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OFBIZ-1490) Implement an automatic GL posting service for incoming payments

Posted by "Mridul Pathak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12550037 ] 

Mridul Pathak commented on OFBIZ-1490:
--------------------------------------

Brajesh,
    I think the eca condition is correct and it will not be needed to modify it.  Because there may be a case where createPayment service is called and statusId is passed with value PMNT_RECEIVED.
    I reviewed your patch, and I find it correct w.r.t the logic, only with some slight modifications required.  Which are :
1) For requirement 2, Operator "not-equals" should be used used in "if-compare" condition for "isReceipt". 
2) For requirement (7.1) the condition in the patch is not correct.  The condition should be on field-name="paymentApplication.overrideGlAccountId".
3) The service call for createAcctgTransAndEntries and <field-to-result> should be inside the <if-compare field-name="isReceipt" operator="not-equals" type="Boolean" value="false"> condition.
4) The comment for the eca on setPaymentStatus needs to be refactored.

> Implement an automatic GL posting service for incoming payments
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-1490
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1490
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>         Attachments: Jira_issue_1490.patch, Jira_issue_1490.patch
>
>
> Name of the service: "createAcctgTransAndEntriesForIncomingPayment" or similar
> Service definition:
>     <service name="createAcctgTransAndEntriesForIncomingPayment" engine="simple" auth="true"
>         location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForIncomingPayment">
>         <description>Create an accounting transaction for an outgoing payment</description>
>         <attribute name="paymentId" type="String" mode="IN" optional="false"/>
>         <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
>     </service>
> 1) get the Payment by paymentId
> 2) if (!UtilAccounting.isReceipt(payment)) then return; (hint: in Minilang, use the "call-class-method" operation)
> 3) organizationPartyId = payment.partyIdTo
> 4) partyId = payment.partyIdFrom and roleTypeId = "BILL_TO_CUSTOMER"
> 5) create an AcctgTransEntry with:
> 5.1) debitCreditFlag=D, glAccountTypeId: do not set for now (<!--TODO-->), origAmount=payment.amount, origCurrencyUomId=payment.currencyUomId
> 6) get the creditGlAccountTypeId in the following way:
> 6.1) get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId
> 6.2) creditGlAccountTypeId = PaymentGlAccountTypeMap.glAccountTypeId
> 7) for the credit entries: select the PaymentApplications associated to the Payment and for each one:
> 7.1) create a AcctgTransEntry with: debitCreditFlag=C, origAmount=paymentApplication.amountApplied, origCurrencyUomId=payment.currencyUomId, glAccountId=paymentApplication.overrideGlAccountId or (if empty) payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 7.2) amountAppliedTotal = amountAppliedTotal + paymentApplication.amountApplied
> 8) if ((payment.amount - amountAppliedTotal) > 0) then create another credit entry with: debitCreditFlag=C, origAmount=(payment.amount - amountAppliedTotal), origCurrencyUomId=payment.currencyUomId, glAccountId=payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 9) call the createAcctgTransAndEntries with the following fields
> 9.1) acctgTransEntries prepared at points 5, 7 and 8
> 9.2) acctgTransTypeId="INCOMING_PAYMENT"
> 9.3) partyId e roleTypeId (point 4), paymentId
> Add the following secas to trigger the service:
> <eca service="createPayment" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>
> <eca service="setPaymentStatus" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OFBIZ-1490) Implement an automatic GL posting service for incoming payments

Posted by "Brajesh Patel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brajesh Patel updated OFBIZ-1490:
---------------------------------

    Attachment: Jira_issue_1490.patch

> Implement an automatic GL posting service for incoming payments
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-1490
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1490
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>         Attachments: Jira_issue_1490.patch, Jira_issue_1490.patch, Jira_issue_1490.patch
>
>
> Name of the service: "createAcctgTransAndEntriesForIncomingPayment" or similar
> Service definition:
>     <service name="createAcctgTransAndEntriesForIncomingPayment" engine="simple" auth="true"
>         location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForIncomingPayment">
>         <description>Create an accounting transaction for an outgoing payment</description>
>         <attribute name="paymentId" type="String" mode="IN" optional="false"/>
>         <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
>     </service>
> 1) get the Payment by paymentId
> 2) if (!UtilAccounting.isReceipt(payment)) then return; (hint: in Minilang, use the "call-class-method" operation)
> 3) organizationPartyId = payment.partyIdTo
> 4) partyId = payment.partyIdFrom and roleTypeId = "BILL_TO_CUSTOMER"
> 5) create an AcctgTransEntry with:
> 5.1) debitCreditFlag=D, glAccountTypeId: do not set for now (<!--TODO-->), origAmount=payment.amount, origCurrencyUomId=payment.currencyUomId
> 6) get the creditGlAccountTypeId in the following way:
> 6.1) get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId
> 6.2) creditGlAccountTypeId = PaymentGlAccountTypeMap.glAccountTypeId
> 7) for the credit entries: select the PaymentApplications associated to the Payment and for each one:
> 7.1) create a AcctgTransEntry with: debitCreditFlag=C, origAmount=paymentApplication.amountApplied, origCurrencyUomId=payment.currencyUomId, glAccountId=paymentApplication.overrideGlAccountId or (if empty) payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 7.2) amountAppliedTotal = amountAppliedTotal + paymentApplication.amountApplied
> 8) if ((payment.amount - amountAppliedTotal) > 0) then create another credit entry with: debitCreditFlag=C, origAmount=(payment.amount - amountAppliedTotal), origCurrencyUomId=payment.currencyUomId, glAccountId=payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 9) call the createAcctgTransAndEntries with the following fields
> 9.1) acctgTransEntries prepared at points 5, 7 and 8
> 9.2) acctgTransTypeId="INCOMING_PAYMENT"
> 9.3) partyId e roleTypeId (point 4), paymentId
> Add the following secas to trigger the service:
> <eca service="createPayment" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>
> <eca service="setPaymentStatus" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OFBIZ-1490) Implement an automatic GL posting service for incoming payments

Posted by "Pranay Pandey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pranay Pandey updated OFBIZ-1490:
---------------------------------

    Attachment: Jira_issue_1490.patch

Brajesh,
       I have reviewed your patch according to the description given in the issue and did some changes in it. The upadated patch is attached. Just review this new patch.
---
Pranay


> Implement an automatic GL posting service for incoming payments
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-1490
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1490
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>         Attachments: Jira_issue_1490.patch
>
>
> Name of the service: "createAcctgTransAndEntriesForIncomingPayment" or similar
> Service definition:
>     <service name="createAcctgTransAndEntriesForIncomingPayment" engine="simple" auth="true"
>         location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForIncomingPayment">
>         <description>Create an accounting transaction for an outgoing payment</description>
>         <attribute name="paymentId" type="String" mode="IN" optional="false"/>
>         <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
>     </service>
> 1) get the Payment by paymentId
> 2) if (!UtilAccounting.isReceipt(payment)) then return; (hint: in Minilang, use the "call-class-method" operation)
> 3) organizationPartyId = payment.partyIdTo
> 4) partyId = payment.partyIdFrom and roleTypeId = "BILL_TO_CUSTOMER"
> 5) create an AcctgTransEntry with:
> 5.1) debitCreditFlag=D, glAccountTypeId: do not set for now (<!--TODO-->), origAmount=payment.amount, origCurrencyUomId=payment.currencyUomId
> 6) get the creditGlAccountTypeId in the following way:
> 6.1) get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId
> 6.2) creditGlAccountTypeId = PaymentGlAccountTypeMap.glAccountTypeId
> 7) for the credit entries: select the PaymentApplications associated to the Payment and for each one:
> 7.1) create a AcctgTransEntry with: debitCreditFlag=C, origAmount=paymentApplication.amountApplied, origCurrencyUomId=payment.currencyUomId, glAccountId=paymentApplication.overrideGlAccountId or (if empty) payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 7.2) amountAppliedTotal = amountAppliedTotal + paymentApplication.amountApplied
> 8) if ((payment.amount - amountAppliedTotal) > 0) then create another credit entry with: debitCreditFlag=C, origAmount=(payment.amount - amountAppliedTotal), origCurrencyUomId=payment.currencyUomId, glAccountId=payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 9) call the createAcctgTransAndEntries with the following fields
> 9.1) acctgTransEntries prepared at points 5, 7 and 8
> 9.2) acctgTransTypeId="INCOMING_PAYMENT"
> 9.3) partyId e roleTypeId (point 4), paymentId
> Add the following secas to trigger the service:
> <eca service="createPayment" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>
> <eca service="setPaymentStatus" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (OFBIZ-1490) Implement an automatic GL posting service for incoming payments

Posted by "Ashish Vijaywargiya (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashish Vijaywargiya reassigned OFBIZ-1490:
------------------------------------------

    Assignee: Ashish Vijaywargiya

> Implement an automatic GL posting service for incoming payments
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-1490
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1490
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>            Assignee: Ashish Vijaywargiya
>         Attachments: Jira_issue_1490.patch, Jira_issue_1490.patch, Jira_issue_1490.patch
>
>
> Name of the service: "createAcctgTransAndEntriesForIncomingPayment" or similar
> Service definition:
>     <service name="createAcctgTransAndEntriesForIncomingPayment" engine="simple" auth="true"
>         location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForIncomingPayment">
>         <description>Create an accounting transaction for an outgoing payment</description>
>         <attribute name="paymentId" type="String" mode="IN" optional="false"/>
>         <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
>     </service>
> 1) get the Payment by paymentId
> 2) if (!UtilAccounting.isReceipt(payment)) then return; (hint: in Minilang, use the "call-class-method" operation)
> 3) organizationPartyId = payment.partyIdTo
> 4) partyId = payment.partyIdFrom and roleTypeId = "BILL_TO_CUSTOMER"
> 5) create an AcctgTransEntry with:
> 5.1) debitCreditFlag=D, glAccountTypeId: do not set for now (<!--TODO-->), origAmount=payment.amount, origCurrencyUomId=payment.currencyUomId
> 6) get the creditGlAccountTypeId in the following way:
> 6.1) get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId
> 6.2) creditGlAccountTypeId = PaymentGlAccountTypeMap.glAccountTypeId
> 7) for the credit entries: select the PaymentApplications associated to the Payment and for each one:
> 7.1) create a AcctgTransEntry with: debitCreditFlag=C, origAmount=paymentApplication.amountApplied, origCurrencyUomId=payment.currencyUomId, glAccountId=paymentApplication.overrideGlAccountId or (if empty) payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 7.2) amountAppliedTotal = amountAppliedTotal + paymentApplication.amountApplied
> 8) if ((payment.amount - amountAppliedTotal) > 0) then create another credit entry with: debitCreditFlag=C, origAmount=(payment.amount - amountAppliedTotal), origCurrencyUomId=payment.currencyUomId, glAccountId=payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 9) call the createAcctgTransAndEntries with the following fields
> 9.1) acctgTransEntries prepared at points 5, 7 and 8
> 9.2) acctgTransTypeId="INCOMING_PAYMENT"
> 9.3) partyId e roleTypeId (point 4), paymentId
> Add the following secas to trigger the service:
> <eca service="createPayment" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>
> <eca service="setPaymentStatus" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (OFBIZ-1490) Implement an automatic GL posting service for incoming payments

Posted by "Brajesh Patel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551731 ] 

brajeshpatel07 edited comment on OFBIZ-1490 at 12/14/07 12:47 AM:
-----------------------------------------------------------------

Updated patch .

      was (Author: brajeshpatel07):
    Updated patech .
  
> Implement an automatic GL posting service for incoming payments
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-1490
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1490
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>            Assignee: Ashish Vijaywargiya
>         Attachments: Jira_issue_1490.patch, Jira_issue_1490.patch, Jira_issue_1490.patch, Jira_issue_1490.patch
>
>
> Name of the service: "createAcctgTransAndEntriesForIncomingPayment" or similar
> Service definition:
>     <service name="createAcctgTransAndEntriesForIncomingPayment" engine="simple" auth="true"
>         location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForIncomingPayment">
>         <description>Create an accounting transaction for an outgoing payment</description>
>         <attribute name="paymentId" type="String" mode="IN" optional="false"/>
>         <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
>     </service>
> 1) get the Payment by paymentId
> 2) if (!UtilAccounting.isReceipt(payment)) then return; (hint: in Minilang, use the "call-class-method" operation)
> 3) organizationPartyId = payment.partyIdTo
> 4) partyId = payment.partyIdFrom and roleTypeId = "BILL_TO_CUSTOMER"
> 5) create an AcctgTransEntry with:
> 5.1) debitCreditFlag=D, glAccountTypeId: do not set for now (<!--TODO-->), origAmount=payment.amount, origCurrencyUomId=payment.currencyUomId
> 6) get the creditGlAccountTypeId in the following way:
> 6.1) get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId
> 6.2) creditGlAccountTypeId = PaymentGlAccountTypeMap.glAccountTypeId
> 7) for the credit entries: select the PaymentApplications associated to the Payment and for each one:
> 7.1) create a AcctgTransEntry with: debitCreditFlag=C, origAmount=paymentApplication.amountApplied, origCurrencyUomId=payment.currencyUomId, glAccountId=paymentApplication.overrideGlAccountId or (if empty) payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 7.2) amountAppliedTotal = amountAppliedTotal + paymentApplication.amountApplied
> 8) if ((payment.amount - amountAppliedTotal) > 0) then create another credit entry with: debitCreditFlag=C, origAmount=(payment.amount - amountAppliedTotal), origCurrencyUomId=payment.currencyUomId, glAccountId=payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 9) call the createAcctgTransAndEntries with the following fields
> 9.1) acctgTransEntries prepared at points 5, 7 and 8
> 9.2) acctgTransTypeId="INCOMING_PAYMENT"
> 9.3) partyId e roleTypeId (point 4), paymentId
> Add the following secas to trigger the service:
> <eca service="createPayment" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>
> <eca service="setPaymentStatus" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OFBIZ-1490) Implement an automatic GL posting service for incoming payments

Posted by "Brajesh Patel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brajesh Patel updated OFBIZ-1490:
---------------------------------

    Attachment: Jira_issue_1490.patch

On created a payment than i have got statusId  PMNT_NOT_PAID
but in eca condition statusId is PMNT_RECEIVED.
Is there need for modifiction in eca condition or i am confuse. 

> Implement an automatic GL posting service for incoming payments
> ---------------------------------------------------------------
>
>                 Key: OFBIZ-1490
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1490
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>         Attachments: Jira_issue_1490.patch, Jira_issue_1490.patch
>
>
> Name of the service: "createAcctgTransAndEntriesForIncomingPayment" or similar
> Service definition:
>     <service name="createAcctgTransAndEntriesForIncomingPayment" engine="simple" auth="true"
>         location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createAcctgTransAndEntriesForIncomingPayment">
>         <description>Create an accounting transaction for an outgoing payment</description>
>         <attribute name="paymentId" type="String" mode="IN" optional="false"/>
>         <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
>     </service>
> 1) get the Payment by paymentId
> 2) if (!UtilAccounting.isReceipt(payment)) then return; (hint: in Minilang, use the "call-class-method" operation)
> 3) organizationPartyId = payment.partyIdTo
> 4) partyId = payment.partyIdFrom and roleTypeId = "BILL_TO_CUSTOMER"
> 5) create an AcctgTransEntry with:
> 5.1) debitCreditFlag=D, glAccountTypeId: do not set for now (<!--TODO-->), origAmount=payment.amount, origCurrencyUomId=payment.currencyUomId
> 6) get the creditGlAccountTypeId in the following way:
> 6.1) get the PaymentGlAccountTypeMap for the given Payment.paymentTypeId and organizationPartyId
> 6.2) creditGlAccountTypeId = PaymentGlAccountTypeMap.glAccountTypeId
> 7) for the credit entries: select the PaymentApplications associated to the Payment and for each one:
> 7.1) create a AcctgTransEntry with: debitCreditFlag=C, origAmount=paymentApplication.amountApplied, origCurrencyUomId=payment.currencyUomId, glAccountId=paymentApplication.overrideGlAccountId or (if empty) payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 7.2) amountAppliedTotal = amountAppliedTotal + paymentApplication.amountApplied
> 8) if ((payment.amount - amountAppliedTotal) > 0) then create another credit entry with: debitCreditFlag=C, origAmount=(payment.amount - amountAppliedTotal), origCurrencyUomId=payment.currencyUomId, glAccountId=payment.overrideGlAccountId, glAccountTypeId=creditGlAccountTypeId
> 9) call the createAcctgTransAndEntries with the following fields
> 9.1) acctgTransEntries prepared at points 5, 7 and 8
> 9.2) acctgTransTypeId="INCOMING_PAYMENT"
> 9.3) partyId e roleTypeId (point 4), paymentId
> Add the following secas to trigger the service:
> <eca service="createPayment" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>
> <eca service="setPaymentStatus" event="commit">
>     <condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
>     <condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
>     <action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
> </eca>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.