Recipe in recipe not use only inventory list


How can I add other recipe to into new recipe?
For example:
Recipe : Pizza Margherita - pizza dough (recipe - flour, yeast…), tomato base, mozzarella
Recipe : Pizza Hawaiian - pizza dough (recipe), tomato base, mozzarella, ham, annanas

In each pizza is same pizza dough and I want use only recipe for dough not all ingredients again.
Is it possible?

Thanks Jiri

You can solve it by using order tags. If you read past tutorials you’ll see you can create recipes for pizza modifiers (order tags). You can configure pizza dough as a product modifier, create a recipe for it and configure it as a default modifier so it gets selected automatically.

Here are the brief steps;

  • Create products for pizza dough, tomato base, mozzarella, ham, ananas, etc. Set their product group as something like Pizza Ingredients. Don’t add them to your menu since you don’t need to see them as buttons.
  • Create related inventory items.
  • Create recipes for these half products.
  • Create product for Pizza Hawaiian.
  • Create a recipe for Pizza Hawaiian. You can leave this recipe empty since we have separate recipe for dough.
  • Create Order tags for pizza Hawaiian as pizza dough, tomato base, etc. Mark this order tag group as Hidden.
  • Map these Order tags to related products.
  • Edit Menu > Edit Product Properties to define default order tags. So dough, tomato base, etc should be selected automatically.
  • Configure your receipt templates to exclude Pizza Ingredients so they won’t appear on receipts.

Instead of creating separate products for dough and tomato base you can merge them to a single product.

We recently applied it to one of the biggest pizza restaurant chains in Turkey. It works pretty fine.


It is little bit complicated, but it will working. Thanks

The solution above will not enable people to make inventory counts of these ‘half products’, so I’m hoping there’s another way to do this.

I want to have two departments (Kitchen and Restaurant) where the products in the Kitchen department become inventory items for the Restaurant department.
So, the Kitchen department would have its own inventory (ingredients) which is used to make these ‘half products’ which are then used as inventory in the Restaurant department.

For example if it were a pizza restaurant, the dough would be made in the Kitchen department, using an ‘order’ of the product Pizza Dough, which would be gifted automatically. At completion of the order, the inventory item Pizza Dough should be automatically increased in the Kitchen department.
Then, the ‘half products’ are either moved to the Restaurant department through inventory transactions, or this could happen automatically (if storage of these ‘half products’ is in a shared place for both departments).

Does anybody have any ideas or tips on how to do this (automatic gifting of products in the Kitchen department, automatic increasing of associated inventory items and automatic inventory transactions after completion of order)?

1 Like

Ok, I already found how to do the first part, automatically gifting all items in the Kitchen department:

Make a rule for when new orders are added, to mark them as gifts:

Map the rule to the Kitchen department:

1 Like

found a way to do part two as well, although I had to use some scripting and database manipulation (made for SambaPOS 3 with SQL Server, can be used in V4 or without SQL server with some adaption):

I created stored procedures in SQL server to make Inventory Transaction Documents and Inventory Transactions:

USE SambaPOS3;
– ================================================
IF OBJECT_ID (N’dbo.NewInventoryItemTransactionDocument’) IS NOT NULL
DROP PROCEDURE dbo.NewInventoryItemTransactionDocument
– ================================================
– =============================================
CREATE PROCEDURE NewInventoryItemTransactionDocument
– Add the parameters for the stored procedure here

– SET NOCOUNT ON added to prevent extra result sets from
– interfering with SELECT statements.

-- Insert statements for procedure here
INSERT INTO dbo.InventoryTransactionDocuments
VALUES (GETDATE(), convert(varchar, GETDATE(),113));



USE SambaPOS3;
– ================================================
IF OBJECT_ID (N’dbo.NewInventoryTransaction’) IS NOT NULL
DROP PROCEDURE dbo.NewInventoryTransaction
– ================================================
– =============================================

CREATE PROCEDURE NewInventoryTransaction
– Add the parameters for the stored procedure here
@InventoryTransactionDocumentID int,
@InventoryTransactionType int,
@Quantity decimal(16,3),
@Price decimal (16,2),
@InventoryItemID int
– SET NOCOUNT ON added to prevent extra result sets from
– interfering with SELECT statements.

-- Insert statements for procedure here
DECLARE @SourceWarehouseID int
SELECT @SourceWarehouseID = DefaultSourceWarehouseId
FROM InventoryTransactionTypes
WHERE Id = @InventoryTransactionType
DECLARE @TargetWarehouseID int
SELECT @TargetWarehouseID = DefaultTargetWarehouseId
FROM InventoryTransactionTypes
WHERE Id = @InventoryTransactionType
DECLARE @unit nvarchar(max)
SELECT @unit = TransactionUnit
FROM InventoryItems
WHERE Id = @InventoryItemID
DECLARE @Multiplier int
SELECT @Multiplier = TransactionUnitMultiplier
FROM InventoryItems
WHERE Id = @InventoryItemID
INSERT INTO dbo.InventoryTransactions
VALUES (@InventoryTransactionDocumentID, 


Then I made a batch file to access these stored procedures (AddInventory.bat):


set InventoryName=%1
set InventoryAmount=%2

set InventoryTransactionType=4
set SName=localhost\SAMBAPOS3
set DbName=SambaPOS3
set UserName=“sa”
set Password=“mypassword”
set ERRFILE=“C:\SambaPOS3\_ErrFile_Report.txt”

if exist %ERRFILE% del %ERRFILE%

::----------find the InventoryItem ID--------------------------
set SQL=“SELECT ID FROM InventoryItems WHERE Name = ‘%InventoryName%’”
sqlcmd -S %SName% -d %DbName% -U %UserName% -P %Password% -I -h-1 -Q %SQL% > result.txt
set /p InventoryItemID=< result.txt
if “%InventoryItemID:~0,1%” equ " " (
set InventoryItemID=%InventoryItemID:~1%
goto :trimLeadingSpace

::----------make new inventory transaction document, get its ID
sqlcmd -S %SName% -d %DbName% -U %UserName% -P %Password% -I -h-1 -Q “exec NewInventoryItemTransactionDocument” > result.txt
set /p TransactionDocumentID=< result.txt
if “%TransactionDocumentID:~0,1%” equ " " (
set TransactionDocumentID=%TransactionDocumentID:~1%
goto :trimLeadingSpace2

::----------make new inventory transaction---------------------
sqlcmd -S %SName% -d %DbName% -U %UserName% -P %Password% -I -Q “exec NewInventoryTransaction $(p1), $(p2), $(p3), $(p4), $(p5)” /v p1=%TransactionDocumentID% p2=%InventoryTransactionType% p3=%InventoryAmount% p4=‘0’ p5=%InventoryItemID%

The parts in bold will have to be changed for other people:

  • InventoryTransactionType should be the ID of the InventoryTransactionType for a purchase (you can create a new one for ‘half product creation transaction’ and check its ID in SQL server)
  • SName is the name of your SQL Server instance
  • DBName is the name of your database

Then I created an action to call this batch file:

Then I added a rule to gift the product and make an inventory transaction when an order is added:

with mapping only for the Kitchen department:

and a rule to decrease the inventory (make an inverse inventory transaction) when an order is cancelled:

(also with mapping only to Kitchen department)

And that’s pretty much it. Now I can ‘sell’ things in my Kitchen department (for free), which automatically creates inventory for these ‘half products’, and keeps track of the inventory of ingredients used at the same time. I can keep track of ingredient inventory and ‘half product’ inventory in the Warehouse screen, do end-of-day records, etc…

It’s important though to name the products in the Kitchen department the same as the inventory item associated with it.

1 Like

wow… I’m impressed. I even don’t know what tables we have on SQL Server side. While implementing custom reports I started studying them :slight_smile:

I have to say, I only tried to figure out the tables that I needed until now, there’s quite a few that I don’t understand yet, especially the ones concerning parts of SambaPOS that I haven’t looked at yet, like Change payment types, Calculation types, Calculation selectors, Price templates, Tax definitions, etc.

I have another problem with this setup described above, I can’t figure out how to disable the plus and minus buttons and the Change Price buttons in the payment screen for the Kitchen department.

If users click on the plus or minus button, this system doesn’t work (changed amount doesn’t get updated in the inventory of the new half-product). Therefore I want to either disable them or at least have a way to intercept the click through an event/rule. I haven’t found any way to do this though.

Any suggestions?

There must be some kind of event triggered when that plus or minus button are hit, no? @Emre? I can’t find these buttons in the Automation Command list, or in the Rule list, is there really no way to intercept when the button is clicked (or at least disable them)?
I thought I could use the Ticket Total Changed event, but that one doesn’t seem to get triggered when I click the plus button…

Is there a way to create InventoryTransactions using Actions rather than using a batch script? I’ve set this up, and it’s working, but it feels clunky.

There are no Create Inventory Transaction or Create Inventory Transaction Document actions, so no, this is not possible at this time.
I am working on a newer version of the script which will create the transactions after the ticket is closed by going through all the orders of the ticket (which will make it a bit less clunky). I will post it when it’s finished.
In order to not need a script for all this, we would need the Inventory transaction actions, but also some way to loop through the orders in a ticket within SambaPOS.

I assume it’ll still use the bat file?

The issue with the bat file is security… the password for the user is saved in plain text. This can be overcome somewhat by creating a SQL user that only has read permissions, and execute SP permissions on the SP’s you made.

You can just convert the .bat file to an exe if you are concerned with someone grabbing the password. You can also run it hidden. Or you can store it on a jump drive that only you have access too and run it from there. Several methods that make the security risk a non issue.

Just an option you may be aware of: you could use a trusted connection (-E) where the DB login is performed using the Windows User Account. That way you don’t need to supply the password in the BAT file…

sqlcmd -S %SName% -E -d %DbName% -I -i %SQL% >> %ERRFILE% 2>&1

Yeah, the login/password thing is something I haven’t quite figured out yet… Obviously I don’t want to leave my password in a batch file (I’m still in testing phase), but then the problem with trusted connections is exactly that it’s linked to your windows login… Which means that every user that needs access to SambaPOS basically has full access to the whole database anyways… At least with “non-trusted connections” there’s still ways to restrict access…
I guess it’s very important to make sure no users have access to anything but SambaPOS (group policies?).
For now I think @Jesse’s suggestion seems like the closest solution (although probably still hackable if they really know what they’re doing).

Unless anybody knows a better solution for this?

I think we should discuss these kind of issues more and add a ‘Security’ chapter in the documentation, this would probably be an important part of anybody’s setup…