<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Supplier payment fails]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=4639&amp;type=atom" />
	<updated>2014-01-04T19:48:40Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=4639</id>
		<entry>
			<title type="html"><![CDATA[Re: Supplier payment fails]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=18935#p18935" />
			<content type="html"><![CDATA[<p>Joe/Janusz, now the rest of the changes in my commits can be incorporated into the FA hg repo now that confirmation is available.</p><p>https://github.com/apmuthu/frontaccounting/commit/854c8067faa29399b655ac317d0d1ace48c3c622<br />https://github.com/apmuthu/frontaccounting/commit/1a2834b600e83e50372667d365cc737835d1b990<br />https://github.com/apmuthu/frontaccounting/commit/5d3a64a1880df01af314ff8d33de01ecfad44250</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2014-01-04T19:48:40Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=18935#p18935</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Supplier payment fails]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=18933#p18933" />
			<content type="html"><![CDATA[<p>Hi Apmuthu,</p><p>I downloaded and copied the complete core into my test directory.</p><p>The 2 issues in the first post are solved.<br />The one issue in the second post as well.</p><p>I can also confirm that the file contents of gl_db_bank_trans.inc is as listed in your post.</p><p>Thanks a lot!</p><p>jlinkels</p>]]></content>
			<author>
				<name><![CDATA[jlinkels]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18827</uri>
			</author>
			<updated>2014-01-04T17:36:40Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=18933#p18933</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Supplier payment fails]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=18921#p18921" />
			<content type="html"><![CDATA[<p>In the purchasing/includes/db folder, the two files:<br />&nbsp; &nbsp; grn_db.inc<br />and<br />&nbsp; &nbsp; suppalloc_db.inc<br />have changed.</p><p>Also some small changes in sql cleanup have not been (fully) included in the official hg repo as yet like https://frontaccounting.com/punbb/viewtopic.php?pid=18517#p18517</p><p>You can try the FA core from <a href="https://github.com/apmuthu/frontaccounting">my unofficial github repo</a> and let me know if it gets clarified.</p><p>Verify that the function get_bank_trans() at lines 66 to 91 in gl/includes/db/gl_db_bank_trans.inc is like:<br /></p><div class="codebox"><pre><code>function get_bank_trans($type, $trans_no=null, $person_type_id=null, $person_id=null)
{
    $sql = &quot;SELECT bt.*, act.*,
        IFNULL(abs(dt.ov_amount), IFNULL(ABS(st.ov_amount), bt.amount)) AS settled_amount,
        IFNULL(abs(dt.ov_amount/bt.amount), IFNULL(ABS(st.ov_amount/bt.amount), 1)) AS settle_rate,
        IFNULL(debtor.curr_code, IFNULL(supplier.curr_code, act.bank_curr_code)) AS settle_curr

        FROM &quot;.TB_PREF.&quot;bank_trans bt
                LEFT JOIN &quot;.TB_PREF.&quot;debtor_trans dt ON dt.type=bt.type AND dt.trans_no=bt.trans_no
                LEFT JOIN &quot;.TB_PREF.&quot;debtors_master debtor ON debtor.debtor_no = dt.debtor_no
                LEFT JOIN &quot;.TB_PREF.&quot;supp_trans st ON st.type=bt.type AND st.trans_no=bt.trans_no
                LEFT JOIN &quot;.TB_PREF.&quot;suppliers supplier ON supplier.supplier_id = st.supplier_id
                LEFT JOIN &quot;.TB_PREF.&quot;bank_accounts act ON act.id = bt.bank_act
        WHERE  1 &quot;;
    if ($type != null)
        $sql .= &quot; AND bt.type=&quot;.db_escape($type);
    if ($trans_no != null)
        $sql .= &quot; AND bt.trans_no = &quot;.db_escape($trans_no);
    if ($person_type_id != null)
        $sql .= &quot; AND bt.person_type_id = &quot;.db_escape($person_type_id);
    if ($person_id != null)
        $sql .= &quot; AND bt.person_id = &quot;.db_escape($person_id);
    $sql .= &quot; ORDER BY bt.trans_date, bt.id&quot;;

    return db_query($sql, &quot;query for bank transaction&quot;);
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2014-01-03T19:25:56Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=18921#p18921</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Supplier payment fails]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=18875#p18875" />
			<content type="html"><![CDATA[<p>Update:</p><p>When I went to Purchases -&gt; Payments for Suppliers and tried to make a payment for an invoice I just received, this failed. No error message, just nothing happened.</p><p>When I restored the directory /var/www/account/purchasing/includes/db to the state it had after installing the stable version the same action was successful. </p><p>If I complicated thing by updating only the directory /var/www/account/purchasing/includes/db to the repository clone, my apologies. On the other hand it might indicate a regression error.</p><p>The original problem as posted in the first post remains the same, regardless of the state of the /var/www/account/purchasing/includes/db directory. </p><p>jlinkels</p>]]></content>
			<author>
				<name><![CDATA[jlinkels]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18827</uri>
			</author>
			<updated>2013-12-30T21:02:57Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=18875#p18875</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Supplier payment fails]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=18873#p18873" />
			<content type="html"><![CDATA[<p>Version 2.3.19</p><p>I am not sure whether this is the same bugs as mentioned here: https://frontaccounting.com/punbb/viewtopic.php?id=4539. It looks different on details.</p><p>The problem is this: <br />Banking -&gt; General Ledger -&gt; Payments<br />Select Pay to: Supplier<br />Select a supplier<br />Enter an amount<br />Press &quot;Add item&quot;<br />Process Payment<br />This error message appears in a red banner:<br />&quot;The settled amount has to be greater than 0&quot;<br />(Translated from Dutch, apologies if not literally correct)<br /><a href="http://www.linkels.net/~jlinkels/links/eds3.jpg">http://www.linkels.net/~jlinkels/links/eds3.jpg</a></p><p>Now when I pay to a supplier which is configured for a different currency, an additional entry appears, showing the amount in the foreign currency. Then the transaction does go through.<br /><a href="http://www.linkels.net/~jlinkels/links/eds4.jpg">http://www.linkels.net/~jlinkels/links/eds4.jpg</a></p><p>However, when I then go to Purchases -&gt; Supplier Transactions and I try to retrieve the payment just made, I get a pop-up with this error message:<br /></p><div class="codebox"><pre><code>Databasefout : query for bank transaction
error code : 1305
error message : FUNCTION frontacc.IFNULL does not exist
sql that failed was : SELECT bt.*, act.*, IFNULL(abs(dt.ov_amount), 
IFNULL (abs(st.ov_amount), bt.amount)) settled_amount, IFNULL(abs(dt.ov_amount/bt.amount), 
IFNULL (abs(st.ov_amount/bt.amount), 1)) settle_rate, 
IFNULL(debtor.curr_code, IFNULL (supplier.curr_code, act.bank_curr_code)) settle_curr FROM
1_bank_trans bt LEFT JOIN 1_debtor_trans dt ON dt.type=bt.type AND
dt.trans_no=bt.trans_no LEFT JOIN 
1_debtors_master debtor ON debtor.debtor_no = dt.debtor_no 
LEFT JOIN 1_supp_trans st ON st.type=bt.type AND st.trans_no=bt.trans_no 
LEFT JOIN 1_suppliers supplier ON 
supplier.supplier_id = st.supplier_id, 1_bank_accounts act 
WHERE act.id=bt.bank_act AND bt.type=&#039;1&#039; AND bt.trans_no = &#039;7&#039; 
ORDER BY trans_date, bt.id</code></pre></div><p>However, in the second case (with the foreign currency) the bank account is credited, so I assume the transaction has been completed.</p><p>To be sure it did not have anything to do with the state of the supplier, I created two new suppliers. One in standard currency, one in foreign currency. Except for the currency I left everything default.</p><p>I tried it in the on-line training database (2.3.18), which was succesful.</p><p>I also downloaded the stable repository <strong>hg clone https://frontaccounting.hg.sourceforge.net:8000/hgroot/frontaccounting/default. </strong> Then I copied the directory /var/lib/vz/repos/mercurial/frontac/default/purchasing/includes/db to the production directory. No changes.</p><p>I was a bit reluctant to sync the complete cloned repository with the production directory, although that should be safe I assume. Right? Would it make a difference?</p><p>jlinkels</p>]]></content>
			<author>
				<name><![CDATA[jlinkels]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18827</uri>
			</author>
			<updated>2013-12-30T20:36:01Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=18873#p18873</id>
		</entry>
</feed>
