<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Anatomy of adding 1 Inventory Item]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7408&amp;type=atom" />
	<updated>2018-04-17T18:55:24Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7408</id>
		<entry>
			<title type="html"><![CDATA[Re: Anatomy of adding 1 Inventory Item]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31444#p31444" />
			<content type="html"><![CDATA[<p>Have a look at the Inventory =&gt; Add New Item page and view the form field names and see how they relate to the various sql statements above.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-04-17T18:55:24Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31444#p31444</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Anatomy of adding 1 Inventory Item]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31439#p31439" />
			<content type="html"><![CDATA[<p>is it possible for you to help us elaborate the anatomy of inventory transfers/adjustments?</p>]]></content>
			<author>
				<name><![CDATA[justapeddler]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=35135</uri>
			</author>
			<updated>2018-04-17T09:52:27Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31439#p31439</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Anatomy of adding 1 Inventory Item]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31148#p31148" />
			<content type="html"><![CDATA[<p>Taking the sql backup diffs between before and after adding a single Inventory Item, the following sequence of SQL statements are observed (Assumed TB_PREF=3_):</p><div class="codebox"><pre><code>SET @StockID      := &#039;MT501&#039;;
SET @ItemDesc     := &#039;Camera 5 MP&#039;;
SET @ItemLongDesc := &#039;Digital Camera of 5 MP resolution&#039;;
SET @ReOrderLevel := &#039;0&#039;;
SET @MBFlag       := &#039;B&#039;;    -- BoughtOut, Manufactured, D: Charges/Services
SET @CatID        := &#039;1&#039;;    -- stock_category.component_id -- Components
SET @LocationCode := &#039;DEF&#039;;  -- locations.loc_code
SET @Units        := &#039;each&#039;; -- item_units.abbr 
SET @TaxTypeID    := &#039;2&#039;;    -- item_tax_types.id
SET @SalesAc      := (SELECT `value` FROM 3_sys_prefs WHERE `category` = &quot;glsetup.items&quot; AND `name` = &quot;default_inv_sales_act&quot;);
SET @COGSAc       := (SELECT `value` FROM 3_sys_prefs WHERE `category` = &quot;glsetup.items&quot; AND `name` = &quot;default_cogs_act&quot;);
SET @InventoryAc  := (SELECT `value` FROM 3_sys_prefs WHERE `category` = &quot;glsetup.items&quot; AND `name` = &quot;default_inventory_act&quot;);
SET @AdjAc        := (SELECT `value` FROM 3_sys_prefs WHERE `category` = &quot;glsetup.items&quot; AND `name` = &quot;default_adj_act&quot;);
SET @WIPAc        := (SELECT `value` FROM 3_sys_prefs WHERE `category` = &quot;glsetup.items&quot; AND `name` = &quot;default_wip_act&quot;);

INSERT INTO `3_stock_master` VALUES
(@StockID, @CatID, @TaxTypeID, @ItemDesc, @ItemLongDesc, @Units, @MBFlag, @SalesAc, @COGSAc, @InventoryAc, @AdjAc, @WIPAc, &#039;0&#039;, &#039;0&#039;, &#039;0&#039;, &#039;0&#039;, &#039;0&#039;, &#039;0&#039;, &#039;0&#039;, &#039;0&#039;, &#039;0&#039;, &#039;0&#039;, &#039;&#039;, &#039;0&#039;, &#039;0&#039;, &#039;0000-00-00&#039;, &#039;0000-00-00&#039;, &#039;&#039;);

INSERT INTO `3_item_codes` VALUES
(NULL, @StockID, @StockID, @ItemDesc, @CatID, &#039;1&#039;, &#039;0&#039;, &#039;0&#039;);

INSERT INTO `3_loc_stock` VALUES
(@LocationCode, @StockID, @ReOrderLevel);

-- If a jpg image of the item was added to company #, then it would be named company/#/images/&lt;StockID&gt;.jpg
-- Here it would be: company/3/images/MT501.jpg
-- item_codes.id has no relevance in FA except for uniquely choosing the item and not even for sorting
-- Foreign Items can have different item_code and stock_id for the same item</code></pre></div><p>Here, first a stock item is added to the stock_master..<br />Then one item_code is allotted for it which may be different from the stock_id if the item is a foreign one.<br />The stock_id is assigned to a location and a Re-Order level fixed for it.</p><p>The above can be useful for bulk importing of inventory items from disparate systems.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-03-17T15:27:36Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31148#p31148</id>
		</entry>
</feed>
