Programmer:Goods Received Note Transfer from Purchase Order v2
From AutoCount Resource Center
Full Document Transfer
publicvoidGRNFullTransferFromPO(AutoCount.Authentication.UserSessionuserSession){AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommandcmd=AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand.Create(userSession,userSession.DBSetting);AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNotedoc=cmd.AddNew();doc.CreditorCode="400-X001";doc.DocDate=DateTime.Today.Date;//Purchase Order numbers to be transferred into Goods Received Notestring[]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.AppExceptionex){//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
publicvoidGRNPartialTransferFromPO(AutoCount.Authentication.UserSessionuserSession){AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommandcmd=AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand.Create(userSession,userSession.DBSetting);AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNotedoc=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 loopstringpoDocNo="PO-00001";stringitemCode="ItemA";stringuom="UNIT";decimalqtyToTransfer=5;decimalfocQtyToTrasnfer=0;//Using Partial Transferdoc.PartialTransfer(AutoCount.Invoicing.Purchase.TransferFrom.PurchaseOrder,poDocNo,itemCode,uom,qtyToTransfer,focQtyToTrasnfer);try{doc.Save();//log save successful}catch(AutoCount.AppExceptionex){//log exception}}
Partial Transfer is to transfer the quantity of the specific item to target document.