<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — [SOLVED]: sales_orders.type=0 not in Template Invoice listing]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=5432</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5432&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in [SOLVED]: sales_orders.type=0 not in Template Invoice listing.]]></description>
		<lastBuildDate>Tue, 30 Dec 2014 19:35:18 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [SOLVED]: sales_orders.type=0 not in Template Invoice listing]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=21968#p21968</link>
			<description><![CDATA[<p>The <strong>Tmpl</strong> checkbox needs to be checked (ticked) in the <strong>Sales =&gt; Sales Order Inquiry</strong> to set the <strong>sales_orders.type=1</strong>.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Tue, 30 Dec 2014 19:35:18 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=21968#p21968</guid>
		</item>
		<item>
			<title><![CDATA[[SOLVED]: sales_orders.type=0 not in Template Invoice listing]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=21966#p21966</link>
			<description><![CDATA[<p><strong>Sales =&gt; Template Invoice</strong></p><p>If we had earlier entered a Direct Invoice, then <strong>sales_orders.type=0</strong> and will not display it in the Invoice Template listing.</p><p>This is due to line 503-504 in <strong>sales/includes/db/sales_order_db.inc</strong>:<br /></p><div class="codebox"><pre><code>        elseif ($filter==&#039;InvoiceTemplates&#039; || $filter==&#039;DeliveryTemplates&#039;)
            $sql .= &quot; AND sorder.type=1&quot;;</code></pre></div><p>Is this the intended functionality?</p><p>What are the possible values of the <strong>sales_orders.type</strong> field and what do they indicate?</p><p>Even a fresh sales order results in <strong>sales_orders.type</strong> field being 0.</p><p>Also if a direct invoice is entered, the Invoice id is incremented but the Sales Order number is not incremented as seen in the <strong>Setup =&gt; Forms Setup</strong> screen. When the next sales order entry is made, the Sales Order number is incremented from it&#039;s old wrong value and hence remains wrong in the <strong>Setup =&gt; Forms Setup</strong> display.</p><p>Hence the <strong>next_reference</strong> field in the <strong>sys_types</strong> table can easily become out of sync with actuals. Instead of incrementing the values in the next_reference field, it is better to use the <strong>last_insert_id() + 1</strong> or take max of field from appropriate table&#039;s primary key.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Tue, 30 Dec 2014 18:51:38 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=21966#p21966</guid>
		</item>
	</channel>
</rss>
