<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://htyp.org/mw/index.php?action=history&amp;feed=atom&amp;title=VbzCart%2Fpieces%2Fcatalog%2Fbuilding%2F2008</id>
	<title>VbzCart/pieces/catalog/building/2008 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://htyp.org/mw/index.php?action=history&amp;feed=atom&amp;title=VbzCart%2Fpieces%2Fcatalog%2Fbuilding%2F2008"/>
	<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=VbzCart/pieces/catalog/building/2008&amp;action=history"/>
	<updated>2026-06-26T15:30:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://htyp.org/mw/index.php?title=VbzCart/pieces/catalog/building/2008&amp;diff=21519&amp;oldid=prev</id>
		<title>Woozle: Woozle moved page VbzCart/pieces/catalog/local/building/2008 to VbzCart/pieces/catalog/building/2008 over redirect: this actually applies to both local and supplier</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=VbzCart/pieces/catalog/building/2008&amp;diff=21519&amp;oldid=prev"/>
		<updated>2016-02-01T02:15:21Z</updated>

		<summary type="html">&lt;p&gt;Woozle moved page &lt;a href=&quot;/VbzCart/pieces/catalog/local/building/2008&quot; class=&quot;mw-redirect&quot; title=&quot;VbzCart/pieces/catalog/local/building/2008&quot;&gt;VbzCart/pieces/catalog/local/building/2008&lt;/a&gt; to &lt;a href=&quot;/VbzCart/pieces/catalog/building/2008&quot; title=&quot;VbzCart/pieces/catalog/building/2008&quot;&gt;VbzCart/pieces/catalog/building/2008&lt;/a&gt; over redirect: this actually applies to both local and supplier&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:15, 1 February 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Woozle</name></author>
	</entry>
	<entry>
		<id>https://htyp.org/mw/index.php?title=VbzCart/pieces/catalog/building/2008&amp;diff=21402&amp;oldid=prev</id>
		<title>Woozle: Woozle moved page VbzCart/pieces/catalog/building/2008 to VbzCart/pieces/catalog/local/building/2008: disambiguation</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=VbzCart/pieces/catalog/building/2008&amp;diff=21402&amp;oldid=prev"/>
		<updated>2016-01-08T17:53:04Z</updated>

		<summary type="html">&lt;p&gt;Woozle moved page &lt;a href=&quot;/VbzCart/pieces/catalog/building/2008&quot; title=&quot;VbzCart/pieces/catalog/building/2008&quot;&gt;VbzCart/pieces/catalog/building/2008&lt;/a&gt; to &lt;a href=&quot;/VbzCart/pieces/catalog/local/building/2008&quot; class=&quot;mw-redirect&quot; title=&quot;VbzCart/pieces/catalog/local/building/2008&quot;&gt;VbzCart/pieces/catalog/local/building/2008&lt;/a&gt;: disambiguation&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:53, 8 January 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Woozle</name></author>
	</entry>
	<entry>
		<id>https://htyp.org/mw/index.php?title=VbzCart/pieces/catalog/building/2008&amp;diff=20549&amp;oldid=prev</id>
		<title>Woozle: Woozle moved page VbzCart/catalog/building/2008 to VbzCart/pieces/catalog/building/2008</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=VbzCart/pieces/catalog/building/2008&amp;diff=20549&amp;oldid=prev"/>
		<updated>2015-01-25T19:14:59Z</updated>

		<summary type="html">&lt;p&gt;Woozle moved page &lt;a href=&quot;/VbzCart/catalog/building/2008&quot; class=&quot;mw-redirect&quot; title=&quot;VbzCart/catalog/building/2008&quot;&gt;VbzCart/catalog/building/2008&lt;/a&gt; to &lt;a href=&quot;/VbzCart/pieces/catalog/building/2008&quot; title=&quot;VbzCart/pieces/catalog/building/2008&quot;&gt;VbzCart/pieces/catalog/building/2008&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:14, 25 January 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Woozle</name></author>
	</entry>
	<entry>
		<id>https://htyp.org/mw/index.php?title=VbzCart/pieces/catalog/building/2008&amp;diff=12750&amp;oldid=prev</id>
		<title>Woozle: extracted from &quot;/building&quot; page because it is now obsolete</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=VbzCart/pieces/catalog/building/2008&amp;diff=12750&amp;oldid=prev"/>
		<updated>2009-12-10T21:45:14Z</updated>

		<summary type="html">&lt;p&gt;extracted from &amp;quot;/building&amp;quot; page because it is now obsolete&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==History==&lt;br /&gt;
For the [[../2009|2009]] version, the stored queries were scrapped in favor of executing their SQL directly from PHP code.&lt;br /&gt;
==Process==&lt;br /&gt;
This is only a draft, as the process is still being worked out. Right now this process does not &amp;quot;recycle&amp;quot; junked records in cat_items; perhaps that was a bad idea to begin with, or perhaps some other use can be found for junked records that isn&amp;#039;t part of catalog-building. There probably should be some process which removes junked records from use so they aren&amp;#039;t taking up space and CPU cycles.&lt;br /&gt;
# Update the list of all catalog-based items ([calc Items Updates saved])&lt;br /&gt;
#* [[#(Step 1) qryVb_Items_updates_append]] -- Add any new items to [calc Items Updates saved]&lt;br /&gt;
#** [[#(Step 1a) qryVb_Items_updates_new]] -- in-print items that are new&lt;br /&gt;
#*** [[#(Step 1aa) qryVb_Items_updates]] -- all the items currently available from suppliers (in print)&lt;br /&gt;
#** [[#(Step 1b) qryVb_Items_updates_copy_fields]]&lt;br /&gt;
# For all items in [calc Items Updates saved] where ID_Item IS NULL, create new records in cat_items and update the corresponding records in [calc Items Updates saved]&lt;br /&gt;
#* [[#(Step 2) qryVb_Items_results_append]] -- adds new cat_items rows for any calculated items not already cross-referenced. It doesn&amp;#039;t cross-reference them, however. That is done by the next query.&lt;br /&gt;
#** [[#(Step 2a) qryVb_Items_results]]&lt;br /&gt;
# Fill in any blank ID_Item fields in [calc Items Updates saved] records:&lt;br /&gt;
#* [[#(Step 3) qryVb_Items_updates_index_new]] -- plugs the Item ID back into the calculated temp table. It assumes (1) 1:1 correspondence between Item IDs and catalog numbers, and (2) catalog numbers won&amp;#039;t be changed during the course of a build (though they can change in general).&lt;br /&gt;
# Copy calculated item data over to [cat_items]:&lt;br /&gt;
#* [[#(Step 4) qryVb_Items_results_update]]&lt;br /&gt;
# Final flag updates:&lt;br /&gt;
#* [[#(Step 5) qryVb_Items_update_final]]&lt;br /&gt;
#** Clear isInPrint flag for cat_items not found in calculated in-print listing&lt;br /&gt;
#** Set isForSale for cat_items with stock for sale&lt;br /&gt;
#** Update stock quantities for all cat_items&lt;br /&gt;
# Housekeeping: mark table as updated so cached tables get recalculated&lt;br /&gt;
#* [[#(Step 6) qryVb_Items_mark_updated]]&lt;br /&gt;
&lt;br /&gt;
==SQL - queries - 2008==&lt;br /&gt;
2008-03-15: Completely rewriting the building sequence again...&lt;br /&gt;
&lt;br /&gt;
* {{vbzcart/query|qryCtg_src_sub}}&lt;br /&gt;
* {{vbzcart/query|qryCtg_src}}&lt;br /&gt;
* {{vbzcart/query|qryCtg_Items_forUpdJoin}}&lt;br /&gt;
* {{vbzcart/query|qryCtg_Upd_join}}&lt;br /&gt;
* {{vbzcart/query|qryCtg_src_dups}}&lt;br /&gt;
* {{vbzcart|proc|doCtgUpdate}}: the main building process - details are documented there too&lt;br /&gt;
* {{vbzcart/query|qryCtgCk_dup_keys}}: looks for duplicate IDS_Items&lt;br /&gt;
&lt;br /&gt;
==SQL - queries==&lt;br /&gt;
These are from the MS Access 97 version, gradually being honed down for migration to MySQL&lt;br /&gt;
===(Step 1a) qryVb_Items_updates_new===&lt;br /&gt;
&amp;lt;sql&amp;gt;SELECT c.*&lt;br /&gt;
FROM qryCtg_Items_updates_joinable AS c LEFT JOIN ctg_updates AS s&lt;br /&gt;
ON c.IDS_Item=s.IDS_Item&lt;br /&gt;
WHERE s.IDS_Item IS NULL;&amp;lt;/sql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===(Step 1) qryVb_Items_updates_append===&lt;br /&gt;
&amp;lt;sql&amp;gt;INSERT INTO ctg_updates (&lt;br /&gt;
  ID_Item,&lt;br /&gt;
  IDS_Item,&lt;br /&gt;
  CatNum,&lt;br /&gt;
  CatSfx,&lt;br /&gt;
  ID_Title,&lt;br /&gt;
  ID_CTG_Group,&lt;br /&gt;
  ID_CTG_Title,&lt;br /&gt;
  ID_CTG_Item,&lt;br /&gt;
  ID_ItTyp,&lt;br /&gt;
  ID_ItOpt )&lt;br /&gt;
SELECT&lt;br /&gt;
  0 AS ID_Item,&lt;br /&gt;
  IDS_Item,&lt;br /&gt;
  CatNum,&lt;br /&gt;
  CatSfx,&lt;br /&gt;
  ID_Title,&lt;br /&gt;
  ID_TGroup,&lt;br /&gt;
  ID_TGTitle,&lt;br /&gt;
  ID_TGItem,&lt;br /&gt;
  ID_ItTyp,&lt;br /&gt;
  ID_ItOpt&lt;br /&gt;
FROM qryVb_Items_Updates_new;&lt;br /&gt;
&amp;lt;/sql&amp;gt;&lt;br /&gt;
===(Step 2) qryVb_Items_results_append===&lt;br /&gt;
This adds new cat_items rows for any calculated items not already cross-referenced. It doesn&amp;#039;t cross-reference them, however. That is done by the next query.&lt;br /&gt;
&amp;lt;sql&amp;gt;INSERT INTO cat_items (&lt;br /&gt;
  CatNum,&lt;br /&gt;
  isForSale,&lt;br /&gt;
  isMaster,&lt;br /&gt;
  isInPrint,&lt;br /&gt;
  isCloseOut,&lt;br /&gt;
  ID_ItTyp,&lt;br /&gt;
  ID_ItOpt,&lt;br /&gt;
  ItOpt_Descr,&lt;br /&gt;
  ItOpt_Sort,&lt;br /&gt;
  ID_ShipCost,&lt;br /&gt;
  PriceBuy,&lt;br /&gt;
  PriceSell,&lt;br /&gt;
  PriceList )&lt;br /&gt;
SELECT&lt;br /&gt;
  r.CatNum,&lt;br /&gt;
  r.isForSale,&lt;br /&gt;
  FALSE AS isMaster,&lt;br /&gt;
  r.isInPrint,&lt;br /&gt;
  r.isCloseOut,&lt;br /&gt;
  r.ID_ItTyp,&lt;br /&gt;
  r.ID_ItOpt,&lt;br /&gt;
  r.ItOpt_Descr,&lt;br /&gt;
  r.ItOpt_Sort,&lt;br /&gt;
  r.ID_ShipCost,&lt;br /&gt;
  r.PriceBuy,&lt;br /&gt;
  r.PriceSell,&lt;br /&gt;
  r.PriceList&lt;br /&gt;
FROM qryCtg_Items_updates AS r LEFT JOIN cat_items AS i ON r.ID_Item=i.ID&lt;br /&gt;
WHERE i.ID IS NULL;&lt;br /&gt;
&amp;lt;/sql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===(Step 3) qryVb_Items_updates_index_new===&lt;br /&gt;
This plugs the Item ID back into the calculated temp table. It assumes (1) 1:1 correspondence between Item IDs and catalog numbers, and (2) catalog numbers won&amp;#039;t be changed during the course of a build (though they can change in general).&lt;br /&gt;
&amp;lt;sql&amp;gt;UPDATE&lt;br /&gt;
  ctg_updates AS s LEFT JOIN&lt;br /&gt;
  cat_items AS i&lt;br /&gt;
ON i.CatNum=s.CatNum&lt;br /&gt;
SET&lt;br /&gt;
  s.ID_Item = i.ID,&lt;br /&gt;
  isForSale = FALSE,&lt;br /&gt;
  isInPrint = FALSE&lt;br /&gt;
WHERE&lt;br /&gt;
  s.ID_Item IS NULL;&lt;br /&gt;
&amp;lt;/sql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===(Step 4) qryVb_Items_results_update===&lt;br /&gt;
&amp;lt;sql&amp;gt;UPDATE&lt;br /&gt;
  qryCtg_build AS r LEFT JOIN&lt;br /&gt;
  cat_items AS i&lt;br /&gt;
ON&lt;br /&gt;
  r.ID_Item=i.ID&lt;br /&gt;
SET&lt;br /&gt;
  i.CatNum = r.CatNum,&lt;br /&gt;
  i.isForSale = r.isForSale,&lt;br /&gt;
  i.isInPrint = r.isInPrint,&lt;br /&gt;
  i.isCloseOut = r.isCloseOut,&lt;br /&gt;
  i.isPulled = FALSE,&lt;br /&gt;
  i.isDumped = FALSE,&lt;br /&gt;
  i.ID_ItTyp = r.ID_ItTyp,&lt;br /&gt;
  i.ID_ItOpt = r.ID_ItOpt,&lt;br /&gt;
  i.ItOpt_Descr = iif(r.ItOpt_Descr IS NULL,i.ItOpt_Descr,r.ItOpt_Descr), &lt;br /&gt;
  i.ItOpt_Sort = r.ItOpt_Sort,&lt;br /&gt;
  i.ID_ShipCost = r.ID_ShipCost,&lt;br /&gt;
  i.PriceBuy = r.PriceBuy,&lt;br /&gt;
  i.PriceSell = r.PriceSell,&lt;br /&gt;
  i.PriceList = r.PriceList,&lt;br /&gt;
  i.GrpCode = r.GrpCode,&lt;br /&gt;
  i.GrpDescr = r.GrpDescr,&lt;br /&gt;
  i.GrpSort = r.GrpSort,&lt;br /&gt;
  i.CatSfx = r.CatSfx&lt;br /&gt;
WHERE r.ID_Item IS NOT NULL;&lt;br /&gt;
&amp;lt;/sql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes:&lt;br /&gt;
* Must clear isPulled and isDumped, in case pulled items are returned to service&lt;br /&gt;
===(Step 5) qryVb_Items_update_final===&lt;br /&gt;
* Clear isInPrint flag for cat_items not found in calculated in-print listing&lt;br /&gt;
* Set isForSale for cat_items with stock for sale&lt;br /&gt;
* Update stock quantities for all cat_items&lt;br /&gt;
&amp;lt;sql&amp;gt;UPDATE &lt;br /&gt;
  (cat_items AS i LEFT JOIN qryCtg_build AS r ON r.ID_Item=i.ID)&lt;br /&gt;
  LEFT JOIN v_stk_items_remaining AS s ON s.ID_Item=i.ID&lt;br /&gt;
SET&lt;br /&gt;
  i.isInPrint = nz(r.isInPrint),&lt;br /&gt;
  i.isCloseOut = nz(r.isCloseOut),&lt;br /&gt;
  i.isForSale = nz(r.isInPrint)&lt;br /&gt;
      OR nz(r.isCloseOut)&lt;br /&gt;
      OR (nz(s.QtyForSale) &amp;gt; 0),&lt;br /&gt;
  i.qtyInStock = nz(s.QtyForSale);&lt;br /&gt;
&amp;lt;/sql&amp;gt;&lt;br /&gt;
===(Step 6) qryVb_Items_mark_updated===&lt;br /&gt;
&amp;lt;sql&amp;gt;UPDATE&lt;br /&gt;
  data_tables&lt;br /&gt;
SET WhenUpdated=Now()&lt;br /&gt;
WHERE Name=&amp;quot;cat_items&amp;quot;&amp;lt;/sql&amp;gt;&lt;/div&gt;</summary>
		<author><name>Woozle</name></author>
	</entry>
</feed>