<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Sales Orders view DESC mode]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=3984</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=3984&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Sales Orders view DESC mode.]]></description>
		<lastBuildDate>Sat, 06 Jul 2013 06:04:17 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Sales Orders view DESC mode]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=16994#p16994</link>
			<description><![CDATA[<p>The simple solution is this<br />_(&quot;Order Date&quot;) =&gt; array(&#039;name&#039;=&gt;&#039;ord_date&#039;, &#039;type&#039;=&gt;&#039;date&#039;, &#039;ord&#039;=&gt;&#039;desc&#039;),</p>]]></description>
			<author><![CDATA[null@example.com (cristiart)]]></author>
			<pubDate>Sat, 06 Jul 2013 06:04:17 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=16994#p16994</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders view DESC mode]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=16226#p16226</link>
			<description><![CDATA[<p>Lines 127 to 138 of <strong>includes/db_pager.inc</strong>:<br /></p><div class="codebox"><pre><code>    //    Change sort column direction 
    //    in order asc-&gt;desc-&gt;none-&gt;asc
    //
    function sort_table($col) 
    {
        $ord = $this-&gt;columns[$col][&#039;ord&#039;];
        $ord = ($ord == &#039;&#039;) ? &#039;asc&#039; : (($ord == &#039;asc&#039;) ? &#039;desc&#039; : &#039;&#039;);
        $this-&gt;columns[$col][&#039;ord&#039;] = $ord;
        $this-&gt;set_page(1);
        $this-&gt;query();
        return true;
    }</code></pre></div><p>This clearly shows a <strong>$ord</strong> check for <strong>empty</strong> being retained as empty becoming ASC, a check for <strong>asc</strong> being set to DESC&nbsp; but if <strong>desc</strong>, no enforcement is done unless invoked by a click to be ASC. Hence Line 133:<br /></p><div class="codebox"><pre><code>        $ord = ($ord == &#039;&#039;) ? &#039;asc&#039; : (($ord == &#039;asc&#039;) ? &#039;desc&#039; : &#039;&#039;);</code></pre></div><p>should possibly be explicit in all it&#039;s redundant splendour&nbsp; (default being to capture any invalid declaration degrading gracefully) like:<br /></p><div class="codebox"><pre><code>        switch ($ord) {
            case &#039;asc&#039;:
                $ord = &#039;desc&#039;;
                break;
            case &#039;desc&#039;:
            case &#039;&#039;:
                $ord = &#039;asc&#039;;
                break;
            default:
                $ord = &#039;asc&#039;;
        }</code></pre></div><p>Hence a setting of &#039;asc&#039; in the code would result in a default display of DESC in this case as in the earlier one as well. This code fragment does not change any logic and is unnecessary and is placed for an understanding of how activation occurs on clicking only.</p><p>If there is a check for an initial value placed in the php page we should use that value to be the default when the $ord is empty thru&#039; clicking route - thereafter, the clicked value of $ord will be available as asc or desc.</p><p>Lines 50-62 of <strong>includes/ui/db_pager_view.php</strong>:<br /></p><div class="codebox"><pre><code>    foreach($pager-&gt;columns as $num_col=&gt;$col) {
        // record status control column is displayed only when control checkbox is on
        if (isset($col[&#039;head&#039;]) &amp;&amp; ($col[&#039;type&#039;]!=&#039;inactive&#039; || get_post(&#039;show_inactive&#039;))) {
            if (!isset($col[&#039;ord&#039;]))
                $headers[] = $col[&#039;head&#039;];
            else {
                  $icon = (($col[&#039;ord&#039;] == &#039;desc&#039;) ? &#039;sort_desc.gif&#039; : 
                    ($col[&#039;ord&#039;] == &#039;asc&#039; ? &#039;sort_asc.gif&#039; : &#039;sort_none.gif&#039;));
                $headers[] = navi_button($pager-&gt;name.&#039;_sort_&#039;.$num_col, 
                    $col[&#039;head&#039;], true, $icon);
            }
         }
    }</code></pre></div><p>sets the sort image on the header correctly and checks used here can be used in the earlier code fragment to synch a similar behaviour.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Wed, 27 Mar 2013 03:40:43 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=16226#p16226</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders view DESC mode]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=16224#p16224</link>
			<description><![CDATA[<p>i thought so to, but it will not for some reason...</p>]]></description>
			<author><![CDATA[null@example.com (cristiart)]]></author>
			<pubDate>Tue, 26 Mar 2013 19:24:46 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=16224#p16224</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders view DESC mode]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=16223#p16223</link>
			<description><![CDATA[<p>Then the following should sort by descending order by default:<br /></p><div class="codebox"><pre><code>_(&quot;Order #&quot;) =&gt; array(&#039;fun&#039;=&gt;&#039;view_link&#039;, &#039;ord&#039;=&gt;&#039;desc&#039;),</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Tue, 26 Mar 2013 19:04:02 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=16223#p16223</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders view DESC mode]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=16222#p16222</link>
			<description><![CDATA[<p>That did not worked but i change line 270 in to this</p><p>&nbsp; &nbsp; &nbsp; &nbsp; _(&quot;Order #&quot;) =&gt; array(&#039;fun&#039;=&gt;&#039;view_link&#039;, &#039;ord&#039;=&gt;&#039;asc&#039;),</p><p>This will allow me to short by asc/desc but not by default. Once you navigate back from page, and come back you&#039;ll have to press &quot;order#&quot; again to rearrange the order...</p>]]></description>
			<author><![CDATA[null@example.com (cristiart)]]></author>
			<pubDate>Tue, 26 Mar 2013 18:48:07 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=16222#p16222</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders view DESC mode]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=16209#p16209</link>
			<description><![CDATA[<p>Try line 268 in sales/inquiry/sales_orders_view.php :<br /></p><div class="codebox"><pre><code>        _(&quot;Required By&quot;) =&gt;array(&#039;type&#039;=&gt;&#039;date&#039;, &#039;ord&#039;=&gt;&#039;&#039;),</code></pre></div><p>to be:<br /></p><div class="codebox"><pre><code>        _(&quot;Required By&quot;) =&gt;array(&#039;type&#039;=&gt;&#039;date&#039;, &#039;ord&#039;=&gt;&#039;desc&#039;),</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Tue, 26 Mar 2013 11:07:49 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=16209#p16209</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders view DESC mode]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=16205#p16205</link>
			<description><![CDATA[<p>Then just look into the sales_orders_view.php code. You have sortable &#039;Required by&#039; column here.<br />Janusz</p>]]></description>
			<author><![CDATA[null@example.com (itronics)]]></author>
			<pubDate>Tue, 26 Mar 2013 07:34:31 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=16205#p16205</guid>
		</item>
		<item>
			<title><![CDATA[Sales Orders view DESC mode]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=16200#p16200</link>
			<description><![CDATA[<p>is there a way to view all sales order in DESC mode/order by default?<br />i&#039;m trying to figure this out to see if I can use FA for my company. We have hundreds of orders/invoices per month and it&#039;s very hard to keep track with invoices + overdue invoices if they are on the back of the list. </p><p>I can hack the php code to do this if i can get some pointers since i&#039;m new here <img src="https://frontaccounting.com/punbb/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />thanks</p>]]></description>
			<author><![CDATA[null@example.com (cristiart)]]></author>
			<pubDate>Tue, 26 Mar 2013 04:20:02 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=16200#p16200</guid>
		</item>
	</channel>
</rss>
