To show only bin/locations with Qty. Available greater than 0, you should extend Where condition for LocationAvailAttribute decorating the INTran.LocationID field:
using PX.Data;
using System;
namespace PX.Objects.IN
{
public class INTransferEntryExt : PXGraphExtension<INTransferEntry>
{
[PXRemoveBaseAttribute(typeof(LocationAvailAttribute))]
[PXMergeAttributes(Method = MergeMethod.Append)]
[LocationAvailCst(typeof(INTran.inventoryID), typeof(INTran.subItemID),
typeof(INTran.siteID), typeof(INTran.tranType), typeof(INTran.invtMult))]
public virtual void INTran_LocationID_CacheAttached(PXCache sender)
{
}
public class LocationAvailCstAttribute : LocationAvailAttribute
{
public LocationAvailCstAttribute(Type inventoryType, Type subItemType,
Type siteIDType, Type TranType, Type InvtMultType)
: base(inventoryType, subItemType, siteIDType, TranType, InvtMultType)
{
var attr = _Attributes[_SelAttrIndex] as PXDimensionSelectorAttribute;
var dimAttr = attr.GetAttribute<PXDimensionAttribute>();
var selAttr = attr.GetAttribute<PXSelectorAttribute>();
var select = selAttr.GetSelect();
select = select.WhereAnd<Where<INLocationStatus.qtyAvail, Greater<Zero>>>();
var newAttr = new PXDimensionSelectorAttribute(DimensionName,
select.GetType(), typeof(INLocation.locationCD),
new Type[]
{
typeof(INLocation.locationCD),
typeof(INLocationStatus.qtyOnHand),
typeof(INLocationStatus.qtyAvail),
typeof(INLocationStatus.active),
typeof(INLocation.primaryItemID),
typeof(INLocation.primaryItemClassID),
typeof(INLocation.receiptsValid),
typeof(INLocation.salesValid),
typeof(INLocation.transfersValid),
typeof(INLocation.projectID),
typeof(INLocation.taskID)
});
_Attributes[_SelAttrIndex] = newAttr;
newAttr.ValidComboRequired = attr.ValidComboRequired;
newAttr.CacheGlobal = attr.CacheGlobal;
newAttr.DirtyRead = attr.DirtyRead;
newAttr.DescriptionField = attr.DescriptionField;
}
}
}
}
With the custom LocationAvailCstAttribute added on the INTran.LocationID field, Location selector will show only bins/locations, for which current Inventory Item Qty. Available is greater than 0: