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:
Carlos Ruiz 2016-11-03 23:06:49 +01:00
parent 2498d530d0
commit 396471ba07
2 changed files with 2 additions and 2 deletions

View File

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

View File

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