1、查询按钮方法:
void clicked()
{
super();
element.executeQuery();
}2、executeQuery方法(Form方法),setTmpData为tmp(InMenory)类型表方法
public void executeQuery()
{
TEK_InventSumShelfLifeTmp l_table;
TEK_InventSumShelfLifeTmp.setTmpData(this.populateRecords());
TEK_InventSumShelfLifeTmp_ds.research();
}3、populateRecords方法(Form方法)
private TEK_InventSumShelfLifeTmp populateRecords()
{
TEK_InventSumShelfLifeTmp l_ret;
InventTable l_item;
InventDim l_dim;
InventBatch l_batch;
InventSum l_inv;
date l_date;
l_date = AsOfDate.dateValue();
while select ItemId
from l_item
where l_item.TEK_ShelfLife > 0
join l_inv
where l_inv.ItemId == l_item.ItemId
&& l_inv.PostedQty + l_inv.Received - l_inv.Deducted
+ l_inv.Registered - l_inv.Picked > 0
join l_dim
where l_inv.InventDimId == l_dim.inventDimId
join l_batch
where l_dim.inventBatchId == l_batch.inventBatchId
&& l_batch.itemId == l_item.ItemId
&& l_batch.expDate <= endmth(l_date)
{
l_ret.clear();
l_ret.ItemId = l_item.ItemId;
l_ret.ItemName = l_inv.itemName();
l_ret.ItemDescription = l_inv.TEK_ItemDescription();
l_ret.UnitId = l_item.inventUnitId();
l_ret.InventLocationId = l_dim.InventLocationId;
l_ret.wMSLocationId = l_dim.wMSLocationId;
l_ret.InventBatchId = l_dim.inventBatchId;
//InventQtyPhysicalOnhand = this.PostedQty + this.Received - this.Deducted + this.Registered - this.Picked;
l_ret.InventQty = l_inv.PostedQty + l_inv.Received - l_inv.Deducted
+ l_inv.Registered - l_inv.Picked;
l_ret.ExpirationDate = l_batch.expDate;
l_ret.insert();
}
return l_ret;
}


留言评论
暂无留言