FR [ 1788114 ] Prepayments on purchases

This commit is contained in:
Carlos Ruiz 2007-09-04 23:33:41 +00:00
parent 9096fbb3fb
commit 5de5a8efe9
2 changed files with 19 additions and 1 deletions

View File

@ -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

View File

@ -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;