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

Paul Foxworthy commented on OFBIZ-6330:
---------------------------------------

Hi Nicolas,

The code here generates individual accounting entries for the tax authorities. 
There is nothing adding the amounts up, so when the tax-inclusive price is 
calculated, the variable invoiceTaxTotal has never been used and will have a 
value of zero.

One reason I didn't take that approach (and I guess Kongrath thought the same) 
is that createAcctgTransForSalesInvoice also just calls getInvoiceTaxTotal.

I understand that adding up the tax amounts would avoid a call to one more 
method, at the expense of making the code a little more complicated. If you 
still think that's a good idea, I'll change all three methods 
createAcctgTransForCustomerReturnInvoice, createAcctgTransForSalesInvoice, 
createAcctgTransForPurchaseInvoice to work that way.

What do you think?

Cheers

Paul

> 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)

Reply via email to