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());
            }
        }
    }
  • 相关阅读:
    凤凰网CEO刘爽称鄙视微博连说20个屁示不齿
    科技创业网站
    梦想,在路上
    小本创业
    rails relevent
    MBA = married but available
    把UTF8编码转换为GB2312编码[转]
    FSFS和VDFS存储方式的区别
    如何让phpmyadmin输入密码再进入
    dede后台登陆后一片空白的解决办法汇总
  • 原文地址:https://www.cnblogs.com/Fandyx/p/3620571.html
Copyright © 2011-2022 走看看