Ga naar inhoud

Receptions2

Report Receptions2

  • Filename: receptions2
  • Title: Receptions in periode :StartPeriode - :EndPeriode
  • Sample: Unit42

Synopsis

List of receptions in a periode, alternate version.

SQL

SELECT
  COUNT(D.ID) AS RowsNo,
  sum(D.QTY) as MyQTY,  
  Count(Distinct D.Artcode) as DistinctArticles,
  (CASE WHEN Count(Distinct D.Artcode)>=200 then 1 else 0 end) as CatReception,
  SUM(D.QTY*WEIGHT) AS TWEIGHT,
  SUM(D.QTY*(CASE WHEN B.UMV='Cbm' THEN B.VOL*1000 ELSE B.VOL END)) AS TVOL,
  max(ISNULL(D.TRANSACTIONTYPE, '-')) as TRANSACTIONTYPE,
  INVOICE,
  CONVERT(CHAR(10), D.RSystemDate,120) as RDATE
FROM
  INVDETAILS D
  LEFT OUTER JOIN ARTICLE B ON (D.ARTCODE=B.NAME)
WHERE
  (D.RSYSTEMDATE>=:StartDate)
  AND (D.RSYSTEMDATE<:EndDate)
--  {CustomFilter}
GROUP by
  INVOICE,
  CONVERT(CHAR(10), D.RSystemDate,120)
ORDER BY
  CatReception desc, TRANSACTIONTYPE, RDATE, INVOICE

Parameters

  • StartDate (TDateTime)
  • EndDate (TDateTime)
  • CustomFilter (string, macro)

Accessible in forms

  1. InvoiceReports