IDEMPIERE-3761 Process "Create AP Expense Invoices" creates wrong AP and expense postings if product's price list "isTaxIncluded=Y"
This commit is contained in:
parent
1e208691d0
commit
bfcf88748a
|
@ -25,6 +25,7 @@ import org.compiere.model.MBPartner;
|
||||||
import org.compiere.model.MDocType;
|
import org.compiere.model.MDocType;
|
||||||
import org.compiere.model.MInvoice;
|
import org.compiere.model.MInvoice;
|
||||||
import org.compiere.model.MInvoiceLine;
|
import org.compiere.model.MInvoiceLine;
|
||||||
|
import org.compiere.model.MPriceList;
|
||||||
import org.compiere.model.MTimeExpense;
|
import org.compiere.model.MTimeExpense;
|
||||||
import org.compiere.model.MTimeExpenseLine;
|
import org.compiere.model.MTimeExpenseLine;
|
||||||
import org.compiere.util.DB;
|
import org.compiere.util.DB;
|
||||||
|
@ -136,6 +137,10 @@ public class ExpenseAPInvoice extends SvrProcess
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
invoice.setM_PriceList_ID(te.getM_PriceList_ID());
|
invoice.setM_PriceList_ID(te.getM_PriceList_ID());
|
||||||
|
|
||||||
|
MPriceList pl = MPriceList.get(getCtx(), te.getM_PriceList_ID(), get_TrxName());
|
||||||
|
invoice.setIsTaxIncluded(pl.isTaxIncluded());
|
||||||
|
|
||||||
invoice.setSalesRep_ID(te.getDoc_User_ID());
|
invoice.setSalesRep_ID(te.getDoc_User_ID());
|
||||||
StringBuilder descr = new StringBuilder().append(Msg.translate(getCtx(), "S_TimeExpense_ID"))
|
StringBuilder descr = new StringBuilder().append(Msg.translate(getCtx(), "S_TimeExpense_ID"))
|
||||||
.append(": ").append(te.getDocumentNo()).append(" " )
|
.append(": ").append(te.getDocumentNo()).append(" " )
|
||||||
|
@ -182,6 +187,7 @@ public class ExpenseAPInvoice extends SvrProcess
|
||||||
//
|
//
|
||||||
// il.setPrice(); // not really a list/limit price for reimbursements
|
// il.setPrice(); // not really a list/limit price for reimbursements
|
||||||
il.setPrice(line.getPriceReimbursed()); //
|
il.setPrice(line.getPriceReimbursed()); //
|
||||||
|
|
||||||
il.setTax();
|
il.setTax();
|
||||||
if (!il.save())
|
if (!il.save())
|
||||||
throw new IllegalStateException("Cannot save Invoice Line");
|
throw new IllegalStateException("Cannot save Invoice Line");
|
||||||
|
|
Loading…
Reference in New Issue