Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0006600Openbravo ERP09. Financial managementpublic2008-12-17 10:042009-01-02 14:15
networkb 
eduardo_Argal 
immediatemajoralways
closedfixed 
20
2.40 
 
Core
No
0006600: An invoice (AP creditmemo) with negative amount and Cash form of payment creates wrong cash journal line
When an invoice (AP creditmemo) that has form of payment Cash and negative amount is completed (C_INVOICE_POST procedure), the amount of the cash journal line created is wrong. It creates a line in the cash journal but with positive amount when it should be negative.
Then you are not able to post the cash journal because the amount of the line does not match with the amount of the dept payment.
1-Create a purchase invoice with form of payment cash and Transaction Document: AP creditmemo
2-Create a line with a negative quantity (the total amount is negative)
3-Complete the invoice
4-It will create a cash journal with its line in the same date as the date of the invoice(financial management->Receivables%payables->Transactions->Cash journal)
5-Go to Payment tab and see that the Amount is positive (correct).
6-Go to Cash Journal window and to Lines tab. You will see a new line but the amount has not the quantity like the invoice we have posted. Instead of being negative, it is positive.
6-Try to complete the cash journal, and you get the following error:
Error:
In line10 the amount does not match with amount of the debt payment

Review the procedure C_INVOICE_POST [1] since it is inserting badly the cash journal line when the invoice is of document type AP Credit Memo.

Review line:

INSERT
  INTO C_CASHLINE
    (
      C_CashLine_ID, AD_Client_ID, AD_Org_ID, IsActive,
      Created, CreatedBy, Updated, UpdatedBy,
      C_Cash_ID, C_Debt_Payment_ID, Line, Description,
      Amount, CashType, C_Currency_ID, DiscountAmt,
      WriteOffAmt, IsGenerated
    )
    VALUES
    (
      v_CashLine, v_Client_ID, v_Org_ID, 'Y',
      now(), v_UpdatedBy, now(), v_UpdatedBy,
      v_Cash, v_debtPaymentID, v_line, v_BPartnerName,
      C_Currency_Convert((CASE v_IsSOTrx WHEN 'Y' THEN v_paymentAmount ELSE -v_paymentAmount END), v_Currency_ID, v_CB_Curr,v_DateAcct,NULL,v_Client_ID, v_Org_ID), 'P', v_Currency_ID, 0,
      0, 'Y'
    )

[1] https://dev.openbravo.com/websvn/openbravo/trunk/src-db/database/model/functions/C_INVOICE_POST.xml [^]
No tags attached.
depends on backport 0006612 closed eduardo_Argal An invoice (AP creditmemo) with negative amount and Cash form of payment creates wrong cash journal line 
Issue History
2008-12-17 10:04networkbNew Issue
2008-12-17 10:04networkbAssigned To => rafaroda
2008-12-17 10:04networkbsf_bug_id0 => 2438797
2008-12-17 10:04networkbRegression testing => No
2008-12-17 11:07networkbSummaryWhen a invoice with negative amount is posted and the form of payment is cash the cash journal line is not correct => A invoice (AP creditmemo) with negative amount is posted and the form of payment is cash the cash journal line is not correct
2008-12-17 11:07networkbDescription Updated
2008-12-17 13:34rafarodaSummaryA invoice (AP creditmemo) with negative amount is posted and the form of payment is cash the cash journal line is not correct => An invoice (AP creditmemo) with negative amount and Cash form of payment creates wrong cash journal line
2008-12-17 13:34rafarodaDescription Updated
2008-12-17 13:34rafarodaProposed Solution updated
2008-12-17 13:34rafarodaSteps to Reproduce Updated
2008-12-17 13:35rafarodaStatusnew => scheduled
2008-12-17 13:35rafarodaAssigned Torafaroda => eduardo_Argal
2008-12-17 13:35rafarodafix_in_branch => trunk
2008-12-17 13:57psarobefix_in_branchtrunk =>
2008-12-17 13:57psarobeProposed Solution updated
2008-12-18 17:46svnbotCheckin
2008-12-18 17:46svnbotNote Added: 0011542
2008-12-18 17:46svnbotStatusscheduled => resolved
2008-12-18 17:46svnbotResolutionopen => fixed
2008-12-18 17:46svnbotsvn_revision => 11388
2008-12-18 17:54svnbotCheckin
2008-12-18 17:54svnbotNote Added: 0011547
2008-12-18 17:54svnbotsvn_revision11388 => 11392
2009-01-02 14:15krishnaStatusresolved => closed

Notes
(0011542)
svnbot   
2008-12-18 17:46   
Repository: openbravo
Revision: 11388
Author: eduardoargal
Date: 2008-12-18 17:46:03 +0100 (Thu, 18 Dec 2008)

Fixes bug 0006600: An invoice (AP creditmemo) with negative amount and Cash form of payment creates wrong cash journal line

---
U trunk/src-db/database/model/functions/C_INVOICE_POST.xml
---

https://dev.openbravo.com/websvn/openbravo/?rev=11388&sc=1 [^]
(0011547)
svnbot   
2008-12-18 17:54   
Repository: openbravo
Revision: 11392
Author: eduardoargal
Date: 2008-12-18 17:54:50 +0100 (Thu, 18 Dec 2008)

Fixes bug 0006600: An invoice (AP creditmemo) with negative amount and Cash form of payment creates wrong cash journal line

---
U trunk/src-db/database/model/functions/C_INVOICE_POST.xml
---

https://dev.openbravo.com/websvn/openbravo/?rev=11392&sc=1 [^]