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}}
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}}