details:   /erp/devel/pi/rev/eeb3790fec5b
changeset: 12247:eeb3790fec5b
user:      Adrián Romero <adrianromero <at> openbravo.com>
date:      Thu May 19 16:18:14 2011 +0200
summary:   Fixes issue 0017273: When voiding an invoice Accounting dimensions 
should be transferred
When voiding an invoice, it has been added the code needed to copy the 
Accounting Dimensions of the reversal invoice.

diffstat:

 src-db/database/model/functions/C_INVOICE_POST.xml |  18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diffs (35 lines):

diff -r f50511381b8b -r eeb3790fec5b 
src-db/database/model/functions/C_INVOICE_POST.xml
--- a/src-db/database/model/functions/C_INVOICE_POST.xml        Thu May 19 
12:28:48 2011 +0200
+++ b/src-db/database/model/functions/C_INVOICE_POST.xml        Thu May 19 
16:18:14 2011 +0200
@@ -51,6 +51,7 @@
   Cur_Parameter RECORD;
   Cur_line RECORD;
   Cur_InvoiceLine RECORD;
+  Cur_InvoiceLineAcctDim RECORD;
   Cur_Discount RECORD;
   Cur_CInvoiceDiscount RECORD;
   Cur_TaxDiscount RECORD;
@@ -576,6 +577,23 @@
               Updated = now(),
               UpdatedBy=v_UpdatedBy
           WHERE C_OrderLine_ID=Cur_InvoiceLine.C_OrderLine_ID; */
+
+          -- Create Reversal Accounting Dimensions
+          FOR Cur_InvoiceLineAcctDim IN
+          (SELECT *
+           FROM C_INVOICELINE_ACCTDIMENSION
+           WHERE C_InvoiceLine_ID=Cur_InvoiceLine.C_InvoiceLine_ID)
+            LOOP
+                    
+            INSERT INTO C_INVOICELINE_ACCTDIMENSION(
+            c_invoiceline_acctdimension_id, ad_client_id, ad_org_id, isactive, 
created, createdby, updated, updatedby, c_invoiceline_id, 
+            amt, c_project_id, c_campaign_id, user1_id, user2_id) 
+            values(
+            get_uuid(), Cur_InvoiceLineAcctDim.ad_client_id, 
Cur_InvoiceLineAcctDim.ad_org_id, Cur_InvoiceLineAcctDim.isactive, now(), 
v_UpdatedBy, now(), v_UpdatedBy, v_NextNo,
+            Cur_InvoiceLineAcctDim.amt * -1, 
Cur_InvoiceLineAcctDim.c_project_id, Cur_InvoiceLineAcctDim.c_campaign_id, 
Cur_InvoiceLineAcctDim.user1_id, Cur_InvoiceLineAcctDim.user2_id);
+
+            END LOOP; -- Create Reversal Accounting Dimensions
+
         END LOOP; -- Create Reversal Invoice Lines
         -- Close Invoice
         UPDATE C_INVOICE

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to