This document will help you perform delete transactions for scenarios where there is heavy data in the back-office, like bills and transactions. This is performed when clicking the Delete transaction button under Maintenance takes a long time and results in a crash.
The only difference in this procedure is that it will be performed in the root shell (Raspberry) or from MySQL client (Windows)
Steps #
1. Go to the root (Ctrl+Alt+F1, user: root, password: saleculator)
2. From the root type mysql -u root -p and press the Enter key
3. When asked for a password type password
4. Type use SALECULATOR; and press the Enter key
5. Copy-Paste the below lines and press the Enter key
SET foreign_key_checks = 0;
TRUNCATE TABLE DELIVERYORDERS;
TRUNCATE TABLE CALLS;
TRUNCATE TABLE TICKETLINES;
TRUNCATE TABLE TAXLINES;
TRUNCATE TABLE TICKETS;
TRUNCATE TABLE PAYMENTS;
TRUNCATE TABLE RECEIPTS;
TRUNCATE TABLE CLOSEDCASH;
TRUNCATE TABLE STOCKDIARY;
TRUNCATE TABLE RESERVATIONS;
SET foreign_key_checks = 1;
Pressing the Enter key after the above lines will delete the old transactions and data.
6. Copy-Paste the below lines and press the Enter key
UPDATE TICKETSNUM SET ID = 0;
UPDATE TICKETSNUM_REFUND SET ID = 0;
UPDATE TICKETSNUM_PAYMENT SET ID = 0;
Pressing the Enter key after the above lines will reset the receipt numbers to start from 1. (You can also perform this action by executing the line UPDATE TICKETSNUM SET ID = 0; from Execute SQL under Maintenance.)
7. Press Ctrl+C to exit out of the MySQL prompt
8. Type reboot and press the Enter key
Leave a Reply