IDEMPIERE-5782 Generated Shipments/MR and Invoices with Invalid Sales Rep (#1914)

This commit is contained in:
Carlos Ruiz 2023-06-28 04:21:18 +02:00 committed by GitHub
parent 2dbdeb6f77
commit 509e900a0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -78,6 +78,7 @@ public class CalloutInOut extends CalloutEngine
mTab.setValue("FreightAmt", order.getFreightAmt());
mTab.setValue("C_BPartner_ID", Integer.valueOf(order.getC_BPartner_ID()));
mTab.setValue("SalesRep_ID", Integer.valueOf(order.getSalesRep_ID()));
//[ 1867464 ]
mTab.setValue("C_BPartner_Location_ID", Integer.valueOf(order.getC_BPartner_Location_ID()));

View File

@ -2957,6 +2957,7 @@ public class MInOut extends X_M_InOut implements DocAction, IDocsPostProcess
setC_Project_ID(order.getC_Project_ID());
setC_Campaign_ID(order.getC_Campaign_ID());
setC_Activity_ID(order.getC_Activity_ID());
setSalesRep_ID (order.getSalesRep_ID());
setUser1_ID(order.getUser1_ID());
setUser2_ID(order.getUser2_ID());

View File

@ -392,7 +392,8 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess
setDateInvoiced(invoiceDate);
setDateAcct(getDateInvoiced());
//
setSalesRep_ID(ship.getSalesRep_ID());
if (getSalesRep_ID() == 0)
setSalesRep_ID(ship.getSalesRep_ID());
} // MInvoice
/**
@ -625,6 +626,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess
setC_BPartner_Location_ID(order.getBill_Location_ID());
// Overwrite Contact
setAD_User_ID(order.getBill_User_ID());
setSalesRep_ID(order.getSalesRep_ID());
//
}
// Check if Shipment/Receipt is based on RMA
@ -3208,6 +3210,7 @@ public class MInvoice extends X_C_Invoice implements DocAction, IDocsPostProcess
{
setPaymentRule(order.getPaymentRule());
setC_PaymentTerm_ID(order.getC_PaymentTerm_ID());
setSalesRep_ID(order.getSalesRep_ID());
saveEx();
load(get_TrxName()); // refresh from DB
// copy payment schedule from order if invoice doesn't have a current payment schedule