VbzCart/docs/queries/qryStk byItem byBin wInfo: Difference between revisions

From Woozle Writes Code
< VbzCart‎ | docs‎ | queries
Jump to navigation Jump to search
imported>Woozle
(+PlcName, -PlcDescr)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
==About==
==About==
* '''Requires''': {{vbzcart|table|stk_bins}}, {{vbzcart|table|stk_places}}, {{vbzcart/query|v_stk_byItemAndBin}}, {{vbzcart/query|qryCat_Items}}
* '''Requires''': {{vbzcart|table|stk_bins}}, {{vbzcart|table|stk_places}}, {{vbzcart/query|qryStk_byItem_byBin}}, {{vbzcart/query|qryCat_Items}}
* '''Used by''': {{vbzcart/query|qryStock_forOpenOrders}}
* '''Used by''': {{vbzcart/query|qryStock_forOpenOrders}}
* '''History''':
* '''History''':
Line 6: Line 6:
** '''2009-04-24''' Added p.Name, which is what "stock needed for orders" should be showing
** '''2009-04-24''' Added p.Name, which is what "stock needed for orders" should be showing
*** commenting out p.Descr->PlcDescr because it probably isn't needed
*** commenting out p.Descr->PlcDescr because it probably isn't needed
** '''2010-02-23''' Renaming this from v_stk_byItemAndBin_wInfo to qryStk_byItem_byBin_wInfo
*** Also, v_stk_byItemAndBin was renamed to qryStk_byItem_byBin
==SQL==
==SQL==
<section begin=sql /><mysql>CREATE OR REPLACE VIEW v_stk_byItemAndBin_wInfo AS
<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryStk_byItem_byBin_wInfo AS
   SELECT
   SELECT
     s.*,
     s.*,
Line 18: Line 20:
   FROM
   FROM
   ((
   ((
       v_stk_byItemAndBin AS s LEFT JOIN qryCat_Items AS i ON s.ID_Item=i.ID
       qryStk_byItem_byBin AS s LEFT JOIN qryCat_Items AS i ON s.ID_Item=i.ID
     ) LEFT JOIN stk_bins AS b ON s.ID_Bin=b.ID
     ) LEFT JOIN stk_bins AS b ON s.ID_Bin=b.ID
   ) LEFT JOIN stk_places AS p ON b.ID_Place=p.ID;</mysql>
   ) LEFT JOIN stk_places AS p ON b.ID_Place=p.ID;</mysql>
<section end=sql />
<section end=sql />

Latest revision as of 01:56, 25 February 2024

About

  • Requires: Template:Vbzcart, Template:Vbzcart, Template:Vbzcart/query, Template:Vbzcart/query
  • Used by: Template:Vbzcart/query
  • History:
    • 2009-02-07 Added p.Descr so "stock needed for orders" can show where bins are
    • 2009-04-24 Added p.Name, which is what "stock needed for orders" should be showing
      • commenting out p.Descr->PlcDescr because it probably isn't needed
    • 2010-02-23 Renaming this from v_stk_byItemAndBin_wInfo to qryStk_byItem_byBin_wInfo
      • Also, v_stk_byItemAndBin was renamed to qryStk_byItem_byBin

SQL

<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryStk_byItem_byBin_wInfo AS

 SELECT
   s.*,
   i.*,
   b.ID_Place,
   b.Code AS BinCode,
   b.Descr AS BinDescr,
   p.Name AS PlcName

/* p.Descr AS PlcDescr */

 FROM
 ((
     qryStk_byItem_byBin AS s LEFT JOIN qryCat_Items AS i ON s.ID_Item=i.ID
   ) LEFT JOIN stk_bins AS b ON s.ID_Bin=b.ID
 ) LEFT JOIN stk_places AS p ON b.ID_Place=p.ID;</mysql>

<section end=sql />