<?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%2Fqueries%2FqryOrderLines_notPkgd</id>
	<title>VbzCart/queries/qryOrderLines notPkgd - 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%2Fqueries%2FqryOrderLines_notPkgd"/>
	<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=VbzCart/queries/qryOrderLines_notPkgd&amp;action=history"/>
	<updated>2026-07-07T03:27:08Z</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/queries/qryOrderLines_notPkgd&amp;diff=12799&amp;oldid=prev</id>
		<title>Woozle: this is now obsolete</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=VbzCart/queries/qryOrderLines_notPkgd&amp;diff=12799&amp;oldid=prev"/>
		<updated>2009-12-14T12:24:22Z</updated>

		<summary type="html">&lt;p&gt;this is now obsolete&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:24, 14 December 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Details==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Details==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &#039;&#039;&#039;Status&#039;&#039;&#039;: Appears to be OBSOLETE; it&#039;s much quicker to generate the list in code (maybe there&#039;s a way to optimize the SQL, but code gives you more control over how the summing is done and more options for doing it)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;#039;&amp;#039;&amp;#039;Returns&amp;#039;&amp;#039;&amp;#039;: Active order lines which have yet to be (completely) put into a package&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;#039;&amp;#039;&amp;#039;Returns&amp;#039;&amp;#039;&amp;#039;: Active order lines which have yet to be (completely) put into a package&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &#039;&#039;&#039;Requires&#039;&#039;&#039;: {{vbzcart&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/&lt;/del&gt;table|ord_lines}}, {{vbzcart&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/&lt;/del&gt;table|ord_pkg_lines}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &#039;&#039;&#039;Requires&#039;&#039;&#039;: {{vbzcart&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|&lt;/ins&gt;table|ord_lines}}, {{vbzcart&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|&lt;/ins&gt;table|ord_pkg_lines&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}}, {{vbzcart|table|core_orders&lt;/ins&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &#039;&#039;&#039;Used by&#039;&#039;&#039;:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &#039;&#039;&#039;Used by&#039;&#039;&#039;: &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{vbzcart/query|qryStock_forOpenOrders}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &#039;&#039;&#039;History&#039;&#039;&#039;:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;** &#039;&#039;&#039;2009-12-13&#039;&#039;&#039; Tried adding JOIN to {{vbzcart/table|core_orders}} to eliminate looking through pulled orders, as a time-optimization, but it didn&#039;t seem to make much difference; reverted back to old version. Discovered that doing the summing in code was vastly better, so this query is now OBSOLETE.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==SQL==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==SQL==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;section begin=sql /&amp;gt;&amp;lt;mysql&amp;gt;CREATE OR REPLACE VIEW qryOrderLines_notPkgd AS&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;section begin=sql /&amp;gt;&amp;lt;mysql&amp;gt;CREATE OR REPLACE VIEW qryOrderLines_notPkgd AS&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/queries/qryOrderLines_notPkgd&amp;diff=10909&amp;oldid=prev</id>
		<title>Woozle: New page: ==Details== * &#039;&#039;&#039;Returns&#039;&#039;&#039;: Active order lines which have yet to be (completely) put into a package * &#039;&#039;&#039;Requires&#039;&#039;&#039;: {{vbzcart/table|ord_lines}}, {{vbzcart/table|ord_pkg_lines}} * &#039;&#039;&#039;Use...</title>
		<link rel="alternate" type="text/html" href="https://htyp.org/mw/index.php?title=VbzCart/queries/qryOrderLines_notPkgd&amp;diff=10909&amp;oldid=prev"/>
		<updated>2008-12-03T21:07:04Z</updated>

		<summary type="html">&lt;p&gt;New page: ==Details== * &amp;#039;&amp;#039;&amp;#039;Returns&amp;#039;&amp;#039;&amp;#039;: Active order lines which have yet to be (completely) put into a package * &amp;#039;&amp;#039;&amp;#039;Requires&amp;#039;&amp;#039;&amp;#039;: {{vbzcart/table|ord_lines}}, {{vbzcart/table|ord_pkg_lines}} * &amp;#039;&amp;#039;&amp;#039;Use...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Details==&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Returns&amp;#039;&amp;#039;&amp;#039;: Active order lines which have yet to be (completely) put into a package&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Requires&amp;#039;&amp;#039;&amp;#039;: {{vbzcart/table|ord_lines}}, {{vbzcart/table|ord_pkg_lines}}&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Used by&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
==SQL==&lt;br /&gt;
&amp;lt;section begin=sql /&amp;gt;&amp;lt;mysql&amp;gt;CREATE OR REPLACE VIEW qryOrderLines_notPkgd AS&lt;br /&gt;
SELECT&lt;br /&gt;
  oi.ID,&lt;br /&gt;
  oi.ID_Order,&lt;br /&gt;
  oi.ID_Item,&lt;br /&gt;
  oi.CatNum,&lt;br /&gt;
  oi.Descr,&lt;br /&gt;
  oi.QtyOrd,&lt;br /&gt;
  oi.Price,&lt;br /&gt;
  oi.QtyOrd&lt;br /&gt;
    -SUM(&lt;br /&gt;
      IFNULL(pi.QtyShipped,0)&lt;br /&gt;
      +IFNULL(pi.QtyNotAvail,0)&lt;br /&gt;
      +IFNULL(pi.QtyKilled,0)&lt;br /&gt;
    ) AS QtyOpen,&lt;br /&gt;
  SUM(IFNULL(pi.QtyShipped,0)) AS QtyShipped,&lt;br /&gt;
  SUM(IFNULL(pi.QtyShipped,0)&lt;br /&gt;
    +IFNULL(pi.QtyNotAvail,0)&lt;br /&gt;
    +IFNULL(pi.QtyKilled,0)) AS QtyHandled&lt;br /&gt;
FROM&lt;br /&gt;
  ord_lines AS oi&lt;br /&gt;
    LEFT JOIN ord_pkg_lines pi ON pi.ID_OrdLine=oi.ID&lt;br /&gt;
GROUP BY&lt;br /&gt;
  oi.ID,&lt;br /&gt;
  oi.ID_Order,&lt;br /&gt;
  oi.ID_Item,&lt;br /&gt;
  oi.CatNum,&lt;br /&gt;
  oi.Descr,&lt;br /&gt;
  oi.QtyOrd,&lt;br /&gt;
  oi.Price&lt;br /&gt;
HAVING oi.QtyOrd-QtyHandled &amp;gt;0;&amp;lt;/mysql&amp;gt;&lt;br /&gt;
&amp;lt;section end=sql /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Woozle</name></author>
	</entry>
</feed>