VbzCart/docs/queries/qryRstkItms active

From Woozle Writes Code
< VbzCart‎ | docs‎ | queries
Revision as of 00:29, 4 December 2008 by imported>Woozle (New page: ==Details== * '''Returns''': Data about items which are in active restocks, i.e. on restock orders but not yet received (or cancelled). * '''Requires''': {{vbzcart/table|rstk_req_item}}, {...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Details

  • Returns: Data about items which are in active restocks, i.e. on restock orders but not yet received (or cancelled).
  • Requires: Template:Vbzcart/table, Template:Vbzcart/query
  • Used by
  • Note: This is different from qryRstkLines_en_route (deprecated):
    • Grouped by Item instead of Restock Line
    • Uses new Restock tables
  • History:
    • 2008-11-18 Created for new restock process

SQL

<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryRstkItms_active AS SELECT

 rrq.ID_Restock,
 rrq.ID_Item,
 SUM(rrq.QtyOrd) AS QtyOrd

FROM

     rstk_req_item AS rrq
   LEFT JOIN qryRstks_active AS rq ON rrq.ID_Restock=rq.ID

WHERE rq.ID IS NOT NULL GROUP BY rrq.ID_Restock, rrq.ID_Item;</mysql> <section end=sql />