<?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 Overview]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=7290</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7290&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Sales Orders Overview.]]></description>
		<lastBuildDate>Tue, 30 Jan 2018 16:03:19 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Sales Orders Overview]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30679#p30679</link>
			<description><![CDATA[<p>@Joe, <br />yes this way is much better. <br />thanks.</p>]]></description>
			<author><![CDATA[null@example.com (Alaa)]]></author>
			<pubDate>Tue, 30 Jan 2018 16:03:19 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30679#p30679</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders Overview]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30667#p30667</link>
			<description><![CDATA[<p>Ok, Guys. This has been <a href="https://github.com/FrontAccountingERP/FA/commit/73f247196745ed24e9258d2d8535c6630bc07a4e">committed</a> with zero decimals in the amounts. I think it is better not to have too much digits when you shall overview the report.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Mon, 29 Jan 2018 21:14:36 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30667#p30667</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders Overview]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30665#p30665</link>
			<description><![CDATA[<p>Hello Guys.</p><p>If it is ok with 0 decimals, I could just change the two amount places to AmountCol. Default decimals here is 0.</p><p>I think that the decimal values is maybe unneeded in the amounts here, right?</p><p>Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Mon, 29 Jan 2018 19:27:42 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30665#p30665</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders Overview]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30664#p30664</link>
			<description><![CDATA[<p>You are right, I didn&#039;t register that when changing. Thanks for reporting this. Will make a rerun in a while.</p><p>Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Mon, 29 Jan 2018 18:55:14 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30664#p30664</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders Overview]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30663#p30663</link>
			<description><![CDATA[<p>As long as the Qty Dec and the Prices/Amount Dec are the same the report is okay.</p><p>@joe: The variable <strong>$dec</strong> is first used in <a href="https://github.com/FrontAccountingERP/FA/blob/5b56b67cfe574ef2d836a038d98a79914ff7a7a7/reporting/rep105.php#L157">Line 157</a> but assigned only later at <a href="https://github.com/FrontAccountingERP/FA/blob/5b56b67cfe574ef2d836a038d98a79914ff7a7a7/reporting/rep105.php#L164">Line 164</a> and that too as a Quantity Unit&#039;s Decimal (<strong>get_qty_dec()</strong>) and used correctly in the next 3 lines for Quantity values but wrongly in <a href="https://github.com/FrontAccountingERP/FA/blob/5b56b67cfe574ef2d836a038d98a79914ff7a7a7/reporting/rep105.php#L179">Line 179</a> for Total Amount. Another variable, say <strong>$dec1</strong> should be assigned <strong>user_price_dec()</strong> much earlier and used for the first and last occurrences of the current <strong>$dec</strong>. While at it, whitespace on Line 138 can also be removed.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Mon, 29 Jan 2018 16:24:07 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30663#p30663</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders Overview]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30662#p30662</link>
			<description><![CDATA[<p>@Joe</p><p>Thanks a lot bro, its perfect, specially the total sales order.. i love it &lt;3 .</p>]]></description>
			<author><![CDATA[null@example.com (Alaa)]]></author>
			<pubDate>Mon, 29 Jan 2018 12:56:37 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30662#p30662</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders Overview]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30661#p30661</link>
			<description><![CDATA[<p>Hello Again,</p><p>I moved the Total Amount for every Sales Order under the Loc column. That gives a little more &#039;air&#039;.<br />And of course a Grand Total.</p><p><a href="https://github.com/FrontAccountingERP/FA/commit/5b56b67cfe574ef2d836a038d98a79914ff7a7a7">Committed</a> to 2.4 core repo.</p><p>I hope it is ok.</p><p>Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Mon, 29 Jan 2018 12:45:00 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30661#p30661</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders Overview]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30659#p30659</link>
			<description><![CDATA[<p>if the sum of Sales Orders for the printed period can be added to the report it&#039;d make a great addition, right now there is noway to know the sum of all sales orders for the selected period. to get it i either use the calculator to enter the amount of each sales order, or by copying the whole sales order inquiry and paste it into excel.</p>]]></description>
			<author><![CDATA[null@example.com (Alaa)]]></author>
			<pubDate>Mon, 29 Jan 2018 09:38:18 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30659#p30659</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders Overview]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30657#p30657</link>
			<description><![CDATA[<p>I will have a look into it.</p><p>Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Mon, 29 Jan 2018 05:50:42 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30657#p30657</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders Overview]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30653#p30653</link>
			<description><![CDATA[<p>The rep105 should be retained as is and the amount can be optionally added under the &quot;Del Date&quot; field.</p><p>@Alaa&#039;s implementation is attached herewith.</p><p>@joe: should we add this into the Sales Orders Report in the core by placing the amount under the Del Date?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 28 Jan 2018 18:20:41 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30653#p30653</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders Overview]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30635#p30635</link>
			<description><![CDATA[<p>i have fixed it by removing the location since i don&#039;t need it and replaced it with Order Total,,<br />here is the code in case someone needs it.</p><div class="codebox"><pre><code>&lt;?php
/**********************************************************************
    Copyright (C) FrontAccounting, LLC.
    Released under the terms of the GNU General Public License, GPL, 
    as published by the Free Software Foundation, either version 3 
    of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
    See the License here &lt;http://www.gnu.org/licenses/gpl-3.0.html&gt;.
***********************************************************************/
$page_security = &#039;SA_SALESBULKREP&#039;;
// ----------------------------------------------------------------
// $ Revision:    2.0 $
// Creator:    Joe Hunt
// date_:    2005-05-19
// Title:    Order Status List
// ----------------------------------------------------------------
$path_to_root=&quot;..&quot;;

include_once($path_to_root . &quot;/includes/session.inc&quot;);
include_once($path_to_root . &quot;/includes/date_functions.inc&quot;);
include_once($path_to_root . &quot;/includes/data_checks.inc&quot;);
include_once($path_to_root . &quot;/sales/includes/sales_db.inc&quot;);
include_once($path_to_root . &quot;/inventory/includes/db/items_category_db.inc&quot;);

//----------------------------------------------------------------------------------------------------

print_order_status_list();

//----------------------------------------------------------------------------------------------------

function GetSalesOrders($from, $to, $category=0, $location=null, $backorder=0)
{
    $fromdate = date2sql($from);
    $todate = date2sql($to);

    $sql= &quot;SELECT sorder.order_no,
                sorder.debtor_no,
                sorder.branch_code,
                sorder.customer_ref,
                sorder.ord_date,
                sorder.from_stk_loc,
                sorder.delivery_date,
                line.stk_code,
                item.description,
                item.units,
                sorder.total,
                line.quantity,
                line.qty_sent
            FROM &quot;.TB_PREF.&quot;sales_orders sorder
                   INNER JOIN &quot;.TB_PREF.&quot;sales_order_details line
                    ON sorder.order_no = line.order_no
                    AND sorder.trans_type = line.trans_type
                    AND sorder.trans_type = &quot;.ST_SALESORDER.&quot;
                INNER JOIN &quot;.TB_PREF.&quot;stock_master item
                    ON line.stk_code = item.stock_id
            WHERE sorder.ord_date &gt;=&#039;$fromdate&#039;
                AND sorder.ord_date &lt;=&#039;$todate&#039;&quot;;
    if ($category &gt; 0)
        $sql .= &quot; AND item.category_id=&quot;.db_escape($category);
    if ($location != null)
        $sql .= &quot; AND sorder.from_stk_loc=&quot;.db_escape($location);
    if ($backorder)
        $sql .= &quot; AND line.quantity - line.qty_sent &gt; 0&quot;;
    $sql .= &quot; ORDER BY sorder.order_no&quot;;

    return db_query($sql, &quot;Error getting order details&quot;);
}

//----------------------------------------------------------------------------------------------------

function print_order_status_list()
{
    global $path_to_root;

    $from = $_POST[&#039;PARAM_0&#039;];
    $to = $_POST[&#039;PARAM_1&#039;];
    $category = $_POST[&#039;PARAM_2&#039;];
    $location = $_POST[&#039;PARAM_3&#039;];
    $backorder = $_POST[&#039;PARAM_4&#039;];
    $comments = $_POST[&#039;PARAM_5&#039;];
    $orientation = $_POST[&#039;PARAM_6&#039;];
    $destination = $_POST[&#039;PARAM_7&#039;];
    if ($destination)
        include_once($path_to_root . &quot;/reporting/includes/excel_report.inc&quot;);
    else
        include_once($path_to_root . &quot;/reporting/includes/pdf_report.inc&quot;);
    $orientation = ($orientation ? &#039;L&#039; : &#039;P&#039;);

    if ($category == ALL_NUMERIC)
        $category = 0;
    if ($location == ALL_TEXT)
        $location = null;
    if ($category == 0)
        $cat = _(&#039;All&#039;);
    else
        $cat = get_category_name($category);
    if ($location == null)
        $loc = _(&#039;All&#039;);
    else
        $loc = get_location_name($location);
    if ($backorder == 0)
        $back = _(&#039;All Orders&#039;);
    else
        $back = _(&#039;Back Orders Only&#039;);

    $cols = array(0, 60, 150, 260, 325,    385, 450, 515);

    $headers2 = array(_(&#039;Order&#039;), _(&#039;Customer&#039;), _(&#039;Branch&#039;), _(&#039;Customer Ref&#039;),
        _(&#039;Ord Date&#039;),    _(&#039;Del Date&#039;),    _(&#039;Order Total&#039;));

    $aligns = array(&#039;left&#039;,    &#039;left&#039;,    &#039;right&#039;, &#039;right&#039;, &#039;right&#039;, &#039;right&#039;,    &#039;right&#039;);

    $headers = array(_(&#039;Code&#039;),    _(&#039;Description&#039;), _(&#039;Ordered&#039;),    _(&#039;Delivered&#039;),
        _(&#039;Outstanding&#039;), &#039;&#039;);

    $params =   array(     0 =&gt; $comments,
                        1 =&gt; array(  &#039;text&#039; =&gt; _(&#039;Period&#039;), &#039;from&#039; =&gt; $from, &#039;to&#039; =&gt; $to),
                        2 =&gt; array(  &#039;text&#039; =&gt; _(&#039;Category&#039;), &#039;from&#039; =&gt; $cat,&#039;to&#039; =&gt; &#039;&#039;),
                        3 =&gt; array(  &#039;text&#039; =&gt; _(&#039;Location&#039;), &#039;from&#039; =&gt; $loc, &#039;to&#039; =&gt; &#039;&#039;),
                        4 =&gt; array(  &#039;text&#039; =&gt; _(&#039;Selection&#039;),&#039;from&#039; =&gt; $back,&#039;to&#039; =&gt; &#039;&#039;));

    $aligns2 = $aligns;

    $rep = new FrontReport(_(&#039;Order Status Listing&#039;), &quot;OrderStatusListing&quot;, user_pagesize(), 9, $orientation);
    if ($orientation == &#039;L&#039;)
        recalculate_cols($cols);
    $cols2 = $cols;
    $rep-&gt;Font();
    $rep-&gt;Info($params, $cols, $headers, $aligns, $cols2, $headers2, $aligns2);

    $rep-&gt;NewPage();
    $orderno = 0;

    $result = GetSalesOrders($from, $to, $category, $location, $backorder);

    while ($myrow=db_fetch($result))
    {
        $rep-&gt;NewLine(0, 2, false, $orderno);
        if ($orderno != $myrow[&#039;order_no&#039;])
        {
            if ($orderno != 0)
            {
                $rep-&gt;Line($rep-&gt;row);
                $rep-&gt;NewLine();
            }
            $rep-&gt;TextCol(0, 1,    $myrow[&#039;order_no&#039;]);
            $rep-&gt;TextCol(1, 2,    get_customer_name($myrow[&#039;debtor_no&#039;]));
            $rep-&gt;TextCol(2, 3,    get_branch_name($myrow[&#039;branch_code&#039;]));
            $rep-&gt;TextCol(3, 4,    $myrow[&#039;customer_ref&#039;]);
            $rep-&gt;DateCol(4, 5,    $myrow[&#039;ord_date&#039;], true);
            $rep-&gt;DateCol(5, 6,    $myrow[&#039;delivery_date&#039;], true);
            $rep-&gt;TextCol(6, 7,    $myrow[&#039;total&#039;]);
            $rep-&gt;NewLine(2);
            $orderno = $myrow[&#039;order_no&#039;];
        }
        $rep-&gt;TextCol(0, 1,    $myrow[&#039;stk_code&#039;]);
        $rep-&gt;TextCol(1, 2,    $myrow[&#039;description&#039;]);
        $dec = get_qty_dec($myrow[&#039;stk_code&#039;]);
        $rep-&gt;AmountCol(2, 3, $myrow[&#039;quantity&#039;], $dec);
        $rep-&gt;AmountCol(3, 4, $myrow[&#039;qty_sent&#039;], $dec);
        $rep-&gt;AmountCol(4, 5, $myrow[&#039;quantity&#039;] - $myrow[&#039;qty_sent&#039;], $dec);
        if ($myrow[&#039;quantity&#039;] - $myrow[&#039;qty_sent&#039;] &gt; 0)
        {
            $rep-&gt;Font(&#039;italic&#039;);
            $rep-&gt;TextCol(5, 6,    _(&#039;Outstanding&#039;));
            $rep-&gt;Font();
        }
        $rep-&gt;NewLine();
    }
    $rep-&gt;Line($rep-&gt;row);
    $rep-&gt;End();
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alaa)]]></author>
			<pubDate>Sat, 27 Jan 2018 18:01:55 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30635#p30635</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders Overview]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30633#p30633</link>
			<description><![CDATA[<p>@apmuthu</p><p>Thats the same as printing Sales Orders.<br />i think report 105 is just perfect if we can add the total amount for each sales order next to the location.</p><p>Regards.</p>]]></description>
			<author><![CDATA[null@example.com (Alaa)]]></author>
			<pubDate>Sat, 27 Jan 2018 14:30:25 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30633#p30633</guid>
		</item>
		<item>
			<title><![CDATA[Re: Sales Orders Overview]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30630#p30630</link>
			<description><![CDATA[<p>Packing Slip is the way out.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 27 Jan 2018 13:15:35 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30630#p30630</guid>
		</item>
		<item>
			<title><![CDATA[Sales Orders Overview]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30627#p30627</link>
			<description><![CDATA[<p>Hello, </p><p>Is there anyway to check the items in all sales order for today and the amount or the total value of all sales orders for a certain period, like today.</p><p>Right now we have to download all today&#039;s sales order and to calculate them one by one. There is also no way to know what items that has been requested in the sales order.</p><p>I don&#039;t know if there is a better way that I am unaware of.</p><p>Kind Regards.</p>]]></description>
			<author><![CDATA[null@example.com (Alaa)]]></author>
			<pubDate>Fri, 26 Jan 2018 20:04:46 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30627#p30627</guid>
		</item>
	</channel>
</rss>
