# Bulk Product And Inventory Importer for latest SambaPOS version?

**URL:** <https://forum.sambapos.com/t/bulk-product-and-inventory-importer-for-latest-sambapos-version/14932>\
**Category:** V5 Question\
**Created:** [May 25, 2017, 10:04am UTC](https://forum.sambapos.com/t/bulk-product-and-inventory-importer-for-latest-sambapos-version/14932 "2017-05-25T10:04:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![KuriGohan\_And\_Kameha](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/k/da6949/32.png) [@KuriGohan\_And\_Kameha](https://forum.sambapos.com/u/KuriGohan_And_Kameha)\
**Post date:** [May 25, 2017, 10:04am UTC](https://forum.sambapos.com/t/bulk-product-and-inventory-importer-for-latest-sambapos-version/14932/1 "2017-05-25T10:04:24Z")

</div>

Hi all,

I would like to know about this tutorial:

> [@SambaPOS 5 Bulk Product and Inventory Importer](https://forum.sambapos.com/t/sambapos-5-bulk-product-and-inventory-importer/10809):
>
> ##Synopsis This Tool is primarily used as a Bulk Product, Inventory, and Recipe importer based on data read from a CSV file. This is especially useful in Retail applications where there is a direct 1:1 relationship between Items you buy from a supplier and Products you sell. As of this release, this Tool is compatible with the following SambaPOS versions: 5.1.58 - 5.1.60 (DB version 124) ::: [dbops124c.zip](https://forum.sambapos.com/uploads/default/original/3X/d/1/d15e79bb9e88db8c2941bcaaa7c471988b6b466c.zip) (24.6 KB) Originally developed by @JohnS for SambaPOS 3, updates to the Tool were dev…

This was made for database version 124c but we are now on 141, any plans to upgrade this tutorial and webpages?

It does not create inventory on the latest version of SambaPOS db

---

<div class="post-metadata">

**Author:** ![KuriGohan\_And\_Kameha](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/k/da6949/32.png) [@KuriGohan\_And\_Kameha](https://forum.sambapos.com/u/KuriGohan_And_Kameha)\
**Post date:** [May 25, 2017, 10:30am UTC](https://forum.sambapos.com/t/bulk-product-and-inventory-importer-for-latest-sambapos-version/14932/2 "2017-05-25T10:30:16Z")

</div>

I tried using this version but i get this error:

```
[Menu Category] BEARINGS
00008: Inserting: [Barcode] 22-1013 [Product] ALL BALLS STEERING STEM BEARING KIT-30-140-21 (22-1013) ::: [MenuItem] ALL BALLS STEERING STEM BEARING KIT-30-140-21 (22-1013) ... 
INSERTED ::: [Portion] Normal ::: [Price] 91
...... [MenuItem] ALL BALLS STEERING STEM BEARING KIT-30-140-21 (22-1013)
...... [InvItem] 22-1013 - ALL BALLS STEERING STEM BEARING KIT-30-140-21
...... [Recipe.Normal] (SellProd) ALL BALLS STEERING STEM BEARING KIT-30-140-21 (22-1013)
( ! ) Warning: odbc_execute(): SQL error: [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot insert the value NULL into column 'ItemType', table 'HATTECHPOSEVODB.dbo.RecipeItems'; column does not allow nulls. INSERT fails., SQL state 23000 in SQLExecute in C:\wamp64\www\dbops_functions.php on line 69
Call Stack
#	Time	Memory	Function	Location
1	0.0024	318480	{main}( )	...\dbops.php:0
2	0.1408	601416	include( 'C:\wamp64\www\dbops_importproducts.php' )	...\dbops.php:498
3	1.0420	717632	ExecQueryP( )	...\dbops_importproducts.php:1070
4	1.0436	719856	odbc_execute ( )	...\dbops_functions.php:69

23000 [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot insert the value NULL into column 'ItemType', table 'HATTECHPOSEVODB.dbo.RecipeItems'; column does not allow nulls. INSERT fails.
QUERY:
INSERT INTO [RecipeItems] ( [RecipeId] ,[Quantity] ,[InventoryItem_Id] ,[OrderTag] ,[ItemType] ) VALUES (?,?,?,?,?)
QPARMS:
953, 1, 880, , , 
QPARMS:

```

at the first item with inventory to create.

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [May 25, 2017, 10:57am UTC](https://forum.sambapos.com/t/bulk-product-and-inventory-importer-for-latest-sambapos-version/14932/3 "2017-05-25T10:57:40Z")

</div>

> [@KuriGohan\_And\_Kameha](#):
>
> SQL error: [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot insert the value NULL into column ‘ItemType’, table ‘HATTECHPOSEVODB.dbo.RecipeItems’; column does not allow nulls.

Thats obviously the problem;

---

<div class="post-metadata">

**Author:** ![mjb2000](https://forum.sambapos.com/user_avatar/forum.sambapos.com/mjb2000/32/29209_2.png) [@mjb2000](https://forum.sambapos.com/u/mjb2000)\
**Post date:** [May 25, 2017, 12:11pm UTC](https://forum.sambapos.com/t/bulk-product-and-inventory-importer-for-latest-sambapos-version/14932/4 "2017-05-25T12:11:01Z")

</div>

It would be great if we could import inventory and recipes using YAML instead of this important tool.

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [May 25, 2017, 12:45pm UTC](https://forum.sambapos.com/t/bulk-product-and-inventory-importer-for-latest-sambapos-version/14932/5 "2017-05-25T12:45:21Z")

</div>

> [@KuriGohan\_And\_Kameha](#):
>
> i get this error
> 
> SQL error: [Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot insert the value NULL into column ‘ItemType’, table ‘HATTECHPOSEVODB.dbo.RecipeItems’; column does not allow nulls.

Use a text editor to open the file: **`dbops_readfile.php`**

Find this line (around 135):

```auto
$RecipeItemType[$r] = (($RecipeItemType[$r]!=0 && $RecipeItemType[$r]!=1) ? 0 : $RecipeItemType[$r]);

```

Replace that line with this:

```auto
$RecipeItemType[$r] = ((($RecipeItemType[$r]!=0 && $RecipeItemType[$r]!=1) || $RecipeItemType[$r]=='') ? 0 : $RecipeItemType[$r]);

```

Save the file and try again.

* * *

That was noted in the last post in that Topic. I just updated the ZIP file today to contain the fix.

---

<div class="post-metadata">

**Author:** ![KuriGohan\_And\_Kameha](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/k/da6949/32.png) [@KuriGohan\_And\_Kameha](https://forum.sambapos.com/u/KuriGohan_And_Kameha)\
**Post date:** [May 26, 2017, 6:23am UTC](https://forum.sambapos.com/t/bulk-product-and-inventory-importer-for-latest-sambapos-version/14932/6 "2017-05-26T06:23:54Z")

</div>

Thank you very much. I must have missed that post, apologies.
