-- phpMyAdmin SQL Dump
-- version 5.2.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 04, 2026 at 10:47 AM
-- Server version: 10.11.16-MariaDB
-- PHP Version: 8.4.19

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `demo_pos`
--

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

--
-- Table structure for table `accounting_accounts`
--

CREATE TABLE `accounting_accounts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `account_id` varchar(255) DEFAULT NULL,
  `name` varchar(191) NOT NULL,
  `gl_code` varchar(191) DEFAULT NULL,
  `business_id` int(11) NOT NULL,
  `account_primary_type` varchar(191) DEFAULT NULL,
  `account_sub_type_id` bigint(20) DEFAULT NULL,
  `detail_type_id` bigint(20) DEFAULT NULL,
  `parent_account_id` bigint(20) DEFAULT NULL,
  `description` longtext DEFAULT NULL,
  `status` varchar(191) DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `account_type` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `accounting_accounts`
--

INSERT INTO `accounting_accounts` (`id`, `account_id`, `name`, `gl_code`, `business_id`, `account_primary_type`, `account_sub_type_id`, `detail_type_id`, `parent_account_id`, `description`, `status`, `created_by`, `created_at`, `updated_at`, `account_type`) VALUES
(2018, '427', 'supplier1', NULL, 1, 'liability', 6, 58, NULL, NULL, 'active', 1, '2026-04-02 16:20:41', '2026-04-02 16:20:41', NULL),
(2019, '428', 'supplier2', NULL, 1, 'liability', 6, 58, NULL, NULL, 'active', 1, '2026-04-02 16:23:41', '2026-04-02 16:23:41', NULL),
(2020, '429', 'supplier3', NULL, 1, 'liability', 6, 58, NULL, NULL, 'active', 1, '2026-04-02 16:25:18', '2026-04-02 16:25:18', NULL),
(2021, '430', 'customer1', NULL, 1, 'asset', 1, 16, NULL, NULL, 'active', 1, '2026-04-02 16:29:25', '2026-04-02 16:29:25', NULL),
(2022, '431', 'customer2 discount', NULL, 1, 'asset', 1, 16, NULL, NULL, 'active', 1, '2026-04-02 16:30:51', '2026-04-02 16:30:51', NULL);

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

--
-- Table structure for table `accounting_accounts_transactions`
--

CREATE TABLE `accounting_accounts_transactions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `accounting_account_id` bigint(20) UNSIGNED NOT NULL,
  `acc_trans_mapping_id` int(11) DEFAULT NULL COMMENT 'id form accounting_acc_trans_mapping table',
  `transaction_id` int(11) DEFAULT NULL COMMENT 'id form transactions table',
  `transaction_payment_id` int(11) DEFAULT NULL COMMENT 'id form transaction_payments table',
  `amount` decimal(22,4) NOT NULL,
  `type` varchar(100) NOT NULL COMMENT 'debit, credit etc',
  `sub_type` varchar(100) NOT NULL,
  `map_type` varchar(100) DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `operation_date` datetime NOT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `accounting_accounts_transactions`
--

INSERT INTO `accounting_accounts_transactions` (`id`, `accounting_account_id`, `acc_trans_mapping_id`, `transaction_id`, `transaction_payment_id`, `amount`, `type`, `sub_type`, `map_type`, `created_by`, `operation_date`, `note`, `created_at`, `updated_at`) VALUES
(825, 2019, NULL, NULL, NULL, 10000.0000, 'credit', 'opening_balance', NULL, 1, '2026-04-02 22:23:41', NULL, '2026-04-02 16:23:41', '2026-04-02 16:23:41'),
(826, 2020, NULL, NULL, NULL, 500.0000, 'credit', 'opening_balance', NULL, 1, '2026-04-02 22:25:18', NULL, '2026-04-02 16:25:18', '2026-04-02 16:25:18'),
(827, 2021, NULL, NULL, NULL, 5000.0000, 'debit', 'opening_balance', NULL, 1, '2026-04-02 22:29:25', NULL, '2026-04-02 16:29:25', '2026-04-02 16:29:25');

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

--
-- Table structure for table `accounting_account_types`
--

CREATE TABLE `accounting_account_types` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `business_id` int(11) DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `account_primary_type` varchar(191) DEFAULT NULL,
  `account_type` varchar(191) DEFAULT NULL,
  `parent_id` bigint(20) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `show_balance` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `accounting_account_types`
--

INSERT INTO `accounting_account_types` (`id`, `name`, `business_id`, `created_by`, `account_primary_type`, `account_type`, `parent_id`, `description`, `show_balance`, `created_at`, `updated_at`) VALUES
(1, 'accounts_receivable', NULL, NULL, 'asset', 'sub_type', NULL, NULL, 0, NULL, NULL),
(2, 'current_assets', NULL, NULL, 'asset', 'sub_type', NULL, NULL, 1, NULL, NULL),
(3, 'cash_and_cash_equivalents', NULL, NULL, 'asset', 'sub_type', NULL, NULL, 1, NULL, NULL),
(4, 'fixed_assets', NULL, NULL, 'asset', 'sub_type', NULL, NULL, 1, NULL, NULL),
(5, 'non_current_assets', NULL, NULL, 'asset', 'sub_type', NULL, NULL, 1, NULL, NULL),
(6, 'accounts_payable', NULL, NULL, 'liability', 'sub_type', NULL, NULL, 0, NULL, NULL),
(7, 'credit_card', NULL, NULL, 'liability', 'sub_type', NULL, NULL, 1, NULL, NULL),
(8, 'current_liabilities', NULL, NULL, 'liability', 'sub_type', NULL, NULL, 1, NULL, NULL),
(9, 'non_current_liabilities', NULL, NULL, 'liability', 'sub_type', NULL, NULL, 1, NULL, NULL),
(10, 'owners_equity', NULL, NULL, 'equity', 'sub_type', NULL, NULL, 1, NULL, NULL),
(11, 'income', NULL, NULL, 'income', 'sub_type', NULL, NULL, 0, NULL, NULL),
(12, 'other_income', NULL, NULL, 'income', 'sub_type', NULL, NULL, 0, NULL, NULL),
(13, 'cost_of_sale', NULL, NULL, 'expenses', 'sub_type', NULL, NULL, 0, NULL, NULL),
(14, 'expenses', NULL, NULL, 'expenses', 'sub_type', NULL, NULL, 0, NULL, NULL),
(15, 'other_expense', NULL, NULL, 'expenses', 'sub_type', NULL, NULL, 0, NULL, NULL),
(16, 'accounts_receivable', NULL, NULL, NULL, 'detail_type', 1, '', 1, NULL, NULL),
(17, 'allowance_for_bad_debts', NULL, NULL, NULL, 'detail_type', 2, 'allowance_for_bad_debts_desc', 1, NULL, NULL),
(18, 'assets_available_for_sale', NULL, NULL, NULL, 'detail_type', 2, 'assets_available_for_sale_desc', 1, NULL, NULL),
(19, 'development_costs', NULL, NULL, NULL, 'detail_type', 2, 'development_costs_desc', 1, NULL, NULL),
(20, 'employee_cash_advances', NULL, NULL, NULL, 'detail_type', 2, 'employee_cash_advances_desc', 1, NULL, NULL),
(21, 'inventory', NULL, NULL, NULL, 'detail_type', 2, 'inventory_desc', 1, NULL, NULL),
(22, 'investments_-_other', NULL, NULL, NULL, 'detail_type', 2, 'investments_-_other_desc', 1, NULL, NULL),
(23, 'loans_to_officers', NULL, NULL, NULL, 'detail_type', 2, 'loans_to_officers_desc', 1, NULL, NULL),
(24, 'loans_to_others', NULL, NULL, NULL, 'detail_type', 2, 'loans_to_others_desc', 1, NULL, NULL),
(25, 'loans_to_shareholders', NULL, NULL, NULL, 'detail_type', 2, 'loans_to_shareholders_desc', 1, NULL, NULL),
(26, 'other_current_assets', NULL, NULL, NULL, 'detail_type', 2, 'other_current_assets_desc', 1, NULL, NULL),
(27, 'prepaid_expenses', NULL, NULL, NULL, 'detail_type', 2, 'prepaid_expenses_desc', 1, NULL, NULL),
(28, 'retainage', NULL, NULL, NULL, 'detail_type', 2, 'retainage_desc', 1, NULL, NULL),
(29, 'undeposited_funds', NULL, NULL, NULL, 'detail_type', 2, 'undeposited_funds_desc', 1, NULL, NULL),
(30, 'bank', NULL, NULL, NULL, 'detail_type', 3, 'bank_desc', 1, NULL, NULL),
(31, 'cash_and_cash_equivalents', NULL, NULL, NULL, 'detail_type', 3, 'cash_and_cash_equivalents_desc', 1, NULL, NULL),
(32, 'cash_on_hand', NULL, NULL, NULL, 'detail_type', 3, 'cash_on_hand_desc', 1, NULL, NULL),
(33, 'client_trust_account', NULL, NULL, NULL, 'detail_type', 3, 'client_trust_account_desc', 1, NULL, NULL),
(34, 'money_market', NULL, NULL, NULL, 'detail_type', 3, 'money_market_desc', 1, NULL, NULL),
(35, 'rents_held_in_trust', NULL, NULL, NULL, 'detail_type', 3, 'rents_held_in_trust_desc', 1, NULL, NULL),
(36, 'savings', NULL, NULL, NULL, 'detail_type', 3, 'savings_desc', 1, NULL, NULL),
(37, 'accumulated_depletion', NULL, NULL, NULL, 'detail_type', 4, 'accumulated_depletion_desc', 1, NULL, NULL),
(38, 'accumulated_depreciation_on_property,_plant_and_equipment', NULL, NULL, NULL, 'detail_type', 4, 'accumulated_depreciation_on_property,_plant_and_equipment_desc', 1, NULL, NULL),
(39, 'buildings', NULL, NULL, NULL, 'detail_type', 4, 'buildings_desc', 1, NULL, NULL),
(40, 'depletable_assets', NULL, NULL, NULL, 'detail_type', 4, 'depletable_assets_desc', 1, NULL, NULL),
(41, 'furniture_and_fixtures', NULL, NULL, NULL, 'detail_type', 4, 'furniture_and_fixtures_desc', 1, NULL, NULL),
(42, 'land', NULL, NULL, NULL, 'detail_type', 4, 'land_desc', 1, NULL, NULL),
(43, 'leasehold_improvements', NULL, NULL, NULL, 'detail_type', 4, 'leasehold_improvements_desc', 1, NULL, NULL),
(44, 'machinery_and_equipment', NULL, NULL, NULL, 'detail_type', 4, 'machinery_and_equipment_desc', 1, NULL, NULL),
(45, 'other_fixed_assets', NULL, NULL, NULL, 'detail_type', 4, 'other_fixed_assets_desc', 1, NULL, NULL),
(46, 'vehicles', NULL, NULL, NULL, 'detail_type', 4, 'vehicles_desc', 1, NULL, NULL),
(47, 'accumulated_amortisation_of_non-current_assets', NULL, NULL, NULL, 'detail_type', 5, 'accumulated_amortisation_of_non-current_assets_desc', 1, NULL, NULL),
(48, 'assets_held_for_sale', NULL, NULL, NULL, 'detail_type', 5, 'assets_held_for_sale_desc', 1, NULL, NULL),
(49, 'deferred_tax', NULL, NULL, NULL, 'detail_type', 5, 'deferred_tax_desc', 1, NULL, NULL),
(50, 'goodwill', NULL, NULL, NULL, 'detail_type', 5, 'goodwill_desc', 1, NULL, NULL),
(51, 'intangible_assets', NULL, NULL, NULL, 'detail_type', 5, 'intangible_assets_desc', 1, NULL, NULL),
(52, 'lease_buyout', NULL, NULL, NULL, 'detail_type', 5, 'lease_buyout_desc', 1, NULL, NULL),
(53, 'licences', NULL, NULL, NULL, 'detail_type', 5, 'licences_desc', 1, NULL, NULL),
(54, 'long-term_investments', NULL, NULL, NULL, 'detail_type', 5, 'long-term_investments_desc', 1, NULL, NULL),
(55, 'organisational_costs', NULL, NULL, NULL, 'detail_type', 5, 'organisational_costs_desc', 1, NULL, NULL),
(56, 'other_non-current_assets', NULL, NULL, NULL, 'detail_type', 5, 'other_non-current_assets_desc', 1, NULL, NULL),
(57, 'security_deposits', NULL, NULL, NULL, 'detail_type', 5, 'security_deposits_desc', 1, NULL, NULL),
(58, 'accounts_payable_(a/p)', NULL, NULL, NULL, 'detail_type', 6, 'accounts_payable_(a/p)_desc', 1, NULL, NULL),
(59, 'credit_card', NULL, NULL, NULL, 'detail_type', 7, 'credit_card_desc', 1, NULL, NULL),
(60, 'accrued_liabilities', NULL, NULL, NULL, 'detail_type', 8, 'accrued_liabilities_desc', 1, NULL, NULL),
(61, 'client_trust_accounts_-_liabilities', NULL, NULL, NULL, 'detail_type', 8, 'client_trust_accounts_-_liabilities_desc', 1, NULL, NULL),
(62, 'current_tax_liability', NULL, NULL, NULL, 'detail_type', 8, 'current_tax_liability_desc', 1, NULL, NULL),
(63, 'current_portion_of_obligations_under_finance_leases', NULL, NULL, NULL, 'detail_type', 8, 'current_portion_of_obligations_under_finance_leases_desc', 1, NULL, NULL),
(64, 'dividends_payable', NULL, NULL, NULL, 'detail_type', 8, 'dividends_payable_desc', 1, NULL, NULL),
(65, 'income_tax_payable', NULL, NULL, NULL, 'detail_type', 8, 'income_tax_payable_desc', 1, NULL, NULL),
(66, 'insurance_payable', NULL, NULL, NULL, 'detail_type', 8, 'insurance_payable_desc', 1, NULL, NULL),
(67, 'line_of_credit', NULL, NULL, NULL, 'detail_type', 8, 'line_of_credit_desc', 1, NULL, NULL),
(68, 'loan_payable', NULL, NULL, NULL, 'detail_type', 8, 'loan_payable_desc', 1, NULL, NULL),
(69, 'other_current_liabilities', NULL, NULL, NULL, 'detail_type', 8, 'other_current_liabilities_desc', 1, NULL, NULL),
(70, 'payroll_clearing', NULL, NULL, NULL, 'detail_type', 8, 'payroll_clearing_desc', 1, NULL, NULL),
(71, 'payroll_liabilities', NULL, NULL, NULL, 'detail_type', 8, 'payroll_liabilities_desc', 1, NULL, NULL),
(72, 'prepaid_expenses_payable', NULL, NULL, NULL, 'detail_type', 8, 'prepaid_expenses_payable_desc', 1, NULL, NULL),
(73, 'rents_in_trust_-_liability', NULL, NULL, NULL, 'detail_type', 8, 'rents_in_trust_-_liability_desc', 1, NULL, NULL),
(74, 'sales_and_service_tax_payable', NULL, NULL, NULL, 'detail_type', 8, 'sales_and_service_tax_payable_desc', 1, NULL, NULL),
(75, 'accrued_holiday_payable', NULL, NULL, NULL, 'detail_type', 9, 'accrued_holiday_payable_desc', 1, NULL, NULL),
(76, 'accrued_non-current_liabilities', NULL, NULL, NULL, 'detail_type', 9, 'accrued_non-current_liabilities_desc', 1, NULL, NULL),
(77, 'liabilities_related_to_assets_held_for_sale', NULL, NULL, NULL, 'detail_type', 9, 'liabilities_related_to_assets_held_for_sale_desc', 1, NULL, NULL),
(78, 'long-term_debt', NULL, NULL, NULL, 'detail_type', 9, 'long-term_debt_desc', 1, NULL, NULL),
(79, 'notes_payable', NULL, NULL, NULL, 'detail_type', 9, 'notes_payable_desc', 1, NULL, NULL),
(80, 'other_non-current_liabilities', NULL, NULL, NULL, 'detail_type', 9, 'other_non-current_liabilities_desc', 1, NULL, NULL),
(81, 'shareholder_notes_payable', NULL, NULL, NULL, 'detail_type', 9, 'shareholder_notes_payable_desc', 1, NULL, NULL),
(82, 'accumulated_adjustment', NULL, NULL, NULL, 'detail_type', 10, 'accumulated_adjustment_desc', 1, NULL, NULL),
(83, 'dividend_disbursed', NULL, NULL, NULL, 'detail_type', 10, 'dividend_disbursed_desc', 1, NULL, NULL),
(84, 'equity_in_earnings_of_subsidiaries', NULL, NULL, NULL, 'detail_type', 10, 'equity_in_earnings_of_subsidiaries_desc', 1, NULL, NULL),
(85, 'opening_balance_equity', NULL, NULL, NULL, 'detail_type', 10, 'opening_balance_equity_desc', 1, NULL, NULL),
(86, 'ordinary_shares', NULL, NULL, NULL, 'detail_type', 10, 'ordinary_shares_desc', 1, NULL, NULL),
(87, 'other_comprehensive_income', NULL, NULL, NULL, 'detail_type', 10, 'other_comprehensive_income_desc', 1, NULL, NULL),
(88, 'owner\'s_equity', NULL, NULL, NULL, 'detail_type', 10, 'owner\'s_equity_desc', 1, NULL, NULL),
(89, 'paid-in_capital_or_surplus', NULL, NULL, NULL, 'detail_type', 10, 'paid-in_capital_or_surplus_desc', 1, NULL, NULL),
(90, 'partner_contributions', NULL, NULL, NULL, 'detail_type', 10, 'partner_contributions_desc', 1, NULL, NULL),
(91, 'partner_distributions', NULL, NULL, NULL, 'detail_type', 10, 'partner_distributions_desc', 1, NULL, NULL),
(92, 'partner\'s_equity', NULL, NULL, NULL, 'detail_type', 10, 'partner\'s_equity_desc', 1, NULL, NULL),
(93, 'preferred_shares', NULL, NULL, NULL, 'detail_type', 10, 'preferred_shares_desc', 1, NULL, NULL),
(94, 'retained_earnings', NULL, NULL, NULL, 'detail_type', 10, 'retained_earnings_desc', 1, NULL, NULL),
(95, 'share_capital', NULL, NULL, NULL, 'detail_type', 10, 'share_capital_desc', 1, NULL, NULL),
(96, 'treasury_shares', NULL, NULL, NULL, 'detail_type', 10, 'treasury_shares_desc', 1, NULL, NULL),
(97, 'discounts/refunds_given', NULL, NULL, NULL, 'detail_type', 11, 'discounts/refunds_given_desc', 1, NULL, NULL),
(98, 'non-profit_income', NULL, NULL, NULL, 'detail_type', 11, 'non-profit_income_desc', 1, NULL, NULL),
(99, 'other_primary_income', NULL, NULL, NULL, 'detail_type', 11, 'other_primary_income_desc', 1, NULL, NULL),
(100, 'revenue_-_general', NULL, NULL, NULL, 'detail_type', 11, 'revenue_-_general_desc', 1, NULL, NULL),
(101, 'sales_-_retail', NULL, NULL, NULL, 'detail_type', 11, 'sales_-_retail_desc', 1, NULL, NULL),
(102, 'sales_-_wholesale', NULL, NULL, NULL, 'detail_type', 11, 'sales_-_wholesale_desc', 1, NULL, NULL),
(103, 'sales_of_product_income', NULL, NULL, NULL, 'detail_type', 11, 'sales_of_product_income_desc', 1, NULL, NULL),
(104, 'service/fee_income', NULL, NULL, NULL, 'detail_type', 11, 'service/fee_income_desc', 1, NULL, NULL),
(105, 'unapplied_cash_payment_income', NULL, NULL, NULL, 'detail_type', 11, 'unapplied_cash_payment_income_desc', 1, NULL, NULL),
(106, 'dividend_income', NULL, NULL, NULL, 'detail_type', 12, 'dividend_income_desc', 1, NULL, NULL),
(107, 'interest_earned', NULL, NULL, NULL, 'detail_type', 12, 'interest_earned_desc', 1, NULL, NULL),
(108, 'loss_on_disposal_of_assets', NULL, NULL, NULL, 'detail_type', 12, 'loss_on_disposal_of_assets_desc', 1, NULL, NULL),
(109, 'other_investment_income', NULL, NULL, NULL, 'detail_type', 12, 'other_investment_income_desc', 1, NULL, NULL),
(110, 'other_miscellaneous_income', NULL, NULL, NULL, 'detail_type', 12, 'other_miscellaneous_income_desc', 1, NULL, NULL),
(111, 'other_operating_income', NULL, NULL, NULL, 'detail_type', 12, 'other_operating_income_desc', 1, NULL, NULL),
(112, 'tax-exempt_interest', NULL, NULL, NULL, 'detail_type', 12, 'tax-exempt_interest_desc', 1, NULL, NULL),
(113, 'unrealised_loss_on_securities,_net_of_tax', NULL, NULL, NULL, 'detail_type', 12, 'unrealised_loss_on_securities,_net_of_tax_desc', 1, NULL, NULL),
(114, 'cost_of_labour_-_cos', NULL, NULL, NULL, 'detail_type', 13, 'cost_of_labour_-_cos_desc', 1, NULL, NULL),
(115, 'equipment_rental_-_cos', NULL, NULL, NULL, 'detail_type', 13, 'equipment_rental_-_cos_desc', 1, NULL, NULL),
(116, 'freight_and_delivery_-_cos', NULL, NULL, NULL, 'detail_type', 13, 'freight_and_delivery_-_cos_desc', 1, NULL, NULL),
(117, 'other_costs_of_sales_-_cos', NULL, NULL, NULL, 'detail_type', 13, 'other_costs_of_sales_-_cos_desc', 1, NULL, NULL),
(118, 'supplies_and_materials_-_cos', NULL, NULL, NULL, 'detail_type', 13, 'supplies_and_materials_-_cos_desc', 1, NULL, NULL),
(119, 'advertising/promotional', NULL, NULL, NULL, 'detail_type', 14, 'advertising/promotional_desc', 1, NULL, NULL),
(120, 'amortisation_expense', NULL, NULL, NULL, 'detail_type', 14, 'amortisation_expense_desc', 1, NULL, NULL),
(121, 'auto', NULL, NULL, NULL, 'detail_type', 14, 'auto_desc', 1, NULL, NULL),
(122, 'bad_debts', NULL, NULL, NULL, 'detail_type', 14, 'bad_debts_desc', 1, NULL, NULL),
(123, 'bank_charges', NULL, NULL, NULL, 'detail_type', 14, 'bank_charges_desc', 1, NULL, NULL),
(124, 'charitable_contributions', NULL, NULL, NULL, 'detail_type', 14, 'charitable_contributions_desc', 1, NULL, NULL),
(125, 'commissions_and_fees', NULL, NULL, NULL, 'detail_type', 14, 'commissions_and_fees_desc', 1, NULL, NULL),
(126, 'cost_of_labour', NULL, NULL, NULL, 'detail_type', 14, 'cost_of_labour_desc', 1, NULL, NULL),
(127, 'dues_and_subscriptions', NULL, NULL, NULL, 'detail_type', 14, 'dues_and_subscriptions_desc', 1, NULL, NULL),
(128, 'equipment_rental', NULL, NULL, NULL, 'detail_type', 14, 'equipment_rental_desc', 1, NULL, NULL),
(129, 'finance_costs', NULL, NULL, NULL, 'detail_type', 14, 'finance_costs_desc', 1, NULL, NULL),
(130, 'income_tax_expense', NULL, NULL, NULL, 'detail_type', 14, 'income_tax_expense_desc', 1, NULL, NULL),
(131, 'insurance', NULL, NULL, NULL, 'detail_type', 14, 'insurance_desc', 1, NULL, NULL),
(132, 'interest_paid', NULL, NULL, NULL, 'detail_type', 14, 'interest_paid_desc', 1, NULL, NULL),
(133, 'legal_and_professional_fees', NULL, NULL, NULL, 'detail_type', 14, 'legal_and_professional_fees_desc', 1, NULL, NULL),
(134, 'loss_on_discontinued_operations,_net_of_tax', NULL, NULL, NULL, 'detail_type', 14, 'loss_on_discontinued_operations,_net_of_tax_desc', 1, NULL, NULL),
(135, 'management_compensation', NULL, NULL, NULL, 'detail_type', 14, 'management_compensation_desc', 1, NULL, NULL),
(136, 'meals_and_entertainment', NULL, NULL, NULL, 'detail_type', 14, 'meals_and_entertainment_desc', 1, NULL, NULL),
(137, 'office/general_administrative_expenses', NULL, NULL, NULL, 'detail_type', 14, 'office/general_administrative_expenses_desc', 1, NULL, NULL),
(138, 'other_miscellaneous_service_cost', NULL, NULL, NULL, 'detail_type', 14, 'other_miscellaneous_service_cost_desc', 1, NULL, NULL),
(139, 'other_selling_expenses', NULL, NULL, NULL, 'detail_type', 14, 'other_selling_expenses_desc', 1, NULL, NULL),
(140, 'payroll_expenses', NULL, NULL, NULL, 'detail_type', 14, 'payroll_expenses_desc', 1, NULL, NULL),
(141, 'rent_or_lease_of_buildings', NULL, NULL, NULL, 'detail_type', 14, 'rent_or_lease_of_buildings_desc', 1, NULL, NULL),
(142, 'repair_and_maintenance', NULL, NULL, NULL, 'detail_type', 14, 'repair_and_maintenance_desc', 1, NULL, NULL),
(143, 'shipping_and_delivery_expense', NULL, NULL, NULL, 'detail_type', 14, 'shipping_and_delivery_expense_desc', 1, NULL, NULL),
(144, 'supplies_and_materials', NULL, NULL, NULL, 'detail_type', 14, 'supplies_and_materials_desc', 1, NULL, NULL),
(145, 'taxes_paid', NULL, NULL, NULL, 'detail_type', 14, 'taxes_paid_desc', 1, NULL, NULL),
(146, 'travel_expenses_-_general_and_admin_expenses', NULL, NULL, NULL, 'detail_type', 14, 'travel_expenses_-_general_and_admin_expenses_desc', 1, NULL, NULL),
(147, 'travel_expenses_-_selling_expense', NULL, NULL, NULL, 'detail_type', 14, 'travel_expenses_-_selling_expense_desc', 1, NULL, NULL),
(148, 'unapplied_cash_bill_payment_expense', NULL, NULL, NULL, 'detail_type', 14, 'unapplied_cash_bill_payment_expense_desc', 1, NULL, NULL),
(149, 'utilities', NULL, NULL, NULL, 'detail_type', 14, 'utilities_desc', 1, NULL, NULL),
(150, 'amortisation', NULL, NULL, NULL, 'detail_type', 15, 'amortisation_desc', 1, NULL, NULL),
(151, 'depreciation', NULL, NULL, NULL, 'detail_type', 15, 'depreciation_desc', 1, NULL, NULL),
(152, 'exchange_gain_or_loss', NULL, NULL, NULL, 'detail_type', 15, 'exchange_gain_or_loss_desc', 1, NULL, NULL),
(153, 'other_expense', NULL, NULL, NULL, 'detail_type', 15, 'other_expense_desc', 1, NULL, NULL),
(154, 'penalties_and_settlements', NULL, NULL, NULL, 'detail_type', 15, 'penalties_and_settlements_desc', 1, NULL, NULL),
(169, 'direct_expenses', 9, 16, 'expenses', 'sub_type', NULL, NULL, 0, '2025-04-29 11:49:06', '2025-04-29 11:49:06'),
(170, 'direct_expenses', 9, 16, NULL, 'detail_type', 169, 'direct_expenses_desc', 1, '2025-04-29 11:49:06', '2025-04-29 11:49:06'),
(171, 'indirect_expenses', 9, 16, 'expenses', 'sub_type', NULL, NULL, 0, '2025-04-29 11:49:06', '2025-04-29 11:49:06'),
(172, 'indirect_expenses', 9, 16, NULL, 'detail_type', 171, 'direct_expenses_desc', 1, '2025-04-29 11:49:06', '2025-04-29 11:49:06'),
(177, 'direct_expenses', 1, 1, 'expenses', 'sub_type', NULL, NULL, 0, '2025-06-01 08:28:14', '2025-06-01 08:28:14'),
(178, 'direct_expenses', 1, 1, NULL, 'detail_type', 177, 'direct_expenses_desc', 1, '2025-06-01 08:28:14', '2025-06-01 08:28:14'),
(179, 'indirect_expenses', 1, 1, 'expenses', 'sub_type', NULL, NULL, 0, '2025-06-01 08:28:14', '2025-06-01 08:28:14'),
(180, 'indirect_expenses', 1, 1, NULL, 'detail_type', 179, 'direct_expenses_desc', 1, '2025-06-01 08:28:14', '2025-06-01 08:28:14');

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

--
-- Table structure for table `accounting_acc_trans_mappings`
--

CREATE TABLE `accounting_acc_trans_mappings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `ref_no` varchar(100) NOT NULL,
  `type` varchar(100) NOT NULL,
  `created_by` int(11) NOT NULL,
  `operation_date` datetime NOT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `accounting_acc_trans_mappings`
--

INSERT INTO `accounting_acc_trans_mappings` (`id`, `business_id`, `ref_no`, `type`, `created_by`, `operation_date`, `note`, `created_at`, `updated_at`) VALUES
(367, 1, 'PO2026/0001', 'journal_entry', 1, '2026-04-03 00:23:00', NULL, '2026-04-02 18:27:50', '2026-04-02 18:27:50'),
(368, 1, 'PO2026/0002', 'journal_entry', 1, '2026-04-03 00:31:00', NULL, '2026-04-02 18:33:39', '2026-04-02 18:33:39'),
(369, 1, 'PO2026/0003', 'journal_entry', 1, '2026-04-03 00:35:00', NULL, '2026-04-02 18:37:03', '2026-04-02 18:37:03');

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

--
-- Table structure for table `accounting_budgets`
--

CREATE TABLE `accounting_budgets` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `accounting_account_id` bigint(20) UNSIGNED NOT NULL,
  `financial_year` int(11) NOT NULL,
  `jan` decimal(22,4) DEFAULT NULL,
  `feb` decimal(22,4) DEFAULT NULL,
  `mar` decimal(22,4) DEFAULT NULL,
  `apr` decimal(22,4) DEFAULT NULL,
  `may` decimal(22,4) DEFAULT NULL,
  `jun` decimal(22,4) DEFAULT NULL,
  `jul` decimal(22,4) DEFAULT NULL,
  `aug` decimal(22,4) DEFAULT NULL,
  `sep` decimal(22,4) DEFAULT NULL,
  `oct` decimal(22,4) DEFAULT NULL,
  `nov` decimal(22,4) DEFAULT NULL,
  `dec` decimal(22,4) DEFAULT NULL,
  `quarter_1` decimal(22,4) DEFAULT NULL,
  `quarter_2` decimal(22,4) DEFAULT NULL,
  `quarter_3` decimal(22,4) DEFAULT NULL,
  `quarter_4` decimal(22,4) DEFAULT NULL,
  `yearly` decimal(22,4) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `accounts`
--

CREATE TABLE `accounts` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `name` varchar(191) NOT NULL,
  `account_number` varchar(191) NOT NULL,
  `account_details` text DEFAULT NULL,
  `account_type_id` int(11) DEFAULT NULL,
  `note` text DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `is_closed` tinyint(1) NOT NULL DEFAULT 0,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `accounts`
--

INSERT INTO `accounts` (`id`, `business_id`, `name`, `account_number`, `account_details`, `account_type_id`, `note`, `created_by`, `is_closed`, `deleted_at`, `created_at`, `updated_at`) VALUES
(22, 1, 'Cash in  Hand', '1001', '[{\"label\":null,\"value\":null},{\"label\":null,\"value\":null},{\"label\":null,\"value\":null},{\"label\":null,\"value\":null},{\"label\":null,\"value\":null},{\"label\":null,\"value\":null}]', 0, NULL, 1, 0, NULL, '2025-10-05 17:10:55', '2025-10-05 17:10:55'),
(35, 1, 'Bank 1 edittt', '420420', '[{\"label\":\"123\",\"value\":\"1\"},{\"label\":null,\"value\":null},{\"label\":null,\"value\":null},{\"label\":null,\"value\":null},{\"label\":null,\"value\":null},{\"label\":null,\"value\":null}]', 3, NULL, 1, 0, NULL, '2026-04-02 16:32:44', '2026-04-02 16:35:07'),
(36, 1, 'UCB POS Machine', '21321321321', '[{\"label\":null,\"value\":null},{\"label\":null,\"value\":null},{\"label\":null,\"value\":null},{\"label\":null,\"value\":null},{\"label\":null,\"value\":null},{\"label\":null,\"value\":null}]', 3, NULL, 1, 0, NULL, '2026-04-02 16:34:01', '2026-04-02 16:34:01');

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

--
-- Table structure for table `account_transactions`
--

CREATE TABLE `account_transactions` (
  `id` int(10) UNSIGNED NOT NULL,
  `account_id` int(11) NOT NULL,
  `type` enum('debit','credit') NOT NULL,
  `sub_type` enum('opening_balance','fund_transfer','deposit') DEFAULT NULL,
  `amount` decimal(22,4) NOT NULL,
  `reff_no` varchar(191) DEFAULT NULL,
  `operation_date` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `transaction_id` int(11) DEFAULT NULL,
  `transaction_payment_id` int(11) DEFAULT NULL,
  `transfer_transaction_id` int(11) DEFAULT NULL,
  `note` text DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `account_transactions`
--

INSERT INTO `account_transactions` (`id`, `account_id`, `type`, `sub_type`, `amount`, `reff_no`, `operation_date`, `created_by`, `transaction_id`, `transaction_payment_id`, `transfer_transaction_id`, `note`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1575, 35, 'credit', 'opening_balance', 10000.0000, NULL, '2026-04-02 22:32:44', 1, NULL, NULL, NULL, NULL, NULL, '2026-04-02 16:32:44', '2026-04-02 16:32:44'),
(1576, 22, 'credit', 'deposit', 500.0000, NULL, '2026-04-02 22:34:00', 1, NULL, NULL, NULL, NULL, NULL, '2026-04-02 16:34:55', '2026-04-02 16:34:55'),
(1577, 22, 'debit', 'fund_transfer', 10.0000, NULL, '2026-04-02 23:27:00', 1, NULL, NULL, 1578, 'test', NULL, '2026-04-02 17:27:47', '2026-04-02 17:27:47'),
(1578, 35, 'credit', 'fund_transfer', 10.0000, NULL, '2026-04-02 23:27:00', 1, NULL, NULL, 1577, 'test', NULL, '2026-04-02 17:27:47', '2026-04-02 17:27:47'),
(1579, 22, 'debit', NULL, 1004950.0000, NULL, '2026-04-03 00:30:00', 1, 3377, 1965, NULL, NULL, NULL, '2026-04-02 18:31:10', '2026-04-02 18:31:10'),
(1580, 22, 'debit', NULL, 10000.0000, NULL, '2026-04-03 00:31:00', 1, 3378, 1966, NULL, NULL, NULL, '2026-04-02 18:33:39', '2026-04-02 18:33:39'),
(1581, 22, 'debit', NULL, 89000.0000, NULL, '2026-04-03 00:33:00', 1, 3378, 1967, NULL, NULL, NULL, '2026-04-02 18:34:12', '2026-04-02 18:34:12');

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

--
-- Table structure for table `account_types`
--

CREATE TABLE `account_types` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `parent_account_type_id` int(11) DEFAULT NULL,
  `business_id` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `account_types`
--

INSERT INTO `account_types` (`id`, `name`, `parent_account_type_id`, `business_id`, `created_at`, `updated_at`) VALUES
(3, 'Current AC edit', NULL, 1, '2026-04-02 16:31:50', '2026-04-02 16:32:14'),
(4, 'Savings AC', NULL, 1, '2026-04-02 16:32:02', '2026-04-02 16:32:02');

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

--
-- Table structure for table `activity_log`
--

CREATE TABLE `activity_log` (
  `id` int(10) UNSIGNED NOT NULL,
  `log_name` varchar(191) DEFAULT NULL,
  `description` text NOT NULL,
  `subject_id` int(11) DEFAULT NULL,
  `subject_type` varchar(191) DEFAULT NULL,
  `event` varchar(191) DEFAULT NULL,
  `business_id` int(11) DEFAULT NULL,
  `causer_id` int(11) DEFAULT NULL,
  `causer_type` varchar(191) DEFAULT NULL,
  `properties` text DEFAULT NULL,
  `batch_uuid` char(36) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `activity_log`
--

INSERT INTO `activity_log` (`id`, `log_name`, `description`, `subject_id`, `subject_type`, `event`, `business_id`, `causer_id`, `causer_type`, `properties`, `batch_uuid`, `created_at`, `updated_at`) VALUES
(4098, 'default', 'login', 1, 'App\\User', NULL, 1, 1, 'App\\User', '[]', NULL, '2026-04-02 15:26:00', '2026-04-02 15:26:00'),
(4099, 'default', 'logout', 1, 'App\\User', NULL, 1, 1, 'App\\User', '[]', NULL, '2026-04-02 15:28:06', '2026-04-02 15:28:06'),
(4100, 'default', 'login', 1, 'App\\User', NULL, 1, 1, 'App\\User', '[]', NULL, '2026-04-02 15:28:21', '2026-04-02 15:28:21'),
(4101, 'default', 'logout', 1, 'App\\User', NULL, 1, 1, 'App\\User', '[]', NULL, '2026-04-02 15:29:23', '2026-04-02 15:29:23'),
(4102, 'default', 'login', 1, 'App\\User', NULL, 1, 1, 'App\\User', '[]', NULL, '2026-04-02 15:29:30', '2026-04-02 15:29:30'),
(4103, 'default', 'logout', 1, 'App\\User', NULL, 1, 1, 'App\\User', '[]', NULL, '2026-04-02 15:29:39', '2026-04-02 15:29:39'),
(4104, 'default', 'login', 1, 'App\\User', NULL, 1, 1, 'App\\User', '[]', NULL, '2026-04-02 15:40:48', '2026-04-02 15:40:48'),
(4105, 'default', 'added', 34, 'App\\User', NULL, 1, 1, 'App\\User', '{\"name\":\" branch manager1 \"}', NULL, '2026-04-02 16:19:31', '2026-04-02 16:19:31'),
(4106, 'default', 'edited', 34, 'App\\User', NULL, 1, 1, 'App\\User', '{\"name\":\" branch manager1 edit \"}', NULL, '2026-04-02 16:19:52', '2026-04-02 16:19:52'),
(4107, 'default', 'added', 427, 'App\\Contact', NULL, 1, 1, 'App\\User', '[]', NULL, '2026-04-02 16:20:41', '2026-04-02 16:20:41'),
(4108, 'default', 'added', 428, 'App\\Contact', NULL, 1, 1, 'App\\User', '[]', NULL, '2026-04-02 16:23:41', '2026-04-02 16:23:41'),
(4109, 'default', 'added', 429, 'App\\Contact', NULL, 1, 1, 'App\\User', '[]', NULL, '2026-04-02 16:25:18', '2026-04-02 16:25:18'),
(4110, 'default', 'added', 430, 'App\\Contact', NULL, 1, 1, 'App\\User', '[]', NULL, '2026-04-02 16:29:25', '2026-04-02 16:29:25'),
(4111, 'default', 'added', 431, 'App\\Contact', NULL, 1, 1, 'App\\User', '[]', NULL, '2026-04-02 16:30:52', '2026-04-02 16:30:52'),
(4112, 'default', 'added', 3376, 'App\\Transaction', NULL, 1, 1, 'App\\User', '[]', NULL, '2026-04-02 18:19:45', '2026-04-02 18:19:45'),
(4113, 'default', 'shipping_edited', 3376, 'App\\Transaction', NULL, 1, 1, 'App\\User', '{\"update_note\":null}', NULL, '2026-04-02 18:21:06', '2026-04-02 18:21:06'),
(4114, 'default', 'status_updated', 3376, 'App\\Transaction', NULL, 1, 1, 'App\\User', '{\"from\":\"ordered\",\"to\":\"partial\"}', NULL, '2026-04-02 18:21:34', '2026-04-02 18:21:34'),
(4115, 'default', 'status_updated', 3376, 'App\\Transaction', NULL, 1, 1, 'App\\User', '{\"from\":\"partial\",\"to\":\"completed\"}', NULL, '2026-04-02 18:21:51', '2026-04-02 18:21:51'),
(4116, 'default', 'added', 3377, 'App\\Transaction', NULL, 1, 1, 'App\\User', '{\"attributes\":{\"type\":\"purchase\",\"status\":\"received\",\"payment_status\":\"due\",\"final_total\":1004950}}', NULL, '2026-04-02 18:27:50', '2026-04-02 18:27:50'),
(4117, 'default', 'payment_edited', 3377, 'App\\Transaction', NULL, 1, 1, 'App\\User', '{\"attributes\":{\"type\":\"purchase\",\"status\":\"received\",\"payment_status\":\"paid\",\"final_total\":\"1004950.0000\"},\"old\":{\"type\":\"purchase\",\"status\":\"received\",\"payment_status\":\"due\",\"final_total\":\"1004950.0000\"}}', NULL, '2026-04-02 18:31:10', '2026-04-02 18:31:10'),
(4118, 'default', 'added', 3378, 'App\\Transaction', NULL, 1, 1, 'App\\User', '{\"attributes\":{\"type\":\"purchase\",\"status\":\"received\",\"payment_status\":\"due\",\"final_total\":600000}}', NULL, '2026-04-02 18:33:39', '2026-04-02 18:33:39'),
(4119, 'default', 'payment_edited', 3378, 'App\\Transaction', NULL, 1, 1, 'App\\User', '{\"attributes\":{\"type\":\"purchase\",\"status\":\"received\",\"payment_status\":\"partial\",\"final_total\":\"600000.0000\"},\"old\":{\"type\":\"purchase\",\"status\":\"received\",\"payment_status\":\"partial\",\"final_total\":\"600000.0000\"}}', NULL, '2026-04-02 18:34:12', '2026-04-02 18:34:12'),
(4120, 'default', 'added', 3379, 'App\\Transaction', NULL, 1, 1, 'App\\User', '{\"attributes\":{\"type\":\"purchase\",\"status\":\"received\",\"payment_status\":\"due\",\"final_total\":90000}}', NULL, '2026-04-02 18:37:03', '2026-04-02 18:37:03'),
(4121, 'default', 'logout', 1, 'App\\User', NULL, 1, 1, 'App\\User', '[]', NULL, '2026-04-02 18:56:56', '2026-04-02 18:56:56'),
(4122, 'default', 'login', 1, 'App\\User', NULL, 1, 1, 'App\\User', '[]', NULL, '2026-04-03 17:30:12', '2026-04-03 17:30:12');

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

--
-- Table structure for table `advanced_report_configurations`
--

CREATE TABLE `advanced_report_configurations` (
  `id` int(10) UNSIGNED NOT NULL,
  `report_type` varchar(50) NOT NULL,
  `report_name` varchar(100) NOT NULL,
  `columns` longtext DEFAULT NULL,
  `filters` longtext DEFAULT NULL,
  `settings` longtext DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` int(10) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `advanced_report_exports`
--

CREATE TABLE `advanced_report_exports` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `report_type` varchar(50) NOT NULL,
  `file_name` varchar(255) NOT NULL,
  `file_path` varchar(500) DEFAULT NULL,
  `export_format` varchar(20) NOT NULL DEFAULT 'excel',
  `filters` longtext DEFAULT NULL,
  `total_records` int(11) NOT NULL DEFAULT 0,
  `status` enum('pending','processing','completed','failed') NOT NULL DEFAULT 'pending',
  `error_message` longtext DEFAULT NULL,
  `started_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `created_by` int(10) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `advanced_report_saved_filters`
--

CREATE TABLE `advanced_report_saved_filters` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `report_type` varchar(50) NOT NULL,
  `filter_name` varchar(100) NOT NULL,
  `filter_data` longtext NOT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `advanced_report_schedules`
--

CREATE TABLE `advanced_report_schedules` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `report_type` varchar(50) NOT NULL,
  `name` varchar(100) NOT NULL,
  `filters` longtext DEFAULT NULL,
  `frequency` enum('daily','weekly','monthly','quarterly') NOT NULL,
  `email_recipients` longtext DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `last_run_at` timestamp NULL DEFAULT NULL,
  `next_run_at` timestamp NULL DEFAULT NULL,
  `created_by` int(10) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `aiassistance_history`
--

CREATE TABLE `aiassistance_history` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `tool_type` varchar(191) NOT NULL,
  `input_data` text DEFAULT NULL,
  `tokens_used` int(11) NOT NULL DEFAULT 0,
  `output_data` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_audit_log`
--

CREATE TABLE `ar_audit_log` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `action_type` enum('create','update','delete','post','reverse','reconcile','rebuild','lock_period','unlock_period') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_type` enum('journal_entry','account','fifo_layer','reconciliation','period_lock','ledger_rollup') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_id` int(10) UNSIGNED DEFAULT NULL,
  `old_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `new_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `ar_bank_accounts`
--

CREATE TABLE `ar_bank_accounts` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `account_name` varchar(191) NOT NULL,
  `account_type` enum('liability','asset') NOT NULL DEFAULT 'asset' COMMENT 'Liability or Asset',
  `bank_name` varchar(191) DEFAULT NULL,
  `account_number` varchar(191) DEFAULT NULL,
  `ifsc_code` varchar(191) DEFAULT NULL,
  `branch_name` varchar(191) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `linked_account_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'Link to accounts table for bank-book integration',
  `opening_balance` decimal(15,2) NOT NULL DEFAULT 0.00,
  `opening_date` date DEFAULT NULL,
  `opening_balance_transaction_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'Reference to account_transactions table for opening balance',
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_bank_reconciliation`
--

CREATE TABLE `ar_bank_reconciliation` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `account_id` int(10) UNSIGNED NOT NULL COMMENT 'Bank account from ar_chart_of_accounts',
  `journal_entry_line_id` bigint(20) UNSIGNED DEFAULT NULL,
  `account_transaction_id` int(10) UNSIGNED DEFAULT NULL,
  `transaction_date` date NOT NULL,
  `amount` decimal(22,4) NOT NULL,
  `reference` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_cleared` tinyint(1) NOT NULL DEFAULT 0,
  `cleared_date` date DEFAULT NULL,
  `cleared_by` int(10) UNSIGNED DEFAULT NULL,
  `bank_statement_ref` varchar(255) DEFAULT NULL,
  `bank_statement_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_budgets`
--

CREATE TABLE `ar_budgets` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `account_id` int(10) UNSIGNED DEFAULT NULL,
  `location_id` int(10) UNSIGNED DEFAULT NULL,
  `budget_name` varchar(191) NOT NULL,
  `fiscal_year` varchar(10) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `month_01` decimal(20,2) NOT NULL DEFAULT 0.00,
  `month_02` decimal(20,2) NOT NULL DEFAULT 0.00,
  `month_03` decimal(20,2) NOT NULL DEFAULT 0.00,
  `month_04` decimal(20,2) NOT NULL DEFAULT 0.00,
  `month_05` decimal(20,2) NOT NULL DEFAULT 0.00,
  `month_06` decimal(20,2) NOT NULL DEFAULT 0.00,
  `month_07` decimal(20,2) NOT NULL DEFAULT 0.00,
  `month_08` decimal(20,2) NOT NULL DEFAULT 0.00,
  `month_09` decimal(20,2) NOT NULL DEFAULT 0.00,
  `month_10` decimal(20,2) NOT NULL DEFAULT 0.00,
  `month_11` decimal(20,2) NOT NULL DEFAULT 0.00,
  `month_12` decimal(20,2) NOT NULL DEFAULT 0.00,
  `notes` text DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_capital_accounts`
--

CREATE TABLE `ar_capital_accounts` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `account_name` varchar(191) NOT NULL,
  `account_type` varchar(191) NOT NULL DEFAULT 'owner' COMMENT 'owner, partner, shareholder, etc.',
  `description` text DEFAULT NULL,
  `opening_balance` decimal(15,2) NOT NULL DEFAULT 0.00,
  `current_balance` decimal(15,2) NOT NULL DEFAULT 0.00,
  `opening_date` date DEFAULT NULL,
  `contact_person` varchar(191) DEFAULT NULL,
  `contact_email` varchar(191) DEFAULT NULL,
  `contact_phone` varchar(191) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_chart_of_accounts`
--

CREATE TABLE `ar_chart_of_accounts` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `code` varchar(50) DEFAULT NULL COMMENT 'Account code (e.g., 1000, 2000)',
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `account_group` varchar(50) NOT NULL COMMENT 'assets_current, assets_non_current, liabilities_current, liabilities_non_current, equity, income, cogs, expenses, other_income, other_expenses',
  `account_type` enum('asset','liability','equity','income','expense','cogs','other') NOT NULL DEFAULT 'asset',
  `parent_id` int(10) UNSIGNED DEFAULT NULL,
  `level` int(11) NOT NULL DEFAULT 0 COMMENT 'Depth in hierarchy (0=root)',
  `path` varchar(500) DEFAULT NULL COMMENT 'Full path for hierarchy queries',
  `is_control_account` tinyint(1) NOT NULL DEFAULT 0,
  `control_type` enum('receivables','payables','inventory','cash','bank','tax','discount','rounding','none') NOT NULL DEFAULT 'none',
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `is_closed` tinyint(1) NOT NULL DEFAULT 0,
  `allow_negative_balance` tinyint(1) NOT NULL DEFAULT 0,
  `requires_contact` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'For AR/AP accounts',
  `account_id` int(10) UNSIGNED DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `updated_by` int(10) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_cheque_books`
--

CREATE TABLE `ar_cheque_books` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `account_id` int(10) UNSIGNED NOT NULL,
  `book_name` varchar(255) NOT NULL COMMENT 'Cheque book name/identifier',
  `book_number` varchar(100) DEFAULT NULL COMMENT 'Cheque book number from bank',
  `start_cheque_no` varchar(100) NOT NULL COMMENT 'Starting cheque number in the book',
  `end_cheque_no` varchar(100) NOT NULL COMMENT 'Ending cheque number in the book',
  `total_cheques` int(10) UNSIGNED NOT NULL COMMENT 'Total number of cheques in the book',
  `status` enum('active','completed','cancelled') NOT NULL DEFAULT 'active',
  `issue_date` date DEFAULT NULL COMMENT 'Date when cheque book was issued/received',
  `expiry_date` date DEFAULT NULL COMMENT 'Expiry date if applicable',
  `location_id` int(10) UNSIGNED DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_cheque_book_entries`
--

CREATE TABLE `ar_cheque_book_entries` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `account_id` int(10) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED DEFAULT NULL,
  `deposit_account_id` int(10) UNSIGNED DEFAULT NULL,
  `bank_account_id` int(10) UNSIGNED DEFAULT NULL,
  `cheque_book_id` int(10) UNSIGNED DEFAULT NULL,
  `cheque_number` varchar(100) NOT NULL,
  `cheque_date` date NOT NULL,
  `amount` decimal(22,4) NOT NULL,
  `type` enum('issued','received') NOT NULL DEFAULT 'issued',
  `status` enum('available','pending','cleared','bounced','cancelled','deposited') DEFAULT 'available',
  `payee_name` varchar(191) DEFAULT NULL COMMENT 'Person/company receiving the cheque',
  `narration` text DEFAULT NULL,
  `reference_no` varchar(191) DEFAULT NULL,
  `transaction_id` int(10) UNSIGNED DEFAULT NULL,
  `transaction_payment_id` int(10) UNSIGNED DEFAULT NULL,
  `source_cheque_id` int(10) UNSIGNED DEFAULT NULL,
  `account_transaction_id` int(10) UNSIGNED DEFAULT NULL,
  `cleared_date` date DEFAULT NULL,
  `presented_date` date DEFAULT NULL,
  `bounced_date` date DEFAULT NULL,
  `bounce_reason` text DEFAULT NULL,
  `bank_statement_ref` varchar(255) DEFAULT NULL,
  `bank_statement_date` date DEFAULT NULL,
  `location_id` int(10) UNSIGNED DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_direct_expenses`
--

CREATE TABLE `ar_direct_expenses` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `amount` decimal(20,2) NOT NULL,
  `expense_date` date NOT NULL,
  `location_id` int(10) UNSIGNED DEFAULT NULL,
  `account_id` int(10) UNSIGNED DEFAULT NULL,
  `reference_no` varchar(191) DEFAULT NULL,
  `document` varchar(191) DEFAULT NULL,
  `payment_amount` decimal(20,2) DEFAULT NULL,
  `payment_method` varchar(191) DEFAULT NULL,
  `payment_account_id` int(10) UNSIGNED DEFAULT NULL,
  `paid_on` datetime DEFAULT NULL,
  `payment_note` varchar(191) DEFAULT NULL,
  `payment_status` varchar(191) DEFAULT 'due',
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_direct_expense_names`
--

CREATE TABLE `ar_direct_expense_names` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_direct_incomes`
--

CREATE TABLE `ar_direct_incomes` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `amount` decimal(20,2) NOT NULL,
  `income_date` date NOT NULL,
  `location_id` int(10) UNSIGNED DEFAULT NULL,
  `account_id` int(10) UNSIGNED DEFAULT NULL,
  `reference_no` varchar(191) DEFAULT NULL,
  `document` varchar(191) DEFAULT NULL,
  `payment_amount` decimal(20,2) DEFAULT NULL,
  `payment_method` varchar(191) DEFAULT NULL,
  `payment_account_id` int(10) UNSIGNED DEFAULT NULL,
  `received_on` datetime DEFAULT NULL,
  `payment_note` varchar(191) DEFAULT NULL,
  `payment_status` varchar(191) DEFAULT 'due',
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_direct_income_names`
--

CREATE TABLE `ar_direct_income_names` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_fifo_layers`
--

CREATE TABLE `ar_fifo_layers` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `variation_id` int(10) UNSIGNED DEFAULT NULL,
  `location_id` int(10) UNSIGNED NOT NULL,
  `transaction_id` int(10) UNSIGNED DEFAULT NULL,
  `transaction_line_id` int(10) UNSIGNED DEFAULT NULL,
  `layer_date` date NOT NULL COMMENT 'Date when this layer was created',
  `quantity` decimal(15,4) NOT NULL DEFAULT 0.0000 COMMENT 'Available quantity in this layer',
  `unit_cost` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Cost per unit for this layer',
  `total_cost` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'quantity * unit_cost',
  `allocated_quantity` decimal(15,4) NOT NULL DEFAULT 0.0000 COMMENT 'Quantity already allocated to sales',
  `status` enum('available','fully_allocated','closed') NOT NULL DEFAULT 'available',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_fixed_assets`
--

CREATE TABLE `ar_fixed_assets` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `purchase_date` date DEFAULT NULL,
  `amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `current_book_value` decimal(15,2) DEFAULT NULL COMMENT 'Current book value after revaluations',
  `accumulated_depreciation` decimal(15,2) NOT NULL DEFAULT 0.00 COMMENT 'Total accumulated depreciation',
  `depreciation_percentage` decimal(5,2) DEFAULT NULL COMMENT 'Depreciation percentage per year',
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_fixed_asset_revaluations`
--

CREATE TABLE `ar_fixed_asset_revaluations` (
  `id` int(10) UNSIGNED NOT NULL,
  `fixed_asset_id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `revaluation_date` date NOT NULL,
  `previous_value` decimal(15,2) NOT NULL,
  `revaluation_amount` decimal(15,2) NOT NULL COMMENT 'New book value after revaluation',
  `revaluation_difference` decimal(15,2) NOT NULL COMMENT 'Difference (revaluation_amount - previous_value)',
  `reason` text DEFAULT NULL COMMENT 'Reason for revaluation',
  `notes` text DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_investments`
--

CREATE TABLE `ar_investments` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `investment_date` date DEFAULT NULL,
  `amount` decimal(15,2) NOT NULL DEFAULT 0.00 COMMENT 'Initial investment amount',
  `current_value` decimal(15,2) DEFAULT NULL COMMENT 'Current market value',
  `investment_type` varchar(191) DEFAULT NULL COMMENT 'e.g., stocks, bonds, mutual funds, commodities, etc.',
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_journal_entry_headers`
--

CREATE TABLE `ar_journal_entry_headers` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `voucher_no` varchar(100) NOT NULL COMMENT 'Unique voucher number (JE-001, SAL-001, etc.)',
  `voucher_date` date NOT NULL,
  `transaction_date` datetime NOT NULL COMMENT 'Actual transaction timestamp',
  `source_module` enum('manual','sale','purchase','expense','payment','receipt','stock_adjustment','opening_balance','return','transfer','reconciliation','revaluation') NOT NULL DEFAULT 'manual',
  `source_transaction_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'Reference to transactions.id',
  `location_id` int(10) UNSIGNED DEFAULT NULL,
  `currency` varchar(3) NOT NULL DEFAULT 'PKR',
  `exchange_rate` decimal(15,6) NOT NULL DEFAULT 1.000000 COMMENT 'Base currency conversion rate',
  `narration` text DEFAULT NULL,
  `reference` text DEFAULT NULL COMMENT 'External reference number',
  `total_debit` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `total_credit` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `is_balanced` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Dr == Cr validation flag',
  `balance_diff` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Dr - Cr (should be 0)',
  `status` enum('draft','posted','cancelled','reversed') NOT NULL DEFAULT 'draft',
  `is_reversed` tinyint(1) NOT NULL DEFAULT 0,
  `reversed_by_journal_id` int(10) UNSIGNED DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `posted_by` int(10) UNSIGNED DEFAULT NULL,
  `posted_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_journal_entry_lines`
--

CREATE TABLE `ar_journal_entry_lines` (
  `id` int(10) UNSIGNED NOT NULL,
  `journal_entry_id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `account_id` int(10) UNSIGNED NOT NULL,
  `debit` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `credit` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `amount` decimal(22,4) NOT NULL COMMENT 'Absolute value (max of debit/credit)',
  `contact_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'Customer/Supplier for AR/AP',
  `product_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'For inventory/COGS',
  `variation_id` int(10) UNSIGNED DEFAULT NULL,
  `tax_id` int(10) UNSIGNED DEFAULT NULL,
  `description` text DEFAULT NULL,
  `reference` varchar(255) DEFAULT NULL,
  `fifo_layer_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'Links to ar_fifo_layers if applicable',
  `line_number` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_ledger_rollups`
--

CREATE TABLE `ar_ledger_rollups` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `account_id` int(10) UNSIGNED NOT NULL,
  `period_date` date NOT NULL COMMENT 'Last day of aggregation period (daily/monthly)',
  `period_type` enum('daily','monthly','yearly') NOT NULL DEFAULT 'daily',
  `opening_debit` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `opening_credit` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `opening_balance` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Dr - Cr (signed)',
  `period_debit` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `period_credit` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `closing_debit` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `closing_credit` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `closing_balance` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Dr - Cr (signed)',
  `location_id` int(10) UNSIGNED DEFAULT NULL,
  `computed_at` datetime NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_loans`
--

CREATE TABLE `ar_loans` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `loan_number` varchar(191) NOT NULL,
  `loan_name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `loan_amount` decimal(20,2) NOT NULL,
  `interest_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `interest_type` enum('flat','reducing') NOT NULL DEFAULT 'flat',
  `loan_date` date NOT NULL,
  `maturity_date` date DEFAULT NULL,
  `lender_name` varchar(191) NOT NULL,
  `lender_contact` varchar(191) DEFAULT NULL,
  `lender_address` text DEFAULT NULL,
  `liability_account_id` int(10) UNSIGNED DEFAULT NULL,
  `payment_account_id` int(10) UNSIGNED DEFAULT NULL,
  `location_id` int(10) UNSIGNED DEFAULT NULL,
  `status` enum('active','closed','defaulted') NOT NULL DEFAULT 'active',
  `principal_paid` decimal(20,2) NOT NULL DEFAULT 0.00,
  `interest_paid` decimal(20,2) NOT NULL DEFAULT 0.00,
  `outstanding_principal` decimal(20,2) NOT NULL,
  `outstanding_interest` decimal(20,2) NOT NULL DEFAULT 0.00,
  `document` varchar(191) DEFAULT NULL,
  `reference_no` varchar(191) DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_loan_transactions`
--

CREATE TABLE `ar_loan_transactions` (
  `id` int(10) UNSIGNED NOT NULL,
  `loan_id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `transaction_number` varchar(191) NOT NULL,
  `transaction_type` enum('loan_receipt','principal_repayment','interest_payment','full_repayment') NOT NULL DEFAULT 'loan_receipt',
  `transaction_date` date NOT NULL,
  `principal_amount` decimal(20,2) NOT NULL DEFAULT 0.00,
  `interest_amount` decimal(20,2) NOT NULL DEFAULT 0.00,
  `total_amount` decimal(20,2) NOT NULL,
  `payment_account_id` int(10) UNSIGNED DEFAULT NULL,
  `payment_method` varchar(191) DEFAULT NULL,
  `cheque_number` varchar(191) DEFAULT NULL,
  `bank_name` varchar(191) DEFAULT NULL,
  `account_transaction_id` int(10) UNSIGNED DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `reference_no` varchar(191) DEFAULT NULL,
  `document` varchar(191) DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_period_locks`
--

CREATE TABLE `ar_period_locks` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `period_start` date NOT NULL,
  `period_end` date NOT NULL,
  `period_type` enum('month','quarter','year') NOT NULL DEFAULT 'month',
  `is_locked` tinyint(1) NOT NULL DEFAULT 0,
  `lock_reason` text DEFAULT NULL,
  `locked_by` int(10) UNSIGNED DEFAULT NULL,
  `locked_at` datetime DEFAULT NULL,
  `unlocked_by` int(10) UNSIGNED DEFAULT NULL,
  `unlocked_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `ar_ratio_snapshots`
--

CREATE TABLE `ar_ratio_snapshots` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `snapshot_date` date NOT NULL,
  `period_type` enum('daily','monthly','quarterly','yearly') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'monthly',
  `current_ratio` decimal(15,4) DEFAULT NULL,
  `quick_ratio` decimal(15,4) DEFAULT NULL,
  `debt_to_equity` decimal(15,4) DEFAULT NULL,
  `interest_coverage` decimal(15,4) DEFAULT NULL,
  `gross_margin` decimal(15,4) DEFAULT NULL,
  `operating_margin` decimal(15,4) DEFAULT NULL,
  `net_margin` decimal(15,4) DEFAULT NULL,
  `roa` decimal(15,4) DEFAULT NULL,
  `roe` decimal(15,4) DEFAULT NULL,
  `inventory_turnover` decimal(15,4) DEFAULT NULL,
  `receivable_days` decimal(15,4) DEFAULT NULL,
  `payable_days` decimal(15,4) DEFAULT NULL,
  `cash_conversion_cycle` decimal(15,4) DEFAULT NULL,
  `sales_growth` decimal(15,4) DEFAULT NULL,
  `gp_growth` decimal(15,4) DEFAULT NULL,
  `pat_growth` decimal(15,4) DEFAULT NULL,
  `raw_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `ar_receivables_payables`
--

CREATE TABLE `ar_receivables_payables` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL,
  `type` enum('receivable','payable') NOT NULL DEFAULT 'receivable',
  `transaction_id` int(10) UNSIGNED NOT NULL,
  `journal_entry_id` int(10) UNSIGNED DEFAULT NULL,
  `document_no` varchar(100) DEFAULT NULL,
  `document_date` date NOT NULL,
  `due_date` date DEFAULT NULL,
  `invoice_amount` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Original invoice/bill amount',
  `allocated_amount` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Total payments/receipts applied',
  `balance` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'invoice_amount - allocated_amount',
  `discount_amount` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `tax_amount` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `status` enum('open','partially_paid','paid','overpaid','written_off','cancelled') NOT NULL DEFAULT 'open',
  `days_past_due` int(11) NOT NULL DEFAULT 0,
  `aging_bucket` enum('current','b0_7','b8_30','b31_60','b61_90','b90_plus') DEFAULT NULL,
  `currency` varchar(3) NOT NULL DEFAULT 'PKR',
  `exchange_rate` decimal(15,6) NOT NULL DEFAULT 1.000000,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `assets`
--

CREATE TABLE `assets` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `asset_code` varchar(191) NOT NULL,
  `name` varchar(191) NOT NULL,
  `quantity` decimal(22,4) NOT NULL,
  `model` varchar(191) DEFAULT NULL,
  `serial_no` varchar(191) DEFAULT NULL,
  `category_id` int(10) UNSIGNED DEFAULT NULL,
  `location_id` int(10) UNSIGNED DEFAULT NULL,
  `purchase_date` date DEFAULT NULL,
  `purchase_type` varchar(191) DEFAULT NULL,
  `unit_price` decimal(22,4) NOT NULL,
  `depreciation` decimal(22,4) DEFAULT NULL,
  `is_allocatable` tinyint(1) NOT NULL DEFAULT 0,
  `description` text DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `asset_maintenances`
--

CREATE TABLE `asset_maintenances` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `asset_id` int(11) NOT NULL,
  `maitenance_id` varchar(191) DEFAULT NULL,
  `status` varchar(191) DEFAULT NULL,
  `priority` varchar(191) DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `assigned_to` int(11) DEFAULT NULL,
  `details` text DEFAULT NULL,
  `maintenance_note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `asset_transactions`
--

CREATE TABLE `asset_transactions` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `asset_id` int(10) UNSIGNED DEFAULT NULL,
  `transaction_type` varchar(191) NOT NULL,
  `ref_no` varchar(191) NOT NULL,
  `receiver` int(10) UNSIGNED DEFAULT NULL COMMENT 'id from users table, who receives asset',
  `quantity` decimal(22,4) NOT NULL,
  `transaction_datetime` datetime NOT NULL,
  `allocated_upto` date DEFAULT NULL,
  `reason` text DEFAULT NULL,
  `parent_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'id from asset_transactions table',
  `created_by` int(10) UNSIGNED NOT NULL COMMENT 'id from users table, who allocated asset',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `asset_warranties`
--

CREATE TABLE `asset_warranties` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `asset_id` int(11) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `additional_cost` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `additional_note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `award_catalog`
--

CREATE TABLE `award_catalog` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED DEFAULT NULL,
  `award_name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `point_threshold` int(11) NOT NULL DEFAULT 0,
  `monetary_value` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `stock_required` tinyint(1) NOT NULL DEFAULT 0,
  `stock_quantity` int(11) NOT NULL DEFAULT 0,
  `award_image` varchar(191) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `award_periods`
--

CREATE TABLE `award_periods` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `period_type` enum('weekly','monthly','yearly') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `period_start` date NOT NULL,
  `period_end` date NOT NULL,
  `is_finalized` tinyint(1) NOT NULL DEFAULT 0,
  `finalized_at` datetime DEFAULT NULL,
  `finalized_by` int(10) UNSIGNED DEFAULT NULL,
  `total_participants` int(11) NOT NULL DEFAULT 0,
  `winners_count` int(11) NOT NULL DEFAULT 0,
  `period_summary` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `backup_logs`
--

CREATE TABLE `backup_logs` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `backup_id` int(10) UNSIGNED DEFAULT NULL,
  `action` enum('create','download','restore','delete','upload_cloud','auto_backup') NOT NULL DEFAULT 'create',
  `status` enum('success','failed','in_progress') NOT NULL DEFAULT 'in_progress',
  `message` text DEFAULT NULL,
  `error_details` text DEFAULT NULL,
  `file_size` int(11) DEFAULT NULL COMMENT 'File size in bytes',
  `ip_address` varchar(191) DEFAULT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `started_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `backup_settings`
--

CREATE TABLE `backup_settings` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `auto_backup_enabled` tinyint(1) NOT NULL DEFAULT 0,
  `backup_frequency` varchar(191) NOT NULL DEFAULT 'daily' COMMENT 'daily, weekly, monthly',
  `backup_time` varchar(191) NOT NULL DEFAULT '02:00' COMMENT 'Time in HH:mm format',
  `backup_day` varchar(191) DEFAULT NULL COMMENT 'Day of week for weekly, day of month for monthly',
  `google_drive_enabled` tinyint(1) NOT NULL DEFAULT 0,
  `google_drive_token` text DEFAULT NULL,
  `google_drive_refresh_token` text DEFAULT NULL,
  `google_drive_folder_id` varchar(191) DEFAULT NULL,
  `keep_local_backups` int(11) NOT NULL DEFAULT 5 COMMENT 'Number of local backups to keep',
  `keep_cloud_backups` int(11) NOT NULL DEFAULT 10 COMMENT 'Number of cloud backups to keep',
  `restore_pin` varchar(191) DEFAULT NULL COMMENT 'Encrypted PIN for restore security',
  `last_backup_at` timestamp NULL DEFAULT NULL,
  `last_cloud_upload_at` timestamp NULL DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `barcodes`
--

CREATE TABLE `barcodes` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `width` double(22,4) DEFAULT NULL,
  `height` double(22,4) DEFAULT NULL,
  `paper_width` double(22,4) DEFAULT NULL,
  `paper_height` double(22,4) DEFAULT NULL,
  `top_margin` double(22,4) DEFAULT NULL,
  `left_margin` double(22,4) DEFAULT NULL,
  `row_distance` double(22,4) DEFAULT NULL,
  `col_distance` double(22,4) DEFAULT NULL,
  `stickers_in_one_row` int(11) DEFAULT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `is_continuous` tinyint(1) NOT NULL DEFAULT 0,
  `stickers_in_one_sheet` int(11) DEFAULT NULL,
  `business_id` int(10) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `barcodes`
--

INSERT INTO `barcodes` (`id`, `name`, `description`, `width`, `height`, `paper_width`, `paper_height`, `top_margin`, `left_margin`, `row_distance`, `col_distance`, `stickers_in_one_row`, `is_default`, `is_continuous`, `stickers_in_one_sheet`, `business_id`, `created_at`, `updated_at`) VALUES
(1, '20 Labels per Sheet', 'Sheet Size: 8.5\" x 11\", Label Size: 4\" x 1\", Labels per sheet: 20', 4.0000, 1.0000, 8.5000, 11.0000, 0.5000, 0.1250, 0.0000, 0.1875, 2, 0, 0, 20, NULL, '2017-12-18 00:13:44', '2017-12-18 00:13:44'),
(2, '30 Labels per sheet', 'Sheet Size: 8.5\" x 11\", Label Size: 2.625\" x 1\", Labels per sheet: 30', 2.6250, 1.0000, 8.5000, 11.0000, 0.5000, 0.1880, 0.0000, 0.1250, 3, 0, 0, 30, NULL, '2017-12-18 00:04:39', '2017-12-18 00:10:40'),
(3, '32 Labels per sheet', 'Sheet Size: 8.5\" x 11\", Label Size: 2\" x 1.25\", Labels per sheet: 32', 2.0000, 1.2500, 8.5000, 11.0000, 0.5000, 0.2500, 0.0000, 0.0000, 4, 0, 0, 32, NULL, '2017-12-17 23:55:40', '2017-12-17 23:55:40'),
(4, '40 Labels per sheet', 'Sheet Size: 8.5\" x 11\", Label Size: 2\" x 1\", Labels per sheet: 40', 2.0000, 1.0000, 8.5000, 11.0000, 0.5000, 0.2500, 0.0000, 0.0000, 4, 0, 0, 40, NULL, '2017-12-17 23:58:40', '2017-12-17 23:58:40'),
(5, '50 Labels per Sheet', 'Sheet Size: 8.5\" x 11\", Label Size: 1.5\" x 1\", Labels per sheet: 50', 1.5000, 1.0000, 8.5000, 11.0000, 0.5000, 0.5000, 0.0000, 0.0000, 5, 0, 0, 50, NULL, '2017-12-17 23:51:10', '2017-12-17 23:51:10'),
(6, 'Continuous Rolls - 31.75mm x 25.4mm', 'Label Size: 31.75mm x 25.4mm, Gap: 3.18mm', 1.2500, 1.0000, 1.2500, 0.0000, 0.1250, 0.0000, 0.1250, 0.0000, 1, 0, 1, NULL, NULL, '2017-12-17 23:51:10', '2017-12-17 23:51:10'),
(7, 'For Qr Code', NULL, 0.9000, 0.9000, 10.0000, 10.0000, 0.0000, 0.0000, 0.1000, 0.1000, 1, 0, 0, 1, 1, '2024-11-02 06:35:28', '2026-01-27 08:30:46');

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

--
-- Table structure for table `bookings`
--

CREATE TABLE `bookings` (
  `id` int(10) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL,
  `waiter_id` int(10) UNSIGNED DEFAULT NULL,
  `table_id` int(10) UNSIGNED DEFAULT NULL,
  `correspondent_id` int(11) DEFAULT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `location_id` int(10) UNSIGNED NOT NULL,
  `booking_start` datetime NOT NULL,
  `booking_end` datetime NOT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `booking_status` varchar(191) NOT NULL,
  `booking_note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `brands`
--

CREATE TABLE `brands` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `use_for_repair` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'brands to be used on repair module',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `brands`
--

INSERT INTO `brands` (`id`, `business_id`, `name`, `description`, `created_by`, `use_for_repair`, `deleted_at`, `created_at`, `updated_at`) VALUES
(145, 1, 'Lux', NULL, 1, 0, NULL, '2026-04-02 15:41:32', '2026-04-02 15:41:32'),
(146, 1, 'Dettol', NULL, 1, 0, NULL, '2026-04-02 15:41:45', '2026-04-02 15:41:45'),
(147, 1, 'Pran', NULL, 1, 0, NULL, '2026-04-02 15:41:53', '2026-04-02 15:41:53'),
(148, 1, 'Samsung', 'SMNSG', 1, 0, NULL, '2026-04-02 17:50:57', '2026-04-02 17:50:57'),
(149, 1, 'Apple', NULL, 1, 0, NULL, '2026-04-02 17:51:05', '2026-04-02 17:51:05'),
(150, 1, 'Oppo', NULL, 1, 0, NULL, '2026-04-02 17:51:12', '2026-04-02 17:51:12');

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

--
-- Table structure for table `business`
--

CREATE TABLE `business` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `currency_id` int(10) UNSIGNED NOT NULL,
  `start_date` date DEFAULT NULL,
  `tax_number_1` varchar(100) DEFAULT NULL,
  `tax_label_1` varchar(10) DEFAULT NULL,
  `tax_number_2` varchar(100) DEFAULT NULL,
  `tax_label_2` varchar(10) DEFAULT NULL,
  `code_label_1` varchar(191) DEFAULT NULL,
  `code_1` varchar(191) DEFAULT NULL,
  `code_label_2` varchar(191) DEFAULT NULL,
  `code_2` varchar(191) DEFAULT NULL,
  `default_sales_tax` int(10) UNSIGNED DEFAULT NULL,
  `default_profit_percent` double(5,2) NOT NULL DEFAULT 0.00,
  `owner_id` int(10) UNSIGNED NOT NULL,
  `time_zone` varchar(191) NOT NULL DEFAULT 'Asia/Kolkata',
  `fy_start_month` tinyint(4) NOT NULL DEFAULT 1,
  `accounting_method` enum('fifo','lifo','avco') NOT NULL DEFAULT 'fifo',
  `default_sales_discount` decimal(5,2) DEFAULT NULL,
  `sell_price_tax` enum('includes','excludes') NOT NULL DEFAULT 'includes',
  `logo` varchar(191) DEFAULT NULL,
  `sku_prefix` varchar(191) DEFAULT NULL,
  `enable_product_expiry` tinyint(1) NOT NULL DEFAULT 0,
  `expiry_type` enum('add_expiry','add_manufacturing') NOT NULL DEFAULT 'add_expiry',
  `on_product_expiry` enum('keep_selling','stop_selling','auto_delete') NOT NULL DEFAULT 'keep_selling',
  `stop_selling_before` int(11) NOT NULL COMMENT 'Stop selling expied item n days before expiry',
  `enable_tooltip` tinyint(1) NOT NULL DEFAULT 1,
  `purchase_in_diff_currency` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Allow purchase to be in different currency then the business currency',
  `purchase_currency_id` int(10) UNSIGNED DEFAULT NULL,
  `p_exchange_rate` decimal(20,3) NOT NULL DEFAULT 1.000,
  `transaction_edit_days` int(10) UNSIGNED NOT NULL DEFAULT 30,
  `stock_expiry_alert_days` int(10) UNSIGNED NOT NULL DEFAULT 30,
  `keyboard_shortcuts` text DEFAULT NULL,
  `pos_settings` text DEFAULT NULL,
  `woocommerce_api_settings` text DEFAULT NULL,
  `woocommerce_skipped_orders` text DEFAULT NULL,
  `woocommerce_wh_oc_secret` varchar(191) DEFAULT NULL,
  `woocommerce_wh_ou_secret` varchar(191) DEFAULT NULL,
  `woocommerce_wh_od_secret` varchar(191) DEFAULT NULL,
  `woocommerce_wh_or_secret` varchar(191) DEFAULT NULL,
  `manufacturing_settings` text DEFAULT NULL,
  `essentials_settings` longtext DEFAULT NULL,
  `weighing_scale_setting` text NOT NULL COMMENT 'used to store the configuration of weighing scale',
  `enable_brand` tinyint(1) NOT NULL DEFAULT 1,
  `enable_category` tinyint(1) NOT NULL DEFAULT 1,
  `enable_sub_category` tinyint(1) NOT NULL DEFAULT 1,
  `enable_price_tax` tinyint(1) NOT NULL DEFAULT 1,
  `enable_purchase_status` tinyint(1) DEFAULT 1,
  `enable_lot_number` tinyint(1) NOT NULL DEFAULT 0,
  `default_unit` int(11) DEFAULT NULL,
  `enable_sub_units` tinyint(1) NOT NULL DEFAULT 0,
  `enable_racks` tinyint(1) NOT NULL DEFAULT 0,
  `enable_row` tinyint(1) NOT NULL DEFAULT 0,
  `enable_position` tinyint(1) NOT NULL DEFAULT 0,
  `enable_editing_product_from_purchase` tinyint(1) NOT NULL DEFAULT 1,
  `sales_cmsn_agnt` enum('logged_in_user','user','cmsn_agnt') DEFAULT NULL,
  `item_addition_method` tinyint(1) NOT NULL DEFAULT 1,
  `enable_inline_tax` tinyint(1) NOT NULL DEFAULT 1,
  `currency_symbol_placement` enum('before','after') NOT NULL DEFAULT 'before',
  `enabled_modules` text DEFAULT NULL,
  `date_format` varchar(191) NOT NULL DEFAULT 'm/d/Y',
  `time_format` enum('12','24') NOT NULL DEFAULT '24',
  `currency_precision` tinyint(4) NOT NULL DEFAULT 2,
  `quantity_precision` tinyint(4) NOT NULL DEFAULT 2,
  `ref_no_prefixes` text DEFAULT NULL,
  `theme_color` char(20) DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `repair_settings` text DEFAULT NULL,
  `repair_jobsheet_settings` text DEFAULT NULL,
  `prj_setting` longtext DEFAULT NULL,
  `asset_settings` text DEFAULT NULL,
  `crm_settings` text DEFAULT NULL,
  `accounting_settings` text DEFAULT NULL,
  `enable_rp` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'rp is the short form of reward points',
  `rp_name` varchar(191) DEFAULT NULL COMMENT 'rp is the short form of reward points',
  `amount_for_unit_rp` decimal(22,4) NOT NULL DEFAULT 1.0000 COMMENT 'rp is the short form of reward points',
  `min_order_total_for_rp` decimal(22,4) NOT NULL DEFAULT 1.0000 COMMENT 'rp is the short form of reward points',
  `max_rp_per_order` int(11) DEFAULT NULL COMMENT 'rp is the short form of reward points',
  `redeem_amount_per_unit_rp` decimal(22,4) NOT NULL DEFAULT 1.0000 COMMENT 'rp is the short form of reward points',
  `min_order_total_for_redeem` decimal(22,4) NOT NULL DEFAULT 1.0000 COMMENT 'rp is the short form of reward points',
  `min_redeem_point` int(11) DEFAULT NULL COMMENT 'rp is the short form of reward points',
  `max_redeem_point` int(11) DEFAULT NULL COMMENT 'rp is the short form of reward points',
  `rp_expiry_period` int(11) DEFAULT NULL COMMENT 'rp is the short form of reward points',
  `rp_expiry_type` enum('month','year') NOT NULL DEFAULT 'year' COMMENT 'rp is the short form of reward points',
  `email_settings` text DEFAULT NULL,
  `sms_settings` text DEFAULT NULL,
  `custom_labels` text DEFAULT NULL,
  `common_settings` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `sharenumber` int(11) NOT NULL,
  `capital` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `business`
--

INSERT INTO `business` (`id`, `name`, `currency_id`, `start_date`, `tax_number_1`, `tax_label_1`, `tax_number_2`, `tax_label_2`, `code_label_1`, `code_1`, `code_label_2`, `code_2`, `default_sales_tax`, `default_profit_percent`, `owner_id`, `time_zone`, `fy_start_month`, `accounting_method`, `default_sales_discount`, `sell_price_tax`, `logo`, `sku_prefix`, `enable_product_expiry`, `expiry_type`, `on_product_expiry`, `stop_selling_before`, `enable_tooltip`, `purchase_in_diff_currency`, `purchase_currency_id`, `p_exchange_rate`, `transaction_edit_days`, `stock_expiry_alert_days`, `keyboard_shortcuts`, `pos_settings`, `woocommerce_api_settings`, `woocommerce_skipped_orders`, `woocommerce_wh_oc_secret`, `woocommerce_wh_ou_secret`, `woocommerce_wh_od_secret`, `woocommerce_wh_or_secret`, `manufacturing_settings`, `essentials_settings`, `weighing_scale_setting`, `enable_brand`, `enable_category`, `enable_sub_category`, `enable_price_tax`, `enable_purchase_status`, `enable_lot_number`, `default_unit`, `enable_sub_units`, `enable_racks`, `enable_row`, `enable_position`, `enable_editing_product_from_purchase`, `sales_cmsn_agnt`, `item_addition_method`, `enable_inline_tax`, `currency_symbol_placement`, `enabled_modules`, `date_format`, `time_format`, `currency_precision`, `quantity_precision`, `ref_no_prefixes`, `theme_color`, `created_by`, `repair_settings`, `repair_jobsheet_settings`, `prj_setting`, `asset_settings`, `crm_settings`, `accounting_settings`, `enable_rp`, `rp_name`, `amount_for_unit_rp`, `min_order_total_for_rp`, `max_rp_per_order`, `redeem_amount_per_unit_rp`, `min_order_total_for_redeem`, `min_redeem_point`, `max_redeem_point`, `rp_expiry_period`, `rp_expiry_type`, `email_settings`, `sms_settings`, `custom_labels`, `common_settings`, `is_active`, `created_at`, `updated_at`, `sharenumber`, `capital`) VALUES
(1, 'IT Solution Chakaria', 134, '2025-02-01', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10.00, 1, 'Asia/Dhaka', 1, 'fifo', 0.00, 'includes', '1769420854_Untitled-3.png', NULL, 1, 'add_expiry', 'stop_selling', 1, 1, 0, NULL, 1.000, 30, 30, '{\"pos\":{\"express_checkout\":\"shift+e\",\"pay_n_ckeckout\":\"shift+p\",\"search_by_barcode\":\"shift+b\",\"draft\":\"shift+d\",\"cancel\":\"shift+c\",\"recent_product_quantity\":\"f2\",\"weighing_scale\":null,\"edit_discount\":\"shift+i\",\"edit_order_tax\":\"shift+t\",\"add_payment_row\":\"shift+r\",\"finalize_payment\":\"shift+f\",\"add_new_product\":\"f4\"}}', '{\"amount_rounding_method\":null,\"is_pay_term_required\":\"1\",\"cmmsn_calculation_type\":\"invoice_value\",\"delete_invoice_password\":null,\"enable_payment_link\":\"1\",\"razor_pay_key_id\":null,\"razor_pay_key_secret\":null,\"stripe_public_key\":null,\"stripe_secret_key\":null,\"product_show_style_second\":\"1\",\"enebale_search_by_barcode\":\"1\",\"disable_order_tax\":\"1\",\"enable_transaction_date\":\"1\",\"enable_weighing_scale\":\"1\",\"print_on_suspend\":\"1\",\"show_pricing_on_product_sugesstion\":\"1\",\"cash_denominations\":\"100,200,500,1000,1,2,5,10,20.50\",\"enable_cash_denomination_on\":\"all_screens\",\"enable_cash_denomination_for_payment_methods\":[\"cash\"],\"disable_pay_checkout\":0,\"disable_draft\":0,\"disable_express_checkout\":0,\"hide_product_suggestion\":0,\"hide_recent_trans\":0,\"disable_discount\":0,\"is_pos_subtotal_editable\":0}', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '{\"leave_ref_no_prefix\":null,\"leave_instructions\":null,\"payroll_ref_no_prefix\":null,\"essentials_todos_prefix\":null,\"grace_before_checkin\":null,\"grace_after_checkin\":null,\"grace_before_checkout\":null,\"grace_after_checkout\":null,\"is_location_required\":0,\"calculate_sales_target_commission_without_tax\":1}', '{\"label_prefix\":null,\"product_sku_length\":\"4\",\"qty_length\":\"3\",\"qty_length_decimal\":\"2\"}', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, NULL, 1, 0, 'before', '[\"purchases\",\"add_sale\",\"pos_sale\",\"stock_transfers\",\"stock_adjustment\",\"expenses\",\"account\"]', 'd/m/Y', '12', 2, 2, '{\"purchase\":\"PO\",\"purchase_return\":null,\"purchase_requisition\":null,\"purchase_order\":null,\"stock_transfer\":\"ST\",\"stock_adjustment\":\"SA\",\"sell_return\":\"CN\",\"expense\":\"EP\",\"contacts\":\"CO\",\"purchase_payment\":\"PP\",\"sell_payment\":\"SP\",\"expense_payment\":null,\"business_location\":\"BL\",\"username\":null,\"subscription\":null,\"draft\":null,\"sales_order\":null}', 'purple', NULL, NULL, '{\"customer_label\":null,\"client_id_label\":null,\"client_tax_label\":null,\"label_width\":\"75\",\"label_height\":\"50\",\"show_customer\":\"1\",\"show_customer_name_in_label\":\"1\",\"show_customer_address_in_label\":\"1\",\"show_customer_phone_in_label\":\"1\",\"show_customer_alt_phone_in_label\":\"1\",\"show_customer_email_in_label\":\"1\",\"show_sales_person_in_label\":\"1\",\"show_barcode_in_label\":\"1\",\"show_status_in_label\":\"1\",\"show_due_date_in_label\":\"1\",\"show_technician_in_label\":\"1\",\"show_job_sheet_number\":\"1\",\"show_sr_no_in_label\":\"1\",\"show_brand_in_label\":\"1\",\"show_location_in_label\":\"1\",\"show_password_in_label\":\"1\"}', NULL, NULL, NULL, NULL, 1, NULL, 100.0000, 100.0000, NULL, 1.0000, 1.0000, NULL, NULL, NULL, 'year', '{\"mail_driver\":\"smtp\",\"mail_host\":null,\"mail_port\":null,\"mail_username\":\"admin\",\"mail_password\":\"12345678\",\"mail_encryption\":null,\"mail_from_address\":null,\"mail_from_name\":null}', '{\"sms_service\":\"other\",\"nexmo_key\":null,\"nexmo_secret\":null,\"nexmo_from\":null,\"twilio_sid\":null,\"twilio_token\":null,\"twilio_from\":null,\"url\":null,\"send_to_param_name\":\"to\",\"msg_param_name\":\"text\",\"request_method\":\"post\",\"header_1\":null,\"header_val_1\":null,\"header_2\":null,\"header_val_2\":null,\"header_3\":null,\"header_val_3\":null,\"param_1\":null,\"param_val_1\":null,\"param_2\":null,\"param_val_2\":null,\"param_3\":null,\"param_val_3\":null,\"param_4\":null,\"param_val_4\":null,\"param_5\":null,\"param_val_5\":null,\"param_6\":null,\"param_val_6\":null,\"param_7\":null,\"param_val_7\":null,\"param_8\":null,\"param_val_8\":null,\"param_9\":null,\"param_val_9\":null,\"param_10\":null,\"param_val_10\":null}', '{\"payments\":{\"custom_pay_1\":\"Mobile number\",\"custom_pay_2\":null,\"custom_pay_3\":null,\"custom_pay_4\":null,\"custom_pay_5\":null,\"custom_pay_6\":null,\"custom_pay_7\":null},\"contact\":{\"custom_field_1\":null,\"custom_field_2\":null,\"custom_field_3\":null,\"custom_field_4\":null,\"custom_field_5\":null,\"custom_field_6\":null,\"custom_field_7\":null,\"custom_field_8\":null,\"custom_field_9\":null,\"custom_field_10\":null},\"product\":{\"custom_field_1\":\"Color\",\"custom_field_2\":\"Storage\",\"custom_field_3\":null,\"custom_field_4\":null,\"custom_field_5\":null,\"custom_field_6\":null,\"custom_field_7\":null,\"custom_field_8\":null,\"custom_field_9\":null,\"custom_field_10\":null,\"custom_field_11\":null,\"custom_field_12\":null,\"custom_field_13\":null,\"custom_field_14\":null,\"custom_field_15\":null,\"custom_field_16\":null,\"custom_field_17\":null,\"custom_field_18\":null,\"custom_field_19\":null,\"custom_field_20\":null},\"product_cf_details\":{\"1\":{\"type\":\"dropdown\",\"dropdown_options\":\"Black\\r\\nGreen\\r\\nGrey\\r\\nBlue\\r\\nTitanium silver\\r\\nBrown\\r\\nGolden\\r\\nWhite\\r\\nPink\\r\\nRed\\r\\nPure Titanium\\r\\npurple\\r\\nsandy titanium\\r\\norange\"},\"2\":{\"type\":\"dropdown\",\"dropdown_options\":\"2GB-32GB\\r\\n2GB-64GB\\r\\n3GB-64GB\\r\\n4GB-64GB\\r\\n4GB-128GB\\r\\n6GB-128GB\\r\\n8GB-128GB\\r\\n8GB-256GB\\r\\n12GB-256GB\\r\\n12GB-512GB\"},\"3\":{\"type\":null,\"dropdown_options\":null},\"4\":{\"type\":\"text\",\"dropdown_options\":null},\"5\":{\"type\":null,\"dropdown_options\":null},\"6\":{\"type\":null,\"dropdown_options\":null},\"7\":{\"type\":null,\"dropdown_options\":null},\"8\":{\"type\":null,\"dropdown_options\":null},\"9\":{\"type\":null,\"dropdown_options\":null},\"10\":{\"type\":null,\"dropdown_options\":null},\"11\":{\"type\":null,\"dropdown_options\":null},\"12\":{\"type\":null,\"dropdown_options\":null},\"13\":{\"type\":null,\"dropdown_options\":null},\"14\":{\"type\":null,\"dropdown_options\":null},\"15\":{\"type\":null,\"dropdown_options\":null},\"16\":{\"type\":null,\"dropdown_options\":null},\"17\":{\"type\":null,\"dropdown_options\":null},\"18\":{\"type\":null,\"dropdown_options\":null},\"19\":{\"type\":null,\"dropdown_options\":null},\"20\":{\"type\":null,\"dropdown_options\":null}},\"location\":{\"custom_field_1\":null,\"custom_field_2\":null,\"custom_field_3\":null,\"custom_field_4\":null},\"user\":{\"custom_field_1\":null,\"custom_field_2\":null,\"custom_field_3\":null,\"custom_field_4\":null},\"purchase\":{\"custom_field_1\":null,\"custom_field_2\":null,\"custom_field_3\":null,\"custom_field_4\":null},\"purchase_shipping\":{\"custom_field_1\":null,\"custom_field_2\":null,\"custom_field_3\":null,\"custom_field_4\":null,\"custom_field_5\":null},\"sell\":{\"custom_field_1\":null,\"custom_field_2\":null,\"custom_field_3\":null,\"custom_field_4\":null},\"shipping\":{\"custom_field_1\":null,\"custom_field_2\":null,\"custom_field_3\":null,\"custom_field_4\":null,\"custom_field_5\":null},\"types_of_service\":{\"custom_field_1\":null,\"custom_field_2\":null,\"custom_field_3\":null,\"custom_field_4\":null,\"custom_field_5\":null,\"custom_field_6\":null}}', '{\"enable_product_multi_unit\":\"1\",\"enable_product_warranty\":\"1\",\"default_credit_limit\":null,\"enable_purchase_order\":\"1\",\"enable_serial_number\":\"1\",\"enable_purchase_requisition\":\"1\",\"default_datatable_page_entries\":\"25\"}', 1, '2024-10-25 16:39:24', '2026-04-02 18:37:03', 3, 1000000.00);

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

--
-- Table structure for table `business_backups`
--

CREATE TABLE `business_backups` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `file_name` varchar(191) NOT NULL,
  `file_path` varchar(191) NOT NULL,
  `file_size` bigint(20) NOT NULL DEFAULT 0,
  `status` enum('pending','completed','failed') NOT NULL DEFAULT 'pending',
  `notes` text DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `business_locations`
--

CREATE TABLE `business_locations` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `location_id` varchar(191) DEFAULT NULL,
  `kot_printer_type` enum('browser','printer') NOT NULL DEFAULT 'browser',
  `kot_printer_id` int(11) DEFAULT NULL,
  `name` varchar(256) NOT NULL,
  `landmark` text DEFAULT NULL,
  `country` varchar(100) NOT NULL,
  `state` varchar(100) NOT NULL,
  `city` varchar(100) NOT NULL,
  `zip_code` char(7) NOT NULL,
  `invoice_scheme_id` int(10) UNSIGNED NOT NULL,
  `sale_invoice_scheme_id` int(11) DEFAULT NULL,
  `invoice_layout_id` int(10) UNSIGNED NOT NULL,
  `sale_invoice_layout_id` int(11) DEFAULT NULL,
  `selling_price_group_id` int(11) DEFAULT NULL,
  `print_receipt_on_invoice` tinyint(1) DEFAULT 1,
  `receipt_printer_type` enum('browser','printer') NOT NULL DEFAULT 'browser',
  `printer_id` int(11) DEFAULT NULL,
  `mobile` varchar(191) DEFAULT NULL,
  `alternate_number` varchar(191) DEFAULT NULL,
  `email` varchar(191) DEFAULT NULL,
  `website` varchar(191) DEFAULT NULL,
  `featured_products` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `default_payment_accounts` text DEFAULT NULL,
  `custom_field1` varchar(191) DEFAULT NULL,
  `custom_field2` varchar(191) DEFAULT NULL,
  `custom_field3` varchar(191) DEFAULT NULL,
  `custom_field4` varchar(191) DEFAULT NULL,
  `accounting_default_map` text DEFAULT NULL COMMENT 'Default transactions mapping of accounting module',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `business_locations`
--

INSERT INTO `business_locations` (`id`, `business_id`, `location_id`, `kot_printer_type`, `kot_printer_id`, `name`, `landmark`, `country`, `state`, `city`, `zip_code`, `invoice_scheme_id`, `sale_invoice_scheme_id`, `invoice_layout_id`, `sale_invoice_layout_id`, `selling_price_group_id`, `print_receipt_on_invoice`, `receipt_printer_type`, `printer_id`, `mobile`, `alternate_number`, `email`, `website`, `featured_products`, `is_active`, `default_payment_accounts`, `custom_field1`, `custom_field2`, `custom_field3`, `custom_field4`, `accounting_default_map`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 1, 'BL0001', 'printer', 1, 'IT Solution Chakaria', 'Somobay Somiti Market ,2nd Floor,', 'Bangladesh', 'Cox\'s Bazar', 'Chakaria', '3400', 1, 1, 1, 1, NULL, 1, 'browser', NULL, '01756-207-207', '01855667785', 'computer.dokanbd@gmail.com', NULL, NULL, 1, '{\"cash\":{\"is_enabled\":\"1\",\"account\":\"22\"},\"card\":{\"is_enabled\":\"1\",\"account\":\"34\"},\"cheque\":{\"is_enabled\":\"1\",\"account\":\"34\"},\"bank_transfer\":{\"is_enabled\":\"1\",\"account\":\"34\"},\"other\":{\"account\":null},\"custom_pay_1\":{\"is_enabled\":\"1\",\"account\":\"32\"},\"custom_pay_2\":{\"account\":null},\"custom_pay_3\":{\"account\":null},\"custom_pay_4\":{\"account\":null},\"custom_pay_5\":{\"account\":null},\"custom_pay_6\":{\"account\":null},\"custom_pay_7\":{\"account\":null}}', NULL, NULL, NULL, NULL, NULL, NULL, '2024-10-25 16:39:24', '2026-01-26 09:58:48'),
(19, 1, 'DHK', 'browser', NULL, 'Dhaka BR', NULL, 'Bangladesh', 'DHK', 'Dhaka', '1200', 1, 1, 1, 1, NULL, 1, 'browser', NULL, NULL, NULL, NULL, NULL, NULL, 1, '{\"cash\":{\"is_enabled\":\"1\",\"account\":null},\"card\":{\"is_enabled\":\"1\",\"account\":null},\"cheque\":{\"is_enabled\":\"1\",\"account\":null},\"bank_transfer\":{\"is_enabled\":\"1\",\"account\":null},\"other\":{\"is_enabled\":\"1\",\"account\":null},\"custom_pay_1\":{\"is_enabled\":\"1\",\"account\":null},\"custom_pay_2\":{\"is_enabled\":\"1\",\"account\":null},\"custom_pay_3\":{\"is_enabled\":\"1\",\"account\":null},\"custom_pay_4\":{\"is_enabled\":\"1\",\"account\":null},\"custom_pay_5\":{\"is_enabled\":\"1\",\"account\":null},\"custom_pay_6\":{\"is_enabled\":\"1\",\"account\":null},\"custom_pay_7\":{\"is_enabled\":\"1\",\"account\":null}}', NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 16:17:59', '2026-04-02 16:17:59');

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

--
-- Table structure for table `business_management_audit_logs`
--

CREATE TABLE `business_management_audit_logs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `module` varchar(50) NOT NULL DEFAULT 'BusinessManagement',
  `action` varchar(100) NOT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `user_email` varchar(255) DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `url` text DEFAULT NULL,
  `method` varchar(10) DEFAULT NULL,
  `report_type` varchar(100) DEFAULT NULL,
  `level` varchar(20) NOT NULL DEFAULT 'info',
  `context` text DEFAULT NULL,
  `business_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `business_management_audit_logs`
--

INSERT INTO `business_management_audit_logs` (`id`, `module`, `action`, `user_id`, `user_email`, `ip_address`, `user_agent`, `url`, `method`, `report_type`, `level`, `context`, `business_id`, `created_at`, `updated_at`) VALUES
(20, 'BusinessManagement', 'feature_usage', 1, NULL, '103.107.77.124', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36', 'https://demo.posifyme.com/business-management/stock-register', 'GET', 'stock_register', 'info', '{\"location_id\":null}', 1, '2026-04-03 17:30:52', '2026-04-03 17:30:52');

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

--
-- Table structure for table `cash_denominations`
--

CREATE TABLE `cash_denominations` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `amount` decimal(22,4) NOT NULL,
  `total_count` int(11) NOT NULL,
  `model_type` varchar(191) NOT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `cash_denominations`
--

INSERT INTO `cash_denominations` (`id`, `business_id`, `amount`, `total_count`, `model_type`, `model_id`, `created_at`, `updated_at`) VALUES
(1, 1, 1000.0000, 100, 'App\\TransactionPayment', 1965, '2026-04-02 18:31:10', '2026-04-02 18:31:10'),
(2, 1, 1000.0000, 100, 'App\\TransactionPayment', 1966, '2026-04-02 18:33:39', '2026-04-02 18:33:39'),
(3, 1, 1000.0000, 89, 'App\\TransactionPayment', 1967, '2026-04-02 18:34:12', '2026-04-02 18:34:12'),
(4, 1, 500.0000, 50, 'App\\TransactionPayment', 1968, '2026-04-02 18:37:03', '2026-04-02 18:37:03');

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

--
-- Table structure for table `cash_registers`
--

CREATE TABLE `cash_registers` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `location_id` int(11) DEFAULT NULL,
  `user_id` int(10) UNSIGNED DEFAULT NULL,
  `status` enum('close','open') NOT NULL DEFAULT 'open',
  `closed_at` datetime DEFAULT NULL,
  `closing_amount` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `total_card_slips` int(11) NOT NULL DEFAULT 0,
  `total_cheques` int(11) NOT NULL DEFAULT 0,
  `denominations` text DEFAULT NULL,
  `closing_note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `fondo_initial` decimal(20,4) DEFAULT 0.0000,
  `fondo_final` decimal(20,4) DEFAULT 0.0000,
  `total_card_amount` decimal(20,4) DEFAULT 0.0000,
  `total_cheque_amount` decimal(20,4) DEFAULT 0.0000,
  `total_other_payment_mod` decimal(20,4) DEFAULT 0.0000,
  `total_other_payment_amount` decimal(20,4) DEFAULT 0.0000,
  `banks_transfers` decimal(20,4) DEFAULT 0.0000,
  `banks_transfers_amount` decimal(20,4) DEFAULT 0.0000,
  `personal_check` text DEFAULT NULL,
  `declaration` enum('declared','not_declared') NOT NULL DEFAULT 'not_declared'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `cash_register_transactions`
--

CREATE TABLE `cash_register_transactions` (
  `id` int(10) UNSIGNED NOT NULL,
  `cash_register_id` int(10) UNSIGNED NOT NULL,
  `amount` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `pay_method` varchar(191) DEFAULT NULL,
  `type` enum('debit','credit') NOT NULL,
  `transaction_type` varchar(191) DEFAULT NULL,
  `transaction_id` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `short_code` varchar(191) DEFAULT NULL,
  `parent_id` int(11) NOT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `woocommerce_cat_id` int(11) DEFAULT NULL,
  `category_type` varchar(191) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `slug` varchar(191) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `categories`
--

INSERT INTO `categories` (`id`, `name`, `business_id`, `short_code`, `parent_id`, `created_by`, `woocommerce_cat_id`, `category_type`, `description`, `slug`, `deleted_at`, `created_at`, `updated_at`) VALUES
(410, 'Soap', 1, 'C1', 0, 1, NULL, 'product', NULL, NULL, NULL, '2026-04-02 17:35:56', '2026-04-02 17:35:56'),
(411, 'House Cleaning', 1, 'C2', 0, 1, NULL, 'product', NULL, NULL, NULL, '2026-04-02 17:36:09', '2026-04-02 17:36:09'),
(412, 'Dal', 1, 'C3', 0, 1, NULL, 'product', 'test dal', NULL, NULL, '2026-04-02 17:36:20', '2026-04-02 17:37:14'),
(413, 'Mug Dal', 1, 'C1.1', 412, 1, NULL, 'product', NULL, NULL, NULL, '2026-04-02 17:36:34', '2026-04-02 17:36:34'),
(414, 'Mobile Phone', 1, 'M1', 0, 1, NULL, 'product', 'm1', NULL, NULL, '2026-04-02 17:56:32', '2026-04-02 17:56:32');

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

--
-- Table structure for table `categorizables`
--

CREATE TABLE `categorizables` (
  `category_id` int(11) NOT NULL,
  `categorizable_type` varchar(191) NOT NULL,
  `categorizable_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `cms_pages`
--

CREATE TABLE `cms_pages` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `type` varchar(191) NOT NULL,
  `layout` varchar(191) DEFAULT NULL,
  `title` varchar(191) NOT NULL,
  `content` longtext DEFAULT NULL,
  `meta_description` text DEFAULT NULL,
  `tags` varchar(191) DEFAULT NULL,
  `feature_image` varchar(191) DEFAULT NULL,
  `priority` int(11) DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `is_enabled` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `cms_page_metas`
--

CREATE TABLE `cms_page_metas` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `cms_page_id` bigint(20) UNSIGNED NOT NULL,
  `meta_key` varchar(191) NOT NULL,
  `meta_value` longtext DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `cms_site_details`
--

CREATE TABLE `cms_site_details` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `site_key` varchar(191) NOT NULL,
  `site_value` longtext DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `contacts`
--

CREATE TABLE `contacts` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `type` varchar(191) NOT NULL,
  `contact_type` varchar(191) DEFAULT NULL,
  `supplier_business_name` varchar(191) DEFAULT NULL,
  `name` varchar(191) DEFAULT NULL,
  `prefix` varchar(191) DEFAULT NULL,
  `first_name` varchar(191) DEFAULT NULL,
  `middle_name` varchar(191) DEFAULT NULL,
  `last_name` varchar(191) DEFAULT NULL,
  `email` varchar(191) DEFAULT NULL,
  `contact_id` varchar(191) DEFAULT NULL,
  `contact_status` varchar(191) NOT NULL DEFAULT 'active',
  `tax_number` varchar(191) DEFAULT NULL,
  `city` varchar(191) DEFAULT NULL,
  `state` varchar(191) DEFAULT NULL,
  `country` varchar(191) DEFAULT NULL,
  `address_line_1` text DEFAULT NULL,
  `address_line_2` text DEFAULT NULL,
  `zip_code` varchar(191) DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `mobile` varchar(191) NOT NULL,
  `landline` varchar(191) DEFAULT NULL,
  `alternate_number` varchar(191) DEFAULT NULL,
  `pay_term_number` int(11) DEFAULT NULL,
  `pay_term_type` enum('days','months') DEFAULT NULL,
  `credit_limit` decimal(22,4) DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `converted_by` int(11) DEFAULT NULL,
  `converted_on` datetime DEFAULT NULL,
  `balance` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `total_rp` int(11) NOT NULL DEFAULT 0 COMMENT 'rp is the short form of reward points',
  `total_rp_used` int(11) NOT NULL DEFAULT 0 COMMENT 'rp is the short form of reward points',
  `total_rp_expired` int(11) NOT NULL DEFAULT 0 COMMENT 'rp is the short form of reward points',
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `shipping_address` text DEFAULT NULL,
  `shipping_custom_field_details` longtext DEFAULT NULL,
  `is_export` tinyint(1) NOT NULL DEFAULT 0,
  `export_custom_field_1` varchar(191) DEFAULT NULL,
  `export_custom_field_2` varchar(191) DEFAULT NULL,
  `export_custom_field_3` varchar(191) DEFAULT NULL,
  `export_custom_field_4` varchar(191) DEFAULT NULL,
  `export_custom_field_5` varchar(191) DEFAULT NULL,
  `export_custom_field_6` varchar(191) DEFAULT NULL,
  `position` varchar(191) DEFAULT NULL,
  `customer_group_id` int(11) DEFAULT NULL,
  `crm_source` varchar(191) DEFAULT NULL,
  `crm_life_stage` varchar(191) DEFAULT NULL,
  `custom_field1` varchar(191) DEFAULT NULL,
  `custom_field2` varchar(191) DEFAULT NULL,
  `custom_field3` varchar(191) DEFAULT NULL,
  `custom_field4` varchar(191) DEFAULT NULL,
  `custom_field5` varchar(191) DEFAULT NULL,
  `custom_field6` varchar(191) DEFAULT NULL,
  `custom_field7` varchar(191) DEFAULT NULL,
  `custom_field8` varchar(191) DEFAULT NULL,
  `custom_field9` varchar(191) DEFAULT NULL,
  `custom_field10` varchar(191) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `contacts`
--

INSERT INTO `contacts` (`id`, `business_id`, `type`, `contact_type`, `supplier_business_name`, `name`, `prefix`, `first_name`, `middle_name`, `last_name`, `email`, `contact_id`, `contact_status`, `tax_number`, `city`, `state`, `country`, `address_line_1`, `address_line_2`, `zip_code`, `dob`, `mobile`, `landline`, `alternate_number`, `pay_term_number`, `pay_term_type`, `credit_limit`, `created_by`, `converted_by`, `converted_on`, `balance`, `total_rp`, `total_rp_used`, `total_rp_expired`, `is_default`, `shipping_address`, `shipping_custom_field_details`, `is_export`, `export_custom_field_1`, `export_custom_field_2`, `export_custom_field_3`, `export_custom_field_4`, `export_custom_field_5`, `export_custom_field_6`, `position`, `customer_group_id`, `crm_source`, `crm_life_stage`, `custom_field1`, `custom_field2`, `custom_field3`, `custom_field4`, `custom_field5`, `custom_field6`, `custom_field7`, `custom_field8`, `custom_field9`, `custom_field10`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 1, 'customer', NULL, NULL, 'Walk-In Customer', NULL, NULL, NULL, NULL, NULL, 'CO0001', 'active', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, 0.0000, 1, NULL, NULL, 0.0000, 0, 0, 0, 1, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-10-25 16:39:24', '2024-10-25 16:39:24'),
(427, 1, 'supplier', 'individual', NULL, 'supplier1', NULL, 'supplier1', NULL, NULL, NULL, 'CO0001', 'active', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '12345678901', NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, 0.0000, 0, 0, 0, 0, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 16:20:41', '2026-04-02 16:20:41'),
(428, 1, 'supplier', 'individual', NULL, 'supplier2', NULL, 'supplier2', NULL, NULL, NULL, 'CO0002', 'active', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '11122233344', NULL, NULL, 1, 'months', NULL, 1, NULL, NULL, 0.0000, 0, 0, 0, 0, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 16:23:41', '2026-04-02 16:23:41'),
(429, 1, 'supplier', 'individual', NULL, 'supplier3', NULL, 'supplier3', NULL, NULL, NULL, 'CO0003', 'active', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '23333333444411', NULL, NULL, 2, 'months', 100.0000, 1, NULL, NULL, 0.0000, 0, 0, 0, 0, 'supplier 3 shipping address', NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 16:25:18', '2026-04-02 16:25:18'),
(430, 1, 'customer', 'individual', NULL, 'customer1', NULL, 'customer1', NULL, NULL, NULL, 'CO0004', 'active', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '5555555555555', NULL, NULL, NULL, NULL, 1000.0000, 1, NULL, NULL, 0.0000, 0, 0, 0, 0, 'cus1 shipping address', NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 16:29:25', '2026-04-02 16:29:25'),
(431, 1, 'customer', 'individual', NULL, 'customer2 discount', NULL, 'customer2 discount', NULL, NULL, NULL, 'CO0005', 'active', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '66666234324', NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, 0.0000, 0, 0, 0, 0, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 19, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 16:30:51', '2026-04-02 16:30:51');

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

--
-- Table structure for table `crm_call_logs`
--

CREATE TABLE `crm_call_logs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `call_type` varchar(191) DEFAULT NULL,
  `mobile_number` varchar(191) NOT NULL,
  `mobile_name` varchar(191) DEFAULT NULL,
  `contact_id` int(11) DEFAULT NULL,
  `start_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `duration` int(11) DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `crm_campaigns`
--

CREATE TABLE `crm_campaigns` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `campaign_type` enum('sms','email') NOT NULL DEFAULT 'email',
  `subject` varchar(191) DEFAULT NULL,
  `email_body` text DEFAULT NULL,
  `sms_body` text DEFAULT NULL,
  `sent_on` datetime DEFAULT NULL,
  `contact_ids` text NOT NULL,
  `additional_info` text DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `crm_contact_person_commissions`
--

CREATE TABLE `crm_contact_person_commissions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `contact_person_id` int(11) NOT NULL,
  `transaction_id` int(11) DEFAULT NULL,
  `commission_amount` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `crm_followup_invoices`
--

CREATE TABLE `crm_followup_invoices` (
  `follow_up_id` int(11) NOT NULL,
  `transaction_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `crm_lead_users`
--

CREATE TABLE `crm_lead_users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL,
  `user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `crm_marketplaces`
--

CREATE TABLE `crm_marketplaces` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `marketplace` varchar(191) DEFAULT NULL,
  `site_key` varchar(191) DEFAULT NULL,
  `site_id` varchar(191) DEFAULT NULL,
  `assigned_users` text DEFAULT NULL,
  `crm_source_id` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `crm_proposals`
--

CREATE TABLE `crm_proposals` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL,
  `subject` text NOT NULL,
  `body` longtext NOT NULL,
  `cc` text DEFAULT NULL,
  `bcc` text DEFAULT NULL,
  `sent_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `crm_proposal_templates`
--

CREATE TABLE `crm_proposal_templates` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `subject` text NOT NULL,
  `body` longtext NOT NULL,
  `cc` text DEFAULT NULL,
  `bcc` text DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `crm_schedules`
--

CREATE TABLE `crm_schedules` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `contact_id` int(11) DEFAULT NULL,
  `title` varchar(191) NOT NULL,
  `status` varchar(191) DEFAULT NULL,
  `start_datetime` datetime DEFAULT NULL,
  `end_datetime` datetime DEFAULT NULL,
  `description` text DEFAULT NULL,
  `schedule_type` enum('call','sms','meeting','email') NOT NULL DEFAULT 'email',
  `followup_category_id` int(11) DEFAULT NULL,
  `allow_notification` tinyint(1) NOT NULL DEFAULT 1,
  `notify_via` text DEFAULT NULL,
  `notify_before` int(11) DEFAULT NULL,
  `notify_type` enum('minute','hour','day') NOT NULL DEFAULT 'hour',
  `created_by` int(11) NOT NULL,
  `is_recursive` tinyint(1) NOT NULL DEFAULT 0,
  `recursion_days` int(11) DEFAULT NULL,
  `followup_additional_info` text DEFAULT NULL,
  `follow_up_by` varchar(191) DEFAULT NULL,
  `follow_up_by_value` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `crm_schedule_logs`
--

CREATE TABLE `crm_schedule_logs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `schedule_id` bigint(20) UNSIGNED NOT NULL,
  `log_type` enum('call','sms','meeting','email') NOT NULL DEFAULT 'email',
  `start_datetime` datetime NOT NULL,
  `end_datetime` datetime NOT NULL,
  `subject` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `crm_schedule_users`
--

CREATE TABLE `crm_schedule_users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `schedule_id` bigint(20) UNSIGNED NOT NULL,
  `user_id` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `currencies`
--

CREATE TABLE `currencies` (
  `id` int(10) UNSIGNED NOT NULL,
  `country` varchar(100) NOT NULL,
  `currency` varchar(100) NOT NULL,
  `code` varchar(25) NOT NULL,
  `symbol` varchar(25) NOT NULL,
  `thousand_separator` varchar(10) NOT NULL,
  `decimal_separator` varchar(10) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `currencies`
--

INSERT INTO `currencies` (`id`, `country`, `currency`, `code`, `symbol`, `thousand_separator`, `decimal_separator`, `created_at`, `updated_at`) VALUES
(1, 'Albania', 'Leke', 'ALL', 'Lek', ',', '.', NULL, NULL),
(2, 'America', 'Dollars', 'USD', '$', ',', '.', NULL, NULL),
(3, 'Afghanistan', 'Afghanis', 'AF', '؋', ',', '.', NULL, NULL),
(4, 'Argentina', 'Pesos', 'ARS', '$', ',', '.', NULL, NULL),
(5, 'Aruba', 'Guilders', 'AWG', 'ƒ', ',', '.', NULL, NULL),
(6, 'Australia', 'Dollars', 'AUD', '$', ',', '.', NULL, NULL),
(7, 'Azerbaijan', 'New Manats', 'AZ', 'ман', ',', '.', NULL, NULL),
(8, 'Bahamas', 'Dollars', 'BSD', '$', ',', '.', NULL, NULL),
(9, 'Barbados', 'Dollars', 'BBD', '$', ',', '.', NULL, NULL),
(10, 'Belarus', 'Rubles', 'BYR', 'p.', ',', '.', NULL, NULL),
(11, 'Belgium', 'Euro', 'EUR', '€', ',', '.', NULL, NULL),
(12, 'Beliz', 'Dollars', 'BZD', 'BZ$', ',', '.', NULL, NULL),
(13, 'Bermuda', 'Dollars', 'BMD', '$', ',', '.', NULL, NULL),
(14, 'Bolivia', 'Bolivianos', 'BOB', '$b', ',', '.', NULL, NULL),
(15, 'Bosnia and Herzegovina', 'Convertible Marka', 'BAM', 'KM', ',', '.', NULL, NULL),
(16, 'Botswana', 'Pula\'s', 'BWP', 'P', ',', '.', NULL, NULL),
(17, 'Bulgaria', 'Leva', 'BG', 'лв', ',', '.', NULL, NULL),
(18, 'Brazil', 'Reais', 'BRL', 'R$', ',', '.', NULL, NULL),
(19, 'Britain [United Kingdom]', 'Pounds', 'GBP', '£', ',', '.', NULL, NULL),
(20, 'Brunei Darussalam', 'Dollars', 'BND', '$', ',', '.', NULL, NULL),
(21, 'Cambodia', 'Riels', 'KHR', '៛', ',', '.', NULL, NULL),
(22, 'Canada', 'Dollars', 'CAD', '$', ',', '.', NULL, NULL),
(23, 'Cayman Islands', 'Dollars', 'KYD', '$', ',', '.', NULL, NULL),
(24, 'Chile', 'Pesos', 'CLP', '$', ',', '.', NULL, NULL),
(25, 'China', 'Yuan Renminbi', 'CNY', '¥', ',', '.', NULL, NULL),
(26, 'Colombia', 'Pesos', 'COP', '$', ',', '.', NULL, NULL),
(27, 'Costa Rica', 'Colón', 'CRC', '₡', ',', '.', NULL, NULL),
(28, 'Croatia', 'Kuna', 'HRK', 'kn', ',', '.', NULL, NULL),
(29, 'Cuba', 'Pesos', 'CUP', '₱', ',', '.', NULL, NULL),
(30, 'Cyprus', 'Euro', 'EUR', '€', '.', ',', NULL, NULL),
(31, 'Czech Republic', 'Koruny', 'CZK', 'Kč', ',', '.', NULL, NULL),
(32, 'Denmark', 'Kroner', 'DKK', 'kr', ',', '.', NULL, NULL),
(33, 'Dominican Republic', 'Pesos', 'DOP ', 'RD$', ',', '.', NULL, NULL),
(34, 'East Caribbean', 'Dollars', 'XCD', '$', ',', '.', NULL, NULL),
(35, 'Egypt', 'Pounds', 'EGP', '£', ',', '.', NULL, NULL),
(36, 'El Salvador', 'Colones', 'SVC', '$', ',', '.', NULL, NULL),
(37, 'England [United Kingdom]', 'Pounds', 'GBP', '£', ',', '.', NULL, NULL),
(38, 'Euro', 'Euro', 'EUR', '€', '.', ',', NULL, NULL),
(39, 'Falkland Islands', 'Pounds', 'FKP', '£', ',', '.', NULL, NULL),
(40, 'Fiji', 'Dollars', 'FJD', '$', ',', '.', NULL, NULL),
(41, 'France', 'Euro', 'EUR', '€', '.', ',', NULL, NULL),
(42, 'Ghana', 'Cedis', 'GHS', '¢', ',', '.', NULL, NULL),
(43, 'Gibraltar', 'Pounds', 'GIP', '£', ',', '.', NULL, NULL),
(44, 'Greece', 'Euro', 'EUR', '€', '.', ',', NULL, NULL),
(45, 'Guatemala', 'Quetzales', 'GTQ', 'Q', ',', '.', NULL, NULL),
(46, 'Guernsey', 'Pounds', 'GGP', '£', ',', '.', NULL, NULL),
(47, 'Guyana', 'Dollars', 'GYD', '$', ',', '.', NULL, NULL),
(48, 'Holland [Netherlands]', 'Euro', 'EUR', '€', '.', ',', NULL, NULL),
(49, 'Honduras', 'Lempiras', 'HNL', 'L', ',', '.', NULL, NULL),
(50, 'Hong Kong', 'Dollars', 'HKD', '$', ',', '.', NULL, NULL),
(51, 'Hungary', 'Forint', 'HUF', 'Ft', ',', '.', NULL, NULL),
(52, 'Iceland', 'Kronur', 'ISK', 'kr', ',', '.', NULL, NULL),
(53, 'India', 'Rupees', 'INR', '₹', ',', '.', NULL, NULL),
(54, 'Indonesia', 'Rupiahs', 'IDR', 'Rp', ',', '.', NULL, NULL),
(55, 'Iran', 'Rials', 'IRR', '﷼', ',', '.', NULL, NULL),
(56, 'Ireland', 'Euro', 'EUR', '€', '.', ',', NULL, NULL),
(57, 'Isle of Man', 'Pounds', 'IMP', '£', ',', '.', NULL, NULL),
(58, 'Israel', 'New Shekels', 'ILS', '₪', ',', '.', NULL, NULL),
(59, 'Italy', 'Euro', 'EUR', '€', '.', ',', NULL, NULL),
(60, 'Jamaica', 'Dollars', 'JMD', 'J$', ',', '.', NULL, NULL),
(61, 'Japan', 'Yen', 'JPY', '¥', ',', '.', NULL, NULL),
(62, 'Jersey', 'Pounds', 'JEP', '£', ',', '.', NULL, NULL),
(63, 'Kazakhstan', 'Tenge', 'KZT', 'лв', ',', '.', NULL, NULL),
(64, 'Korea [North]', 'Won', 'KPW', '₩', ',', '.', NULL, NULL),
(65, 'Korea [South]', 'Won', 'KRW', '₩', ',', '.', NULL, NULL),
(66, 'Kyrgyzstan', 'Soms', 'KGS', 'лв', ',', '.', NULL, NULL),
(67, 'Laos', 'Kips', 'LAK', '₭', ',', '.', NULL, NULL),
(68, 'Latvia', 'Lati', 'LVL', 'Ls', ',', '.', NULL, NULL),
(69, 'Lebanon', 'Pounds', 'LBP', '£', ',', '.', NULL, NULL),
(70, 'Liberia', 'Dollars', 'LRD', '$', ',', '.', NULL, NULL),
(71, 'Liechtenstein', 'Switzerland Francs', 'CHF', 'CHF', ',', '.', NULL, NULL),
(72, 'Lithuania', 'Litai', 'LTL', 'Lt', ',', '.', NULL, NULL),
(73, 'Luxembourg', 'Euro', 'EUR', '€', '.', ',', NULL, NULL),
(74, 'Macedonia', 'Denars', 'MKD', 'ден', ',', '.', NULL, NULL),
(75, 'Malaysia', 'Ringgits', 'MYR', 'RM', ',', '.', NULL, NULL),
(76, 'Malta', 'Euro', 'EUR', '€', '.', ',', NULL, NULL),
(77, 'Mauritius', 'Rupees', 'MUR', '₨', ',', '.', NULL, NULL),
(78, 'Mexico', 'Pesos', 'MXN', '$', ',', '.', NULL, NULL),
(79, 'Mongolia', 'Tugriks', 'MNT', '₮', ',', '.', NULL, NULL),
(80, 'Mozambique', 'Meticais', 'MZ', 'MT', ',', '.', NULL, NULL),
(81, 'Namibia', 'Dollars', 'NAD', '$', ',', '.', NULL, NULL),
(82, 'Nepal', 'Rupees', 'NPR', '₨', ',', '.', NULL, NULL),
(83, 'Netherlands Antilles', 'Guilders', 'ANG', 'ƒ', ',', '.', NULL, NULL),
(84, 'Netherlands', 'Euro', 'EUR', '€', '.', ',', NULL, NULL),
(85, 'New Zealand', 'Dollars', 'NZD', '$', ',', '.', NULL, NULL),
(86, 'Nicaragua', 'Cordobas', 'NIO', 'C$', ',', '.', NULL, NULL),
(87, 'Nigeria', 'Nairas', 'NGN', '₦', ',', '.', NULL, NULL),
(88, 'North Korea', 'Won', 'KPW', '₩', ',', '.', NULL, NULL),
(89, 'Norway', 'Krone', 'NOK', 'kr', ',', '.', NULL, NULL),
(90, 'Oman', 'Rials', 'OMR', '﷼', ',', '.', NULL, NULL),
(91, 'Pakistan', 'Rupees', 'PKR', '₨', ',', '.', NULL, NULL),
(92, 'Panama', 'Balboa', 'PAB', 'B/.', ',', '.', NULL, NULL),
(93, 'Paraguay', 'Guarani', 'PYG', 'Gs', ',', '.', NULL, NULL),
(94, 'Peru', 'Nuevos Soles', 'PE', 'S/.', ',', '.', NULL, NULL),
(95, 'Philippines', 'Pesos', 'PHP', 'Php', ',', '.', NULL, NULL),
(96, 'Poland', 'Zlotych', 'PL', 'zł', ',', '.', NULL, NULL),
(97, 'Qatar', 'Rials', 'QAR', '﷼', ',', '.', NULL, NULL),
(98, 'Romania', 'New Lei', 'RO', 'lei', ',', '.', NULL, NULL),
(99, 'Russia', 'Rubles', 'RUB', 'руб', ',', '.', NULL, NULL),
(100, 'Saint Helena', 'Pounds', 'SHP', '£', ',', '.', NULL, NULL),
(101, 'Saudi Arabia', 'Riyals', 'SAR', '﷼', ',', '.', NULL, NULL),
(102, 'Serbia', 'Dinars', 'RSD', 'Дин.', ',', '.', NULL, NULL),
(103, 'Seychelles', 'Rupees', 'SCR', '₨', ',', '.', NULL, NULL),
(104, 'Singapore', 'Dollars', 'SGD', '$', ',', '.', NULL, NULL),
(105, 'Slovenia', 'Euro', 'EUR', '€', '.', ',', NULL, NULL),
(106, 'Solomon Islands', 'Dollars', 'SBD', '$', ',', '.', NULL, NULL),
(107, 'Somalia', 'Shillings', 'SOS', 'S', ',', '.', NULL, NULL),
(108, 'South Africa', 'Rand', 'ZAR', 'R', ',', '.', NULL, NULL),
(109, 'South Korea', 'Won', 'KRW', '₩', ',', '.', NULL, NULL),
(110, 'Spain', 'Euro', 'EUR', '€', '.', ',', NULL, NULL),
(111, 'Sri Lanka', 'Rupees', 'LKR', '₨', ',', '.', NULL, NULL),
(112, 'Sweden', 'Kronor', 'SEK', 'kr', ',', '.', NULL, NULL),
(113, 'Switzerland', 'Francs', 'CHF', 'CHF', ',', '.', NULL, NULL),
(114, 'Suriname', 'Dollars', 'SRD', '$', ',', '.', NULL, NULL),
(115, 'Syria', 'Pounds', 'SYP', '£', ',', '.', NULL, NULL),
(116, 'Taiwan', 'New Dollars', 'TWD', 'NT$', ',', '.', NULL, NULL),
(117, 'Thailand', 'Baht', 'THB', '฿', ',', '.', NULL, NULL),
(118, 'Trinidad and Tobago', 'Dollars', 'TTD', 'TT$', ',', '.', NULL, NULL),
(119, 'Turkey', 'Lira', 'TRY', 'TL', ',', '.', NULL, NULL),
(120, 'Turkey', 'Liras', 'TRL', '£', ',', '.', NULL, NULL),
(121, 'Tuvalu', 'Dollars', 'TVD', '$', ',', '.', NULL, NULL),
(122, 'Ukraine', 'Hryvnia', 'UAH', '₴', ',', '.', NULL, NULL),
(123, 'United Kingdom', 'Pounds', 'GBP', '£', ',', '.', NULL, NULL),
(124, 'United States of America', 'Dollars', 'USD', '$', ',', '.', NULL, NULL),
(125, 'Uruguay', 'Pesos', 'UYU', '$U', ',', '.', NULL, NULL),
(126, 'Uzbekistan', 'Sums', 'UZS', 'лв', ',', '.', NULL, NULL),
(127, 'Vatican City', 'Euro', 'EUR', '€', '.', ',', NULL, NULL),
(128, 'Venezuela', 'Bolivares Fuertes', 'VEF', 'Bs', ',', '.', NULL, NULL),
(129, 'Vietnam', 'Dong', 'VND', '₫', ',', '.', NULL, NULL),
(130, 'Yemen', 'Rials', 'YER', '﷼', ',', '.', NULL, NULL),
(131, 'Zimbabwe', 'Zimbabwe Dollars', 'ZWD', 'Z$', ',', '.', NULL, NULL),
(132, 'Iraq', 'Iraqi dinar', 'IQD', 'د.ع', ',', '.', NULL, NULL),
(133, 'Kenya', 'Kenyan shilling', 'KES', 'KSh', ',', '.', NULL, NULL),
(134, 'Bangladesh', 'Taka', 'BDT', '৳', ',', '.', NULL, NULL),
(135, 'Algerie', 'Algerian dinar', 'DZD', 'د.ج', ' ', '.', NULL, NULL),
(136, 'United Arab Emirates', 'United Arab Emirates dirham', 'AED', 'د.إ', ',', '.', NULL, NULL),
(137, 'Uganda', 'Uganda shillings', 'UGX', 'USh', ',', '.', NULL, NULL),
(138, 'Tanzania', 'Tanzanian shilling', 'TZS', 'TSh', ',', '.', NULL, NULL),
(139, 'Angola', 'Kwanza', 'AOA', 'Kz', ',', '.', NULL, NULL),
(140, 'Kuwait', 'Kuwaiti dinar', 'KWD', 'KD', ',', '.', NULL, NULL),
(141, 'Bahrain', 'Bahraini dinar', 'BHD', 'BD', ',', '.', NULL, NULL);

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

--
-- Table structure for table `customer_awards`
--

CREATE TABLE `customer_awards` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `customer_id` int(10) UNSIGNED NOT NULL,
  `period_id` bigint(20) UNSIGNED DEFAULT NULL,
  `period_type` enum('weekly','monthly','yearly') NOT NULL,
  `period_start` date NOT NULL,
  `period_end` date NOT NULL,
  `rank_position` int(11) NOT NULL,
  `sales_total` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `engagement_points` int(11) NOT NULL DEFAULT 0,
  `final_score` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `transaction_count` int(11) NOT NULL DEFAULT 0,
  `avg_transaction_value` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `award_type` enum('manual','catalog','none') NOT NULL DEFAULT 'none',
  `catalog_item_id` bigint(20) UNSIGNED DEFAULT NULL,
  `award_quantity` int(11) NOT NULL DEFAULT 1 COMMENT 'Quantity of items awarded (for catalog awards)',
  `gift_description` varchar(191) DEFAULT NULL,
  `gift_monetary_value` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `stock_deducted` tinyint(1) NOT NULL DEFAULT 0,
  `award_notes` text DEFAULT NULL,
  `is_awarded` tinyint(1) NOT NULL DEFAULT 0,
  `awarded_by` int(10) UNSIGNED DEFAULT NULL,
  `awarded_date` datetime DEFAULT NULL,
  `notification_sent` tinyint(1) NOT NULL DEFAULT 0,
  `certificate_path` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `customer_engagements`
--

CREATE TABLE `customer_engagements` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `customer_id` int(10) UNSIGNED NOT NULL,
  `engagement_type` enum('youtube_follow','facebook_follow','content_share','review','referral','instagram_follow','twitter_follow','google_review','other') NOT NULL,
  `points` int(11) NOT NULL DEFAULT 0,
  `verification_notes` text DEFAULT NULL,
  `platform` varchar(191) DEFAULT NULL,
  `reference_url` varchar(191) DEFAULT NULL,
  `recorded_by` int(10) UNSIGNED NOT NULL,
  `recorded_date` date NOT NULL,
  `status` enum('pending','verified','rejected') NOT NULL DEFAULT 'verified',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `customer_groups`
--

CREATE TABLE `customer_groups` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `amount` double(5,2) NOT NULL,
  `price_calculation_type` varchar(191) DEFAULT 'percentage',
  `selling_price_group_id` int(11) DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `customer_groups`
--

INSERT INTO `customer_groups` (`id`, `business_id`, `name`, `amount`, `price_calculation_type`, `selling_price_group_id`, `created_by`, `created_at`, `updated_at`) VALUES
(19, 1, '5% Discount group edit', 5.05, 'percentage', NULL, 1, '2026-04-02 16:29:55', '2026-04-02 16:30:08');

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

--
-- Table structure for table `customer_recognition_cache`
--

CREATE TABLE `customer_recognition_cache` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `customer_id` int(10) UNSIGNED NOT NULL,
  `period_type` enum('weekly','monthly','yearly') NOT NULL,
  `period_start` date NOT NULL,
  `period_end` date NOT NULL,
  `sales_total` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `engagement_points` int(11) NOT NULL DEFAULT 0,
  `final_score` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `transaction_count` int(11) NOT NULL DEFAULT 0,
  `current_rank` int(11) DEFAULT NULL,
  `last_updated` datetime NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `customer_recognition_settings`
--

CREATE TABLE `customer_recognition_settings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `weekly_enabled` tinyint(1) NOT NULL DEFAULT 1,
  `monthly_enabled` tinyint(1) NOT NULL DEFAULT 1,
  `yearly_enabled` tinyint(1) NOT NULL DEFAULT 1,
  `winner_count_weekly` int(11) NOT NULL DEFAULT 3,
  `winner_count_monthly` int(11) NOT NULL DEFAULT 5,
  `winner_count_yearly` int(11) NOT NULL DEFAULT 10,
  `scoring_method` enum('pure_sales','weighted','pure_payments','weighted_payments','payment_adjusted') NOT NULL DEFAULT 'payment_adjusted',
  `sales_weight` decimal(3,2) NOT NULL DEFAULT 0.70,
  `engagement_weight` decimal(3,2) NOT NULL DEFAULT 0.30,
  `module_start_date` date NOT NULL,
  `calculate_historical` tinyint(1) NOT NULL DEFAULT 0,
  `historical_months` int(11) NOT NULL DEFAULT 12,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `dashboard_configurations`
--

CREATE TABLE `dashboard_configurations` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `created_by` int(11) NOT NULL,
  `name` varchar(191) NOT NULL,
  `color` varchar(191) NOT NULL,
  `configuration` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `discounts`
--

CREATE TABLE `discounts` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `business_id` int(11) NOT NULL,
  `brand_id` int(11) DEFAULT NULL,
  `category_id` int(11) DEFAULT NULL,
  `location_id` int(11) DEFAULT NULL,
  `priority` int(11) DEFAULT NULL,
  `discount_type` varchar(191) DEFAULT NULL,
  `discount_amount` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `starts_at` datetime DEFAULT NULL,
  `ends_at` datetime DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `spg` varchar(100) DEFAULT NULL COMMENT 'Applicable in specified selling price group only. Use of applicable_in_spg column is discontinued',
  `applicable_in_cg` tinyint(1) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `discount_variations`
--

CREATE TABLE `discount_variations` (
  `discount_id` int(11) NOT NULL,
  `variation_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `document_and_notes`
--

CREATE TABLE `document_and_notes` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `notable_id` int(11) NOT NULL,
  `notable_type` varchar(191) NOT NULL,
  `heading` text DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_private` tinyint(1) NOT NULL DEFAULT 0,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_allowances_and_deductions`
--

CREATE TABLE `essentials_allowances_and_deductions` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `description` varchar(191) NOT NULL,
  `type` enum('allowance','deduction') NOT NULL,
  `amount` decimal(22,4) NOT NULL,
  `amount_type` enum('fixed','percent') NOT NULL,
  `applicable_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_attendances`
--

CREATE TABLE `essentials_attendances` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(11) NOT NULL,
  `business_id` int(11) NOT NULL,
  `clock_in_time` datetime DEFAULT NULL,
  `clock_out_time` datetime DEFAULT NULL,
  `essentials_shift_id` int(11) DEFAULT NULL,
  `ip_address` varchar(191) DEFAULT NULL,
  `clock_in_note` text DEFAULT NULL,
  `clock_out_note` text DEFAULT NULL,
  `clock_in_location` text DEFAULT NULL,
  `clock_out_location` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_documents`
--

CREATE TABLE `essentials_documents` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `type` varchar(191) DEFAULT NULL,
  `name` varchar(191) NOT NULL,
  `description` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_document_shares`
--

CREATE TABLE `essentials_document_shares` (
  `id` int(10) UNSIGNED NOT NULL,
  `document_id` int(11) NOT NULL,
  `value_type` enum('user','role') NOT NULL,
  `value` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_holidays`
--

CREATE TABLE `essentials_holidays` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) DEFAULT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `business_id` int(11) NOT NULL,
  `location_id` int(11) DEFAULT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_kb`
--

CREATE TABLE `essentials_kb` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` bigint(20) UNSIGNED NOT NULL,
  `title` varchar(191) NOT NULL,
  `content` longtext DEFAULT NULL,
  `status` varchar(191) NOT NULL,
  `kb_type` varchar(191) NOT NULL,
  `parent_id` bigint(20) UNSIGNED DEFAULT NULL COMMENT 'id from essentials_kb table',
  `share_with` varchar(191) DEFAULT NULL COMMENT 'public, private, only_with',
  `created_by` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_kb_users`
--

CREATE TABLE `essentials_kb_users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `kb_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_leaves`
--

CREATE TABLE `essentials_leaves` (
  `id` int(10) UNSIGNED NOT NULL,
  `essentials_leave_type_id` int(11) DEFAULT NULL,
  `business_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `ref_no` varchar(191) DEFAULT NULL,
  `status` enum('pending','approved','cancelled') DEFAULT NULL,
  `reason` text DEFAULT NULL,
  `status_note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_leave_types`
--

CREATE TABLE `essentials_leave_types` (
  `id` int(10) UNSIGNED NOT NULL,
  `leave_type` varchar(191) NOT NULL,
  `max_leave_count` int(11) DEFAULT NULL,
  `leave_count_interval` enum('month','year') DEFAULT NULL,
  `business_id` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_messages`
--

CREATE TABLE `essentials_messages` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `message` text NOT NULL,
  `location_id` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_payroll_groups`
--

CREATE TABLE `essentials_payroll_groups` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `location_id` int(11) DEFAULT NULL COMMENT 'payroll for work location',
  `name` varchar(191) NOT NULL,
  `status` varchar(191) NOT NULL,
  `payment_status` varchar(191) NOT NULL DEFAULT 'due',
  `gross_total` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_payroll_group_transactions`
--

CREATE TABLE `essentials_payroll_group_transactions` (
  `payroll_group_id` bigint(20) UNSIGNED NOT NULL,
  `transaction_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_reminders`
--

CREATE TABLE `essentials_reminders` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `name` varchar(191) NOT NULL,
  `date` date NOT NULL,
  `time` time NOT NULL,
  `end_time` time DEFAULT NULL,
  `repeat` enum('one_time','every_day','every_week','every_month') NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_shifts`
--

CREATE TABLE `essentials_shifts` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `type` enum('fixed_shift','flexible_shift') NOT NULL DEFAULT 'fixed_shift',
  `business_id` int(11) NOT NULL,
  `start_time` time DEFAULT NULL,
  `end_time` time DEFAULT NULL,
  `is_allowed_auto_clockout` tinyint(1) NOT NULL DEFAULT 0,
  `auto_clockout_time` time DEFAULT NULL,
  `holidays` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_todos_users`
--

CREATE TABLE `essentials_todos_users` (
  `todo_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_todo_comments`
--

CREATE TABLE `essentials_todo_comments` (
  `id` int(10) UNSIGNED NOT NULL,
  `comment` text NOT NULL,
  `task_id` int(11) NOT NULL,
  `comment_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_to_dos`
--

CREATE TABLE `essentials_to_dos` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `task` text NOT NULL,
  `date` datetime DEFAULT NULL,
  `end_date` datetime DEFAULT NULL,
  `task_id` varchar(191) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `status` varchar(191) DEFAULT NULL,
  `estimated_hours` varchar(191) DEFAULT NULL,
  `priority` varchar(191) DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_user_allowance_and_deductions`
--

CREATE TABLE `essentials_user_allowance_and_deductions` (
  `user_id` int(11) NOT NULL,
  `allowance_deduction_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_user_sales_targets`
--

CREATE TABLE `essentials_user_sales_targets` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `user_id` int(11) NOT NULL,
  `target_start` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `target_end` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `commission_percent` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `essentials_user_shifts`
--

CREATE TABLE `essentials_user_shifts` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(11) NOT NULL,
  `essentials_shift_id` int(11) NOT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `expense_categories`
--

CREATE TABLE `expense_categories` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `code` varchar(191) DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `field_forces`
--

CREATE TABLE `field_forces` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `visit_id` varchar(191) NOT NULL,
  `business_id` int(11) NOT NULL,
  `contact_id` int(11) DEFAULT NULL,
  `visit_to` varchar(191) DEFAULT NULL,
  `visit_address` text DEFAULT NULL,
  `assigned_to` int(11) NOT NULL,
  `visited_address` text DEFAULT NULL,
  `visited_address_longitude` varchar(191) DEFAULT NULL,
  `visited_address_latitude` varchar(191) DEFAULT NULL,
  `status` varchar(191) NOT NULL,
  `visit_on` datetime NOT NULL,
  `visited_on` datetime DEFAULT NULL,
  `meet_with_mobileno` varchar(191) DEFAULT NULL,
  `meet_with_mobileno2` varchar(191) DEFAULT NULL,
  `meet_with_mobileno3` varchar(191) DEFAULT NULL,
  `meet_with` varchar(191) DEFAULT NULL,
  `meet_with2` varchar(191) DEFAULT NULL,
  `meet_with3` varchar(191) DEFAULT NULL,
  `meet_with_designation` varchar(191) DEFAULT NULL,
  `meet_with_designation2` varchar(191) DEFAULT NULL,
  `meet_with_designation3` varchar(191) DEFAULT NULL,
  `visit_for` text DEFAULT NULL,
  `comments` text DEFAULT NULL,
  `reason_to_not_meet_contact` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `group_sub_taxes`
--

CREATE TABLE `group_sub_taxes` (
  `group_tax_id` int(10) UNSIGNED NOT NULL,
  `tax_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `installments`
--

CREATE TABLE `installments` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `installment_id` int(11) NOT NULL,
  `business_id` int(11) NOT NULL,
  `contact_id` int(11) NOT NULL,
  `transaction_id` int(11) NOT NULL,
  `payment_id` int(11) DEFAULT NULL,
  `system_id` int(11) NOT NULL,
  `installment_number` int(11) DEFAULT NULL,
  `installment_value` decimal(20,2) NOT NULL,
  `number` int(11) NOT NULL,
  `period` int(11) NOT NULL,
  `type` varchar(10) NOT NULL,
  `benefit` decimal(5,2) NOT NULL,
  `benefit_type` varchar(10) NOT NULL,
  `benefit_value` decimal(10,2) DEFAULT NULL,
  `latfines` decimal(10,2) DEFAULT NULL,
  `latfinestype` varchar(10) DEFAULT NULL,
  `latfines_value` decimal(10,2) DEFAULT NULL,
  `paid_value` decimal(10,2) NOT NULL,
  `paid_date` date DEFAULT NULL,
  `installmentdate` date DEFAULT NULL,
  `notes` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `installment_db`
--

CREATE TABLE `installment_db` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `contact_id` int(11) NOT NULL,
  `transaction_id` int(11) NOT NULL,
  `system_id` int(11) NOT NULL,
  `installment_value` decimal(20,2) NOT NULL,
  `total` decimal(20,2) NOT NULL,
  `number` int(11) NOT NULL,
  `paidnumber` int(11) NOT NULL,
  `period` int(11) NOT NULL,
  `type` varchar(10) NOT NULL,
  `benefit` decimal(5,2) NOT NULL,
  `benefit_type` varchar(10) NOT NULL,
  `benefit_value` decimal(10,2) DEFAULT NULL,
  `latfines` decimal(10,2) DEFAULT NULL,
  `latfinestype` varchar(10) DEFAULT NULL,
  `installmentdate` date DEFAULT NULL,
  `notes` varchar(255) DEFAULT NULL,
  `user_id` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `installment_systems`
--

CREATE TABLE `installment_systems` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `name` varchar(191) NOT NULL,
  `number` int(11) NOT NULL,
  `period` int(11) NOT NULL,
  `type` varchar(10) NOT NULL,
  `benefit` decimal(5,2) NOT NULL,
  `benefit_type` varchar(10) NOT NULL,
  `latfines` decimal(5,2) NOT NULL,
  `latfinestype` varchar(10) NOT NULL,
  `description` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `inventory`
--

CREATE TABLE `inventory` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `branch_id` int(10) UNSIGNED NOT NULL,
  `name` text NOT NULL,
  `end_date` timestamp NULL DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `inventory_products`
--

CREATE TABLE `inventory_products` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `inventory_id` bigint(20) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `amount_after_inventory` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
  `Amount_difference` int(11) NOT NULL DEFAULT 0,
  `inventory_type` varchar(191) NOT NULL,
  `qty_before` varchar(191) NOT NULL,
  `transaction_id` int(10) UNSIGNED NOT NULL,
  `variation_id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `invoice_layouts`
--

CREATE TABLE `invoice_layouts` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `header_text` text DEFAULT NULL,
  `invoice_no_prefix` varchar(191) DEFAULT NULL,
  `quotation_no_prefix` varchar(191) DEFAULT NULL,
  `invoice_heading` varchar(191) DEFAULT NULL,
  `sub_heading_line1` varchar(191) DEFAULT NULL,
  `sub_heading_line2` varchar(191) DEFAULT NULL,
  `sub_heading_line3` varchar(191) DEFAULT NULL,
  `sub_heading_line4` varchar(191) DEFAULT NULL,
  `sub_heading_line5` varchar(191) DEFAULT NULL,
  `invoice_heading_not_paid` varchar(191) DEFAULT NULL,
  `invoice_heading_paid` varchar(191) DEFAULT NULL,
  `quotation_heading` varchar(191) DEFAULT NULL,
  `sub_total_label` varchar(191) DEFAULT NULL,
  `discount_label` varchar(191) DEFAULT NULL,
  `tax_label` varchar(191) DEFAULT NULL,
  `total_label` varchar(191) DEFAULT NULL,
  `round_off_label` varchar(191) DEFAULT NULL,
  `total_due_label` varchar(191) DEFAULT NULL,
  `paid_label` varchar(191) DEFAULT NULL,
  `show_client_id` tinyint(1) NOT NULL DEFAULT 0,
  `client_id_label` varchar(191) DEFAULT NULL,
  `client_tax_label` varchar(191) DEFAULT NULL,
  `date_label` varchar(191) DEFAULT NULL,
  `date_time_format` varchar(191) DEFAULT NULL,
  `show_time` tinyint(1) NOT NULL DEFAULT 1,
  `show_brand` tinyint(1) NOT NULL DEFAULT 0,
  `show_sku` tinyint(1) NOT NULL DEFAULT 1,
  `show_cat_code` tinyint(1) NOT NULL DEFAULT 1,
  `show_multi_unit_details` tinyint(1) NOT NULL DEFAULT 0,
  `show_expiry` tinyint(1) NOT NULL DEFAULT 0,
  `show_lot` tinyint(1) NOT NULL DEFAULT 0,
  `show_image` tinyint(1) NOT NULL DEFAULT 0,
  `show_sale_description` tinyint(1) NOT NULL DEFAULT 0,
  `sales_person_label` varchar(191) DEFAULT NULL,
  `show_sales_person` tinyint(1) NOT NULL DEFAULT 0,
  `table_product_label` varchar(191) DEFAULT NULL,
  `table_qty_label` varchar(191) DEFAULT NULL,
  `table_unit_price_label` varchar(191) DEFAULT NULL,
  `table_subtotal_label` varchar(191) DEFAULT NULL,
  `cat_code_label` varchar(191) DEFAULT NULL,
  `logo` varchar(191) DEFAULT NULL,
  `show_logo` tinyint(1) NOT NULL DEFAULT 0,
  `show_business_name` tinyint(1) NOT NULL DEFAULT 0,
  `show_location_name` tinyint(1) NOT NULL DEFAULT 1,
  `show_landmark` tinyint(1) NOT NULL DEFAULT 1,
  `show_city` tinyint(1) NOT NULL DEFAULT 1,
  `show_state` tinyint(1) NOT NULL DEFAULT 1,
  `show_zip_code` tinyint(1) NOT NULL DEFAULT 1,
  `show_country` tinyint(1) NOT NULL DEFAULT 1,
  `show_mobile_number` tinyint(1) NOT NULL DEFAULT 1,
  `show_alternate_number` tinyint(1) NOT NULL DEFAULT 0,
  `show_email` tinyint(1) NOT NULL DEFAULT 0,
  `show_tax_1` tinyint(1) NOT NULL DEFAULT 1,
  `show_tax_2` tinyint(1) NOT NULL DEFAULT 0,
  `show_barcode` tinyint(1) NOT NULL DEFAULT 0,
  `show_payments` tinyint(1) NOT NULL DEFAULT 0,
  `show_customer` tinyint(1) NOT NULL DEFAULT 0,
  `customer_label` varchar(191) DEFAULT NULL,
  `commission_agent_label` varchar(191) DEFAULT NULL,
  `show_commission_agent` tinyint(1) NOT NULL DEFAULT 0,
  `show_reward_point` tinyint(1) NOT NULL DEFAULT 0,
  `highlight_color` varchar(10) DEFAULT NULL,
  `footer_text` text DEFAULT NULL,
  `module_info` text DEFAULT NULL,
  `common_settings` text DEFAULT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `business_id` int(10) UNSIGNED NOT NULL,
  `show_letter_head` tinyint(1) NOT NULL DEFAULT 0,
  `letter_head` varchar(191) DEFAULT NULL,
  `show_qr_code` tinyint(1) NOT NULL DEFAULT 0,
  `qr_code_fields` text DEFAULT NULL,
  `design` varchar(190) DEFAULT 'classic',
  `cn_heading` varchar(191) DEFAULT NULL COMMENT 'cn = credit note',
  `cn_no_label` varchar(191) DEFAULT NULL,
  `cn_amount_label` varchar(191) DEFAULT NULL,
  `table_tax_headings` text DEFAULT NULL,
  `show_previous_bal` tinyint(1) NOT NULL DEFAULT 0,
  `prev_bal_label` varchar(191) DEFAULT NULL,
  `change_return_label` varchar(191) DEFAULT NULL,
  `product_custom_fields` text DEFAULT NULL,
  `contact_custom_fields` text DEFAULT NULL,
  `location_custom_fields` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `invoice_layouts`
--

INSERT INTO `invoice_layouts` (`id`, `name`, `header_text`, `invoice_no_prefix`, `quotation_no_prefix`, `invoice_heading`, `sub_heading_line1`, `sub_heading_line2`, `sub_heading_line3`, `sub_heading_line4`, `sub_heading_line5`, `invoice_heading_not_paid`, `invoice_heading_paid`, `quotation_heading`, `sub_total_label`, `discount_label`, `tax_label`, `total_label`, `round_off_label`, `total_due_label`, `paid_label`, `show_client_id`, `client_id_label`, `client_tax_label`, `date_label`, `date_time_format`, `show_time`, `show_brand`, `show_sku`, `show_cat_code`, `show_multi_unit_details`, `show_expiry`, `show_lot`, `show_image`, `show_sale_description`, `sales_person_label`, `show_sales_person`, `table_product_label`, `table_qty_label`, `table_unit_price_label`, `table_subtotal_label`, `cat_code_label`, `logo`, `show_logo`, `show_business_name`, `show_location_name`, `show_landmark`, `show_city`, `show_state`, `show_zip_code`, `show_country`, `show_mobile_number`, `show_alternate_number`, `show_email`, `show_tax_1`, `show_tax_2`, `show_barcode`, `show_payments`, `show_customer`, `customer_label`, `commission_agent_label`, `show_commission_agent`, `show_reward_point`, `highlight_color`, `footer_text`, `module_info`, `common_settings`, `is_default`, `business_id`, `show_letter_head`, `letter_head`, `show_qr_code`, `qr_code_fields`, `design`, `cn_heading`, `cn_no_label`, `cn_amount_label`, `table_tax_headings`, `show_previous_bal`, `prev_bal_label`, `change_return_label`, `product_custom_fields`, `contact_custom_fields`, `location_custom_fields`, `created_at`, `updated_at`) VALUES
(1, 'Default', NULL, 'Invoice No.', NULL, 'Invoice', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Subtotal', 'Discount', 'Tax', 'Total', NULL, 'Total Due', 'Total Paid', 0, NULL, NULL, 'Date', NULL, 1, 0, 0, 0, 0, 0, 0, 1, 1, NULL, 1, 'Product', 'Quantity', 'Unit Price', 'Subtotal', NULL, '1769421065_Untitled-3.png', 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 'Customer', NULL, 0, 0, '#000000', '<p>Thank you for staying with<strong> IT Solutions.</strong></p>', '{\"repair\":{\"show_repair_status\":\"1\",\"repair_status_label\":null,\"show_repair_warranty\":\"1\",\"repair_warranty_label\":null,\"show_brand\":\"1\",\"brand_label\":null,\"show_device\":\"1\",\"device_label\":null,\"show_model\":\"1\",\"model_no_label\":null,\"show_serial_no\":\"1\",\"serial_no_label\":null,\"show_defects\":\"1\",\"defects_label\":null,\"show_repair_checklist\":\"1\",\"repair_checklist_label\":null}}', '{\"proforma_heading\":null,\"sales_order_heading\":null,\"due_date_label\":null,\"show_only_sold_unit\":\"1\",\"show_serial_number\":\"1\",\"total_quantity_label\":null,\"item_discount_label\":null,\"discounted_unit_price_label\":null,\"show_warranty_name\":\"1\",\"show_warranty_exp_date\":\"1\",\"show_warranty_description\":\"1\",\"total_items_label\":null,\"show_total_in_words\":\"1\",\"num_to_word_format\":\"international\",\"tax_summary_label\":null,\"return_refund_text\":\"-1. No Return After Sales. \\r\\n-2. Product Exchange Applies Only To Products. \\r\\n-3. No Money Will Refund. \\r\\n-4. Please Check Your Products Before Leave.\\r\\n**( 1, 2, 3, will be imposed after 3 days. Items will not be exchanged or refunded unless they are in the same condition as when purchased. )**\",\"warranty_void_text\":\"\\u09e7. \\u098f\\u0987 \\u0987\\u09a8\\u09ad\\u09df\\u09c7\\u099f\\u09bf \\u0986\\u09aa\\u09a8\\u09be\\u09b0 \\u099c\\u09a8\\u09cd\\u09af \\u0993\\u09df\\u09be\\u09b0\\u09c7\\u09a8\\u09cd\\u099f\\u09bf \\/ \\u0997\\u09c7\\u09b0\\u09be\\u09a8\\u09cd\\u099f\\u09bf \\u0995\\u09be\\u09b0\\u09cd\\u09a1\\u0964 ( \\u0993\\u09df\\u09be\\u09b0\\u09c7\\u09a8\\u09cd\\u099f\\u09bf\\u09b0 \\u099c\\u09a8\\u09cd\\u09af \\u0986\\u09aa\\u09a8\\u09be\\u0995\\u09c7 \\u0985\\u09ac\\u09b6\\u09cd\\u09af\\u0987 \\u098f\\u0987 \\u0987\\u09a8\\u09ad\\u09df\\u09c7\\u099c\\u09c7\\u09b0 \\u098f\\u0995\\u099f\\u09bf \\u09ab\\u099f\\u09cb\\u0995\\u09aa\\u09bf \\u09b8\\u0999\\u09cd\\u0997\\u09c7 \\u0986\\u09a8\\u09a4\\u09c7 \\u09b9\\u09ac\\u09c7\\u0964 \\r\\n\\u09e8. \\u09aa\\u09a8\\u09cd\\u09af \\u0995\\u09cd\\u09b0\\u09df\\u09c7\\u09b0 \\u09b8\\u09ae\\u09df \\u0985\\u09ac\\u09b6\\u09cd\\u09af\\u0987 \\u09aa\\u09a8\\u09cd\\u09af\\u099f\\u09bf \\u09ad\\u09be\\u09b2\\u09cb \\u0995\\u09b0\\u09c7 \\u09af\\u09be\\u099a\\u09be\\u0987 \\u0995\\u09b0\\u09c7 \\u09a8\\u09bf\\u09ac\\u09c7\\u09a8\\u0964   \\u09e9. \\u09aa\\u09a8\\u09cd\\u09af\\u099f\\u09bf \\u09ad\\u09be\\u0999\\u09cd\\u0997\\u09be, \\u09aa\\u09cb\\u09dc\\u09be , \\u09b8\\u09cd\\u099f\\u09bf\\u0995\\u09be\\u09b0 \\/ \\u09b8\\u09c0\\u09b2 \\u099b\\u09bf\\u09dc\\u09c7 \\u09ac\\u09be \\u0989\\u09a0\\u09c7 \\u0997\\u09c7\\u09b2\\u09c7 \\u0993\\u09df\\u09be\\u09b0\\u09c7\\u09a8\\u09cd\\u099f\\u09bf \\u09aa\\u09cd\\u09b0\\u09a6\\u09be\\u09a8 \\u0995\\u09b0\\u09be \\u09b9\\u09ac\\u09c7 \\u09a8\\u09be\\u0964    \\r\\n\\u09ea. \\u0987\\u09a8\\u09ad\\u09df\\u09c7\\u099c\\u09c7\\u09b0 \\u09a4\\u09be\\u09b0\\u09bf\\u0996 \\u0985\\u09a8\\u09c1\\u09af\\u09be\\u09df\\u09c0 \\u09b6\\u09b0\\u09cd\\u09a4 \\u09b8\\u09be\\u09aa\\u09c7\\u0995\\u09cd\\u09b7\\u09c7 \\u0993\\u09df\\u09be\\u09b0\\u09c7\\u09a8\\u09cd\\u099f\\u09bf \\u09aa\\u09cd\\u09b0\\u09a6\\u09be\\u09a8 \\u0995\\u09b0\\u09be \\u09b9\\u09ac\\u09c7\\u0964   \\u09eb.  \\u0993\\u09af\\u09bc\\u09be\\u09b0\\u09c7\\u09a8\\u09cd\\u099f\\u09bf \\u09aa\\u09cd\\u09b0\\u09cb\\u09a1\\u09be\\u0995\\u09cd\\u099f\\u09c7\\u09b0 \\u09b8\\u09be\\u09b0\\u09cd\\u09ad\\u09bf\\u09b8\\u09bf\\u0982 \\u098f\\u09b0 \\u099c\\u09a8\\u09cd\\u09af 7 \\u09a5\\u09c7\\u0995\\u09c7 \\u09e9\\u09e6 \\u09a6\\u09bf\\u09a8 \\u09b8\\u09ae\\u09af\\u09bc \\u09b2\\u09be\\u0997\\u09a4\\u09c7 \\u09aa\\u09be\\u09b0\\u09c7, \\u09b8\\u09ae\\u09af\\u09bc \\u09a6\\u09bf\\u09af\\u09bc\\u09c7 \\u09b8\\u09b9\\u09af\\u09cb\\u0997\\u09bf\\u09a4\\u09be \\u0995\\u09b0\\u09c1\\u09a8\\u0964\\r\\n\\u09ec. \\u0995\\u09c1\\u09b0\\u09bf\\u09df\\u09be\\u09b0 \\u09b8\\u09be\\u09b0\\u09cd\\u09ad\\u09bf\\u09b8 \\u0996\\u09b0\\u099a \\u09aa\\u09cd\\u09b0\\u09be\\u09b9\\u0995\\u0995\\u09c7 \\u09ac\\u09b9\\u09a8 \\u0995\\u09b0\\u09a4\\u09c7 \\u09b9\\u09ac\\u09c7\\u0964 (\\u09b6\\u09b0\\u09cd\\u09a4 \\u09aa\\u09cd\\u09b0\\u09af\\u09cb\\u099c\\u09cd\\u09af) \\u09a7\\u09a8\\u09cd\\u09af\\u09ac\\u09be\\u09a6\\u0964\"}', 1, 1, 0, NULL, 0, NULL, 'classic', NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, '2024-10-25 16:39:24', '2026-03-24 06:08:06');

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

--
-- Table structure for table `invoice_schemes`
--

CREATE TABLE `invoice_schemes` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `scheme_type` enum('blank','year') NOT NULL,
  `number_type` varchar(100) NOT NULL DEFAULT 'sequential',
  `prefix` varchar(191) DEFAULT NULL,
  `start_number` int(11) DEFAULT NULL,
  `invoice_count` int(11) NOT NULL DEFAULT 0,
  `total_digits` int(11) DEFAULT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `invoice_schemes`
--

INSERT INTO `invoice_schemes` (`id`, `business_id`, `name`, `scheme_type`, `number_type`, `prefix`, `start_number`, `invoice_count`, `total_digits`, `is_default`, `created_at`, `updated_at`) VALUES
(1, 1, 'Default', 'blank', 'sequential', '', 1, 317, 4, 1, '2024-10-25 16:39:24', '2026-03-30 14:06:56');

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

--
-- Table structure for table `media`
--

CREATE TABLE `media` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `file_name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `uploaded_by` int(11) DEFAULT NULL,
  `model_type` varchar(191) NOT NULL,
  `woocommerce_media_id` int(11) DEFAULT NULL,
  `model_media_type` varchar(191) DEFAULT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `media`
--

INSERT INTO `media` (`id`, `business_id`, `file_name`, `description`, `uploaded_by`, `model_type`, `woocommerce_media_id`, `model_media_type`, `model_id`, `created_at`, `updated_at`) VALUES
(281, 1, '1775152503_1793526246_FlyerDesign29july1.jpg', NULL, 1, 'App\\Variation', NULL, NULL, 2221, '2026-04-02 17:55:03', '2026-04-02 17:55:03'),
(282, 1, '1775152722_170024681_FlyerDesign29july2.jpg', NULL, 1, 'App\\Variation', NULL, NULL, 2222, '2026-04-02 17:58:42', '2026-04-02 17:58:42');

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

--
-- Table structure for table `mfg_ingredient_groups`
--

CREATE TABLE `mfg_ingredient_groups` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `business_id` int(11) NOT NULL,
  `description` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `mfg_recipes`
--

CREATE TABLE `mfg_recipes` (
  `id` int(10) UNSIGNED NOT NULL,
  `product_id` int(11) NOT NULL,
  `variation_id` int(11) NOT NULL,
  `instructions` text DEFAULT NULL,
  `waste_percent` decimal(10,2) NOT NULL DEFAULT 0.00,
  `ingredients_cost` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `extra_cost` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `production_cost_type` varchar(191) DEFAULT 'percentage',
  `total_quantity` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `final_price` decimal(22,4) NOT NULL,
  `sub_unit_id` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `mfg_recipe_ingredients`
--

CREATE TABLE `mfg_recipe_ingredients` (
  `id` int(10) UNSIGNED NOT NULL,
  `mfg_recipe_id` int(10) UNSIGNED NOT NULL,
  `variation_id` int(11) NOT NULL,
  `mfg_ingredient_group_id` int(11) DEFAULT NULL,
  `quantity` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `waste_percent` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `sub_unit_id` int(11) DEFAULT NULL,
  `sort_order` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(191) NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2016_06_01_000001_create_oauth_auth_codes_table', 1),
(4, '2016_06_01_000002_create_oauth_access_tokens_table', 1),
(5, '2016_06_01_000003_create_oauth_refresh_tokens_table', 1),
(6, '2016_06_01_000004_create_oauth_clients_table', 1),
(7, '2016_06_01_000005_create_oauth_personal_access_clients_table', 1),
(8, '2017_07_05_071953_create_currencies_table', 1),
(9, '2017_07_05_073658_create_business_table', 1),
(10, '2017_07_22_075923_add_business_id_users_table', 1),
(11, '2017_07_23_113209_create_brands_table', 1),
(12, '2017_07_26_083429_create_permission_tables', 1),
(13, '2017_07_26_110000_create_tax_rates_table', 1),
(14, '2017_07_26_122313_create_units_table', 1),
(15, '2017_07_27_075706_create_contacts_table', 1),
(16, '2017_08_04_071038_create_categories_table', 1),
(17, '2017_08_08_115903_create_products_table', 1),
(18, '2017_08_09_061616_create_variation_templates_table', 1),
(19, '2017_08_09_061638_create_variation_value_templates_table', 1),
(20, '2017_08_10_061146_create_product_variations_table', 1),
(21, '2017_08_10_061216_create_variations_table', 1),
(22, '2017_08_19_054827_create_transactions_table', 1),
(23, '2017_08_31_073533_create_purchase_lines_table', 1),
(24, '2017_10_15_064638_create_transaction_payments_table', 1),
(25, '2017_10_31_065621_add_default_sales_tax_to_business_table', 1),
(26, '2017_11_20_051930_create_table_group_sub_taxes', 1),
(27, '2017_11_20_063603_create_transaction_sell_lines', 1),
(28, '2017_11_21_064540_create_barcodes_table', 1),
(29, '2017_11_23_181237_create_invoice_schemes_table', 1),
(30, '2017_12_25_122822_create_business_locations_table', 1),
(31, '2017_12_25_160253_add_location_id_to_transactions_table', 1),
(32, '2017_12_25_163227_create_variation_location_details_table', 1),
(33, '2018_01_04_115627_create_sessions_table', 1),
(34, '2018_01_05_112817_create_invoice_layouts_table', 1),
(35, '2018_01_06_112303_add_invoice_scheme_id_and_invoice_layout_id_to_business_locations', 1),
(36, '2018_01_08_104124_create_expense_categories_table', 1),
(37, '2018_01_08_123327_modify_transactions_table_for_expenses', 1),
(38, '2018_01_09_111005_modify_payment_status_in_transactions_table', 1),
(39, '2018_01_09_111109_add_paid_on_column_to_transaction_payments_table', 1),
(40, '2018_01_25_172439_add_printer_related_fields_to_business_locations_table', 1),
(41, '2018_01_27_184322_create_printers_table', 1),
(42, '2018_01_30_181442_create_cash_registers_table', 1),
(43, '2018_01_31_125836_create_cash_register_transactions_table', 1),
(44, '2018_02_07_173326_modify_business_table', 1),
(45, '2018_02_08_105425_add_enable_product_expiry_column_to_business_table', 1),
(46, '2018_02_08_111027_add_expiry_period_and_expiry_period_type_columns_to_products_table', 1),
(47, '2018_02_08_131118_add_mfg_date_and_exp_date_purchase_lines_table', 1),
(48, '2018_02_08_155348_add_exchange_rate_to_transactions_table', 1),
(49, '2018_02_09_124945_modify_transaction_payments_table_for_contact_payments', 1),
(50, '2018_02_12_113640_create_transaction_sell_lines_purchase_lines_table', 1),
(51, '2018_02_12_114605_add_quantity_sold_in_purchase_lines_table', 1),
(52, '2018_02_13_183323_alter_decimal_fields_size', 1),
(53, '2018_02_14_161928_add_transaction_edit_days_to_business_table', 1),
(54, '2018_02_15_161032_add_document_column_to_transactions_table', 1),
(55, '2018_02_17_124709_add_more_options_to_invoice_layouts', 1),
(56, '2018_02_19_111517_add_keyboard_shortcut_column_to_business_table', 1),
(57, '2018_02_19_121537_stock_adjustment_move_to_transaction_table', 1),
(58, '2018_02_20_165505_add_is_direct_sale_column_to_transactions_table', 1),
(59, '2018_02_21_105329_create_system_table', 1),
(60, '2018_02_23_100549_version_1_2', 1),
(61, '2018_02_23_125648_add_enable_editing_sp_from_purchase_column_to_business_table', 1),
(62, '2018_02_26_103612_add_sales_commission_agent_column_to_business_table', 1),
(63, '2018_02_26_130519_modify_users_table_for_sales_cmmsn_agnt', 1),
(64, '2018_02_26_134500_add_commission_agent_to_transactions_table', 1),
(65, '2018_02_27_121422_add_item_addition_method_to_business_table', 1),
(66, '2018_02_27_170232_modify_transactions_table_for_stock_transfer', 1),
(67, '2018_03_05_153510_add_enable_inline_tax_column_to_business_table', 1),
(68, '2018_03_06_210206_modify_product_barcode_types', 1),
(69, '2018_03_13_181541_add_expiry_type_to_business_table', 1),
(70, '2018_03_16_113446_product_expiry_setting_for_business', 1),
(71, '2018_03_19_113601_add_business_settings_options', 1),
(72, '2018_03_26_125334_add_pos_settings_to_business_table', 1),
(73, '2018_03_26_165350_create_customer_groups_table', 1),
(74, '2018_03_27_122720_customer_group_related_changes_in_tables', 1),
(75, '2018_03_29_110138_change_tax_field_to_nullable_in_business_table', 1),
(76, '2018_03_29_115502_add_changes_for_sr_number_in_products_and_sale_lines_table', 1),
(77, '2018_03_29_134340_add_inline_discount_fields_in_purchase_lines', 1),
(78, '2018_03_31_140921_update_transactions_table_exchange_rate', 1),
(79, '2018_04_03_103037_add_contact_id_to_contacts_table', 1),
(80, '2018_04_03_122709_add_changes_to_invoice_layouts_table', 1),
(81, '2018_04_09_135320_change_exchage_rate_size_in_business_table', 1),
(82, '2018_04_17_123122_add_lot_number_to_business', 1),
(83, '2018_04_17_160845_add_product_racks_table', 1),
(84, '2018_04_20_182015_create_res_tables_table', 1),
(85, '2018_04_24_105246_restaurant_fields_in_transaction_table', 1),
(86, '2018_04_24_114149_add_enabled_modules_business_table', 1),
(87, '2018_04_24_133704_add_modules_fields_in_invoice_layout_table', 1),
(88, '2018_04_27_132653_quotation_related_change', 1),
(89, '2018_05_02_104439_add_date_format_and_time_format_to_business', 1),
(90, '2018_05_02_111939_add_sell_return_to_transaction_payments', 1),
(91, '2018_05_14_114027_add_rows_positions_for_products', 1),
(92, '2018_05_14_125223_add_weight_to_products_table', 1),
(93, '2018_05_14_164754_add_opening_stock_permission', 1),
(94, '2018_05_15_134729_add_design_to_invoice_layouts', 1),
(95, '2018_05_16_183307_add_tax_fields_invoice_layout', 1),
(96, '2018_05_18_191956_add_sell_return_to_transaction_table', 1),
(97, '2018_05_21_131349_add_custom_fileds_to_contacts_table', 1),
(98, '2018_05_21_131607_invoice_layout_fields_for_sell_return', 1),
(99, '2018_05_21_131949_add_custom_fileds_and_website_to_business_locations_table', 1),
(100, '2018_05_22_123527_create_reference_counts_table', 1),
(101, '2018_05_22_154540_add_ref_no_prefixes_column_to_business_table', 1),
(102, '2018_05_24_132620_add_ref_no_column_to_transaction_payments_table', 1),
(103, '2018_05_24_161026_add_location_id_column_to_business_location_table', 1),
(104, '2018_05_25_180603_create_modifiers_related_table', 1),
(105, '2018_05_29_121714_add_purchase_line_id_to_stock_adjustment_line_table', 1),
(106, '2018_05_31_114645_add_res_order_status_column_to_transactions_table', 1),
(107, '2018_06_05_103530_rename_purchase_line_id_in_stock_adjustment_lines_table', 1),
(108, '2018_06_05_111905_modify_products_table_for_modifiers', 1),
(109, '2018_06_06_110524_add_parent_sell_line_id_column_to_transaction_sell_lines_table', 1),
(110, '2018_06_07_152443_add_is_service_staff_to_roles_table', 1),
(111, '2018_06_07_182258_add_image_field_to_products_table', 1),
(112, '2018_06_13_133705_create_bookings_table', 1),
(113, '2018_06_15_173636_add_email_column_to_contacts_table', 1),
(114, '2018_06_27_182835_add_superadmin_related_fields_business', 1),
(115, '2018_07_10_101913_add_custom_fields_to_products_table', 1),
(116, '2018_07_17_103434_add_sales_person_name_label_to_invoice_layouts_table', 1),
(117, '2018_07_17_163920_add_theme_skin_color_column_to_business_table', 1),
(118, '2018_07_24_160319_add_lot_no_line_id_to_transaction_sell_lines_table', 1),
(119, '2018_07_25_110004_add_show_expiry_and_show_lot_colums_to_invoice_layouts_table', 1),
(120, '2018_07_25_172004_add_discount_columns_to_transaction_sell_lines_table', 1),
(121, '2018_07_26_124720_change_design_column_type_in_invoice_layouts_table', 1),
(122, '2018_07_26_170424_add_unit_price_before_discount_column_to_transaction_sell_line_table', 1),
(123, '2018_07_28_103614_add_credit_limit_column_to_contacts_table', 1),
(124, '2018_08_08_110755_add_new_payment_methods_to_transaction_payments_table', 1),
(125, '2018_08_08_122225_modify_cash_register_transactions_table_for_new_payment_methods', 1),
(126, '2018_08_14_104036_add_opening_balance_type_to_transactions_table', 1),
(127, '2018_09_04_155900_create_accounts_table', 1),
(128, '2018_09_06_114438_create_selling_price_groups_table', 1),
(129, '2018_09_06_154057_create_variation_group_prices_table', 1),
(130, '2018_09_07_102413_add_permission_to_access_default_selling_price', 1),
(131, '2018_09_07_134858_add_selling_price_group_id_to_transactions_table', 1),
(132, '2018_09_10_112448_update_product_type_to_single_if_null_in_products_table', 1),
(133, '2018_09_10_152703_create_account_transactions_table', 1),
(134, '2018_09_10_173656_add_account_id_column_to_transaction_payments_table', 1),
(135, '2018_09_19_123914_create_notification_templates_table', 1),
(136, '2018_09_22_110504_add_sms_and_email_settings_columns_to_business_table', 1),
(137, '2018_09_24_134942_add_lot_no_line_id_to_stock_adjustment_lines_table', 1),
(138, '2018_09_26_105557_add_transaction_payments_for_existing_expenses', 1),
(139, '2018_09_27_111609_modify_transactions_table_for_purchase_return', 1),
(140, '2018_09_27_131154_add_quantity_returned_column_to_purchase_lines_table', 1),
(141, '2018_10_02_131401_add_return_quantity_column_to_transaction_sell_lines_table', 1),
(142, '2018_10_03_104918_add_qty_returned_column_to_transaction_sell_lines_purchase_lines_table', 1),
(143, '2018_10_03_185947_add_default_notification_templates_to_database', 1),
(144, '2018_10_09_153105_add_business_id_to_transaction_payments_table', 1),
(145, '2018_10_16_135229_create_permission_for_sells_and_purchase', 1),
(146, '2018_10_22_114441_add_columns_for_variable_product_modifications', 1),
(147, '2018_10_22_134428_modify_variable_product_data', 1),
(148, '2018_10_30_181558_add_table_tax_headings_to_invoice_layout', 1),
(149, '2018_10_31_122619_add_pay_terms_field_transactions_table', 1),
(150, '2018_10_31_161328_add_new_permissions_for_pos_screen', 1),
(151, '2018_10_31_174752_add_access_selected_contacts_only_to_users_table', 1),
(152, '2018_10_31_175627_add_user_contact_access', 1),
(153, '2018_10_31_180559_add_auto_send_sms_column_to_notification_templates_table', 1),
(154, '2018_11_02_171949_change_card_type_column_to_varchar_in_transaction_payments_table', 1),
(155, '2018_11_08_105621_add_role_permissions', 1),
(156, '2018_11_26_114135_add_is_suspend_column_to_transactions_table', 1),
(157, '2018_11_28_104410_modify_units_table_for_multi_unit', 1),
(158, '2018_11_28_170952_add_sub_unit_id_to_purchase_lines_and_sell_lines', 1),
(159, '2018_11_29_115918_add_primary_key_in_system_table', 1),
(160, '2018_12_03_185546_add_product_description_column_to_products_table', 1),
(161, '2018_12_06_114937_modify_system_table_and_users_table', 1),
(162, '2018_12_13_160007_add_custom_fields_display_options_to_invoice_layouts_table', 1),
(163, '2018_12_14_103307_modify_system_table', 1),
(164, '2018_12_18_133837_add_prev_balance_due_columns_to_invoice_layouts_table', 1),
(165, '2018_12_18_170656_add_invoice_token_column_to_transaction_table', 1),
(166, '2018_12_20_133639_add_date_time_format_column_to_invoice_layouts_table', 1),
(167, '2018_12_21_120659_add_recurring_invoice_fields_to_transactions_table', 1),
(168, '2018_12_24_154933_create_notifications_table', 1),
(169, '2019_01_08_112015_add_document_column_to_transaction_payments_table', 1),
(170, '2019_01_10_124645_add_account_permission', 1),
(171, '2019_01_16_125825_add_subscription_no_column_to_transactions_table', 1),
(172, '2019_01_28_111647_add_order_addresses_column_to_transactions_table', 1),
(173, '2019_02_13_173821_add_is_inactive_column_to_products_table', 1),
(174, '2019_02_19_103118_create_discounts_table', 1),
(175, '2019_02_21_120324_add_discount_id_column_to_transaction_sell_lines_table', 1),
(176, '2019_02_21_134324_add_permission_for_discount', 1),
(177, '2019_03_04_170832_add_service_staff_columns_to_transaction_sell_lines_table', 1),
(178, '2019_03_09_102425_add_sub_type_column_to_transactions_table', 1),
(179, '2019_03_09_124457_add_indexing_transaction_sell_lines_purchase_lines_table', 1),
(180, '2019_03_12_120336_create_activity_log_table', 1),
(181, '2019_03_15_132925_create_media_table', 1),
(182, '2019_05_08_130339_add_indexing_to_parent_id_in_transaction_payments_table', 1),
(183, '2019_05_10_132311_add_missing_column_indexing', 1),
(184, '2019_05_14_091812_add_show_image_column_to_invoice_layouts_table', 1),
(185, '2019_05_25_104922_add_view_purchase_price_permission', 1),
(186, '2019_06_17_103515_add_profile_informations_columns_to_users_table', 1),
(187, '2019_06_18_135524_add_permission_to_view_own_sales_only', 1),
(188, '2019_06_19_112058_add_database_changes_for_reward_points', 1),
(189, '2019_06_28_133732_change_type_column_to_string_in_transactions_table', 1),
(190, '2019_07_13_111420_add_is_created_from_api_column_to_transactions_table', 1),
(191, '2019_07_15_165136_add_fields_for_combo_product', 1),
(192, '2019_07_19_103446_add_mfg_quantity_used_column_to_purchase_lines_table', 1),
(193, '2019_07_22_152649_add_not_for_selling_in_product_table', 1),
(194, '2019_07_29_185351_add_show_reward_point_column_to_invoice_layouts_table', 1),
(195, '2019_08_08_162302_add_sub_units_related_fields', 1),
(196, '2019_08_26_133419_update_price_fields_decimal_point', 1),
(197, '2019_09_02_160054_remove_location_permissions_from_roles', 1),
(198, '2019_09_03_185259_add_permission_for_pos_screen', 1),
(199, '2019_09_04_163141_add_location_id_to_cash_registers_table', 1),
(200, '2019_09_04_184008_create_types_of_services_table', 1),
(201, '2019_09_06_131445_add_types_of_service_fields_to_transactions_table', 1),
(202, '2019_09_09_134810_add_default_selling_price_group_id_column_to_business_locations_table', 1),
(203, '2019_09_12_105616_create_product_locations_table', 1),
(204, '2019_09_17_122522_add_custom_labels_column_to_business_table', 1),
(205, '2019_09_18_164319_add_shipping_fields_to_transactions_table', 1),
(206, '2019_09_19_170927_close_all_active_registers', 1),
(207, '2019_09_23_161906_add_media_description_cloumn_to_media_table', 1),
(208, '2019_10_18_155633_create_account_types_table', 1),
(209, '2019_10_22_163335_add_common_settings_column_to_business_table', 1),
(210, '2019_10_29_132521_add_update_purchase_status_permission', 1),
(211, '2019_11_09_110522_add_indexing_to_lot_number', 1),
(212, '2019_11_19_170824_add_is_active_column_to_business_locations_table', 1),
(213, '2019_11_21_162913_change_quantity_field_types_to_decimal', 1),
(214, '2019_11_25_160340_modify_categories_table_for_polymerphic_relationship', 1),
(215, '2019_12_02_105025_create_warranties_table', 1),
(216, '2019_12_03_180342_add_common_settings_field_to_invoice_layouts_table', 1),
(217, '2019_12_05_183955_add_more_fields_to_users_table', 1),
(218, '2019_12_06_174904_add_change_return_label_column_to_invoice_layouts_table', 1),
(219, '2019_12_11_121307_add_draft_and_quotation_list_permissions', 1),
(220, '2019_12_12_180126_copy_expense_total_to_total_before_tax', 1),
(221, '2019_12_19_181412_make_alert_quantity_field_nullable_on_products_table', 1),
(222, '2019_12_25_173413_create_dashboard_configurations_table', 1),
(223, '2020_01_08_133506_create_document_and_notes_table', 1),
(224, '2020_01_09_113252_add_cc_bcc_column_to_notification_templates_table', 1),
(225, '2020_01_16_174818_add_round_off_amount_field_to_transactions_table', 1),
(226, '2020_01_28_162345_add_weighing_scale_settings_in_business_settings_table', 1),
(227, '2020_02_18_172447_add_import_fields_to_transactions_table', 1),
(228, '2020_03_13_135844_add_is_active_column_to_selling_price_groups_table', 1),
(229, '2020_03_16_115449_add_contact_status_field_to_contacts_table', 1),
(230, '2020_03_26_124736_add_allow_login_column_in_users_table', 1),
(231, '2020_04_13_154150_add_feature_products_column_to_business_loactions', 1),
(232, '2020_04_15_151802_add_user_type_to_users_table', 1),
(233, '2020_04_22_153905_add_subscription_repeat_on_column_to_transactions_table', 1),
(234, '2020_04_28_111436_add_shipping_address_to_contacts_table', 1),
(235, '2020_06_01_094654_add_max_sale_discount_column_to_users_table', 1),
(236, '2020_06_12_162245_modify_contacts_table', 1),
(237, '2020_06_22_103104_change_recur_interval_default_to_one', 1),
(238, '2020_07_09_174621_add_balance_field_to_contacts_table', 1),
(239, '2020_07_23_104933_change_status_column_to_varchar_in_transaction_table', 1),
(240, '2020_09_07_171059_change_completed_stock_transfer_status_to_final', 1),
(241, '2020_09_21_123224_modify_booking_status_column_in_bookings_table', 1),
(242, '2020_09_22_121639_create_discount_variations_table', 1),
(243, '2020_10_05_121550_modify_business_location_table_for_invoice_layout', 1),
(244, '2020_10_16_175726_set_status_as_received_for_opening_stock', 1),
(245, '2020_10_23_170823_add_for_group_tax_column_to_tax_rates_table', 1),
(246, '2020_11_04_130940_add_more_custom_fields_to_contacts_table', 1),
(247, '2020_11_10_152841_add_cash_register_permissions', 1),
(248, '2020_11_17_164041_modify_type_column_to_varchar_in_contacts_table', 1),
(249, '2020_12_18_181447_add_shipping_custom_fields_to_transactions_table', 1),
(250, '2020_12_22_164303_add_sub_status_column_to_transactions_table', 1),
(251, '2020_12_24_153050_add_custom_fields_to_transactions_table', 1),
(252, '2020_12_28_105403_add_whatsapp_text_column_to_notification_templates_table', 1),
(253, '2020_12_29_165925_add_model_document_type_to_media_table', 1),
(254, '2021_02_08_175632_add_contact_number_fields_to_users_table', 1),
(255, '2021_02_11_172217_add_indexing_for_multiple_columns', 1),
(256, '2021_02_23_122043_add_more_columns_to_customer_groups_table', 1),
(257, '2021_02_24_175551_add_print_invoice_permission_to_all_roles', 1),
(258, '2021_03_03_162021_add_purchase_order_columns_to_purchase_lines_and_transactions_table', 1),
(259, '2021_03_11_120229_add_sales_order_columns', 1),
(260, '2021_03_16_120705_add_business_id_to_activity_log_table', 1),
(261, '2021_03_16_153427_add_code_columns_to_business_table', 1),
(262, '2021_03_18_173308_add_account_details_column_to_accounts_table', 1),
(263, '2021_03_18_183119_add_prefer_payment_account_columns_to_transactions_table', 1),
(264, '2021_03_22_120810_add_more_types_of_service_custom_fields', 1),
(265, '2021_03_24_183132_add_shipping_export_custom_field_details_to_contacts_table', 1),
(266, '2021_03_25_170715_add_export_custom_fields_info_to_transactions_table', 1),
(267, '2021_04_15_063449_add_denominations_column_to_cash_registers_table', 1),
(268, '2021_05_22_083426_add_indexing_to_account_transactions_table', 1),
(269, '2021_07_08_065808_add_additional_expense_columns_to_transaction_table', 1),
(270, '2021_07_13_082918_add_qr_code_columns_to_invoice_layouts_table', 1),
(271, '2021_07_21_061615_add_fields_to_show_commission_agent_in_invoice_layout', 1),
(272, '2021_08_13_105549_add_crm_contact_id_to_users_table', 1),
(273, '2021_08_25_114932_add_payment_link_fields_to_transaction_payments_table', 1),
(274, '2021_09_01_063110_add_spg_column_to_discounts_table', 1),
(275, '2021_09_03_061528_modify_cash_register_transactions_table', 1),
(276, '2021_10_05_061658_add_source_column_to_transactions_table', 1),
(277, '2021_12_16_121851_add_parent_id_column_to_expense_categories_table', 1),
(278, '2022_04_14_075120_add_payment_type_column_to_transaction_payments_table', 1),
(279, '2022_04_21_083327_create_cash_denominations_table', 1),
(280, '2022_05_10_055307_add_delivery_date_column_to_transactions_table', 1),
(281, '2022_06_13_123135_add_currency_precision_and_quantity_precision_fields_to_business_table', 1),
(282, '2022_06_28_133342_add_secondary_unit_columns_to_products_sell_line_purchase_lines_tables', 1),
(283, '2022_07_13_114307_create_purchase_requisition_related_columns', 1),
(284, '2022_08_25_132707_add_service_staff_timer_fields_to_products_and_users_table', 1),
(285, '2023_01_28_114255_add_letter_head_column_to_invoice_layouts_table', 1),
(286, '2023_02_11_161510_add_event_column_to_activity_log_table', 1),
(287, '2023_02_11_161511_add_batch_uuid_column_to_activity_log_table', 1),
(288, '2023_03_02_170312_add_provider_to_oauth_clients_table', 1),
(289, '2023_03_21_122731_add_sale_invoice_scheme_id_business_table', 1),
(290, '2023_03_21_170446_add_number_type_to_invoice_scheme', 1),
(291, '2023_04_17_155216_add_custom_fields_to_products', 1),
(292, '2023_04_28_130247_add_price_type_to_group_price_table', 1),
(293, '2023_06_21_033923_add_delivery_person_in_transactions', 1),
(294, '2023_09_13_153555_add_service_staff_pin_columns_in_users', 1),
(295, '2023_09_15_154404_add_is_kitchen_order_in_transactions', 1),
(296, '2023_12_06_152840_add_contact_type_in_contacts', 1),
(299, '2024_10_27_202427_add_multiunit_fields_to_products_table', 2),
(300, '2024_10_27_202522_add_sell_unit_id_column_to_transaction_sell_lines_table', 2),
(301, '2024_10_27_204557_add_changes_to_invoice_layouts_table', 3),
(302, '2024_10_27_204624_add_multi_unit_fields_to_variations_table', 3),
(303, '2024_10_28_134436_add_inline_discount_in_purchase_lines_table', 4),
(304, '2024_10_29_091611_add_multi_unit_column_to_stock_adjustment_lines_table', 5),
(305, '2024_07_31_215407_add_enable_serial_number_field_to_products_table', 6),
(306, '2024_07_31_215536_create_serial_numbers_table', 6),
(307, '2024_07_31_220505_add_enable_serial_number_field_to_purchase_lines_table', 6),
(308, '2024_07_31_221130_create_service_warranties_table', 6),
(309, '2022_10_31_115725_create_accounting_account_types_table', 7),
(310, '2022_11_01_104108_create_accounting_accounts_table', 7),
(311, '2022_11_10_135427_create_accounts_transactions_table', 7),
(312, '2022_11_14_171948_create_accounting_acc_trans_mapping', 7),
(313, '2022_12_02_133536_create_accounting_budgets_table', 7),
(314, '2022_12_19_124743_add_accounting_settings_column_to_business_table', 7),
(315, '2022_12_26_182821_AddAccountingModuleVersionToSystemTable', 7),
(316, '2023_05_25_131005_add_default_map_transactions_fields', 7),
(317, '2020_03_19_130231_add_contact_id_to_users_table', 8),
(318, '2020_03_27_133605_create_schedules_table', 8),
(319, '2020_03_27_133628_create_schedule_users_table', 8),
(320, '2020_03_30_112834_create_schedule_logs_table', 8),
(321, '2020_04_02_182331_add_crm_module_version_to_system_table', 8),
(322, '2020_04_08_153231_modify_cloumn_in_contacts_table', 8),
(323, '2020_04_09_101052_create_lead_users_table', 8),
(324, '2020_04_16_114747_create_crm_campaigns_table', 8),
(325, '2021_01_07_155757_add_followup_additional_info_column_to_crm_schedules_table', 8),
(326, '2021_02_02_140021_add_additional_info_to_crm_campaigns_table', 8),
(327, '2021_02_02_173651_add_new_columns_to_contacts_table', 8),
(328, '2021_02_04_120439_create_call_logs_table', 8),
(329, '2021_02_08_172047_add_mobile_name_column_to_crm_call_logs_table', 8),
(330, '2021_02_16_190038_add_crm_module_indexing', 8),
(331, '2021_02_19_120846_create_crm_followup_invoices', 8),
(332, '2021_02_22_132125_add_follow_up_by_to_crm_schedules_table', 8),
(333, '2021_03_24_160736_add_department_and_designation_to_users_table', 8),
(334, '2021_06_15_152924_create_proposal_templates_table', 8),
(335, '2021_06_16_114448_add_recursive_fields_to_crm_schedules_table', 8),
(336, '2021_06_16_125740_create_proposals_table', 8),
(337, '2021_09_24_065738_add_crm_settings_column_to_business_table', 8),
(338, '2022_02_09_055012_create_crm_marketplaces_table', 8),
(339, '2022_02_17_113045_add_source_id_to_marketplace', 8),
(340, '2022_03_02_180929_add_followup_category_id', 8),
(341, '2022_05_26_061553_create_crm_contact_person_commissions_table', 8),
(342, '2022_06_06_073006_add_cc_and_bcc_columns_to_crm_proposals_table', 8),
(343, '2018_10_01_151252_create_documents_table', 9),
(344, '2018_10_02_151803_create_document_shares_table', 9),
(345, '2018_10_09_134558_create_reminders_table', 9),
(346, '2018_11_16_170756_create_to_dos_table', 9),
(347, '2019_02_22_120329_essentials_messages', 9),
(348, '2019_02_22_161513_add_message_permissions', 9),
(349, '2019_03_29_164339_add_essentials_version_to_system_table', 9),
(350, '2019_05_17_153306_create_essentials_leave_types_table', 9),
(351, '2019_05_17_175921_create_essentials_leaves_table', 9),
(352, '2019_05_21_154517_add_essentials_settings_columns_to_business_table', 9),
(353, '2019_05_21_181653_create_table_essentials_attendance', 9),
(354, '2019_05_30_110049_create_essentials_payrolls_table', 9),
(355, '2019_06_04_105723_create_essentials_holidays_table', 9),
(356, '2019_06_28_134217_add_payroll_columns_to_transactions_table', 9),
(357, '2019_07_15_114211_add_manufacturing_module_version_to_system_table', 9),
(358, '2019_07_15_114403_create_mfg_recipes_table', 9),
(359, '2019_07_18_180217_add_production_columns_to_transactions_table', 9),
(360, '2019_07_26_110753_add_manufacturing_settings_column_to_business_table', 9),
(361, '2019_07_26_170450_add_manufacturing_permissions', 9),
(362, '2019_08_08_110035_create_mfg_recipe_ingredients_table', 9),
(363, '2019_08_08_172837_add_recipe_add_edit_permissions', 9),
(364, '2019_08_12_114610_add_ingredient_waste_percent_columns', 9),
(365, '2019_08_26_103520_add_approve_leave_permission', 9),
(366, '2019_08_27_103724_create_essentials_allowance_and_deduction_table', 9),
(367, '2019_08_27_105236_create_essentials_user_allowances_and_deductions', 9),
(368, '2019_09_20_115906_add_more_columns_to_essentials_to_dos_table', 9),
(369, '2019_09_23_120439_create_essentials_todo_comments_table', 9),
(370, '2019_11_05_115136_create_ingredient_groups_table', 9),
(371, '2019_12_05_170724_add_hrm_columns_to_users_table', 9),
(372, '2019_12_09_105809_add_allowance_and_deductions_permission', 9),
(373, '2020_02_22_120303_add_column_to_mfg_recipe_ingredients_table', 9),
(374, '2020_03_28_152838_create_essentials_shift_table', 9),
(375, '2020_03_30_162029_create_user_shifts_table', 9),
(376, '2020_03_31_134558_add_shift_id_to_attendance_table', 9),
(377, '2020_08_19_103831_add_production_cost_type_to_recipe_and_transaction_table', 9),
(378, '2020_08_19_175842_add_asset_management_module_version_to_system_table', 9),
(379, '2020_08_20_114339_create_assets_table', 9),
(380, '2020_08_20_173031_create_asset_transactions_table', 9),
(381, '2020_08_21_180138_add_asset_settings_column_to_business_table', 9),
(382, '2020_11_05_105157_modify_todos_date_column_type', 9),
(383, '2020_11_11_174852_add_end_time_column_to_essentials_reminders_table', 9),
(384, '2020_11_26_170527_create_essentials_kb_table', 9),
(385, '2020_11_30_112615_create_essentials_kb_users_table', 9),
(386, '2021_02_12_185514_add_clock_in_location_to_essentials_attendances_table', 9),
(387, '2021_02_16_190203_add_essentials_module_indexing', 9),
(388, '2021_02_16_190302_add_manufacturing_module_indexing', 9),
(389, '2021_02_27_133448_add_columns_to_users_table', 9),
(390, '2021_03_04_174857_create_payroll_groups_table', 9),
(391, '2021_03_04_175025_create_payroll_group_transactions_table', 9),
(392, '2021_03_09_123914_add_auto_clockout_to_essentials_shifts', 9),
(393, '2021_04_07_154331_add_mfg_ingredient_group_id_to_transaction_sell_lines_table', 9),
(394, '2021_06_17_121451_add_location_id_to_table', 9),
(395, '2021_09_28_091541_create_essentials_user_sales_targets_table', 9),
(396, '2021_10_29_110841_create_asset_warranties_table', 9),
(397, '2022_03_26_062215_create_asset_maintenances_table', 9),
(398, '2022_05_11_070711_add_maintenance_note_column_to_asset_maintenances_table', 9),
(399, '2024_11_03_102559_add_discount_id_field_to_products_table', 9),
(400, '2021_05_25_232102_creat_installment_sytem_table', 10),
(401, '2021_05_30_070558_create_installments_table', 10),
(402, '2021_05_30_130133_create_installment_db_table', 10),
(403, '2024_02_27_081100_AddApprovePosPermission', 11),
(404, '2024_05_18_195021_add_columns_to_variations', 12),
(405, '2024_05_22_185253_add_columns_to_currency', 12),
(406, '2024_05_23_002542_add_alias_to_tazas_table', 12),
(407, '2024_07_24_231450_add_columns_to_cash_register', 12),
(414, '2021_12_27_051331_create_field_forces_table', 14),
(415, '2022_01_07_110553_add_fieldforce_version_to_system_table', 14),
(416, '2022_01_07_130035_add_visit_to_and_visit_address_to_field_forces_table', 14),
(417, '2022_02_15_171323_add_fields_to_field_force', 14),
(418, '2022_02_21_171746_add_meet_with_reated_field', 14),
(419, '2022_03_01_180203_add_coordinates_to_visits_table', 14),
(420, '2020_12_23_125610_add_spreadsheet_version_to_system_table', 15),
(421, '2020_12_23_153255_create_spreadsheets_table', 15),
(422, '2021_03_12_175416_create_spreadsheet_shares_table', 15),
(423, '2023_01_16_124948_add_folder_id_column_to_sheet_spreadsheets_table', 15),
(424, '2019_11_12_163135_create_projects_table', 16),
(425, '2019_11_12_164431_create_project_members_table', 16),
(426, '2019_11_14_112230_create_project_tasks_table', 16),
(427, '2019_11_14_112258_create_project_task_members_table', 16),
(428, '2019_11_18_154617_create_project_task_comments_table', 16),
(429, '2019_11_19_134807_create_project_time_logs_table', 16),
(430, '2019_12_11_102549_add_more_fields_in_transactions_table', 16),
(431, '2019_12_11_102735_create_invoice_lines_table', 16),
(432, '2020_01_07_172852_add_project_permissions', 16),
(433, '2020_01_08_115422_add_project_module_version_to_system_table', 16),
(434, '2020_07_10_114514_set_location_id_on_existing_invoice', 16),
(435, '2023_11_14_125332_prj_setting_in_business', 16),
(436, '2023_11_14_170736_add_custom_columns_pjt_projects', 16),
(437, '2023_08_22_033711_WhatsAppAccounts', 17),
(438, '2023_09_13_124913_add_sender_column', 17),
(439, '2018_06_27_185405_create_packages_table', 18),
(440, '2018_06_28_182803_create_subscriptions_table', 18),
(441, '2018_07_17_182021_add_rows_to_system_table', 18),
(442, '2018_07_19_131721_add_options_to_packages_table', 18),
(443, '2018_08_17_155534_add_min_termination_alert_days', 18),
(444, '2018_08_28_105945_add_business_based_username_settings_to_system_table', 18),
(445, '2018_08_30_105906_add_superadmin_communicator_logs_table', 18),
(446, '2018_11_02_130636_add_custom_permissions_to_packages_table', 18),
(447, '2018_11_05_161848_add_more_fields_to_packages_table', 18),
(448, '2018_12_10_124621_modify_system_table_values_null_default', 18),
(449, '2019_05_10_135434_add_missing_database_column_indexes', 18),
(450, '2019_08_16_115300_create_superadmin_frontend_pages_table', 18),
(451, '2023_06_10_132121_create_coupons_table', 18),
(452, '2023_06_16_141928_add_column_in_subscriptions', 18),
(453, '2023_06_29_183442_add_mark_package_as_popular', 18),
(454, '2023_07_04_151432_add_column_business', 18),
(455, '2023_07_13_191306_add_businesses_column_in_coupons', 18),
(456, '2020_08_18_123107_add_connector_module_version_to_system_table', 19),
(457, '2018_10_10_110400_add_module_version_to_system_table', 20),
(458, '2018_10_10_122845_add_woocommerce_api_settings_to_business_table', 20),
(459, '2018_10_10_162041_add_woocommerce_category_id_to_categories_table', 20),
(460, '2018_10_11_173839_create_woocommerce_sync_logs_table', 20),
(461, '2018_10_16_123522_add_woocommerce_tax_rate_id_column_to_tax_rates_table', 20),
(462, '2018_10_23_111555_add_woocommerce_attr_id_column_to_variation_templates_table', 20),
(463, '2018_12_03_163945_add_woocommerce_permissions', 20),
(464, '2019_02_18_154414_change_woocommerce_sync_logs_table', 20),
(465, '2019_04_19_174129_add_disable_woocommerce_sync_column_to_products_table', 20),
(466, '2019_06_08_132440_add_woocommerce_wh_oc_secret_column_to_business_table', 20),
(467, '2019_10_01_171828_add_woocommerce_media_id_columns', 20),
(468, '2020_09_07_124952_add_woocommerce_skipped_orders_fields_to_business_table', 20),
(469, '2021_02_16_190608_add_woocommerce_module_indexing', 20),
(470, '2019_03_07_155813_make_repair_statuses_table', 21),
(471, '2019_03_08_120634_add_repair_columns_to_transactions_table', 21),
(472, '2019_03_14_182704_add_repair_permissions', 21),
(473, '2019_03_29_110241_add_repair_version_column_to_system_table', 21),
(474, '2019_04_12_113901_add_repair_settings_column_to_business_table', 21),
(475, '2020_05_05_125008_create_device_models_table', 21),
(476, '2020_05_06_103135_add_repair_model_id_column_to_products_table', 21),
(477, '2020_07_11_120308_add_columns_to_repair_statuses_table', 21),
(478, '2020_07_31_130737_create_job_sheets_table', 21),
(479, '2020_08_07_124241_add_job_sheet_id_to_transactions_table', 21),
(480, '2020_08_22_104640_add_email_template_field_to_repair_status_table', 21),
(481, '2020_10_19_131934_add_job_sheet_custom_fields_to_repair_job_sheets_table', 21),
(482, '2020_11_25_111050_add_parts_column_to_repair_job_sheets_table', 21),
(483, '2020_12_30_101842_add_use_for_repair_column_to_brands_table', 21),
(484, '2021_02_16_190423_add_repair_module_indexing', 21),
(485, '2022_12_23_162847_add_repair_jobsheet_settings_column_to_business_table', 21),
(486, '2022_08_04_143146_create_cms_pages_table', 22),
(487, '2022_09_10_161849_add_layout_column_to_cms_pages_table', 22),
(488, '2022_09_10_163209_create_cms_site_details_table', 22),
(489, '2022_09_15_122547_create_cms_page_metas_table', 22),
(490, '2022_09_16_130337_create_default_data_for_cms', 22),
(491, '2023_02_17_140135_AddVersionForAiAssistance', 23),
(492, '2023_02_21_182321_create_aiassistance_generation_table', 23),
(493, '2020_09_29_184909_add_product_catalogue_version', 24),
(494, '2023_01_05_075042_add_inventory_management_module_version_to_system_table', 25),
(495, '2023_01_06_130527_create_inventory_table', 25),
(496, '2023_01_14_103339_create_table_inventory_products', 25),
(497, '2023_01_05_075042_add_ageing_report_module_version_to_system_table', 26),
(504, '2025_07_17_032333_create_advanced_reports_tables', 27),
(505, '2025_08_09_193149_add_supplier_id_to_products_table', 27),
(506, '2025_08_17_004744_create_customer_recognition_tables', 27),
(507, '2025_09_04_172325_remove_catalog_foreign_key_from_customer_awards', 27),
(508, '2025_09_04_181455_add_award_quantity_to_customer_awards', 27),
(509, '2025_09_04_200000_create_staff_recognition_tables', 27),
(510, '2025_09_05_000001_add_advanced_reports_permissions', 27),
(511, '2025_09_09_000001_vw_vld_vs_calculated_and_indexes', 28),
(512, '2025_09_15_000001_create_stock_integrity_views', 28),
(513, '2024_01_01_000001_add_business_management_permissions', 29),
(514, '2024_01_02_000001_add_business_management_report_permissions', 29),
(515, '2024_01_03_000001_add_business_management_indexes', 29),
(516, '2024_01_04_000001_add_pin_security_settings', 29),
(517, '2024_01_05_000001_create_audit_logs_table', 29),
(518, '2024_12_05_000001_add_daybook_permissions', 29),
(519, '2024_12_16_000001_add_install_domain_to_module_licenses', 29),
(520, '2024_01_01_000001_create_chart_of_accounts_table', 30),
(521, '2024_01_01_000002_create_journal_entry_headers_table', 30),
(522, '2024_01_01_000003_create_journal_entry_lines_table', 30),
(523, '2024_01_01_000004_create_ledger_rollups_table', 30),
(524, '2024_01_01_000005_create_fifo_layers_table', 30),
(525, '2024_01_01_000006_create_account_receivables_payables_table', 30),
(526, '2024_01_01_000007_create_period_locks_table', 30),
(527, '2024_01_01_000008_create_bank_reconciliation_table', 30),
(528, '2024_01_01_000009_create_audit_log_table', 30),
(529, '2024_01_01_000010_create_ratio_snapshots_table', 30),
(530, '2024_01_01_000011_create_direct_expenses_table', 30),
(531, '2024_01_01_000012_create_direct_expense_names_table', 30),
(532, '2024_01_01_000013_create_direct_income_names_table', 30),
(533, '2024_01_01_000014_create_direct_incomes_table', 30),
(534, '2024_01_01_000015_create_cheque_book_entries_table', 30),
(535, '2024_01_01_000016_create_cheque_books_table', 30),
(536, '2024_01_01_000017_create_loans_table', 30),
(537, '2024_01_01_000018_create_loan_transactions_table', 30),
(538, '2024_01_01_000019_create_fixed_assets_table', 30),
(539, '2024_01_01_000020_add_fields_to_fixed_assets_table', 30),
(540, '2024_01_01_000021_add_revaluation_fields_to_fixed_assets_table', 30),
(541, '2024_01_01_000022_create_fixed_asset_revaluations_table', 30),
(542, '2024_01_01_000023_create_capital_accounts_table', 30),
(543, '2024_01_01_000024_create_investments_table', 30),
(544, '2024_01_01_000025_create_bank_accounts_table', 30),
(545, '2024_01_01_000026_add_opening_balance_transaction_to_bank_accounts', 30),
(546, '2025_01_15_000001_add_account_transaction_id_to_bank_reconciliation', 30),
(547, '2025_01_15_000002_add_bank_account_id_to_cheque_book_entries', 30),
(548, '2025_01_15_000003_create_budgets_table', 30),
(549, '2025_01_16_000001_add_available_status_to_cheque_book_entries', 30),
(550, '2025_11_03_030547_add_category_id_to_direct_expenses_table', 30),
(551, '2025_12_16_005428_add_source_cheque_id_to_cheque_book_entries_table', 30),
(552, '2025_12_16_010056_add_contact_and_deposit_account_to_cheque_book_entries_table', 30),
(553, '2025_12_16_012618_make_journal_entry_line_id_nullable_in_bank_reconciliation_table', 30),
(554, '2024_12_22_000001_create_business_backups_table', 31),
(555, '2024_12_22_000002_add_backup_management_permissions', 31),
(556, '2024_12_22_000003_create_backup_settings_table', 31),
(557, '2024_12_22_000004_create_backup_logs_table', 31),
(558, '2024_12_22_000005_add_restore_pin_to_backup_settings', 31),
(559, '2025_05_23_001710_create_transaction_exchanges_table', 32),
(560, '2025_05_23_001814_create_transaction_exchange_lines_table', 32),
(561, '2025_05_23_001851_add_exchange_columns_to_transactions_table', 32),
(562, '2025_05_23_001926_add_exchange_columns_to_transaction_sell_lines_table', 32),
(563, '2025_05_23_012705_add_exchange_amount_tracking_columns', 32),
(564, '2025_05_23_183050_add-column-cancel-to-transaction-exchange-table', 32),
(565, '2025_10_23_123604_add_stock_adjustments_to_transaction_exchanges', 32),
(566, '2024_12_24_000001_create_promotions_table', 33),
(567, '2024_12_24_000002_add_daily_limits_to_promotions_table', 33),
(568, '2024_12_24_000003_create_promotion_daily_usage_table', 33),
(569, '2024_12_24_000004_add_buy_x_get_y_fields_to_promotions_table', 33),
(570, '2024_12_24_000005_add_get_product_id_to_promotions_table', 33),
(571, '2025_01_27_000001_add_indexes_and_foreign_keys_to_promotions', 33),
(572, '2025_01_27_000002_create_promotion_templates_table', 33),
(573, '2025_01_27_000003_create_promotion_audit_logs_table', 33),
(574, '2024_01_01_000001_create_rma_complain_receives_table', 34),
(575, '2024_01_01_000002_create_rma_replace_outs_table', 34),
(576, '2024_01_01_000003_create_rma_replace_ins_table', 34),
(577, '2024_01_01_000004_create_rma_replacement_deliveries_table', 34),
(578, '2024_01_01_000005_create_rma_diagnoses_table', 34),
(579, '2024_01_01_000006_create_rma_item_utilizes_table', 34),
(580, '2024_01_01_000007_create_rma_problem_setups_table', 34),
(581, '2024_01_01_000008_create_rma_service_bills_table', 34),
(582, '2024_01_01_000009_create_rma_engineer_fixings_table', 34),
(583, '2024_01_01_000010_create_rma_serial_histories_table', 34),
(584, '2026_01_07_153015_add_login_pin_to_users_table', 35),
(585, '2026_01_08_000000_fix_login_pin_column_type', 35);

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

--
-- Table structure for table `model_has_permissions`
--

CREATE TABLE `model_has_permissions` (
  `permission_id` int(10) UNSIGNED NOT NULL,
  `model_type` varchar(191) NOT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_permissions`
--

INSERT INTO `model_has_permissions` (`permission_id`, `model_type`, `model_id`) VALUES
(80, 'App\\User', 1),
(80, 'App\\User', 4),
(80, 'App\\User', 8),
(80, 'App\\User', 11),
(80, 'App\\User', 18),
(80, 'App\\User', 25),
(110, 'App\\User', 3),
(112, 'App\\User', 5),
(112, 'App\\User', 6),
(112, 'App\\User', 7),
(354, 'App\\User', 34);

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

--
-- Table structure for table `model_has_roles`
--

CREATE TABLE `model_has_roles` (
  `role_id` int(10) UNSIGNED NOT NULL,
  `model_type` varchar(191) NOT NULL,
  `model_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_roles`
--

INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`) VALUES
(1, 'App\\User', 1),
(1, 'App\\User', 11),
(2, 'App\\User', 8),
(2, 'App\\User', 18),
(2, 'App\\User', 25),
(33, 'App\\User', 34);

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

--
-- Table structure for table `module_licenses`
--

CREATE TABLE `module_licenses` (
  `id` int(10) UNSIGNED NOT NULL,
  `module_name` varchar(100) NOT NULL,
  `license_code` varchar(100) NOT NULL,
  `username` varchar(100) NOT NULL,
  `email` varchar(100) DEFAULT NULL,
  `license_type` enum('single','multi','unlimited') NOT NULL DEFAULT 'single',
  `expiry_date` date DEFAULT NULL,
  `status` enum('active','inactive','expired','revoked') NOT NULL DEFAULT 'active',
  `install_domain` varchar(255) DEFAULT NULL,
  `install_url` varchar(500) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `module_licenses`
--

INSERT INTO `module_licenses` (`id`, `module_name`, `license_code`, `username`, `email`, `license_type`, `expiry_date`, `status`, `install_domain`, `install_url`, `notes`, `created_at`, `updated_at`) VALUES
(1, 'businessmanagement', 'BM-C697-6549-DA11-5E6C', 'itsolutionchakaria', NULL, 'single', NULL, 'inactive', 'bill.itsolutionchakaria.com', 'https://bill.itsolutionchakaria.com', NULL, '2026-01-13 19:51:20', '2026-04-02 15:26:40'),
(2, 'businessmanagement', 'BM-372F-8E30-E2FE-90CF', 'demoposify', NULL, 'single', NULL, 'active', 'demo.posifyme.com', 'https://demo.posifyme.com', NULL, '2026-04-02 15:27:51', '2026-04-02 15:27:51');

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

--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` char(36) NOT NULL,
  `type` varchar(191) NOT NULL,
  `notifiable_type` varchar(191) NOT NULL,
  `notifiable_id` bigint(20) UNSIGNED NOT NULL,
  `data` text NOT NULL,
  `read_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `notification_templates`
--

CREATE TABLE `notification_templates` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `template_for` varchar(191) NOT NULL,
  `email_body` text DEFAULT NULL,
  `sms_body` text DEFAULT NULL,
  `whatsapp_text` text DEFAULT NULL,
  `subject` varchar(191) DEFAULT NULL,
  `cc` varchar(191) DEFAULT NULL,
  `bcc` varchar(191) DEFAULT NULL,
  `auto_send` tinyint(1) NOT NULL DEFAULT 0,
  `auto_send_sms` tinyint(1) NOT NULL DEFAULT 0,
  `auto_send_wa_notif` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `notification_templates`
--

INSERT INTO `notification_templates` (`id`, `business_id`, `template_for`, `email_body`, `sms_body`, `whatsapp_text`, `subject`, `cc`, `bcc`, `auto_send`, `auto_send_sms`, `auto_send_wa_notif`, `created_at`, `updated_at`) VALUES
(1, 1, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2024-10-25 16:39:24', '2024-10-25 16:39:24'),
(2, 1, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2024-10-25 16:39:24', '2024-10-25 16:39:24'),
(3, 1, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2024-10-25 16:39:24', '2024-10-25 16:39:24'),
(4, 1, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2024-10-25 16:39:24', '2024-10-25 16:39:24'),
(5, 1, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2024-10-25 16:39:24', '2024-10-25 16:39:24'),
(6, 1, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2024-10-25 16:39:24', '2024-10-25 16:39:24'),
(7, 1, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2024-10-25 16:39:24', '2024-10-25 16:39:24'),
(8, 1, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2024-10-25 16:39:24', '2024-10-25 16:39:24'),
(9, 1, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2024-10-25 16:39:24', '2024-10-25 16:39:24'),
(10, 1, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2024-10-25 16:39:24', '2024-10-25 16:39:24'),
(11, 2, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-14 18:51:43', '2025-02-14 18:51:43'),
(12, 2, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-14 18:51:43', '2025-02-14 18:51:43'),
(13, 2, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-14 18:51:43', '2025-02-14 18:51:43'),
(14, 2, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2025-02-14 18:51:43', '2025-02-14 18:51:43'),
(15, 2, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-14 18:51:43', '2025-02-14 18:51:43'),
(16, 2, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-14 18:51:43', '2025-02-14 18:51:43'),
(17, 2, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-14 18:51:43', '2025-02-14 18:51:43'),
(18, 2, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-14 18:51:43', '2025-02-14 18:51:43'),
(19, 2, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-14 18:51:43', '2025-02-14 18:51:43'),
(20, 2, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-14 18:51:43', '2025-02-14 18:51:43'),
(21, 3, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-17 06:46:51', '2025-02-17 06:46:51'),
(22, 3, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-17 06:46:51', '2025-02-17 06:46:51'),
(23, 3, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-17 06:46:51', '2025-02-17 06:46:51'),
(24, 3, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2025-02-17 06:46:51', '2025-02-17 06:46:51'),
(25, 3, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-17 06:46:51', '2025-02-17 06:46:51'),
(26, 3, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-17 06:46:51', '2025-02-17 06:46:51'),
(27, 3, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-17 06:46:51', '2025-02-17 06:46:51'),
(28, 3, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-17 06:46:51', '2025-02-17 06:46:51'),
(29, 3, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-17 06:46:51', '2025-02-17 06:46:51'),
(30, 3, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-17 06:46:51', '2025-02-17 06:46:51'),
(31, 4, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-23 06:21:29', '2025-02-23 06:21:29'),
(32, 4, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-23 06:21:29', '2025-02-23 06:21:29'),
(33, 4, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-23 06:21:29', '2025-02-23 06:21:29'),
(34, 4, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2025-02-23 06:21:29', '2025-02-23 06:21:29'),
(35, 4, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-23 06:21:29', '2025-02-23 06:21:29'),
(36, 4, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-23 06:21:29', '2025-02-23 06:21:29'),
(37, 4, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-23 06:21:29', '2025-02-23 06:21:29'),
(38, 4, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-23 06:21:29', '2025-02-23 06:21:29'),
(39, 4, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-23 06:21:29', '2025-02-23 06:21:29'),
(40, 4, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-02-23 06:21:29', '2025-02-23 06:21:29'),
(41, 5, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-03-09 21:45:09', '2025-03-09 21:45:09'),
(42, 5, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-03-09 21:45:09', '2025-03-09 21:45:09'),
(43, 5, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2025-03-09 21:45:09', '2025-03-09 21:45:09'),
(44, 5, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2025-03-09 21:45:09', '2025-03-09 21:45:09'),
(45, 5, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-03-09 21:45:09', '2025-03-09 21:45:09'),
(46, 5, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2025-03-09 21:45:09', '2025-03-09 21:45:09'),
(47, 5, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-03-09 21:45:09', '2025-03-09 21:45:09'),
(48, 5, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2025-03-09 21:45:09', '2025-03-09 21:45:09'),
(49, 5, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-03-09 21:45:09', '2025-03-09 21:45:09'),
(50, 5, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-03-09 21:45:09', '2025-03-09 21:45:09'),
(51, 6, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-03 13:38:09', '2025-04-03 13:38:09'),
(52, 6, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-03 13:38:09', '2025-04-03 13:38:09'),
(53, 6, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-03 13:38:09', '2025-04-03 13:38:09'),
(54, 6, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2025-04-03 13:38:09', '2025-04-03 13:38:09'),
(55, 6, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-03 13:38:09', '2025-04-03 13:38:09'),
(56, 6, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-03 13:38:09', '2025-04-03 13:38:09'),
(57, 6, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-03 13:38:09', '2025-04-03 13:38:09'),
(58, 6, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-03 13:38:09', '2025-04-03 13:38:09'),
(59, 6, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-03 13:38:09', '2025-04-03 13:38:09'),
(60, 6, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-03 13:38:09', '2025-04-03 13:38:09'),
(61, 7, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:07:48', '2025-04-25 19:07:48'),
(62, 7, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:07:48', '2025-04-25 19:07:48'),
(63, 7, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:07:48', '2025-04-25 19:07:48'),
(64, 7, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:07:48', '2025-04-25 19:07:48'),
(65, 7, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:07:48', '2025-04-25 19:07:48'),
(66, 7, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:07:48', '2025-04-25 19:07:48'),
(67, 7, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:07:48', '2025-04-25 19:07:48'),
(68, 7, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:07:48', '2025-04-25 19:07:48'),
(69, 7, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:07:48', '2025-04-25 19:07:48'),
(70, 7, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:07:48', '2025-04-25 19:07:48'),
(71, 8, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:16:11', '2025-04-25 19:16:11'),
(72, 8, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:16:11', '2025-04-25 19:16:11'),
(73, 8, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:16:11', '2025-04-25 19:16:11'),
(74, 8, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:16:11', '2025-04-25 19:16:11'),
(75, 8, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:16:11', '2025-04-25 19:16:11'),
(76, 8, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:16:11', '2025-04-25 19:16:11'),
(77, 8, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:16:11', '2025-04-25 19:16:11'),
(78, 8, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:16:11', '2025-04-25 19:16:11'),
(79, 8, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:16:11', '2025-04-25 19:16:11'),
(80, 8, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-25 19:16:11', '2025-04-25 19:16:11'),
(81, 9, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-29 06:08:51', '2025-04-29 06:08:51'),
(82, 9, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-29 06:08:51', '2025-04-29 06:08:51'),
(83, 9, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-29 06:08:51', '2025-04-29 06:08:51'),
(84, 9, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2025-04-29 06:08:51', '2025-04-29 06:08:51'),
(85, 9, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-29 06:08:51', '2025-04-29 06:08:51'),
(86, 9, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-29 06:08:51', '2025-04-29 06:08:51'),
(87, 9, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-29 06:08:51', '2025-04-29 06:08:51'),
(88, 9, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-29 06:08:51', '2025-04-29 06:08:51'),
(89, 9, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-29 06:08:51', '2025-04-29 06:08:51'),
(90, 9, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-04-29 06:08:51', '2025-04-29 06:08:51'),
(91, 10, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-02 07:35:33', '2025-06-02 07:35:33'),
(92, 10, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-02 07:35:33', '2025-06-02 07:35:33'),
(93, 10, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-02 07:35:33', '2025-06-02 07:35:33'),
(94, 10, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2025-06-02 07:35:33', '2025-06-02 07:35:33'),
(95, 10, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-02 07:35:33', '2025-06-02 07:35:33'),
(96, 10, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-02 07:35:33', '2025-06-02 07:35:33'),
(97, 10, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-02 07:35:33', '2025-06-02 07:35:33');
INSERT INTO `notification_templates` (`id`, `business_id`, `template_for`, `email_body`, `sms_body`, `whatsapp_text`, `subject`, `cc`, `bcc`, `auto_send`, `auto_send_sms`, `auto_send_wa_notif`, `created_at`, `updated_at`) VALUES
(98, 10, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-02 07:35:33', '2025-06-02 07:35:33'),
(99, 10, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-02 07:35:33', '2025-06-02 07:35:33'),
(100, 10, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-02 07:35:33', '2025-06-02 07:35:33'),
(101, 11, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-08 19:48:05', '2025-06-08 19:48:05'),
(102, 11, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-08 19:48:05', '2025-06-08 19:48:05'),
(103, 11, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-08 19:48:05', '2025-06-08 19:48:05'),
(104, 11, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2025-06-08 19:48:05', '2025-06-08 19:48:05'),
(105, 11, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-08 19:48:05', '2025-06-08 19:48:05'),
(106, 11, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-08 19:48:05', '2025-06-08 19:48:05'),
(107, 11, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-08 19:48:05', '2025-06-08 19:48:05'),
(108, 11, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-08 19:48:05', '2025-06-08 19:48:05'),
(109, 11, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-08 19:48:05', '2025-06-08 19:48:05'),
(110, 11, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-08 19:48:05', '2025-06-08 19:48:05'),
(111, 12, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-09 00:14:59', '2025-06-09 00:14:59'),
(112, 12, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-09 00:14:59', '2025-06-09 00:14:59'),
(113, 12, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-09 00:14:59', '2025-06-09 00:14:59'),
(114, 12, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2025-06-09 00:14:59', '2025-06-09 00:14:59'),
(115, 12, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-09 00:14:59', '2025-06-09 00:14:59'),
(116, 12, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-09 00:14:59', '2025-06-09 00:14:59'),
(117, 12, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-09 00:14:59', '2025-06-09 00:14:59'),
(118, 12, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-09 00:14:59', '2025-06-09 00:14:59'),
(119, 12, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-09 00:14:59', '2025-06-09 00:14:59'),
(120, 12, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-06-09 00:14:59', '2025-06-09 00:14:59'),
(121, 13, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-07-14 07:24:17', '2025-07-14 07:24:17'),
(122, 13, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-07-14 07:24:17', '2025-07-14 07:24:17'),
(123, 13, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2025-07-14 07:24:17', '2025-07-14 07:24:17'),
(124, 13, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2025-07-14 07:24:17', '2025-07-14 07:24:17'),
(125, 13, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-07-14 07:24:17', '2025-07-14 07:24:17'),
(126, 13, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2025-07-14 07:24:17', '2025-07-14 07:24:17'),
(127, 13, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-07-14 07:24:17', '2025-07-14 07:24:17'),
(128, 13, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2025-07-14 07:24:17', '2025-07-14 07:24:17'),
(129, 13, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-07-14 07:24:17', '2025-07-14 07:24:17'),
(130, 13, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-07-14 07:24:17', '2025-07-14 07:24:17'),
(131, 14, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-09-07 12:54:54', '2025-09-07 12:54:54'),
(132, 14, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-09-07 12:54:54', '2025-09-07 12:54:54'),
(133, 14, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2025-09-07 12:54:54', '2025-09-07 12:54:54'),
(134, 14, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2025-09-07 12:54:54', '2025-09-07 12:54:54'),
(135, 14, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-09-07 12:54:54', '2025-09-07 12:54:54'),
(136, 14, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2025-09-07 12:54:54', '2025-09-07 12:54:54'),
(137, 14, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2025-09-07 12:54:54', '2025-09-07 12:54:54'),
(138, 14, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2025-09-07 12:54:54', '2025-09-07 12:54:54'),
(139, 14, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2025-09-07 12:54:54', '2025-09-07 12:54:54'),
(140, 14, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2025-09-07 12:54:54', '2025-09-07 12:54:54'),
(141, 15, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2026-01-24 11:38:53', '2026-01-24 11:38:53'),
(142, 15, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2026-01-24 11:38:53', '2026-01-24 11:38:53'),
(143, 15, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2026-01-24 11:38:53', '2026-01-24 11:38:53'),
(144, 15, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2026-01-24 11:38:53', '2026-01-24 11:38:53'),
(145, 15, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2026-01-24 11:38:53', '2026-01-24 11:38:53'),
(146, 15, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2026-01-24 11:38:53', '2026-01-24 11:38:53'),
(147, 15, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2026-01-24 11:38:53', '2026-01-24 11:38:53'),
(148, 15, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2026-01-24 11:38:53', '2026-01-24 11:38:53'),
(149, 15, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2026-01-24 11:38:53', '2026-01-24 11:38:53'),
(150, 15, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2026-01-24 11:38:53', '2026-01-24 11:38:53'),
(151, 16, 'new_sale', '<p>Dear {contact_name},</p>\n\n                    <p>Your invoice number is {invoice_number}<br />\n                    Total amount: {total_amount}<br />\n                    Paid amount: {received_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2026-02-24 02:37:33', '2026-02-24 02:37:33'),
(152, 16, 'payment_received', '<p>Dear {contact_name},</p>\n\n                <p>We have received a payment of {received_amount}</p>\n\n                <p>{business_logo}</p>', 'Dear {contact_name}, We have received a payment of {received_amount}. {business_name}', NULL, 'Payment Received, from {business_name}', NULL, NULL, 0, 0, 0, '2026-02-24 02:37:33', '2026-02-24 02:37:33'),
(153, 16, 'payment_reminder', '<p>Dear {contact_name},</p>\n\n                    <p>This is to remind you that you have pending payment of {due_amount}. Kindly pay it as soon as possible.</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, You have pending payment of {due_amount}. Kindly pay it as soon as possible. {business_name}', NULL, 'Payment Reminder, from {business_name}', NULL, NULL, 0, 0, 0, '2026-02-24 02:37:33', '2026-02-24 02:37:33'),
(154, 16, 'new_booking', '<p>Dear {contact_name},</p>\n\n                    <p>Your booking is confirmed</p>\n\n                    <p>Date: {start_time} to {end_time}</p>\n\n                    <p>Table: {table}</p>\n\n                    <p>Location: {location}</p>\n\n                    <p>{business_logo}</p>', 'Dear {contact_name}, Your booking is confirmed. Date: {start_time} to {end_time}, Table: {table}, Location: {location}', NULL, 'Booking Confirmed - {business_name}', NULL, NULL, 0, 0, 0, '2026-02-24 02:37:33', '2026-02-24 02:37:33'),
(155, 16, 'new_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'Dear {contact_name}, We have a new order with reference number {order_ref_number}. Kindly process the products as soon as possible. {business_name}', NULL, 'New Order, from {business_name}', NULL, NULL, 0, 0, 0, '2026-02-24 02:37:33', '2026-02-24 02:37:33'),
(156, 16, 'payment_paid', '<p>Dear {contact_name},</p>\n\n                    <p>We have paid amount {paid_amount} again invoice number {order_ref_number}.<br />\n                    Kindly note it down.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have paid amount {paid_amount} again invoice number {order_ref_number}.\n                    Kindly note it down. {business_name}', NULL, 'Payment Paid, from {business_name}', NULL, NULL, 0, 0, 0, '2026-02-24 02:37:33', '2026-02-24 02:37:33'),
(157, 16, 'items_received', '<p>Dear {contact_name},</p>\n\n                    <p>We have received all items from invoice reference number {order_ref_number}. Thank you for processing it.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'We have received all items from invoice reference number {order_ref_number}. Thank you for processing it. {business_name}', NULL, 'Items received, from {business_name}', NULL, NULL, 0, 0, 0, '2026-02-24 02:37:33', '2026-02-24 02:37:33'),
(158, 16, 'items_pending', '<p>Dear {contact_name},<br />\n                    This is to remind you that we have not yet received some items from invoice reference number {order_ref_number}. Please process it as soon as possible.</p>\n\n                    <p>{business_name}<br />\n                    {business_logo}</p>', 'This is to remind you that we have not yet received some items from invoice reference number {order_ref_number} . Please process it as soon as possible.{business_name}', NULL, 'Items Pending, from {business_name}', NULL, NULL, 0, 0, 0, '2026-02-24 02:37:33', '2026-02-24 02:37:33'),
(159, 16, 'new_quotation', '<p>Dear {contact_name},</p>\n\n                    <p>Your quotation number is {invoice_number}<br />\n                    Total amount: {total_amount}</p>\n\n                    <p>Thank you for shopping with us.</p>\n\n                    <p>{business_logo}</p>\n\n                    <p>&nbsp;</p>', 'Dear {contact_name}, Thank you for shopping with us. {business_name}', NULL, 'Thank you from {business_name}', NULL, NULL, 0, 0, 0, '2026-02-24 02:37:33', '2026-02-24 02:37:33'),
(160, 16, 'purchase_order', '<p>Dear {contact_name},</p>\n\n                    <p>We have a new purchase order with reference number {order_ref_number}. The respective invoice is attached here with.</p>\n\n                    <p>{business_logo}</p>', 'We have a new purchase order with reference number {order_ref_number}. {business_name}', NULL, 'New Purchase Order, from {business_name}', NULL, NULL, 0, 0, 0, '2026-02-24 02:37:33', '2026-02-24 02:37:33');

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

--
-- Table structure for table `oauth_access_tokens`
--

CREATE TABLE `oauth_access_tokens` (
  `id` varchar(100) NOT NULL,
  `user_id` bigint(20) DEFAULT NULL,
  `client_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) DEFAULT NULL,
  `scopes` text DEFAULT NULL,
  `revoked` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `expires_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `oauth_auth_codes`
--

CREATE TABLE `oauth_auth_codes` (
  `id` varchar(100) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `client_id` int(10) UNSIGNED NOT NULL,
  `scopes` text DEFAULT NULL,
  `revoked` tinyint(1) NOT NULL,
  `expires_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `oauth_clients`
--

CREATE TABLE `oauth_clients` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` bigint(20) DEFAULT NULL,
  `name` varchar(191) NOT NULL,
  `secret` varchar(100) NOT NULL,
  `provider` varchar(191) DEFAULT NULL,
  `redirect` text NOT NULL,
  `personal_access_client` tinyint(1) NOT NULL,
  `password_client` tinyint(1) NOT NULL,
  `revoked` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `oauth_personal_access_clients`
--

CREATE TABLE `oauth_personal_access_clients` (
  `id` int(10) UNSIGNED NOT NULL,
  `client_id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `oauth_refresh_tokens`
--

CREATE TABLE `oauth_refresh_tokens` (
  `id` varchar(100) NOT NULL,
  `access_token_id` varchar(100) NOT NULL,
  `revoked` tinyint(1) NOT NULL,
  `expires_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `packages`
--

CREATE TABLE `packages` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` text NOT NULL,
  `location_count` int(11) NOT NULL COMMENT 'No. of Business Locations, 0 = infinite option.',
  `user_count` int(11) NOT NULL,
  `product_count` int(11) NOT NULL,
  `bookings` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Enable/Disable bookings',
  `kitchen` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Enable/Disable kitchen',
  `order_screen` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Enable/Disable order_screen',
  `tables` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Enable/Disable tables',
  `invoice_count` int(11) NOT NULL,
  `interval` enum('days','months','years') NOT NULL,
  `interval_count` int(11) NOT NULL,
  `trial_days` int(11) NOT NULL,
  `price` decimal(22,4) NOT NULL,
  `custom_permissions` longtext NOT NULL,
  `created_by` int(11) NOT NULL,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL,
  `mark_package_as_popular` tinyint(1) NOT NULL,
  `businesses` longtext DEFAULT NULL,
  `is_private` tinyint(1) NOT NULL DEFAULT 0,
  `is_one_time` tinyint(1) NOT NULL DEFAULT 0,
  `enable_custom_link` tinyint(1) NOT NULL DEFAULT 0,
  `custom_link` varchar(191) DEFAULT NULL,
  `custom_link_text` varchar(191) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `password_resets`
--

CREATE TABLE `password_resets` (
  `email` varchar(191) NOT NULL,
  `token` varchar(191) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `permissions`
--

CREATE TABLE `permissions` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `guard_name` varchar(191) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `permissions`
--

INSERT INTO `permissions` (`id`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
(1, 'profit_loss_report.view', 'web', '2024-10-25 16:35:19', NULL),
(2, 'direct_sell.access', 'web', '2024-10-25 16:35:19', NULL),
(3, 'product.opening_stock', 'web', '2024-10-25 16:35:22', '2024-10-25 16:35:22'),
(4, 'crud_all_bookings', 'web', '2024-10-25 16:35:23', '2024-10-25 16:35:23'),
(5, 'crud_own_bookings', 'web', '2024-10-25 16:35:23', '2024-10-25 16:35:23'),
(6, 'access_default_selling_price', 'web', '2024-10-25 16:35:24', '2024-10-25 16:35:24'),
(7, 'purchase.payments', 'web', '2024-10-25 16:35:24', '2024-10-25 16:35:24'),
(8, 'sell.payments', 'web', '2024-10-25 16:35:24', '2024-10-25 16:35:24'),
(9, 'edit_product_price_from_sale_screen', 'web', '2024-10-25 16:35:25', '2024-10-25 16:35:25'),
(10, 'edit_product_discount_from_sale_screen', 'web', '2024-10-25 16:35:25', '2024-10-25 16:35:25'),
(11, 'roles.view', 'web', '2024-10-25 16:35:25', '2024-10-25 16:35:25'),
(12, 'roles.create', 'web', '2024-10-25 16:35:25', '2024-10-25 16:35:25'),
(13, 'roles.update', 'web', '2024-10-25 16:35:25', '2024-10-25 16:35:25'),
(14, 'roles.delete', 'web', '2024-10-25 16:35:25', '2024-10-25 16:35:25'),
(15, 'account.access', 'web', '2024-10-25 16:35:25', '2024-10-25 16:35:25'),
(16, 'discount.access', 'web', '2024-10-25 16:35:26', '2024-10-25 16:35:26'),
(17, 'view_purchase_price', 'web', '2024-10-25 16:35:26', '2024-10-25 16:35:26'),
(18, 'view_own_sell_only', 'web', '2024-10-25 16:35:26', '2024-10-25 16:35:26'),
(19, 'edit_product_discount_from_pos_screen', 'web', '2024-10-25 16:35:27', '2024-10-25 16:35:27'),
(20, 'edit_product_price_from_pos_screen', 'web', '2024-10-25 16:35:27', '2024-10-25 16:35:27'),
(21, 'access_shipping', 'web', '2024-10-25 16:35:28', '2024-10-25 16:35:28'),
(22, 'purchase.update_status', 'web', '2024-10-25 16:35:28', '2024-10-25 16:35:28'),
(23, 'list_drafts', 'web', '2024-10-25 16:35:29', '2024-10-25 16:35:29'),
(24, 'list_quotations', 'web', '2024-10-25 16:35:29', '2024-10-25 16:35:29'),
(25, 'view_cash_register', 'web', '2024-10-25 16:35:31', '2024-10-25 16:35:31'),
(26, 'close_cash_register', 'web', '2024-10-25 16:35:31', '2024-10-25 16:35:31'),
(27, 'print_invoice', 'web', '2024-10-25 16:35:33', '2024-10-25 16:35:33'),
(28, 'user.view', 'web', '2024-10-25 16:35:35', NULL),
(29, 'user.create', 'web', '2024-10-25 16:35:35', NULL),
(30, 'user.update', 'web', '2024-10-25 16:35:35', NULL),
(31, 'user.delete', 'web', '2024-10-25 16:35:35', NULL),
(32, 'supplier.view', 'web', '2024-10-25 16:35:35', NULL),
(33, 'supplier.create', 'web', '2024-10-25 16:35:35', NULL),
(34, 'supplier.update', 'web', '2024-10-25 16:35:35', NULL),
(35, 'supplier.delete', 'web', '2024-10-25 16:35:35', NULL),
(36, 'customer.view', 'web', '2024-10-25 16:35:35', NULL),
(37, 'customer.create', 'web', '2024-10-25 16:35:35', NULL),
(38, 'customer.update', 'web', '2024-10-25 16:35:35', NULL),
(39, 'customer.delete', 'web', '2024-10-25 16:35:35', NULL),
(40, 'product.view', 'web', '2024-10-25 16:35:35', NULL),
(41, 'product.create', 'web', '2024-10-25 16:35:35', NULL),
(42, 'product.update', 'web', '2024-10-25 16:35:35', NULL),
(43, 'product.delete', 'web', '2024-10-25 16:35:35', NULL),
(44, 'purchase.view', 'web', '2024-10-25 16:35:35', NULL),
(45, 'purchase.create', 'web', '2024-10-25 16:35:35', NULL),
(46, 'purchase.update', 'web', '2024-10-25 16:35:35', NULL),
(47, 'purchase.delete', 'web', '2024-10-25 16:35:35', NULL),
(48, 'sell.view', 'web', '2024-10-25 16:35:35', NULL),
(49, 'sell.create', 'web', '2024-10-25 16:35:35', NULL),
(50, 'sell.update', 'web', '2024-10-25 16:35:35', NULL),
(51, 'sell.delete', 'web', '2024-10-25 16:35:35', NULL),
(52, 'purchase_n_sell_report.view', 'web', '2024-10-25 16:35:35', NULL),
(53, 'contacts_report.view', 'web', '2024-10-25 16:35:35', NULL),
(54, 'stock_report.view', 'web', '2024-10-25 16:35:35', NULL),
(55, 'tax_report.view', 'web', '2024-10-25 16:35:35', NULL),
(56, 'trending_product_report.view', 'web', '2024-10-25 16:35:35', NULL),
(57, 'register_report.view', 'web', '2024-10-25 16:35:35', NULL),
(58, 'sales_representative.view', 'web', '2024-10-25 16:35:35', NULL),
(59, 'expense_report.view', 'web', '2024-10-25 16:35:35', NULL),
(60, 'business_settings.access', 'web', '2024-10-25 16:35:35', NULL),
(61, 'barcode_settings.access', 'web', '2024-10-25 16:35:35', NULL),
(62, 'invoice_settings.access', 'web', '2024-10-25 16:35:35', NULL),
(63, 'brand.view', 'web', '2024-10-25 16:35:35', NULL),
(64, 'brand.create', 'web', '2024-10-25 16:35:35', NULL),
(65, 'brand.update', 'web', '2024-10-25 16:35:35', NULL),
(66, 'brand.delete', 'web', '2024-10-25 16:35:35', NULL),
(67, 'tax_rate.view', 'web', '2024-10-25 16:35:35', NULL),
(68, 'tax_rate.create', 'web', '2024-10-25 16:35:35', NULL),
(69, 'tax_rate.update', 'web', '2024-10-25 16:35:35', NULL),
(70, 'tax_rate.delete', 'web', '2024-10-25 16:35:35', NULL),
(71, 'unit.view', 'web', '2024-10-25 16:35:35', NULL),
(72, 'unit.create', 'web', '2024-10-25 16:35:35', NULL),
(73, 'unit.update', 'web', '2024-10-25 16:35:35', NULL),
(74, 'unit.delete', 'web', '2024-10-25 16:35:35', NULL),
(75, 'category.view', 'web', '2024-10-25 16:35:35', NULL),
(76, 'category.create', 'web', '2024-10-25 16:35:35', NULL),
(77, 'category.update', 'web', '2024-10-25 16:35:35', NULL),
(78, 'category.delete', 'web', '2024-10-25 16:35:35', NULL),
(79, 'expense.access', 'web', '2024-10-25 16:35:35', NULL),
(80, 'access_all_locations', 'web', '2024-10-25 16:35:35', NULL),
(81, 'dashboard.data', 'web', '2024-10-25 16:35:35', NULL),
(82, 'location.1', 'web', '2024-10-25 16:39:24', '2024-10-25 16:39:24'),
(83, 'location.2', 'web', '2024-10-29 03:26:47', '2024-10-29 03:26:47'),
(84, 'essentials.create_message', 'web', '2024-11-03 04:26:40', '2024-11-03 04:26:40'),
(85, 'essentials.view_message', 'web', '2024-11-03 04:26:40', '2024-11-03 04:26:40'),
(86, 'manufacturing.access_recipe', 'web', '2024-11-03 04:26:41', '2024-11-03 04:26:41'),
(87, 'manufacturing.access_production', 'web', '2024-11-03 04:26:41', '2024-11-03 04:26:41'),
(88, 'manufacturing.add_recipe', 'web', '2024-11-03 04:26:41', '2024-11-03 04:26:41'),
(89, 'manufacturing.edit_recipe', 'web', '2024-11-03 04:26:41', '2024-11-03 04:26:41'),
(90, 'essentials.approve_leave', 'web', '2024-11-03 04:26:41', '2024-11-03 04:26:41'),
(91, 'essentials.assign_todos', 'web', '2024-11-03 04:26:41', '2024-11-03 04:26:41'),
(92, 'essentials.add_allowance_and_deduction', 'web', '2024-11-03 04:26:41', '2024-11-03 04:26:41'),
(93, 'selling_price_group.1', 'web', '2024-11-03 04:45:06', '2024-11-03 04:45:06'),
(94, 'selling_price_group.2', 'web', '2024-11-03 05:29:42', '2024-11-03 05:29:42'),
(95, 'poscustom.enabled', 'web', '2025-02-01 18:52:33', '2025-02-01 18:52:33'),
(96, 'project.create_project', 'web', '2025-02-01 18:59:09', '2025-02-01 18:59:09'),
(97, 'project.edit_project', 'web', '2025-02-01 18:59:09', '2025-02-01 18:59:09'),
(98, 'project.delete_project', 'web', '2025-02-01 18:59:09', '2025-02-01 18:59:09'),
(99, 'woocommerce.syc_categories', 'web', '2025-02-01 19:14:36', '2025-02-01 19:14:36'),
(100, 'woocommerce.sync_products', 'web', '2025-02-01 19:14:36', '2025-02-01 19:14:36'),
(101, 'woocommerce.sync_orders', 'web', '2025-02-01 19:14:36', '2025-02-01 19:14:36'),
(102, 'woocommerce.map_tax_rates', 'web', '2025-02-01 19:14:36', '2025-02-01 19:14:36'),
(103, 'woocommerce.access_woocommerce_api_settings', 'web', '2025-02-01 19:14:36', '2025-02-01 19:14:36'),
(104, 'repair.create', 'web', '2025-02-01 19:15:01', '2025-02-01 19:15:01'),
(105, 'repair.update', 'web', '2025-02-01 19:15:01', '2025-02-01 19:15:01'),
(106, 'repair.view', 'web', '2025-02-01 19:15:01', '2025-02-01 19:15:01'),
(107, 'repair.delete', 'web', '2025-02-01 19:15:01', '2025-02-01 19:15:01'),
(108, 'repair_status.update', 'web', '2025-02-01 19:15:01', '2025-02-01 19:15:01'),
(109, 'repair_status.access', 'web', '2025-02-01 19:15:01', '2025-02-01 19:15:01'),
(110, 'location.3', 'web', '2025-02-14 18:51:43', '2025-02-14 18:51:43'),
(111, 'selling_price_group.3', 'web', '2025-02-14 17:35:16', '2025-02-14 17:35:16'),
(112, 'location.4', 'web', '2025-02-17 06:46:51', '2025-02-17 06:46:51'),
(113, 'view_export_buttons', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(114, 'edit_purchase_payment', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(115, 'edit_pos_payment', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(116, 'view_paid_sells_only', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(117, 'view_due_sells_only', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(118, 'view_partial_sells_only', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(119, 'view_overdue_sells_only', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(120, 'direct_sell.update', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(121, 'view_commission_agent_sell', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(122, 'edit_sell_payment', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(123, 'access_sell_return', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(124, 'access_own_sell_return', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(125, 'edit_invoice_number', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(126, 'draft.update', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(127, 'draft.delete', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(128, 'quotation.update', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(129, 'quotation.delete', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(130, 'access_pending_shipments_only', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(131, 'access_commission_agent_shipping', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(132, 'expense.add', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(133, 'expense.edit', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(134, 'customer.view_own', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(135, 'customer_irrespective_of_sell', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(136, 'draft.view_own', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(137, 'quotation.view_own', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(138, 'access_own_shipping', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(139, 'view_own_expense', 'web', '2025-02-17 05:50:49', '2025-02-17 05:50:49'),
(140, 'selling_price_group.4', 'web', '2025-02-17 06:00:27', '2025-02-17 06:00:27'),
(141, 'selling_price_group.5', 'web', '2025-02-17 06:02:07', '2025-02-17 06:02:07'),
(142, 'selling_price_group.6', 'web', '2025-02-17 06:03:35', '2025-02-17 06:03:35'),
(143, 'location.5', 'web', '2025-02-23 06:21:29', '2025-02-23 06:21:29'),
(144, 'view_product_stock_value', 'web', '2025-02-24 06:58:23', '2025-02-24 06:58:23'),
(145, 'access_printers', 'web', '2025-02-24 06:58:23', '2025-02-24 06:58:23'),
(146, 'edit_account_transaction', 'web', '2025-02-24 06:58:23', '2025-02-24 06:58:23'),
(147, 'inventorymanagement.view', 'web', '2025-02-24 06:58:23', '2025-02-24 06:58:23'),
(148, 'inventorymanagement.empty', 'web', '2025-02-24 06:58:23', '2025-02-24 06:58:23'),
(149, 'disable_pay_checkout', 'web', '2025-02-24 09:34:06', '2025-02-24 09:34:06'),
(150, 'disable_draft', 'web', '2025-02-24 09:34:06', '2025-02-24 09:34:06'),
(151, 'disable_express_checkout', 'web', '2025-02-24 09:34:06', '2025-02-24 09:34:06'),
(152, 'disable_discount', 'web', '2025-02-24 09:34:06', '2025-02-24 09:34:06'),
(153, 'disable_suspend_sale', 'web', '2025-02-24 09:34:06', '2025-02-24 09:34:06'),
(154, 'disable_credit_sale', 'web', '2025-02-24 09:34:06', '2025-02-24 09:34:06'),
(155, 'disable_quotation', 'web', '2025-02-24 09:34:06', '2025-02-24 09:34:06'),
(156, 'disable_card', 'web', '2025-02-24 09:34:06', '2025-02-24 09:34:06'),
(157, 'expense.delete', 'web', '2025-02-24 09:34:06', '2025-02-24 09:34:06'),
(158, 'supplier.view_own', 'web', '2025-02-24 09:34:06', '2025-02-24 09:34:06'),
(159, 'view_own_purchase', 'web', '2025-02-24 09:34:06', '2025-02-24 09:34:06'),
(160, 'purchase_requisition.create', 'web', '2025-02-24 09:42:54', '2025-02-24 09:42:54'),
(161, 'purchase_requisition.delete', 'web', '2025-02-24 09:42:54', '2025-02-24 09:42:54'),
(162, 'purchase_order.create', 'web', '2025-02-24 09:42:54', '2025-02-24 09:42:54'),
(163, 'purchase_order.update', 'web', '2025-02-24 09:42:54', '2025-02-24 09:42:54'),
(164, 'purchase_order.delete', 'web', '2025-02-24 09:42:54', '2025-02-24 09:42:54'),
(165, 'purchase_requisition.view_own', 'web', '2025-02-24 09:42:54', '2025-02-24 09:42:54'),
(166, 'purchase_order.view_own', 'web', '2025-02-24 09:42:54', '2025-02-24 09:42:54'),
(167, 'location.6', 'web', '2025-03-09 21:45:09', '2025-03-09 21:45:09'),
(168, 'draft.view_all', 'web', '2025-03-12 18:48:09', '2025-03-12 18:48:09'),
(169, 'quotation.view_all', 'web', '2025-03-12 18:48:09', '2025-03-12 18:48:09'),
(170, 'selling_price_group.7', 'web', '2025-03-13 16:46:27', '2025-03-13 16:46:27'),
(171, 'location.7', 'web', '2025-03-21 14:09:02', '2025-03-21 14:09:02'),
(172, 'location.8', 'web', '2025-04-03 13:38:09', '2025-04-03 13:38:09'),
(173, 'location.9', 'web', '2025-04-25 19:07:48', '2025-04-25 19:07:48'),
(174, 'location.10', 'web', '2025-04-25 19:16:11', '2025-04-25 19:16:11'),
(175, 'selling_price_group.8', 'web', '2025-04-26 03:38:58', '2025-04-26 03:38:58'),
(176, 'selling_price_group.9', 'web', '2025-04-26 03:39:08', '2025-04-26 03:39:08'),
(177, 'selling_price_group.10', 'web', '2025-04-26 03:39:18', '2025-04-26 03:39:18'),
(178, 'selling_price_group.11', 'web', '2025-04-26 03:39:37', '2025-04-26 03:39:37'),
(179, 'selling_price_group.12', 'web', '2025-04-26 03:39:52', '2025-04-26 03:39:52'),
(180, 'selling_price_group.13', 'web', '2025-04-26 03:40:16', '2025-04-26 03:40:16'),
(181, 'selling_price_group.14', 'web', '2025-04-26 08:43:39', '2025-04-26 08:43:39'),
(182, 'location.11', 'web', '2025-04-29 06:08:51', '2025-04-29 06:08:51'),
(183, 'location.12', 'web', '2025-06-02 07:35:33', '2025-06-02 07:35:33'),
(184, 'location.13', 'web', '2025-06-08 19:48:05', '2025-06-08 19:48:05'),
(185, 'location.14', 'web', '2025-06-09 00:14:59', '2025-06-09 00:14:59'),
(186, 'location.15', 'web', '2025-07-14 07:24:17', '2025-07-14 07:24:17'),
(187, 'location.16', 'web', '2025-09-07 12:54:54', '2025-09-07 12:54:54'),
(188, 'AdvancedReports.view', 'web', '2025-11-10 15:15:20', '2025-11-10 15:15:20'),
(189, 'AdvancedReports.cash_flow_report', 'web', '2025-11-10 15:15:20', '2025-11-10 15:15:20'),
(190, 'AdvancedReports.purchase_analysis_report', 'web', '2025-11-10 15:15:20', '2025-11-10 15:15:20'),
(191, 'selling_price_group.15', 'web', '2026-01-10 08:03:00', '2026-01-10 08:03:00'),
(192, 'businessmanagement.view', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(193, 'businessmanagement.purchase_register', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(194, 'businessmanagement.sales_register', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(195, 'businessmanagement.stock_register', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(196, 'businessmanagement.accounts_register', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(197, 'businessmanagement.purchase_register.date_wise_purchase', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(198, 'businessmanagement.purchase_register.supplier_wise_purchase', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(199, 'businessmanagement.purchase_register.supplier_wise_purchase_wop', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(200, 'businessmanagement.purchase_register.product_wise_purchase', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(201, 'businessmanagement.purchase_register.product_wise_purchase_wop', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(202, 'businessmanagement.purchase_register.location_wise_net_product_purchase', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(203, 'businessmanagement.purchase_register.date_wise_net_product_purchase', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(204, 'businessmanagement.purchase_register.supplier_wise_statement', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(205, 'businessmanagement.purchase_register.supplier_and_product_wise_purchase', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(206, 'businessmanagement.purchase_register.purchased_product_movement', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(207, 'businessmanagement.purchase_register.supplier_wise_purchase_return', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(208, 'businessmanagement.purchase_register.date_wise_purchase_return', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(209, 'businessmanagement.purchase_register.product_wise_purchase_return', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(210, 'businessmanagement.purchase_register.date_wise_purchase_order', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(211, 'businessmanagement.purchase_register.supplier_wise_purchase_order', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(212, 'businessmanagement.sales_register.date_wise_sales', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(213, 'businessmanagement.sales_register.product_wise_sales', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(214, 'businessmanagement.sales_register.customer_wise_sales', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(215, 'businessmanagement.sales_register.date_wise_net_product_sales', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(216, 'businessmanagement.sales_register.customer_wise_net_product_sales', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(217, 'businessmanagement.sales_register.date_wise_gross_profit', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(218, 'businessmanagement.sales_register.product_wise_gross_profit', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(219, 'businessmanagement.sales_register.date_wise_sales_return', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(220, 'businessmanagement.sales_register.product_wise_sales_return', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(221, 'businessmanagement.sales_register.customer_wise_sales_return', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(222, 'businessmanagement.sales_register.explicit_product_wise_sales', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(223, 'businessmanagement.sales_register.customer_wise_statement', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(224, 'businessmanagement.sales_register.product_group_wise_net_sales', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(225, 'businessmanagement.sales_register.product_wise_sales_summary', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(226, 'businessmanagement.sales_register.date_wise_sales_summary', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(227, 'businessmanagement.sales_register.product_group_wise_net_sales_mpo', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(228, 'businessmanagement.sales_register.customer_wise_sales_summary', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(229, 'businessmanagement.sales_register.customer_wise_invoice_status', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(230, 'businessmanagement.sales_register.date_wise_sales_invoice', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(231, 'businessmanagement.sales_register.customer_wise_gross_profit', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(232, 'businessmanagement.sales_register.product_wise_net_profit', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(233, 'businessmanagement.sales_register.customer_wise_sales_with_serial', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(234, 'businessmanagement.sales_register.product_wise_sales_with_serial', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(235, 'businessmanagement.sales_register.daily_sales_details', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(236, 'businessmanagement.stock_register.current_stock_combined', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(237, 'businessmanagement.stock_register.current_stock_c', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(238, 'businessmanagement.stock_register.current_stock_with_serial', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(239, 'businessmanagement.stock_register.combined_current_stock_all_br_summary', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(240, 'businessmanagement.stock_register.date_wise_product_status', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(241, 'businessmanagement.stock_register.date_wise_stock', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(242, 'businessmanagement.stock_register.product_price_list', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(243, 'businessmanagement.stock_register.supplier_wise_current_stock', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(244, 'businessmanagement.stock_register.date_wise_product_in_out_statement', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(245, 'businessmanagement.stock_register.date_wise_stock_serial_m', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(246, 'businessmanagement.accounts_register.due_list', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(247, 'businessmanagement.accounts_register.all_customers_due_list', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(248, 'businessmanagement.accounts_register.supplier_due_list', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(249, 'businessmanagement.accounts_register.customer_accounts_ledger', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(250, 'businessmanagement.accounts_register.cash_book', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(251, 'businessmanagement.accounts_register.date_wise_credit_voucher', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(252, 'businessmanagement.accounts_register.date_wise_debit_voucher', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(253, 'businessmanagement.accounts_register.income_statement', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(254, 'businessmanagement.accounts_register.day_book', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(255, 'businessmanagement.accounts_register.due_list_without_treatment', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(256, 'businessmanagement.accounts_register.date_wise_sales_received', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(257, 'businessmanagement.accounts_register.balance_sheet', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(258, 'businessmanagement.accounts_register.date_wise_general_expenses', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(259, 'businessmanagement.accounts_register.accounts_receivable', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(260, 'businessmanagement.accounts_register.accounts_payable', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(261, 'businessmanagement.accounts_register.customer_due_with_ageing', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(262, 'businessmanagement.accounts_register.cash_flows', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(263, 'businessmanagement.accounts_register.date_wise_receipt_payment_statement', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(264, 'businessmanagement.accounts_register.date_wise_receive', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(265, 'businessmanagement.accounts_register.date_wise_sales_with_profit', 'web', '2026-01-13 19:51:18', '2026-01-13 19:51:18'),
(266, 'businessmanagement.daybook.view', 'web', '2026-01-13 19:51:20', '2026-01-13 19:51:20'),
(267, 'businessmanagement.daybook.export', 'web', '2026-01-13 19:51:20', '2026-01-13 19:51:20'),
(268, 'accounting.view_all', 'web', '2026-01-13 20:14:08', '2026-01-13 20:14:08'),
(269, 'accounting.view_trial_balance', 'web', '2026-01-13 20:14:08', '2026-01-13 20:14:08'),
(270, 'accounting.view_balance_sheet', 'web', '2026-01-13 20:14:08', '2026-01-13 20:14:08'),
(271, 'accounting.view_pl', 'web', '2026-01-13 20:14:08', '2026-01-13 20:14:08'),
(272, 'accounting.view_cashflow', 'web', '2026-01-13 20:14:08', '2026-01-13 20:14:08'),
(273, 'accounting.view_ar', 'web', '2026-01-13 20:14:08', '2026-01-13 20:14:08'),
(274, 'accounting.view_ap', 'web', '2026-01-13 20:14:08', '2026-01-13 20:14:08'),
(275, 'accounting.view_daybook', 'web', '2026-01-13 20:14:08', '2026-01-13 20:14:08'),
(276, 'accounting.view_cashbook', 'web', '2026-01-13 20:14:08', '2026-01-13 20:14:08'),
(277, 'accounting.view_bankbook', 'web', '2026-01-13 20:14:08', '2026-01-13 20:14:08'),
(278, 'accounting.export_reports', 'web', '2026-01-13 20:14:08', '2026-01-13 20:14:08'),
(279, 'accounting.print_multi_account', 'web', '2026-01-13 20:14:08', '2026-01-13 20:14:08'),
(280, 'backup_management.create_backup', 'web', '2026-01-13 20:55:19', '2026-01-13 20:55:19'),
(281, 'backup_management.view_backup', 'web', '2026-01-13 20:55:19', '2026-01-13 20:55:19'),
(282, 'backup_management.download_backup', 'web', '2026-01-13 20:55:19', '2026-01-13 20:55:19'),
(283, 'backup_management.delete_backup', 'web', '2026-01-13 20:55:19', '2026-01-13 20:55:19'),
(284, 'backup_management.restore_backup', 'web', '2026-01-13 20:55:19', '2026-01-13 20:55:19'),
(285, 'location.17', 'web', '2026-01-24 11:38:53', '2026-01-24 11:38:53'),
(286, 'location.18', 'web', '2026-02-24 02:37:33', '2026-02-24 02:37:33'),
(287, 'accounting.view_journals', 'web', '2026-04-02 14:55:36', '2026-04-02 14:55:36'),
(288, 'delete_sell_payment', 'web', '2026-04-02 16:15:06', '2026-04-02 16:15:06'),
(289, 'AdvancedReports.export', 'web', '2026-04-02 16:15:06', '2026-04-02 16:15:06'),
(290, 'AdvancedReports.sales_report', 'web', '2026-04-02 16:15:06', '2026-04-02 16:15:06'),
(291, 'AdvancedReports.sales_detail_report', 'web', '2026-04-02 16:15:06', '2026-04-02 16:15:06'),
(292, 'AdvancedReports.customer_monthly_sales', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(293, 'AdvancedReports.itemwise_sales_report', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(294, 'AdvancedReports.daily_report', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(295, 'AdvancedReports.daily_summary_report', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(296, 'AdvancedReports.inventory_turnover', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(297, 'AdvancedReports.customer_lifetime_value', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(298, 'AdvancedReports.customer_behavior', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(299, 'AdvancedReports.customer_segmentation', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(300, 'AdvancedReports.gst_sales_report', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(301, 'AdvancedReports.gst_purchase_report', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(302, 'AdvancedReports.expense_monthly_report', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(303, 'AdvancedReports.operations_summary_report', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(304, 'AdvancedReports.customer_group_performance', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(305, 'dailystockhistory.view', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(306, 'dailystockhistory.access', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(307, 'daybook.view', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(308, 'daybook.export', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(309, 'essentials.crud_leave_type', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(310, 'essentials.allow_users_for_attendance_from_web', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(311, 'essentials.allow_users_for_attendance_from_api', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(312, 'essentials.view_allowance_and_deduction', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(313, 'essentials.crud_department', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(314, 'essentials.crud_designation', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(315, 'essentials.view_all_payroll', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(316, 'essentials.create_payroll', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(317, 'essentials.update_payroll', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(318, 'essentials.add_todos', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(319, 'essentials.edit_todos', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(320, 'essentials.access_sales_target', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(321, 'exchange.access', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(322, 'exchange.view', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(323, 'exchange.create', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(324, 'exchange.cancel', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(325, 'exchange.delete', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(326, 'exchange.export', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(327, 'exchange.print', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(328, 'rma.view', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(329, 'rma.complain_receive', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(330, 'rma.replace_out', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(331, 'rma.replace_in', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(332, 'rma.replacement_delivery', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(333, 'rma.diagnosis', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(334, 'rma.item_utilize', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(335, 'rma.problem_setup', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(336, 'rma.serial_history', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(337, 'rma.service_bill', 'web', '2026-04-02 16:15:07', '2026-04-02 16:15:07'),
(338, 'rma.engineer_fixing', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(339, 'rma.approve', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(340, 'job_sheet.create', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(341, 'job_sheet.edit', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(342, 'access.spreadsheet', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(343, 'create.spreadsheet', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(344, 'StockRecalculation.view', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(345, 'StockRecalculation.manage', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(346, 'StockRecalculation.backup', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(347, 'StockRecalculation.recalculate', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(348, 'StockRecalculation.audit', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(349, 'StockRecalculation.export', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(350, 'essentials.crud_own_leave', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(351, 'essentials.view_own_attendance', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(352, 'repair.view_own', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(353, 'job_sheet.view_all', 'web', '2026-04-02 16:15:08', '2026-04-02 16:15:08'),
(354, 'location.19', 'web', '2026-04-02 16:17:59', '2026-04-02 16:17:59');

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

--
-- Table structure for table `pjt_invoice_lines`
--

CREATE TABLE `pjt_invoice_lines` (
  `id` int(10) UNSIGNED NOT NULL,
  `transaction_id` int(10) UNSIGNED NOT NULL,
  `task` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `rate` decimal(22,4) NOT NULL,
  `tax_rate_id` int(11) DEFAULT NULL,
  `quantity` decimal(22,4) NOT NULL,
  `total` decimal(22,4) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pjt_projects`
--

CREATE TABLE `pjt_projects` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `name` varchar(191) NOT NULL,
  `contact_id` int(11) DEFAULT NULL,
  `status` enum('not_started','in_progress','on_hold','cancelled','completed') NOT NULL,
  `lead_id` int(11) NOT NULL,
  `start_date` datetime DEFAULT NULL,
  `end_date` datetime DEFAULT NULL,
  `description` text DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `settings` text DEFAULT NULL,
  `custom_field1` varchar(191) DEFAULT NULL,
  `custom_field2` varchar(191) DEFAULT NULL,
  `custom_field3` varchar(191) DEFAULT NULL,
  `custom_field4` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pjt_project_members`
--

CREATE TABLE `pjt_project_members` (
  `id` int(10) UNSIGNED NOT NULL,
  `project_id` int(10) UNSIGNED NOT NULL,
  `user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pjt_project_tasks`
--

CREATE TABLE `pjt_project_tasks` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `project_id` int(10) UNSIGNED NOT NULL,
  `task_id` varchar(191) NOT NULL,
  `subject` varchar(191) NOT NULL,
  `start_date` datetime DEFAULT NULL,
  `due_date` datetime DEFAULT NULL,
  `priority` enum('low','medium','high','urgent') NOT NULL DEFAULT 'low',
  `description` text DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `status` enum('completed','not_started','in_progress','on_hold','cancelled') NOT NULL DEFAULT 'not_started',
  `custom_field_1` varchar(191) DEFAULT NULL,
  `custom_field_2` varchar(191) DEFAULT NULL,
  `custom_field_3` varchar(191) DEFAULT NULL,
  `custom_field_4` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pjt_project_task_comments`
--

CREATE TABLE `pjt_project_task_comments` (
  `id` int(10) UNSIGNED NOT NULL,
  `project_task_id` int(10) UNSIGNED NOT NULL,
  `comment` text NOT NULL,
  `commented_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pjt_project_task_members`
--

CREATE TABLE `pjt_project_task_members` (
  `id` int(10) UNSIGNED NOT NULL,
  `project_task_id` int(10) UNSIGNED NOT NULL,
  `user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `pjt_project_time_logs`
--

CREATE TABLE `pjt_project_time_logs` (
  `id` int(10) UNSIGNED NOT NULL,
  `project_id` int(10) UNSIGNED NOT NULL,
  `project_task_id` int(10) UNSIGNED DEFAULT NULL,
  `user_id` int(11) NOT NULL,
  `start_datetime` datetime NOT NULL,
  `end_datetime` datetime NOT NULL,
  `note` text DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `premade_lines`
--

CREATE TABLE `premade_lines` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `premade_product_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `variation_id` int(10) UNSIGNED NOT NULL,
  `sub_unit_id` int(11) DEFAULT NULL,
  `sell_unit_id` int(11) DEFAULT NULL,
  `quantity` decimal(22,4) NOT NULL,
  `premade_price` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `premade_price_inc_tax` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `printers`
--

CREATE TABLE `printers` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `category_id` int(11) DEFAULT NULL,
  `name` varchar(191) NOT NULL,
  `connection_type` enum('network','windows','linux') NOT NULL,
  `capability_profile` enum('default','simple','SP2000','TEP-200M','P822D') NOT NULL DEFAULT 'default',
  `char_per_line` varchar(191) DEFAULT NULL,
  `ip_address` varchar(191) DEFAULT NULL,
  `port` varchar(191) DEFAULT NULL,
  `path` varchar(191) DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `type` enum('single','variable','modifier','combo') DEFAULT NULL,
  `unit_id` int(10) UNSIGNED DEFAULT NULL,
  `secondary_unit_id` int(11) DEFAULT NULL,
  `sub_unit_ids` text DEFAULT NULL,
  `brand_id` int(10) UNSIGNED DEFAULT NULL,
  `supplier_id` int(10) UNSIGNED DEFAULT NULL,
  `category_id` int(10) UNSIGNED DEFAULT NULL,
  `sub_category_id` int(10) UNSIGNED DEFAULT NULL,
  `discount_id` int(10) UNSIGNED DEFAULT NULL,
  `tax` int(10) UNSIGNED DEFAULT NULL,
  `tax_type` enum('inclusive','exclusive') NOT NULL,
  `enable_stock` tinyint(1) NOT NULL DEFAULT 0,
  `alert_quantity` decimal(22,4) DEFAULT NULL,
  `sku` varchar(191) NOT NULL,
  `barcode_type` enum('C39','C128','EAN13','EAN8','UPCA','UPCE') DEFAULT 'C128',
  `expiry_period` decimal(4,2) DEFAULT NULL,
  `expiry_period_type` enum('days','months') DEFAULT NULL,
  `enable_sr_no` tinyint(1) NOT NULL DEFAULT 0,
  `enable_serial_number` tinyint(1) NOT NULL DEFAULT 0,
  `weight` varchar(191) DEFAULT NULL,
  `pre_made` tinyint(4) NOT NULL DEFAULT 0,
  `use_multi_unit` tinyint(1) NOT NULL DEFAULT 0,
  `first_conversion_unit_id` int(10) UNSIGNED DEFAULT NULL,
  `first_conversion_unit_rate` decimal(20,4) DEFAULT NULL,
  `second_conversion_unit_id` int(10) UNSIGNED DEFAULT NULL,
  `second_conversion_unit_rate` decimal(20,4) DEFAULT NULL,
  `product_custom_field1` varchar(191) DEFAULT NULL,
  `product_custom_field2` varchar(191) DEFAULT NULL,
  `product_custom_field3` varchar(191) DEFAULT NULL,
  `product_custom_field4` varchar(191) DEFAULT NULL,
  `product_custom_field5` varchar(191) DEFAULT NULL,
  `product_custom_field6` varchar(191) DEFAULT NULL,
  `product_custom_field7` varchar(191) DEFAULT NULL,
  `product_custom_field8` varchar(191) DEFAULT NULL,
  `product_custom_field9` varchar(191) DEFAULT NULL,
  `product_custom_field10` varchar(191) DEFAULT NULL,
  `product_custom_field11` varchar(191) DEFAULT NULL,
  `product_custom_field12` varchar(191) DEFAULT NULL,
  `product_custom_field13` varchar(191) DEFAULT NULL,
  `product_custom_field14` varchar(191) DEFAULT NULL,
  `product_custom_field15` varchar(191) DEFAULT NULL,
  `product_custom_field16` varchar(191) DEFAULT NULL,
  `product_custom_field17` varchar(191) DEFAULT NULL,
  `product_custom_field18` varchar(191) DEFAULT NULL,
  `product_custom_field19` varchar(191) DEFAULT NULL,
  `product_custom_field20` varchar(191) DEFAULT NULL,
  `image` varchar(191) DEFAULT NULL,
  `woocommerce_media_id` int(11) DEFAULT NULL,
  `product_description` text DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `woocommerce_product_id` int(11) DEFAULT NULL,
  `woocommerce_disable_sync` tinyint(1) NOT NULL DEFAULT 0,
  `preparation_time_in_minutes` int(11) DEFAULT NULL,
  `warranty_id` int(11) DEFAULT NULL,
  `is_inactive` tinyint(1) NOT NULL DEFAULT 0,
  `repair_model_id` int(10) UNSIGNED DEFAULT NULL,
  `not_for_selling` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `status_modifier` enum('enabled','disabled') DEFAULT 'enabled'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `products`
--

INSERT INTO `products` (`id`, `name`, `business_id`, `type`, `unit_id`, `secondary_unit_id`, `sub_unit_ids`, `brand_id`, `supplier_id`, `category_id`, `sub_category_id`, `discount_id`, `tax`, `tax_type`, `enable_stock`, `alert_quantity`, `sku`, `barcode_type`, `expiry_period`, `expiry_period_type`, `enable_sr_no`, `enable_serial_number`, `weight`, `pre_made`, `use_multi_unit`, `first_conversion_unit_id`, `first_conversion_unit_rate`, `second_conversion_unit_id`, `second_conversion_unit_rate`, `product_custom_field1`, `product_custom_field2`, `product_custom_field3`, `product_custom_field4`, `product_custom_field5`, `product_custom_field6`, `product_custom_field7`, `product_custom_field8`, `product_custom_field9`, `product_custom_field10`, `product_custom_field11`, `product_custom_field12`, `product_custom_field13`, `product_custom_field14`, `product_custom_field15`, `product_custom_field16`, `product_custom_field17`, `product_custom_field18`, `product_custom_field19`, `product_custom_field20`, `image`, `woocommerce_media_id`, `product_description`, `created_by`, `woocommerce_product_id`, `woocommerce_disable_sync`, `preparation_time_in_minutes`, `warranty_id`, `is_inactive`, `repair_model_id`, `not_for_selling`, `created_at`, `updated_at`, `status_modifier`) VALUES
(2216, 'Lux Small Rose', 1, 'single', 1, NULL, NULL, 145, NULL, 410, NULL, 0, NULL, 'exclusive', 1, 10.0000, '123', 'C128', NULL, NULL, 0, 0, NULL, 0, 0, NULL, NULL, NULL, NULL, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '1775152503_FlyerDesign29july(1).jpg', NULL, NULL, 1, NULL, 0, NULL, NULL, 0, NULL, 0, '2026-04-02 17:53:21', '2026-04-02 17:55:03', 'enabled'),
(2217, 'Samsung A123', 1, 'single', 1, NULL, NULL, 148, NULL, 414, NULL, 0, NULL, 'exclusive', 1, 5.0000, 's1', 'C128', NULL, NULL, 1, 1, NULL, 0, 0, NULL, NULL, NULL, NULL, '0', '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '1775152855_R3.jpg', NULL, NULL, 1, NULL, 0, NULL, 24, 0, NULL, 0, '2026-04-02 17:58:42', '2026-04-02 18:00:55', 'enabled'),
(2218, 'iphone 17', 1, 'single', 1, NULL, NULL, 149, NULL, 414, NULL, NULL, NULL, 'exclusive', 1, 3.0000, 'iphone17', 'C128', NULL, NULL, 1, 1, NULL, 0, 0, NULL, NULL, NULL, NULL, '0', '9', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 0, NULL, 25, 0, NULL, 0, '2026-04-02 18:03:14', '2026-04-02 18:03:14', 'enabled'),
(2219, 'Lux Big Rose', 1, 'single', 1, NULL, NULL, 145, NULL, 410, NULL, NULL, NULL, 'exclusive', 1, NULL, 'LX12', 'C128', NULL, NULL, 0, 0, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 0, NULL, NULL, 0, NULL, 0, '2026-04-02 18:05:20', '2026-04-02 18:05:20', 'enabled'),
(2220, 'Lux Combo', 1, 'combo', 1, NULL, NULL, 145, NULL, 410, NULL, NULL, NULL, 'exclusive', 0, 0.0000, 'cmbp1', 'C128', NULL, NULL, 0, 0, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '<p>only testing</p>', 1, NULL, 0, NULL, NULL, 0, NULL, 0, '2026-04-02 18:16:12', '2026-04-02 18:16:12', 'enabled');

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

--
-- Table structure for table `product_locations`
--

CREATE TABLE `product_locations` (
  `product_id` int(11) NOT NULL,
  `location_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_locations`
--

INSERT INTO `product_locations` (`product_id`, `location_id`) VALUES
(2216, 19),
(2217, 1),
(2218, 1),
(2217, 19),
(2219, 19),
(2220, 19);

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

--
-- Table structure for table `product_racks`
--

CREATE TABLE `product_racks` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `location_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `rack` varchar(191) DEFAULT NULL,
  `row` varchar(191) DEFAULT NULL,
  `position` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_racks`
--

INSERT INTO `product_racks` (`id`, `business_id`, `location_id`, `product_id`, `rack`, `row`, `position`, `created_at`, `updated_at`) VALUES
(232, 1, 1, 2220, NULL, NULL, NULL, '2026-04-02 18:16:12', '2026-04-02 18:16:12'),
(233, 1, 19, 2220, NULL, NULL, NULL, '2026-04-02 18:16:12', '2026-04-02 18:16:12');

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

--
-- Table structure for table `product_variations`
--

CREATE TABLE `product_variations` (
  `id` int(10) UNSIGNED NOT NULL,
  `variation_template_id` int(11) DEFAULT NULL,
  `name` varchar(191) NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `is_dummy` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `product_variations`
--

INSERT INTO `product_variations` (`id`, `variation_template_id`, `name`, `product_id`, `is_dummy`, `created_at`, `updated_at`) VALUES
(2216, NULL, 'DUMMY', 2216, 1, '2026-04-02 17:53:21', '2026-04-02 17:53:21'),
(2217, NULL, 'DUMMY', 2217, 1, '2026-04-02 17:58:42', '2026-04-02 17:58:42'),
(2218, NULL, 'DUMMY', 2218, 1, '2026-04-02 18:03:14', '2026-04-02 18:03:14'),
(2219, NULL, 'DUMMY', 2219, 1, '2026-04-02 18:05:20', '2026-04-02 18:05:20'),
(2220, NULL, 'DUMMY', 2220, 1, '2026-04-02 18:16:12', '2026-04-02 18:16:12');

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

--
-- Table structure for table `promotions`
--

CREATE TABLE `promotions` (
  `id` int(10) UNSIGNED NOT NULL,
  `promotion_type` enum('product_discount','buy_x_get_y') NOT NULL DEFAULT 'product_discount',
  `business_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED DEFAULT NULL,
  `get_product_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'Product to get free/discounted (for Buy X Get Y). Null means same product.',
  `get_variation_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'Variation to get free/discounted (for Buy X Get Y). Null means all variations.',
  `variation_id` int(10) UNSIGNED DEFAULT NULL,
  `name` varchar(191) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `discount_percentage` decimal(5,2) NOT NULL,
  `buy_quantity` int(11) DEFAULT NULL COMMENT 'X quantity - buy this many',
  `get_quantity` int(11) DEFAULT NULL COMMENT 'Y quantity - get this many free/discounted',
  `get_discount_type` enum('free','percentage','fixed') DEFAULT NULL COMMENT 'Type of discount for Y items',
  `get_discount_value` decimal(10,2) DEFAULT NULL COMMENT 'Discount value (percentage or fixed amount)',
  `daily_quantity_limit` int(11) DEFAULT NULL COMMENT 'Daily limit for quantity (pieces) - null means unlimited',
  `daily_invoice_limit` int(11) DEFAULT NULL COMMENT 'Daily limit for invoices - null means unlimited',
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `location_id` int(10) UNSIGNED DEFAULT NULL,
  `created_by` int(10) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `promotion_audit_logs`
--

CREATE TABLE `promotion_audit_logs` (
  `id` int(10) UNSIGNED NOT NULL,
  `promotion_id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `action` varchar(191) NOT NULL,
  `old_values` text DEFAULT NULL,
  `new_values` text DEFAULT NULL,
  `changes` text DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `promotion_daily_usage`
--

CREATE TABLE `promotion_daily_usage` (
  `id` int(10) UNSIGNED NOT NULL,
  `promotion_id` int(10) UNSIGNED NOT NULL,
  `usage_date` date NOT NULL,
  `quantity_used` int(11) NOT NULL DEFAULT 0 COMMENT 'Total quantity sold today',
  `invoice_count` int(11) NOT NULL DEFAULT 0 COMMENT 'Total invoices with this promotion today',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `promotion_templates`
--

CREATE TABLE `promotion_templates` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `promotion_type` varchar(191) NOT NULL,
  `template_data` text NOT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `purchase_lines`
--

CREATE TABLE `purchase_lines` (
  `id` int(10) UNSIGNED NOT NULL,
  `transaction_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `variation_id` int(10) UNSIGNED NOT NULL,
  `quantity` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `serial_purchase_code` varchar(191) DEFAULT NULL,
  `secondary_unit_quantity` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `pp_without_discount` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Purchase price before inline discounts',
  `discount_percent` decimal(5,2) NOT NULL DEFAULT 0.00 COMMENT 'Inline discount percentage',
  `purchase_price` decimal(22,4) NOT NULL,
  `purchase_price_inc_tax` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `item_tax` decimal(22,4) NOT NULL COMMENT 'Tax for one quantity',
  `tax_id` int(10) UNSIGNED DEFAULT NULL,
  `line_discount_type` enum('fixed','percentage') DEFAULT NULL,
  `line_discount_amount` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `purchase_requisition_line_id` int(11) DEFAULT NULL,
  `purchase_order_line_id` int(11) DEFAULT NULL,
  `quantity_sold` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Quanity sold from this purchase line',
  `quantity_adjusted` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Quanity adjusted in stock adjustment from this purchase line',
  `quantity_returned` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `po_quantity_purchased` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `mfg_quantity_used` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `mfg_date` date DEFAULT NULL,
  `exp_date` date DEFAULT NULL,
  `lot_number` varchar(191) DEFAULT NULL,
  `sub_unit_id` int(11) DEFAULT NULL,
  `transfer_return` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `purchase_lines`
--

INSERT INTO `purchase_lines` (`id`, `transaction_id`, `product_id`, `variation_id`, `quantity`, `serial_purchase_code`, `secondary_unit_quantity`, `pp_without_discount`, `discount_percent`, `purchase_price`, `purchase_price_inc_tax`, `item_tax`, `tax_id`, `line_discount_type`, `line_discount_amount`, `purchase_requisition_line_id`, `purchase_order_line_id`, `quantity_sold`, `quantity_adjusted`, `quantity_returned`, `po_quantity_purchased`, `mfg_quantity_used`, `mfg_date`, `exp_date`, `lot_number`, `sub_unit_id`, `transfer_return`, `created_at`, `updated_at`) VALUES
(1716, 3372, 2216, 2221, 100.0000, '2216RZEAYP', 0.0000, 40.0000, 0.00, 40.0000, 40.0000, 0.0000, NULL, NULL, 0.0000, NULL, NULL, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, NULL, NULL, NULL, 1, 0, '2026-04-02 17:55:24', '2026-04-02 17:55:24'),
(1717, 3373, 2217, 2222, 10.0000, '2217pqYupZ', 0.0000, 100000.0000, 0.00, 100000.0000, 100000.0000, 0.0000, NULL, NULL, 0.0000, NULL, NULL, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, '2026-04-02 17:59:49', '2026-04-02 17:59:49'),
(1718, 3374, 2218, 2223, 4.0000, '2218vP4lCA', 0.0000, 200000.0000, 0.00, 200000.0000, 200000.0000, 0.0000, NULL, NULL, 0.0000, NULL, NULL, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, '2026-04-02 18:03:47', '2026-04-02 18:03:47'),
(1719, 3375, 2219, 2224, 10.0000, '22192frbOz', 0.0000, 50.0000, 0.00, 50.0000, 50.0000, 0.0000, NULL, NULL, 0.0000, NULL, NULL, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, NULL, NULL, NULL, 1, 0, '2026-04-02 18:05:28', '2026-04-02 18:05:28'),
(1720, 3376, 2216, 2221, 1000.0000, '2216p0jGgO', 0.0000, 40.0000, 0.00, 40.0000, 40.0000, 0.0000, NULL, 'fixed', 0.0000, NULL, NULL, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, '2026-04-02 18:19:45', '2026-04-02 18:19:45'),
(1721, 3376, 2219, 2224, 1000.0000, '2219HR6MJQ', 0.0000, 50.0000, 0.00, 50.0000, 50.0000, 0.0000, NULL, 'fixed', 0.0000, NULL, NULL, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, '2026-04-02 18:19:45', '2026-04-02 18:19:45'),
(1722, 3377, 2218, 2223, 5.0000, '2218nLrbrZ', 0.0000, 200000.0000, 0.00, 200000.0000, 200000.0000, 0.0000, NULL, 'fixed', 0.0000, NULL, NULL, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, NULL, NULL, 'Lot123', NULL, 0, '2026-04-02 18:27:50', '2026-04-02 18:27:50'),
(1723, 3378, 2218, 2223, 3.0000, '2218Uk1CYQ', 0.0000, 200000.0000, 0.00, 200000.0000, 200000.0000, 0.0000, NULL, 'fixed', 0.0000, NULL, NULL, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, '2026-04-02 18:33:39', '2026-04-02 18:33:39'),
(1724, 3379, 2216, 2221, 1000.0000, '2216hjSooM', 0.0000, 40.0000, 0.00, 40.0000, 40.0000, 0.0000, NULL, 'fixed', 0.0000, NULL, NULL, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, NULL, '2026-04-03', 'LuxLot1', NULL, 0, '2026-04-02 18:37:03', '2026-04-02 18:37:03'),
(1725, 3379, 2219, 2224, 1000.0000, '2219pdqNI5', 0.0000, 50.0000, 0.00, 50.0000, 50.0000, 0.0000, NULL, 'fixed', 0.0000, NULL, NULL, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, NULL, '2026-04-03', 'LuxLot1', NULL, 0, '2026-04-02 18:37:03', '2026-04-02 18:37:03');

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

--
-- Table structure for table `reference_counts`
--

CREATE TABLE `reference_counts` (
  `id` int(10) UNSIGNED NOT NULL,
  `ref_type` varchar(191) NOT NULL,
  `ref_count` int(11) NOT NULL,
  `business_id` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `reference_counts`
--

INSERT INTO `reference_counts` (`id`, `ref_type`, `ref_count`, `business_id`, `created_at`, `updated_at`) VALUES
(181, 'business_location', 1, 1, '2026-04-02 16:17:59', '2026-04-02 16:17:59'),
(182, 'contacts', 5, 1, '2026-04-02 16:20:41', '2026-04-02 16:30:51'),
(183, 'opening_balance', 3, 1, '2026-04-02 16:23:41', '2026-04-02 16:29:25'),
(184, 'purchase_order', 1, 1, '2026-04-02 18:19:45', '2026-04-02 18:19:45'),
(185, 'purchase', 3, 1, '2026-04-02 18:27:50', '2026-04-02 18:37:03'),
(186, 'purchase_payment', 4, 1, '2026-04-02 18:31:10', '2026-04-02 18:37:03');

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

--
-- Table structure for table `repair_device_models`
--

CREATE TABLE `repair_device_models` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `repair_checklist` text DEFAULT NULL,
  `brand_id` int(10) UNSIGNED DEFAULT NULL,
  `device_id` int(10) UNSIGNED DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `repair_job_sheets`
--

CREATE TABLE `repair_job_sheets` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `location_id` int(10) UNSIGNED DEFAULT NULL,
  `contact_id` int(10) UNSIGNED NOT NULL,
  `job_sheet_no` varchar(191) NOT NULL,
  `service_type` enum('carry_in','pick_up','on_site') NOT NULL,
  `pick_up_on_site_addr` text DEFAULT NULL,
  `brand_id` int(10) UNSIGNED DEFAULT NULL,
  `device_id` int(10) UNSIGNED DEFAULT NULL,
  `device_model_id` int(10) UNSIGNED DEFAULT NULL,
  `checklist` text DEFAULT NULL,
  `security_pwd` varchar(191) DEFAULT NULL,
  `security_pattern` varchar(191) DEFAULT NULL,
  `serial_no` varchar(191) NOT NULL,
  `status_id` int(11) NOT NULL,
  `delivery_date` datetime DEFAULT NULL,
  `product_configuration` text DEFAULT NULL,
  `defects` text DEFAULT NULL,
  `product_condition` text DEFAULT NULL,
  `service_staff` int(10) UNSIGNED DEFAULT NULL,
  `comment_by_ss` text DEFAULT NULL COMMENT 'comment made by technician',
  `estimated_cost` decimal(22,4) DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `parts` text DEFAULT NULL,
  `custom_field_1` varchar(191) DEFAULT NULL,
  `custom_field_2` varchar(191) DEFAULT NULL,
  `custom_field_3` varchar(191) DEFAULT NULL,
  `custom_field_4` varchar(191) DEFAULT NULL,
  `custom_field_5` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `repair_statuses`
--

CREATE TABLE `repair_statuses` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `color` varchar(191) DEFAULT NULL,
  `sort_order` int(11) DEFAULT NULL,
  `business_id` int(11) NOT NULL,
  `is_completed_status` tinyint(1) NOT NULL DEFAULT 0,
  `sms_template` text DEFAULT NULL,
  `email_subject` text DEFAULT NULL,
  `email_body` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `res_product_modifier_sets`
--

CREATE TABLE `res_product_modifier_sets` (
  `modifier_set_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL COMMENT 'Table use to store the modifier sets applicable for a product'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `res_tables`
--

CREATE TABLE `res_tables` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `location_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `return_groups`
--

CREATE TABLE `return_groups` (
  `id` int(11) NOT NULL,
  `business_id` int(11) NOT NULL,
  `created_at` timestamp NOT NULL,
  `updated_at` timestamp NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `rma_complain_receives`
--

CREATE TABLE `rma_complain_receives` (
  `id` int(10) UNSIGNED NOT NULL,
  `rma_number` varchar(191) NOT NULL,
  `business_id` int(11) NOT NULL,
  `location_id` int(11) DEFAULT NULL,
  `contact_id` int(11) DEFAULT NULL,
  `product_id` int(11) NOT NULL,
  `serial_id` int(11) DEFAULT NULL,
  `serial_number` varchar(191) DEFAULT NULL,
  `transaction_id` int(11) DEFAULT NULL,
  `complain_date` date NOT NULL,
  `problem_description` text DEFAULT NULL,
  `problem_id` int(11) DEFAULT NULL,
  `status` enum('pending','approved','rejected','in_process','completed','cancelled') NOT NULL DEFAULT 'pending',
  `approved_by` int(11) DEFAULT NULL,
  `approved_at` datetime DEFAULT NULL,
  `rejection_reason` text DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `rma_diagnoses`
--

CREATE TABLE `rma_diagnoses` (
  `id` int(10) UNSIGNED NOT NULL,
  `diagnosis_number` varchar(191) NOT NULL,
  `business_id` int(11) NOT NULL,
  `location_id` int(11) DEFAULT NULL,
  `complain_receive_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `serial_id` int(11) DEFAULT NULL,
  `serial_number` varchar(191) DEFAULT NULL,
  `diagnosis_date` date NOT NULL,
  `diagnosis_result` text DEFAULT NULL,
  `diagnosis_status` enum('pending','diagnosed','repairable','not_repairable') NOT NULL DEFAULT 'pending',
  `estimated_repair_cost` decimal(20,2) DEFAULT NULL,
  `technician_notes` text DEFAULT NULL,
  `technician_id` int(11) DEFAULT NULL,
  `status` enum('pending','completed','cancelled') NOT NULL DEFAULT 'pending',
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `rma_engineer_fixings`
--

CREATE TABLE `rma_engineer_fixings` (
  `id` int(10) UNSIGNED NOT NULL,
  `fixing_number` varchar(191) NOT NULL,
  `business_id` int(11) NOT NULL,
  `location_id` int(11) DEFAULT NULL,
  `complain_receive_id` int(11) NOT NULL,
  `diagnosis_id` int(11) DEFAULT NULL,
  `product_id` int(11) NOT NULL,
  `serial_id` int(11) DEFAULT NULL,
  `serial_number` varchar(191) DEFAULT NULL,
  `fixing_date` date NOT NULL,
  `fixing_description` text DEFAULT NULL,
  `parts_used` text DEFAULT NULL,
  `technician_notes` text DEFAULT NULL,
  `engineer_id` int(11) DEFAULT NULL,
  `fixing_status` enum('pending','in_progress','completed','failed') NOT NULL DEFAULT 'pending',
  `status` enum('pending','completed','cancelled') NOT NULL DEFAULT 'pending',
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `rma_item_utilizes`
--

CREATE TABLE `rma_item_utilizes` (
  `id` int(10) UNSIGNED NOT NULL,
  `utilize_number` varchar(191) NOT NULL,
  `business_id` int(11) NOT NULL,
  `location_id` int(11) DEFAULT NULL,
  `complain_receive_id` int(11) DEFAULT NULL,
  `product_id` int(11) NOT NULL,
  `serial_id` int(11) DEFAULT NULL,
  `serial_number` varchar(191) DEFAULT NULL,
  `utilize_date` date NOT NULL,
  `utilize_type` enum('scrap','refurbish','parts_harvest','donation','other') NOT NULL DEFAULT 'scrap',
  `utilize_notes` text DEFAULT NULL,
  `status` enum('pending','completed','cancelled') NOT NULL DEFAULT 'pending',
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `rma_problem_setups`
--

CREATE TABLE `rma_problem_setups` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `problem_code` varchar(191) DEFAULT NULL,
  `problem_name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `problem_category` enum('hardware','software','electrical','mechanical','cosmetic','other') NOT NULL DEFAULT 'other',
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `rma_replacement_deliveries`
--

CREATE TABLE `rma_replacement_deliveries` (
  `id` int(10) UNSIGNED NOT NULL,
  `delivery_number` varchar(191) NOT NULL,
  `business_id` int(11) NOT NULL,
  `location_id` int(11) DEFAULT NULL,
  `contact_id` int(11) DEFAULT NULL,
  `replace_in_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `serial_id` int(11) DEFAULT NULL,
  `serial_number` varchar(191) DEFAULT NULL,
  `delivery_date` date NOT NULL,
  `transaction_id` int(11) DEFAULT NULL,
  `delivery_notes` text DEFAULT NULL,
  `status` enum('pending','delivered','cancelled') NOT NULL DEFAULT 'pending',
  `delivered_by` int(11) DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `rma_replace_ins`
--

CREATE TABLE `rma_replace_ins` (
  `id` int(10) UNSIGNED NOT NULL,
  `replace_in_number` varchar(191) NOT NULL,
  `business_id` int(11) NOT NULL,
  `location_id` int(11) DEFAULT NULL,
  `replace_out_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `serial_id` int(11) DEFAULT NULL,
  `serial_number` varchar(191) DEFAULT NULL,
  `replace_in_date` date NOT NULL,
  `condition_notes` text DEFAULT NULL,
  `condition` enum('good','damaged','defective') NOT NULL DEFAULT 'good',
  `notes` text DEFAULT NULL,
  `status` enum('pending','completed','cancelled') NOT NULL DEFAULT 'pending',
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `rma_replace_outs`
--

CREATE TABLE `rma_replace_outs` (
  `id` int(10) UNSIGNED NOT NULL,
  `replace_out_number` varchar(191) NOT NULL,
  `business_id` int(11) NOT NULL,
  `location_id` int(11) DEFAULT NULL,
  `complain_receive_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `serial_id` int(11) DEFAULT NULL,
  `serial_number` varchar(191) DEFAULT NULL,
  `replacement_product_id` int(11) DEFAULT NULL,
  `replacement_serial_id` int(11) DEFAULT NULL,
  `replacement_serial_number` varchar(191) DEFAULT NULL,
  `replace_out_date` date NOT NULL,
  `notes` text DEFAULT NULL,
  `status` enum('pending','completed','cancelled') NOT NULL DEFAULT 'pending',
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `rma_serial_histories`
--

CREATE TABLE `rma_serial_histories` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `serial_id` int(11) NOT NULL,
  `serial_number` varchar(191) NOT NULL,
  `product_id` int(11) NOT NULL,
  `action_type` varchar(191) NOT NULL,
  `reference_id` int(11) DEFAULT NULL,
  `reference_number` varchar(191) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `rma_service_bills`
--

CREATE TABLE `rma_service_bills` (
  `id` int(10) UNSIGNED NOT NULL,
  `service_bill_number` varchar(191) NOT NULL,
  `business_id` int(11) NOT NULL,
  `location_id` int(11) DEFAULT NULL,
  `contact_id` int(11) DEFAULT NULL,
  `complain_receive_id` int(11) DEFAULT NULL,
  `diagnosis_id` int(11) DEFAULT NULL,
  `product_id` int(11) NOT NULL,
  `serial_id` int(11) DEFAULT NULL,
  `serial_number` varchar(191) DEFAULT NULL,
  `service_date` date NOT NULL,
  `service_charge` decimal(20,2) NOT NULL DEFAULT 0.00,
  `parts_cost` decimal(20,2) NOT NULL DEFAULT 0.00,
  `labor_cost` decimal(20,2) NOT NULL DEFAULT 0.00,
  `total_amount` decimal(20,2) NOT NULL DEFAULT 0.00,
  `transaction_id` int(11) DEFAULT NULL,
  `service_notes` text DEFAULT NULL,
  `payment_status` enum('pending','partial','paid') NOT NULL DEFAULT 'pending',
  `status` enum('pending','completed','cancelled') NOT NULL DEFAULT 'pending',
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `guard_name` varchar(191) NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `is_service_staff` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` (`id`, `name`, `guard_name`, `business_id`, `is_default`, `is_service_staff`, `created_at`, `updated_at`) VALUES
(1, 'Admin#1', 'web', 1, 1, 0, '2024-10-25 16:39:24', '2024-10-25 16:39:24'),
(2, 'Cashier#1', 'web', 1, 0, 0, '2024-10-25 16:39:24', '2024-10-25 16:39:24'),
(33, 'Branch Manager#1', 'web', 1, 0, 0, '2026-04-02 16:15:06', '2026-04-02 16:15:06');

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

--
-- Table structure for table `role_has_permissions`
--

CREATE TABLE `role_has_permissions` (
  `permission_id` int(10) UNSIGNED NOT NULL,
  `role_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_has_permissions`
--

INSERT INTO `role_has_permissions` (`permission_id`, `role_id`) VALUES
(2, 2),
(3, 2),
(6, 2),
(7, 2),
(8, 2),
(9, 2),
(10, 2),
(16, 2),
(17, 2),
(18, 2),
(19, 2),
(20, 2),
(22, 2),
(25, 2),
(26, 2),
(27, 2),
(28, 2),
(33, 2),
(34, 2),
(35, 2),
(37, 2),
(38, 2),
(39, 2),
(40, 2),
(41, 2),
(42, 2),
(45, 2),
(46, 2),
(48, 2),
(49, 2),
(50, 2),
(51, 2),
(81, 2),
(113, 2),
(114, 2),
(115, 2),
(116, 2),
(117, 2),
(118, 2),
(119, 2),
(120, 2),
(121, 2),
(122, 2),
(123, 2),
(124, 2),
(125, 2),
(132, 2),
(133, 2),
(134, 2),
(135, 2),
(139, 2),
(149, 2),
(157, 2),
(158, 2),
(159, 2),
(160, 2),
(161, 2),
(162, 2),
(163, 2),
(164, 2),
(165, 2),
(166, 2);

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

--
-- Table structure for table `selling_price_groups`
--

CREATE TABLE `selling_price_groups` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sell_exchange`
--

CREATE TABLE `sell_exchange` (
  `id` int(11) NOT NULL,
  `business_id` varchar(255) DEFAULT NULL,
  `location_id` varchar(255) DEFAULT NULL,
  `transaction_id` varchar(255) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `reason` text DEFAULT NULL,
  `amount_before_exchange` varchar(255) DEFAULT NULL,
  `amount_after_exchange` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sell_exchange_product`
--

CREATE TABLE `sell_exchange_product` (
  `id` int(11) NOT NULL,
  `sell_exchange_id` varchar(255) DEFAULT NULL,
  `exchange_product_id` varchar(255) DEFAULT NULL,
  `new_product_id` varchar(255) DEFAULT NULL,
  `exchange_product_variation_id` varchar(255) DEFAULT NULL,
  `new_product_variation_id` varchar(255) DEFAULT NULL,
  `exchange_product_quantity` varchar(255) DEFAULT NULL,
  `new_product_quantity` varchar(255) DEFAULT NULL,
  `exchange_product_unit_price` varchar(255) DEFAULT NULL,
  `new_product_unit_price` varchar(255) DEFAULT NULL,
  `exchange_product_total_price` varchar(255) DEFAULT NULL,
  `new_product_total_price` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sell_line_warranties`
--

CREATE TABLE `sell_line_warranties` (
  `sell_line_id` int(11) NOT NULL,
  `warranty_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `serial_numbers`
--

CREATE TABLE `serial_numbers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(11) DEFAULT NULL,
  `location_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `variation_id` int(10) UNSIGNED NOT NULL,
  `serial_number` varchar(191) NOT NULL,
  `purchase_status` varchar(191) NOT NULL DEFAULT 'received',
  `stock_status` varchar(191) NOT NULL DEFAULT 'available',
  `transaction_id` bigint(20) DEFAULT NULL,
  `serial_purchase_code` varchar(191) DEFAULT NULL,
  `is_return` int(11) DEFAULT NULL,
  `is_p_return` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `serial_numbers`
--

INSERT INTO `serial_numbers` (`id`, `business_id`, `location_id`, `product_id`, `variation_id`, `serial_number`, `purchase_status`, `stock_status`, `transaction_id`, `serial_purchase_code`, `is_return`, `is_p_return`, `created_at`, `updated_at`) VALUES
(607, 1, 1, 2217, 2222, 's1', 'received', 'available', NULL, '2217pqYupZ', NULL, NULL, NULL, NULL),
(608, 1, 1, 2217, 2222, 's2', 'received', 'available', NULL, '2217pqYupZ', NULL, NULL, NULL, NULL),
(609, 1, 1, 2217, 2222, 's3', 'received', 'available', NULL, '2217pqYupZ', NULL, NULL, NULL, NULL),
(610, 1, 1, 2217, 2222, 's4', 'received', 'available', NULL, '2217pqYupZ', NULL, NULL, NULL, NULL),
(611, 1, 1, 2217, 2222, 's5', 'received', 'available', NULL, '2217pqYupZ', NULL, NULL, NULL, NULL),
(612, 1, 1, 2217, 2222, 's6', 'received', 'available', NULL, '2217pqYupZ', NULL, NULL, NULL, NULL),
(613, 1, 1, 2217, 2222, 's7', 'received', 'available', NULL, '2217pqYupZ', NULL, NULL, NULL, NULL),
(614, 1, 1, 2217, 2222, 's8', 'received', 'available', NULL, '2217pqYupZ', NULL, NULL, NULL, NULL),
(615, 1, 1, 2217, 2222, 's9', 'received', 'available', NULL, '2217pqYupZ', NULL, NULL, NULL, NULL),
(616, 1, 1, 2217, 2222, 's10', 'received', 'available', NULL, '2217pqYupZ', NULL, NULL, NULL, NULL),
(617, 1, 1, 2218, 2223, 'iphone1', 'received', 'available', NULL, '2218vP4lCA', NULL, NULL, NULL, NULL),
(618, 1, 1, 2218, 2223, 'iphone2', 'received', 'available', NULL, '2218vP4lCA', NULL, NULL, NULL, NULL),
(619, 1, 1, 2218, 2223, 'iphone3', 'received', 'available', NULL, '2218vP4lCA', NULL, NULL, NULL, NULL),
(620, 1, 1, 2218, 2223, 'iphone4', 'received', 'available', NULL, '2218vP4lCA', NULL, NULL, NULL, NULL),
(621, 1, 1, 2218, 2223, 'fon1', 'received', 'available', NULL, '2218nLrbrZ', NULL, NULL, NULL, NULL),
(622, 1, 1, 2218, 2223, 'fon2', 'received', 'available', NULL, '2218nLrbrZ', NULL, NULL, NULL, NULL),
(623, 1, 1, 2218, 2223, 'fon3', 'received', 'available', NULL, '2218nLrbrZ', NULL, NULL, NULL, NULL),
(624, 1, 1, 2218, 2223, 'fon4', 'received', 'available', NULL, '2218nLrbrZ', NULL, NULL, NULL, NULL),
(625, 1, 1, 2218, 2223, 'fon5', 'received', 'available', NULL, '2218nLrbrZ', NULL, NULL, NULL, NULL),
(626, 1, 1, 2218, 2223, 'ff1', 'received', 'available', NULL, '2218Uk1CYQ', NULL, NULL, NULL, NULL),
(627, 1, 1, 2218, 2223, 'ff2', 'received', 'available', NULL, '2218Uk1CYQ', NULL, NULL, NULL, NULL),
(628, 1, 1, 2218, 2223, 'ff3', 'received', 'available', NULL, '2218Uk1CYQ', NULL, NULL, NULL, NULL);

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

--
-- Table structure for table `service_warranties`
--

CREATE TABLE `service_warranties` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `location_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `serial_id` int(10) UNSIGNED DEFAULT NULL,
  `service_transaction_id` int(10) UNSIGNED DEFAULT NULL,
  `service_fee` decimal(22,4) DEFAULT NULL,
  `status` varchar(191) NOT NULL DEFAULT 'received',
  `received_time` timestamp NULL DEFAULT NULL,
  `delivery_time` timestamp NULL DEFAULT NULL,
  `old_serial` varchar(191) DEFAULT NULL,
  `new_serial` varchar(191) DEFAULT NULL,
  `service_recived_no` varchar(191) DEFAULT NULL,
  `service_delivery_no` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(191) NOT NULL,
  `user_id` int(10) UNSIGNED DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` text NOT NULL,
  `last_activity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sheet_spreadsheets`
--

CREATE TABLE `sheet_spreadsheets` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `sheet_data` longtext NOT NULL,
  `created_by` int(11) NOT NULL,
  `folder_id` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `sheet_spreadsheet_shares`
--

CREATE TABLE `sheet_spreadsheet_shares` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `sheet_spreadsheet_id` bigint(20) UNSIGNED NOT NULL,
  `shared_with` varchar(191) NOT NULL COMMENT 'Shared with like user/role/todo',
  `shared_id` int(11) NOT NULL COMMENT 'Id of shared with like user_id/role_id/todo_id',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `staff_awards`
--

CREATE TABLE `staff_awards` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `staff_id` int(10) UNSIGNED NOT NULL,
  `period_id` bigint(20) UNSIGNED DEFAULT NULL,
  `period_type` enum('weekly','monthly','yearly') NOT NULL,
  `period_start` date NOT NULL,
  `period_end` date NOT NULL,
  `rank_position` int(11) NOT NULL,
  `sales_total` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `transaction_count` int(11) NOT NULL DEFAULT 0,
  `avg_transaction_value` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `performance_points` int(11) NOT NULL DEFAULT 0,
  `final_score` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `award_type` enum('manual','catalog') DEFAULT NULL,
  `catalog_item_id` int(10) UNSIGNED DEFAULT NULL,
  `award_quantity` int(11) NOT NULL DEFAULT 1,
  `gift_description` varchar(191) DEFAULT NULL,
  `gift_monetary_value` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `stock_deducted` tinyint(1) NOT NULL DEFAULT 0,
  `award_notes` text DEFAULT NULL,
  `is_awarded` tinyint(1) NOT NULL DEFAULT 0,
  `awarded_by` int(10) UNSIGNED DEFAULT NULL,
  `awarded_date` timestamp NULL DEFAULT NULL,
  `notification_sent` tinyint(1) NOT NULL DEFAULT 0,
  `certificate_path` varchar(191) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `staff_award_periods`
--

CREATE TABLE `staff_award_periods` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `period_type` enum('weekly','monthly','yearly') NOT NULL,
  `period_start` date NOT NULL,
  `period_end` date NOT NULL,
  `winner_count` int(11) NOT NULL DEFAULT 10,
  `is_finalized` tinyint(1) NOT NULL DEFAULT 0,
  `finalized_at` timestamp NULL DEFAULT NULL,
  `finalized_by` int(10) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `staff_performance_activities`
--

CREATE TABLE `staff_performance_activities` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `staff_id` int(10) UNSIGNED NOT NULL,
  `activity_type` enum('punctuality','customer_service','upselling','teamwork','training_completion','cleanliness','other') NOT NULL,
  `points` int(11) NOT NULL,
  `description` text DEFAULT NULL,
  `reference_url` varchar(191) DEFAULT NULL,
  `verification_notes` text DEFAULT NULL,
  `recorded_by` int(10) UNSIGNED NOT NULL,
  `recorded_date` date NOT NULL,
  `status` enum('pending','verified','rejected') NOT NULL DEFAULT 'verified',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `staff_recognition_settings`
--

CREATE TABLE `staff_recognition_settings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `performance_weights` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `activity_points` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `min_transactions_weekly` int(11) NOT NULL DEFAULT 10,
  `min_transactions_monthly` int(11) NOT NULL DEFAULT 50,
  `min_transactions_yearly` int(11) NOT NULL DEFAULT 500,
  `auto_finalize_periods` tinyint(1) NOT NULL DEFAULT 0,
  `send_notifications` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `stock_adjustments_temp`
--

CREATE TABLE `stock_adjustments_temp` (
  `id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `stock_adjustment_lines`
--

CREATE TABLE `stock_adjustment_lines` (
  `id` int(10) UNSIGNED NOT NULL,
  `transaction_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `variation_id` int(10) UNSIGNED NOT NULL,
  `quantity` decimal(22,4) NOT NULL,
  `adjustment_unit_id` int(11) DEFAULT NULL,
  `secondary_unit_quantity` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `unit_price` decimal(22,4) DEFAULT NULL COMMENT 'Last purchase unit price',
  `removed_purchase_line` int(11) DEFAULT NULL,
  `lot_no_line_id` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `subscriptions`
--

CREATE TABLE `subscriptions` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `package_id` int(10) UNSIGNED NOT NULL,
  `start_date` date DEFAULT NULL,
  `trial_end_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `package_price` decimal(22,4) NOT NULL,
  `original_price` decimal(22,4) DEFAULT NULL,
  `coupon_code` varchar(191) DEFAULT NULL,
  `package_details` longtext NOT NULL,
  `created_id` int(10) UNSIGNED NOT NULL,
  `paid_via` varchar(191) DEFAULT NULL,
  `payment_transaction_id` varchar(191) DEFAULT NULL,
  `status` enum('approved','waiting','declined') NOT NULL DEFAULT 'waiting',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `superadmin_communicator_logs`
--

CREATE TABLE `superadmin_communicator_logs` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_ids` text DEFAULT NULL,
  `subject` varchar(191) DEFAULT NULL,
  `message` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `superadmin_coupons`
--

CREATE TABLE `superadmin_coupons` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `coupon_code` varchar(191) NOT NULL,
  `discount_type` varchar(191) NOT NULL,
  `discount` decimal(8,2) NOT NULL,
  `expiry_date` date DEFAULT NULL,
  `applied_on_packages` varchar(191) DEFAULT NULL,
  `applied_on_business` varchar(191) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `superadmin_frontend_pages`
--

CREATE TABLE `superadmin_frontend_pages` (
  `id` int(10) UNSIGNED NOT NULL,
  `title` varchar(191) DEFAULT NULL,
  `slug` varchar(191) NOT NULL,
  `content` longtext NOT NULL,
  `is_shown` tinyint(1) NOT NULL,
  `menu_order` int(11) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `system`
--

CREATE TABLE `system` (
  `id` int(10) UNSIGNED NOT NULL,
  `key` varchar(191) NOT NULL,
  `value` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `system`
--

INSERT INTO `system` (`id`, `key`, `value`) VALUES
(1, 'db_version', '6.4'),
(2, 'default_business_active_status', '1'),
(5, 'essentials_version', '5.0'),
(13, 'spreadsheet_version', '2.0'),
(17, 'app_currency_id', '90'),
(18, 'invoice_business_name', 'Global SMART POS'),
(19, 'invoice_business_landmark', 'Damitte'),
(20, 'invoice_business_zip', 'Zip'),
(21, 'invoice_business_state', 'State'),
(22, 'invoice_business_city', 'Damitte'),
(23, 'invoice_business_country', 'Egypt'),
(24, 'email', 'superadmin@example.com'),
(25, 'package_expiry_alert_days', '5'),
(26, 'enable_business_based_username', '0'),
(35, 'superadmin_register_tc', NULL),
(36, 'welcome_email_subject', NULL),
(37, 'welcome_email_body', NULL),
(38, 'additional_js', NULL),
(39, 'additional_css', NULL),
(40, 'offline_payment_details', NULL),
(41, 'superadmin_enable_register_tc', '0'),
(42, 'allow_email_settings_to_businesses', '0'),
(43, 'enable_new_business_registration_notification', '0'),
(44, 'enable_new_subscription_notification', '0'),
(45, 'enable_welcome_email', '0'),
(46, 'enable_offline_payment', '1'),
(51, 'whatsapp_version', '1.1'),
(53, 'advancedreports_version', '1.2.4'),
(54, 'daybook_version', '1.0.0'),
(55, 'stockrecalculation_version', '1.2.0'),
(56, 'dailystockhistory_version', '1.0'),
(59, 'businessmanagement_license_validated_at', '2026-04-02 21:27:51'),
(60, 'businessmanagement_install_domain', 'demo.posifyme.com'),
(61, 'businessmanagement_install_url', 'https://demo.posifyme.com'),
(62, 'businessmanagement_pin_enabled', '0'),
(63, 'businessmanagement_pin_code', ''),
(64, 'businessmanagement_pin_max_attempts', '5'),
(65, 'businessmanagement_pin_lockout_minutes', '15'),
(67, 'accountingreports_install_domain', 'bill.itsolutionchakaria.com'),
(68, 'accountingreports_install_url', 'https://bill.itsolutionchakaria.com'),
(69, 'accountingreports_version', '2.0.2'),
(70, 'backupmanagement_version', '1.0'),
(71, 'Exchange_version', '1.0.9'),
(72, 'camerabarcodescanner_version', '1.1.0'),
(73, 'productcatalogue_version', '1.0'),
(74, 'rma_version', '1.0.0'),
(75, 'repair_version', '3.1'),
(76, 'project_version', '3.0'),
(77, 'assetmanagement_version', '3.0'),
(78, 'businessmanagement_license_code', 'BM-372F-8E30-E2FE-90CF'),
(79, 'businessmanagement_license_username', 'demoposify'),
(80, 'businessmanagement_version', '1.0.6'),
(81, 'pinloginsystem_version', '1.0.0');

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

--
-- Table structure for table `tax_rates`
--

CREATE TABLE `tax_rates` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `amount` double(22,4) NOT NULL,
  `is_tax_group` tinyint(1) NOT NULL DEFAULT 0,
  `for_tax_group` tinyint(1) NOT NULL DEFAULT 0,
  `created_by` int(10) UNSIGNED NOT NULL,
  `woocommerce_tax_rate_id` int(11) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `tazas`
--

CREATE TABLE `tazas` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `currency_id` int(10) UNSIGNED NOT NULL,
  `value` decimal(50,15) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `alias` varchar(191) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `transactions`
--

CREATE TABLE `transactions` (
  `id` int(10) UNSIGNED NOT NULL,
  `exchange_sell_id` bigint(20) UNSIGNED DEFAULT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `location_id` int(10) UNSIGNED DEFAULT NULL,
  `is_kitchen_order` tinyint(1) NOT NULL DEFAULT 0,
  `res_table_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'fields to restaurant module',
  `res_waiter_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'fields to restaurant module',
  `res_order_status` enum('received','cooked','served') DEFAULT NULL,
  `type` varchar(191) DEFAULT NULL,
  `sub_type` varchar(20) DEFAULT NULL,
  `status` varchar(191) NOT NULL,
  `sub_status` varchar(191) DEFAULT NULL,
  `is_quotation` tinyint(1) NOT NULL DEFAULT 0,
  `payment_status` enum('paid','due','partial') DEFAULT NULL,
  `adjustment_type` enum('normal','abnormal') DEFAULT NULL,
  `contact_id` int(10) UNSIGNED DEFAULT NULL,
  `customer_group_id` int(11) DEFAULT NULL COMMENT 'used to add customer group while selling',
  `invoice_no` varchar(191) DEFAULT NULL,
  `ref_no` varchar(191) DEFAULT NULL,
  `source` varchar(191) DEFAULT NULL,
  `subscription_no` varchar(191) DEFAULT NULL,
  `subscription_repeat_on` varchar(191) DEFAULT NULL,
  `transaction_date` datetime NOT NULL,
  `total_before_tax` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Total before the purchase/invoice tax, this includeds the indivisual product tax',
  `tax_id` int(10) UNSIGNED DEFAULT NULL,
  `tax_amount` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `discount_type` enum('fixed','percentage') DEFAULT NULL,
  `discount_amount` decimal(22,4) DEFAULT 0.0000,
  `rp_redeemed` int(11) NOT NULL DEFAULT 0 COMMENT 'rp is the short form of reward points',
  `rp_redeemed_amount` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'rp is the short form of reward points',
  `shipping_details` varchar(191) DEFAULT NULL,
  `shipping_address` text DEFAULT NULL,
  `delivery_date` datetime DEFAULT NULL,
  `shipping_status` varchar(191) DEFAULT NULL,
  `delivered_to` varchar(191) DEFAULT NULL,
  `delivery_person` bigint(20) DEFAULT NULL,
  `shipping_charges` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `shipping_custom_field_1` varchar(191) DEFAULT NULL,
  `shipping_custom_field_2` varchar(191) DEFAULT NULL,
  `shipping_custom_field_3` varchar(191) DEFAULT NULL,
  `shipping_custom_field_4` varchar(191) DEFAULT NULL,
  `shipping_custom_field_5` varchar(191) DEFAULT NULL,
  `additional_notes` text DEFAULT NULL,
  `staff_note` text DEFAULT NULL,
  `is_export` tinyint(1) NOT NULL DEFAULT 0,
  `export_custom_fields_info` longtext DEFAULT NULL,
  `round_off_amount` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Difference of rounded total and actual total',
  `additional_expense_key_1` varchar(191) DEFAULT NULL,
  `additional_expense_value_1` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `additional_expense_key_2` varchar(191) DEFAULT NULL,
  `additional_expense_value_2` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `additional_expense_key_3` varchar(191) DEFAULT NULL,
  `additional_expense_value_3` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `additional_expense_key_4` varchar(191) DEFAULT NULL,
  `additional_expense_value_4` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `final_total` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `expense_category_id` int(10) UNSIGNED DEFAULT NULL,
  `expense_sub_category_id` int(11) DEFAULT NULL,
  `expense_for` int(10) UNSIGNED DEFAULT NULL,
  `commission_agent` int(11) DEFAULT NULL,
  `document` varchar(191) DEFAULT NULL,
  `is_direct_sale` tinyint(1) NOT NULL DEFAULT 0,
  `is_suspend` tinyint(1) NOT NULL DEFAULT 0,
  `exchange_rate` decimal(20,3) NOT NULL DEFAULT 1.000,
  `total_amount_recovered` decimal(22,4) DEFAULT NULL COMMENT 'Used for stock adjustment.',
  `transfer_parent_id` int(11) DEFAULT NULL,
  `return_parent_id` int(11) DEFAULT NULL,
  `opening_stock_product_id` int(11) DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `repair_completed_on` datetime DEFAULT NULL,
  `repair_warranty_id` int(11) DEFAULT NULL,
  `repair_brand_id` int(11) DEFAULT NULL,
  `repair_status_id` int(11) DEFAULT NULL,
  `repair_model_id` int(11) DEFAULT NULL,
  `repair_job_sheet_id` int(10) UNSIGNED DEFAULT NULL,
  `repair_defects` text DEFAULT NULL,
  `repair_serial_no` varchar(191) DEFAULT NULL,
  `repair_checklist` text DEFAULT NULL,
  `repair_security_pwd` varchar(191) DEFAULT NULL,
  `repair_security_pattern` varchar(191) DEFAULT NULL,
  `repair_due_date` datetime DEFAULT NULL,
  `repair_device_id` int(11) DEFAULT NULL,
  `repair_updates_notif` tinyint(1) NOT NULL DEFAULT 0,
  `woocommerce_order_id` int(11) DEFAULT NULL,
  `mfg_parent_production_purchase_id` int(11) DEFAULT NULL,
  `mfg_wasted_units` decimal(22,4) DEFAULT NULL,
  `mfg_production_cost` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `mfg_production_cost_type` varchar(191) DEFAULT 'percentage',
  `mfg_is_final` tinyint(1) NOT NULL DEFAULT 0,
  `essentials_duration` decimal(8,2) NOT NULL,
  `essentials_duration_unit` varchar(20) DEFAULT NULL,
  `essentials_amount_per_unit_duration` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `essentials_allowances` text DEFAULT NULL,
  `essentials_deductions` text DEFAULT NULL,
  `crm_is_order_request` tinyint(1) NOT NULL DEFAULT 0,
  `purchase_requisition_ids` text DEFAULT NULL,
  `prefer_payment_method` varchar(191) DEFAULT NULL,
  `prefer_payment_account` int(11) DEFAULT NULL,
  `sales_order_ids` text DEFAULT NULL,
  `purchase_order_ids` text DEFAULT NULL,
  `custom_field_1` varchar(191) DEFAULT NULL,
  `custom_field_2` varchar(191) DEFAULT NULL,
  `custom_field_3` varchar(191) DEFAULT NULL,
  `custom_field_4` varchar(191) DEFAULT NULL,
  `import_batch` int(11) DEFAULT NULL,
  `import_time` datetime DEFAULT NULL,
  `types_of_service_id` int(11) DEFAULT NULL,
  `packing_charge` decimal(22,4) DEFAULT NULL,
  `packing_charge_type` enum('fixed','percent') DEFAULT NULL,
  `service_custom_field_1` text DEFAULT NULL,
  `service_custom_field_2` text DEFAULT NULL,
  `service_custom_field_3` text DEFAULT NULL,
  `service_custom_field_4` text DEFAULT NULL,
  `service_custom_field_5` text DEFAULT NULL,
  `service_custom_field_6` text DEFAULT NULL,
  `is_created_from_api` tinyint(1) NOT NULL DEFAULT 0,
  `rp_earned` int(11) NOT NULL DEFAULT 0 COMMENT 'rp is the short form of reward points',
  `order_addresses` text DEFAULT NULL,
  `is_recurring` tinyint(1) NOT NULL DEFAULT 0,
  `recur_interval` double(22,4) DEFAULT NULL,
  `recur_interval_type` enum('days','months','years') DEFAULT NULL,
  `recur_repetitions` int(11) DEFAULT NULL,
  `recur_stopped_on` datetime DEFAULT NULL,
  `recur_parent_id` int(11) DEFAULT NULL,
  `invoice_token` varchar(191) DEFAULT NULL,
  `pay_term_number` int(11) DEFAULT NULL,
  `pay_term_type` enum('days','months') DEFAULT NULL,
  `pjt_project_id` int(10) UNSIGNED DEFAULT NULL,
  `pjt_title` varchar(191) DEFAULT NULL,
  `selling_price_group_id` int(11) DEFAULT NULL,
  `return_group_id` int(11) DEFAULT NULL,
  `transfer_return` int(11) DEFAULT NULL,
  `return_transfer_location` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `exchange_parent_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'Reference to original transaction if this is an exchange',
  `is_exchange` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Mark if this transaction is an exchange'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `transactions`
--

INSERT INTO `transactions` (`id`, `exchange_sell_id`, `business_id`, `location_id`, `is_kitchen_order`, `res_table_id`, `res_waiter_id`, `res_order_status`, `type`, `sub_type`, `status`, `sub_status`, `is_quotation`, `payment_status`, `adjustment_type`, `contact_id`, `customer_group_id`, `invoice_no`, `ref_no`, `source`, `subscription_no`, `subscription_repeat_on`, `transaction_date`, `total_before_tax`, `tax_id`, `tax_amount`, `discount_type`, `discount_amount`, `rp_redeemed`, `rp_redeemed_amount`, `shipping_details`, `shipping_address`, `delivery_date`, `shipping_status`, `delivered_to`, `delivery_person`, `shipping_charges`, `shipping_custom_field_1`, `shipping_custom_field_2`, `shipping_custom_field_3`, `shipping_custom_field_4`, `shipping_custom_field_5`, `additional_notes`, `staff_note`, `is_export`, `export_custom_fields_info`, `round_off_amount`, `additional_expense_key_1`, `additional_expense_value_1`, `additional_expense_key_2`, `additional_expense_value_2`, `additional_expense_key_3`, `additional_expense_value_3`, `additional_expense_key_4`, `additional_expense_value_4`, `final_total`, `expense_category_id`, `expense_sub_category_id`, `expense_for`, `commission_agent`, `document`, `is_direct_sale`, `is_suspend`, `exchange_rate`, `total_amount_recovered`, `transfer_parent_id`, `return_parent_id`, `opening_stock_product_id`, `created_by`, `repair_completed_on`, `repair_warranty_id`, `repair_brand_id`, `repair_status_id`, `repair_model_id`, `repair_job_sheet_id`, `repair_defects`, `repair_serial_no`, `repair_checklist`, `repair_security_pwd`, `repair_security_pattern`, `repair_due_date`, `repair_device_id`, `repair_updates_notif`, `woocommerce_order_id`, `mfg_parent_production_purchase_id`, `mfg_wasted_units`, `mfg_production_cost`, `mfg_production_cost_type`, `mfg_is_final`, `essentials_duration`, `essentials_duration_unit`, `essentials_amount_per_unit_duration`, `essentials_allowances`, `essentials_deductions`, `crm_is_order_request`, `purchase_requisition_ids`, `prefer_payment_method`, `prefer_payment_account`, `sales_order_ids`, `purchase_order_ids`, `custom_field_1`, `custom_field_2`, `custom_field_3`, `custom_field_4`, `import_batch`, `import_time`, `types_of_service_id`, `packing_charge`, `packing_charge_type`, `service_custom_field_1`, `service_custom_field_2`, `service_custom_field_3`, `service_custom_field_4`, `service_custom_field_5`, `service_custom_field_6`, `is_created_from_api`, `rp_earned`, `order_addresses`, `is_recurring`, `recur_interval`, `recur_interval_type`, `recur_repetitions`, `recur_stopped_on`, `recur_parent_id`, `invoice_token`, `pay_term_number`, `pay_term_type`, `pjt_project_id`, `pjt_title`, `selling_price_group_id`, `return_group_id`, `transfer_return`, `return_transfer_location`, `created_at`, `updated_at`, `exchange_parent_id`, `is_exchange`) VALUES
(3369, NULL, 1, 1, 0, NULL, NULL, NULL, 'opening_balance', NULL, 'final', NULL, 0, 'due', NULL, 428, NULL, NULL, '2026/0001', NULL, NULL, NULL, '2026-04-02 22:23:41', 10000.0000, NULL, 0.0000, NULL, 0.0000, 0, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, 10000.0000, NULL, NULL, NULL, NULL, NULL, 0, 0, 1.000, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 0.0000, 'percentage', 0, 0.00, NULL, 0.0000, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 16:23:41', '2026-04-02 16:23:41', NULL, 0),
(3370, NULL, 1, 1, 0, NULL, NULL, NULL, 'opening_balance', NULL, 'final', NULL, 0, 'due', NULL, 429, NULL, NULL, '2026/0002', NULL, NULL, NULL, '2026-04-02 22:25:18', 500.0000, NULL, 0.0000, NULL, 0.0000, 0, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, 500.0000, NULL, NULL, NULL, NULL, NULL, 0, 0, 1.000, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 0.0000, 'percentage', 0, 0.00, NULL, 0.0000, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 16:25:18', '2026-04-02 16:25:18', NULL, 0),
(3371, NULL, 1, 1, 0, NULL, NULL, NULL, 'opening_balance', NULL, 'final', NULL, 0, 'due', NULL, 430, NULL, NULL, '2026/0003', NULL, NULL, NULL, '2026-04-02 22:29:25', 5000.0000, NULL, 0.0000, NULL, 0.0000, 0, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, 5000.0000, NULL, NULL, NULL, NULL, NULL, 0, 0, 1.000, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 0.0000, 'percentage', 0, 0.00, NULL, 0.0000, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 16:29:25', '2026-04-02 16:29:25', NULL, 0),
(3372, NULL, 1, 19, 0, NULL, NULL, NULL, 'opening_stock', NULL, 'received', NULL, 0, 'paid', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-01-01 23:55:24', 40.0000, NULL, 0.0000, NULL, 0.0000, 0, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, 0.0000, NULL, NULL, NULL, NULL, NULL, '100pc opening stock', NULL, 0, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, 4000.0000, NULL, NULL, NULL, NULL, NULL, 0, 0, 1.000, NULL, NULL, NULL, 2216, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 0.0000, 'percentage', 0, 0.00, NULL, 0.0000, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 17:55:24', '2026-04-02 17:55:24', NULL, 0),
(3373, NULL, 1, 1, 0, NULL, NULL, NULL, 'opening_stock', NULL, 'received', NULL, 0, 'paid', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-01-01 23:59:49', 100000.0000, NULL, 0.0000, NULL, 0.0000, 0, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, 1000000.0000, NULL, NULL, NULL, NULL, NULL, 0, 0, 1.000, NULL, NULL, NULL, 2217, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 0.0000, 'percentage', 0, 0.00, NULL, 0.0000, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 17:59:49', '2026-04-02 17:59:49', NULL, 0),
(3374, NULL, 1, 1, 0, NULL, NULL, NULL, 'opening_stock', NULL, 'received', NULL, 0, 'paid', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-01-01 00:03:47', 200000.0000, NULL, 0.0000, NULL, 0.0000, 0, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, 800000.0000, NULL, NULL, NULL, NULL, NULL, 0, 0, 1.000, NULL, NULL, NULL, 2218, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 0.0000, 'percentage', 0, 0.00, NULL, 0.0000, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 18:03:47', '2026-04-02 18:03:47', NULL, 0),
(3375, NULL, 1, 19, 0, NULL, NULL, NULL, 'opening_stock', NULL, 'received', NULL, 0, 'paid', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-01-01 00:05:28', 50.0000, NULL, 0.0000, NULL, 0.0000, 0, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, 500.0000, NULL, NULL, NULL, NULL, NULL, 0, 0, 1.000, NULL, NULL, NULL, 2219, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 0.0000, 'percentage', 0, 0.00, NULL, 0.0000, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 18:05:28', '2026-04-02 18:05:28', NULL, 0),
(3376, NULL, 1, 19, 0, NULL, NULL, NULL, 'purchase_order', NULL, 'completed', NULL, 0, NULL, NULL, 428, NULL, NULL, '2026/0001', NULL, NULL, NULL, '2026-04-03 00:17:00', 90000.0000, NULL, 0.0000, NULL, 0.0000, 0, 0.0000, 'test details', 'test shipping address', NULL, 'delivered', NULL, NULL, 1000.0000, NULL, NULL, NULL, NULL, NULL, 'test addiotnal note', NULL, 0, NULL, 0.0000, 'Courier', 100.0000, NULL, 0.0000, NULL, 0.0000, 'Courier', 0.0000, 91100.0000, NULL, NULL, NULL, NULL, NULL, 0, 0, 1.000, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 0.0000, 'percentage', 0, 0.00, NULL, 0.0000, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 1, 'months', NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 18:19:45', '2026-04-02 18:21:51', NULL, 0),
(3377, NULL, 1, 1, 0, NULL, NULL, NULL, 'purchase', NULL, 'received', NULL, 0, 'paid', NULL, 427, NULL, NULL, 'PO2026/0001', NULL, NULL, NULL, '2026-04-03 00:23:00', 1000000.0000, NULL, 0.0000, 'fixed', 50.0000, 0, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, 0.0000, NULL, NULL, NULL, NULL, NULL, 'test niote', NULL, 0, NULL, 0.0000, 'Courier', 5000.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, 1004950.0000, NULL, NULL, NULL, NULL, NULL, 0, 0, 1.000, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 0.0000, 'percentage', 0, 0.00, NULL, 0.0000, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 1, 'months', NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 18:27:50', '2026-04-02 18:31:10', NULL, 0),
(3378, NULL, 1, 1, 0, NULL, NULL, NULL, 'purchase', NULL, 'received', NULL, 0, 'partial', NULL, 428, NULL, NULL, 'PO2026/0002', NULL, NULL, NULL, '2026-04-03 00:31:00', 600000.0000, NULL, 0.0000, NULL, 0.0000, 0, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, 600000.0000, NULL, NULL, NULL, NULL, NULL, 0, 0, 1.000, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 0.0000, 'percentage', 0, 0.00, NULL, 0.0000, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 1, 'months', NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 18:33:39', '2026-04-02 18:33:39', NULL, 0),
(3379, NULL, 1, 19, 0, NULL, NULL, NULL, 'purchase', NULL, 'received', NULL, 0, 'partial', NULL, 429, NULL, NULL, 'PO2026/0003', NULL, NULL, NULL, '2026-04-03 00:35:00', 90000.0000, NULL, 0.0000, NULL, 0.0000, 0, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, 0.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, NULL, 0.0000, 90000.0000, NULL, NULL, NULL, NULL, NULL, 0, 0, 1.000, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 0.0000, 'percentage', 0, 0.00, NULL, 0.0000, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 2, 'months', NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 18:37:03', '2026-04-02 18:37:03', NULL, 0);

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

--
-- Table structure for table `transaction_exchanges`
--

CREATE TABLE `transaction_exchanges` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `location_id` int(10) UNSIGNED NOT NULL,
  `original_transaction_id` int(10) UNSIGNED NOT NULL COMMENT 'Reference to original sale',
  `exchange_transaction_id` int(10) UNSIGNED NOT NULL COMMENT 'New exchange transaction',
  `exchange_ref_no` varchar(191) NOT NULL,
  `exchange_date` datetime NOT NULL,
  `total_exchange_amount` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Net amount (positive=customer pays, negative=refund)',
  `status` enum('pending','completed','cancelled') NOT NULL DEFAULT 'pending',
  `created_by` int(10) UNSIGNED NOT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `original_amount` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Total amount of returned items',
  `new_amount` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Total amount of new items',
  `exchange_difference` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Difference amount (new - original)',
  `payment_received` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Additional payment received from customer',
  `refund_given` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Refund given to customer',
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `cancelled_by` int(10) UNSIGNED DEFAULT NULL,
  `stock_adjustments` text DEFAULT NULL COMMENT 'JSON data of stock adjustments for reversal'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `transaction_exchange_lines`
--

CREATE TABLE `transaction_exchange_lines` (
  `id` int(10) UNSIGNED NOT NULL,
  `exchange_id` int(10) UNSIGNED NOT NULL,
  `original_sell_line_id` int(10) UNSIGNED NOT NULL COMMENT 'Original item being returned',
  `new_sell_line_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'New item being sold (if any)',
  `exchange_type` enum('return_only','exchange_with_new','new_only') NOT NULL DEFAULT 'exchange_with_new',
  `original_quantity` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `original_unit_price` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `new_quantity` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `new_unit_price` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `price_difference` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'New price - Original price',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `transaction_payments`
--

CREATE TABLE `transaction_payments` (
  `id` int(10) UNSIGNED NOT NULL,
  `transaction_id` int(10) UNSIGNED DEFAULT NULL,
  `business_id` int(11) DEFAULT NULL,
  `is_return` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Used during sales to return the change',
  `amount` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `method` varchar(191) DEFAULT NULL,
  `payment_type` varchar(191) DEFAULT NULL,
  `transaction_no` varchar(191) DEFAULT NULL,
  `card_transaction_number` varchar(191) DEFAULT NULL,
  `card_number` varchar(191) DEFAULT NULL,
  `card_type` varchar(191) DEFAULT NULL,
  `card_holder_name` varchar(191) DEFAULT NULL,
  `card_month` varchar(191) DEFAULT NULL,
  `card_year` varchar(191) DEFAULT NULL,
  `card_security` varchar(5) DEFAULT NULL,
  `cheque_number` varchar(191) DEFAULT NULL,
  `bank_account_number` varchar(191) DEFAULT NULL,
  `paid_on` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `paid_through_link` tinyint(1) NOT NULL DEFAULT 0,
  `gateway` varchar(191) DEFAULT NULL,
  `is_advance` tinyint(1) NOT NULL DEFAULT 0,
  `payment_for` int(11) DEFAULT NULL COMMENT 'stores the contact id',
  `parent_id` int(11) DEFAULT NULL,
  `note` varchar(191) DEFAULT NULL,
  `document` varchar(191) DEFAULT NULL,
  `payment_ref_no` varchar(191) DEFAULT NULL,
  `account_id` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `transaction_payments`
--

INSERT INTO `transaction_payments` (`id`, `transaction_id`, `business_id`, `is_return`, `amount`, `method`, `payment_type`, `transaction_no`, `card_transaction_number`, `card_number`, `card_type`, `card_holder_name`, `card_month`, `card_year`, `card_security`, `cheque_number`, `bank_account_number`, `paid_on`, `created_by`, `paid_through_link`, `gateway`, `is_advance`, `payment_for`, `parent_id`, `note`, `document`, `payment_ref_no`, `account_id`, `created_at`, `updated_at`) VALUES
(1965, 3377, 1, 0, 1004950.0000, 'cash', NULL, NULL, NULL, NULL, 'credit', NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-03 00:30:00', 1, 0, NULL, 0, 427, NULL, NULL, NULL, 'PP2026/0001', 22, '2026-04-02 18:31:10', '2026-04-02 18:31:10'),
(1966, 3378, 1, 0, 10000.0000, 'cash', NULL, NULL, NULL, NULL, 'credit', NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-03 00:31:00', 1, 0, NULL, 0, 428, NULL, NULL, NULL, 'PP2026/0002', 22, '2026-04-02 18:33:39', '2026-04-02 18:33:39'),
(1967, 3378, 1, 0, 89000.0000, 'cash', NULL, NULL, NULL, NULL, 'credit', NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-03 00:33:00', 1, 0, NULL, 0, 428, NULL, NULL, NULL, 'PP2026/0003', 22, '2026-04-02 18:34:12', '2026-04-02 18:34:12'),
(1968, 3379, 1, 0, 25000.0000, 'cash', NULL, NULL, NULL, NULL, 'credit', NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-03 00:35:00', 1, 0, NULL, 0, 429, NULL, NULL, NULL, 'PP2026/0004', NULL, '2026-04-02 18:37:03', '2026-04-02 18:37:03');

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

--
-- Table structure for table `transaction_sell_lines`
--

CREATE TABLE `transaction_sell_lines` (
  `id` int(10) UNSIGNED NOT NULL,
  `transaction_id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `variation_id` int(10) UNSIGNED NOT NULL,
  `quantity` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `mfg_waste_percent` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `mfg_ingredient_group_id` int(11) DEFAULT NULL,
  `sell_unit_id` int(11) DEFAULT NULL,
  `secondary_unit_quantity` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `quantity_returned` decimal(20,4) NOT NULL DEFAULT 0.0000,
  `unit_price_before_discount` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `unit_price` decimal(22,4) DEFAULT NULL COMMENT 'Sell price excluding tax',
  `line_discount_type` enum('fixed','percentage') DEFAULT NULL,
  `line_discount_amount` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `unit_price_inc_tax` decimal(22,4) DEFAULT NULL COMMENT 'Sell price including tax',
  `item_tax` decimal(22,4) NOT NULL COMMENT 'Tax for one quantity',
  `tax_id` int(10) UNSIGNED DEFAULT NULL,
  `discount_id` int(11) DEFAULT NULL,
  `lot_no_line_id` int(11) DEFAULT NULL,
  `sell_line_note` text DEFAULT NULL,
  `woocommerce_line_items_id` int(11) DEFAULT NULL,
  `so_line_id` int(11) DEFAULT NULL,
  `so_quantity_invoiced` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `res_service_staff_id` int(11) DEFAULT NULL,
  `res_line_order_status` varchar(191) DEFAULT NULL,
  `parent_sell_line_id` int(11) DEFAULT NULL,
  `children_type` varchar(191) NOT NULL DEFAULT '' COMMENT 'Type of children for the parent, like modifier or combo',
  `sub_unit_id` int(11) DEFAULT NULL,
  `transfer_return` int(11) DEFAULT NULL,
  `return_sell_line_id` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `is_exchange_return` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Mark if this line item was returned in exchange',
  `exchange_parent_line_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'Reference to original sell line if this is exchange replacement'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `transaction_sell_lines_purchase_lines`
--

CREATE TABLE `transaction_sell_lines_purchase_lines` (
  `id` int(10) UNSIGNED NOT NULL,
  `sell_line_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'id from transaction_sell_lines',
  `stock_adjustment_line_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'id from stock_adjustment_lines',
  `purchase_line_id` int(10) UNSIGNED NOT NULL COMMENT 'id from purchase_lines',
  `quantity` decimal(22,4) NOT NULL,
  `qty_returned` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `types_of_services`
--

CREATE TABLE `types_of_services` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `business_id` int(11) NOT NULL,
  `location_price_group` text DEFAULT NULL,
  `packing_charge` decimal(22,4) DEFAULT NULL,
  `packing_charge_type` enum('fixed','percent') DEFAULT NULL,
  `enable_custom_fields` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `units`
--

CREATE TABLE `units` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `actual_name` varchar(191) NOT NULL,
  `short_name` varchar(191) NOT NULL,
  `allow_decimal` tinyint(1) NOT NULL,
  `base_unit_id` int(11) DEFAULT NULL,
  `base_unit_multiplier` decimal(20,4) DEFAULT NULL,
  `created_by` int(10) UNSIGNED NOT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `units`
--

INSERT INTO `units` (`id`, `business_id`, `actual_name`, `short_name`, `allow_decimal`, `base_unit_id`, `base_unit_multiplier`, `created_by`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 1, 'Pieces', 'Pc(s)', 0, NULL, NULL, 1, NULL, '2024-10-25 16:39:24', '2024-10-25 16:39:24'),
(90, 1, 'Dozen', 'DZN', 0, 1, 12.0000, 1, NULL, '2026-04-02 17:34:11', '2026-04-02 17:35:03'),
(91, 1, 'Liter', 'LTR', 0, NULL, NULL, 1, NULL, '2026-04-02 17:34:53', '2026-04-02 17:34:53'),
(92, 1, 'Half Dozen', 'HFDZN', 0, 1, 6.0000, 1, NULL, '2026-04-02 17:35:34', '2026-04-02 17:35:34');

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_type` varchar(191) NOT NULL DEFAULT 'user',
  `surname` char(10) DEFAULT NULL,
  `first_name` varchar(191) NOT NULL,
  `last_name` varchar(191) DEFAULT NULL,
  `username` varchar(191) DEFAULT NULL,
  `email` varchar(191) DEFAULT NULL,
  `password` varchar(191) DEFAULT NULL,
  `login_pin` text DEFAULT NULL,
  `language` char(7) NOT NULL DEFAULT 'en',
  `contact_no` char(15) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `remember_token` varchar(100) DEFAULT NULL,
  `business_id` int(10) UNSIGNED DEFAULT NULL,
  `essentials_department_id` int(11) DEFAULT NULL,
  `essentials_designation_id` int(11) DEFAULT NULL,
  `essentials_salary` decimal(22,4) DEFAULT NULL,
  `essentials_pay_period` varchar(191) DEFAULT NULL,
  `essentials_pay_cycle` varchar(191) DEFAULT NULL,
  `available_at` datetime DEFAULT NULL COMMENT 'Service staff avilable at. Calculated from product preparation_time_in_minutes',
  `paused_at` datetime DEFAULT NULL COMMENT 'Service staff available time paused at, Will be nulled on resume.',
  `max_sales_discount_percent` decimal(5,2) DEFAULT NULL,
  `allow_login` tinyint(1) NOT NULL DEFAULT 1,
  `status` enum('active','inactive','terminated') NOT NULL DEFAULT 'active',
  `is_enable_service_staff_pin` tinyint(1) NOT NULL DEFAULT 0,
  `service_staff_pin` text DEFAULT NULL,
  `crm_contact_id` int(10) UNSIGNED DEFAULT NULL,
  `is_cmmsn_agnt` tinyint(1) NOT NULL DEFAULT 0,
  `cmmsn_percent` decimal(4,2) NOT NULL DEFAULT 0.00,
  `selected_contacts` tinyint(1) NOT NULL DEFAULT 0,
  `dob` date DEFAULT NULL,
  `gender` varchar(191) DEFAULT NULL,
  `marital_status` enum('married','unmarried','divorced') DEFAULT NULL,
  `blood_group` char(10) DEFAULT NULL,
  `contact_number` char(20) DEFAULT NULL,
  `alt_number` varchar(191) DEFAULT NULL,
  `family_number` varchar(191) DEFAULT NULL,
  `fb_link` varchar(191) DEFAULT NULL,
  `twitter_link` varchar(191) DEFAULT NULL,
  `social_media_1` varchar(191) DEFAULT NULL,
  `social_media_2` varchar(191) DEFAULT NULL,
  `permanent_address` text DEFAULT NULL,
  `current_address` text DEFAULT NULL,
  `guardian_name` varchar(191) DEFAULT NULL,
  `custom_field_1` varchar(191) DEFAULT NULL,
  `custom_field_2` varchar(191) DEFAULT NULL,
  `custom_field_3` varchar(191) DEFAULT NULL,
  `custom_field_4` varchar(191) DEFAULT NULL,
  `bank_details` longtext DEFAULT NULL,
  `id_proof_name` varchar(191) DEFAULT NULL,
  `id_proof_number` varchar(191) DEFAULT NULL,
  `location_id` int(11) DEFAULT NULL COMMENT 'user primary work location',
  `crm_department` varchar(191) DEFAULT NULL COMMENT 'Contact person''s department',
  `crm_designation` varchar(191) DEFAULT NULL COMMENT 'Contact person''s designation',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `user_type`, `surname`, `first_name`, `last_name`, `username`, `email`, `password`, `login_pin`, `language`, `contact_no`, `address`, `remember_token`, `business_id`, `essentials_department_id`, `essentials_designation_id`, `essentials_salary`, `essentials_pay_period`, `essentials_pay_cycle`, `available_at`, `paused_at`, `max_sales_discount_percent`, `allow_login`, `status`, `is_enable_service_staff_pin`, `service_staff_pin`, `crm_contact_id`, `is_cmmsn_agnt`, `cmmsn_percent`, `selected_contacts`, `dob`, `gender`, `marital_status`, `blood_group`, `contact_number`, `alt_number`, `family_number`, `fb_link`, `twitter_link`, `social_media_1`, `social_media_2`, `permanent_address`, `current_address`, `guardian_name`, `custom_field_1`, `custom_field_2`, `custom_field_3`, `custom_field_4`, `bank_details`, `id_proof_name`, `id_proof_number`, `location_id`, `crm_department`, `crm_designation`, `deleted_at`, `created_at`, `updated_at`) VALUES
(1, 'user', 'MR', 'HIMAL', NULL, 'admin', 'admin@gmail.com', '$2y$10$QFrWWeW8ur7RTA09QubcOOGkaYrxRW15KW32i6nl0gWQtkIHI4drC', 'eyJpdiI6IlFPR1pUd3ZtbmhsZXpoYWt4dW9wL3c9PSIsInZhbHVlIjoiZG8xZnM5QTIvd1NOV1ExanlESW4rQT09IiwibWFjIjoiZWIwZmU5N2E4MWU4Y2Q3ODNhMTU4NWFkZTQ1ZTA1NTc5YzFiYTBmY2RlMWYxZTFkMjE0Y2IyZmFmZmM5ZWMyMCIsInRhZyI6IiJ9', 'en', NULL, NULL, 'Vo7tSZI9kSn2tplzmDob0jNYslMQ1V4po6nyjfWZqJyPrMXESctSyVJLb9iK', 1, NULL, 388, 13000.0000, 'month', NULL, NULL, NULL, NULL, 1, 'active', 0, NULL, NULL, 0, 0.00, 0, '1989-08-03', 'male', 'married', 'O+', '01756207207', '01855667785', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '{\"account_holder_name\":null,\"account_number\":null,\"bank_name\":null,\"bank_code\":null,\"branch\":null,\"tax_payer_id\":null}', NULL, NULL, 1, NULL, NULL, NULL, '2024-10-25 16:39:24', '2026-04-02 15:29:17'),
(25, 'user', 'MR', 'Shuvo', NULL, 'Shuvo', 'mrhimal60@gmail.com', '$2y$10$5CU/9bVBNltONpPYsqYs0.m3abOG6EErSAhzui3j5M/3jG8D2u8XW', NULL, 'en', NULL, NULL, NULL, 1, NULL, NULL, 1000.0000, 'month', NULL, NULL, NULL, 3.00, 1, 'active', 0, NULL, NULL, 0, 1.00, 0, NULL, 'male', 'unmarried', 'O+', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '{\"account_holder_name\":null,\"account_number\":null,\"bank_name\":null,\"bank_code\":null,\"branch\":null,\"tax_payer_id\":null}', NULL, NULL, 1, NULL, NULL, NULL, '2026-01-26 03:45:00', '2026-01-26 03:45:00'),
(34, 'user', NULL, 'branch manager1 edit', NULL, 'branchmanager1', 'branchmanager1@gmail.com', '$2y$10$L51tUKxRBveKjXI/h0IzXe0ZkJRcpq34P5D1cEt.Q5pybqWpEwoPG', NULL, 'en', NULL, NULL, NULL, 1, NULL, NULL, NULL, 'month', NULL, NULL, NULL, 10.00, 1, 'active', 1, '1234', NULL, 0, 3.00, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '{\"account_holder_name\":null,\"account_number\":null,\"bank_name\":null,\"bank_code\":null,\"branch\":null,\"tax_payer_id\":null}', NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-02 16:19:31', '2026-04-02 16:19:52');

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

--
-- Table structure for table `user_contact_access`
--

CREATE TABLE `user_contact_access` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(11) NOT NULL,
  `contact_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_contact_access`
--

INSERT INTO `user_contact_access` (`id`, `user_id`, `contact_id`) VALUES
(1, 34, 429);

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

--
-- Table structure for table `variations`
--

CREATE TABLE `variations` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `sub_sku` varchar(191) DEFAULT NULL,
  `product_variation_id` int(10) UNSIGNED NOT NULL,
  `woocommerce_variation_id` int(11) DEFAULT NULL,
  `variation_value_id` int(11) DEFAULT NULL,
  `default_purchase_price` decimal(22,4) DEFAULT NULL,
  `dpp_inc_tax` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `profit_percent` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `default_sell_price` decimal(22,4) DEFAULT NULL,
  `sell_price_inc_tax` decimal(22,4) DEFAULT NULL COMMENT 'Sell price including tax',
  `first_unit_sku` varchar(191) DEFAULT NULL COMMENT 'First Unit SKU',
  `fu_default_purchase_price` decimal(22,4) DEFAULT NULL COMMENT 'First Unit',
  `fu_dpp_inc_tax` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'First Unit',
  `fu_profit_percent` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'First Unit',
  `fu_default_sell_price` decimal(22,4) DEFAULT NULL COMMENT 'First Unit',
  `fu_sell_price_inc_tax` decimal(22,4) DEFAULT NULL COMMENT 'First Unit',
  `second_unit_sku` varchar(191) DEFAULT NULL COMMENT 'Second Unit SKU',
  `su_default_purchase_price` decimal(22,4) DEFAULT NULL COMMENT 'Second Unit',
  `su_dpp_inc_tax` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Second Unit',
  `su_profit_percent` decimal(22,4) NOT NULL DEFAULT 0.0000 COMMENT 'Second Unit',
  `su_default_sell_price` decimal(22,4) DEFAULT NULL COMMENT 'Second Unit',
  `su_sell_price_inc_tax` decimal(22,4) DEFAULT NULL COMMENT 'Second Unit',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `combo_variations` text DEFAULT NULL COMMENT 'Contains the combo variation details',
  `modifier_qty` decimal(10,2) DEFAULT NULL,
  `modifier_product` bigint(20) DEFAULT NULL,
  `color_button_modifier` varchar(191) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `variations`
--

INSERT INTO `variations` (`id`, `name`, `product_id`, `sub_sku`, `product_variation_id`, `woocommerce_variation_id`, `variation_value_id`, `default_purchase_price`, `dpp_inc_tax`, `profit_percent`, `default_sell_price`, `sell_price_inc_tax`, `first_unit_sku`, `fu_default_purchase_price`, `fu_dpp_inc_tax`, `fu_profit_percent`, `fu_default_sell_price`, `fu_sell_price_inc_tax`, `second_unit_sku`, `su_default_purchase_price`, `su_dpp_inc_tax`, `su_profit_percent`, `su_default_sell_price`, `su_sell_price_inc_tax`, `created_at`, `updated_at`, `deleted_at`, `combo_variations`, `modifier_qty`, `modifier_product`, `color_button_modifier`) VALUES
(2221, 'DUMMY', 2216, '123', 2216, NULL, NULL, 40.0000, 40.0000, 0.0000, 40.0000, 40.0000, NULL, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, NULL, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, '2026-04-02 17:53:21', '2026-04-02 17:55:03', NULL, '[]', NULL, NULL, NULL),
(2222, 'DUMMY', 2217, 's1', 2217, NULL, NULL, 100000.0000, 100000.0000, 25.0000, 125000.0000, 125000.0000, NULL, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, NULL, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, '2026-04-02 17:58:42', '2026-04-02 18:00:55', NULL, '[]', NULL, NULL, NULL),
(2223, 'DUMMY', 2218, 'iphone17', 2218, NULL, NULL, 200000.0000, 200000.0000, 25.0000, 250000.0000, 250000.0000, NULL, NULL, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0.0000, 0.0000, NULL, NULL, '2026-04-02 18:03:14', '2026-04-02 18:27:50', NULL, '[]', NULL, NULL, NULL),
(2224, 'DUMMY', 2219, 'LX12', 2219, NULL, NULL, 50.0000, 50.0000, 50.0000, 75.0000, 75.0000, NULL, NULL, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0.0000, 0.0000, NULL, NULL, '2026-04-02 18:05:20', '2026-04-02 18:05:20', NULL, '[]', NULL, NULL, NULL),
(2225, 'DUMMY', 2220, 'cmbp1', 2220, NULL, NULL, 90.0000, 90.0000, 16.6700, 105.0000, 105.0000, NULL, NULL, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0.0000, 0.0000, NULL, NULL, '2026-04-02 18:16:12', '2026-04-02 18:16:12', NULL, '[{\"variation_id\":\"2221\",\"quantity\":1,\"unit_id\":\"1\"},{\"variation_id\":\"2224\",\"quantity\":1,\"unit_id\":\"1\"}]', NULL, NULL, NULL);

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

--
-- Table structure for table `variation_group_prices`
--

CREATE TABLE `variation_group_prices` (
  `id` int(10) UNSIGNED NOT NULL,
  `variation_id` int(10) UNSIGNED NOT NULL,
  `price_group_id` int(10) UNSIGNED NOT NULL,
  `price_inc_tax` decimal(22,4) NOT NULL,
  `price_type` varchar(191) NOT NULL DEFAULT 'fixed',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `variation_location_details`
--

CREATE TABLE `variation_location_details` (
  `id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `product_variation_id` int(10) UNSIGNED NOT NULL COMMENT 'id from product_variations table',
  `variation_id` int(10) UNSIGNED NOT NULL,
  `location_id` int(10) UNSIGNED NOT NULL,
  `qty_available` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `variation_location_details`
--

INSERT INTO `variation_location_details` (`id`, `product_id`, `product_variation_id`, `variation_id`, `location_id`, `qty_available`, `created_at`, `updated_at`) VALUES
(1543, 2216, 2216, 2221, 19, 1100.0000, '2026-04-02 17:55:24', '2026-04-02 18:37:03'),
(1544, 2217, 2217, 2222, 1, 10.0000, '2026-04-02 17:59:49', '2026-04-02 17:59:49'),
(1545, 2218, 2218, 2223, 1, 12.0000, '2026-04-02 18:03:47', '2026-04-02 18:33:39'),
(1546, 2219, 2219, 2224, 19, 1010.0000, '2026-04-02 18:05:28', '2026-04-02 18:37:03');

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

--
-- Table structure for table `variation_templates`
--

CREATE TABLE `variation_templates` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `business_id` int(10) UNSIGNED NOT NULL,
  `woocommerce_attr_id` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `variation_templates`
--

INSERT INTO `variation_templates` (`id`, `name`, `business_id`, `woocommerce_attr_id`, `created_at`, `updated_at`) VALUES
(6, 'Color', 1, NULL, '2026-04-02 17:33:34', '2026-04-02 17:50:02'),
(7, 'Storage', 1, NULL, '2026-04-02 17:50:38', '2026-04-02 17:50:38'),
(8, 'Flavour', 1, NULL, '2026-04-02 17:52:09', '2026-04-02 17:52:09');

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

--
-- Table structure for table `variation_value_templates`
--

CREATE TABLE `variation_value_templates` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `variation_template_id` int(10) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `variation_value_templates`
--

INSERT INTO `variation_value_templates` (`id`, `name`, `variation_template_id`, `created_at`, `updated_at`) VALUES
(21, 'Blue', 6, '2026-04-02 17:33:34', '2026-04-02 17:50:02'),
(22, 'Black', 6, '2026-04-02 17:50:02', '2026-04-02 17:50:02'),
(23, 'Red', 6, '2026-04-02 17:50:02', '2026-04-02 17:50:02'),
(24, 'White', 6, '2026-04-02 17:50:02', '2026-04-02 17:50:02'),
(25, '32Gb', 7, '2026-04-02 17:50:38', '2026-04-02 17:50:38'),
(26, '64Gb', 7, '2026-04-02 17:50:38', '2026-04-02 17:50:38'),
(27, '128Gb', 7, '2026-04-02 17:50:38', '2026-04-02 17:50:38'),
(28, '256Gb', 7, '2026-04-02 17:50:38', '2026-04-02 17:50:38'),
(29, '512Gb', 7, '2026-04-02 17:50:38', '2026-04-02 17:50:38'),
(30, 'Strawberry', 8, '2026-04-02 17:52:09', '2026-04-02 17:52:09'),
(31, 'Vanila', 8, '2026-04-02 17:52:09', '2026-04-02 17:52:09'),
(32, 'Chocolate', 8, '2026-04-02 17:52:09', '2026-04-02 17:52:09');

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

--
-- Table structure for table `vld_backup_1_2026_03_15_18_50_01`
--

CREATE TABLE `vld_backup_1_2026_03_15_18_50_01` (
  `id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `product_variation_id` int(10) UNSIGNED NOT NULL COMMENT 'id from product_variations table',
  `variation_id` int(10) UNSIGNED NOT NULL,
  `location_id` int(10) UNSIGNED NOT NULL,
  `qty_available` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vld_backup_1_2026_03_15_18_57_56`
--

CREATE TABLE `vld_backup_1_2026_03_15_18_57_56` (
  `id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `product_variation_id` int(10) UNSIGNED NOT NULL COMMENT 'id from product_variations table',
  `variation_id` int(10) UNSIGNED NOT NULL,
  `location_id` int(10) UNSIGNED NOT NULL,
  `qty_available` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `vld_backup_1_2026_03_15_19_30_41`
--

CREATE TABLE `vld_backup_1_2026_03_15_19_30_41` (
  `id` int(10) UNSIGNED NOT NULL,
  `product_id` int(10) UNSIGNED NOT NULL,
  `product_variation_id` int(10) UNSIGNED NOT NULL COMMENT 'id from product_variations table',
  `variation_id` int(10) UNSIGNED NOT NULL,
  `location_id` int(10) UNSIGNED NOT NULL,
  `qty_available` decimal(22,4) NOT NULL DEFAULT 0.0000,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `warehouses`
--

CREATE TABLE `warehouses` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `business_id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `location` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `warranties`
--

CREATE TABLE `warranties` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `business_id` int(11) NOT NULL,
  `description` text DEFAULT NULL,
  `duration` int(11) NOT NULL,
  `duration_type` enum('days','months','years') NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `warranties`
--

INSERT INTO `warranties` (`id`, `name`, `business_id`, `description`, `duration`, `duration_type`, `created_at`, `updated_at`) VALUES
(23, '7days', 1, '7day warranty', 7, 'days', '2026-04-02 15:45:34', '2026-04-02 15:45:34'),
(24, '1Month warranty', 1, NULL, 30, 'days', '2026-04-02 15:46:47', '2026-04-02 15:46:47'),
(25, '6 Month edit', 1, NULL, 6, 'months', '2026-04-02 15:48:31', '2026-04-02 15:48:51');

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

--
-- Table structure for table `whatsapp_gateway`
--

CREATE TABLE `whatsapp_gateway` (
  `id` int(10) UNSIGNED NOT NULL,
  `sources` varchar(191) NOT NULL,
  `is_default` int(11) NOT NULL,
  `wa_server` varchar(191) NOT NULL,
  `sender` bigint(20) DEFAULT NULL COMMENT 'Add sender for MPWA',
  `app_key` varchar(191) NOT NULL,
  `auth_key` varchar(191) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `woocommerce_sync_logs`
--

CREATE TABLE `woocommerce_sync_logs` (
  `id` int(10) UNSIGNED NOT NULL,
  `business_id` int(11) NOT NULL,
  `sync_type` varchar(191) NOT NULL,
  `operation_type` varchar(191) DEFAULT NULL,
  `data` longtext DEFAULT NULL,
  `details` longtext DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `accounting_accounts`
--
ALTER TABLE `accounting_accounts`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `accounting_accounts_transactions`
--
ALTER TABLE `accounting_accounts_transactions`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `accounting_account_types`
--
ALTER TABLE `accounting_account_types`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `accounting_acc_trans_mappings`
--
ALTER TABLE `accounting_acc_trans_mappings`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `accounting_budgets`
--
ALTER TABLE `accounting_budgets`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `accounts`
--
ALTER TABLE `accounts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `accounts_business_id_index` (`business_id`),
  ADD KEY `accounts_account_type_id_index` (`account_type_id`),
  ADD KEY `accounts_created_by_index` (`created_by`);

--
-- Indexes for table `account_transactions`
--
ALTER TABLE `account_transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `account_transactions_account_id_index` (`account_id`),
  ADD KEY `account_transactions_transaction_id_index` (`transaction_id`),
  ADD KEY `account_transactions_transaction_payment_id_index` (`transaction_payment_id`),
  ADD KEY `account_transactions_transfer_transaction_id_index` (`transfer_transaction_id`),
  ADD KEY `account_transactions_created_by_index` (`created_by`),
  ADD KEY `account_transactions_type_index` (`type`),
  ADD KEY `account_transactions_sub_type_index` (`sub_type`),
  ADD KEY `account_transactions_operation_date_index` (`operation_date`),
  ADD KEY `idx_account_transactions_account_date` (`account_id`,`operation_date`),
  ADD KEY `idx_account_transactions_operation_date` (`operation_date`);

--
-- Indexes for table `account_types`
--
ALTER TABLE `account_types`
  ADD PRIMARY KEY (`id`),
  ADD KEY `account_types_parent_account_type_id_index` (`parent_account_type_id`),
  ADD KEY `account_types_business_id_index` (`business_id`);

--
-- Indexes for table `activity_log`
--
ALTER TABLE `activity_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `activity_log_log_name_index` (`log_name`);

--
-- Indexes for table `advanced_report_configurations`
--
ALTER TABLE `advanced_report_configurations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `arc_type_active_idx` (`report_type`,`is_active`);

--
-- Indexes for table `advanced_report_exports`
--
ALTER TABLE `advanced_report_exports`
  ADD PRIMARY KEY (`id`),
  ADD KEY `are_biz_status_idx` (`business_id`,`status`),
  ADD KEY `are_created_status_idx` (`created_at`,`status`);

--
-- Indexes for table `advanced_report_saved_filters`
--
ALTER TABLE `advanced_report_saved_filters`
  ADD PRIMARY KEY (`id`),
  ADD KEY `advanced_report_saved_filters_user_id_foreign` (`user_id`),
  ADD KEY `arsf_biz_user_type_idx` (`business_id`,`user_id`,`report_type`);

--
-- Indexes for table `advanced_report_schedules`
--
ALTER TABLE `advanced_report_schedules`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ars_biz_active_idx` (`business_id`,`is_active`),
  ADD KEY `ars_next_run_idx` (`next_run_at`);

--
-- Indexes for table `aiassistance_history`
--
ALTER TABLE `aiassistance_history`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `ar_audit_log`
--
ALTER TABLE `ar_audit_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ar_audit_log_user_id_foreign` (`user_id`),
  ADD KEY `ar_audit_log_business_id_entity_type_entity_id_index` (`business_id`,`entity_type`,`entity_id`),
  ADD KEY `ar_audit_log_business_id_user_id_created_at_index` (`business_id`,`user_id`,`created_at`),
  ADD KEY `ar_audit_log_business_id_action_type_created_at_index` (`business_id`,`action_type`,`created_at`);

--
-- Indexes for table `ar_bank_accounts`
--
ALTER TABLE `ar_bank_accounts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ar_bank_accounts_business_id_account_name_unique` (`business_id`,`account_name`),
  ADD KEY `ar_bank_accounts_created_by_foreign` (`created_by`),
  ADD KEY `ar_bank_accounts_business_id_is_active_index` (`business_id`,`is_active`),
  ADD KEY `ar_bank_accounts_business_id_account_type_index` (`business_id`,`account_type`),
  ADD KEY `ar_bank_accounts_linked_account_id_index` (`linked_account_id`),
  ADD KEY `ar_bank_accounts_opening_balance_transaction_id_index` (`opening_balance_transaction_id`);

--
-- Indexes for table `ar_bank_reconciliation`
--
ALTER TABLE `ar_bank_reconciliation`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ar_bank_recon_jel_unique` (`journal_entry_line_id`),
  ADD KEY `ar_bank_reconciliation_account_id_foreign` (`account_id`),
  ADD KEY `ar_bank_reconciliation_cleared_by_foreign` (`cleared_by`),
  ADD KEY `ar_bank_recon_cleared_idx` (`business_id`,`account_id`,`is_cleared`),
  ADD KEY `ar_bank_recon_date_idx` (`business_id`,`account_id`,`transaction_date`),
  ADD KEY `ar_bank_reconciliation_account_transaction_id_index` (`account_transaction_id`);

--
-- Indexes for table `ar_budgets`
--
ALTER TABLE `ar_budgets`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ar_budgets_business_id_fiscal_year_index` (`business_id`,`fiscal_year`),
  ADD KEY `ar_budgets_account_id_fiscal_year_index` (`account_id`,`fiscal_year`),
  ADD KEY `ar_budgets_location_id_index` (`location_id`);

--
-- Indexes for table `ar_capital_accounts`
--
ALTER TABLE `ar_capital_accounts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ar_capital_accounts_business_id_account_name_unique` (`business_id`,`account_name`),
  ADD KEY `ar_capital_accounts_created_by_foreign` (`created_by`),
  ADD KEY `ar_capital_accounts_business_id_is_active_index` (`business_id`,`is_active`),
  ADD KEY `ar_capital_accounts_account_type_index` (`account_type`);

--
-- Indexes for table `ar_chart_of_accounts`
--
ALTER TABLE `ar_chart_of_accounts`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ar_chart_of_accounts_business_id_code_unique` (`business_id`,`code`),
  ADD KEY `ar_chart_of_accounts_account_id_foreign` (`account_id`),
  ADD KEY `ar_chart_of_accounts_created_by_foreign` (`created_by`),
  ADD KEY `ar_chart_of_accounts_updated_by_foreign` (`updated_by`),
  ADD KEY `ar_chart_of_accounts_business_id_account_group_index` (`business_id`,`account_group`),
  ADD KEY `ar_chart_of_accounts_business_id_account_type_index` (`business_id`,`account_type`),
  ADD KEY `ar_chart_of_accounts_business_id_code_index` (`business_id`,`code`),
  ADD KEY `ar_chart_of_accounts_parent_id_index` (`parent_id`);

--
-- Indexes for table `ar_cheque_books`
--
ALTER TABLE `ar_cheque_books`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ar_cheque_books_account_id_foreign` (`account_id`),
  ADD KEY `ar_cheque_books_location_id_foreign` (`location_id`),
  ADD KEY `ar_cheque_books_created_by_foreign` (`created_by`),
  ADD KEY `cheque_books_business_account_status_idx` (`business_id`,`account_id`,`status`),
  ADD KEY `cheque_books_range_idx` (`business_id`,`account_id`,`start_cheque_no`);

--
-- Indexes for table `ar_cheque_book_entries`
--
ALTER TABLE `ar_cheque_book_entries`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ar_cbe_unique` (`business_id`,`account_id`,`cheque_number`),
  ADD KEY `ar_cheque_book_entries_account_id_foreign` (`account_id`),
  ADD KEY `ar_cheque_book_entries_transaction_id_foreign` (`transaction_id`),
  ADD KEY `ar_cheque_book_entries_transaction_payment_id_foreign` (`transaction_payment_id`),
  ADD KEY `ar_cheque_book_entries_location_id_foreign` (`location_id`),
  ADD KEY `ar_cheque_book_entries_created_by_foreign` (`created_by`),
  ADD KEY `ar_cbe_status_idx` (`business_id`,`account_id`,`status`),
  ADD KEY `ar_cbe_date_idx` (`business_id`,`account_id`,`cheque_date`),
  ADD KEY `ar_cbe_cheque_idx` (`cheque_number`,`account_id`),
  ADD KEY `ar_cheque_book_entries_cheque_book_id_cheque_no_index` (`cheque_book_id`,`cheque_number`),
  ADD KEY `ar_cheque_book_entries_bank_account_id_index` (`bank_account_id`),
  ADD KEY `ar_cheque_book_entries_account_transaction_id_foreign` (`account_transaction_id`),
  ADD KEY `ar_cbe_source_cheque_idx` (`source_cheque_id`),
  ADD KEY `ar_cbe_contact_idx` (`contact_id`),
  ADD KEY `ar_cbe_deposit_account_idx` (`deposit_account_id`);

--
-- Indexes for table `ar_direct_expenses`
--
ALTER TABLE `ar_direct_expenses`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ar_direct_expenses_payment_account_id_foreign` (`payment_account_id`),
  ADD KEY `ar_direct_expenses_created_by_foreign` (`created_by`),
  ADD KEY `ar_direct_expenses_business_id_expense_date_index` (`business_id`,`expense_date`),
  ADD KEY `ar_direct_expenses_location_id_index` (`location_id`),
  ADD KEY `ar_direct_expenses_account_id_index` (`account_id`);

--
-- Indexes for table `ar_direct_expense_names`
--
ALTER TABLE `ar_direct_expense_names`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ar_direct_expense_names_business_id_name_unique` (`business_id`,`name`),
  ADD KEY `ar_direct_expense_names_created_by_foreign` (`created_by`),
  ADD KEY `ar_direct_expense_names_business_id_is_active_index` (`business_id`,`is_active`);

--
-- Indexes for table `ar_direct_incomes`
--
ALTER TABLE `ar_direct_incomes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ar_direct_incomes_payment_account_id_foreign` (`payment_account_id`),
  ADD KEY `ar_direct_incomes_created_by_foreign` (`created_by`),
  ADD KEY `ar_direct_incomes_business_id_income_date_index` (`business_id`,`income_date`),
  ADD KEY `ar_direct_incomes_location_id_index` (`location_id`),
  ADD KEY `ar_direct_incomes_account_id_index` (`account_id`);

--
-- Indexes for table `ar_direct_income_names`
--
ALTER TABLE `ar_direct_income_names`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ar_direct_income_names_business_id_name_unique` (`business_id`,`name`),
  ADD KEY `ar_direct_income_names_created_by_foreign` (`created_by`),
  ADD KEY `ar_direct_income_names_business_id_is_active_index` (`business_id`,`is_active`);

--
-- Indexes for table `ar_fifo_layers`
--
ALTER TABLE `ar_fifo_layers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ar_fifo_layers_product_id_foreign` (`product_id`),
  ADD KEY `ar_fifo_layers_variation_id_foreign` (`variation_id`),
  ADD KEY `ar_fifo_layers_location_id_foreign` (`location_id`),
  ADD KEY `ar_fifo_layers_transaction_id_foreign` (`transaction_id`),
  ADD KEY `ar_fifo_layers_main_idx` (`business_id`,`product_id`,`variation_id`,`location_id`,`status`),
  ADD KEY `ar_fifo_layers_date_idx` (`business_id`,`location_id`,`layer_date`),
  ADD KEY `ar_fifo_layers_trans_idx` (`business_id`,`transaction_id`);

--
-- Indexes for table `ar_fixed_assets`
--
ALTER TABLE `ar_fixed_assets`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ar_fixed_assets_business_id_name_unique` (`business_id`,`name`),
  ADD KEY `ar_fixed_assets_created_by_foreign` (`created_by`),
  ADD KEY `ar_fixed_assets_business_id_is_active_index` (`business_id`,`is_active`);

--
-- Indexes for table `ar_fixed_asset_revaluations`
--
ALTER TABLE `ar_fixed_asset_revaluations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ar_fixed_asset_revaluations_business_id_foreign` (`business_id`),
  ADD KEY `ar_fixed_asset_revaluations_created_by_foreign` (`created_by`),
  ADD KEY `ar_fixed_asset_revaluations_fixed_asset_id_business_id_index` (`fixed_asset_id`,`business_id`),
  ADD KEY `ar_fixed_asset_revaluations_revaluation_date_index` (`revaluation_date`);

--
-- Indexes for table `ar_investments`
--
ALTER TABLE `ar_investments`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ar_investments_business_id_name_unique` (`business_id`,`name`),
  ADD KEY `ar_investments_created_by_foreign` (`created_by`),
  ADD KEY `ar_investments_business_id_is_active_index` (`business_id`,`is_active`);

--
-- Indexes for table `ar_journal_entry_headers`
--
ALTER TABLE `ar_journal_entry_headers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ar_jeh_voucher_unique` (`business_id`,`voucher_no`),
  ADD KEY `ar_journal_entry_headers_source_transaction_id_foreign` (`source_transaction_id`),
  ADD KEY `ar_journal_entry_headers_location_id_foreign` (`location_id`),
  ADD KEY `ar_journal_entry_headers_created_by_foreign` (`created_by`),
  ADD KEY `ar_journal_entry_headers_posted_by_foreign` (`posted_by`),
  ADD KEY `ar_jeh_date_idx` (`business_id`,`voucher_date`),
  ADD KEY `ar_jeh_source_idx` (`business_id`,`source_module`,`source_transaction_id`),
  ADD KEY `ar_jeh_loc_date_idx` (`business_id`,`location_id`,`voucher_date`),
  ADD KEY `ar_jeh_status_idx` (`status`);

--
-- Indexes for table `ar_journal_entry_lines`
--
ALTER TABLE `ar_journal_entry_lines`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ar_journal_entry_lines_account_id_foreign` (`account_id`),
  ADD KEY `ar_journal_entry_lines_contact_id_foreign` (`contact_id`),
  ADD KEY `ar_journal_entry_lines_product_id_foreign` (`product_id`),
  ADD KEY `ar_journal_entry_lines_variation_id_foreign` (`variation_id`),
  ADD KEY `ar_journal_entry_lines_tax_id_foreign` (`tax_id`),
  ADD KEY `ar_jel_account_idx` (`business_id`,`account_id`),
  ADD KEY `ar_jel_contact_idx` (`business_id`,`contact_id`),
  ADD KEY `ar_jel_product_idx` (`business_id`,`product_id`),
  ADD KEY `ar_jel_entry_idx` (`journal_entry_id`,`line_number`),
  ADD KEY `ar_jel_account_date_idx` (`business_id`,`account_id`,`created_at`);

--
-- Indexes for table `ar_ledger_rollups`
--
ALTER TABLE `ar_ledger_rollups`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ar_ledger_rollup_unique` (`business_id`,`account_id`,`period_date`,`period_type`,`location_id`),
  ADD KEY `ar_ledger_rollups_account_id_foreign` (`account_id`),
  ADD KEY `ar_ledger_rollups_location_id_foreign` (`location_id`),
  ADD KEY `ar_rollup_account_date_idx` (`business_id`,`account_id`,`period_date`),
  ADD KEY `ar_rollup_period_idx` (`business_id`,`period_date`,`period_type`);

--
-- Indexes for table `ar_loans`
--
ALTER TABLE `ar_loans`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ar_loans_loan_number_unique` (`loan_number`),
  ADD KEY `ar_loans_liability_account_id_foreign` (`liability_account_id`),
  ADD KEY `ar_loans_payment_account_id_foreign` (`payment_account_id`),
  ADD KEY `ar_loans_location_id_foreign` (`location_id`),
  ADD KEY `ar_loans_created_by_foreign` (`created_by`),
  ADD KEY `ar_loans_business_id_loan_date_index` (`business_id`,`loan_date`),
  ADD KEY `ar_loans_business_id_status_index` (`business_id`,`status`),
  ADD KEY `ar_loans_loan_number_index` (`loan_number`);

--
-- Indexes for table `ar_loan_transactions`
--
ALTER TABLE `ar_loan_transactions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ar_loan_transactions_transaction_number_unique` (`transaction_number`),
  ADD KEY `ar_loan_transactions_payment_account_id_foreign` (`payment_account_id`),
  ADD KEY `ar_loan_transactions_account_transaction_id_foreign` (`account_transaction_id`),
  ADD KEY `ar_loan_transactions_created_by_foreign` (`created_by`),
  ADD KEY `ar_loan_transactions_loan_id_transaction_date_index` (`loan_id`,`transaction_date`),
  ADD KEY `ar_loan_transactions_business_id_transaction_type_index` (`business_id`,`transaction_type`),
  ADD KEY `ar_loan_transactions_transaction_number_index` (`transaction_number`);

--
-- Indexes for table `ar_period_locks`
--
ALTER TABLE `ar_period_locks`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ar_period_locks_business_id_period_start_period_end_unique` (`business_id`,`period_start`,`period_end`),
  ADD KEY `ar_period_locks_locked_by_foreign` (`locked_by`),
  ADD KEY `ar_period_locks_unlocked_by_foreign` (`unlocked_by`),
  ADD KEY `ar_period_locks_business_id_is_locked_index` (`business_id`,`is_locked`);

--
-- Indexes for table `ar_ratio_snapshots`
--
ALTER TABLE `ar_ratio_snapshots`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ar_ratio_snapshots_business_id_snapshot_date_period_type_unique` (`business_id`,`snapshot_date`,`period_type`),
  ADD KEY `ar_ratio_snapshots_business_id_snapshot_date_index` (`business_id`,`snapshot_date`);

--
-- Indexes for table `ar_receivables_payables`
--
ALTER TABLE `ar_receivables_payables`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ar_receivables_payables_contact_id_foreign` (`contact_id`),
  ADD KEY `ar_receivables_payables_transaction_id_foreign` (`transaction_id`),
  ADD KEY `ar_receivables_payables_journal_entry_id_foreign` (`journal_entry_id`),
  ADD KEY `ar_arp_contact_status_idx` (`business_id`,`contact_id`,`type`,`status`),
  ADD KEY `ar_arp_doc_date_idx` (`business_id`,`type`,`document_date`),
  ADD KEY `ar_arp_aging_idx` (`business_id`,`type`,`days_past_due`),
  ADD KEY `ar_arp_trans_idx` (`business_id`,`transaction_id`);

--
-- Indexes for table `assets`
--
ALTER TABLE `assets`
  ADD PRIMARY KEY (`id`),
  ADD KEY `assets_business_id_foreign` (`business_id`),
  ADD KEY `assets_category_id_foreign` (`category_id`),
  ADD KEY `assets_created_by_foreign` (`created_by`);

--
-- Indexes for table `asset_maintenances`
--
ALTER TABLE `asset_maintenances`
  ADD PRIMARY KEY (`id`),
  ADD KEY `asset_maintenances_business_id_index` (`business_id`),
  ADD KEY `asset_maintenances_asset_id_index` (`asset_id`),
  ADD KEY `asset_maintenances_status_index` (`status`),
  ADD KEY `asset_maintenances_priority_index` (`priority`),
  ADD KEY `asset_maintenances_created_by_index` (`created_by`),
  ADD KEY `asset_maintenances_assigned_to_index` (`assigned_to`);

--
-- Indexes for table `asset_transactions`
--
ALTER TABLE `asset_transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `asset_transactions_business_id_foreign` (`business_id`),
  ADD KEY `asset_transactions_asset_id_foreign` (`asset_id`),
  ADD KEY `asset_transactions_receiver_foreign` (`receiver`),
  ADD KEY `asset_transactions_parent_id_foreign` (`parent_id`),
  ADD KEY `asset_transactions_created_by_foreign` (`created_by`);

--
-- Indexes for table `asset_warranties`
--
ALTER TABLE `asset_warranties`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `award_catalog`
--
ALTER TABLE `award_catalog`
  ADD PRIMARY KEY (`id`),
  ADD KEY `award_catalog_product_id_foreign` (`product_id`),
  ADD KEY `award_catalog_business_id_is_active_index` (`business_id`,`is_active`);

--
-- Indexes for table `award_periods`
--
ALTER TABLE `award_periods`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ap_business_period_start_unique` (`business_id`,`period_type`,`period_start`),
  ADD KEY `award_periods_finalized_by_foreign` (`finalized_by`),
  ADD KEY `ap_business_period_finalized_idx` (`business_id`,`period_type`,`is_finalized`);

--
-- Indexes for table `backup_logs`
--
ALTER TABLE `backup_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `backup_logs_user_id_foreign` (`user_id`),
  ADD KEY `backup_logs_business_id_index` (`business_id`),
  ADD KEY `backup_logs_backup_id_index` (`backup_id`),
  ADD KEY `backup_logs_action_index` (`action`),
  ADD KEY `backup_logs_status_index` (`status`),
  ADD KEY `backup_logs_created_at_index` (`created_at`);

--
-- Indexes for table `backup_settings`
--
ALTER TABLE `backup_settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `backup_settings_business_id_unique` (`business_id`),
  ADD KEY `backup_settings_created_by_foreign` (`created_by`),
  ADD KEY `backup_settings_business_id_index` (`business_id`);

--
-- Indexes for table `barcodes`
--
ALTER TABLE `barcodes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `barcodes_business_id_foreign` (`business_id`);

--
-- Indexes for table `bookings`
--
ALTER TABLE `bookings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `bookings_contact_id_foreign` (`contact_id`),
  ADD KEY `bookings_business_id_foreign` (`business_id`),
  ADD KEY `bookings_created_by_foreign` (`created_by`),
  ADD KEY `bookings_table_id_index` (`table_id`),
  ADD KEY `bookings_waiter_id_index` (`waiter_id`),
  ADD KEY `bookings_location_id_index` (`location_id`),
  ADD KEY `bookings_booking_status_index` (`booking_status`),
  ADD KEY `bookings_correspondent_id_index` (`correspondent_id`);

--
-- Indexes for table `brands`
--
ALTER TABLE `brands`
  ADD PRIMARY KEY (`id`),
  ADD KEY `brands_business_id_foreign` (`business_id`),
  ADD KEY `brands_created_by_foreign` (`created_by`);

--
-- Indexes for table `business`
--
ALTER TABLE `business`
  ADD PRIMARY KEY (`id`),
  ADD KEY `business_owner_id_foreign` (`owner_id`),
  ADD KEY `business_currency_id_foreign` (`currency_id`),
  ADD KEY `business_default_sales_tax_foreign` (`default_sales_tax`);

--
-- Indexes for table `business_backups`
--
ALTER TABLE `business_backups`
  ADD PRIMARY KEY (`id`),
  ADD KEY `business_backups_created_by_foreign` (`created_by`),
  ADD KEY `business_backups_business_id_index` (`business_id`),
  ADD KEY `business_backups_status_index` (`status`);

--
-- Indexes for table `business_locations`
--
ALTER TABLE `business_locations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `business_locations_business_id_index` (`business_id`),
  ADD KEY `business_locations_invoice_scheme_id_foreign` (`invoice_scheme_id`),
  ADD KEY `business_locations_invoice_layout_id_foreign` (`invoice_layout_id`),
  ADD KEY `business_locations_sale_invoice_layout_id_index` (`sale_invoice_layout_id`),
  ADD KEY `business_locations_selling_price_group_id_index` (`selling_price_group_id`),
  ADD KEY `business_locations_receipt_printer_type_index` (`receipt_printer_type`),
  ADD KEY `business_locations_printer_id_index` (`printer_id`);

--
-- Indexes for table `business_management_audit_logs`
--
ALTER TABLE `business_management_audit_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `business_management_audit_logs_user_id_created_at_index` (`user_id`,`created_at`),
  ADD KEY `business_management_audit_logs_business_id_created_at_index` (`business_id`,`created_at`),
  ADD KEY `business_management_audit_logs_action_created_at_index` (`action`,`created_at`),
  ADD KEY `business_management_audit_logs_level_created_at_index` (`level`,`created_at`),
  ADD KEY `business_management_audit_logs_report_type_created_at_index` (`report_type`,`created_at`),
  ADD KEY `business_management_audit_logs_action_index` (`action`),
  ADD KEY `business_management_audit_logs_user_id_index` (`user_id`),
  ADD KEY `business_management_audit_logs_report_type_index` (`report_type`),
  ADD KEY `business_management_audit_logs_level_index` (`level`),
  ADD KEY `business_management_audit_logs_business_id_index` (`business_id`);

--
-- Indexes for table `cash_denominations`
--
ALTER TABLE `cash_denominations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `cash_denominations_model_type_model_id_index` (`model_type`,`model_id`);

--
-- Indexes for table `cash_registers`
--
ALTER TABLE `cash_registers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `cash_registers_business_id_foreign` (`business_id`),
  ADD KEY `cash_registers_user_id_foreign` (`user_id`),
  ADD KEY `cash_registers_location_id_index` (`location_id`);

--
-- Indexes for table `cash_register_transactions`
--
ALTER TABLE `cash_register_transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `cash_register_transactions_cash_register_id_foreign` (`cash_register_id`),
  ADD KEY `cash_register_transactions_transaction_id_index` (`transaction_id`),
  ADD KEY `cash_register_transactions_type_index` (`type`),
  ADD KEY `cash_register_transactions_transaction_type_index` (`transaction_type`);

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `categories_business_id_foreign` (`business_id`),
  ADD KEY `categories_created_by_foreign` (`created_by`),
  ADD KEY `categories_parent_id_index` (`parent_id`),
  ADD KEY `categories_woocommerce_cat_id_index` (`woocommerce_cat_id`);

--
-- Indexes for table `categorizables`
--
ALTER TABLE `categorizables`
  ADD KEY `categorizables_categorizable_type_categorizable_id_index` (`categorizable_type`,`categorizable_id`);

--
-- Indexes for table `cms_pages`
--
ALTER TABLE `cms_pages`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `cms_page_metas`
--
ALTER TABLE `cms_page_metas`
  ADD PRIMARY KEY (`id`),
  ADD KEY `cms_page_metas_cms_page_id_foreign` (`cms_page_id`);

--
-- Indexes for table `cms_site_details`
--
ALTER TABLE `cms_site_details`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `contacts`
--
ALTER TABLE `contacts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `contacts_business_id_foreign` (`business_id`),
  ADD KEY `contacts_created_by_foreign` (`created_by`),
  ADD KEY `contacts_type_index` (`type`),
  ADD KEY `contacts_contact_status_index` (`contact_status`),
  ADD KEY `contacts_crm_source_index` (`crm_source`),
  ADD KEY `contacts_crm_life_stage_index` (`crm_life_stage`),
  ADD KEY `contacts_converted_by_index` (`converted_by`),
  ADD KEY `idx_contacts_business_type` (`business_id`,`type`);

--
-- Indexes for table `crm_call_logs`
--
ALTER TABLE `crm_call_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `crm_call_logs_business_id_index` (`business_id`),
  ADD KEY `crm_call_logs_user_id_index` (`user_id`),
  ADD KEY `crm_call_logs_contact_id_index` (`contact_id`),
  ADD KEY `crm_call_logs_created_by_index` (`created_by`);

--
-- Indexes for table `crm_campaigns`
--
ALTER TABLE `crm_campaigns`
  ADD PRIMARY KEY (`id`),
  ADD KEY `crm_campaigns_business_id_foreign` (`business_id`),
  ADD KEY `crm_campaigns_created_by_index` (`created_by`);

--
-- Indexes for table `crm_contact_person_commissions`
--
ALTER TABLE `crm_contact_person_commissions`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `crm_lead_users`
--
ALTER TABLE `crm_lead_users`
  ADD PRIMARY KEY (`id`),
  ADD KEY `crm_lead_users_user_id_index` (`user_id`),
  ADD KEY `crm_lead_users_contact_id_index` (`contact_id`);

--
-- Indexes for table `crm_marketplaces`
--
ALTER TABLE `crm_marketplaces`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `crm_proposals`
--
ALTER TABLE `crm_proposals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `crm_proposals_business_id_foreign` (`business_id`),
  ADD KEY `crm_proposals_contact_id_foreign` (`contact_id`),
  ADD KEY `crm_proposals_sent_by_index` (`sent_by`);

--
-- Indexes for table `crm_proposal_templates`
--
ALTER TABLE `crm_proposal_templates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `crm_proposal_templates_business_id_foreign` (`business_id`),
  ADD KEY `crm_proposal_templates_created_by_index` (`created_by`);

--
-- Indexes for table `crm_schedules`
--
ALTER TABLE `crm_schedules`
  ADD PRIMARY KEY (`id`),
  ADD KEY `crm_schedules_created_by_index` (`created_by`),
  ADD KEY `crm_schedules_business_id_index` (`business_id`),
  ADD KEY `crm_schedules_contact_id_index` (`contact_id`),
  ADD KEY `crm_schedules_schedule_type_index` (`schedule_type`),
  ADD KEY `crm_schedules_notify_type_index` (`notify_type`);

--
-- Indexes for table `crm_schedule_logs`
--
ALTER TABLE `crm_schedule_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `crm_schedule_logs_schedule_id_foreign` (`schedule_id`),
  ADD KEY `crm_schedule_logs_created_by_index` (`created_by`);

--
-- Indexes for table `crm_schedule_users`
--
ALTER TABLE `crm_schedule_users`
  ADD PRIMARY KEY (`id`),
  ADD KEY `crm_schedule_users_schedule_id_foreign` (`schedule_id`),
  ADD KEY `crm_schedule_users_user_id_index` (`user_id`);

--
-- Indexes for table `currencies`
--
ALTER TABLE `currencies`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `customer_awards`
--
ALTER TABLE `customer_awards`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `ca_business_customer_period_unique` (`business_id`,`customer_id`,`period_type`,`period_start`),
  ADD KEY `customer_awards_customer_id_foreign` (`customer_id`),
  ADD KEY `customer_awards_period_id_foreign` (`period_id`),
  ADD KEY `customer_awards_catalog_item_id_foreign` (`catalog_item_id`),
  ADD KEY `customer_awards_awarded_by_foreign` (`awarded_by`),
  ADD KEY `ca_business_period_rank_idx` (`business_id`,`period_type`,`rank_position`),
  ADD KEY `ca_business_awarded_idx` (`business_id`,`is_awarded`);

--
-- Indexes for table `customer_engagements`
--
ALTER TABLE `customer_engagements`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_engagements_customer_id_foreign` (`customer_id`),
  ADD KEY `customer_engagements_recorded_by_foreign` (`recorded_by`),
  ADD KEY `customer_engagements_business_id_customer_id_index` (`business_id`,`customer_id`),
  ADD KEY `customer_engagements_business_id_recorded_date_index` (`business_id`,`recorded_date`);

--
-- Indexes for table `customer_groups`
--
ALTER TABLE `customer_groups`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_groups_business_id_foreign` (`business_id`),
  ADD KEY `customer_groups_created_by_index` (`created_by`),
  ADD KEY `customer_groups_price_calculation_type_index` (`price_calculation_type`),
  ADD KEY `customer_groups_selling_price_group_id_index` (`selling_price_group_id`);

--
-- Indexes for table `customer_recognition_cache`
--
ALTER TABLE `customer_recognition_cache`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `crc_business_customer_period_unique` (`business_id`,`customer_id`,`period_type`,`period_start`),
  ADD KEY `customer_recognition_cache_customer_id_foreign` (`customer_id`),
  ADD KEY `crc_business_period_score_idx` (`business_id`,`period_type`,`final_score`);

--
-- Indexes for table `customer_recognition_settings`
--
ALTER TABLE `customer_recognition_settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `customer_recognition_settings_business_id_unique` (`business_id`);

--
-- Indexes for table `dashboard_configurations`
--
ALTER TABLE `dashboard_configurations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `dashboard_configurations_business_id_foreign` (`business_id`);

--
-- Indexes for table `discounts`
--
ALTER TABLE `discounts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `discounts_business_id_index` (`business_id`),
  ADD KEY `discounts_brand_id_index` (`brand_id`),
  ADD KEY `discounts_category_id_index` (`category_id`),
  ADD KEY `discounts_location_id_index` (`location_id`),
  ADD KEY `discounts_priority_index` (`priority`),
  ADD KEY `discounts_spg_index` (`spg`);

--
-- Indexes for table `discount_variations`
--
ALTER TABLE `discount_variations`
  ADD KEY `discount_variations_discount_id_index` (`discount_id`),
  ADD KEY `discount_variations_variation_id_index` (`variation_id`);

--
-- Indexes for table `document_and_notes`
--
ALTER TABLE `document_and_notes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `document_and_notes_business_id_index` (`business_id`),
  ADD KEY `document_and_notes_notable_id_index` (`notable_id`),
  ADD KEY `document_and_notes_created_by_index` (`created_by`);

--
-- Indexes for table `essentials_allowances_and_deductions`
--
ALTER TABLE `essentials_allowances_and_deductions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `essentials_allowances_and_deductions_business_id_index` (`business_id`);

--
-- Indexes for table `essentials_attendances`
--
ALTER TABLE `essentials_attendances`
  ADD PRIMARY KEY (`id`),
  ADD KEY `essentials_attendances_user_id_index` (`user_id`),
  ADD KEY `essentials_attendances_business_id_index` (`business_id`),
  ADD KEY `essentials_attendances_essentials_shift_id_index` (`essentials_shift_id`);

--
-- Indexes for table `essentials_documents`
--
ALTER TABLE `essentials_documents`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `essentials_document_shares`
--
ALTER TABLE `essentials_document_shares`
  ADD PRIMARY KEY (`id`),
  ADD KEY `essentials_document_shares_document_id_index` (`document_id`),
  ADD KEY `essentials_document_shares_value_type_index` (`value_type`);

--
-- Indexes for table `essentials_holidays`
--
ALTER TABLE `essentials_holidays`
  ADD PRIMARY KEY (`id`),
  ADD KEY `essentials_holidays_business_id_index` (`business_id`),
  ADD KEY `essentials_holidays_location_id_index` (`location_id`);

--
-- Indexes for table `essentials_kb`
--
ALTER TABLE `essentials_kb`
  ADD PRIMARY KEY (`id`),
  ADD KEY `essentials_kb_business_id_index` (`business_id`),
  ADD KEY `essentials_kb_parent_id_index` (`parent_id`),
  ADD KEY `essentials_kb_created_by_index` (`created_by`);

--
-- Indexes for table `essentials_kb_users`
--
ALTER TABLE `essentials_kb_users`
  ADD PRIMARY KEY (`id`),
  ADD KEY `essentials_kb_users_kb_id_index` (`kb_id`),
  ADD KEY `essentials_kb_users_user_id_index` (`user_id`);

--
-- Indexes for table `essentials_leaves`
--
ALTER TABLE `essentials_leaves`
  ADD PRIMARY KEY (`id`),
  ADD KEY `essentials_leaves_essentials_leave_type_id_index` (`essentials_leave_type_id`),
  ADD KEY `essentials_leaves_business_id_index` (`business_id`),
  ADD KEY `essentials_leaves_user_id_index` (`user_id`);

--
-- Indexes for table `essentials_leave_types`
--
ALTER TABLE `essentials_leave_types`
  ADD PRIMARY KEY (`id`),
  ADD KEY `essentials_leave_types_business_id_index` (`business_id`);

--
-- Indexes for table `essentials_messages`
--
ALTER TABLE `essentials_messages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `essentials_messages_business_id_index` (`business_id`),
  ADD KEY `essentials_messages_user_id_index` (`user_id`),
  ADD KEY `essentials_messages_location_id_index` (`location_id`);

--
-- Indexes for table `essentials_payroll_groups`
--
ALTER TABLE `essentials_payroll_groups`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `essentials_payroll_group_transactions`
--
ALTER TABLE `essentials_payroll_group_transactions`
  ADD KEY `essentials_payroll_group_transactions_payroll_group_id_foreign` (`payroll_group_id`);

--
-- Indexes for table `essentials_reminders`
--
ALTER TABLE `essentials_reminders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `essentials_reminders_business_id_index` (`business_id`),
  ADD KEY `essentials_reminders_user_id_index` (`user_id`);

--
-- Indexes for table `essentials_shifts`
--
ALTER TABLE `essentials_shifts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `essentials_shifts_type_index` (`type`),
  ADD KEY `essentials_shifts_business_id_index` (`business_id`);

--
-- Indexes for table `essentials_todo_comments`
--
ALTER TABLE `essentials_todo_comments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `essentials_todo_comments_task_id_index` (`task_id`),
  ADD KEY `essentials_todo_comments_comment_by_index` (`comment_by`);

--
-- Indexes for table `essentials_to_dos`
--
ALTER TABLE `essentials_to_dos`
  ADD PRIMARY KEY (`id`),
  ADD KEY `essentials_to_dos_status_index` (`status`),
  ADD KEY `essentials_to_dos_priority_index` (`priority`),
  ADD KEY `essentials_to_dos_created_by_index` (`created_by`),
  ADD KEY `essentials_to_dos_business_id_index` (`business_id`),
  ADD KEY `essentials_to_dos_task_id_index` (`task_id`);

--
-- Indexes for table `essentials_user_allowance_and_deductions`
--
ALTER TABLE `essentials_user_allowance_and_deductions`
  ADD KEY `essentials_user_allowance_and_deductions_user_id_index` (`user_id`),
  ADD KEY `allow_deduct_index` (`allowance_deduction_id`);

--
-- Indexes for table `essentials_user_sales_targets`
--
ALTER TABLE `essentials_user_sales_targets`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `essentials_user_shifts`
--
ALTER TABLE `essentials_user_shifts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `essentials_user_shifts_user_id_index` (`user_id`),
  ADD KEY `essentials_user_shifts_essentials_shift_id_index` (`essentials_shift_id`);

--
-- Indexes for table `expense_categories`
--
ALTER TABLE `expense_categories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `expense_categories_business_id_foreign` (`business_id`);

--
-- Indexes for table `field_forces`
--
ALTER TABLE `field_forces`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `group_sub_taxes`
--
ALTER TABLE `group_sub_taxes`
  ADD KEY `group_sub_taxes_group_tax_id_foreign` (`group_tax_id`),
  ADD KEY `group_sub_taxes_tax_id_foreign` (`tax_id`);

--
-- Indexes for table `installments`
--
ALTER TABLE `installments`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `installment_db`
--
ALTER TABLE `installment_db`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `installment_systems`
--
ALTER TABLE `installment_systems`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `inventory`
--
ALTER TABLE `inventory`
  ADD PRIMARY KEY (`id`),
  ADD KEY `inventory_branch_id_foreign` (`branch_id`);

--
-- Indexes for table `inventory_products`
--
ALTER TABLE `inventory_products`
  ADD PRIMARY KEY (`id`),
  ADD KEY `inventory_products_inventory_id_foreign` (`inventory_id`),
  ADD KEY `inventory_products_product_id_foreign` (`product_id`),
  ADD KEY `inventory_products_transaction_id_foreign` (`transaction_id`),
  ADD KEY `inventory_products_variation_id_foreign` (`variation_id`);

--
-- Indexes for table `invoice_layouts`
--
ALTER TABLE `invoice_layouts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `invoice_layouts_business_id_foreign` (`business_id`);

--
-- Indexes for table `invoice_schemes`
--
ALTER TABLE `invoice_schemes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `invoice_schemes_business_id_foreign` (`business_id`),
  ADD KEY `invoice_schemes_scheme_type_index` (`scheme_type`),
  ADD KEY `invoice_schemes_number_type_index` (`number_type`);

--
-- Indexes for table `media`
--
ALTER TABLE `media`
  ADD PRIMARY KEY (`id`),
  ADD KEY `media_model_type_model_id_index` (`model_type`,`model_id`),
  ADD KEY `media_business_id_index` (`business_id`),
  ADD KEY `media_uploaded_by_index` (`uploaded_by`),
  ADD KEY `media_woocommerce_media_id_index` (`woocommerce_media_id`);

--
-- Indexes for table `mfg_ingredient_groups`
--
ALTER TABLE `mfg_ingredient_groups`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `mfg_recipes`
--
ALTER TABLE `mfg_recipes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `mfg_recipes_product_id_index` (`product_id`),
  ADD KEY `mfg_recipes_variation_id_index` (`variation_id`);

--
-- Indexes for table `mfg_recipe_ingredients`
--
ALTER TABLE `mfg_recipe_ingredients`
  ADD PRIMARY KEY (`id`),
  ADD KEY `mfg_recipe_ingredients_mfg_recipe_id_index` (`mfg_recipe_id`),
  ADD KEY `mfg_recipe_ingredients_variation_id_index` (`variation_id`),
  ADD KEY `mfg_recipe_ingredients_sub_unit_id_index` (`sub_unit_id`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  ADD KEY `model_has_permissions_model_type_model_id_index` (`model_type`,`model_id`);

--
-- Indexes for table `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  ADD KEY `model_has_roles_model_type_model_id_index` (`model_type`,`model_id`);

--
-- Indexes for table `module_licenses`
--
ALTER TABLE `module_licenses`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `module_licenses_license_code_unique` (`license_code`),
  ADD KEY `module_licenses_module_name_license_code_index` (`module_name`,`license_code`),
  ADD KEY `module_licenses_module_name_username_index` (`module_name`,`username`),
  ADD KEY `module_licenses_module_name_index` (`module_name`);

--
-- Indexes for table `notifications`
--
ALTER TABLE `notifications`
  ADD PRIMARY KEY (`id`),
  ADD KEY `notifications_notifiable_type_notifiable_id_index` (`notifiable_type`,`notifiable_id`);

--
-- Indexes for table `notification_templates`
--
ALTER TABLE `notification_templates`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `oauth_access_tokens`
--
ALTER TABLE `oauth_access_tokens`
  ADD PRIMARY KEY (`id`),
  ADD KEY `oauth_access_tokens_user_id_index` (`user_id`);

--
-- Indexes for table `oauth_auth_codes`
--
ALTER TABLE `oauth_auth_codes`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `oauth_clients`
--
ALTER TABLE `oauth_clients`
  ADD PRIMARY KEY (`id`),
  ADD KEY `oauth_clients_user_id_index` (`user_id`);

--
-- Indexes for table `oauth_personal_access_clients`
--
ALTER TABLE `oauth_personal_access_clients`
  ADD PRIMARY KEY (`id`),
  ADD KEY `oauth_personal_access_clients_client_id_index` (`client_id`);

--
-- Indexes for table `oauth_refresh_tokens`
--
ALTER TABLE `oauth_refresh_tokens`
  ADD PRIMARY KEY (`id`),
  ADD KEY `oauth_refresh_tokens_access_token_id_index` (`access_token_id`);

--
-- Indexes for table `packages`
--
ALTER TABLE `packages`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
  ADD KEY `password_resets_email_index` (`email`);

--
-- Indexes for table `permissions`
--
ALTER TABLE `permissions`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `pjt_invoice_lines`
--
ALTER TABLE `pjt_invoice_lines`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pjt_invoice_lines_transaction_id_foreign` (`transaction_id`),
  ADD KEY `pjt_invoice_lines_tax_rate_id_index` (`tax_rate_id`);

--
-- Indexes for table `pjt_projects`
--
ALTER TABLE `pjt_projects`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pjt_projects_business_id_index` (`business_id`),
  ADD KEY `pjt_projects_contact_id_index` (`contact_id`),
  ADD KEY `pjt_projects_lead_id_index` (`lead_id`),
  ADD KEY `pjt_projects_created_by_index` (`created_by`);

--
-- Indexes for table `pjt_project_members`
--
ALTER TABLE `pjt_project_members`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pjt_project_members_project_id_foreign` (`project_id`),
  ADD KEY `pjt_project_members_user_id_index` (`user_id`);

--
-- Indexes for table `pjt_project_tasks`
--
ALTER TABLE `pjt_project_tasks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pjt_project_tasks_project_id_foreign` (`project_id`),
  ADD KEY `pjt_project_tasks_business_id_index` (`business_id`),
  ADD KEY `pjt_project_tasks_created_by_index` (`created_by`);

--
-- Indexes for table `pjt_project_task_comments`
--
ALTER TABLE `pjt_project_task_comments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pjt_project_task_comments_project_task_id_foreign` (`project_task_id`);

--
-- Indexes for table `pjt_project_task_members`
--
ALTER TABLE `pjt_project_task_members`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pjt_project_task_members_project_task_id_foreign` (`project_task_id`),
  ADD KEY `pjt_project_task_members_user_id_index` (`user_id`);

--
-- Indexes for table `pjt_project_time_logs`
--
ALTER TABLE `pjt_project_time_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pjt_project_time_logs_project_id_foreign` (`project_id`),
  ADD KEY `pjt_project_time_logs_project_task_id_foreign` (`project_task_id`),
  ADD KEY `pjt_project_time_logs_user_id_index` (`user_id`),
  ADD KEY `pjt_project_time_logs_created_by_index` (`created_by`);

--
-- Indexes for table `premade_lines`
--
ALTER TABLE `premade_lines`
  ADD PRIMARY KEY (`id`),
  ADD KEY `premade_lines_business_id_foreign` (`business_id`),
  ADD KEY `premade_lines_premade_product_id_foreign` (`premade_product_id`),
  ADD KEY `premade_lines_product_id_foreign` (`product_id`),
  ADD KEY `premade_lines_variation_id_foreign` (`variation_id`);

--
-- Indexes for table `printers`
--
ALTER TABLE `printers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `printers_business_id_foreign` (`business_id`);

--
-- Indexes for table `products`
--
ALTER TABLE `products`
  ADD PRIMARY KEY (`id`),
  ADD KEY `products_brand_id_foreign` (`brand_id`),
  ADD KEY `products_category_id_foreign` (`category_id`),
  ADD KEY `products_sub_category_id_foreign` (`sub_category_id`),
  ADD KEY `products_tax_foreign` (`tax`),
  ADD KEY `products_name_index` (`name`),
  ADD KEY `products_business_id_index` (`business_id`),
  ADD KEY `products_unit_id_index` (`unit_id`),
  ADD KEY `products_created_by_index` (`created_by`),
  ADD KEY `products_warranty_id_index` (`warranty_id`),
  ADD KEY `products_type_index` (`type`),
  ADD KEY `products_tax_type_index` (`tax_type`),
  ADD KEY `products_barcode_type_index` (`barcode_type`),
  ADD KEY `products_secondary_unit_id_index` (`secondary_unit_id`),
  ADD KEY `products_woocommerce_product_id_index` (`woocommerce_product_id`),
  ADD KEY `products_woocommerce_media_id_index` (`woocommerce_media_id`),
  ADD KEY `products_repair_model_id_index` (`repair_model_id`),
  ADD KEY `products_supplier_id_index` (`supplier_id`),
  ADD KEY `idx_products_business_category` (`business_id`,`category_id`);

--
-- Indexes for table `product_locations`
--
ALTER TABLE `product_locations`
  ADD KEY `product_locations_product_id_index` (`product_id`),
  ADD KEY `product_locations_location_id_index` (`location_id`);

--
-- Indexes for table `product_racks`
--
ALTER TABLE `product_racks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `product_racks_business_id_index` (`business_id`),
  ADD KEY `product_racks_location_id_index` (`location_id`),
  ADD KEY `product_racks_product_id_index` (`product_id`);

--
-- Indexes for table `product_variations`
--
ALTER TABLE `product_variations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `product_variations_name_index` (`name`),
  ADD KEY `product_variations_product_id_index` (`product_id`);

--
-- Indexes for table `promotions`
--
ALTER TABLE `promotions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `promotions_business_id_product_id_index` (`business_id`,`product_id`),
  ADD KEY `promotions_start_date_end_date_index` (`start_date`,`end_date`),
  ADD KEY `promotions_is_active_index` (`is_active`),
  ADD KEY `promotions_promotion_type_index` (`promotion_type`),
  ADD KEY `promotions_get_product_id_index` (`get_product_id`),
  ADD KEY `idx_business_type_active` (`business_id`,`promotion_type`,`is_active`),
  ADD KEY `idx_business_active_dates` (`business_id`,`is_active`,`start_date`,`end_date`),
  ADD KEY `idx_business_location` (`business_id`,`location_id`),
  ADD KEY `promotions_product_id_foreign` (`product_id`),
  ADD KEY `promotions_location_id_foreign` (`location_id`),
  ADD KEY `promotions_created_by_foreign` (`created_by`),
  ADD KEY `idx_product_lookup` (`business_id`,`product_id`,`variation_id`,`is_active`),
  ADD KEY `idx_location_lookup` (`business_id`,`location_id`,`is_active`);

--
-- Indexes for table `promotion_audit_logs`
--
ALTER TABLE `promotion_audit_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `promotion_audit_logs_promotion_id_created_at_index` (`promotion_id`,`created_at`),
  ADD KEY `promotion_audit_logs_user_id_created_at_index` (`user_id`,`created_at`),
  ADD KEY `promotion_audit_logs_action_index` (`action`);

--
-- Indexes for table `promotion_daily_usage`
--
ALTER TABLE `promotion_daily_usage`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `promotion_daily_usage_promotion_id_usage_date_unique` (`promotion_id`,`usage_date`),
  ADD KEY `promotion_daily_usage_promotion_id_index` (`promotion_id`),
  ADD KEY `promotion_daily_usage_usage_date_index` (`usage_date`);

--
-- Indexes for table `promotion_templates`
--
ALTER TABLE `promotion_templates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `promotion_templates_created_by_foreign` (`created_by`),
  ADD KEY `promotion_templates_business_id_promotion_type_index` (`business_id`,`promotion_type`);

--
-- Indexes for table `purchase_lines`
--
ALTER TABLE `purchase_lines`
  ADD PRIMARY KEY (`id`),
  ADD KEY `purchase_lines_transaction_id_foreign` (`transaction_id`),
  ADD KEY `purchase_lines_product_id_foreign` (`product_id`),
  ADD KEY `purchase_lines_variation_id_foreign` (`variation_id`),
  ADD KEY `purchase_lines_tax_id_foreign` (`tax_id`),
  ADD KEY `purchase_lines_sub_unit_id_index` (`sub_unit_id`),
  ADD KEY `purchase_lines_lot_number_index` (`lot_number`),
  ADD KEY `idx_pl_variation` (`variation_id`),
  ADD KEY `idx_purchase_lines_transaction` (`transaction_id`),
  ADD KEY `idx_purchase_lines_variation` (`variation_id`),
  ADD KEY `idx_purchase_lines_transaction_variation` (`transaction_id`,`variation_id`);

--
-- Indexes for table `reference_counts`
--
ALTER TABLE `reference_counts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `reference_counts_business_id_index` (`business_id`);

--
-- Indexes for table `repair_device_models`
--
ALTER TABLE `repair_device_models`
  ADD PRIMARY KEY (`id`),
  ADD KEY `repair_device_models_business_id_index` (`business_id`),
  ADD KEY `repair_device_models_brand_id_index` (`brand_id`),
  ADD KEY `repair_device_models_device_id_index` (`device_id`),
  ADD KEY `repair_device_models_created_by_index` (`created_by`);

--
-- Indexes for table `repair_job_sheets`
--
ALTER TABLE `repair_job_sheets`
  ADD PRIMARY KEY (`id`),
  ADD KEY `repair_job_sheets_business_id_index` (`business_id`),
  ADD KEY `repair_job_sheets_location_id_index` (`location_id`),
  ADD KEY `repair_job_sheets_contact_id_index` (`contact_id`),
  ADD KEY `repair_job_sheets_brand_id_index` (`brand_id`),
  ADD KEY `repair_job_sheets_device_id_index` (`device_id`),
  ADD KEY `repair_job_sheets_device_model_id_index` (`device_model_id`),
  ADD KEY `repair_job_sheets_status_id_index` (`status_id`),
  ADD KEY `repair_job_sheets_service_staff_index` (`service_staff`),
  ADD KEY `repair_job_sheets_created_by_index` (`created_by`);

--
-- Indexes for table `repair_statuses`
--
ALTER TABLE `repair_statuses`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `res_product_modifier_sets`
--
ALTER TABLE `res_product_modifier_sets`
  ADD KEY `res_product_modifier_sets_modifier_set_id_foreign` (`modifier_set_id`);

--
-- Indexes for table `res_tables`
--
ALTER TABLE `res_tables`
  ADD PRIMARY KEY (`id`),
  ADD KEY `res_tables_business_id_foreign` (`business_id`);

--
-- Indexes for table `return_groups`
--
ALTER TABLE `return_groups`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `rma_complain_receives`
--
ALTER TABLE `rma_complain_receives`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `rma_complain_receives_rma_number_unique` (`rma_number`),
  ADD KEY `rma_complain_receives_business_id_status_index` (`business_id`,`status`),
  ADD KEY `rma_complain_receives_rma_number_index` (`rma_number`),
  ADD KEY `rma_complain_receives_serial_id_index` (`serial_id`);

--
-- Indexes for table `rma_diagnoses`
--
ALTER TABLE `rma_diagnoses`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `rma_diagnoses_diagnosis_number_unique` (`diagnosis_number`),
  ADD KEY `rma_diagnoses_business_id_status_index` (`business_id`,`status`),
  ADD KEY `rma_diagnoses_complain_receive_id_index` (`complain_receive_id`);

--
-- Indexes for table `rma_engineer_fixings`
--
ALTER TABLE `rma_engineer_fixings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `rma_engineer_fixings_fixing_number_unique` (`fixing_number`),
  ADD KEY `rma_engineer_fixings_business_id_status_index` (`business_id`,`status`),
  ADD KEY `rma_engineer_fixings_complain_receive_id_index` (`complain_receive_id`);

--
-- Indexes for table `rma_item_utilizes`
--
ALTER TABLE `rma_item_utilizes`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `rma_item_utilizes_utilize_number_unique` (`utilize_number`),
  ADD KEY `rma_item_utilizes_business_id_status_index` (`business_id`,`status`),
  ADD KEY `rma_item_utilizes_complain_receive_id_index` (`complain_receive_id`);

--
-- Indexes for table `rma_problem_setups`
--
ALTER TABLE `rma_problem_setups`
  ADD PRIMARY KEY (`id`),
  ADD KEY `rma_problem_setups_business_id_is_active_index` (`business_id`,`is_active`);

--
-- Indexes for table `rma_replacement_deliveries`
--
ALTER TABLE `rma_replacement_deliveries`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `rma_replacement_deliveries_delivery_number_unique` (`delivery_number`),
  ADD KEY `rma_replacement_deliveries_business_id_status_index` (`business_id`,`status`),
  ADD KEY `rma_replacement_deliveries_replace_in_id_index` (`replace_in_id`);

--
-- Indexes for table `rma_replace_ins`
--
ALTER TABLE `rma_replace_ins`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `rma_replace_ins_replace_in_number_unique` (`replace_in_number`),
  ADD KEY `rma_replace_ins_business_id_status_index` (`business_id`,`status`),
  ADD KEY `rma_replace_ins_replace_out_id_index` (`replace_out_id`);

--
-- Indexes for table `rma_replace_outs`
--
ALTER TABLE `rma_replace_outs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `rma_replace_outs_replace_out_number_unique` (`replace_out_number`),
  ADD KEY `rma_replace_outs_business_id_status_index` (`business_id`,`status`),
  ADD KEY `rma_replace_outs_complain_receive_id_index` (`complain_receive_id`);

--
-- Indexes for table `rma_serial_histories`
--
ALTER TABLE `rma_serial_histories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `rma_serial_histories_business_id_serial_id_index` (`business_id`,`serial_id`),
  ADD KEY `rma_serial_histories_serial_number_index` (`serial_number`),
  ADD KEY `rma_serial_histories_action_type_index` (`action_type`);

--
-- Indexes for table `rma_service_bills`
--
ALTER TABLE `rma_service_bills`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `rma_service_bills_service_bill_number_unique` (`service_bill_number`),
  ADD KEY `rma_service_bills_business_id_status_index` (`business_id`,`status`),
  ADD KEY `rma_service_bills_complain_receive_id_index` (`complain_receive_id`);

--
-- Indexes for table `roles`
--
ALTER TABLE `roles`
  ADD PRIMARY KEY (`id`),
  ADD KEY `roles_business_id_foreign` (`business_id`);

--
-- Indexes for table `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD PRIMARY KEY (`permission_id`,`role_id`),
  ADD KEY `role_has_permissions_role_id_foreign` (`role_id`);

--
-- Indexes for table `selling_price_groups`
--
ALTER TABLE `selling_price_groups`
  ADD PRIMARY KEY (`id`),
  ADD KEY `selling_price_groups_business_id_foreign` (`business_id`);

--
-- Indexes for table `sell_exchange`
--
ALTER TABLE `sell_exchange`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `sell_exchange_product`
--
ALTER TABLE `sell_exchange_product`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `serial_numbers`
--
ALTER TABLE `serial_numbers`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `service_warranties`
--
ALTER TABLE `service_warranties`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `sessions`
--
ALTER TABLE `sessions`
  ADD UNIQUE KEY `sessions_id_unique` (`id`);

--
-- Indexes for table `sheet_spreadsheets`
--
ALTER TABLE `sheet_spreadsheets`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sheet_spreadsheets_business_id_foreign` (`business_id`),
  ADD KEY `sheet_spreadsheets_created_by_index` (`created_by`);

--
-- Indexes for table `sheet_spreadsheet_shares`
--
ALTER TABLE `sheet_spreadsheet_shares`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sheet_spreadsheet_shares_sheet_spreadsheet_id_foreign` (`sheet_spreadsheet_id`),
  ADD KEY `sheet_spreadsheet_shares_shared_with_index` (`shared_with`),
  ADD KEY `sheet_spreadsheet_shares_shared_id_index` (`shared_id`);

--
-- Indexes for table `staff_awards`
--
ALTER TABLE `staff_awards`
  ADD PRIMARY KEY (`id`),
  ADD KEY `staff_awards_business_id_foreign` (`business_id`),
  ADD KEY `staff_awards_staff_id_foreign` (`staff_id`),
  ADD KEY `staff_awards_period_id_foreign` (`period_id`),
  ADD KEY `staff_awards_catalog_item_id_foreign` (`catalog_item_id`),
  ADD KEY `staff_awards_awarded_by_foreign` (`awarded_by`);

--
-- Indexes for table `staff_award_periods`
--
ALTER TABLE `staff_award_periods`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `staff_award_periods_business_id_period_type_period_start_unique` (`business_id`,`period_type`,`period_start`),
  ADD KEY `staff_award_periods_finalized_by_foreign` (`finalized_by`);

--
-- Indexes for table `staff_performance_activities`
--
ALTER TABLE `staff_performance_activities`
  ADD PRIMARY KEY (`id`),
  ADD KEY `staff_performance_activities_business_id_foreign` (`business_id`),
  ADD KEY `staff_performance_activities_staff_id_foreign` (`staff_id`),
  ADD KEY `staff_performance_activities_recorded_by_foreign` (`recorded_by`);

--
-- Indexes for table `staff_recognition_settings`
--
ALTER TABLE `staff_recognition_settings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `staff_recognition_settings_business_id_foreign` (`business_id`);

--
-- Indexes for table `stock_adjustment_lines`
--
ALTER TABLE `stock_adjustment_lines`
  ADD PRIMARY KEY (`id`),
  ADD KEY `stock_adjustment_lines_product_id_foreign` (`product_id`),
  ADD KEY `stock_adjustment_lines_variation_id_foreign` (`variation_id`),
  ADD KEY `stock_adjustment_lines_transaction_id_index` (`transaction_id`),
  ADD KEY `stock_adjustment_lines_lot_no_line_id_index` (`lot_no_line_id`),
  ADD KEY `idx_sal_variation` (`variation_id`);

--
-- Indexes for table `subscriptions`
--
ALTER TABLE `subscriptions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `subscriptions_business_id_foreign` (`business_id`),
  ADD KEY `subscriptions_package_id_index` (`package_id`),
  ADD KEY `subscriptions_created_id_index` (`created_id`);

--
-- Indexes for table `superadmin_communicator_logs`
--
ALTER TABLE `superadmin_communicator_logs`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `superadmin_coupons`
--
ALTER TABLE `superadmin_coupons`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `superadmin_frontend_pages`
--
ALTER TABLE `superadmin_frontend_pages`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `system`
--
ALTER TABLE `system`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `tax_rates`
--
ALTER TABLE `tax_rates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tax_rates_business_id_foreign` (`business_id`),
  ADD KEY `tax_rates_created_by_foreign` (`created_by`),
  ADD KEY `tax_rates_woocommerce_tax_rate_id_index` (`woocommerce_tax_rate_id`);

--
-- Indexes for table `tazas`
--
ALTER TABLE `tazas`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tazas_business_id_foreign` (`business_id`),
  ADD KEY `tazas_currency_id_foreign` (`currency_id`);

--
-- Indexes for table `transactions`
--
ALTER TABLE `transactions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `transactions_tax_id_foreign` (`tax_id`),
  ADD KEY `transactions_business_id_index` (`business_id`),
  ADD KEY `transactions_type_index` (`type`),
  ADD KEY `transactions_contact_id_index` (`contact_id`),
  ADD KEY `transactions_transaction_date_index` (`transaction_date`),
  ADD KEY `transactions_created_by_index` (`created_by`),
  ADD KEY `transactions_location_id_index` (`location_id`),
  ADD KEY `transactions_expense_for_foreign` (`expense_for`),
  ADD KEY `transactions_expense_category_id_index` (`expense_category_id`),
  ADD KEY `transactions_sub_type_index` (`sub_type`),
  ADD KEY `transactions_return_parent_id_index` (`return_parent_id`),
  ADD KEY `type` (`type`),
  ADD KEY `transactions_status_index` (`status`),
  ADD KEY `transactions_sub_status_index` (`sub_status`),
  ADD KEY `transactions_res_table_id_index` (`res_table_id`),
  ADD KEY `transactions_res_waiter_id_index` (`res_waiter_id`),
  ADD KEY `transactions_res_order_status_index` (`res_order_status`),
  ADD KEY `transactions_payment_status_index` (`payment_status`),
  ADD KEY `transactions_discount_type_index` (`discount_type`),
  ADD KEY `transactions_commission_agent_index` (`commission_agent`),
  ADD KEY `transactions_transfer_parent_id_index` (`transfer_parent_id`),
  ADD KEY `transactions_types_of_service_id_index` (`types_of_service_id`),
  ADD KEY `transactions_packing_charge_type_index` (`packing_charge_type`),
  ADD KEY `transactions_recur_parent_id_index` (`recur_parent_id`),
  ADD KEY `transactions_selling_price_group_id_index` (`selling_price_group_id`),
  ADD KEY `transactions_delivery_date_index` (`delivery_date`),
  ADD KEY `transactions_delivery_person_index` (`delivery_person`),
  ADD KEY `transactions_mfg_parent_production_purchase_id_index` (`mfg_parent_production_purchase_id`),
  ADD KEY `transactions_pjt_project_id_foreign` (`pjt_project_id`),
  ADD KEY `transactions_woocommerce_order_id_index` (`woocommerce_order_id`),
  ADD KEY `transactions_repair_model_id_index` (`repair_model_id`),
  ADD KEY `transactions_repair_warranty_id_index` (`repair_warranty_id`),
  ADD KEY `transactions_repair_brand_id_index` (`repair_brand_id`),
  ADD KEY `transactions_repair_status_id_index` (`repair_status_id`),
  ADD KEY `transactions_repair_device_id_index` (`repair_device_id`),
  ADD KEY `transactions_repair_job_sheet_id_index` (`repair_job_sheet_id`),
  ADD KEY `idx_t_business_type_loc` (`business_id`,`type`,`location_id`),
  ADD KEY `idx_transactions_business_location_type` (`business_id`,`location_id`,`type`),
  ADD KEY `idx_transactions_business_date` (`business_id`,`transaction_date`),
  ADD KEY `idx_transactions_location_date` (`location_id`,`transaction_date`),
  ADD KEY `idx_transactions_contact_type` (`contact_id`,`type`),
  ADD KEY `idx_transactions_type_date` (`type`,`transaction_date`),
  ADD KEY `transactions_exchange_parent_id_index` (`exchange_parent_id`),
  ADD KEY `transactions_is_exchange_index` (`is_exchange`);

--
-- Indexes for table `transaction_exchanges`
--
ALTER TABLE `transaction_exchanges`
  ADD PRIMARY KEY (`id`),
  ADD KEY `transaction_exchanges_location_id_foreign` (`location_id`),
  ADD KEY `transaction_exchanges_original_transaction_id_foreign` (`original_transaction_id`),
  ADD KEY `transaction_exchanges_exchange_transaction_id_foreign` (`exchange_transaction_id`),
  ADD KEY `transaction_exchanges_created_by_foreign` (`created_by`),
  ADD KEY `transaction_exchanges_business_id_status_index` (`business_id`,`status`),
  ADD KEY `transaction_exchanges_exchange_date_index` (`exchange_date`),
  ADD KEY `idx_exchange_amounts` (`original_amount`,`new_amount`,`exchange_difference`),
  ADD KEY `idx_exchange_financial` (`payment_received`,`refund_given`),
  ADD KEY `transaction_exchanges_cancelled_by_foreign` (`cancelled_by`);

--
-- Indexes for table `transaction_exchange_lines`
--
ALTER TABLE `transaction_exchange_lines`
  ADD PRIMARY KEY (`id`),
  ADD KEY `transaction_exchange_lines_exchange_id_foreign` (`exchange_id`),
  ADD KEY `transaction_exchange_lines_original_sell_line_id_foreign` (`original_sell_line_id`),
  ADD KEY `transaction_exchange_lines_new_sell_line_id_foreign` (`new_sell_line_id`);

--
-- Indexes for table `transaction_payments`
--
ALTER TABLE `transaction_payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `transaction_payments_transaction_id_foreign` (`transaction_id`),
  ADD KEY `transaction_payments_created_by_index` (`created_by`),
  ADD KEY `transaction_payments_parent_id_index` (`parent_id`),
  ADD KEY `transaction_payments_payment_type_index` (`payment_type`);

--
-- Indexes for table `transaction_sell_lines`
--
ALTER TABLE `transaction_sell_lines`
  ADD PRIMARY KEY (`id`),
  ADD KEY `transaction_sell_lines_transaction_id_foreign` (`transaction_id`),
  ADD KEY `transaction_sell_lines_product_id_foreign` (`product_id`),
  ADD KEY `transaction_sell_lines_variation_id_foreign` (`variation_id`),
  ADD KEY `transaction_sell_lines_tax_id_foreign` (`tax_id`),
  ADD KEY `transaction_sell_lines_children_type_index` (`children_type`),
  ADD KEY `transaction_sell_lines_parent_sell_line_id_index` (`parent_sell_line_id`),
  ADD KEY `transaction_sell_lines_line_discount_type_index` (`line_discount_type`),
  ADD KEY `transaction_sell_lines_discount_id_index` (`discount_id`),
  ADD KEY `transaction_sell_lines_lot_no_line_id_index` (`lot_no_line_id`),
  ADD KEY `transaction_sell_lines_sub_unit_id_index` (`sub_unit_id`),
  ADD KEY `transaction_sell_lines_woocommerce_line_items_id_index` (`woocommerce_line_items_id`),
  ADD KEY `idx_tsl_variation` (`variation_id`),
  ADD KEY `idx_transaction_sell_lines_transaction` (`transaction_id`),
  ADD KEY `idx_transaction_sell_lines_variation` (`variation_id`),
  ADD KEY `idx_transaction_sell_lines_transaction_variation` (`transaction_id`,`variation_id`),
  ADD KEY `transaction_sell_lines_is_exchange_return_index` (`is_exchange_return`),
  ADD KEY `transaction_sell_lines_exchange_parent_line_id_index` (`exchange_parent_line_id`);

--
-- Indexes for table `transaction_sell_lines_purchase_lines`
--
ALTER TABLE `transaction_sell_lines_purchase_lines`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sell_line_id` (`sell_line_id`),
  ADD KEY `stock_adjustment_line_id` (`stock_adjustment_line_id`),
  ADD KEY `purchase_line_id` (`purchase_line_id`);

--
-- Indexes for table `types_of_services`
--
ALTER TABLE `types_of_services`
  ADD PRIMARY KEY (`id`),
  ADD KEY `types_of_services_business_id_index` (`business_id`);

--
-- Indexes for table `units`
--
ALTER TABLE `units`
  ADD PRIMARY KEY (`id`),
  ADD KEY `units_business_id_foreign` (`business_id`),
  ADD KEY `units_created_by_foreign` (`created_by`),
  ADD KEY `units_base_unit_id_index` (`base_unit_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_username_unique` (`username`),
  ADD KEY `users_business_id_foreign` (`business_id`),
  ADD KEY `users_user_type_index` (`user_type`),
  ADD KEY `users_crm_contact_id_index` (`crm_contact_id`),
  ADD KEY `users_essentials_department_id_index` (`essentials_department_id`),
  ADD KEY `users_essentials_designation_id_index` (`essentials_designation_id`);

--
-- Indexes for table `user_contact_access`
--
ALTER TABLE `user_contact_access`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_contact_access_user_id_index` (`user_id`),
  ADD KEY `user_contact_access_contact_id_index` (`contact_id`);

--
-- Indexes for table `variations`
--
ALTER TABLE `variations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `variations_product_id_foreign` (`product_id`),
  ADD KEY `variations_product_variation_id_foreign` (`product_variation_id`),
  ADD KEY `variations_name_index` (`name`),
  ADD KEY `variations_sub_sku_index` (`sub_sku`),
  ADD KEY `variations_variation_value_id_index` (`variation_value_id`),
  ADD KEY `variations_woocommerce_variation_id_index` (`woocommerce_variation_id`);

--
-- Indexes for table `variation_group_prices`
--
ALTER TABLE `variation_group_prices`
  ADD PRIMARY KEY (`id`),
  ADD KEY `variation_group_prices_variation_id_foreign` (`variation_id`),
  ADD KEY `variation_group_prices_price_group_id_foreign` (`price_group_id`);

--
-- Indexes for table `variation_location_details`
--
ALTER TABLE `variation_location_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `variation_location_details_location_id_foreign` (`location_id`),
  ADD KEY `variation_location_details_product_id_index` (`product_id`),
  ADD KEY `variation_location_details_product_variation_id_index` (`product_variation_id`),
  ADD KEY `variation_location_details_variation_id_index` (`variation_id`),
  ADD KEY `idx_vld_vl` (`variation_id`,`location_id`),
  ADD KEY `idx_variation_location_details_location` (`location_id`),
  ADD KEY `idx_variation_location_details_variation_location` (`variation_id`,`location_id`),
  ADD KEY `idx_variation_location_details_location_variation` (`location_id`,`variation_id`);

--
-- Indexes for table `variation_templates`
--
ALTER TABLE `variation_templates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `variation_templates_business_id_foreign` (`business_id`),
  ADD KEY `variation_templates_woocommerce_attr_id_index` (`woocommerce_attr_id`);

--
-- Indexes for table `variation_value_templates`
--
ALTER TABLE `variation_value_templates`
  ADD PRIMARY KEY (`id`),
  ADD KEY `variation_value_templates_name_index` (`name`),
  ADD KEY `variation_value_templates_variation_template_id_index` (`variation_template_id`);

--
-- Indexes for table `vld_backup_1_2026_03_15_18_50_01`
--
ALTER TABLE `vld_backup_1_2026_03_15_18_50_01`
  ADD PRIMARY KEY (`id`),
  ADD KEY `variation_location_details_location_id_foreign` (`location_id`),
  ADD KEY `variation_location_details_product_id_index` (`product_id`),
  ADD KEY `variation_location_details_product_variation_id_index` (`product_variation_id`),
  ADD KEY `variation_location_details_variation_id_index` (`variation_id`),
  ADD KEY `idx_vld_vl` (`variation_id`,`location_id`),
  ADD KEY `idx_variation_location_details_location` (`location_id`),
  ADD KEY `idx_variation_location_details_variation_location` (`variation_id`,`location_id`),
  ADD KEY `idx_variation_location_details_location_variation` (`location_id`,`variation_id`);

--
-- Indexes for table `vld_backup_1_2026_03_15_18_57_56`
--
ALTER TABLE `vld_backup_1_2026_03_15_18_57_56`
  ADD PRIMARY KEY (`id`),
  ADD KEY `variation_location_details_location_id_foreign` (`location_id`),
  ADD KEY `variation_location_details_product_id_index` (`product_id`),
  ADD KEY `variation_location_details_product_variation_id_index` (`product_variation_id`),
  ADD KEY `variation_location_details_variation_id_index` (`variation_id`),
  ADD KEY `idx_vld_vl` (`variation_id`,`location_id`),
  ADD KEY `idx_variation_location_details_location` (`location_id`),
  ADD KEY `idx_variation_location_details_variation_location` (`variation_id`,`location_id`),
  ADD KEY `idx_variation_location_details_location_variation` (`location_id`,`variation_id`);

--
-- Indexes for table `vld_backup_1_2026_03_15_19_30_41`
--
ALTER TABLE `vld_backup_1_2026_03_15_19_30_41`
  ADD PRIMARY KEY (`id`),
  ADD KEY `variation_location_details_location_id_foreign` (`location_id`),
  ADD KEY `variation_location_details_product_id_index` (`product_id`),
  ADD KEY `variation_location_details_product_variation_id_index` (`product_variation_id`),
  ADD KEY `variation_location_details_variation_id_index` (`variation_id`),
  ADD KEY `idx_vld_vl` (`variation_id`,`location_id`),
  ADD KEY `idx_variation_location_details_location` (`location_id`),
  ADD KEY `idx_variation_location_details_variation_location` (`variation_id`,`location_id`),
  ADD KEY `idx_variation_location_details_location_variation` (`location_id`,`variation_id`);

--
-- Indexes for table `warehouses`
--
ALTER TABLE `warehouses`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `warranties`
--
ALTER TABLE `warranties`
  ADD PRIMARY KEY (`id`),
  ADD KEY `warranties_business_id_index` (`business_id`),
  ADD KEY `warranties_duration_type_index` (`duration_type`);

--
-- Indexes for table `whatsapp_gateway`
--
ALTER TABLE `whatsapp_gateway`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `woocommerce_sync_logs`
--
ALTER TABLE `woocommerce_sync_logs`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `accounting_accounts`
--
ALTER TABLE `accounting_accounts`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2023;

--
-- AUTO_INCREMENT for table `accounting_accounts_transactions`
--
ALTER TABLE `accounting_accounts_transactions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=828;

--
-- AUTO_INCREMENT for table `accounting_account_types`
--
ALTER TABLE `accounting_account_types`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=181;

--
-- AUTO_INCREMENT for table `accounting_acc_trans_mappings`
--
ALTER TABLE `accounting_acc_trans_mappings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=370;

--
-- AUTO_INCREMENT for table `accounting_budgets`
--
ALTER TABLE `accounting_budgets`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=185;

--
-- AUTO_INCREMENT for table `accounts`
--
ALTER TABLE `accounts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37;

--
-- AUTO_INCREMENT for table `account_transactions`
--
ALTER TABLE `account_transactions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1582;

--
-- AUTO_INCREMENT for table `account_types`
--
ALTER TABLE `account_types`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `activity_log`
--
ALTER TABLE `activity_log`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4123;

--
-- AUTO_INCREMENT for table `advanced_report_configurations`
--
ALTER TABLE `advanced_report_configurations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `advanced_report_exports`
--
ALTER TABLE `advanced_report_exports`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `advanced_report_saved_filters`
--
ALTER TABLE `advanced_report_saved_filters`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `advanced_report_schedules`
--
ALTER TABLE `advanced_report_schedules`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `aiassistance_history`
--
ALTER TABLE `aiassistance_history`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_audit_log`
--
ALTER TABLE `ar_audit_log`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_bank_accounts`
--
ALTER TABLE `ar_bank_accounts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_bank_reconciliation`
--
ALTER TABLE `ar_bank_reconciliation`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_budgets`
--
ALTER TABLE `ar_budgets`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_capital_accounts`
--
ALTER TABLE `ar_capital_accounts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_chart_of_accounts`
--
ALTER TABLE `ar_chart_of_accounts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=66;

--
-- AUTO_INCREMENT for table `ar_cheque_books`
--
ALTER TABLE `ar_cheque_books`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_cheque_book_entries`
--
ALTER TABLE `ar_cheque_book_entries`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_direct_expenses`
--
ALTER TABLE `ar_direct_expenses`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_direct_expense_names`
--
ALTER TABLE `ar_direct_expense_names`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_direct_incomes`
--
ALTER TABLE `ar_direct_incomes`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_direct_income_names`
--
ALTER TABLE `ar_direct_income_names`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_fifo_layers`
--
ALTER TABLE `ar_fifo_layers`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_fixed_assets`
--
ALTER TABLE `ar_fixed_assets`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_fixed_asset_revaluations`
--
ALTER TABLE `ar_fixed_asset_revaluations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_investments`
--
ALTER TABLE `ar_investments`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_journal_entry_headers`
--
ALTER TABLE `ar_journal_entry_headers`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=261;

--
-- AUTO_INCREMENT for table `ar_journal_entry_lines`
--
ALTER TABLE `ar_journal_entry_lines`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=309;

--
-- AUTO_INCREMENT for table `ar_ledger_rollups`
--
ALTER TABLE `ar_ledger_rollups`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_loans`
--
ALTER TABLE `ar_loans`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_loan_transactions`
--
ALTER TABLE `ar_loan_transactions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_period_locks`
--
ALTER TABLE `ar_period_locks`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_ratio_snapshots`
--
ALTER TABLE `ar_ratio_snapshots`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ar_receivables_payables`
--
ALTER TABLE `ar_receivables_payables`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `assets`
--
ALTER TABLE `assets`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `asset_maintenances`
--
ALTER TABLE `asset_maintenances`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `asset_transactions`
--
ALTER TABLE `asset_transactions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `asset_warranties`
--
ALTER TABLE `asset_warranties`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `award_catalog`
--
ALTER TABLE `award_catalog`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `award_periods`
--
ALTER TABLE `award_periods`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `backup_logs`
--
ALTER TABLE `backup_logs`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `backup_settings`
--
ALTER TABLE `backup_settings`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `barcodes`
--
ALTER TABLE `barcodes`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `bookings`
--
ALTER TABLE `bookings`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `brands`
--
ALTER TABLE `brands`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=151;

--
-- AUTO_INCREMENT for table `business`
--
ALTER TABLE `business`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `business_backups`
--
ALTER TABLE `business_backups`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `business_locations`
--
ALTER TABLE `business_locations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT for table `business_management_audit_logs`
--
ALTER TABLE `business_management_audit_logs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `cash_denominations`
--
ALTER TABLE `cash_denominations`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `cash_registers`
--
ALTER TABLE `cash_registers`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=72;

--
-- AUTO_INCREMENT for table `cash_register_transactions`
--
ALTER TABLE `cash_register_transactions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1704;

--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=415;

--
-- AUTO_INCREMENT for table `cms_pages`
--
ALTER TABLE `cms_pages`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `cms_page_metas`
--
ALTER TABLE `cms_page_metas`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `cms_site_details`
--
ALTER TABLE `cms_site_details`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `contacts`
--
ALTER TABLE `contacts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=432;

--
-- AUTO_INCREMENT for table `crm_call_logs`
--
ALTER TABLE `crm_call_logs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `crm_campaigns`
--
ALTER TABLE `crm_campaigns`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `crm_contact_person_commissions`
--
ALTER TABLE `crm_contact_person_commissions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `crm_lead_users`
--
ALTER TABLE `crm_lead_users`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `crm_marketplaces`
--
ALTER TABLE `crm_marketplaces`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `crm_proposals`
--
ALTER TABLE `crm_proposals`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `crm_proposal_templates`
--
ALTER TABLE `crm_proposal_templates`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `crm_schedules`
--
ALTER TABLE `crm_schedules`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `crm_schedule_logs`
--
ALTER TABLE `crm_schedule_logs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `crm_schedule_users`
--
ALTER TABLE `crm_schedule_users`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `currencies`
--
ALTER TABLE `currencies`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=142;

--
-- AUTO_INCREMENT for table `customer_awards`
--
ALTER TABLE `customer_awards`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_engagements`
--
ALTER TABLE `customer_engagements`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_groups`
--
ALTER TABLE `customer_groups`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT for table `customer_recognition_cache`
--
ALTER TABLE `customer_recognition_cache`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_recognition_settings`
--
ALTER TABLE `customer_recognition_settings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `dashboard_configurations`
--
ALTER TABLE `dashboard_configurations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `discounts`
--
ALTER TABLE `discounts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `document_and_notes`
--
ALTER TABLE `document_and_notes`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `essentials_allowances_and_deductions`
--
ALTER TABLE `essentials_allowances_and_deductions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `essentials_attendances`
--
ALTER TABLE `essentials_attendances`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `essentials_documents`
--
ALTER TABLE `essentials_documents`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `essentials_document_shares`
--
ALTER TABLE `essentials_document_shares`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `essentials_holidays`
--
ALTER TABLE `essentials_holidays`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `essentials_kb`
--
ALTER TABLE `essentials_kb`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `essentials_kb_users`
--
ALTER TABLE `essentials_kb_users`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `essentials_leaves`
--
ALTER TABLE `essentials_leaves`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `essentials_leave_types`
--
ALTER TABLE `essentials_leave_types`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `essentials_messages`
--
ALTER TABLE `essentials_messages`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `essentials_payroll_groups`
--
ALTER TABLE `essentials_payroll_groups`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `essentials_reminders`
--
ALTER TABLE `essentials_reminders`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `essentials_shifts`
--
ALTER TABLE `essentials_shifts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `essentials_todo_comments`
--
ALTER TABLE `essentials_todo_comments`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `essentials_to_dos`
--
ALTER TABLE `essentials_to_dos`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `essentials_user_sales_targets`
--
ALTER TABLE `essentials_user_sales_targets`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `essentials_user_shifts`
--
ALTER TABLE `essentials_user_shifts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `expense_categories`
--
ALTER TABLE `expense_categories`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=64;

--
-- AUTO_INCREMENT for table `field_forces`
--
ALTER TABLE `field_forces`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `installments`
--
ALTER TABLE `installments`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35;

--
-- AUTO_INCREMENT for table `installment_db`
--
ALTER TABLE `installment_db`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `installment_systems`
--
ALTER TABLE `installment_systems`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `inventory`
--
ALTER TABLE `inventory`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `inventory_products`
--
ALTER TABLE `inventory_products`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `invoice_layouts`
--
ALTER TABLE `invoice_layouts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `invoice_schemes`
--
ALTER TABLE `invoice_schemes`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `media`
--
ALTER TABLE `media`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=283;

--
-- AUTO_INCREMENT for table `mfg_ingredient_groups`
--
ALTER TABLE `mfg_ingredient_groups`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `mfg_recipes`
--
ALTER TABLE `mfg_recipes`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `mfg_recipe_ingredients`
--
ALTER TABLE `mfg_recipe_ingredients`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=586;

--
-- AUTO_INCREMENT for table `module_licenses`
--
ALTER TABLE `module_licenses`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `notification_templates`
--
ALTER TABLE `notification_templates`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=161;

--
-- AUTO_INCREMENT for table `oauth_clients`
--
ALTER TABLE `oauth_clients`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `oauth_personal_access_clients`
--
ALTER TABLE `oauth_personal_access_clients`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `packages`
--
ALTER TABLE `packages`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `permissions`
--
ALTER TABLE `permissions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=355;

--
-- AUTO_INCREMENT for table `pjt_invoice_lines`
--
ALTER TABLE `pjt_invoice_lines`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `pjt_projects`
--
ALTER TABLE `pjt_projects`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `pjt_project_members`
--
ALTER TABLE `pjt_project_members`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `pjt_project_tasks`
--
ALTER TABLE `pjt_project_tasks`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `pjt_project_task_comments`
--
ALTER TABLE `pjt_project_task_comments`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `pjt_project_task_members`
--
ALTER TABLE `pjt_project_task_members`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `pjt_project_time_logs`
--
ALTER TABLE `pjt_project_time_logs`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `premade_lines`
--
ALTER TABLE `premade_lines`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;

--
-- AUTO_INCREMENT for table `printers`
--
ALTER TABLE `printers`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2221;

--
-- AUTO_INCREMENT for table `product_racks`
--
ALTER TABLE `product_racks`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=234;

--
-- AUTO_INCREMENT for table `product_variations`
--
ALTER TABLE `product_variations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2221;

--
-- AUTO_INCREMENT for table `promotions`
--
ALTER TABLE `promotions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `promotion_audit_logs`
--
ALTER TABLE `promotion_audit_logs`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `promotion_daily_usage`
--
ALTER TABLE `promotion_daily_usage`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `promotion_templates`
--
ALTER TABLE `promotion_templates`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `purchase_lines`
--
ALTER TABLE `purchase_lines`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1726;

--
-- AUTO_INCREMENT for table `reference_counts`
--
ALTER TABLE `reference_counts`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=187;

--
-- AUTO_INCREMENT for table `repair_device_models`
--
ALTER TABLE `repair_device_models`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `repair_job_sheets`
--
ALTER TABLE `repair_job_sheets`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `repair_statuses`
--
ALTER TABLE `repair_statuses`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `res_tables`
--
ALTER TABLE `res_tables`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `return_groups`
--
ALTER TABLE `return_groups`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=177;

--
-- AUTO_INCREMENT for table `rma_complain_receives`
--
ALTER TABLE `rma_complain_receives`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `rma_diagnoses`
--
ALTER TABLE `rma_diagnoses`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `rma_engineer_fixings`
--
ALTER TABLE `rma_engineer_fixings`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `rma_item_utilizes`
--
ALTER TABLE `rma_item_utilizes`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `rma_problem_setups`
--
ALTER TABLE `rma_problem_setups`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `rma_replacement_deliveries`
--
ALTER TABLE `rma_replacement_deliveries`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `rma_replace_ins`
--
ALTER TABLE `rma_replace_ins`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `rma_replace_outs`
--
ALTER TABLE `rma_replace_outs`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `rma_serial_histories`
--
ALTER TABLE `rma_serial_histories`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `rma_service_bills`
--
ALTER TABLE `rma_service_bills`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `roles`
--
ALTER TABLE `roles`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;

--
-- AUTO_INCREMENT for table `selling_price_groups`
--
ALTER TABLE `selling_price_groups`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `sell_exchange`
--
ALTER TABLE `sell_exchange`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `sell_exchange_product`
--
ALTER TABLE `sell_exchange_product`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `serial_numbers`
--
ALTER TABLE `serial_numbers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=629;

--
-- AUTO_INCREMENT for table `service_warranties`
--
ALTER TABLE `service_warranties`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `sheet_spreadsheets`
--
ALTER TABLE `sheet_spreadsheets`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sheet_spreadsheet_shares`
--
ALTER TABLE `sheet_spreadsheet_shares`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `staff_awards`
--
ALTER TABLE `staff_awards`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `staff_award_periods`
--
ALTER TABLE `staff_award_periods`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `staff_performance_activities`
--
ALTER TABLE `staff_performance_activities`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `staff_recognition_settings`
--
ALTER TABLE `staff_recognition_settings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `stock_adjustment_lines`
--
ALTER TABLE `stock_adjustment_lines`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `subscriptions`
--
ALTER TABLE `subscriptions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `superadmin_communicator_logs`
--
ALTER TABLE `superadmin_communicator_logs`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `superadmin_coupons`
--
ALTER TABLE `superadmin_coupons`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `superadmin_frontend_pages`
--
ALTER TABLE `superadmin_frontend_pages`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `system`
--
ALTER TABLE `system`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=82;

--
-- AUTO_INCREMENT for table `tax_rates`
--
ALTER TABLE `tax_rates`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `tazas`
--
ALTER TABLE `tazas`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transactions`
--
ALTER TABLE `transactions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3380;

--
-- AUTO_INCREMENT for table `transaction_exchanges`
--
ALTER TABLE `transaction_exchanges`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transaction_exchange_lines`
--
ALTER TABLE `transaction_exchange_lines`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transaction_payments`
--
ALTER TABLE `transaction_payments`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1969;

--
-- AUTO_INCREMENT for table `transaction_sell_lines`
--
ALTER TABLE `transaction_sell_lines`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4028;

--
-- AUTO_INCREMENT for table `transaction_sell_lines_purchase_lines`
--
ALTER TABLE `transaction_sell_lines_purchase_lines`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3744;

--
-- AUTO_INCREMENT for table `types_of_services`
--
ALTER TABLE `types_of_services`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `units`
--
ALTER TABLE `units`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=93;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35;

--
-- AUTO_INCREMENT for table `user_contact_access`
--
ALTER TABLE `user_contact_access`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `variations`
--
ALTER TABLE `variations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2226;

--
-- AUTO_INCREMENT for table `variation_group_prices`
--
ALTER TABLE `variation_group_prices`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=369;

--
-- AUTO_INCREMENT for table `variation_location_details`
--
ALTER TABLE `variation_location_details`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1547;

--
-- AUTO_INCREMENT for table `variation_templates`
--
ALTER TABLE `variation_templates`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `variation_value_templates`
--
ALTER TABLE `variation_value_templates`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;

--
-- AUTO_INCREMENT for table `vld_backup_1_2026_03_15_18_50_01`
--
ALTER TABLE `vld_backup_1_2026_03_15_18_50_01`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1537;

--
-- AUTO_INCREMENT for table `vld_backup_1_2026_03_15_18_57_56`
--
ALTER TABLE `vld_backup_1_2026_03_15_18_57_56`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1537;

--
-- AUTO_INCREMENT for table `vld_backup_1_2026_03_15_19_30_41`
--
ALTER TABLE `vld_backup_1_2026_03_15_19_30_41`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1537;

--
-- AUTO_INCREMENT for table `warehouses`
--
ALTER TABLE `warehouses`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `warranties`
--
ALTER TABLE `warranties`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;

--
-- AUTO_INCREMENT for table `whatsapp_gateway`
--
ALTER TABLE `whatsapp_gateway`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `woocommerce_sync_logs`
--
ALTER TABLE `woocommerce_sync_logs`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `advanced_report_exports`
--
ALTER TABLE `advanced_report_exports`
  ADD CONSTRAINT `advanced_report_exports_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `advanced_report_saved_filters`
--
ALTER TABLE `advanced_report_saved_filters`
  ADD CONSTRAINT `advanced_report_saved_filters_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `advanced_report_saved_filters_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `advanced_report_schedules`
--
ALTER TABLE `advanced_report_schedules`
  ADD CONSTRAINT `advanced_report_schedules_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `ar_audit_log`
--
ALTER TABLE `ar_audit_log`
  ADD CONSTRAINT `ar_audit_log_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_audit_log_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `ar_bank_accounts`
--
ALTER TABLE `ar_bank_accounts`
  ADD CONSTRAINT `ar_bank_accounts_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_bank_accounts_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_bank_accounts_linked_account_id_foreign` FOREIGN KEY (`linked_account_id`) REFERENCES `accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_bank_accounts_opening_balance_transaction_id_foreign` FOREIGN KEY (`opening_balance_transaction_id`) REFERENCES `account_transactions` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `ar_bank_reconciliation`
--
ALTER TABLE `ar_bank_reconciliation`
  ADD CONSTRAINT `ar_bank_reconciliation_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `ar_chart_of_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_bank_reconciliation_account_transaction_id_foreign` FOREIGN KEY (`account_transaction_id`) REFERENCES `account_transactions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_bank_reconciliation_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_bank_reconciliation_cleared_by_foreign` FOREIGN KEY (`cleared_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `ar_capital_accounts`
--
ALTER TABLE `ar_capital_accounts`
  ADD CONSTRAINT `ar_capital_accounts_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_capital_accounts_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `ar_chart_of_accounts`
--
ALTER TABLE `ar_chart_of_accounts`
  ADD CONSTRAINT `ar_chart_of_accounts_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_chart_of_accounts_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_chart_of_accounts_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_chart_of_accounts_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `ar_chart_of_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_chart_of_accounts_updated_by_foreign` FOREIGN KEY (`updated_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `ar_cheque_books`
--
ALTER TABLE `ar_cheque_books`
  ADD CONSTRAINT `ar_cheque_books_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_cheque_books_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_cheque_books_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_cheque_books_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `business_locations` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `ar_cheque_book_entries`
--
ALTER TABLE `ar_cheque_book_entries`
  ADD CONSTRAINT `ar_cheque_book_entries_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_cheque_book_entries_account_transaction_id_foreign` FOREIGN KEY (`account_transaction_id`) REFERENCES `account_transactions` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_cheque_book_entries_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `ar_bank_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_cheque_book_entries_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_cheque_book_entries_cheque_book_id_foreign` FOREIGN KEY (`cheque_book_id`) REFERENCES `ar_cheque_books` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_cheque_book_entries_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_cheque_book_entries_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_cheque_book_entries_deposit_account_id_foreign` FOREIGN KEY (`deposit_account_id`) REFERENCES `accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_cheque_book_entries_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `business_locations` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_cheque_book_entries_source_cheque_id_foreign` FOREIGN KEY (`source_cheque_id`) REFERENCES `ar_cheque_book_entries` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_cheque_book_entries_transaction_id_foreign` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_cheque_book_entries_transaction_payment_id_foreign` FOREIGN KEY (`transaction_payment_id`) REFERENCES `transaction_payments` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `ar_direct_expenses`
--
ALTER TABLE `ar_direct_expenses`
  ADD CONSTRAINT `ar_direct_expenses_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_direct_expenses_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_direct_expenses_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_direct_expenses_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `business_locations` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_direct_expenses_payment_account_id_foreign` FOREIGN KEY (`payment_account_id`) REFERENCES `accounts` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `ar_direct_expense_names`
--
ALTER TABLE `ar_direct_expense_names`
  ADD CONSTRAINT `ar_direct_expense_names_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_direct_expense_names_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `ar_direct_incomes`
--
ALTER TABLE `ar_direct_incomes`
  ADD CONSTRAINT `ar_direct_incomes_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_direct_incomes_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_direct_incomes_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_direct_incomes_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `business_locations` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_direct_incomes_payment_account_id_foreign` FOREIGN KEY (`payment_account_id`) REFERENCES `accounts` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `ar_direct_income_names`
--
ALTER TABLE `ar_direct_income_names`
  ADD CONSTRAINT `ar_direct_income_names_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_direct_income_names_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `ar_fifo_layers`
--
ALTER TABLE `ar_fifo_layers`
  ADD CONSTRAINT `ar_fifo_layers_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_fifo_layers_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `business_locations` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_fifo_layers_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_fifo_layers_transaction_id_foreign` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_fifo_layers_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `variations` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `ar_fixed_assets`
--
ALTER TABLE `ar_fixed_assets`
  ADD CONSTRAINT `ar_fixed_assets_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_fixed_assets_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `ar_fixed_asset_revaluations`
--
ALTER TABLE `ar_fixed_asset_revaluations`
  ADD CONSTRAINT `ar_fixed_asset_revaluations_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_fixed_asset_revaluations_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_fixed_asset_revaluations_fixed_asset_id_foreign` FOREIGN KEY (`fixed_asset_id`) REFERENCES `ar_fixed_assets` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `ar_investments`
--
ALTER TABLE `ar_investments`
  ADD CONSTRAINT `ar_investments_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_investments_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `ar_journal_entry_headers`
--
ALTER TABLE `ar_journal_entry_headers`
  ADD CONSTRAINT `ar_journal_entry_headers_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_journal_entry_headers_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_journal_entry_headers_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `business_locations` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_journal_entry_headers_posted_by_foreign` FOREIGN KEY (`posted_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_journal_entry_headers_source_transaction_id_foreign` FOREIGN KEY (`source_transaction_id`) REFERENCES `transactions` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `ar_journal_entry_lines`
--
ALTER TABLE `ar_journal_entry_lines`
  ADD CONSTRAINT `ar_journal_entry_lines_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `ar_chart_of_accounts` (`id`),
  ADD CONSTRAINT `ar_journal_entry_lines_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_journal_entry_lines_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_journal_entry_lines_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `ar_journal_entry_headers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_journal_entry_lines_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_journal_entry_lines_tax_id_foreign` FOREIGN KEY (`tax_id`) REFERENCES `tax_rates` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_journal_entry_lines_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `variations` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `ar_ledger_rollups`
--
ALTER TABLE `ar_ledger_rollups`
  ADD CONSTRAINT `ar_ledger_rollups_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `ar_chart_of_accounts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_ledger_rollups_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_ledger_rollups_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `business_locations` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `ar_loans`
--
ALTER TABLE `ar_loans`
  ADD CONSTRAINT `ar_loans_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_loans_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_loans_liability_account_id_foreign` FOREIGN KEY (`liability_account_id`) REFERENCES `accounts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_loans_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `business_locations` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_loans_payment_account_id_foreign` FOREIGN KEY (`payment_account_id`) REFERENCES `accounts` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `ar_loan_transactions`
--
ALTER TABLE `ar_loan_transactions`
  ADD CONSTRAINT `ar_loan_transactions_account_transaction_id_foreign` FOREIGN KEY (`account_transaction_id`) REFERENCES `account_transactions` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_loan_transactions_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_loan_transactions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_loan_transactions_loan_id_foreign` FOREIGN KEY (`loan_id`) REFERENCES `ar_loans` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_loan_transactions_payment_account_id_foreign` FOREIGN KEY (`payment_account_id`) REFERENCES `accounts` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `ar_period_locks`
--
ALTER TABLE `ar_period_locks`
  ADD CONSTRAINT `ar_period_locks_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_period_locks_locked_by_foreign` FOREIGN KEY (`locked_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_period_locks_unlocked_by_foreign` FOREIGN KEY (`unlocked_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `ar_ratio_snapshots`
--
ALTER TABLE `ar_ratio_snapshots`
  ADD CONSTRAINT `ar_ratio_snapshots_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `ar_receivables_payables`
--
ALTER TABLE `ar_receivables_payables`
  ADD CONSTRAINT `ar_receivables_payables_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_receivables_payables_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ar_receivables_payables_journal_entry_id_foreign` FOREIGN KEY (`journal_entry_id`) REFERENCES `ar_journal_entry_headers` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `ar_receivables_payables_transaction_id_foreign` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `assets`
--
ALTER TABLE `assets`
  ADD CONSTRAINT `assets_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `assets_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`),
  ADD CONSTRAINT `assets_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`);

--
-- Constraints for table `asset_transactions`
--
ALTER TABLE `asset_transactions`
  ADD CONSTRAINT `asset_transactions_asset_id_foreign` FOREIGN KEY (`asset_id`) REFERENCES `assets` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asset_transactions_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asset_transactions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `asset_transactions_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `asset_transactions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `asset_transactions_receiver_foreign` FOREIGN KEY (`receiver`) REFERENCES `users` (`id`);

--
-- Constraints for table `award_catalog`
--
ALTER TABLE `award_catalog`
  ADD CONSTRAINT `award_catalog_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `award_catalog_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `award_periods`
--
ALTER TABLE `award_periods`
  ADD CONSTRAINT `award_periods_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `award_periods_finalized_by_foreign` FOREIGN KEY (`finalized_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `backup_logs`
--
ALTER TABLE `backup_logs`
  ADD CONSTRAINT `backup_logs_backup_id_foreign` FOREIGN KEY (`backup_id`) REFERENCES `business_backups` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `backup_logs_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `backup_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `backup_settings`
--
ALTER TABLE `backup_settings`
  ADD CONSTRAINT `backup_settings_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `backup_settings_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `barcodes`
--
ALTER TABLE `barcodes`
  ADD CONSTRAINT `barcodes_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `bookings`
--
ALTER TABLE `bookings`
  ADD CONSTRAINT `bookings_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `bookings_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `bookings_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `brands`
--
ALTER TABLE `brands`
  ADD CONSTRAINT `brands_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `brands_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `business`
--
ALTER TABLE `business`
  ADD CONSTRAINT `business_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
  ADD CONSTRAINT `business_default_sales_tax_foreign` FOREIGN KEY (`default_sales_tax`) REFERENCES `tax_rates` (`id`),
  ADD CONSTRAINT `business_owner_id_foreign` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `business_backups`
--
ALTER TABLE `business_backups`
  ADD CONSTRAINT `business_backups_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `business_backups_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `business_locations`
--
ALTER TABLE `business_locations`
  ADD CONSTRAINT `business_locations_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `business_locations_invoice_layout_id_foreign` FOREIGN KEY (`invoice_layout_id`) REFERENCES `invoice_layouts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `business_locations_invoice_scheme_id_foreign` FOREIGN KEY (`invoice_scheme_id`) REFERENCES `invoice_schemes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `cash_registers`
--
ALTER TABLE `cash_registers`
  ADD CONSTRAINT `cash_registers_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `cash_registers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `cash_register_transactions`
--
ALTER TABLE `cash_register_transactions`
  ADD CONSTRAINT `cash_register_transactions_cash_register_id_foreign` FOREIGN KEY (`cash_register_id`) REFERENCES `cash_registers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `categories`
--
ALTER TABLE `categories`
  ADD CONSTRAINT `categories_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `categories_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `cms_page_metas`
--
ALTER TABLE `cms_page_metas`
  ADD CONSTRAINT `cms_page_metas_cms_page_id_foreign` FOREIGN KEY (`cms_page_id`) REFERENCES `cms_pages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `contacts`
--
ALTER TABLE `contacts`
  ADD CONSTRAINT `contacts_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `contacts_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `crm_campaigns`
--
ALTER TABLE `crm_campaigns`
  ADD CONSTRAINT `crm_campaigns_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `crm_lead_users`
--
ALTER TABLE `crm_lead_users`
  ADD CONSTRAINT `crm_lead_users_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `crm_proposals`
--
ALTER TABLE `crm_proposals`
  ADD CONSTRAINT `crm_proposals_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `crm_proposals_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `crm_proposal_templates`
--
ALTER TABLE `crm_proposal_templates`
  ADD CONSTRAINT `crm_proposal_templates_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `crm_schedules`
--
ALTER TABLE `crm_schedules`
  ADD CONSTRAINT `crm_schedules_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `crm_schedule_logs`
--
ALTER TABLE `crm_schedule_logs`
  ADD CONSTRAINT `crm_schedule_logs_schedule_id_foreign` FOREIGN KEY (`schedule_id`) REFERENCES `crm_schedules` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `crm_schedule_users`
--
ALTER TABLE `crm_schedule_users`
  ADD CONSTRAINT `crm_schedule_users_schedule_id_foreign` FOREIGN KEY (`schedule_id`) REFERENCES `crm_schedules` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_awards`
--
ALTER TABLE `customer_awards`
  ADD CONSTRAINT `customer_awards_awarded_by_foreign` FOREIGN KEY (`awarded_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_awards_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_awards_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_awards_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `award_periods` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `customer_engagements`
--
ALTER TABLE `customer_engagements`
  ADD CONSTRAINT `customer_engagements_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_engagements_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_engagements_recorded_by_foreign` FOREIGN KEY (`recorded_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_groups`
--
ALTER TABLE `customer_groups`
  ADD CONSTRAINT `customer_groups_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_recognition_cache`
--
ALTER TABLE `customer_recognition_cache`
  ADD CONSTRAINT `customer_recognition_cache_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_recognition_cache_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_recognition_settings`
--
ALTER TABLE `customer_recognition_settings`
  ADD CONSTRAINT `customer_recognition_settings_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `dashboard_configurations`
--
ALTER TABLE `dashboard_configurations`
  ADD CONSTRAINT `dashboard_configurations_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `essentials_kb`
--
ALTER TABLE `essentials_kb`
  ADD CONSTRAINT `essentials_kb_parent_id_foreign` FOREIGN KEY (`parent_id`) REFERENCES `essentials_kb` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `essentials_payroll_group_transactions`
--
ALTER TABLE `essentials_payroll_group_transactions`
  ADD CONSTRAINT `essentials_payroll_group_transactions_payroll_group_id_foreign` FOREIGN KEY (`payroll_group_id`) REFERENCES `essentials_payroll_groups` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `expense_categories`
--
ALTER TABLE `expense_categories`
  ADD CONSTRAINT `expense_categories_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `group_sub_taxes`
--
ALTER TABLE `group_sub_taxes`
  ADD CONSTRAINT `group_sub_taxes_group_tax_id_foreign` FOREIGN KEY (`group_tax_id`) REFERENCES `tax_rates` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `group_sub_taxes_tax_id_foreign` FOREIGN KEY (`tax_id`) REFERENCES `tax_rates` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `inventory`
--
ALTER TABLE `inventory`
  ADD CONSTRAINT `inventory_branch_id_foreign` FOREIGN KEY (`branch_id`) REFERENCES `business_locations` (`id`);

--
-- Constraints for table `inventory_products`
--
ALTER TABLE `inventory_products`
  ADD CONSTRAINT `inventory_products_inventory_id_foreign` FOREIGN KEY (`inventory_id`) REFERENCES `inventory` (`id`),
  ADD CONSTRAINT `inventory_products_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`),
  ADD CONSTRAINT `inventory_products_transaction_id_foreign` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `inventory_products_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `variations` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `invoice_layouts`
--
ALTER TABLE `invoice_layouts`
  ADD CONSTRAINT `invoice_layouts_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `invoice_schemes`
--
ALTER TABLE `invoice_schemes`
  ADD CONSTRAINT `invoice_schemes_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `mfg_recipe_ingredients`
--
ALTER TABLE `mfg_recipe_ingredients`
  ADD CONSTRAINT `mfg_recipe_ingredients_mfg_recipe_id_foreign` FOREIGN KEY (`mfg_recipe_id`) REFERENCES `mfg_recipes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `model_has_permissions`
--
ALTER TABLE `model_has_permissions`
  ADD CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `model_has_roles`
--
ALTER TABLE `model_has_roles`
  ADD CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `pjt_invoice_lines`
--
ALTER TABLE `pjt_invoice_lines`
  ADD CONSTRAINT `pjt_invoice_lines_transaction_id_foreign` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `pjt_project_members`
--
ALTER TABLE `pjt_project_members`
  ADD CONSTRAINT `pjt_project_members_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `pjt_projects` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `pjt_project_tasks`
--
ALTER TABLE `pjt_project_tasks`
  ADD CONSTRAINT `pjt_project_tasks_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `pjt_projects` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `pjt_project_task_comments`
--
ALTER TABLE `pjt_project_task_comments`
  ADD CONSTRAINT `pjt_project_task_comments_project_task_id_foreign` FOREIGN KEY (`project_task_id`) REFERENCES `pjt_project_tasks` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `pjt_project_task_members`
--
ALTER TABLE `pjt_project_task_members`
  ADD CONSTRAINT `pjt_project_task_members_project_task_id_foreign` FOREIGN KEY (`project_task_id`) REFERENCES `pjt_project_tasks` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `pjt_project_time_logs`
--
ALTER TABLE `pjt_project_time_logs`
  ADD CONSTRAINT `pjt_project_time_logs_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `pjt_projects` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `pjt_project_time_logs_project_task_id_foreign` FOREIGN KEY (`project_task_id`) REFERENCES `pjt_project_tasks` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `premade_lines`
--
ALTER TABLE `premade_lines`
  ADD CONSTRAINT `premade_lines_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `premade_lines_premade_product_id_foreign` FOREIGN KEY (`premade_product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `premade_lines_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `premade_lines_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `variations` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `printers`
--
ALTER TABLE `printers`
  ADD CONSTRAINT `printers_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `products`
--
ALTER TABLE `products`
  ADD CONSTRAINT `products_brand_id_foreign` FOREIGN KEY (`brand_id`) REFERENCES `brands` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `products_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `products_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `products_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `products_repair_model_id_foreign` FOREIGN KEY (`repair_model_id`) REFERENCES `repair_device_models` (`id`),
  ADD CONSTRAINT `products_sub_category_id_foreign` FOREIGN KEY (`sub_category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `products_supplier_id_foreign` FOREIGN KEY (`supplier_id`) REFERENCES `contacts` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `products_tax_foreign` FOREIGN KEY (`tax`) REFERENCES `tax_rates` (`id`),
  ADD CONSTRAINT `products_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `product_variations`
--
ALTER TABLE `product_variations`
  ADD CONSTRAINT `product_variations_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `promotions`
--
ALTER TABLE `promotions`
  ADD CONSTRAINT `promotions_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `promotions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `promotions_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `business_locations` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `promotions_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `promotion_audit_logs`
--
ALTER TABLE `promotion_audit_logs`
  ADD CONSTRAINT `promotion_audit_logs_promotion_id_foreign` FOREIGN KEY (`promotion_id`) REFERENCES `promotions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `promotion_audit_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `promotion_daily_usage`
--
ALTER TABLE `promotion_daily_usage`
  ADD CONSTRAINT `promotion_daily_usage_promotion_id_foreign` FOREIGN KEY (`promotion_id`) REFERENCES `promotions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `promotion_templates`
--
ALTER TABLE `promotion_templates`
  ADD CONSTRAINT `promotion_templates_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `promotion_templates_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `purchase_lines`
--
ALTER TABLE `purchase_lines`
  ADD CONSTRAINT `purchase_lines_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_lines_tax_id_foreign` FOREIGN KEY (`tax_id`) REFERENCES `tax_rates` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_lines_transaction_id_foreign` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `purchase_lines_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `variations` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `repair_device_models`
--
ALTER TABLE `repair_device_models`
  ADD CONSTRAINT `repair_device_models_brand_id_foreign` FOREIGN KEY (`brand_id`) REFERENCES `brands` (`id`),
  ADD CONSTRAINT `repair_device_models_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `repair_device_models_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `repair_device_models_device_id_foreign` FOREIGN KEY (`device_id`) REFERENCES `categories` (`id`);

--
-- Constraints for table `repair_job_sheets`
--
ALTER TABLE `repair_job_sheets`
  ADD CONSTRAINT `repair_job_sheets_brand_id_foreign` FOREIGN KEY (`brand_id`) REFERENCES `brands` (`id`),
  ADD CONSTRAINT `repair_job_sheets_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `repair_job_sheets_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `repair_job_sheets_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `repair_job_sheets_device_id_foreign` FOREIGN KEY (`device_id`) REFERENCES `categories` (`id`),
  ADD CONSTRAINT `repair_job_sheets_device_model_id_foreign` FOREIGN KEY (`device_model_id`) REFERENCES `repair_device_models` (`id`),
  ADD CONSTRAINT `repair_job_sheets_service_staff_foreign` FOREIGN KEY (`service_staff`) REFERENCES `users` (`id`);

--
-- Constraints for table `res_product_modifier_sets`
--
ALTER TABLE `res_product_modifier_sets`
  ADD CONSTRAINT `res_product_modifier_sets_modifier_set_id_foreign` FOREIGN KEY (`modifier_set_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `res_tables`
--
ALTER TABLE `res_tables`
  ADD CONSTRAINT `res_tables_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `roles`
--
ALTER TABLE `roles`
  ADD CONSTRAINT `roles_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `role_has_permissions`
--
ALTER TABLE `role_has_permissions`
  ADD CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `selling_price_groups`
--
ALTER TABLE `selling_price_groups`
  ADD CONSTRAINT `selling_price_groups_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `sheet_spreadsheets`
--
ALTER TABLE `sheet_spreadsheets`
  ADD CONSTRAINT `sheet_spreadsheets_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `sheet_spreadsheet_shares`
--
ALTER TABLE `sheet_spreadsheet_shares`
  ADD CONSTRAINT `sheet_spreadsheet_shares_sheet_spreadsheet_id_foreign` FOREIGN KEY (`sheet_spreadsheet_id`) REFERENCES `sheet_spreadsheets` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `staff_awards`
--
ALTER TABLE `staff_awards`
  ADD CONSTRAINT `staff_awards_awarded_by_foreign` FOREIGN KEY (`awarded_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `staff_awards_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `staff_awards_catalog_item_id_foreign` FOREIGN KEY (`catalog_item_id`) REFERENCES `variations` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `staff_awards_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `staff_award_periods` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `staff_awards_staff_id_foreign` FOREIGN KEY (`staff_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `staff_award_periods`
--
ALTER TABLE `staff_award_periods`
  ADD CONSTRAINT `staff_award_periods_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `staff_award_periods_finalized_by_foreign` FOREIGN KEY (`finalized_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `staff_performance_activities`
--
ALTER TABLE `staff_performance_activities`
  ADD CONSTRAINT `staff_performance_activities_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `staff_performance_activities_recorded_by_foreign` FOREIGN KEY (`recorded_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `staff_performance_activities_staff_id_foreign` FOREIGN KEY (`staff_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `staff_recognition_settings`
--
ALTER TABLE `staff_recognition_settings`
  ADD CONSTRAINT `staff_recognition_settings_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `stock_adjustment_lines`
--
ALTER TABLE `stock_adjustment_lines`
  ADD CONSTRAINT `stock_adjustment_lines_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `stock_adjustment_lines_transaction_id_foreign` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `stock_adjustment_lines_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `variations` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `subscriptions`
--
ALTER TABLE `subscriptions`
  ADD CONSTRAINT `subscriptions_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `tax_rates`
--
ALTER TABLE `tax_rates`
  ADD CONSTRAINT `tax_rates_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `tax_rates_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `tazas`
--
ALTER TABLE `tazas`
  ADD CONSTRAINT `tazas_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `tazas_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `transactions`
--
ALTER TABLE `transactions`
  ADD CONSTRAINT `transactions_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transactions_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transactions_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transactions_expense_category_id_foreign` FOREIGN KEY (`expense_category_id`) REFERENCES `expense_categories` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transactions_expense_for_foreign` FOREIGN KEY (`expense_for`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transactions_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `business_locations` (`id`),
  ADD CONSTRAINT `transactions_pjt_project_id_foreign` FOREIGN KEY (`pjt_project_id`) REFERENCES `pjt_projects` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transactions_repair_job_sheet_id_foreign` FOREIGN KEY (`repair_job_sheet_id`) REFERENCES `repair_job_sheets` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transactions_tax_id_foreign` FOREIGN KEY (`tax_id`) REFERENCES `tax_rates` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `transaction_exchanges`
--
ALTER TABLE `transaction_exchanges`
  ADD CONSTRAINT `transaction_exchanges_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transaction_exchanges_cancelled_by_foreign` FOREIGN KEY (`cancelled_by`) REFERENCES `users` (`id`),
  ADD CONSTRAINT `transaction_exchanges_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transaction_exchanges_exchange_transaction_id_foreign` FOREIGN KEY (`exchange_transaction_id`) REFERENCES `transactions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transaction_exchanges_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `business_locations` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transaction_exchanges_original_transaction_id_foreign` FOREIGN KEY (`original_transaction_id`) REFERENCES `transactions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `transaction_exchange_lines`
--
ALTER TABLE `transaction_exchange_lines`
  ADD CONSTRAINT `transaction_exchange_lines_exchange_id_foreign` FOREIGN KEY (`exchange_id`) REFERENCES `transaction_exchanges` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transaction_exchange_lines_new_sell_line_id_foreign` FOREIGN KEY (`new_sell_line_id`) REFERENCES `transaction_sell_lines` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transaction_exchange_lines_original_sell_line_id_foreign` FOREIGN KEY (`original_sell_line_id`) REFERENCES `transaction_sell_lines` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `transaction_payments`
--
ALTER TABLE `transaction_payments`
  ADD CONSTRAINT `transaction_payments_transaction_id_foreign` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `transaction_sell_lines`
--
ALTER TABLE `transaction_sell_lines`
  ADD CONSTRAINT `transaction_sell_lines_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transaction_sell_lines_tax_id_foreign` FOREIGN KEY (`tax_id`) REFERENCES `tax_rates` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transaction_sell_lines_transaction_id_foreign` FOREIGN KEY (`transaction_id`) REFERENCES `transactions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `transaction_sell_lines_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `variations` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `units`
--
ALTER TABLE `units`
  ADD CONSTRAINT `units_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `units_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `users`
--
ALTER TABLE `users`
  ADD CONSTRAINT `users_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `users_crm_contact_id_foreign` FOREIGN KEY (`crm_contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `variations`
--
ALTER TABLE `variations`
  ADD CONSTRAINT `variations_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `variations_product_variation_id_foreign` FOREIGN KEY (`product_variation_id`) REFERENCES `product_variations` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `variation_group_prices`
--
ALTER TABLE `variation_group_prices`
  ADD CONSTRAINT `variation_group_prices_price_group_id_foreign` FOREIGN KEY (`price_group_id`) REFERENCES `selling_price_groups` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `variation_group_prices_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `variations` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `variation_location_details`
--
ALTER TABLE `variation_location_details`
  ADD CONSTRAINT `variation_location_details_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `business_locations` (`id`),
  ADD CONSTRAINT `variation_location_details_variation_id_foreign` FOREIGN KEY (`variation_id`) REFERENCES `variations` (`id`);

--
-- Constraints for table `variation_templates`
--
ALTER TABLE `variation_templates`
  ADD CONSTRAINT `variation_templates_business_id_foreign` FOREIGN KEY (`business_id`) REFERENCES `business` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `variation_value_templates`
--
ALTER TABLE `variation_value_templates`
  ADD CONSTRAINT `variation_value_templates_variation_template_id_foreign` FOREIGN KEY (`variation_template_id`) REFERENCES `variation_templates` (`id`) ON DELETE CASCADE;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
