Yes, Konstantin, there was an error in grouping of fields. This way it works:
| Code |
|---|
SEL ECT
ReceiptLineItems.Ref AS Receipt,
ReceiptLineItems.Payment,
SalesInvoice.Ref AS Invoice,
SalesInvoice.DocumentTotalRC AS InvoiceAmount,
ReceiptLineItems.Ref.Date AS PaymentDate
FR OM
Document.Receipt.LineItems AS ReceiptLineItems
LEFT JOIN Document.SalesInvoice AS SalesInvoice
ON ReceiptLineItems.Document = SalesInvoice.Ref |
But I have one more question: how can I change the query in order to get all invoices, even if they are not payed?