Creating Sales Order And Posting Sales Order Invoice
static void Esh_CreateSO(Args _args)
{
// Create the Sales Order
SalesTable salesTable;
NumberSeq NumberSeq;
SalesId sid;
SalesLine sl;
SalesFormLetter salesFormLetter;
;
NumberSeq =NumberSeq::newGetNum(SalesParameters::numRefSalesId() , true);
sid=NumberSeq.num();
salesTable.SalesId = sid;
salesTable.initValue();
salesTable.CustAccount = "US-006";
salesTable.initFromCustTable();
salesTable.insert();
//Create the Sales Line with the created Sales Order
sl.SalesId=sid;
sl.ItemId="A0001";
sl.InventDimId="000458";
sl.PriceUnit=3750.00;
sl.SalesQty=5;
sl.CreateLine(NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes);
info("Sales Order Created with Line");
//Posting Sales Order
salesFormLetter=SalesFormLetter::construct(DocumentStatus::PackingSlip);
salesFormLetter.update(SalesTable::find(sid));
salesFormLetter.update(salesTable,systemDateGet(),SalesUpdate::All,AccountOrder::None, NoYes::No,NoYes::Yes);
info("Sales Order Status is Delivered");
//Post the Sales Order Invoice
salesFormLetter=SalesFormLetter::construct(DocumentStatus::Invoice);
salesFormLetter.update(SalesTable::find(sid));
info(strFmt("%1 Sales Order Posted and Final Status is Invoiced",salesTable.SalesId));
}
static void Esh_CreateSO(Args _args)
{
// Create the Sales Order
SalesTable salesTable;
NumberSeq NumberSeq;
SalesId sid;
SalesLine sl;
SalesFormLetter salesFormLetter;
;
NumberSeq =NumberSeq::newGetNum(SalesParameters::numRefSalesId() , true);
sid=NumberSeq.num();
salesTable.SalesId = sid;
salesTable.initValue();
salesTable.CustAccount = "US-006";
salesTable.initFromCustTable();
salesTable.insert();
//Create the Sales Line with the created Sales Order
sl.SalesId=sid;
sl.ItemId="A0001";
sl.InventDimId="000458";
sl.PriceUnit=3750.00;
sl.SalesQty=5;
sl.CreateLine(NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes);
info("Sales Order Created with Line");
//Posting Sales Order
salesFormLetter=SalesFormLetter::construct(DocumentStatus::PackingSlip);
salesFormLetter.update(SalesTable::find(sid));
salesFormLetter.update(salesTable,systemDateGet(),SalesUpdate::All,AccountOrder::None, NoYes::No,NoYes::Yes);
info("Sales Order Status is Delivered");
//Post the Sales Order Invoice
salesFormLetter=SalesFormLetter::construct(DocumentStatus::Invoice);
salesFormLetter.update(SalesTable::find(sid));
info(strFmt("%1 Sales Order Posted and Final Status is Invoiced",salesTable.SalesId));
}
https://www.youtube.com/playlist?list=PLWSxgDbjVWTjxvgnaAZ0iK8o5dYHAYhrq
ReplyDeleteCollection of Microsoft ERP Clips || ERP Licensing, Technical, Functional ,Manager Learning Videos Listing