details: https://code.openbravo.com/erp/devel/pi/rev/75838b0fd787 changeset: 32875:75838b0fd787 user: David Miguelez <david.miguelez <at> openbravo.com> date: Fri Oct 13 09:34:21 2017 +0200 summary: Fixes Issue 37010. In the loop that goes through each Non Deductuable Tax, the Orderlines are retrieved.
However, this lines must be filtered to retrieve only the ones that use the Tax that is being looped. If not, all the lines will be used for all the taxes and then duplicated data will appear diffstat: src/org/openbravo/erpCommon/ad_forms/DocInvoice.java | 3 ++- src/org/openbravo/erpCommon/ad_forms/DocLineInvoice_data.xsql | 2 ++ 2 files changed, 4 insertions(+), 1 deletions(-) diffs (29 lines): diff -r 61c208f24417 -r 75838b0fd787 src/org/openbravo/erpCommon/ad_forms/DocInvoice.java --- a/src/org/openbravo/erpCommon/ad_forms/DocInvoice.java Thu Oct 19 16:51:23 2017 +0200 +++ b/src/org/openbravo/erpCommon/ad_forms/DocInvoice.java Fri Oct 13 09:34:21 2017 +0200 @@ -863,7 +863,8 @@ } else { DocLineInvoiceData[] data = null; try { - data = DocLineInvoiceData.selectUndeductable(connectionProvider, Record_ID); + data = DocLineInvoiceData.selectUndeductable(connectionProvider, Record_ID, + m_taxes[i].m_C_Tax_ID); } catch (ServletException e) { log4jDocInvoice.warn(e); } diff -r 61c208f24417 -r 75838b0fd787 src/org/openbravo/erpCommon/ad_forms/DocLineInvoice_data.xsql --- a/src/org/openbravo/erpCommon/ad_forms/DocLineInvoice_data.xsql Thu Oct 19 16:51:23 2017 +0200 +++ b/src/org/openbravo/erpCommon/ad_forms/DocLineInvoice_data.xsql Fri Oct 13 09:34:21 2017 +0200 @@ -127,10 +127,12 @@ left join c_tax on c_tax.c_tax_id=c_invoicelinetax.c_tax_id WHERE C_INVOICELINE.C_INVOICE_ID = ? and c_tax.istaxundeductable='Y' + and c_invoicelinetax.C_TAX_ID = ? ORDER BY LINE ]]> </Sql> <Parameter name="C_Invoice_ID"/> + <Parameter name="C_Tax_ID"/> </SqlMethod> </SqlClass> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits