<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Non Field Data from tables into Reports]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5420&amp;type=atom" />
	<updated>2014-12-28T18:46:52Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=5420</id>
		<entry>
			<title type="html"><![CDATA[Re: Non Field Data from tables into Reports]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21923#p21923" />
			<content type="html"><![CDATA[<p>Yes, I see that it is now <a href="http://https:/sourceforge.net/p/frontaccounting/mercurial/ci/5775c5de697a059c27e3e4786aeb7b8cedc4dfdf/tree/reporting/includes/reporting.inc?diff=5932dac9045dea6cfdcf314f4d09897232b82828">committed to the v2.4 unstable branch</a> in the Hg repo.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2014-12-28T18:46:52Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21923#p21923</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Non Field Data from tables into Reports]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21921#p21921" />
			<content type="html"><![CDATA[<p>Sorry for the wrong folder. Thanks.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2014-12-28T17:53:26Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21921#p21921</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Non Field Data from tables into Reports]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21920#p21920" />
			<content type="html"><![CDATA[<p>Thanks Joe. I&#039;ve placed the code in my FAMods for now in the said file at <strong>reporting/includes/reporting.inc</strong>.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2014-12-28T17:51:00Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21920#p21920</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Non Field Data from tables into Reports]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21919#p21919" />
			<content type="html"><![CDATA[<p>I understand your point of view, however, doing this in 2.4 makes sense.<br />We are almost finished with 2.4. Testing it during these days.<br />This function has been included in the file /reporting/reporting.inc at the bery end.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2014-12-28T16:04:17Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21919#p21919</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Non Field Data from tables into Reports]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21915#p21915" />
			<content type="html"><![CDATA[<p>It is actually important for v2.3 to avoid users needlessly extending tables in non-standardised manner making migration to v2.4 that much more cumbersome - yes enough work for consultants if that is what you wish to &quot;support&quot;.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2014-12-28T05:41:13Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21915#p21915</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Non Field Data from tables into Reports]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21912#p21912" />
			<content type="html"><![CDATA[<p>This function will be implemented in release 2.4.</p><p>Thanks apmuthu.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2014-12-27T22:27:34Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21912#p21912</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Non Field Data from tables into Reports]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21898#p21898" />
			<content type="html"><![CDATA[<p>This way when we do actually include some specific fields like Person&#039;s Country Identity Number / SSN / NRIC etc / Tax Exemption Number (US) / Gender / Titular Addressing. etc., we can auto migrate them from the notes. The method stated suffers from not being able to accommodate spaces in the parameters whence some other separator values like &quot;|&quot; (vertical bar) can be used.</p><p>It will also help standardise every FA user&#039;s CoA to the same schema so that migration to v2.4 can be predictably smooth.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2014-12-26T11:39:02Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21898#p21898</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Non Field Data from tables into Reports]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21897#p21897" />
			<content type="html"><![CDATA[<p>In my opinion, not a bad idea. I have asked Janusz to look at it also.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2014-12-26T10:43:44Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21897#p21897</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Non Field Data from tables into Reports]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=21896#p21896" />
			<content type="html"><![CDATA[<p>When we need extra parameters to be included into reports we generally extend the tables with extra fields that will break db schema compatibilities for upgrades. Instead, we add them as space separated key#value pairs into the relevant tables&#039; <strong>notes</strong> field and partake of them within reports using the function listed herein.</p><p>@joe: please include it in any file that gets universally included into all reports.</p><p><strong>Extra Parameters in Reports taken from formatted<span style="color: #ff0000"> notes</span> field</strong></p><p>Include the following function into any report or it&#039;s includes: <br /></p><div class="codebox"><pre><code>/*
// Purpose: Function to parse a string into parameters
// Release Date: 2014-12-26
// Author: ApMuthu &lt;apmuthu@usa.net&gt;
// Usage:
$str = &quot;PPFrt#2000 CID#6378465 TaxEx#2345-038 abcde ertrgdert COD#4253 jdegtd PIN#6473654&quot;;
$p = parse_notes_params($str);
echo print_r($p, true);
*/

function parse_notes_params($str, $sep=&quot; &quot;, $delim=&quot;#&quot;) {
    $str_params = explode($sep, $str);
    $param_array=Array(&#039;notes&#039; =&gt; &#039;&#039;);
    foreach ($str_params AS $str_param) {
        $param_set=explode($delim, trim($str_param));
        $key = (array_key_exists(0, $param_set) ? trim($param_set[0]) : &#039;&#039;);
        $val = (array_key_exists(1, $param_set) ? trim($param_set[1]) : &#039;&#039;);
        if (strlen($key) &gt; 0 &amp;&amp; strlen($val) &gt; 0) {
            $param_array[$key]=$val;
        } else {
            // stop at first missing parameter set
            // break;
            // Collect the rest into notes
            $param_array[&#039;notes&#039;] .= (&quot; &quot; .  $str_param);
        }
    }
    $param_array[&#039;notes&#039;] = trim($param_array[&#039;notes&#039;]);
    return $param_array;
}</code></pre></div><p>An example of usage will be in the <strong>reporting/rep110.php</strong> file at near the end just before the last <strong>$rep-Font();</strong> statement: <br /></p><div class="codebox"><pre><code>    $notes_params = parse_notes_params($branch[&#039;notes&#039;]);
    if ($packing_slip == 0 &amp;&amp; array_key_exists(&#039;CID&#039;, $notes_params)) {
        $rep-&gt;NewLine(1);
        $rep-&gt;TextCol(1, 7, &quot;Old Customer# : &quot; . $notes_params[&#039;CID&#039;], - 2);
    }</code></pre></div><p><a href="https://frontaccounting.com/fawiki/uploads/Help/Rep110_mod.png">Screenshot</a></p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2014-12-26T10:05:44Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=21896#p21896</id>
		</entry>
</feed>
