Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT ALLOWED
- CASE
- WHEN SalesTurnovers.Recorder = UNDEFINED
- THEN NULL
- ELSE SalesTurnovers.Recorder
- END AS Recorder,
- SalesTurnovers.Item AS Item,
- SalesTurnovers.Item AS ItemWithSKU,
- SalesTurnovers.Item.Description AS ItemPresentation,
- CASE
- WHEN SalesTurnovers.Characteristic = VALUE(Catalog.ItemCharacteristics.EmptyRef)
- THEN CASE
- WHEN SalesTurnovers.Batch <> VALUE(Catalog.ItemBatches.EmptyRef)
- THEN "N/A"
- ELSE NULL
- END
- ELSE SalesTurnovers.Characteristic
- END AS Characteristic,
- SalesTurnovers.Characteristic AS CharacteristicGrossProfit,
- CASE
- WHEN SalesTurnovers.Batch = VALUE(Catalog.ItemBatches.EmptyRef)
- THEN NULL
- ELSE SalesTurnovers.Batch
- END AS Batch,
- SalesTurnovers.Batch AS BatchGrossProfit,
- SalesTurnovers.Document AS Document,
- SalesTurnovers.VATRate AS VATRate,
- SalesTurnovers.Entity AS Entity,
- SalesTurnovers.CustomerOrder AS CustomerOrder,
- SalesTurnovers.QuantityTurnover AS Quantity,
- SalesTurnovers.AmountTurnover AS Amount,
- SalesTurnovers.AmountTurnover - SalesTurnovers.VATAmountTurnover AS AmountWithoutVAT,
- SalesTurnovers.VATAmountTurnover AS VATAmount,
- SalesTurnovers.CostPriceTurnover AS CostPrice,
- SalesTurnovers.Item.UnitOfMeasure AS ItemUnitOfMeasure,
- SalesTurnovers.Item.SKU AS ItemSKU,
- SalesTurnovers.Document.Responsible AS Responsible,
- CASE
- WHEN SalesTurnovers.Document REFS Document.AdvancesReport
- THEN VALUE(Catalog.BaseUnits.EmptyRef)
- WHEN SalesTurnovers.Document REFS Document.InventoryReceipt
- THEN SalesTurnovers.Document.BaseUnit
- ELSE SalesTurnovers.Document.Department
- END AS Department,
- Companies.Ref AS Company,
- SalesTurnovers.Project AS Project,
- SalesTurnovers.Document.Date AS DocumentDate,
- SalesTurnovers.Document.Number AS DocumentNumber,
- SalesTurnovers.CustomerOrder.Date AS CustomerOrderDate,
- SalesTurnovers.CustomerOrder.Number AS CustomerOrderNumber,
- SalesTurnovers.WeekPeriod AS WeekPeriod,
- SalesTurnovers.MonthPeriod AS MonthPeriod,
- SalesTurnovers.QuarterPeriod AS QuarterPeriod,
- SalesTurnovers.HalfYearPeriod AS HalfYearPeriod,
- SalesTurnovers.YearPeriod AS YearPeriod
- FROM
- AccumulationRegister.Sales.Turnovers(, , Auto, ) AS SalesTurnovers
- LEFT JOIN Catalog.Companies AS Companies
- ON (Companies.Ref = SalesTurnovers.Document.Company)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement