<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Opening Balance entry for Customers and Suppliers]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8568&amp;type=atom" />
	<updated>2019-12-17T06:51:33Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=8568</id>
		<entry>
			<title type="html"><![CDATA[Re: Opening Balance entry for Customers and Suppliers]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36630#p36630" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[anoopmb]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18207</uri>
			</author>
			<updated>2019-12-17T06:51:33Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36630#p36630</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Opening Balance entry for Customers and Suppliers]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36628#p36628" />
			<content type="html"><![CDATA[<p>With patch files it will be easy to test.</p>]]></content>
			<author>
				<name><![CDATA[boxygen]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20175</uri>
			</author>
			<updated>2019-12-17T05:30:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36628#p36628</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Opening Balance entry for Customers and Suppliers]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36619#p36619" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[anoopmb]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18207</uri>
			</author>
			<updated>2019-12-16T15:10:06Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36619#p36619</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Opening Balance entry for Customers and Suppliers]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36616#p36616" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2019-12-16T03:08:51Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36616#p36616</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Opening Balance entry for Customers and Suppliers]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36615#p36615" />
			<content type="html"><![CDATA[<p>This solution can be applied when people shifting to FA</p>]]></content>
			<author>
				<name><![CDATA[anoopmb]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18207</uri>
			</author>
			<updated>2019-12-15T18:16:30Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36615#p36615</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Opening Balance entry for Customers and Suppliers]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36614#p36614" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2019-12-15T17:33:06Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36614#p36614</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Opening Balance entry for Customers and Suppliers]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36613#p36613" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[anoopmb]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18207</uri>
			</author>
			<updated>2019-12-15T11:17:00Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36613#p36613</id>
		</entry>
</feed>
