<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Opening Balance entry for Customers and Suppliers]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=8568</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8568&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Opening Balance entry for Customers and Suppliers.]]></description>
		<lastBuildDate>Tue, 17 Dec 2019 06:51:33 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Opening Balance entry for Customers and Suppliers]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=36630#p36630</link>
			<description><![CDATA[<p>Hi,</p><p>you can download patch file from <a href="https://drive.google.com/file/d/141rZZcXzrCCYl39MU4sFH2miKAgjkl1B/view?usp=sharing">HERE</a></p>]]></description>
			<author><![CDATA[null@example.com (anoopmb)]]></author>
			<pubDate>Tue, 17 Dec 2019 06:51:33 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=36630#p36630</guid>
		</item>
		<item>
			<title><![CDATA[Re: Opening Balance entry for Customers and Suppliers]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=36628#p36628</link>
			<description><![CDATA[<p>With patch files it will be easy to test.</p>]]></description>
			<author><![CDATA[null@example.com (boxygen)]]></author>
			<pubDate>Tue, 17 Dec 2019 05:30:42 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=36628#p36628</guid>
		</item>
		<item>
			<title><![CDATA[Re: Opening Balance entry for Customers and Suppliers]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=36619#p36619</link>
			<description><![CDATA[<p>ok right, if anybody shifting to FA but dont want to import old transactions&nbsp; but want to start as new in FA , i think they can use this solution for their old customers and suppliers</p>]]></description>
			<author><![CDATA[null@example.com (anoopmb)]]></author>
			<pubDate>Mon, 16 Dec 2019 15:10:06 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=36619#p36619</guid>
		</item>
		<item>
			<title><![CDATA[Re: Opening Balance entry for Customers and Suppliers]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=36616#p36616</link>
			<description><![CDATA[<p>In such a case, migrating the entire trial balance is done in two steps involving a temporary Suspense Account as the contra Account.<br />1. Move all (non allocatable) Non Supplier / Non Customer Balance Sheet / TB entries into FA using Journal Entry<br />2. Use Credit Note / Debit Note to bring forward allocatable payments for the Customer / Supplier balances</p><p>@joe: any better practice?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Mon, 16 Dec 2019 03:08:51 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=36616#p36616</guid>
		</item>
		<item>
			<title><![CDATA[Re: Opening Balance entry for Customers and Suppliers]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=36615#p36615</link>
			<description><![CDATA[<p>This solution can be applied when people shifting to FA</p>]]></description>
			<author><![CDATA[null@example.com (anoopmb)]]></author>
			<pubDate>Sun, 15 Dec 2019 18:16:30 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=36615#p36615</guid>
		</item>
		<item>
			<title><![CDATA[Re: Opening Balance entry for Customers and Suppliers]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=36614#p36614</link>
			<description><![CDATA[<p>Does the opening balance not come calculated by default in FA? Is it not generally done using a Journal Entry at the start of FA?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 15 Dec 2019 17:33:06 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=36614#p36614</guid>
		</item>
		<item>
			<title><![CDATA[Opening Balance entry for Customers and Suppliers]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=36613#p36613</link>
			<description><![CDATA[<p>I have done like this and would like to know will it be a proper solution?</p><p>This solution will accept negative values too , which will be a bank deposit by customer or payment to supplier</p><p>1. include item cart class in customer and suppliers</p><p>&nbsp; &nbsp; </p><div class="codebox"><pre><code>      include_once($path_to_root . &quot;/includes/ui/items_cart.inc&quot;);
    </code></pre></div><p>2. added two input fields to customers and suppliers master (amount and date)<br />&nbsp; &nbsp;a. Customer </p><div class="codebox"><pre><code>table_section(2);
    if (!$selected_id) {
        table_section_title(_(&quot;Opening Balance&quot;));
        amount_row(_(&quot;Amount:&quot;), &#039;opening_bal&#039;);
        if (!isset($_POST[&#039;ob_date&#039;]))
            $_POST[&#039;ob_date&#039;] = add_days(begin_fiscalyear(), -1);
        date_row(_(&quot;As of:&quot;), &#039;ob_date&#039;);
    } else {
        hidden(&#039;opening_bal&#039;, 0);
        hidden(&#039;ob_date&#039;, Today());
    }</code></pre></div><p>b. Supplier</p><div class="codebox"><pre><code>   if (!$supplier_id) {
        table_section_title(_(&quot;Opening Balance&quot;));
        amount_row(_(&quot;Amount:&quot;), &#039;opening_bal&#039;);
        if (!isset($_POST[&#039;ob_date&#039;]))
            $_POST[&#039;ob_date&#039;] = add_days(begin_fiscalyear(), -1);
        date_row(_(&quot;As of:&quot;), &#039;ob_date&#039;);
    } else {
        hidden(&#039;opening_bal&#039;, 0);
        hidden(&#039;ob_date&#039;, Today());
    }</code></pre></div><p>It will appear only in new customer or supplier mode</p><p>3. Validation of Opening balance entry date in can_process() method</p><p>&nbsp; &nbsp;for both Customer and supplier<br />&nbsp; &nbsp; </p><div class="codebox"><pre><code>    if (input_num(&#039;opening_bal&#039;) != 0 &amp;&amp; !is_date(get_post(&#039;ob_date&#039;))) {
        display_error(_(&quot;Invalid opening balance entry date.&quot;));
        set_focus(&#039;ob_date&#039;);
        return false;
    }
    </code></pre></div><p>4.&nbsp; Journal entry in handle_submit method<br />&nbsp; &nbsp; a. customer <br />&nbsp; &nbsp; &nbsp;</p><div class="codebox"><pre><code>       if (input_num(&#039;opening_bal&#039;) != 0) {
            $cart = new items_cart(ST_JOURNAL);
            $cart-&gt;order_id = 0;
            $cart-&gt;tran_date = $cart-&gt;doc_date = $cart-&gt;event_date = get_post(&#039;ob_date&#039;);
            $cart-&gt;reference = $Refs-&gt;get_next(ST_JOURNAL, null, $cart-&gt;tran_date);
            $cart-&gt;tax_info = false;
            $cart-&gt;memo_ = _(&quot;Opening Balance Entry&quot;);
            $cart-&gt;currency = $_POST[&#039;curr_code&#039;];
            if ($cart-&gt;currency != get_company_pref(&#039;curr_default&#039;))
                $cart-&gt;rate = get_exchange_rate_to_home_currency($cart-&gt;currency,get_post(&#039;ob_date&#039;));
            $cart-&gt;clear_items();
            if (input_num(&#039;opening_bal&#039;) &gt; 0) {
                $cart-&gt;add_gl_item(get_company_pref(&#039;debtors_act&#039;), 0,
                    0, input_num(&#039;opening_bal&#039;), _(&quot;Opening Balance Entry&quot;), &#039;&#039;, $selected_id);
                $cart-&gt;add_gl_item(get_company_pref(&#039;default_inv_sales_act&#039;), 0,
                    0, input_num(&#039;opening_bal&#039;) * -1, _(&quot;Opening Balance Entry&quot;), &#039;&#039;, $selected_id);
            } else {
                $cart-&gt;add_gl_item(get_company_pref(&#039;debtors_act&#039;), 0,
                    0, input_num(&#039;opening_bal&#039;), _(&quot;Opening Balance Entry&quot;), &#039;&#039;, $selected_id);
                $bank_account= get_bank_account(get_default_customer_bank_account($selected_id));
                $cart-&gt;add_gl_item($bank_account[&#039;account_code&#039;], 0,
                    0, input_num(&#039;opening_bal&#039;)*-1 , _(&quot;Opening Balance Entry&quot;), &#039;&#039;, $selected_id);
            }
            $trans_no = write_journal_entries($cart);

        }
     </code></pre></div><p>&nbsp; &nbsp; b. Supplier<br />&nbsp; &nbsp; &nbsp; </p><div class="codebox"><pre><code>if (input_num(&#039;opening_bal&#039;) != 0) {
            $cart = new items_cart(ST_JOURNAL);
            $cart-&gt;order_id = 0;
            $cart-&gt;tran_date = $cart-&gt;doc_date = $cart-&gt;event_date = get_post(&#039;ob_date&#039;);
            $cart-&gt;reference = $Refs-&gt;get_next(ST_JOURNAL, null, $cart-&gt;tran_date);
            $cart-&gt;tax_info = false;
            $cart-&gt;memo_ = _(&quot;Opening Balance Entry&quot;);
            $cart-&gt;currency = $_POST[&#039;curr_code&#039;];
            if ($cart-&gt;currency != get_company_pref(&#039;curr_default&#039;))
                $cart-&gt;rate = get_exchange_rate_to_home_currency($cart-&gt;currency,get_post(&#039;ob_date&#039;));
            $cart-&gt;clear_items();
            if (input_num(&#039;opening_bal&#039;) &gt; 0) {
                $cart-&gt;add_gl_item($_POST[&#039;payable_account&#039;], 0,
                    0, input_num(&#039;opening_bal&#039;)* -1, _(&quot;Opening Balance Entry&quot;), &#039;&#039;, $supplier_id);
                $cart-&gt;add_gl_item($_POST[&#039;purchase_account&#039;]!=&#039;&#039;?$_POST[&#039;purchase_account&#039;]:get_company_pref(&#039;grn_clearing_act&#039;), 0,
                    0, input_num(&#039;opening_bal&#039;) , _(&quot;Opening Balance Entry&quot;), &#039;&#039;, $supplier_id);
            } else {
                $cart-&gt;add_gl_item($_POST[&#039;payable_account&#039;], 0,
                    0, input_num(&#039;opening_bal&#039;)* -1, _(&quot;Opening Balance Entry&quot;), &#039;&#039;, $supplier_id);
                $bank_account= get_bank_account(get_default_supplier_bank_account($supplier_id));
                $cart-&gt;add_gl_item($bank_account[&#039;account_code&#039;], 0,
                    0, input_num(&#039;opening_bal&#039;) , _(&quot;Opening Balance Entry&quot;), &#039;&#039;, $supplier_id);
            }
            $trans_no = write_journal_entries($cart);

        }
      </code></pre></div><br /><p>NB: patch file is available on request</p>]]></description>
			<author><![CDATA[null@example.com (anoopmb)]]></author>
			<pubDate>Sun, 15 Dec 2019 11:17:00 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=36613#p36613</guid>
		</item>
	</channel>
</rss>
