VbzCart/queries/qryRstkReq Items expected

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< VbzCart‎ | queries
Revision as of 02:32, 4 January 2010 by Woozle (talk | contribs) (Created page with '==About== * '''Purpose''': Returns a list of items we're currently expecting to receive in restocks, based on items requested (in active restock requests only) less items already…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About

  • Purpose: Returns a list of items we're currently expecting to receive in restocks, based on items requested (in active restock requests only) less items already received for those requests
  • Requires:
  1. REDIRECT Template:l/vc/query
  • Used by : "items needed" admin page
  • Related: Like qryRstkItms_expected, but grouped by Item (eliminates rstk_req data)
  • History:
    • 2010-01-03 Created for generating list of needed items

SQL

<mysql>CREATE OR REPLACE VIEW qryRstkReq_Items_expected AS SELECT

 ID_Item,
 SUM(QtyRecd) AS QtyRecd,
 SUM(QtyOrd) AS QtyOrd

FROM qryRstkReq_Item_status GROUP BY ID_Item HAVING SUM(QtyOrd)-SUM(QtyRecd)>0;</mysql>