IDEMPIERE-4854 Bugfixes in InOutGenerate (#753)

InOutGenerate.createLine(): The Process would sometimes generate
multiple inout lines from a single product lot/asi.
InOutGenerate.prepare(): moved date setting code out of the loop.

Co-authored-by: Andreas <sumerauer@kanzlei-wmv.de>
This commit is contained in:
Andreas Sumerauer 2021-11-12 23:34:51 +01:00 committed by GitHub
parent 9c747a6f0d
commit e405daf52e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 16 deletions

View File

@ -120,15 +120,14 @@ public class InOutGenerate extends SvrProcess
p_DateShipped = (Timestamp)para[i].getParameter(); p_DateShipped = (Timestamp)para[i].getParameter();
else else
log.log(Level.SEVERE, "Unknown Parameter: " + name); log.log(Level.SEVERE, "Unknown Parameter: " + name);
// juddm - added ability to specify a shipment date from Generate Shipments
if (p_DateShipped == null) {
m_movementDate = Env.getContextAsDate(getCtx(), Env.DATE);
if (m_movementDate == null)
m_movementDate = new Timestamp(System.currentTimeMillis());
} else
m_movementDate = p_DateShipped;
} }
// juddm - added ability to specify a shipment date from Generate Shipments
if (p_DateShipped == null) {
m_movementDate = Env.getContextAsDate(getCtx(), Env.DATE);
if (m_movementDate == null)
m_movementDate = new Timestamp(System.currentTimeMillis());
} else
m_movementDate = p_DateShipped;
} // prepare } // prepare
/** /**
@ -495,16 +494,14 @@ public class InOutGenerate extends SvrProcess
int M_Locator_ID = storage.getM_Locator_ID(); int M_Locator_ID = storage.getM_Locator_ID();
// //
MInOutLine line = null; MInOutLine line = null;
if (orderLine.getM_AttributeSetInstance_ID() == 0) // find line with Locator int olAsiID = orderLine.getM_AttributeSetInstance_ID();
for (int ll = 0; ll < list.size(); ll++)
{ {
for (int ll = 0; ll < list.size(); ll++) MInOutLine test = (MInOutLine)list.get(ll);
if (test.getM_Locator_ID() == M_Locator_ID && test.getM_AttributeSetInstance_ID() == olAsiID)
{ {
MInOutLine test = (MInOutLine)list.get(ll); line = test;
if (test.getM_Locator_ID() == M_Locator_ID && test.getM_AttributeSetInstance_ID() == 0) break;
{
line = test;
break;
}
} }
} }
if (line == null) // new line if (line == null) // new line