BF [ 2584839 ] Null locator when create Receipt from Invoice
https://sourceforge.net/tracker/index.php?func=detail&aid=2584839&group_id=176962&atid=879332
This commit is contained in:
parent
2e60e57aa4
commit
0033aa028c
|
|
@ -1018,8 +1018,7 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
|
||||||
KeyNamePair pp = null ;
|
KeyNamePair pp = null ;
|
||||||
if(M_Locator_ID == 0)
|
if(M_Locator_ID == 0)
|
||||||
{
|
{
|
||||||
|
MLocator locator = getM_Locator();
|
||||||
MLocator locator = getM_Warehouse().getDefaultLocator();
|
|
||||||
if (locator != null)
|
if (locator != null)
|
||||||
{
|
{
|
||||||
pp = new KeyNamePair(locator.get_ID(), locator.getValue());
|
pp = new KeyNamePair(locator.get_ID(), locator.getValue());
|
||||||
|
|
@ -1033,12 +1032,28 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the Warehouse from Order
|
* Get Locator from Order or locatorField
|
||||||
* @return MWarehouse
|
* @return MLocator
|
||||||
*/
|
*/
|
||||||
protected MWarehouse getM_Warehouse()
|
protected MLocator getM_Locator()
|
||||||
{
|
{
|
||||||
return MWarehouse.get(p_order.getCtx(),p_order.getM_Warehouse_ID());
|
MLocator locator = null;
|
||||||
|
if (p_order != null)
|
||||||
|
{
|
||||||
|
MWarehouse wh = MWarehouse.get(Env.getCtx(), p_order.getM_Warehouse_ID());
|
||||||
|
if (wh != null)
|
||||||
|
{
|
||||||
|
locator = wh.getDefaultLocator();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (locator == null)
|
||||||
|
{
|
||||||
|
Integer M_Locator_ID = (Integer) locatorField.getValue();
|
||||||
|
if (M_Locator_ID != null && M_Locator_ID > 0)
|
||||||
|
{
|
||||||
|
locator = MLocator.get(Env.getCtx(), M_Locator_ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return locator;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // VCreateFromShipment
|
} // VCreateFromShipment
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue