You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Nicolas Malin (JIRA)" <ji...@apache.org> on 2017/02/07 20:27:41 UTC

[jira] [Comment Edited] (OFBIZ-6330) The invoiceTaxTotal value is missing from createAcctgTransForPurchaseInvoice service

    [ https://issues.apache.org/jira/browse/OFBIZ-6330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15856723#comment-15856723 ] 

Nicolas Malin edited comment on OFBIZ-6330 at 2/7/17 8:27 PM:
--------------------------------------------------------------

Hello,
I checked the code and found a nice detail to resolve all tax merged by taxAuthority.
line 2033 on 
{code:xml}
            <call-class-method method-name="getInvoiceTaxAuthPartyAndGeos" class-name="org.apache.ofbiz.accounting.invoice.InvoiceWorker"
                  ret-field="taxAuthPartyAndGeos">
                <field field="invoice" type="org.apache.ofbiz.entity.GenericValue"/>
            </call-class-method>
            <iterate-map key="taxAuthPartyId" value="taxAuthGeoIds" map="taxAuthPartyAndGeos">
                <iterate list="taxAuthGeoIds" entry="taxAuthGeoId">
                    <clear-field field="debitEntry"/>
                    <make-value entity-name="AcctgTransEntry" value-field="debitEntry"/>
                    <set field="debitEntry.debitCreditFlag" value="D"/>
                    <set field="debitEntry.organizationPartyId" from-field="invoice.partyId"/>
                    <call-class-method method-name="getInvoiceTaxTotalForTaxAuthPartyAndGeo" class-name="org.apache.ofbiz.accounting.invoice.InvoiceWorker"
                            ret-field="taxAmount">
                        <field field="invoice" type="GenericValue"/>
                        <field field="taxAuthPartyId" type="String"/>
                        <field field="taxAuthGeoId" type="String"/>
                    </call-class-method>
                    <set field="debitEntry.origAmount" from-field="taxAmount"/>
                    <set field="debitEntry.origCurrencyUomId" from-field="invoice.currencyUomId"/>
                    <set field="debitEntry.partyId" from-field="taxAuthPartyId"/>
                    <set field="debitEntry.roleTypeId" value="TAX_AUTHORITY"/>
                    <set field="acctgTransEntries[]" from-field="debitEntry" type="Object"/>
                </iterate>
            </iterate-map>
            <!-- Another entry for tax not attributed to a taxAuthPartyId -->
            <call-class-method method-name="getInvoiceUnattributedTaxTotal" class-name="org.apache.ofbiz.accounting.invoice.InvoiceWorker"
                    ret-field="taxAmount">
                <field field="invoice" type="GenericValue"/>
            </call-class-method>
{code}

Did you check why this method doesn't works well ? Because I think it's more powerfull than just resolve all tax on one line.



was (Author: soledad):
Hello,
I checked the code and found a nice detail to resolve all tax merged by taxAuthority.
line 2033 on 
{code|lang=xml}
            <call-class-method method-name="getInvoiceTaxAuthPartyAndGeos" class-name="org.apache.ofbiz.accounting.invoice.InvoiceWorker"
                  ret-field="taxAuthPartyAndGeos">
                <field field="invoice" type="org.apache.ofbiz.entity.GenericValue"/>
            </call-class-method>
            <iterate-map key="taxAuthPartyId" value="taxAuthGeoIds" map="taxAuthPartyAndGeos">
                <iterate list="taxAuthGeoIds" entry="taxAuthGeoId">
                    <clear-field field="debitEntry"/>
                    <make-value entity-name="AcctgTransEntry" value-field="debitEntry"/>
                    <set field="debitEntry.debitCreditFlag" value="D"/>
                    <set field="debitEntry.organizationPartyId" from-field="invoice.partyId"/>
                    <call-class-method method-name="getInvoiceTaxTotalForTaxAuthPartyAndGeo" class-name="org.apache.ofbiz.accounting.invoice.InvoiceWorker"
                            ret-field="taxAmount">
                        <field field="invoice" type="GenericValue"/>
                        <field field="taxAuthPartyId" type="String"/>
                        <field field="taxAuthGeoId" type="String"/>
                    </call-class-method>
                    <set field="debitEntry.origAmount" from-field="taxAmount"/>
                    <set field="debitEntry.origCurrencyUomId" from-field="invoice.currencyUomId"/>
                    <set field="debitEntry.partyId" from-field="taxAuthPartyId"/>
                    <set field="debitEntry.roleTypeId" value="TAX_AUTHORITY"/>
                    <set field="acctgTransEntries[]" from-field="debitEntry" type="Object"/>
                </iterate>
            </iterate-map>
            <!-- Another entry for tax not attributed to a taxAuthPartyId -->
            <call-class-method method-name="getInvoiceUnattributedTaxTotal" class-name="org.apache.ofbiz.accounting.invoice.InvoiceWorker"
                    ret-field="taxAmount">
                <field field="invoice" type="GenericValue"/>
            </call-class-method>
{code}

Did you check why this method doesn't works well ? Because I think it's more powerfull than just resolve all tax on one line.


> The invoiceTaxTotal value is missing from createAcctgTransForPurchaseInvoice service
> ------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-6330
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6330
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>    Affects Versions: Trunk
>            Reporter: Kongrath Suankaewmanee
>            Assignee: Paul Foxworthy
>         Attachments: GeneralLedgerServices.patch, OFBIZ-6330_TaxAccountingOnPurchasesAndReturns.patch
>
>
> Hi All,
> Scenario: The sum of debit and credit in InvoiceAcctgTransEntriesPdf of purchase invoice are not equal.
> Question: I'm not sure why the createAcctgTransForPurchaseInvoice service did not call the method to get invoiceTaxTotal.
> <call-class-method method-name="getInvoiceTaxTotal" class-name="org.ofbiz.accounting.invoice.InvoiceWorker" ret-field="invoiceTaxTotal">
>     <field field="invoice" type="GenericValue"/>
> </call-class-method>
> And the invoiceTaxTotal value needs to add to totalAmountFromInvoice via code below:
> <calculate field="totalAmountFromInvoice" type="BigDecimal" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
>     <calcop operator="add">
>         <calcop operator="get" field="totalAmountFromInvoice"/>
>         <calcop operator="get" field="invoiceTaxTotal"/>
>     </calcop>
> </calculate>
> That it should work like the createAcctgTransForSalesInvoice service of the sales invoice.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)