计算现有量

static void jay_getInventSum(Args _args)
{
    InventDim           inventDim;
    inventDimParm       inventDimParm;
    InventOnhand        inventOnhand;
    InventLocationId    inventLocationId = "J-001";
    InventBatchId       inventBatchId = "J-000003";
    ItemId              itemId = "J-iphone4";
            
    Qty                 qty = 0;
    ;
            
    inventDim.InventLocationId  = inventLocationId;
    inventDim.InventBatchId     = inventBatchId;

    inventDimParm.initFromInventDim(inventDim);
    inventOnhand = InventOnhand::newParameters(itemId, inventDim, inventDimParm);

    qty = inventOnHand.inventSum().availPhysical();

    info(num2str(qty, 2, 2, 1, 2));
}

 

//计算某一天的现有量

static void findingOnHandByDate(Args _args)

{
    ItemId itemId;
    InventDim inventDimCriteria;
    InventDimParm inventDimParm;
    InventSumDateDim inventSumDateDim;
    ;
    // Specify the item to get onhand info on
    itemId = "1001";
    inventDimCriteria.InventColorId = "02";
    inventDimParm.initFromInventDim(inventDimCriteria);
    inventSumDateDim =
    InventSumDateDim::newParameters(mkdate(01,01,2009),
    itemId,
    inventDimCriteria,
    inventDimParm);
    info(strfmt("PostedQty: %1",inventSumDateDim.postedQty()));
    info(strfmt("DeductedQty: %1",inventSumDateDim.deductedQty()));
    info(strfmt("ReceivedQty: %1",inventSumDateDim.receivedQty()));
}

 

//现有量查询

static void jay_testInventSumQuery(Args _args)
{
query q;
queryRun qr;
InventSum inventSum;
InventDim inventDim;
InventDim inventDimValue;
InventDimParm inventDimParmCriteria;
inventDimParm inventDimParmGroupBy;
inventSumDateValueReportDim inventSumDateValueReportDim;

;
//维度(Dimension)条件
inventDimValue.InventLocationId = "NNLLC";
//inventDimValue.configId = "NZ-R";
//inventDimValue.inventBatchId = "00000000-000000";

//维度显示(有效)参数 过滤条件
inventDimParmCriteria.ItemIdFlag = NoYes::Yes;
//inventDimParmCriteria.InventLocationIdFlag = NoYes::Yes;
//inventDimParmCriteria.ConfigIdFlag = NoYes::Yes;
//inventDimParmCriteria.InventBatchIdFlag = NoYes::Yes;

//维度汇总参数
inventDimParmGroupBy.ItemIdFlag = NoYes::Yes;
//inventDimParmGroupBy.ConfigIdFlag = NoYes::Yes;
inventDimParmGroupBy.InventSiteIdFlag = NoYes::Yes;
//inventDimParmGroupBy.InventLocationIdFlag = NoYes::Yes;
//inventDimParmGroupBy.InventBatchIdFlag = NoYes::Yes;

q = new Query();
InventSum::newQuery(q,"Pro-000330",inventDimValue,inventDimParmCriteria,inventDimParmGroupBy);

//info(q.dataSourceNo(1).toString());

qr = new QueryRun(q);
while (qr.next())
{
inventDim = qr.get(tableNum(InventDim));
inventSum = qr.get(tableNum(InventSum));

info(num2str(inventSum.AvailPhysical, 2, 2, 2, 2) + " " + num2str(inventSum.PhysicalInvent, 2, 2, 2, 2));
}
}

转载于:https://www.cnblogs.com/xiangliqi/p/4543732.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值