details: /erp/stable/2.50/rev/c6ef78a1a2f9
changeset: 9444:c6ef78a1a2f9
user: Adrián Romero <adrianromero <at> openbravo.com>
date: Thu May 19 16:12:45 2011 +0200
summary: Fixes issue 0017120: 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 80131c7ad56e -r c6ef78a1a2f9
src-db/database/model/functions/C_INVOICE_POST.xml
--- a/src-db/database/model/functions/C_INVOICE_POST.xml Thu May 19
13:14:38 2011 +0200
+++ b/src-db/database/model/functions/C_INVOICE_POST.xml Thu May 19
16:12:45 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