zoukankan      html  css  js  c++  java
  • Find out the different MOQ of purchase price

    static void Jimmy_priceDiscTableFromMOQ(Args _args)
    {
        priceDiscTable  priceDiscTable;
        test            test;
        int             i;
    ;
        ttsbegin;
        test.selectForUpdate(true);
        while select test order by test.ItemId
        {
            test.VendAccount = "";
            test.Currency    = "";
            test.Price2     = 0;
            test.Price01    = 0;
            test.Price02    = 0;
            test.Price03    = 0;
            test.Price04    = 0;
            test.Name       = InventTable::find(test.ItemId).ItemName;
            
            while select priceDiscTable
                where priceDiscTable.ItemCode       == TableGroupAll::Table
                &&    priceDiscTable.AccountCode    == TableGroupAll::Table
                &&    priceDiscTable.relation       == PriceType::PricePurch
                &&    priceDiscTable.Module         == ModuleInventCustVend::Vend
                &&    priceDiscTable.ItemRelation   == test.ItemId
                &&   (systemdateget() >= priceDiscTable.fromDate || !priceDiscTable.fromDate) &&
                     (systemdateget() <= priceDiscTable.toDate   || !priceDiscTable.toDate  )
                &&   (priceDiscTable.QuantityAmount == 1         ||  priceDiscTable.QuantityAmount == 2000
                ||    priceDiscTable.QuantityAmount == 5000      ||  priceDiscTable.QuantityAmount == 10000
                ||    priceDiscTable.QuantityAmount == 20000)
             {
                i++;
                test.VendAccount = priceDiscTable.AccountRelation;
                test.Currency    = priceDiscTable.Currency;
                switch(priceDiscTable.QuantityAmount)
                {
                    case 1 :
                        test.Price2  = priceDiscTable.Amount;break;
                    case 2000 :
                        test.Price01 = priceDiscTable.Amount;break;
                    case 5000 :
                        test.Price02 = priceDiscTable.Amount;break;
                    case 10000 :
                        test.Price03 = priceDiscTable.Amount;break;
                    case 20000 :
                        test.Price04 = priceDiscTable.Amount;break;
                    default :
                        break;
                }
             }
             test.doupdate();
         }
         ttscommit;
         info(strfmt("Total updated %1 records!",i));
    }
    
  • 相关阅读:
    java读写文本文件
    django学习<二>:连接数据库
    【MongoDB】递归获取字段更新表达式,更新复杂数据类型对象
    【MongoDB】C#中的Mongo数据类型转换
    【MongoDB】 基于C#官方驱动2.2版的封装类
    【Python】 属性的 get 与 set 方法
    【基础知识】UML基础
    【C#】 知乎用户网络爬虫
    【C#】MVC项目中搭建WebSocket服务器
    【MongoDB】 Windows 安装
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1886645.html
Copyright © 2011-2022 走看看