<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Voiding purchase order deliveries in 2.4.1]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6875&amp;type=atom" />
	<updated>2017-07-19T16:05:08Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=6875</id>
		<entry>
			<title type="html"><![CDATA[Re: Voiding purchase order deliveries in 2.4.1]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28215#p28215" />
			<content type="html"><![CDATA[<p>That makes sense, however I don&#039;t know how to do it.</p><p>If I try to void the PO Delivery (GRN) before removing the invoice, the message</p><p>&nbsp; &nbsp; &nbsp; &nbsp;The entered transaction does not exist or cannot be voided</p><p>still occurs.</p><p>Note that the code that actually voids the transaction (void_transaction) still calls exists_grn_on_invoices():</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case ST_SUPPRECEIVE : // it&#039;s a GRN<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (exists_grn_on_invoices($type_no))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return _(&#039;This GRN cannot be voided because it was already invoiced.&#039;);</p><p>But this seems to be prevented from running now by the earlier call to exists_grn() in admin/void_transaction.php.</p>]]></content>
			<author>
				<name><![CDATA[Braath Waate]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41493</uri>
			</author>
			<updated>2017-07-19T16:05:08Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28215#p28215</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Voiding purchase order deliveries in 2.4.1]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28213#p28213" />
			<content type="html"><![CDATA[<p>The faulty behaviour existing in 2.3 was fixed in 2.4.1. If you want remove invalid PO you have to explicitly void related GRNs first.<br />There cannot be hanging GRNs without PO in database.<br />Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2017-07-19T07:21:17Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28213#p28213</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Voiding purchase order deliveries in 2.4.1]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28208#p28208" />
			<content type="html"><![CDATA[<p>Will send this to Janusz.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2017-07-18T19:49:10Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28208#p28208</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Voiding purchase order deliveries in 2.4.1]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28207#p28207" />
			<content type="html"><![CDATA[<p>@joe: any fix?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-07-18T17:01:08Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28207#p28207</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Voiding purchase order deliveries in 2.4.1]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28204#p28204" />
			<content type="html"><![CDATA[<p>In 2.3, one can void a PO delivery by voiding the invoice and then voiding the PO delivery.&nbsp; The voiding of the invoice clears quantity in supp_inv_items.&nbsp; This allows the void of the PO delivery to proceed because it calls:</p><p>function exists_grn_on_invoices($grn_batch)<br />{<br />&nbsp; &nbsp; &nbsp; &nbsp; $sql = &quot;SELECT &quot;.TB_PREF.&quot;supp_invoice_items.id FROM &quot;.TB_PREF.&quot;supp_invoice_items,&quot;.TB_PREF.&quot;grn_items<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE &quot;.TB_PREF.&quot;supp_invoice_items.grn_item_id=&quot;.TB_PREF.&quot;grn_items.id<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND quantity != 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND grn_batch_id=&quot;.db_escape($grn_batch);<br />&nbsp; &nbsp; &nbsp; &nbsp; $result = db_query($sql, &quot;Cannot query GRNs&quot;);</p><p>&nbsp; &nbsp; return (db_num_rows($result) &gt; 0);<br />}</p><p>and disallows the void only if &quot;quantity != 0&quot;.</p><p>This code changed in 2.4.1.&nbsp; &nbsp;It now calls exists_grn() which simply checks for a grn_batch entry, and if it exists it disallows the void.&nbsp; &nbsp;Yet the grn_batch entry still exists after an invoice has been voided and thus returns the error: </p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;The entered transaction does not exist or cannot be voided.</p><p>To test this, create a direct supplier invoice in both 2.3 and 2.4.1, void the invoice and then void the PO Delivery.</p>]]></content>
			<author>
				<name><![CDATA[Braath Waate]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41493</uri>
			</author>
			<updated>2017-07-18T16:45:15Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28204#p28204</id>
		</entry>
</feed>
