<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Rep107 - Remove Article Code from Invoice (v2.4.x)]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8679&amp;type=atom" />
	<updated>2022-06-03T06:28:59Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=8679</id>
		<entry>
			<title type="html"><![CDATA[Re: Rep107 - Remove Article Code from Invoice (v2.4.x)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41134#p41134" />
			<content type="html"><![CDATA[<p>1. You can make a copy of header2.inc file (say header107.inc), now do all the changes sledge did on that file<br />2. Create a new function in reporting/includes/pdf_report.inc (say function Header107() ), include the above header107.inc e.g given below</p><p>&nbsp; &nbsp; function Header107()<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; global $dflt_lang; // FIXME should be passed as params</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;SetLang(@$this-&gt;formData[&#039;rep_lang&#039;] ? $this-&gt;formData[&#039;rep_lang&#039;] : $dflt_lang);<br />&nbsp; &nbsp; &nbsp; &nbsp; $doctype = $this-&gt;formData[&#039;doctype&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; $header2type = true;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $lang = user_language();<br />&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;SetLang(@$this-&gt;formData[&#039;rep_lang&#039;] ? $this-&gt;formData[&#039;rep_lang&#039;]<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : ( $lang ? $lang : $dflt_lang));</p><p> &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; // leave layout files names without path to enable including<br /> &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; // modified versions from company/x/reporting directory<br />&nbsp; &nbsp; &nbsp; &nbsp; include(&quot;includes/doctext.inc&quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; include(&quot;includes/header107.inc&quot;);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;row = $temp;<br />&nbsp; &nbsp; }</p><p>3. Now rename SetHeaderType on line 141 for calling Header107 function in rep107.php<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $rep-&gt;SetHeaderType(&#039;Header107&#039;);<br />4. Now this will make a custom header for specific for invoice pdf.</p>]]></content>
			<author>
				<name><![CDATA[dz]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=44997</uri>
			</author>
			<updated>2022-06-03T06:28:59Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41134#p41134</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rep107 - Remove Article Code from Invoice (v2.4.x)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41131#p41131" />
			<content type="html"><![CDATA[<p>Hello Sledge,</p><p>This modification is nice. but there is a problem. I did this modification in header.inc, it affected the Receipt header, Delivery header and other Reports. Cant it be done in Just rep107.php so it is on just the Invoice only?</p><p>thanks</p><p>Popsicles12</p>]]></content>
			<author>
				<name><![CDATA[popsicles12]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=36</uri>
			</author>
			<updated>2022-06-02T19:21:21Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41131#p41131</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Rep107 - Remove Article Code from Invoice (v2.4.x)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36947#p36947" />
			<content type="html"><![CDATA[<p>For the record, to fix the headers I modify file &quot;../reporting/includes/header2.inc&quot;</p><p><strong>Original (Lines 182-189)</strong><br /></p><div class="codebox"><pre><code>        // Line headers
        $this-&gt;row = $iline5 - $this-&gt;lineHeight - 1;
        $this-&gt;Font(&#039;bold&#039;);
        $count = count($this-&gt;headers);
        $this-&gt;cols[$count] = $right - 3;
        for ($i = 0; $i &lt; $count; $i++)
            $this-&gt;TextCol($i, $i + 1, $this-&gt;headers[$i], -2);
        $this-&gt;Font();</code></pre></div><p><strong>Modified - add line 185 (Lines 182-190)</strong><br /></p><div class="codebox"><pre><code>        // Line headers
        $this-&gt;row = $iline5 - $this-&gt;lineHeight - 1;
        $this-&gt;Font(&#039;bold&#039;);
        $this-&gt;headers = array(_(&quot;Item Description&quot;),&#039;&#039;, _(&quot;Quantity&quot;),_(&quot;Unit&quot;), _(&quot;Price&quot;), _(&quot;Discount %&quot;), _(&quot;Total&quot;));
        $count = count($this-&gt;headers);
        $this-&gt;cols[$count] = $right - 3;
        for ($i = 0; $i &lt; $count; $i++)
            $this-&gt;TextCol($i, $i + 1, $this-&gt;headers[$i], -2);
        $this-&gt;Font();</code></pre></div><p>I agree that modifying file &quot;../reporting/includes/doctext.inc&quot; would be preferable, but that has a lot of consequences for a many other reports.</p>]]></content>
			<author>
				<name><![CDATA[sledge]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=13020</uri>
			</author>
			<updated>2020-02-01T16:02:19Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36947#p36947</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Rep107 - Remove Article Code from Invoice (v2.4.x)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36946#p36946" />
			<content type="html"><![CDATA[<p>I recently upgrade from v2.3 to v2.4<br />As my business mainly supplies services, I used to remove the Article Codes column from the invoices (rep107). The codes are not much of use in my case and this leaves more white space to enter an appropriate description.</p><p>I&#039;ve noticed the rep107 template changed quite a lot between v2.3 and v2.4.<br />I&#039;ve got my adjustment working, but I think there is a better way of doing it, which preserves the &#039;$c++, $c&#039; instead of fiddling around with column numbers.</p><p>My work around;<br /><strong>Original (Lines 162-180)</strong><br /></p><div class="codebox"><pre><code>                $c=0;
                $rep-&gt;TextCol($c++, $c,    $myrow2[&#039;stock_id&#039;], -2);
                $oldrow = $rep-&gt;row;
                $rep-&gt;TextColLines($c++, $c, $myrow2[&#039;StockDescription&#039;], -2);
                $newrow = $rep-&gt;row;
                $rep-&gt;row = $oldrow;
                if ($Net != 0.0 || !is_service($myrow2[&#039;mb_flag&#039;]) || !$SysPrefs-&gt;no_zero_lines_amount())
                {
                    $rep-&gt;TextCol($c++, $c,    $DisplayQty, -2);
                    $rep-&gt;TextCol($c++, $c,    $myrow2[&#039;units&#039;], -2);
                    $rep-&gt;TextCol($c++, $c,    $DisplayPrice, -2);
                    $rep-&gt;TextCol($c++, $c,    $DisplayDiscount, -2);
                    $rep-&gt;TextCol($c++, $c,    $DisplayNet, -2);
                }
                $rep-&gt;row = $newrow;
                //$rep-&gt;NewLine(1);
                if ($rep-&gt;row &lt; $summary_start_row)
                    $rep-&gt;NewPage();
            }</code></pre></div><p><strong>Modified (Lines 162-180)</strong><br /></p><div class="codebox"><pre><code>                $c=0;
                //$rep-&gt;TextCol($c++, $c,    $myrow2[&#039;stock_id&#039;], -2);
                $oldrow = $rep-&gt;row;
                $rep-&gt;TextColLines(0, 2, $myrow2[&#039;StockDescription&#039;], -2);
                $newrow = $rep-&gt;row;
                $rep-&gt;row = $oldrow;
                if ($Net != 0.0 || !is_service($myrow2[&#039;mb_flag&#039;]) || !$SysPrefs-&gt;no_zero_lines_amount())
                {
                    $rep-&gt;TextCol(2, 3,    $DisplayQty, -2);
                    $rep-&gt;TextCol(3, 4,    $myrow2[&#039;units&#039;], -2);
                    $rep-&gt;TextCol(4, 5,    $DisplayPrice, -2);
                    $rep-&gt;TextCol(5, 6,    $DisplayDiscount, -2);
                    $rep-&gt;TextCol(6, 7,    $DisplayNet, -2);
                }
                $rep-&gt;row = $newrow;
                //$rep-&gt;NewLine(1);
                if ($rep-&gt;row &lt; $summary_start_row)
                    $rep-&gt;NewPage();
            }</code></pre></div><p>Anyone?</p>]]></content>
			<author>
				<name><![CDATA[sledge]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=13020</uri>
			</author>
			<updated>2020-02-01T15:17:46Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36946#p36946</id>
		</entry>
</feed>
