static void Job217(Args _args)
{
SalesFormLetter salesFormLetter;
QueryRun queryRun;
Query query;
str strSalesTable = "TSSO00001979, TSSO00001982";// "000630,000631,000643";
int64 salesline1,salesline2;
str saleslines;
SalesTable salesTable;
SalesLine salesLine;
;
//TSSO00001961
//TSt00000199
select salesLine where salesLine.SalesId == "TSSO00001961";
salesline1 = salesLine.RecId;
salesLine.clear();
select salesLine where salesLine.SalesId == "TSt00000199";
salesline2 = salesLine.RecId;
saleslines = strFmt("%1,%2",salesline1,salesline2);
salesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice);
query = new Query(QueryStr(SalesUpdate));
//query.dataSourceTable(tablenum(SalesTable)).addRange(fieldnum(SalesTable, SalesId)).value(strSalesTable);
query.dataSourceTable(tablenum(salesLine)).addRange(fieldnum(salesLine, RecId)).value(saleslines);
queryRun = new QueryRun(query);
salesFormLetter.chooseLinesQuery(queryRun);
salesFormLetter.transDate(systemdateget());
salesFormLetter.specQty(SalesUpdate::All);
salesFormLetter.chooseLines();
salesFormLetter.run();
info("done");
}
{
SalesFormLetter salesFormLetter;
QueryRun queryRun;
Query query;
str strSalesTable = "TSSO00001979, TSSO00001982";// "000630,000631,000643";
int64 salesline1,salesline2;
str saleslines;
SalesTable salesTable;
SalesLine salesLine;
;
//TSSO00001961
//TSt00000199
select salesLine where salesLine.SalesId == "TSSO00001961";
salesline1 = salesLine.RecId;
salesLine.clear();
select salesLine where salesLine.SalesId == "TSt00000199";
salesline2 = salesLine.RecId;
saleslines = strFmt("%1,%2",salesline1,salesline2);
salesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice);
query = new Query(QueryStr(SalesUpdate));
//query.dataSourceTable(tablenum(SalesTable)).addRange(fieldnum(SalesTable, SalesId)).value(strSalesTable);
query.dataSourceTable(tablenum(salesLine)).addRange(fieldnum(salesLine, RecId)).value(saleslines);
queryRun = new QueryRun(query);
salesFormLetter.chooseLinesQuery(queryRun);
salesFormLetter.transDate(systemdateget());
salesFormLetter.specQty(SalesUpdate::All);
salesFormLetter.chooseLines();
salesFormLetter.run();
info("done");
}
No comments:
Post a Comment