<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Customer Allocation date zero]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7250&amp;type=atom" />
	<updated>2018-01-07T08:07:43Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7250</id>
		<entry>
			<title type="html"><![CDATA[Customer Allocation date zero]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=30438#p30438" />
			<content type="html"><![CDATA[<p>When a customer payment is allocated, the date of allocation is entered as &#039;0000-00-00&#039; but it is correctly entered for direct cash invoices. This happens in the <strong>cust_allocations</strong> and <strong>debtor_trans tables</strong>. The <strong>$_POST[&#039;DateBanked&#039;]</strong> or it&#039;s processed value like end of current fiscal_year should have been used.</p><p>The set of payment and full allocation transaction sqls are:<br /></p><div class="codebox"><pre><code>SET @alloc=400;
SET @bankcharge=5;

INSERT INTO `1_refs` VALUES
(&#039;4&#039;, &#039;12&#039;, &#039;001/2018&#039;);

INSERT INTO `1_bank_trans` VALUES
(NULL, &#039;12&#039;, &#039;4&#039;, &#039;1&#039;, &#039;001/2018&#039;, &#039;2018-01-07&#039;, @alloc-@bankcharge, &#039;0&#039;, &#039;0&#039;, &#039;2&#039;, &#039;1&#039;, NULL);
INSERT INTO `1_comments` VALUES
(&#039;12&#039;, &#039;4&#039;, &#039;2018-01-07&#039;, &#039;paid by outstation cheque&#039;);
INSERT INTO `1_cust_allocations` VALUES
(NULL, &#039;1&#039;, @alloc, &#039;0000-00-00&#039;, &#039;4&#039;, &#039;12&#039;, &#039;5&#039;, &#039;10&#039;);
INSERT INTO `1_debtor_trans` VALUES
(&#039;4&#039;, &#039;12&#039;, &#039;0&#039;, &#039;1&#039;, &#039;1&#039;, &#039;2018-01-07&#039;, &#039;0000-00-00&#039;, &#039;001/2018&#039;, &#039;0&#039;, &#039;0&#039;, &#039;400&#039;, &#039;0&#039;, &#039;0&#039;, &#039;0&#039;, &#039;0&#039;, @alloc, &#039;0&#039;, &#039;1&#039;, &#039;0&#039;, &#039;0&#039;, &#039;0&#039;, NULL, &#039;0&#039;),
UPDATE `1_debtor_trans` SET `alloc`=`ov_amount`-@alloc WHERE `type`=&#039;10&#039; AND `trans_no`=&#039;5&#039; AND `debtor_no`=&#039;4&#039;
INSERT INTO `1_gl_trans` VALUES
(NULL, &#039;12&#039;, &#039;4&#039;, &#039;2018-01-07&#039;, &#039;1060&#039;, &#039;&#039;, @alloc-@bankcharge, &#039;0&#039;, &#039;0&#039;, NULL, NULL),
(NULL, &#039;12&#039;, &#039;4&#039;, &#039;2018-01-07&#039;, &#039;1200&#039;, &#039;&#039;, -@alloc, &#039;0&#039;, &#039;0&#039;, &#039;2&#039;, &#039;1&#039;),
(NULL, &#039;12&#039;, &#039;4&#039;, &#039;2018-01-07&#039;, &#039;5690&#039;, &#039;&#039;, @bankcharge, &#039;0&#039;, &#039;0&#039;, NULL, NULL);
INSERT INTO `1_audit_trail` VALUES
(NULL, &#039;12&#039;, &#039;4&#039;, &#039;1&#039;, &#039;2018-01-07 10:13:49&#039;, NULL, &#039;3&#039;, &#039;2018-01-07&#039;, &#039;0&#039;);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-01-07T08:07:43Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=30438#p30438</id>
		</entry>
</feed>
