<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — New filter for cust. inquiry screen: 'Sales Invoices & Delivery Notes']]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=4363</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=4363&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in New filter for cust. inquiry screen: 'Sales Invoices & Delivery Notes'.]]></description>
		<lastBuildDate>Fri, 06 Sep 2013 03:05:03 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[New filter for cust. inquiry screen: 'Sales Invoices & Delivery Notes']]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=17656#p17656</link>
			<description><![CDATA[<p>Hi Guys<br />I made a quick mod to the &#039;Customer Transactions&#039; screen to give you a new document filter.<br />I wanted to quickly see just Sales Invoices and Delivery Notes documents in the list, so made the following mod instructions if you want to do the same thing (or add your own custom document filter).</p><p>I&#039;m not suggesting this go into the main version, I just posted the instructions here in case anyone wants to do the same thing, or add their own filters. Use at your own risk!</p><p>Pete</p><p>New &#039;Sales Invoice &amp; Delivery Notes&#039; selector for customer_inquiry.php by Pete p2409.<br />------------------------------------------------------------------------------------</p><p>Currently, FA lets you filter document types in the customer inquiry (transactions)<br />screen eg. Sales Invoices, Overdue Invoices etc.</p><p>This mod adds a new filter: Sales Invoices &amp; Delivery Notes, letting you match them<br />more easily. Two files are modified (3 minor mods).<br />The logic can easily be adapted for any other document filters you want in this screen.</p><p>CHANGES TO CODE/TABLE<br />---------------------</p><p>1) ./includes/ui/ui_lists.inc</p><p>Add &#039;Sales Invoices &amp; Delivery Notes&#039; option to the cust_allocations_list_cells<br />function.<br />Around line 1935, find:<br /></p><div class="codebox"><pre><code>    $allocs = array(
        $all_items=&gt;_(&quot;All Types&quot;),
        &#039;1&#039;=&gt; _(&quot;Sales Invoices&quot;),
        &#039;2&#039;=&gt; _(&quot;Overdue Invoices&quot;),
        &#039;3&#039; =&gt; _(&quot;Payments&quot;),
        &#039;4&#039; =&gt; _(&quot;Credit Notes&quot;),
        &#039;5&#039; =&gt; _(&quot;Delivery Notes&quot;)
    );</code></pre></div><p>CHANGE TO:<br /></p><div class="codebox"><pre><code>    $allocs = array(
        $all_items=&gt;_(&quot;All Types&quot;),
        &#039;1&#039;=&gt; _(&quot;Sales Invoices&quot;),
        &#039;2&#039;=&gt; _(&quot;Overdue Invoices&quot;),
        &#039;3&#039; =&gt; _(&quot;Payments&quot;),
        &#039;4&#039; =&gt; _(&quot;Credit Notes&quot;),
        &#039;5&#039; =&gt; _(&quot;Delivery Notes&quot;),
        &#039;6&#039; =&gt; _(&quot;Sales Invoices&quot;) . &quot; &amp; &quot; . _(&quot;Delivery Notes&quot;)
    );</code></pre></div><p>2) ./sales/includes/db/cust_trans_db.inc</p><p>We need to update SQL the in customer transaction query function (get_sql_for_customer_inquiry)</p><p>Around line 356, ADD:<br /></p><div class="codebox"><pre><code>        // Add delivery and invoices option
        elseif ($_POST[&#039;filterType&#039;] == &#039;6&#039;)
        {
            $sql .= &quot; AND (trans.type = &quot;.ST_SALESINVOICE .&quot; OR
            trans.type = &quot;. ST_CUSTDELIVERY . &quot;) &quot;;
        }
        // eof delivery and invoice filter option</code></pre></div><p>The transaction sort key has been changed to order number, just for this option.<br />Around line 370, after the group by clause, add a test for this new option, and<br />a single ORDER BY line below:</p><p>AFTER:<br /></p><div class="codebox"><pre><code>    $sql .= &quot; GROUP BY trans.trans_no, trans.type&quot;;</code></pre></div><p>ADD:<br /></p><div class="codebox"><pre><code>    // Order by trans.order_, but only for &#039;Sales Invoice &amp; Delivery Note&#039; filter.
    if ($_POST[&#039;filterType&#039;] == &#039;6&#039;) {
        $sql .= &quot; ORDER BY trans.order_ DESC, trans.trans_no DESC &quot;;
    }
    // eof p2409</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (p2409)]]></author>
			<pubDate>Fri, 06 Sep 2013 03:05:03 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=17656#p17656</guid>
		</item>
	</channel>
</rss>
