details:   https://code.openbravo.com/erp/devel/pi/rev/6ff1238ec5b0
changeset: 14074:6ff1238ec5b0
user:      Mikel Irurita <mikel.irurita <at> openbravo.com>
date:      Mon Oct 24 13:52:44 2011 +0200
summary:   Fixes issue 18784: Tax Payment process should properly manage 
Reverse Purchase/Sales invoices

diffstat:

 src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters.java      |  3 
++-
 src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters_data.xsql |  2 
+-
 2 files changed, 3 insertions(+), 2 deletions(-)

diffs (25 lines):

diff -r e5af0079aa01 -r 6ff1238ec5b0 
src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters.java
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters.java       
Mon Oct 24 12:34:40 2011 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters.java       
Mon Oct 24 13:52:44 2011 +0200
@@ -218,7 +218,8 @@
             return myMessage;
           }
           if (myinvoice.docbasetype.equals(DocInvoice.DOCTYPE_APCredit)
-              || myinvoice.docbasetype.equals(DocInvoice.DOCTYPE_ARCredit)) {
+              || myinvoice.docbasetype.equals(DocInvoice.DOCTYPE_ARCredit)
+              || "Y".equals(myinvoice.isreversal)) { // isreversal means 
credit memo
             strTaxBaseAmt = (new 
BigDecimal(strTaxBaseAmt).negate()).toPlainString();
             strTaxAmt = (new BigDecimal(strTaxAmt).negate()).toPlainString();
             strTaxUndeducAmt = (new 
BigDecimal(strTaxUndeducAmt).negate()).toPlainString();
diff -r e5af0079aa01 -r 6ff1238ec5b0 
src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters_data.xsql
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters_data.xsql  
Mon Oct 24 12:34:40 2011 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters_data.xsql  
Mon Oct 24 13:52:44 2011 +0200
@@ -33,7 +33,7 @@
          case when C_Invoice.C_Currency_ID = (select c_currency_id from 
c_taxpayment where c_taxpayment_id = ? ) then C_InvoiceTax.TaxBaseAmt else
          C_Currency_Convert(C_InvoiceTax.TaxBaseAmt ,C_Invoice.C_Currency_ID, 
(select c_currency_id from c_taxpayment where c_taxpayment_id = ? ),
          coalesce(C_invoice.TaxDate, C_invoice.DateAcct), 'S', 
c_invoice.ad_client_id, c_invoice.ad_org_id) end as TaxBaseAmt,
-         C_Tax.C_Tax_ID, C_Tax.IsTaxExempt ,C_Tax.IsTaxUndeductable, 
C_Tax.IsNoVat, C_DocType.DocBaseType
+         C_Tax.C_Tax_ID, C_Tax.IsTaxExempt ,C_Tax.IsTaxUndeductable, 
C_Tax.IsNoVat, C_DocType.DocBaseType, C_DocType.isreversal
          from C_Invoice,
          C_TaxRegister_Type_Lines,
          C_InvoiceTax,

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to