Page 1 of 1

Business Bug - Generate Shipment from SO get posted!

PostPosted: Tue Aug 24, 2004 8:44 pm
by red1
This is the first business bug i m filing. When u 'CO' a Sales Order, and then Generate Shipment (Manual) it does that but completes and posted it automatically! Sounds 8) to us techies but that is wrong according to our n2n :shock: - accountant and biz whiz, saying that the user may want to examine the shipment first, such as split it, check its packaging, etc. Thus we have to trace the codes, and make it stop completing the shipment process during generation and just merely "prepare" it. So here is the snippet from InOutGenerate.java: (in BASE folder org.compiere.process)

private void completeShipment()
{
if (m_shipment != null)
{
// Fails if there is a confirmation
if (!m_shipment.processIt(DocAction.ACTION_Prepare)) //red1 formerly ACTION_Complete
log.warn("completeShipment - failed: " + m_shipment);
m_shipment.save();
//
addLog(m_shipment.getM_InOut_ID(), m_shipment.getMovementDate(), null, m_shipment.getDocumentNo());
m_created++;
}
m_shipment = null;
} // completeOrder


It took me about three hours to nail this. Then i tested it, checking the warehouse inventory, before and after processing it thru completion.

PostPosted: Tue Aug 24, 2004 9:16 pm
by red1
This is the equivalent in InvoiceGenerate.java (BASE org.compeire.process)

private void completeInvoice()
{
if (m_invoice != null)
{
if (!m_invoice.processIt(DocAction.ACTION_Prepare)) //red1 formerly ACTION_Complete
log.warn("completeInvoice - failed: " + m_invoice);
m_invoice.save();
//
addLog(m_invoice.getC_Invoice_ID(), m_invoice.getDateInvoiced(), null, m_invoice.getDocumentNo());
m_created++;
}
m_invoice = null;
m_ship = null;
} // completeInvoice