Below is the job I created for posting sales invoices.
Solution 1
------------------
Solution 2
------------------
class Test_PostPackingSlip
{
/// <summary>
/// Runs the class with the specified arguments.
/// </summary>
/// <param name = "_args">The specified arguments.</param>
public static void main(Args _args)
{
SalesTable _SalesTable;
SalesFormLetter_Invoice invoice;
ttsbegin;
_SalesTable.clear();
_SalesTable = SalesTable::find("SO00125116");
invoice = SalesFormLetter::construct(DocumentStatus::Invoice);
// Post the invoice
invoice.update(_SalesTable,
SystemDateGet(),
SalesUpdate::All,
AccountOrder::None,
false,
true); // Set to true to print the invoice
ttsCommit;
}
}
Solution 1
------------------
Public static void salesOrderInvoiceByLine(SalesLine _salesline)
{
salesFormLetter salesFormLetter;
salesFormletterParmData salesFormLetterParmData;
salesParmUpdate salesParmUpdate;
salesParmTable salesParmTable;
salesParmLine salesParmLine;
salesTable salesTable;
ttsbegin;
salesTable = salesTable::find(_salesline.SalesId);
salesFormLetterParmData = salesFormletterParmData::newData(DocumentStatus::Invoice, VersioningUpdateType::Initial);
salesFormLetterParmData.parmOnlyCreateParmUpdate(true);
salesFormLetterParmData.createData(false);
salesParmUpdate = salesFormLetterParmData.parmParmUpdate();
salesParmTable.clear();
salesParmTable.TransDate = _salesline.ReceiptDateRequested;
salesParmTable.Ordering = DocumentStatus::Invoice;
salesParmTable.ParmJobStatus = ParmJobStatus::Waiting;
salesParmTable.salesId = salesTable.salesId;
salesParmTable.salesName = salesTable.salesName;
salesParmTable.DeliveryName = salesTable.DeliveryName;
salesParmTable.DeliveryPostalAddress = salesTable.DeliveryPostalAddress;
salesParmTable.CustAccount = salesTable.CustAccount;
salesParmTable.CurrencyCode = salesTable.CurrencyCode;
salesParmTable.InvoiceAccount = salesTable.InvoiceAccount;
salesParmTable.ParmId = salesParmUpdate.ParmId;
salesParmTable.insert();
if (_salesline)
{
salesParmLine.InitFromsalesLine(_salesline);
salesParmLine.DeliverNow = _salesline.SalesQty;
salesParmLine.ParmId = salesParmTable.ParmId;
salesParmLine.TableRefId = salesParmTable.TableRefId;
salesParmLine.setQty(DocumentStatus::Invoice, false, true);
salesParmLine.setLineAmount(_salesline);
salesParmLine.insert();
}
ttscommit;
salesFormLetter = salesFormLetter::construct(DocumentStatus::Invoice);
salesFormLetter.transDate(_salesline.ReceiptDateRequested);
salesFormLetter.proforma(false);
salesFormLetter.specQty(salesUpdate::All);
salesFormLetter.salesTable(salesTable);
salesFormLetter.parmId(salesParmTable.ParmId);
salesFormLetter.salesParmUpdate(salesFormLetterParmData.parmParmUpdate());
salesFormLetter.run();
}
Solution 2
------------------
class Test_PostPackingSlip
{
/// <summary>
/// Runs the class with the specified arguments.
/// </summary>
/// <param name = "_args">The specified arguments.</param>
public static void main(Args _args)
{
SalesTable _SalesTable;
SalesFormLetter_Invoice invoice;
ttsbegin;
_SalesTable.clear();
_SalesTable = SalesTable::find("SO00125116");
invoice = SalesFormLetter::construct(DocumentStatus::Invoice);
// Post the invoice
invoice.update(_SalesTable,
SystemDateGet(),
SalesUpdate::All,
AccountOrder::None,
false,
true); // Set to true to print the invoice
ttsCommit;
}
}
The curriculum for free sales courses usually begins with the sales introduction. This is the process of creating rapport with the prospective customers. קורס מכירות
ReplyDeleteThis will result in a higher page ranking on the SERP. As you know, a higher search engine result page rank you get, the more people are going to click on your website link. free invoice template UK
ReplyDeleteWhen your website or blog goes live for the first time, it is exciting. That is until you realize no one but you and your.
ReplyDeletepresales
I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post.
ReplyDeletepożyczka w 5 minut bez zaświadczeń
Really I enjoy your site with effective and useful information. It is included very nice post with a lot of our resources.thanks for share. i enjoy this post. invoice factoring
ReplyDelete