From b29b483ba185b93af81dc2d8c8aa735437a2c4a2 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 1 May 2007 17:00:05 +0000 Subject: [PATCH] [ 1703207 ] Issue when push button Paymenet Rule fo Order Complete Fix bug introduced in revision 2161 (NPE) --- client/src/org/compiere/grid/VPayment.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/client/src/org/compiere/grid/VPayment.java b/client/src/org/compiere/grid/VPayment.java index c71acb88fe..2bd95bd8b3 100644 --- a/client/src/org/compiere/grid/VPayment.java +++ b/client/src/org/compiere/grid/VPayment.java @@ -1023,19 +1023,23 @@ public class VPayment extends CDialog if (cl.save()) { log.config("CashCreated"); - if(invoice == null && C_Invoice_ID != 0) + if (invoice == null && C_Invoice_ID != 0) { invoice = new MInvoice (Env.getCtx(), C_Invoice_ID, null); - } + } + if (invoice != null) { invoice.setC_CashLine_ID(cl.getC_CashLine_ID()); invoice.save(); + } - if(order == null && C_Order_ID != 0) + if (order == null && C_Order_ID != 0) { order = new MOrder (Env.getCtx(), C_Order_ID, null); - } + } + if (order != null) { order.setC_CashLine_ID(cl.getC_CashLine_ID()); order.save(); + } log.config("Update Order & Invoice with CashLine"); } else