<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Add Bank Account Tab In Suppliers]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6210&amp;type=atom" />
	<updated>2016-04-12T11:18:10Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=6210</id>
		<entry>
			<title type="html"><![CDATA[Add Bank Account Tab In Suppliers]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25373#p25373" />
			<content type="html"><![CDATA[<p>Hallo, i&#039;m really new with this front accounting.<br />And i need to add new tab for bank account in suppliers list.</p><p>Cause every suppliers have more than 1 bank account.<br />So i duplicate tab contacs and modified it but it is not working.<br />It never show my bank account table list.</p><p>Here is my codes</p><p>function list_view() {<br />&nbsp; &nbsp; &nbsp; &nbsp; br();</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $banks = get_crm_banks($this-&gt;entity);<br />//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; check_value(&#039;show_inactive&#039;));<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; start_table(TABLESTYLE, &quot;width=&#039;80%&#039;&quot;);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $th = array(_(&#039;Description&#039;), _(&quot;Account Name&quot;), _(&quot;Account No&quot;), &#039;&#039;, &quot; &quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; inactive_control_column($th);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; table_header($th);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $k = 0; </p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $last = $myrow = db_fetch($banks);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ($last)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($myrow[&#039;id&#039;] != $last[&#039;id&#039;]) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alt_table_row_color($k);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label_cell($last[&quot;description&quot;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label_cell($last[&quot;account_name&quot;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label_cell($last[&quot;account_no&quot;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; inactive_control_cell($myrow[&quot;id&quot;], $myrow[&quot;inactive&quot;], &#039;crm_banks&#039;, &#039;id&#039;);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; edit_button_cell(&quot;{$this-&gt;name}Edit[{$last[&#039;id&#039;]}]&quot;, _(&quot;Edit&quot;));</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // delete button removes only category unless this is the last contact for this person<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delete_button_cell(&quot;{$this-&gt;name}Delete[{$last[&#039;id&#039;]}]&quot;, _(&quot;Delete&quot;));<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end_row();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $description = array();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $last = $myrow;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($myrow) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $description[] = $myrow[&#039;description&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $myrow = db_fetch($banks);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //inactive_control_row($th);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end_table(1);<br />&nbsp; &nbsp; }</p><p>function get_crm_banks($entity=null, $unique=false)<br />{<br />&nbsp; &nbsp; $sql = &quot;SELECT cb.*, b.*, b.bank_id as bank_id FROM &quot;.TB_PREF.&quot;crm_banks cb,&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .TB_PREF.&quot;bank b WHERE &quot;;<br />&nbsp; &nbsp; $sel = array(&#039;cb.bank_id = b.bank_id&#039;);</p><p>&nbsp; &nbsp; if ($entity) <br />&nbsp; &nbsp; &nbsp; &nbsp; $sel[] = &#039;cb.entity_id=&#039;.db_escape($entity);</p><p>&nbsp; &nbsp; $sql .= implode (&quot; AND &quot;, $sel);</p><p>&nbsp; &nbsp; $sql .= &quot; ORDER BY cb.id&quot;;</p><p>&nbsp; &nbsp; $result = db_query($sql, &quot;Can&#039;t get crm banks&quot;);<br />&nbsp; &nbsp; // fallback to general contacts<br />&nbsp; &nbsp; return $result;<br />}</p><p>When i read errors.log, it said &quot;simple_crud_class.inc:106: key() [&lt;a href=&#039;function.key&#039;&gt;function.key&lt;/a&gt;]: Passed variable is not an array or object &quot;</p><p>Anyone can help?</p><p>Sorry for my bad english.</p><p>Thx</p>]]></content>
			<author>
				<name><![CDATA[kuropone]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=21285</uri>
			</author>
			<updated>2016-04-12T11:18:10Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25373#p25373</id>
		</entry>
</feed>
