<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — REP_ID 107 Void Invoice Still Exist In Drop-down]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=8451&amp;type=atom" />
	<updated>2019-10-13T23:29:19Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=8451</id>
		<entry>
			<title type="html"><![CDATA[Re: REP_ID 107 Void Invoice Still Exist In Drop-down]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36261#p36261" />
			<content type="html"><![CDATA[<p><a href="https://sourceforge.net/p/frontaccounting/git/ci/master/tree/reporting/includes/printer_class.inc">Committed</a> and sent to 2.4.7 repo.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2019-10-13T23:29:19Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36261#p36261</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: REP_ID 107 Void Invoice Still Exist In Drop-down]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36260#p36260" />
			<content type="html"><![CDATA[<p>Thanks @kvvaradha and @dearmosin</p><p>Will fix this later this evening</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2019-10-13T16:26:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36260#p36260</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: REP_ID 107 Void Invoice Still Exist In Drop-down]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36258#p36258" />
			<content type="html"><![CDATA[<p>for other types. </p><div class="codebox"><pre><code>case &#039;INVOICE&#039;:
                    $IV = $type_shortcuts[ST_SALESINVOICE];
                    $ref = ($SysPrefs-&gt;print_invoice_no() == 1 ? &quot;trans_no&quot; : &quot;reference&quot;);
                    $sql = &quot;SELECT concat(debtor_trans.trans_no, &#039;-&#039;, debtor_trans.type) AS TNO,
                                concat(&#039;$IV &#039;, debtor_trans.$ref,&#039; &#039;, debtor.name) as IName
                        FROM &quot;.TB_PREF.&quot;debtors_master debtor,&quot;
                            .TB_PREF.&quot;debtor_trans debtor_trans LEFT JOIN &quot;.TB_PREF.&quot;voided AS vd ON debtor_trans.type=vd.type AND debtor_trans.trans_no=vd.id
                        WHERE debtor_trans.type=&quot;.ST_SALESINVOICE.&quot; AND debtor.debtor_no=debtor_trans.debtor_no AND ISNULL(vd.id)
                        ORDER BY debtor_trans.trans_no DESC&quot;;
                    return combo_input($name, &#039;&#039;, $sql, &#039;TNO&#039;, &#039;IName&#039;,array(&#039;order&#039;=&gt;false));

                case &#039;CREDIT&#039;:
                    $CN = $type_shortcuts[ST_CUSTCREDIT];
                    $ref = ($SysPrefs-&gt;print_invoice_no() == 1 ? &quot;trans_no&quot; : &quot;reference&quot;);
                    $sql = &quot;SELECT concat(debtor_trans.trans_no, &#039;-&#039;, debtor_trans.type) AS TNO,
                                concat(&#039;$CN &#039;, debtor_trans.$ref,&#039; &#039;, debtor.name) as IName
                        FROM &quot;.TB_PREF.&quot;debtors_master debtor,&quot;
                            .TB_PREF.&quot;debtor_trans debtor_trans LEFT JOIN &quot;.TB_PREF.&quot;voided AS vd ON debtor_trans.type=vd.type AND debtor_trans.trans_no=vd.id
                        WHERE debtor_trans.type=&quot;.ST_CUSTCREDIT.&quot; AND debtor.debtor_no=debtor_trans.debtor_no AND ISNULL(vd.id)
                        ORDER BY debtor_trans.trans_no DESC&quot;;
                    return combo_input($name, &#039;&#039;, $sql, &#039;TNO&#039;, &#039;IName&#039;,array(&#039;order&#039;=&gt;false));

                case &#039;DELIVERY&#039;:
                    $DN = $type_shortcuts[ST_CUSTDELIVERY];
                    $sql = &quot;SELECT    concat(debtor_trans.trans_no, &#039;-&#039;, debtor_trans.type) AS TNO,
                                concat(debtor_trans.trans_no, &#039; $DN &#039;, debtor.name) as IName
                        FROM &quot;.TB_PREF.&quot;debtors_master debtor,&quot;
                            .TB_PREF.&quot;debtor_trans debtor_trans LEFT JOIN &quot;.TB_PREF.&quot;voided AS vd ON debtor_trans.type=vd.type AND debtor_trans.trans_no=vd.id
                        WHERE debtor_trans.type=&quot;.ST_CUSTDELIVERY.&quot; AND debtor.debtor_no=debtor_trans.debtor_no AND ISNULL(vd.id)
                        ORDER BY debtor_trans.trans_no DESC&quot;;
                    return combo_input($name, &#039;&#039;, $sql, &#039;TNO&#039;, &#039;IName&#039;,array(&#039;order&#039;=&gt;false));


                case &#039;REMITTANCE&#039;:
                    $BP = $type_shortcuts[ST_BANKPAYMENT];
                    $SP = $type_shortcuts[ST_SUPPAYMENT];
                    $CN = $type_shortcuts[ST_SUPPCREDIT];
                    $ref = ($SysPrefs-&gt;print_invoice_no() == 1 ? &quot;trans_no&quot; : &quot;reference&quot;);
                    $sql = &quot;SELECT concat(trans.trans_no, &#039;-&#039;,trans.type) AS TNO,
                                concat(trans.$ref, IF(type=&quot;.ST_BANKPAYMENT.&quot;, &#039; $BP &#039;, IF(type=&quot;.ST_SUPPAYMENT.&quot;, &#039; $SP &#039;, &#039; $CN &#039;)), supplier.supp_name) as IName
                            FROM &quot;.TB_PREF.&quot;suppliers supplier, &quot;
                                .TB_PREF.&quot;supp_trans trans  LEFT JOIN &quot;.TB_PREF.&quot;voided AS vd ON trans.type=vd.type AND trans.trans_no=vd.id
                            WHERE trans.type IN(&quot;.ST_BANKPAYMENT.&quot;,&quot;.ST_SUPPAYMENT.&quot;,&quot;.ST_SUPPCREDIT.&quot;)    AND supplier.supplier_id=trans.supplier_id AND ISNULL(vd.id)
                            ORDER BY trans.trans_no DESC&quot;;
                    return combo_input($name, &#039;&#039;, $sql, &#039;TNO&#039;, &#039;IName&#039;,array(&#039;order&#039;=&gt;false));

                case &#039;RECEIPT&#039;:
                    $BD = $type_shortcuts[ST_BANKDEPOSIT];
                    $CP = $type_shortcuts[ST_CUSTPAYMENT];
                    $ref = ($SysPrefs-&gt;print_invoice_no() == 1 ? &quot;trans_no&quot; : &quot;reference&quot;);
                    $sql = &quot;SELECT concat(trans.trans_no, &#039;-&#039;, trans.type) AS TNO,
                                concat(trans.$ref, IF(trans.type=&quot;.ST_BANKDEPOSIT.&quot;, &#039; $BD &#039;, &#039; $CP &#039;), debtor.name) as IName
                        FROM &quot;.TB_PREF.&quot;debtors_master debtor,&quot;
                            .TB_PREF.&quot;debtor_trans trans LEFT JOIN &quot;.TB_PREF.&quot;voided AS vd ON trans.type=vd.type AND trans.trans_no=vd.id
                        WHERE trans.type IN(&quot;.ST_BANKDEPOSIT.&quot;,&quot;.ST_CUSTPAYMENT.&quot;,&quot;.ST_CUSTCREDIT.&quot;) AND debtor.debtor_no=trans.debtor_no AND ISNULL(vd.id)
                        ORDER BY trans.trans_no DESC&quot;;
                    return combo_input($name, &#039;&#039;, $sql, &#039;TNO&#039;, &#039;IName&#039;,array(&#039;order&#039;=&gt;false));</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2019-10-13T15:14:14Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36258#p36258</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: REP_ID 107 Void Invoice Still Exist In Drop-down]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36257#p36257" />
			<content type="html"><![CDATA[<p>A good issue, @joe looks like we have to add voided table in it.</p><p>it sholud be like this for sales invoice </p><div class="codebox"><pre><code>case &#039;INVOICE&#039;:
                    $IV = $type_shortcuts[ST_SALESINVOICE];
                    $ref = ($SysPrefs-&gt;print_invoice_no() == 1 ? &quot;trans_no&quot; : &quot;reference&quot;);
                    $sql = &quot;SELECT concat(debtor_trans.trans_no, &#039;-&#039;, debtor_trans.type) AS TNO,
                                concat(&#039;$IV &#039;, debtor_trans.$ref,&#039; &#039;, debtor.name) as IName
                        FROM &quot;.TB_PREF.&quot;debtors_master debtor,&quot;
                            .TB_PREF.&quot;debtor_trans debtor_trans LEFT JOIN &quot;.TB_PREF.&quot;voided AS vd ON debtor_trans.type=vd.type AND debtor_trans.trans_no=vd.id
                        WHERE debtor_trans.type=&quot;.ST_SALESINVOICE.&quot; AND debtor.debtor_no=debtor_trans.debtor_no AND ISNULL(vd.id)
                        ORDER BY debtor_trans.trans_no DESC&quot;;
                    return combo_input($name, &#039;&#039;, $sql, &#039;TNO&#039;, &#039;IName&#039;,array(&#039;order&#039;=&gt;false));</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2019-10-13T15:05:51Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36257#p36257</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[REP_ID 107 Void Invoice Still Exist In Drop-down]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=36256#p36256" />
			<content type="html"><![CDATA[<p>My company setting is $SysPrefs-&gt;print_invoice_no() is FALSE</p><p>HOW TO PRODUCE THIS ERROR<br />I tried voiding invoice and then created invoice with same reference number which I voided earlier. When I try to print invoice it is displaying two invoice with same reference in drop-down</p><p>SOLUTIONS<br />in reporting/includes/reports_classes.inc I made these changes to prevent voided invoice displaying in print invoice section</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &#039;INVOICE&#039;:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $IV = $type_shortcuts[ST_SALESINVOICE];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ref = ($SysPrefs-&gt;print_invoice_no() == 1 ? &quot;trans_no&quot; : &quot;reference&quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql = &quot;SELECT concat(debtor_trans.trans_no, &#039;-&#039;, debtor_trans.type) AS TNO,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; concat(&#039;$IV &#039;, debtor_trans.$ref,&#039; &#039;, debtor.name) as IName<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FROM &quot;.TB_PREF.&quot;debtors_master debtor,&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .TB_PREF.&quot;debtor_trans debtor_trans<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE type=&quot;.ST_SALESINVOICE.&quot; AND debtor.debtor_no=debtor_trans.debtor_no AND version = 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ORDER BY debtor_trans.trans_no DESC&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return combo_input($name, &#039;&#039;, $sql, &#039;TNO&#039;, &#039;IName&#039;,array(&#039;order&#039;=&gt;false)); </p><p>In where clause I just added&nbsp; AND version = 0</p>]]></content>
			<author>
				<name><![CDATA[dearmosin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=44699</uri>
			</author>
			<updated>2019-10-13T09:49:59Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=36256#p36256</id>
		</entry>
</feed>
