Цитата:
Сообщение от
Himan
для данного заказа выдать сумму выплат и валюту
Я конечно не экстрасенс

, но суди по всему, требуется что-то вроде этого:
X++:
static void SalesTotalsPosted(Args _args)
{
SalesTable salesTable;
CustInvoiceJour custInvoiceJour;
CustTrans custTrans;
SalesId salesId = "??0031";
;
select salesTable
where salesTable.SalesId == salesId
join custInvoiceJour
where custInvoiceJour.SalesId == salesTable.SalesId
join custTrans
where custTrans.Invoice == custInvoiceJour.InvoiceId;
info(strfmt("InvoiceAmount: %1, SettelAmount: %2, Balance: %3",
custTrans.AmountCur ,
custTrans.SettleAmountCur,
custTrans.AmountCur - custTrans.SettleAmountCur));
}