VbzCart/docs/queries/qryRstks active

From Woozle Writes Code
< VbzCart‎ | docs‎ | queries
Revision as of 01:56, 25 February 2024 by Woozle (talk | contribs) (Woozle moved page VbzCart/VbzCart/queries/qryRstks active to VbzCart/docs/queries/qryRstks active without leaving a redirect: part 3/5)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Details

  • Obsolete: use cRstkReqs::SQLfor_Active_NewestFirst() instead
  • Returns: List of restock requests for which we are currently expecting one or more shipments; the exact opposite of Template:Vbzcart/query.
  • Requires: Template:Vbzcart/table
  • Used by: Template:Vbzcart/query, Template:Vbzcart/query, page for displaying expected restocks
  • History:
    • 2008-11-19 Created for new restock process
    • 2008-11-20 Including WhenClosed (new field) in the filter
    • 2015-12-31 Replacing this with PHP-generated SQL
  • Notes:
    • We don't want to exclude requests just because a shipment has been received, because that shipment might not have included everything in the request. Once a request is marked closed (via WhenClosed), however, it means we are not expecting any further receipts from that request and we will need to request again if there's anything not yet received.
    • At one point, doing a JOIN with rstk_rcd seemed to make the query run faster, but this may have been an illusion due to caching by MySQL and not enough testing.

SQL

<mysql>CREATE OR REPLACE VIEW qryRstks_active AS

 SELECT rq.* FROM rstk_req AS rq
   WHERE (rq.WhenClosed IS NULL) AND (rq.WhenKilled IS NULL) AND (rq.WhenOrphaned IS NULL);</mysql>