<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Anatomy of adding 1 customer]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=7406</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7406&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Anatomy of adding 1 customer.]]></description>
		<lastBuildDate>Fri, 25 Dec 2020 03:17:09 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Anatomy of adding 1 customer]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=38819#p38819</link>
			<description><![CDATA[<p>hi did you write the code? is it available ?</p>]]></description>
			<author><![CDATA[null@example.com (sewkar)]]></author>
			<pubDate>Fri, 25 Dec 2020 03:17:09 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=38819#p38819</guid>
		</item>
		<item>
			<title><![CDATA[Re: Anatomy of adding 1 customer]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=31139#p31139</link>
			<description><![CDATA[<p>This is useful. I will be writing the customer migration code, soon. Thank you.</p>]]></description>
			<author><![CDATA[null@example.com (oakstreet1)]]></author>
			<pubDate>Fri, 16 Mar 2018 16:57:43 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=31139#p31139</guid>
		</item>
		<item>
			<title><![CDATA[Anatomy of adding 1 customer]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=31133#p31133</link>
			<description><![CDATA[<p>Analysing the diffs of backups before and after adding 1 Customer resulted in a set of INSERT statements when parsed out and sequences with variable extractions done resulted in the following (Assumed TB_PREF=3_):<br /></p><div class="codebox"><pre><code>SET @Customer  := &quot;PKA Enterprises&quot;;
SET @CustShort := &quot;PKA&quot;;
SET @Phone     := &quot;28557841&quot;;
SET @EMail     := &quot;pka@example.com&quot;;
SET @Address   := &quot;Joe Smith Road\nTimbuktoo - Z9HG34&quot;;
SET @GST       := &quot;1234578&quot;;
SET @Location  := &#039;DEF&#039;;
SET @DefCurr   := (SELECT `value` FROM `3_sys_prefs` WHERE `name`=&quot;curr_default&quot; AND `category`=&quot;setup.company&quot;);
SET @Credit    := (SELECT `value` FROM `3_sys_prefs` WHERE `name`=&quot;default_credit_limit&quot; AND `category`=&quot;glsetup.customer&quot;);
SET @DfPayAc   := (SELECT `value` FROM `3_sys_prefs` WHERE `name`=&quot;default_prompt_payment_act&quot; AND `category`=&quot;glsetup.sales&quot;);
SET @PrPayAc   := (SELECT `value` FROM `3_sys_prefs` WHERE `name`=&quot;default_sales_discount_act&quot; AND `category`=&quot;glsetup.sales&quot;);
SET @DrsAc     := (SELECT `value` FROM `3_sys_prefs` WHERE `name`=&quot;debtors_act&quot; AND `category`=&quot;glsetup.sales&quot;);

INSERT INTO `3_debtors_master` VALUES
(NULL, @Customer, @CustShort, @Address, @GST, @DefCurr, &#039;1&#039;, &#039;0&#039;, &#039;0&#039;, &#039;1&#039;, &#039;4&#039;, &#039;0&#039;, &#039;0&#039;, @Credit, &#039;&#039;, &#039;0&#039;);
SET @DrNum := (SELECT LAST_INSERT_ID());

INSERT INTO `3_cust_branch` VALUES
(NULL, @DrNum, @Customer, @CustShort, @Address, &#039;1&#039;, &#039;1&#039;, @Location, &#039;1&#039;, &#039;&#039;, @PrPayAc, @DrsAc, @DfPayAc, &#039;1&#039;, @Address, &#039;0&#039;, &#039;&#039;, NULL, &#039;0&#039;);
SET @BranchID := (SELECT LAST_INSERT_ID());

INSERT INTO `3_crm_persons` VALUES
(NULL, @CustShort, @Customer, NULL, @Address, @Phone, NULL, NULL, @EMail, NULL, &#039;&#039;, &#039;0&#039;);
SET @PersonID := (SELECT LAST_INSERT_ID());

INSERT INTO `3_crm_contacts` VALUES
(NULL, @PersonID, &#039;cust_branch&#039;, &#039;general&#039;, @BranchID),
(NULL, @PersonID, &#039;customer&#039;, &#039;general&#039;, @DrNum);</code></pre></div><p>Here, first a customer is created and then a branch for the said customer.<br />Then one Person is created.<br />This Person is then allotted to both -&nbsp; customer and cust_branch.</p><p>The above can be useful for bulk importing of customers from disparate systems.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 16 Mar 2018 12:12:31 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=31133#p31133</guid>
		</item>
	</channel>
</rss>
