Page 1 of 1

FORCE DELIVERY Rule Bug - 251e

PostPosted: Thu Aug 26, 2004 6:22 pm
by red1
InOutGenerate.java of package org.compiere.process again here...
This time when you choose a FORCE DELIVERY rule in your Sales Order, where the stock may not be there, it should still ship according to that rule. However the code logic doesn't do it - but it is corrected as shown:

// Force
else if (MOrder.DELIVERYRULE_Force.equals(order.getDeliveryRule()))
{
BigDecimal deliver = toDeliver;
//red1 if (deliver.compareTo(onHand) > 0) -- shouldn't compare when Force
//red1 deliver = onHand;
log.debug("generate - Force - OnHand=" + onHand
+ ", ToDeliver=" + toDeliver + ", Deliver=" + deliver + " - " + line);
//
createLine (order, line, deliver, storages);
}
= = = = = = = = = = = = = =
// Inventory Lines
BigDecimal toDeliver = qty;
for (int i = 0; i < storages.length; i++)
{
MStorage storage = storages[i];
// TODO Selection of ASI

BigDecimal deliver = toDeliver;
//red1 if (deliver.compareTo(storage.getQtyOnHand()) > 0)
//red1 deliver = storage.getQtyOnHand(); -- redundant as todeliver was vetted above

====================
the second part is commented out because it is redundant as the TODELIVER variable has been checked previously!