Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0006612
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Openbravo ERP] 09. Financial managementmajoralways2008-12-17 13:352009-01-25 20:17
ReporternetworkbView Statuspublic 
Assigned Toeduardo_Argal 
PriorityimmediateResolutionfixedFixed in Version2.40MP2
StatusclosedFix in branch2.40Fixed in SCM revision11391
ProjectionnoneETAnoneTarget Version
OSLinux 32 bitDatabaseOracleJava version
OS VersionDatabase versionAnt version
Product Version2.40SCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

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

DescriptionWhen 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.
Steps To Reproduce1-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
Proposed SolutionReview 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 [^]
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0006600 closededuardo_Argal An invoice (AP creditmemo) with negative amount and Cash form of payment creates wrong cash journal line 

-  Notes
(0011546)
svnbot (reporter)
2008-12-18 17:53

Repository: openbravo
Revision: 11391
Author: eduardoargal
Date: 2008-12-18 17:53:24 +0100 (Thu, 18 Dec 2008)

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

---
U branches/r2.40/src-db/database/model/functions/C_INVOICE_POST.xml
---

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

- Issue History
Date Modified Username Field Change
2008-12-17 13:35 rafaroda New Issue
2008-12-17 13:35 rafaroda Assigned To => eduardo_Argal
2008-12-17 13:35 rafaroda Status new => scheduled
2008-12-17 13:58 psarobe Proposed Solution updated
2008-12-18 17:53 svnbot Checkin
2008-12-18 17:53 svnbot Note Added: 0011546
2008-12-18 17:53 svnbot Status scheduled => resolved
2008-12-18 17:53 svnbot Resolution open => fixed
2008-12-18 17:53 svnbot svn_revision => 11391
2009-01-25 20:17 psarobe Regression testing => No
2009-01-25 20:17 psarobe Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker