FOR DB CLEAN UP

TRUNCATE `box`;
TRUNCATE `cash`;
TRUNCATE `category`;
TRUNCATE `discount`;
TRUNCATE `discount_history`;
TRUNCATE `main_category`;
TRUNCATE `merge_sell`;
TRUNCATE `merge_sell_ids`;
TRUNCATE `operation`;
TRUNCATE `operation_history`;
TRUNCATE `operation_logs`;
TRUNCATE `operation_option`;
TRUNCATE `operation_option_history`;
TRUNCATE `option`;
TRUNCATE `option_product`;
TRUNCATE `product`;
TRUNCATE `product_option`;
TRUNCATE `printer`;
TRUNCATE `sell`;
TRUNCATE `sell_history`;
TRUNCATE `sell_invoice`;
TRUNCATE `sell_logs`;
TRUNCATE `sell_logs_new`;
TRUNCATE `sell_payment`;
TRUNCATE `xreport`;
TRUNCATE `xreport_banknotes`;
TRUNCATE `xreport_payment`;
TRUNCATE `email_configuration`;
TRUNCATE `item`;
TRUNCATE `item_zone`;
TRUNCATE `section`;
TRUNCATE `t`;

---------------------------------------------------------------------------------------------------------------------------------------

FILES CLEAN UP

images
storage/configuration
storage/products
tmp/reports
tmp/totals
tmp/z-report

mail_log.txt
report_x_z_log.txt
db_backup_logs.txt
cron_job_logs.txt

---------------------------------------------------------------------------------------------------------------------------------------

CHANGING BACKOFFICE LINKS IN POS

LOCAL
UPDATE `autoload_configuration` SET `value` = 'http://localhost/backoffice_accounting/en/sidsApi/?' WHERE `id` = 2;
UPDATE `autoload_configuration` SET `value` = 'http://localhost/backoffice_accounting/' WHERE `id` = 3;
UPDATE `autoload_configuration` SET `value` = 'http://localhost/backoffice_accounting/' WHERE `id` = 4;

STAGGING
UPDATE `autoload_configuration` SET `value` = 'https://backoffice.dev.trackerteer.com/en/sidsApi/?' WHERE `id` = 2;
UPDATE `autoload_configuration` SET `value` = 'http://backoffice.dev.trackerteer.com/' WHERE `id` = 3;
UPDATE `autoload_configuration` SET `value` = 'https://backoffice.dev.trackerteer.com/' WHERE `id` = 4;

PRODUCTION LIVE
UPDATE `autoload_configuration` SET `value` = 'https://backoffice.trackerteer.com/en/sidsApi/?' WHERE `id` = 2;
UPDATE `autoload_configuration` SET `value` = 'http://backoffice.trackerteer.com/' WHERE `id` = 3;
UPDATE `autoload_configuration` SET `value` = 'https://backoffice.trackerteer.com/' WHERE `id` = 4;

STAGGING BACKOFFICE PHP 8
UPDATE `autoload_configuration` SET `value` = 'https://stagingbackoffice.trackerteer.com/en/sidsApi/?' WHERE `id` = 2;
UPDATE `autoload_configuration` SET `value` = 'http://stagingbackoffice.trackerteer.com/' WHERE `id` = 3;
UPDATE `autoload_configuration` SET `value` = 'https://stagingbackoffice.trackerteer.com/' WHERE `id` = 4;

---------------------------------------------------------------------------------------------------------------------------------------

DISABLED TUTORIAL

UPDATE `tutorial_modules` SET status = 'D';
TRUNCATE `tutorial`;

---------------------------------------------------------------------------------------------------------------------------------------

COPY POS BACKOFFICE MENU

# COPY MAIN CAT
UPDATE rck_main_category_store b 
INNER JOIN rck_main_category_store a ON a.main_category_id = b.main_category_id AND a.store_id = 96
SET b.status = a.status
WHERE b.store_id = 108;

# COPY SUB CAT
UPDATE rck_category_store b 
INNER JOIN rck_category_store a ON a.category_id = b.category_id AND a.store_id = 96
SET b.status = a.status
WHERE b.store_id = 108;

# COPY PRODUCTS
UPDATE rck_product_store b 
INNER JOIN rck_product_store a ON a.product_id = b.product_id AND a.store_id = 96
SET b.status = a.status
WHERE b.store_id = 108;

---------------------------------------------------------------------------------------------------------------------------------------

RESET BACKOFFICE SYNCED DATA FROM POS

Note: Update store_id

DELETE FROM rck_sell WHERE store_id = 119;
DELETE FROM rck_sell_customer WHERE store_id = 119;
DELETE FROM rck_sell_products WHERE store_id = 119;
DELETE FROM rck_sell_payment WHERE store_id = 119;
DELETE FROM rck_zreport WHERE store_id = 119;
DELETE FROM rck_zreport_product_sync WHERE store_id = 119;
DELETE FROM rck_products WHERE store_id = 119;
DELETE FROM rck_discount_history WHERE store_id = 119;
DELETE FROM rck_pos_customer WHERE store_id = 119;