VbzCart/docs/queries/qryStk lines remaining: Difference between revisions
Jump to navigation
Jump to search
imported>Woozle (obsolete) |
m (Woozle moved page VbzCart/VbzCart/queries/qryStk lines remaining to VbzCart/docs/queries/qryStk lines remaining without leaving a redirect: part 3/5) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
==About== | ==About== | ||
* ''' | * '''OBSOLETE''': replaced by a number of things (search for query name to find them) | ||
* '''Returns''': {{vbzcart/table|stk_items}} actually in stock, which is actually different things: | * '''Returns''': {{vbzcart/table|stk_items}} actually in stock, which is actually different things: | ||
** "forSale": items which are visible as "in stock" to customers | ** "forSale": items which are visible as "in stock" to customers |
Latest revision as of 01:56, 25 February 2024
About
- OBSOLETE: replaced by a number of things (search for query name to find them)
- Returns: Template:Vbzcart/table actually in stock, which is actually different things:
- "forSale": items which are visible as "in stock" to customers
- "forShip": items which are available for shipping
- items neither for shipping nor for sale (probably some kind of recordkeeping purpose)
- Requires: Template:Vbzcart/table, Template:Vbzcart/table
- Used by: Template:Vbzcart/query, Template:Vbzcart/query, Template:Vbzcart/query, Template:Vbzcart/query
- History:
- 2009-11-29 renamed from v_stk_lines_remaining to qryStk_lines_remaining
- 2010-06-15 added BinCode (sb.Code) -- needed for clsStkItems::List_forItem()
SQL
<mysql>CREATE OR REPLACE VIEW qryStk_lines_remaining AS
SELECT st.ID, st.ID_Bin, st.ID_Item, IF(sb.isForSale,st.Qty,0) AS QtyForSale, IF(sb.isForShip,st.Qty,0) AS QtyForShip, st.Qty AS QtyExisting, st.CatNum, st.WhenAdded, st.WhenChanged, st.WhenCounted, st.Notes, sb.Code AS BinCode, sb.ID_Place, sp.Name AS WhName FROM ( stk_items AS st LEFT JOIN stk_bins AS sb ON sb.ID=st.ID_Bin ) LEFT JOIN stk_places AS sp ON sb.ID_Place=sp.ID WHERE (st.WhenRemoved IS NULL) AND (sb.WhenVoided IS NULL) AND (st.Qty <> 0);</mysql>