<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Braathwaate quickreport_inquiry]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=7924</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7924&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Braathwaate quickreport_inquiry.]]></description>
		<lastBuildDate>Wed, 09 Jan 2019 09:22:53 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Braathwaate quickreport_inquiry]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33921#p33921</link>
			<description><![CDATA[<p>Yes, they should. These have only a few parameters. The rest is default.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Wed, 09 Jan 2019 09:22:53 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33921#p33921</guid>
		</item>
		<item>
			<title><![CDATA[Re: Braathwaate quickreport_inquiry]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33918#p33918</link>
			<description><![CDATA[<p>Hope this addresses the new argument in the calls in:<br /></p><div class="codebox"><pre><code>gl/view/accrual_trans.php
reporting/rep702.php
reporting/rep704.php</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Wed, 09 Jan 2019 08:48:59 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33918#p33918</guid>
		</item>
		<item>
			<title><![CDATA[Re: Braathwaate quickreport_inquiry]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33910#p33910</link>
			<description><![CDATA[<p>This is fixed and committed to repo.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Tue, 08 Jan 2019 22:47:30 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33910#p33910</guid>
		</item>
		<item>
			<title><![CDATA[Re: Braathwaate quickreport_inquiry]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33908#p33908</link>
			<description><![CDATA[<p>The <a href="https://frontaccounting.com/punbb/viewtopic.php?pid=33876#p33876">4th post</a> in this thread lists the files that use the said function.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Tue, 08 Jan 2019 19:36:28 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33908#p33908</guid>
		</item>
		<item>
			<title><![CDATA[Re: Braathwaate quickreport_inquiry]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33905#p33905</link>
			<description><![CDATA[<p>Ok, I understand. I think I will just use your get_gl_transactions for now. To fix the timeout problem.</p><p>And put the extra null parameter in gl_account_inquiry.php.</p><p>We could then easily get more fix here later. Thanks for helping.</p><p>Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Tue, 08 Jan 2019 16:37:18 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33905#p33905</guid>
		</item>
		<item>
			<title><![CDATA[Re: Braathwaate quickreport_inquiry]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33904#p33904</link>
			<description><![CDATA[<p>My gl_account_inquiry.php differs from the core because it offers the person-type/person-id filters, just like the quickreport extension.&nbsp; So the call in my gl_account_inqury.php is:<br /></p><div class="codebox"><pre><code>    $result = get_gl_transactions($_POST[&#039;TransFromDate&#039;], $_POST[&#039;TransToDate&#039;], -1,
        $_POST[&quot;account&quot;], $_POST[&#039;Dimension&#039;], $_POST[&#039;Dimension2&#039;], null,
        input_num(&#039;amount_min&#039;), input_num(&#039;amount_max&#039;), get_post(&#039;person_type&#039;), get_post(&#039;person_id&#039;), $_POST[&#039;Memo&#039;]);</code></pre></div><p>Without the person-type/person-id filter code, those parameters can be null.</p><p>In quickreport.php and my gl inquiry, the person-type/person-id list is ajax enabled.&nbsp; &nbsp;One regret is that the code does not search on the Miscellaneous person type so perhaps there should be an additional &lt;no search&gt; entry in the list.</p><p>The original impetus to add the person-type/person-id filter was because there is no other way of searching for quick entry transactions in FA.</p>]]></description>
			<author><![CDATA[null@example.com (Braath Waate)]]></author>
			<pubDate>Tue, 08 Jan 2019 16:08:43 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33904#p33904</guid>
		</item>
		<item>
			<title><![CDATA[Re: Braathwaate quickreport_inquiry]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33903#p33903</link>
			<description><![CDATA[<p>@braathwaate</p><p>Or do you want 2 extra input filters on the gl inquiry, person-type and person combo. In that case we should probably use som ajax-update when selecting.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Tue, 08 Jan 2019 15:47:42 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33903#p33903</guid>
		</item>
		<item>
			<title><![CDATA[Re: Braathwaate quickreport_inquiry]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33902#p33902</link>
			<description><![CDATA[<p>@braathwaate</p><p>Any change to parameters in the file gl_account_inquiry.php that calls get_gl_transactions?</p><p>This is the only file that are different in the new parameter list.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Tue, 08 Jan 2019 15:41:35 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33902#p33902</guid>
		</item>
		<item>
			<title><![CDATA[Re: Braathwaate quickreport_inquiry]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33901#p33901</link>
			<description><![CDATA[<p>Note: this also has my suggested fix for mantis issue 0004817: g/l account inquiry can timeout due to slow sql.</p><div class="codebox"><pre><code>function get_gl_transactions($from_date, $to_date, $trans_no=0,
    $account=null, $dimension=0, $dimension2=0, $filter_type=null,
        $amount_min=null, $amount_max=null, $person_type=null, $person_id=null, $memo=&#039;&#039;)
{
    global $SysPrefs;

    $from = date2sql($from_date);
    $to = date2sql($to_date);

    $sql = &quot;SELECT gl.*, j.event_date, j.doc_date, a.gl_seq, u.user_id, st.supp_reference, gl.person_id subcode,
            IFNULL(IFNULL(sup.supp_name, debt.name), bt.person_id) as person_name, 
            IFNULL(gl.person_id, IFNULL(sup.supplier_id, IFNULL(debt.debtor_no, bt.person_id))) as person_id,
            IF(gl.person_id, gl.person_type_id, IF(sup.supplier_id,&quot;.  PT_SUPPLIER . &quot;,&quot; .  &quot;IF(debt.debtor_no,&quot; . PT_CUSTOMER . &quot;,&quot; . 
            &quot;IF(bt.person_id != &#039;&#039; AND !ISNULL(bt.person_id), bt.person_type_id, -1)))) as person_type_id,
            IFNULL(st.tran_date, IFNULL(dt.tran_date, IFNULL(bt.trans_date, IFNULL(grn.delivery_date, gl.tran_date)))) as doc_date,
            coa.account_name, ref.reference, IF(ISNULL(c.memo_), gl.memo_, CONCAT(gl.memo_,&#039; &#039;,c.memo_)) AS memo
             FROM &quot;
            .TB_PREF.&quot;gl_trans gl
            LEFT JOIN &quot;.TB_PREF.&quot;voided v ON gl.type_no=v.id AND v.type=gl.type

            LEFT JOIN &quot;.TB_PREF.&quot;supp_trans st ON gl.type_no=st.trans_no AND st.type=gl.type AND (gl.type!=&quot;.ST_JOURNAL.&quot; OR gl.person_id=st.supplier_id)
            LEFT JOIN &quot;.TB_PREF.&quot;grn_batch grn ON grn.id=gl.type_no AND gl.type=&quot;.ST_SUPPRECEIVE.&quot;
            LEFT JOIN &quot;.TB_PREF.&quot;debtor_trans dt ON gl.type_no=dt.trans_no AND dt.type=gl.type AND (gl.type!=&quot;.ST_JOURNAL.&quot; OR gl.person_id=dt.debtor_no)

            LEFT JOIN &quot;.TB_PREF.&quot;suppliers sup ON st.supplier_id=sup.supplier_id
            LEFT JOIN &quot;.TB_PREF.&quot;cust_branch branch ON dt.branch_code=branch.branch_code
            LEFT JOIN &quot;.TB_PREF.&quot;debtors_master debt ON dt.debtor_no=debt.debtor_no

            LEFT JOIN &quot;.TB_PREF.&quot;bank_trans bt ON bt.type=gl.type AND bt.trans_no=gl.type_no AND bt.amount!=0
                 AND (bt.person_id != &#039;&#039; AND !ISNULL(bt.person_id))

            LEFT JOIN &quot;.TB_PREF.&quot;journal j ON j.type=gl.type AND j.trans_no=gl.type_no
            LEFT JOIN &quot;.TB_PREF.&quot;audit_trail a ON a.type=gl.type AND a.trans_no=gl.type_no AND NOT ISNULL(gl_seq)
            LEFT JOIN &quot;.TB_PREF.&quot;users u ON a.user=u.id
            LEFT JOIN &quot;.TB_PREF.&quot;comments c ON c.id=gl.type_no AND c.type=gl.type

            LEFT JOIN &quot;.TB_PREF.&quot;refs ref ON ref.type=gl.type AND ref.id=gl.type_no,&quot;
        .TB_PREF.&quot;chart_master coa
        WHERE coa.account_code=gl.account
        AND ISNULL(v.date_)
        AND gl.tran_date &gt;= &#039;$from&#039;
        AND gl.tran_date &lt;= &#039;$to&#039;
        AND gl.amount &lt;&gt; 0&quot;; 

    if ($trans_no &gt; 0)
        $sql .= &quot; AND gl.type_no LIKE &quot;.db_escape(&#039;%&#039;.$trans_no);;

    if ($account != null)
        $sql .= &quot; AND gl.account = &quot;.db_escape($account);

    if ($dimension != 0)
        $sql .= &quot; AND gl.dimension_id = &quot;.($dimension&lt;0 ? 0 : db_escape($dimension));

    if ($dimension2 != 0)
        $sql .= &quot; AND gl.dimension2_id = &quot;.($dimension2&lt;0 ? 0 : db_escape($dimension2));

    if ($filter_type != null)
        $sql .= &quot; AND gl.type IN (&quot; . $filter_type .&quot;)&quot;;

    if ($amount_min != null)
        $sql .= &quot; AND ABS(gl.amount) &gt;= ABS(&quot;.db_escape($amount_min).&quot;)&quot;;
    
    if ($amount_max != null)
        $sql .= &quot; AND ABS(gl.amount) &lt;= ABS(&quot;.db_escape($amount_max).&quot;)&quot;;

    if ($memo)
        $sql .= &quot; AND (gl.memo_ LIKE &quot;. db_escape(&quot;%$memo%&quot;) . &quot; OR c.memo_ LIKE &quot; . db_escape(&quot;%$memo%&quot;) . &quot;)&quot;;

    $sql .= &quot; GROUP BY counter&quot;;

    $sql .= &quot; HAVING TRUE&quot;;
    if ($person_type != 0)
            $sql .= &quot; AND person_type_id=&quot;.db_escape($person_type); 
    if ($person_id != 0)
            $sql .= &quot; AND person_id=&quot;.db_escape($person_id); 

    $sql .= &quot; ORDER BY tran_date, counter&quot;;
//display_notification($sql);

    return db_query($sql, &quot;The transactions for could not be retrieved&quot;);
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Braath Waate)]]></author>
			<pubDate>Tue, 08 Jan 2019 13:22:22 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33901#p33901</guid>
		</item>
		<item>
			<title><![CDATA[Re: Braathwaate quickreport_inquiry]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33895#p33895</link>
			<description><![CDATA[<p>@apmuthu or @Braathwaate,</p><p>Where can I find the specific variant of get_transactions?</p><p>/joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Tue, 08 Jan 2019 08:56:14 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33895#p33895</guid>
		</item>
		<item>
			<title><![CDATA[Re: Braathwaate quickreport_inquiry]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33888#p33888</link>
			<description><![CDATA[<p>@apmuthu<br />Your optimized function has been committed to core.</p><p>Regarding @braathwaate&#039;s get_transactions function, I will have to check it carefully before syncing.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Mon, 07 Jan 2019 16:33:56 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33888#p33888</guid>
		</item>
		<item>
			<title><![CDATA[Re: Braathwaate quickreport_inquiry]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33876#p33876</link>
			<description><![CDATA[<p>@joe: It might be worthwhile to synch the <strong>function get_gl_transactions()</strong> with that of @braathwaate. The said function is defined in <strong>gl/includes/db/gl_db_trans.inc</strong> and is used in the core in:<br /></p><div class="codebox"><pre><code>gl/inquiry/gl_account_inquiry.php
gl/view/accrual_trans.php
reporting/rep702.php
reporting/rep704.php</code></pre></div><p>Furthermore, it is not used in any other extension as well. Besides, the <strong>effective_rate</strong> is not used anywhere at all (but used in the list of sql fields in <strong>function get_trans_tax_details</strong> in it!</p><p>In fact, the <strong>function get_trans_tax_details()</strong> from lines 478 to 493:<br /></p><div class="codebox"><pre><code>function get_trans_tax_details($trans_type, $trans_no)
{
    $sql = &quot;SELECT tax_details.*,
                tax_type.name AS tax_type_name,
                tax_details.rate AS effective_rate,
                tax_type.rate AS rate
        FROM &quot;.TB_PREF.&quot;trans_tax_details tax_details,
            &quot;.TB_PREF.&quot;tax_types tax_type
        WHERE 
            trans_type = &quot;.db_escape($trans_type).&quot;
        AND trans_no = &quot;.db_escape($trans_no).&quot;
        AND (net_amount != 0 OR amount != 0)
        AND tax_type.id = tax_details.tax_type_id&quot;;

    return db_query($sql, &quot;The transaction tax details could not be retrieved&quot;);
}</code></pre></div><p>can now be simplified to be:<br /></p><div class="codebox"><pre><code>function get_trans_tax_details($trans_type, $trans_no)
{
    $sql = &quot;SELECT tax_details.*, tax_type.name AS tax_type_name, tax_type.rate AS rate
        FROM &quot;.TB_PREF.&quot;trans_tax_details tax_details INNER JOIN 
        &quot;.TB_PREF.&quot;tax_types tax_type ON tax_type.id = tax_details.tax_type_id
        WHERE 
                trans_type = &quot;.db_escape($trans_type).&quot;
            AND trans_no = &quot;.db_escape($trans_no).&quot;
            AND (net_amount != 0 OR amount != 0)&quot;;

    return db_query($sql, &quot;The transaction tax details could not be retrieved&quot;);
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 06 Jan 2019 15:50:57 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33876#p33876</guid>
		</item>
		<item>
			<title><![CDATA[Re: Braathwaate quickreport_inquiry]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33874#p33874</link>
			<description><![CDATA[<p>@apmuthu: I fixed the reset problem you mentioned.&nbsp; Thanx.</p><p>I have a differing core and the get_gl_transactions() differs in several ways.&nbsp; One difference is the person_type argument that you mention.&nbsp; &nbsp;Another difference is that the filter_type parameter accepts a list of gl types instead of just one, which is necessary for the balances to be correct in this report by not displaying deliveries.&nbsp; &nbsp;A third difference is that the memo field searches by both gl memo and comment memo.</p><p>The purpose of this inquiry page is to condense the display of g/l account transactions by placing the two accounts of a double entered transaction into separate columns rather than on separate lines like the standard gl inquiry.&nbsp; &nbsp;If there are more than two accounts for a transaction, it displays &quot;split&quot;.</p><p>This is helpful in visually identifying transactions entered into wrong accounts because often transactions use the same accounts each time.&nbsp; &nbsp;For example, payments to a fuel supplier might usually use the accounts &quot;Auto Expenses&quot; and &quot;Credit Card&quot;.&nbsp; &nbsp;If one scans down the list of transactions for this supplier and then sees &quot;Office Expenses&quot; on one transaction, it probably was incorrectly entered and appropriate action can be taken (by clicking on the pencil to edit the transaction).</p>]]></description>
			<author><![CDATA[null@example.com (Braath Waate)]]></author>
			<pubDate>Sun, 06 Jan 2019 15:22:32 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33874#p33874</guid>
		</item>
		<item>
			<title><![CDATA[Re: Braathwaate quickreport_inquiry]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33870#p33870</link>
			<description><![CDATA[<p>@braathwate: Your report uses your custom functions in ui_controls.inc and ui_view.inc files that have been appended to your quickreport_inquiry.php file for testing:<br /></p><div class="codebox"><pre><code>function scroll_down($div)
{
    global $Ajax;

    $js = &quot;
        var objDiv = document.getElementById(&#039;&quot; . $div . &quot;&#039;);
        objDiv.scrollTop = objDiv.scrollHeight;
    &quot;;
    if (in_ajax()) {
        $Ajax-&gt;addScript(true, $js);
    } else
        add_js_source($js);
}

function get_js_history($vars)
{
    $js = &#039; 
    function changeVar() {
        var stateObj = { foo: &quot;bar&quot; };
        var state = &quot;&quot;;
&#039;;

    $first = true;
    foreach ( $vars as $var ) {
        $js .= &#039;
        var element = document.getElementsByName(&quot;&#039; . $var. &#039;&quot;);
        if (element[0])&#039;;
        if ($first) {
            $first = false;
            $js .= &#039;
            state += &quot;?&#039;;
        } else
            $js .= &#039;
            state += &quot;&amp;&#039;;
        $js .= $var .&#039;=&quot;&#039; . &#039; + element[0].value;&#039;;
    }

    $js .= &#039;
        history.replaceState(stateObj, &quot;page 2&quot;, location.protocol + &quot;//&quot; + location.host + location.pathname + state);
    }&#039;;
    return $js;
}

function set_posts($vars)
{
    foreach ( $vars as $var )
        if (isset($_GET[$var]))
            $_POST[$var] = $_GET[$var];
}</code></pre></div><p>@joe: see if you want to include them into the core.</p><p>The js history and remembering past form field values will result in a cache use and erroneous Ajax output like when a specific customer is chosen first and then a Supplier is chosen without resetting them selectively.</p><p>Also, your use of the <strong>function get_gl_transactions()</strong> in the said report has 12 arguments whereas the standard one in <strong>gl/includes/db/gl_db_trans.inc</strong> has only 11. The extra argument used is </p><div class="codebox"><pre><code>get_post(&#039;person_type&#039;)</code></pre></div><p>.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 06 Jan 2019 08:59:32 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33870#p33870</guid>
		</item>
		<item>
			<title><![CDATA[Braathwaate quickreport_inquiry]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33864#p33864</link>
			<description><![CDATA[<p>Missing file include at line 15 of <a href="https://github.com/braathwaate/FA24extensions/commit/1f61e8746411c1c74239e53a530f365031030f59"><strong>quickreport.php</strong></a>:<br /></p><div class="codebox"><pre><code>include_once($path_to_root . &quot;/includes/foo.inc&quot;);</code></pre></div><p>-- Fixed</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 05 Jan 2019 16:04:44 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33864#p33864</guid>
		</item>
	</channel>
</rss>
