Missing error logs, system crashes on end work period and view warehouse

I have written a php application to import new items, update the inventory and change the stock levels. I have looked at the SambaPOS bulk importer topics (JohnS) and my code is very similar. When I import an item via the php app, everything looks fine: inventory, recipe, warehouse, product etc. The warehouse shows the items transferred from a supplier warehouse to the local one. Everything works fine. Then if I try to sell one of the items (through the normal SambaPOS payment screens) I get errors. The system crashes when I try and view the warehouse, end the work period or look at inventory reports. This is the only error message I get:

The error log in [My Documents]\SambaPOS5\log.txt have no record of the error.

I have tried everything I can think of to debug/troubleshoot but can find no broken links in the DB. Is there another way I can debug this or see what is broken? Can anyone give me any clues as to what might be wrong? Please help…!

Try switching on Detailed Logging. It might not help catch the error in your local log, but something might be sent to SambaPOS Team.

Ending a WP and using the Warehouses Screen both deal with calculation of Cost based on Consumption via Menu Items sold which have a Recipe tied to Inventory Item(s). So a good guess is that one or more of your DB Tables is messed up, and likely one of those that your PHP application touches.

You should probably try using SQL Profiler to see what is going on in the DB when you navigate to the Warehouses Screen. It is part of SSMS.

1 Like

Thank you so much…I am fairly new to mssql (I’ve mostly used Mysql). The SQL Server Profiler is a really useful tool which has helped me find the bug in my code. I ran the sequence of events on SambaPOS and traced all the SQL queries it generated through the profiler. I was then able to see (very small) differences in my php/sql code (I think it was a missing NULL value that was causing the problem).

Thank you for taking the time to help me and teaching me a new trick…

1 Like