Difference between revisions of "VbzCart/queries/qryRstkItms active"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
(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}}, {...)
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Details==
 
==Details==
 +
* '''Obsolete''': use  '''VCT_RstkReqItems::SQLobj_Items_active()''' or '''::SQLstr_Items_active()''' instead
 
* '''Returns''': Data about items which are in active restocks, i.e. on restock orders but not yet received (or cancelled).
 
* '''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}}, {{vbzcart/query|qryRstks_active}}
+
* '''Requires''': {{l/vc/table|rstk_req_item}}, {{l/vc/query|qryRstks_active}}
* '''Used by'''
+
* '''Used by''': {{l/vc/query|qryRstkItms_expected}}
 
* '''Note''': This is different from qryRstkLines_en_route (deprecated):
 
* '''Note''': This is different from qryRstkLines_en_route (deprecated):
 
** Grouped by Item instead of Restock Line
 
** Grouped by Item instead of Restock Line
Line 8: Line 9:
 
* '''History''':
 
* '''History''':
 
** '''2008-11-18''' Created for new restock process
 
** '''2008-11-18''' Created for new restock process
 +
** '''2010-01-04''' now allowing QtyExp to override QtyOrd; resulting field renamed from QtyOrd to QtyExp
 +
** '''2015-12-31''' replacing this with PHP-generated SQL
 +
** '''2016-03-02''' Query no longer works; removing from database.
 
==SQL==
 
==SQL==
<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryRstkItms_active AS
+
<mysql>CREATE OR REPLACE VIEW qryRstkItms_active AS
 
SELECT
 
SELECT
 
   rrq.ID_Restock,
 
   rrq.ID_Restock,
 
   rrq.ID_Item,
 
   rrq.ID_Item,
   SUM(rrq.QtyOrd) AS QtyOrd
+
   SUM(IFNULL(rrq.QtyExp,rrq.QtyOrd)) AS QtyExp
FROM
+
FROM rstk_req_item AS rrq
      rstk_req_item AS rrq
+
  LEFT JOIN qryRstks_active AS rq ON rrq.ID_Restock=rq.ID
    LEFT JOIN qryRstks_active AS rq ON rrq.ID_Restock=rq.ID
 
 
WHERE rq.ID IS NOT NULL
 
WHERE rq.ID IS NOT NULL
 
GROUP BY rrq.ID_Restock, rrq.ID_Item;</mysql>
 
GROUP BY rrq.ID_Restock, rrq.ID_Item;</mysql>
<section end=sql />
 

Latest revision as of 22:54, 2 March 2016

Details

  • Obsolete: use VCT_RstkReqItems::SQLobj_Items_active() or ::SQLstr_Items_active() instead
  • Returns: Data about items which are in active restocks, i.e. on restock orders but not yet received (or cancelled).
  • Requires: rstk_req_item, qryRstks_active
  • Used by: qryRstkItms_expected
  • 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
    • 2010-01-04 now allowing QtyExp to override QtyOrd; resulting field renamed from QtyOrd to QtyExp
    • 2015-12-31 replacing this with PHP-generated SQL
    • 2016-03-02 Query no longer works; removing from database.

SQL

<mysql>CREATE OR REPLACE VIEW qryRstkItms_active AS SELECT

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

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>