<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Is it possible to View Payments by branch?]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=9676</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=9676&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Is it possible to View Payments by branch?.]]></description>
		<lastBuildDate>Mon, 31 Jan 2022 01:20:49 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Is it possible to View Payments by branch?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=40594#p40594</link>
			<description><![CDATA[<p>Thanks for considering taking a look at this.<br />a though would be a branch select list with the first option for all branches then the other branches.</p><p>I can get it to output by branch by add this if statement to the loop</p><p>if ($_POST[&#039;BranchID&#039;] == $myrow[&#039;branch_code&#039;]){<br />Blah blah do the table stuff here<br />}</p><p>but what is strange is the BranchID select box doesnt update any $_POST data?</p><p>only customer select and bank select appear to be working properly. To update $_POST[&#039;BranchID&#039;] you have to select the branch then adjust the bank account to update it.</p><p> If you change the customer it will select the default first BranchID again so that works ok.</p>]]></description>
			<author><![CDATA[null@example.com (trafficpest)]]></author>
			<pubDate>Mon, 31 Jan 2022 01:20:49 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=40594#p40594</guid>
		</item>
		<item>
			<title><![CDATA[Re: Is it possible to View Payments by branch?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=40593#p40593</link>
			<description><![CDATA[<p>@joe branch was coded in customer payment.&nbsp; But doesnt used it properly. Can we update the allocation&nbsp; code to pass branch_id and use it effectively in the system.</p>]]></description>
			<author><![CDATA[null@example.com (kvvaradha)]]></author>
			<pubDate>Mon, 31 Jan 2022 00:46:36 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=40593#p40593</guid>
		</item>
		<item>
			<title><![CDATA[Re: Is it possible to View Payments by branch?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=40592#p40592</link>
			<description><![CDATA[<p>I have it outputting the Branch name in the table now. fairly easy</p><p>in<br />/includes/ui/allocation_cart.inc<br />in the function show_allocatable($show_totals)</p><p>add&nbsp; Branch table header in the table loop pull the customer transaction data and add br name to the cell. This is how my function looks.</p><div class="codebox"><pre><code>function show_allocatable($show_totals) {

    global $systypes_array;
    
    $k = $total_allocated = 0;

    $cart = $_SESSION[&#039;alloc&#039;];
    $supp_ref = in_array($cart-&gt;type, array(ST_SUPPCREDIT, ST_SUPPAYMENT, ST_BANKPAYMENT));

    if (count($cart-&gt;allocs)) 
    {
        display_heading(sprintf(_(&quot;Allocated amounts in %s:&quot;), $cart-&gt;person_curr));
        start_table(TABLESTYLE, &quot;width=&#039;60%&#039;&quot;);
           $th = array(_(&quot;Transaction Type&quot;), _(&quot;#&quot;), _(&quot;Branch&quot;), $supp_ref ? _(&quot;Supplier Ref&quot;): _(&quot;Ref&quot;), _(&quot;Date&quot;), _(&quot;Due Date&quot;), _(&quot;Amount&quot;),
               _(&quot;Other Allocations&quot;), _(&quot;Left to Allocate&quot;), _(&quot;This Allocation&quot;),&#039;&#039;,&#039;&#039;); // added branch heading

           table_header($th);

        foreach ($cart-&gt;allocs as $id =&gt; $alloc_item)
        {
            if (floatcmp(abs($alloc_item-&gt;amount), $alloc_item-&gt;amount_allocated))
            {
                $myrow = get_customer_trans($alloc_item-&gt;type_no, ST_SALESINVOICE);// new to get trans data
                alt_table_row_color($k);
                label_cell($systypes_array[$alloc_item-&gt;type]);
                   label_cell(get_trans_view_str($alloc_item-&gt;type, $alloc_item-&gt;type_no), &quot;nowrap align=&#039;right&#039;&quot;);
                   label_cell($myrow[&#039;br_name&#039;], &quot;nowrap align=&#039;right&#039;&quot;); // to output branch
                   label_cell($alloc_item-&gt;ref);
                label_cell($alloc_item-&gt;date_, &quot;align=right&quot;);
                label_cell($alloc_item-&gt;due_date, &quot;align=right&quot;);
                amount_cell(abs($alloc_item-&gt;amount));
                amount_cell($alloc_item-&gt;amount_allocated);

                $_POST[&#039;amount&#039; . $id] = price_format($alloc_item-&gt;current_allocated);

                $un_allocated = round((abs($alloc_item-&gt;amount) - $alloc_item-&gt;amount_allocated), 6);
                amount_cell($un_allocated, false,&#039;&#039;, &#039;maxval&#039;.$id);
                amount_cells(null, &quot;amount&quot; . $id);//, input_num(&#039;amount&#039; . $id));
                label_cell(&quot;&lt;a href=&#039;javascript:void(0)&#039; name=Alloc$id onclick=&#039;allocate_all(this.name.substr(5));return true;&#039;&gt;&quot;
                     . _(&quot;All&quot;) . &quot;&lt;/a&gt;&quot;);
                label_cell(&quot;&lt;a href=&#039;javascript:void(0)&#039; name=DeAll$id onclick=&#039;allocate_none(this.name.substr(5));return true;&#039;&gt;&quot;
                     . _(&quot;None&quot;) . &quot;&lt;/a&gt;&quot;.hidden(&quot;un_allocated&quot; . $id, 
                     price_format($un_allocated), false));
                end_row();

                   $total_allocated += input_num(&#039;amount&#039; . $id);
               }
        }
        if ($show_totals) {
               label_row(_(&quot;Total Allocated&quot;), price_format($total_allocated),
                &quot;colspan=8 align=right&quot;, &quot;align=right id=&#039;total_allocated&#039;&quot;, 3);

            $amount = abs($cart-&gt;amount);

            if (floatcmp($amount, $total_allocated) &lt; 0)
            {
                $font1 = &quot;&lt;font color=red&gt;&quot;;
                $font2 = &quot;&lt;/font&gt;&quot;;
            }
            else
                $font1 = $font2 = &quot;&quot;;
            $left_to_allocate = price_format($amount - $total_allocated);
            label_row(_(&quot;Left to Allocate&quot;), $font1 . $left_to_allocate . $font2, 
                &quot;colspan=8 align=right&quot;, &quot;nowrap align=right id=&#039;left_to_allocate&#039;&quot;,
                 3);
        }
        end_table(1);
    }
    hidden(&#039;TotalNumberOfAllocs&#039;, count($cart-&gt;allocs));
}</code></pre></div><p>I will try to add logic to check the branch in the loop. if anyone good at this stuff can help lol<br />Thank you</p>]]></description>
			<author><![CDATA[null@example.com (trafficpest)]]></author>
			<pubDate>Sun, 30 Jan 2022 23:19:04 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=40592#p40592</guid>
		</item>
		<item>
			<title><![CDATA[Is it possible to View Payments by branch?]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=40591#p40591</link>
			<description><![CDATA[<p>Is it possible on the customer payments page show only the invoices by branch or at least have it show in the allocation table what branch the invoice belongs too. We have customers with over 800 branches and it is really difficult to find the correct invoice.</p><p>on this page<br />/sales/customer_payments.php</p><p>function in question<br />show_allocatable();<br />calls <br />class allocation<br />set_person()<br />read()</p>]]></description>
			<author><![CDATA[null@example.com (trafficpest)]]></author>
			<pubDate>Sun, 30 Jan 2022 20:00:36 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=40591#p40591</guid>
		</item>
	</channel>
</rss>
