zoukankan      html  css  js  c++  java
  • AX 2012 purch Charge费用作成

    public void CreateUpdateMiscCharge(MarkupCode _markupCode ,MarkUpValue _freightCharge, boolean _createOK=true)
    {

        MarkUpTrans     markUpTrans, localMarkUpTrans;
        MarkUpValue     freight;

        PurchTable      purchTable;
        ;
     
        if(_markupCode == "" || _freightCharge ==0)
        {
            return;
        }

        purchTable = PurchTable::find(SNY_HachuTable.Z_PurchId);

        freight = decRound(_freightCharge, 2);

        ttsbegin;
       
      
        select firstonly forupdate markUpTrans
            where markUpTrans.TransTableId == purchTable.TableId &&
                  markUpTrans.TransRecId   == purchTable.RecId   &&
                  markUpTrans.MarkupCode   == _markupCode;

        if (markUpTrans)
        {
            markUpTrans.Txt             = MarkUpTable::find(markUpTrans.ModuleType,_markupCode).Txt;
            markUpTrans.Value           = freight;
            markUpTrans.Keep            = NoYes::Yes;
            markUpTrans.MarkupCategory  = MarkupCategory::Fixed;
            markUpTrans.update();
        }
        else if (_createOK)
        {
            //check if SomeCode1 is there and bump up the line number if so, so it creates a new record
            select firstonly localMarkUpTrans
            where localMarkUpTrans.TransTableId == purchTable.TableId &&
                     localMarkUpTrans.TransRecId   == purchTable.RecId   &&
                     localMarkUpTrans.MarkupCode   == _markupCode;
            if(localMarkUpTrans)
            {
                markUpTrans.LineNum = localMarkUpTrans.LineNum + 1;
            }

            markUpTrans.initFromPurchTable(purchTable);
            markUpTrans.MarkupCode      = _markupCode;
            markUpTrans.Txt             = MarkUpTable::find(markUpTrans.ModuleType,_markupCode).Txt;
            markUpTrans.Value           = freight;
            markUpTrans.Keep            = NoYes::Yes;
            markUpTrans.MarkupCategory  = MarkupCategory::Fixed;
            markUpTrans.insert();
        }
        ttscommit;


    }

  • 相关阅读:
    Java项目中加载properties文件的方式
    第十一篇 JVM之运行时数据区<7>: 本地方法栈
    第十七篇 JVM之运行时数据区<13>: 字符串常量池
    第十四篇 JVM之运行时数据区<10>: 对象分配过程
    基于zxing工具生成二维码
    第十八篇 JVM之运行时数据区<14>: 方法区的垃圾收集
    第十六篇 JVM之运行时数据区<12>: 方法区
    第十二篇 JVM之运行时数据区<8>: Java堆
    圣诞
    LeetCode 748 最短补全词
  • 原文地址:https://www.cnblogs.com/fogfog/p/6122839.html
Copyright © 2011-2022 走看看