Wednesday, 25 November 2015

Automatic PO Confirmation and Packingslip

static void PostPOPackingSlip(Args _args)
{
        PurchFormLetter  purchFormLetter;
        PurchTable       purchTable;
    purchTable  = purchTable::find('000048');
    if (purchTable.DocumentState != VersioningDocumentState::Confirmed)
                {
                    purchFormLetter = PurchFormLetter::construct(DocumentStatus::PurchaseOrder);
                    purchFormLetter.update(purchTable, "def1");
                }

                purchTable.reread();

                if (purchTable.DocumentState == VersioningDocumentState::Confirmed)
                {
                    purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip);
                    purchFormLetter.update(purchTable,"123",systemDateGet(), PurchUpdate::All, AccountOrder::None,false,false);

                }

info("jobcompleted");

}

No comments:

Post a Comment