zoukankan      html  css  js  c++  java
  • 获取物料指定日期的库存

    How to get On-Hand inventory of past years (by date)
    Many a times we come accross a requirement from customer to show on hand inventory of last year or some other report of this type as it is not included in the out of box package. I found a very interesting job from the community web site related to this.
     
    static void findingOnHandByDate(Args _args)
    {
    ItemId itemId;
    InventDim inventDimCriteria;
    InventDimParm inventDimParm;
    InventSumDateDim inventSumDateDim;
    TransDate start, finish;
    int c;
    int onHandTotal;
    ;
    start = str2date("1/1/2010", 213);
    finish = str2date("12/31/2010", 213);
    onHandTotal = 0;
    while(start != finish)
    {
    c++;
    // Specify the item to get onhand info on
    itemId = "00017470";
     
    inventSumDateDim =
    InventSumDateDim::newParameters(start,
    itemId,
    inventDimCriteria,
    inventDimParm);
     
    info(strfmt("Date: %1 on hand: %2", start, num2str(inventSumDateDim.postedQty() + inventSumDateDim.receivedQty() - inventSumDateDim.deductedQty(), 0, 2, 1, 1)));
    onHandTotal += (inventSumDateDim.postedQty() + inventSumDateDim.receivedQty() - inventSumDateDim.deductedQty());
    start += 1;
    }
    info(strfmt("Avg on hand per year: %1", onHandTotal / 365));
    }
  • 相关阅读:
    安装.NET FRAMEWORK 4.5安装进度条回滚之后发生严重错误 代码0x80070643
    C#远程时间同步助手软件设计
    Win7+Ubuntu双系统安装完成后时间不一致相差大概8小时
    php中类的不定参数使用示例
    php读写xml基于DOMDocument方法
    php写的非常简单的文件浏览器
    php封装的sqlite操作类
    phpstudy中apache的默认根目录的配置
    实现基于最近邻内插和双线性内插的图像缩放C++实现
    【STL深入理解】vector
  • 原文地址:https://www.cnblogs.com/perock/p/2609581.html
Copyright © 2011-2022 走看看