details: /erp/devel/pi/rev/fb8df49a0cc3
changeset: 8745:fb8df49a0cc3
user: Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
date: Tue Oct 26 11:58:14 2010 +0200
summary: Fixes bug 0014825, 0014931
diffstat:
src/org/openbravo/erpCommon/ad_forms/DocInvoice.java | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diffs (41 lines):
diff -r 0f75f9ed2c72 -r fb8df49a0cc3
src/org/openbravo/erpCommon/ad_forms/DocInvoice.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocInvoice.java Tue Oct 26
13:06:52 2010 +0530
+++ b/src/org/openbravo/erpCommon/ad_forms/DocInvoice.java Tue Oct 26
11:58:14 2010 +0200
@@ -353,12 +353,16 @@
}
else
for (int i = 0; m_payments != null && i < m_payments.length; i++) {
+ BigDecimal amount = new BigDecimal(m_payments[i].Amount);
+ BigDecimal prepaidAmount = new
BigDecimal(m_payments[i].PrepaidAmount);
fact.createLine(m_payments[i], getAccountBPartner(C_BPartner_ID, as,
true, false, conn),
- this.C_Currency_ID, "", getConvertedAmt(m_payments[i].Amount,
+ this.C_Currency_ID, "",
getConvertedAmt(amount.negate().toString(),
m_payments[i].C_Currency_ID_From, this.C_Currency_ID,
DateAcct, "", conn),
Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn);
+ // Pre-payment: Probably not needed as at this point we can not
generate pre-payments
+ // against ARC. Amount is negated
fact.createLine(m_payments[i], getAccountBPartner(C_BPartner_ID, as,
true, true, conn),
- this.C_Currency_ID, "",
getConvertedAmt(m_payments[i].PrepaidAmount,
+ this.C_Currency_ID, "",
getConvertedAmt(prepaidAmount.negate().toString(),
m_payments[i].C_Currency_ID_From, this.C_Currency_ID,
DateAcct, "", conn),
Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn);
}
@@ -469,12 +473,16 @@
}
else
for (int i = 0; m_payments != null && i < m_payments.length; i++) {
+ BigDecimal amount = new BigDecimal(m_payments[i].Amount);
+ BigDecimal prepaidAmount = new
BigDecimal(m_payments[i].PrepaidAmount);
fact.createLine(m_payments[i], getAccountBPartner(C_BPartner_ID, as,
false, false, conn),
- this.C_Currency_ID, getConvertedAmt(m_payments[i].Amount,
+ this.C_Currency_ID, getConvertedAmt(amount.negate().toString(),
m_payments[i].C_Currency_ID_From, this.C_Currency_ID,
DateAcct, "", conn), "",
Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn);
+ // Pre-payment: Probably not needed as at this point we can not
generate pre-payments
+ // against APC. Amount is negated
fact.createLine(m_payments[i], getAccountBPartner(C_BPartner_ID, as,
false, true, conn),
- this.C_Currency_ID, getConvertedAmt(m_payments[i].PrepaidAmount,
+ this.C_Currency_ID,
getConvertedAmt(prepaidAmount.negate().toString(),
m_payments[i].C_Currency_ID_From, this.C_Currency_ID,
DateAcct, "", conn), "",
Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn);
}
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits