Bulk Product And Inventory Importer for latest SambaPOS version?

Hi all,

I would like to know about this tutorial:

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

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.

Thats obviously the problem;

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

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

Find this line (around 135):

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

Replace that line with this:

$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.

3 Likes

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