7. Dezember 2011 21:22
static void Job14(Args _args)
{
SalesTable sTable, cTable;
SalesLine sLine;
while select SalesId, SalesName, CustAccount, CustGroup from sTable
join count(ItemId), sum(SalesQty), SalesId from sLine
group by sLine.SalesId, sLine.ItemId
where sLine.SalesId == sTable.SalesId
{
/*
if (cTable.SalesId != sLine.SalesId)
{
select SalesId, SalesName, CustAccount, CustGroup from cTable
where cTable.SalesId == sLine.SalesId;
//Anstelle von 'info' hier auch 'print'
info(strFmt("SalesId: %1 * SalesName: %2 * CustAccount: %3 * CustGroup: %4",
cTable.SalesId, cTable.SalesName, cTable.CustAccount, cTable.CustGroup));
}
*/
info(strFmt("ItemId: %1 * Menge: %2, * %3", sLine.ItemId, sLine.SalesQty, sTable.SalesId));
//breakpoint;
}
pause;
}
12. Dezember 2011 19:57
static void SeclectSalesLineTest(Args _args)
{
SalesTable sTable;
SalesLine sLine;
SalesId sId;
;
while select sum(SalesQty) from sLine group by sLine.SalesId, sLine.ItemId
{
if(sId != sLine.SalesId)
{
select SalesId, SalesName, CustAccount, CustGroup from sTable where sTable.SalesId == sLine.SalesId;
sId = sLine.SalesId;
print('----------------------------------------------------------------');
print('----------------------------------------------------------------');
print(strFmt("SalesID: %1, SalesName: %2, CustAccount %3, CustGroup: %2", sTable.SalesId, sTable.SalesName, sTable.CustAccount, sTable.CustGroup));
print('----------------------------------------------------------------');
}
print(strFmt("ItemID: %1, SalesQty: %2, SalesID: %3", sLine.ItemId, sLine.SalesQty, sLine.SalesId));
}
pause;
}
14. Dezember 2011 15:16