diff --git a/base/src/org/compiere/model/CalloutPayment.java b/base/src/org/compiere/model/CalloutPayment.java index e1395c07f4..864e8bbc62 100644 --- a/base/src/org/compiere/model/CalloutPayment.java +++ b/base/src/org/compiere/model/CalloutPayment.java @@ -270,9 +270,21 @@ public class CalloutPayment extends CalloutEngine return "PaymentDocTypeInvoiceInconsistent"; } } + + // globalqss - Allow prepayment to Purchase Orders // Order Waiting Payment (can only be SO) - if (C_Order_ID != 0 && dt != null && !dt.isSOTrx()) + // if (C_Order_ID != 0 && dt != null && !dt.isSOTrx()) + // return "PaymentDocTypeInvoiceInconsistent"; + // Order + if (C_Order_ID != 0) + { + MOrder ord = new MOrder (ctx, C_Order_ID, null); + if (dt != null) + { + if (ord.isSOTrx() != dt.isSOTrx()) return "PaymentDocTypeInvoiceInconsistent"; + } + } return ""; } // docType diff --git a/migration/330-trunk/009_FR_1788114.sql b/migration/330-trunk/009_FR_1788114.sql new file mode 100644 index 0000000000..a293174a47 --- /dev/null +++ b/migration/330-trunk/009_FR_1788114.sql @@ -0,0 +1,6 @@ +UPDATE AD_VAL_RULE + SET code = + '(C_Order.DocStatus=''WP'' OR (C_Order.DocStatus=''CO'' AND EXISTS (SELECT * FROM C_DocType dt WHERE C_Order.C_DocType_ID=dt.C_DocType_ID AND (dt.DocSubTypeSO=''SO'' OR dt.DocBaseType=''POO'')) AND EXISTS (SELECT * FROM C_OrderLine ol WHERE C_Order.C_Order_ID=ol.C_Order_ID AND ol.QtyInvoiced<>ol.QtyOrdered)))' + WHERE ad_val_rule_id = 218; + +COMMIT; \ No newline at end of file