Programmer:Goods Received Note Transfer from Purchase Order v2

From AutoCount Resource Center

Full Document Transfer

public void GRNFullTransferFromPO(AutoCount.Authentication.UserSession userSession)
{
    AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand cmd =
        AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand.Create(userSession, userSession.DBSetting);
    AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNote doc = cmd.AddNew();

    doc.CreditorCode = "400-X001";
    doc.DocDate = DateTime.Today.Date;

    //Purchase Order numbers to be transferred into Goods Received Note
    string[] poDocNos = { "PO-00001", "PO-00002" };

    doc.FullTransfer(poDocNos, AutoCount.Invoicing.Purchase.TransferFrom.PurchaseOrder, AutoCount.Invoicing.FullTransferOption.FullDetails);

    try
    {
        doc.Save();
        //log save successful
    }
    catch (AutoCount.AppException ex)
    {
        //log exception
    }
}
  • Full Transfer is to transfer the whole document to target document. It allows one or many to one document.
  • After full transfer is performed, there will be no outstanding in the source document, regardless if the target quantity has been reduced.

Partial Transfer

public void GRNPartialTransferFromPO(AutoCount.Authentication.UserSession userSession)
{
    AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand cmd =
        AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand.Create(userSession, userSession.DBSetting);
    AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNote doc = cmd.AddNew();

    doc.CreditorCode = "400-X001";
    doc.DocDate = DateTime.Today.Date;

    //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 = 5;
    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
    }
}
  • Partial Transfer is to transfer the quantity of the specific item to target document.

Go to menu

Go to top
Resources For AutoCount Software Developers