VbzCart/queries/qryPkgLines qtys done ord sum
Jump to navigation
Jump to search
About
- Requires:
- REDIRECT Template:l/vc/query
- Returns: sum of "done" quantities for all packages which have been checked in each order
- In other words, you get one record for each item in an order; that record gives the sum of quantities "done" for that item across all "checked" packages. This lets you know how many of each item remain open (to be filled).
- This is intended to then be filtered by ID_Order, otherwise it can take 30-40 seconds to return results.
- There is also PHP code somewhere which does this, but I needed to be able to pull these numbers up in w3tpl.
- History:
- 2011-05-31 created for packing slips
SQL
<mysql>CREATE OR REPLACE VIEW qryPkgLines_qtys_done_ord_sum AS SELECT
ID_Order, ID_OrdLine, ID_Item, SUM(QtyDone) AS QtyDone
FROM qryPkgLines_qtys_done GROUP BY ID_Order, ID_OrdLine, ID_Item;</mysql>