Difference between revisions of "Programmer:Cancel Purchase Order v2"

From AutoCount Resource Center
Jump to navigation Jump to search
(Created page with " ===Partial Transfer=== <syntaxhighlight lang="csharp"> public void NewCancelPO(AutoCount.Authentication.UserSession userSession) { AutoCount.Invoicing.Purchase.CancelPO.C...")
 
m
 
Line 14: Line 14:
 
     decimal qtyToTransfer = 1;
 
     decimal qtyToTransfer = 1;
 
     decimal focQtyToTrasnfer = 0;
 
     decimal focQtyToTrasnfer = 0;
 +
 
     //Using Partial Transfer
 
     //Using Partial Transfer
 
     doc.PartialTransfer(AutoCount.Invoicing.Purchase.TransferFrom.PurchaseOrder,
 
     doc.PartialTransfer(AutoCount.Invoicing.Purchase.TransferFrom.PurchaseOrder,

Latest revision as of 06:43, 23 May 2018

Partial Transfer

public void NewCancelPO(AutoCount.Authentication.UserSession userSession)
{
    AutoCount.Invoicing.Purchase.CancelPO.CancelPOCommand cmd =
        AutoCount.Invoicing.Purchase.CancelPO.CancelPOCommand.Create(userSession, userSession.DBSetting);
    AutoCount.Invoicing.Purchase.CancelPO.CancelPO doc = cmd.AddNew();

    //Transfer one line of item from PO, if more than one line, write a loop
    string poDocNo = "PO-00001";
    string itemCode = "ItemA";
    string uom = "UNIT";
    decimal qtyToTransfer = 1;
    decimal focQtyToTrasnfer = 0;

    //Using Partial Transfer
    doc.PartialTransfer(AutoCount.Invoicing.Purchase.TransferFrom.PurchaseOrder,
        poDocNo, itemCode, uom, qtyToTransfer, focQtyToTrasnfer);

    try
    {
        doc.Save();
        //log save successful
    }
    catch (AutoCount.AppException ex)
    {
        //log exception
    }
}

Go to menu

IconAC81.png Go to top
ProgrammerGo.jpg Resources For AutoCount Software Developers