<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Grab Data of individual Accounts From Database]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=7833</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7833&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Grab Data of individual Accounts From Database.]]></description>
		<lastBuildDate>Wed, 28 Nov 2018 03:22:30 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Grab Data of individual Accounts From Database]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33421#p33421</link>
			<description><![CDATA[<p>The issue here is that the alias of the table in addressing the field may be required in some MySQL versions. Therefore the field &quot;account&quot; referred to in the existing sql was sought by you to be replaced by &quot;trans.account&quot; which is okay. The NULL check is still retained.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Wed, 28 Nov 2018 03:22:30 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33421#p33421</guid>
		</item>
		<item>
			<title><![CDATA[Re: Grab Data of individual Accounts From Database]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33414#p33414</link>
			<description><![CDATA[<p>@apmuthu, its a mandatory parameter to get_balance function.&nbsp; so he has to add it without checking whether the account code null or not.</p>]]></description>
			<author><![CDATA[null@example.com (kvvaradha)]]></author>
			<pubDate>Tue, 27 Nov 2018 05:54:40 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33414#p33414</guid>
		</item>
		<item>
			<title><![CDATA[Re: Grab Data of individual Accounts From Database]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33409#p33409</link>
			<description><![CDATA[<p>Since the <strong>gl_trans</strong> is declared with an alias <strong>trans</strong> it might be necessary for some MySQL versions to use it as in:<br /></p><div class="codebox"><pre><code>        .($account == null ? &#039;&#039; : &quot; AND trans.account=&quot;.db_escape($account))</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Mon, 26 Nov 2018 16:01:26 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33409#p33409</guid>
		</item>
		<item>
			<title><![CDATA[Re: Grab Data of individual Accounts From Database]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33402#p33402</link>
			<description><![CDATA[<p>@kvvaradha, can you please contact me personally, mailto: emiangel839@gmail.com</p>]]></description>
			<author><![CDATA[null@example.com (emiangel839)]]></author>
			<pubDate>Mon, 26 Nov 2018 07:44:49 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33402#p33402</guid>
		</item>
		<item>
			<title><![CDATA[Re: Grab Data of individual Accounts From Database]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33401#p33401</link>
			<description><![CDATA[<p>@emiangel -&nbsp; You can do it simply by adding this one.</p><div class="codebox"><pre><code>    WHERE trans.account=coa.account_code  </code></pre></div><p>Here add it like this </p><div class="codebox"><pre><code>    WHERE trans.account=coa.account_code AND trans.account=&quot;.db_escape($account).&quot; </code></pre></div><p>Hope it connects the account code and gets what you needed</p>]]></description>
			<author><![CDATA[null@example.com (kvvaradha)]]></author>
			<pubDate>Mon, 26 Nov 2018 06:12:04 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33401#p33401</guid>
		</item>
		<item>
			<title><![CDATA[Re: Grab Data of individual Accounts From Database]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33399#p33399</link>
			<description><![CDATA[<p>hey, i have already seen this but the problem is i am unable to connect my $account with account name or account code</p><p>see your function</p><div class="codebox"><pre><code>function get_balance($account, $dimension, $dimension2, $from, $to, $from_incl=true, $to_incl=true) 
{
    $from_date = date2sql($from);
    $to_date = date2sql($to);
    $sql = &quot;SELECT    SUM(IF(amount &gt;= 0, amount, 0)) as debit, 
                    SUM(IF(amount &lt; 0, -amount, 0)) as credit,
                    SUM(amount) as balance 
        FROM &quot;.TB_PREF.&quot;gl_trans trans,&quot;
            .TB_PREF.&quot;chart_master coa,&quot;
            .TB_PREF.&quot;chart_types act_type, &quot;
            .TB_PREF.&quot;chart_class act_class
        WHERE trans.account=coa.account_code
            AND coa.account_type=act_type.id 
        AND act_type.class_id=act_class.cid&quot;
        .&quot; AND &quot;.($from_incl ? &quot;tran_date &gt;= &#039;$from_date&#039;&quot; : &quot;tran_date &gt; IF(ctype&gt;0 AND ctype&lt;&quot;.CL_INCOME.&quot;, &#039;0000-00-00&#039;, &#039;$from_date&#039;)&quot;)
        .&quot; AND &quot;.($to_incl ? &quot;tran_date &lt;= &#039;$to_date&#039;&quot; : &quot;tran_date &lt; &#039;$to_date&#039;&quot;)
        .($account == null ? &#039;&#039; : &quot; AND account=&quot;.db_escape($account))
        .($dimension == 0 ? &#039;&#039;  : &quot; AND dimension_id = &quot;.($dimension&lt;0 ? 0 : db_escape($dimension)))
        .($dimension2 == 0 ? &#039;&#039; : &quot; AND dimension2_id = &quot;.($dimension2&lt;0 ? 0 : db_escape($dimension2)));
    $result = db_query($sql,&quot;No general ledger accounts were returned&quot;);
    return db_fetch($result);
}</code></pre></div><p>in above $account not linked from my side</p>]]></description>
			<author><![CDATA[null@example.com (emiangel839)]]></author>
			<pubDate>Mon, 26 Nov 2018 05:36:04 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33399#p33399</guid>
		</item>
		<item>
			<title><![CDATA[Re: Grab Data of individual Accounts From Database]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33398#p33398</link>
			<description><![CDATA[<p>Note that array element inline addressing is available in later versions of PHP only.</p><p>The <strong>function get_balance()</strong> is defined from <a href="https://github.com/FrontAccountingERP/FA/blob/master/gl/includes/db/gl_db_trans.inc">Line 316</a> of <strong>gl/includes/db/gl_db_trans.inc</strong> and it;s prototype is:<br /></p><div class="codebox"><pre><code>function get_balance($account, $dimension, $dimension2, $from, $to, $from_incl=true, $to_incl=true) </code></pre></div><p>The computed data fields available are: credit, debit and balance.</p><p>Note that this file has had a <a href="https://github.com/FrontAccountingERP/FA/commit/3d01a4b1319dd62d6b7672ebfc3d73f594343b6a">commit</a> recently and you may need to update it accordingly.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 25 Nov 2018 23:39:04 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33398#p33398</guid>
		</item>
		<item>
			<title><![CDATA[Re: Grab Data of individual Accounts From Database]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33393#p33393</link>
			<description><![CDATA[<p>here is for same Professional Expenses</p><p>$PE = get_balance(1245, 0, 0, begin_fiscalyear(), Today(), true, true)[&#039;balance&#039;];</p><p>here PR = Professional Expenses and Account code is 1245</p>]]></description>
			<author><![CDATA[null@example.com (emiangel839)]]></author>
			<pubDate>Sun, 25 Nov 2018 09:22:34 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33393#p33393</guid>
		</item>
		<item>
			<title><![CDATA[Re: Grab Data of individual Accounts From Database]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33392#p33392</link>
			<description><![CDATA[<p>Can you please guide me because i am unable to fetch this... hope so you can</p>]]></description>
			<author><![CDATA[null@example.com (emiangel839)]]></author>
			<pubDate>Sun, 25 Nov 2018 09:10:27 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33392#p33392</guid>
		</item>
		<item>
			<title><![CDATA[Re: Grab Data of individual Accounts From Database]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33389#p33389</link>
			<description><![CDATA[<p>Choose your Account Receivable using some other function/query and then use the get_balance() function with that value instead of 1065.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 25 Nov 2018 02:58:21 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33389#p33389</guid>
		</item>
		<item>
			<title><![CDATA[Re: Grab Data of individual Accounts From Database]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33375#p33375</link>
			<description><![CDATA[<p>hey,</p><p>i am using this : $AR = get_balance(1065, 0, 0, begin_fiscalyear(), Today(), true, true)[&#039;balance&#039;];</p><p>here AR is Account Receivable and ID code is 1065</p><p>can you please tell me how can i get data without using 1065 because every time 1065 not equal to account receivable</p><p>any help</p>]]></description>
			<author><![CDATA[null@example.com (emiangel839)]]></author>
			<pubDate>Fri, 23 Nov 2018 07:08:37 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33375#p33375</guid>
		</item>
		<item>
			<title><![CDATA[Re: Grab Data of individual Accounts From Database]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33371#p33371</link>
			<description><![CDATA[<p>Probably does not have the opening balances.....</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 23 Nov 2018 01:00:45 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33371#p33371</guid>
		</item>
		<item>
			<title><![CDATA[Re: Grab Data of individual Accounts From Database]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33369#p33369</link>
			<description><![CDATA[<div class="quotebox"><cite>kvvaradha wrote:</cite><blockquote><div class="codebox"><pre><code> SELECT SUM(amount), account_name FROM 0_gl_trans, 0_chart_master WHERE 0_gl_trans.account=0_chart_master.account_code GROUP BY account </code></pre></div><p>hope this query satisfy your needs.</p></blockquote></div><br /><p>not working....</p>]]></description>
			<author><![CDATA[null@example.com (emiangel839)]]></author>
			<pubDate>Thu, 22 Nov 2018 16:37:51 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33369#p33369</guid>
		</item>
		<item>
			<title><![CDATA[Re: Grab Data of individual Accounts From Database]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33365#p33365</link>
			<description><![CDATA[<div class="codebox"><pre><code> SELECT SUM(amount), account_name FROM 0_gl_trans, 0_chart_master WHERE 0_gl_trans.account=0_chart_master.account_code GROUP BY account </code></pre></div><p>hope this query satisfy your needs.</p>]]></description>
			<author><![CDATA[null@example.com (kvvaradha)]]></author>
			<pubDate>Thu, 22 Nov 2018 09:19:04 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33365#p33365</guid>
		</item>
		<item>
			<title><![CDATA[Re: Grab Data of individual Accounts From Database]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=33359#p33359</link>
			<description><![CDATA[<p>well bro, again i am trying to make a BLOCK that shows only AMOUNT/BALANCES of ACCOUNTS, <br />see example of image</p><p>https://imgur.com/a/xVpxAQr</p><p>the balances will be linked with Trial Balance show we can easily grab any amount/balance what we want in future</p><p>the main reason is when we grab balances or amounts from TB then afterwards we calculate the RATIO ANALYSIS</p><p>so firstly, i want to grab INDIVIDUAL BALANCE that shown in image TB,</p><p>see image</p><p>Regards</p>]]></description>
			<author><![CDATA[null@example.com (emiangel839)]]></author>
			<pubDate>Thu, 22 Nov 2018 06:25:44 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=33359#p33359</guid>
		</item>
	</channel>
</rss>
