<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — INVOICE NUMBER - PREVENT CHANGE BY USER]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=5857</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5857&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in INVOICE NUMBER - PREVENT CHANGE BY USER.]]></description>
		<lastBuildDate>Sun, 20 Sep 2015 15:22:55 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: INVOICE NUMBER - PREVENT CHANGE BY USER]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=24324#p24324</link>
			<description><![CDATA[<p>It is possible to make all Reference fields in new element forms to be readonly. The attached screenshots are for making just one form (Direct Invoice) or all forms to have their Reference field as non-editable.</p><p>Apart from being defined in <strong>includes/ui/ui_input.inc</strong>, there are 17 files that use the function <strong>ref_row</strong> - once each. The said function is currently not used in any standard extension.</p><p>Placed on <a href="https://frontaccounting.com/fawiki/index.php?n=Devel.ReferenceFieldNonEditableMod">Wiki</a>.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 20 Sep 2015 15:22:55 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=24324#p24324</guid>
		</item>
		<item>
			<title><![CDATA[Re: INVOICE NUMBER - PREVENT CHANGE BY USER]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=24323#p24323</link>
			<description><![CDATA[<p>The before and after depiction of the code changes suggested for pass 1 of the function synch is attached herein.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 20 Sep 2015 14:06:56 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=24323#p24323</guid>
		</item>
		<item>
			<title><![CDATA[Re: INVOICE NUMBER - PREVENT CHANGE BY USER]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=24318#p24318</link>
			<description><![CDATA[<p>The same could have been achieved easily with a flag based readonly attribute in the input tag.</p><p>I have re-factored the <strong>includes/ui/ui_input.inc</strong> &#039;s <span class="bbu">text_cells</span> and <span class="bbu">text_cells_ex</span> functions to have the same argument names and bunching similar code for ease of understanding before the inclusion of the <strong>$inparams</strong> in the latter function where the <strong>readonly</strong> can be inserted. This will also server to clarify the code.</p><p>The real solution will be to have a flag in the <strong>sys_prefs</strong> table that removes the field altogether and in the processing script acquires the next reference and then populates the tables, showing the end result in the browser.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 20 Sep 2015 05:27:29 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=24318#p24318</guid>
		</item>
		<item>
			<title><![CDATA[Re: INVOICE NUMBER - PREVENT CHANGE BY USER]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=24314#p24314</link>
			<description><![CDATA[<p>Hi AP Muthu,</p><p>Sorry for the late reply.... and sure I&#039;m happy to provide the change I made.</p><p>Actually it is just a small change to this file:&nbsp; sales/customer_invoice.php:</p><p>At around line 400,&nbsp; I commented this line: </p><p>ref_cells(_(&quot;Reference&quot;), &#039;ref&#039;, &#039;&#039;, null, &quot;class=&#039;tableheader2&#039;&quot;);</p><p>and replaced it with these 2 lines:</p><p>label_cells(_(&quot;Inv No:&quot;), $_SESSION[&#039;Items&#039;]-&gt;reference, &quot;class=&#039;tableheader2&#039;&quot;);<br />hidden(&#039;ref&#039;, $_SESSION[&#039;Items&#039;]-&gt;reference);</p><p>That&#039;s all I did and now the Invoice number cannot be changed by user.</p><p>I&#039;m not sure this is the best way to do but it achieved what I need.</p>]]></description>
			<author><![CDATA[null@example.com (mark0300)]]></author>
			<pubDate>Fri, 18 Sep 2015 09:13:54 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=24314#p24314</guid>
		</item>
		<item>
			<title><![CDATA[Re: INVOICE NUMBER - PREVENT CHANGE BY USER]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23983#p23983</link>
			<description><![CDATA[<p>Would you like to provide a diff or changed fileset to the project?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Mon, 03 Aug 2015 14:19:43 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23983#p23983</guid>
		</item>
		<item>
			<title><![CDATA[Re: INVOICE NUMBER - PREVENT CHANGE BY USER]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23979#p23979</link>
			<description><![CDATA[<p>Thanks very much.<br />It works for me!</p>]]></description>
			<author><![CDATA[null@example.com (mark0300)]]></author>
			<pubDate>Fri, 31 Jul 2015 10:16:48 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23979#p23979</guid>
		</item>
		<item>
			<title><![CDATA[Re: INVOICE NUMBER - PREVENT CHANGE BY USER]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23965#p23965</link>
			<description><![CDATA[<p>Try a blank (or value: auto) hidden field for it.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Wed, 29 Jul 2015 17:53:13 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23965#p23965</guid>
		</item>
		<item>
			<title><![CDATA[Re: INVOICE NUMBER - PREVENT CHANGE BY USER]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23954#p23954</link>
			<description><![CDATA[<p>Thanks APmuthu.&nbsp; &nbsp;I need some help in getting the variable of the field.&nbsp; </p><p>Based on this line:</p><p>ref_cells(_(&quot;Reference&quot;), &#039;ref&#039;, &#039;&#039;, null, &quot;class=&#039;tableheader2&#039;&quot;); //Invoice Number assigned but editable</p><p>I thought the value is $_SESSION[&#039;Items&#039;]-&gt;reference.&nbsp; But I struggled to figure out what should be the correct variable/value to assign to the field but I failed to make it work.&nbsp; (I can&#039;t put $ref = $_SESSION[&#039;Items&#039;]-&gt;reference;)</p><p>I would appreciate it if you could advise how to assign that and it will help if you could give me some examples.</p><p>Thank you.</p>]]></description>
			<author><![CDATA[null@example.com (mark0300)]]></author>
			<pubDate>Tue, 28 Jul 2015 08:24:24 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23954#p23954</guid>
		</item>
		<item>
			<title><![CDATA[Re: INVOICE NUMBER - PREVENT CHANGE BY USER]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23926#p23926</link>
			<description><![CDATA[<p>You will need to make a hidden field with assigned value.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 26 Jul 2015 09:20:41 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23926#p23926</guid>
		</item>
		<item>
			<title><![CDATA[INVOICE NUMBER - PREVENT CHANGE BY USER]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=23908#p23908</link>
			<description><![CDATA[<p>I have posted this under another post but there is no reply so I transferred the topic to here....</p><p>There is a need to implement a control of the invoice number and we have to make the invoice number non-editable by the user when they enter a Direct Invoice or Invoice against a delivery.&nbsp; We used the Form Setup to assign the first number and let the Invoice number incremental run automatically.</p><p>Currently, the Invoice screen will show the Invoice Number assigned by the Form Setup and the field allows user to edit.&nbsp; &nbsp;This is because of the lines below in sales\customer_invoice.php:</p><p>if ($_SESSION[&#039;Items&#039;]-&gt;trans_no == 0) {<br />&nbsp; &nbsp; ref_cells(_(&quot;Reference&quot;), &#039;ref&#039;, &#039;&#039;, null, &quot;class=&#039;tableheader2&#039;&quot;); //Invoice Number assigned but editable<br />} else {<br />&nbsp; &nbsp; label_cells(_(&quot;Reference&quot;), $_SESSION[&#039;Items&#039;]-&gt;reference, &quot;class=&#039;tableheader2&#039;&quot;);<br />}</p><br /><br /><p>To make it non-editable, I have replaced the line ref_cells to label_cells as follows:</p><p>if ($_SESSION[&#039;Items&#039;]-&gt;trans_no == 0) {<br />&nbsp; &nbsp; label_cells(_(&quot;Reference&quot;), $_SESSION[&#039;Items&#039;]-&gt;reference, &quot;class=&#039;tableheader2&#039;&quot;);&nbsp; //Invoice Number assigned and now not editable<br />} else {<br />&nbsp; &nbsp; label_cells(_(&quot;Reference&quot;), $_SESSION[&#039;Items&#039;]-&gt;reference, &quot;class=&#039;tableheader2&#039;&quot;);<br />}</p><p>With this change, now the Invoice number is assigned (by Form Setups) and not editable.&nbsp; However, when I process the Invoice, the error &quot;You must enter a reference.&quot; shows.&nbsp; I know I missed out something but I don&#039;t know what else to change.&nbsp; The Invoice Number showed is not assigned to the variable which in turn update the reference in the database tables.&nbsp; This variable is empty. </p><p>Would you please advise what other codes I have to change so that the assigned Invoice number is picked up and update the reference in the Tables?</p><p>Thank you.</p><p>Mark</p>]]></description>
			<author><![CDATA[null@example.com (mark0300)]]></author>
			<pubDate>Wed, 22 Jul 2015 09:25:32 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=23908#p23908</guid>
		</item>
	</channel>
</rss>
