Fixed wrong checking on whether invoice is linked with order, reported at http://red1.org/adempiere/viewtopic.php?f=31&t=1337

Fixes IDEMPIERE-47 Customer Return - Generate Invoice error
http://jira.idempiere.com/browse/IDEMPIERE-47
This commit is contained in:
Heng Sin Low 2011-08-04 21:36:24 -05:00
parent 2959a43ad9
commit f9fd4b80c5
1 changed files with 3 additions and 3 deletions

View File

@ -107,9 +107,9 @@ public class InOutCreateInvoice extends SvrProcess
if (!line.save())
throw new IllegalArgumentException("Cannot save Invoice Line");
}
MOrder order = new MOrder(getCtx(), invoice.getC_Order_ID(), get_TrxName());
if (order != null) {
if (invoice.getC_Order_ID() > 0) {
MOrder order = new MOrder(getCtx(), invoice.getC_Order_ID(), get_TrxName());
invoice.setPaymentRule(order.getPaymentRule());
invoice.setC_PaymentTerm_ID(order.getC_PaymentTerm_ID());
invoice.saveEx();