Thursday 19 January 2017

job for posting SO

static void PostSO(Args _args)
{


    SalesTable                  salesTable;
    SalesFormLetter             salesFormLetter;
    SalesFormLetter_PackingSlip packingSlip;
    SalesFormLetter_Invoice     invoice;
    CustInvoiceJour             custInvoiceJour;
    str                         parmArgs;
    DmsInterCompanyPO           interCompanyPO = new DmsInterCompanyPO();

    salesTable = SalesTable::find('E618-002657'); //_args.record();
    //parmArgs = _args.parm();

    try
    {
        ttsBegin;


        salesFormLetter = SalesFormLetter::construct(DocumentStatus::Confirmation);
        salesFormLetter.update(salesTable);

        //for intercompany order
        /*
        if (parmArgs != "IntercompanyTransferOrder")
        {
            interCompanyPO.run(SalesTable.SalesId);
        }
        */

        packingSlip = salesFormLetter::construct(DocumentStatus::PackingSlip);
        packingSlip.showQueryForm(false);
        packingSlip.update(salesTable,today(),SalesUpdate::All,AccountOrder::None,false,false);

        invoice = salesFormLetter::construct(DocumentStatus::Invoice);
        invoice.showQueryForm(false);
        invoice.update(salesTable,today(),SalesUpdate::PackingSlip,AccountOrder::None,false,false);


        ttsCommit;

        select InvoiceId from custInvoiceJour order by InvoiceId where custInvoiceJour.SalesId == salesTable.SalesId;
        info(strFmt("@DMS1834",custInvoiceJour.InvoiceId));
    }
    catch
    {
        ttsAbort;
        error("@DMS1835");
    }


}

No comments:

Post a Comment

intercompany PO multiple product receipt by x++

public void processStampICPO(PackingSlipId _deliveryNote,                             Transdate _deliverydate,                             ...