Fixes Issue 26467
authorAtul Gaware <atul.gaware@openbravo.com>
Thu, 12 Jun 2014 13:19:07 +0530
changeset 23481 df19952acd95
parent 23480 893b5cbee3ab
child 23482 fa64ace20e79
Fixes Issue 26467
src/org/openbravo/erpCommon/utility/CashVATUtil.java
--- a/src/org/openbravo/erpCommon/utility/CashVATUtil.java	Fri Jun 13 09:40:32 2014 +0200
+++ b/src/org/openbravo/erpCommon/utility/CashVATUtil.java	Thu Jun 12 13:19:07 2014 +0530
@@ -370,30 +370,29 @@
                 || invoicedocumentType.equals(AcctServer.DOCTYPE_ARProForma)
                 || invoicedocumentType.equals(AcctServer.DOCTYPE_RMSalesInvoice)) {
               if (isReversal) {
-                final FactLine factLine1 = fact.createLine(line,
-                    m_tax.getAccount(DocTax.ACCTTYPE_TaxDue_Trans, as, conn), cCurrencyID, "",
+                final FactLine factLine1 = fact.createLine(line, m_tax.getAccount(
+                    DocTax.ACCTTYPE_TaxDue_Trans, as, conn), invoice.getCurrency().getId(), "",
                     taxAmt.toString(), Fact_Acct_Group_ID, nextSeqNo(SeqNo), documentType, conn);
-                factLine2 = fact.createLine(line,
-                    m_tax.getAccount(DocTax.ACCTTYPE_TaxDue, as, conn), cCurrencyID,
+                factLine2 = fact.createLine(line, m_tax
+                    .getAccount(DocTax.ACCTTYPE_TaxDue, as, conn), invoice.getCurrency().getId(),
                     taxAmt.toString(), "", Fact_Acct_Group_ID, nextSeqNo(factLine1.m_SeqNo),
                     documentType, conn);
               } else {
-                final FactLine factLine1 = fact
-                    .createLine(line, m_tax.getAccount(DocTax.ACCTTYPE_TaxDue_Trans, as, conn),
-                        cCurrencyID, taxAmt.toString(), "", Fact_Acct_Group_ID, nextSeqNo(SeqNo),
-                        documentType, conn);
-                factLine2 = fact.createLine(line,
-                    m_tax.getAccount(DocTax.ACCTTYPE_TaxDue, as, conn), cCurrencyID, "",
-                    taxAmt.toString(), Fact_Acct_Group_ID, nextSeqNo(factLine1.m_SeqNo),
+                final FactLine factLine1 = fact.createLine(line, m_tax.getAccount(
+                    DocTax.ACCTTYPE_TaxDue_Trans, as, conn), invoice.getCurrency().getId(), taxAmt
+                    .toString(), "", Fact_Acct_Group_ID, nextSeqNo(SeqNo), documentType, conn);
+                factLine2 = fact.createLine(line, m_tax
+                    .getAccount(DocTax.ACCTTYPE_TaxDue, as, conn), invoice.getCurrency().getId(),
+                    "", taxAmt.toString(), Fact_Acct_Group_ID, nextSeqNo(factLine1.m_SeqNo),
                     documentType, conn);
               }
             }// ARC
             else if (invoicedocumentType.equals(AcctServer.DOCTYPE_ARCredit)) {
-              final FactLine factLine1 = fact.createLine(line,
-                  m_tax.getAccount(DocTax.ACCTTYPE_TaxDue_Trans, as, conn), cCurrencyID, "",
+              final FactLine factLine1 = fact.createLine(line, m_tax.getAccount(
+                  DocTax.ACCTTYPE_TaxDue_Trans, as, conn), invoice.getCurrency().getId(), "",
                   taxAmt.toString(), Fact_Acct_Group_ID, nextSeqNo(SeqNo), documentType, conn);
               factLine2 = fact.createLine(line, m_tax.getAccount(DocTax.ACCTTYPE_TaxDue, as, conn),
-                  cCurrencyID, taxAmt.toString(), "", Fact_Acct_Group_ID,
+                  invoice.getCurrency().getId(), taxAmt.toString(), "", Fact_Acct_Group_ID,
                   nextSeqNo(factLine1.m_SeqNo), documentType, conn);
             }
             // API
@@ -401,12 +400,11 @@
               if (isReversal) {
                 final FactLine factLine1 = fact
                     .createLine(line, m_tax.getAccount(DocTax.ACCTTYPE_TaxCredit_Trans, as, conn),
-                        cCurrencyID, taxAmt.toString(), "", Fact_Acct_Group_ID, nextSeqNo(SeqNo),
-                        documentType, conn);
-                factLine2 = fact.createLine(line,
-                    m_tax.getAccount(DocTax.ACCTTYPE_TaxCredit, as, conn), cCurrencyID, "",
-                    taxAmt.toString(), Fact_Acct_Group_ID, nextSeqNo(factLine1.m_SeqNo),
-                    documentType, conn);
+                        invoice.getCurrency().getId(), taxAmt.toString(), "", Fact_Acct_Group_ID,
+                        nextSeqNo(SeqNo), documentType, conn);
+                factLine2 = fact.createLine(line, m_tax.getAccount(DocTax.ACCTTYPE_TaxCredit, as,
+                    conn), invoice.getCurrency().getId(), "", taxAmt.toString(),
+                    Fact_Acct_Group_ID, nextSeqNo(factLine1.m_SeqNo), documentType, conn);
               } else {
                 final FactLine factLine1 = fact.createLine(line,
                     m_tax.getAccount(DocTax.ACCTTYPE_TaxCredit_Trans, as, conn), cCurrencyID, "",
@@ -419,13 +417,12 @@
             }
             // APC
             else if (invoicedocumentType.equals(AcctServer.DOCTYPE_APCredit)) {
-              final FactLine factLine1 = fact.createLine(line,
-                  m_tax.getAccount(DocTax.ACCTTYPE_TaxCredit_Trans, as, conn), cCurrencyID,
-                  taxAmt.toString(), "", Fact_Acct_Group_ID, nextSeqNo(SeqNo), documentType, conn);
-              factLine2 = fact.createLine(line,
-                  m_tax.getAccount(DocTax.ACCTTYPE_TaxCredit, as, conn), cCurrencyID, "",
-                  taxAmt.toString(), Fact_Acct_Group_ID, nextSeqNo(factLine1.m_SeqNo),
-                  documentType, conn);
+              final FactLine factLine1 = fact.createLine(line, m_tax.getAccount(
+                  DocTax.ACCTTYPE_TaxCredit_Trans, as, conn), invoice.getCurrency().getId(), taxAmt
+                  .toString(), "", Fact_Acct_Group_ID, nextSeqNo(SeqNo), documentType, conn);
+              factLine2 = fact.createLine(line, m_tax.getAccount(DocTax.ACCTTYPE_TaxCredit, as,
+                  conn), invoice.getCurrency().getId(), "", taxAmt.toString(), Fact_Acct_Group_ID,
+                  nextSeqNo(factLine1.m_SeqNo), documentType, conn);
             }
           }
         }