Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0019638Openbravo ERP09. Financial managementpublic2012-02-02 14:022012-03-02 15:34
dalsasua 
eduardo_Argal 
immediatemajoralways
closedfixed 
20Ubuntu 10.10
pi 
3.0MP9pi 
Core
No
0019638: Prepaid account must exists to post an invoice, even if it hasn't got any prepayment
Prepaid account must exists to post an invoice, even if it hasn't got any prepayment
Create a BP. In accounting tab unselect any prepayment account.
Create an invoice with some lines.
Process and post.
Posting will not take place, and this message will be shown:
Error
Account Not Defined For: Vendor Prepayment || Owner: XX || Accounting Schema: XX
diff -r f757e34def52 src/org/openbravo/erpCommon/ad_forms/DocInvoice.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocInvoice.java Thu Feb 02 13:04:52 2012 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/DocInvoice.java Thu Feb 02 13:37:50 2012 +0100
@@ -305,7 +305,8 @@
           fact.createLine(m_payments[i], getAccountBPartner(C_BPartner_ID, as, true, false, conn),
               this.C_Currency_ID, m_payments[i].Amount, "", Fact_Acct_Group_ID, nextSeqNo(SeqNo),
               DocumentType, conn);
- if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)) {
+ if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)
+ && new BigDecimal(m_payments[i].PrepaidAmount).compareTo(ZERO) != 0) {
             fact.createLine(m_payments[i], getAccountBPartner(C_BPartner_ID, as, true, true, conn),
                 this.C_Currency_ID, m_payments[i].PrepaidAmount, "", Fact_Acct_Group_ID,
                 nextSeqNo(SeqNo), DocumentType, conn);
@@ -406,7 +407,8 @@
               nextSeqNo(SeqNo), DocumentType, conn);
           // Pre-payment: Probably not needed as at this point we can not generate pre-payments
           // against ARC. Amount is negated
- if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)) {
+ if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)
+ && new BigDecimal(m_payments[i].PrepaidAmount).compareTo(ZERO) != 0) {
             fact.createLine(m_payments[i], getAccountBPartner(C_BPartner_ID, as, true, true, conn),
                 this.C_Currency_ID, "", prepaidAmount.negate().toString(), Fact_Acct_Group_ID,
                 nextSeqNo(SeqNo), DocumentType, conn);
@@ -493,7 +495,8 @@
           fact.createLine(m_payments[i], getAccountBPartner(C_BPartner_ID, as, false, false, conn),
               this.C_Currency_ID, "", m_payments[i].Amount, Fact_Acct_Group_ID, nextSeqNo(SeqNo),
               DocumentType, conn);
- if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)) {
+ if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)
+ && new BigDecimal(m_payments[i].PrepaidAmount).compareTo(ZERO) != 0) {
             fact.createLine(m_payments[i],
                 getAccountBPartner(C_BPartner_ID, as, false, true, conn), this.C_Currency_ID, "",
                 m_payments[i].PrepaidAmount, Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType,
@@ -597,7 +600,8 @@
               nextSeqNo(SeqNo), DocumentType, conn);
           // Pre-payment: Probably not needed as at this point we can not generate pre-payments
           // against APC. Amount is negated
- if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)) {
+ if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)
+ && new BigDecimal(m_payments[i].PrepaidAmount).compareTo(ZERO) != 0) {
             fact.createLine(m_payments[i],
                 getAccountBPartner(C_BPartner_ID, as, false, true, conn), this.C_Currency_ID,
                 prepaidAmount.negate().toString(), "", Fact_Acct_Group_ID, nextSeqNo(SeqNo),
No tags attached.
related to defect 0019639 closed jonalegriaesarte Localization Pack: Spain Pre-payment account is required not in the ERP 
Issue History
2012-02-02 14:02dalsasuaNew Issue
2012-02-02 14:02dalsasuaAssigned To => eduardo_Argal
2012-02-02 14:02dalsasuaModules => Core
2012-02-02 14:09dalsasuaRelationship addedrelated to 0019639
2012-02-02 14:18eduardo_ArgalStatusnew => scheduled
2012-02-02 14:18eduardo_Argalfix_in_branch => pi
2012-02-02 14:20hgbotCheckin
2012-02-02 14:20hgbotNote Added: 0044811
2012-02-02 14:20hgbotStatusscheduled => resolved
2012-02-02 14:20hgbotResolutionopen => fixed
2012-02-02 14:20hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/cdb3da3521330cbfd5e9c8f164f536e9807e2420 [^]
2012-02-03 16:49psarobeNote Added: 0044869
2012-02-03 16:49psarobeStatusresolved => closed
2012-02-03 16:49psarobeFixed in Version => pi
2012-03-02 15:34hudsonbotCheckin
2012-03-02 15:34hudsonbotNote Added: 0045733

Notes
(0044811)
hgbot   
2012-02-02 14:20   
Repository: erp/devel/pi
Changeset: cdb3da3521330cbfd5e9c8f164f536e9807e2420
Author: Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
Date: Thu Feb 02 14:19:18 2012 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/cdb3da3521330cbfd5e9c8f164f536e9807e2420 [^]

Fixes bug 19638: Prepaid account must exists to post an invoice, even if it hasn't got any prepayment

---
M src/org/openbravo/erpCommon/ad_forms/DocInvoice.java
---
(0044869)
psarobe   
2012-02-03 16:49   
Test:

Remove the prepayment account for hoteles buenas noches
create an invoice and complete it
post the document

I was able to post it without any problems
(0045733)
hudsonbot   
2012-03-02 15:34   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/544d64e0c159 [^]

Maturity status: Test