IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge / found an issue with an invoice line that had a quantity but not amount - and the default product expense account was inactive - the invoice line still tries to post the "comment" line and fails - so the comment line must have both qty and price zero
This commit is contained in:
parent
2498d530d0
commit
396471ba07
|
@ -911,7 +911,7 @@ public class MInvoiceLine extends X_C_InvoiceLine
|
|||
* IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge
|
||||
*/
|
||||
if (getParent().getC_DocTypeTarget().isChargeOrProductMandatory()) {
|
||||
if (getC_Charge_ID() == 0 && getM_Product_ID() == 0 && getPriceEntered().signum() != 0) {
|
||||
if (getC_Charge_ID() == 0 && getM_Product_ID() == 0 && (getPriceEntered().signum() != 0 || getQtyEntered().signum() != 0)) {
|
||||
log.saveError("FillMandatory", Msg.translate(getCtx(), "ChargeOrProductMandatory"));
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -969,7 +969,7 @@ public class MOrderLine extends X_C_OrderLine
|
|||
* IDEMPIERE-178 Orders and Invoices must disallow amount lines without product/charge
|
||||
*/
|
||||
if (getParent().getC_DocTypeTarget().isChargeOrProductMandatory()) {
|
||||
if (getC_Charge_ID() == 0 && getM_Product_ID() == 0 && getPriceEntered().signum() != 0) {
|
||||
if (getC_Charge_ID() == 0 && getM_Product_ID() == 0 && (getPriceEntered().signum() != 0 || getQtyEntered().signum() != 0)) {
|
||||
log.saveError("FillMandatory", Msg.translate(getCtx(), "ChargeOrProductMandatory"));
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue