zoukankan      html  css  js  c++  java
  • How to using code post packingSlip on Quality Orders Form[AX2009]

    For simple user operation posting packing slip with purchase order. we added a function button on Quality Orders Form.

    // VAR Changed by Xie Yu Fan.Fandy 谢宇帆
    void  YIP_PostPurchPackingSlip()
    {
        PurchFormLetter_PackingSlip purchFormLetter;
        SysQueryRun                 chooseLinesQuery;
    
        PurchParmUpdate         purchParmUpdate;
        PurchLine               purchLine;
        PurchParmTable          purchParmTable;
        PurchParmLine           purchParmLine;
        InventDim               inventDim;
        ;
        ttsbegin;
        chooseLinesQuery = new SysQueryRun(querystr(PurchUpdate));
    
        chooseLinesQuery.query().dataSourceTable(tablenum(PurchTable)).addRange(fieldnum(PurchTable, PurchId)).value(queryValue(this.InventRefId));
        chooseLinesQuery.query().dataSourceTable(tablenum(PurchLine)).addRange(fieldnum(PurchLine, InventTransId)).value(queryValue(this.InventRefTransId));
    
        chooseLinesQuery.query().interactive(false);
        chooseLinesQuery.saveUserSetup      (false);
    
        purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip);
    
        purchFormLetter.chooseLinesQuery        (chooseLinesQuery);
        purchFormLetter.purchTable              (PurchTable::find(this.InventRefId));
        purchFormLetter.transDate               (systemdateget());
        purchFormLetter.specQty                 (PurchUpdate::All);
        purchFormLetter.printFormLetter         (NoYes::No);
        purchFormLetter.splitDeliveryInformation(NoYes::No);
        purchFormLetter.sumBy                   (AccountOrder::None);
    
        purchFormLetter.createParmUpdate(false);
        purchFormLetter.chooseLines();
        purchFormLetter.setForUpdatePurchParmTable();
    
        purchParmTable      = purchFormLetter.currentPurchParmTable();
        if (!purchParmTable)
            throw Exception::Break;
    
        purchParmLine       = purchParmLine::findInventTransId(purchParmTable.ParmId,this.InventRefTransId,true);
        if (!purchParmLine)
            throw Exception::Break;
    
        inventDim                   = this.inventDim();
        purchParmLine.InventDimId   = InventDim::findOrCreate(inventDim).inventDimId;
        purchLine                   = PurchLine::findInventTransId(this.InventRefTransId);
        [purchParmLine.ReceiveNow,  purchParmLine.RemainBefore      , purchParmLine.RemainAfter      ] = purchFormLetter.qtyPurch (purchLine, purchLine.YIP_calcPurchQty(this.Qty));
        [purchParmLine.InventNow,   purchParmLine.RemainBeforeInvent, purchParmLine.RemainAfterInvent] = purchFormLetter.qtyInvent(purchLine, this.Qty);
        purchParmLine.setLineAmount(purchParmLine.ReceiveNow,purchLine);
        purchParmLine.update();
    
        purchFormLetter.reArrangeNow(true);
        purchFormLetter.YIP_parmFromExternalRun(true);
        purchFormLetter.saveLast();
        ttscommit;
        if (purchFormLetter.prompt())
        {
            try
            {
                ttsbegin;
                purchFormLetter.run();
                this.YIP_QCStatus = YIP_QCStatus::PackingSlip;
                this.doUpdate();
                ttscommit;
            }
            catch(exception::Error)
            {
                ttsabort;
                throw error("Catch an error exception.");
            }
            catch(exception::CLRError)
            {
                ttsabort;
                throw error(AifUtil::getClrErrorMessage());
            }
        }
    }
  • 相关阅读:
    Title
    2019 年 Java 最新面试指南共 80 题,赶快收藏起来吧!
    1+x证书《Web前端开发》等级考试样题
    云服务器、VPS、虚拟主机三者之间的区别?
    1+X”中级Web前端证书对应课程分析
    轻松装Win10:VMware Workstation 12虚拟机下载
    网站收录提交入口
    使用coding和hexo快速搭建博客
    宝塔安装Lsky Pro图床教程
    jsDeliver+github使用教程,免费的cdn
  • 原文地址:https://www.cnblogs.com/Fandyx/p/3620571.html
Copyright © 2011-2022 走看看