From 4c4981533e0541879ee27f35af49dbf28dec8e4a Mon Sep 17 00:00:00 2001 From: Nicolas Micoud <58596990+nmicoud@users.noreply.github.com> Date: Tue, 19 Sep 2023 15:04:18 +0200 Subject: [PATCH] IDEMPIERE-5856: MOrder.setBPartner is not using IsSOTrx for PaymentRule (#2012) * IDEMPIERE-5856: MOrder.setBPartner is not using IsSOTrx for PaymentRule * IDEMPIERE-5856: MOrder.setBPartner is not using IsSOTrx for PaymentRule serial update * IDEMPIERE-5856: MOrder.setBPartner is not using IsSOTrx for PaymentRule if getPaymentRulePO() is null, we fall back to getPaymentRule() --- org.adempiere.base/src/org/compiere/model/MOrder.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MOrder.java b/org.adempiere.base/src/org/compiere/model/MOrder.java index 5fa7a8898e..5c783ef77e 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrder.java +++ b/org.adempiere.base/src/org/compiere/model/MOrder.java @@ -82,7 +82,7 @@ public class MOrder extends X_C_Order implements DocAction /** * generated serial id */ - private static final long serialVersionUID = 1298245367836653594L; + private static final long serialVersionUID = 9095740800513665542L; private static final String BASE_MATCHING_SQL = """ @@ -746,7 +746,10 @@ public class MOrder extends X_C_Order implements DocAction ss = bp.getInvoiceRule(); if (ss != null) setInvoiceRule(ss); - ss = bp.getPaymentRule(); + if (isSOTrx()) + ss = bp.getPaymentRule(); + else + ss = !Util.isEmpty(bp.getPaymentRulePO()) ? bp.getPaymentRulePO() : bp.getPaymentRule(); if (ss != null) setPaymentRule(ss); // Sales Rep