-
-
Save vkostyanetsky/f4423dcfb28d4a27039c7310c13c3a73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
<...> | |
FROM | |
TTReturns AS ReturnsTable | |
LEFT JOIN AccumulationRegister.Inventory AS TableSales | |
ON | |
ReturnsTable.Item = TableSales.Item | |
AND ReturnsTable.Characteristic = TableSales.Characteristic | |
AND ReturnsTable.Batch = TableSales.Batch | |
AND ReturnsTable.OrderSales = TableSales.OrderSales | |
AND ReturnsTable.SalesDocument = TableSales.SalesDocument | |
AND ReturnsTable.GLAccount_GL = TableSales.GLAccount_GL | |
AND ReturnsTable.CostObject = TableSales.CostObject | |
AND ReturnsTable.VATRate = TableSales.VATRate | |
AND TableSales.Entity = &Entity | |
AND TableSales.CorrGLAccount_GL = &EmptyAccount_GL | |
AND TableSales.RecordType = VALUE(AccumulationRecordType.Expense) | |
AND NOT TableSales.Return | |
GROUP BY | |
<...> | |
HAVING | |
(CAST(SUM(TableSales.Amount) - ReturnsTable.Amount AS NUMBER(15, 2))) <> 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment