

CREATE TABLE `accounts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `chart_of_account_id` int(11) DEFAULT NULL,
  `account_no` varchar(191) NOT NULL,
  `name` varchar(191) NOT NULL,
  `initial_balance` double DEFAULT NULL,
  `total_balance` double NOT NULL,
  `note` text DEFAULT NULL,
  `is_default` tinyint(1) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO accounts VALUES("1","2","1111.001","PENDAPATAN PENJUALAN","","0","","1","1","2026-03-10 21:51:38","2026-08-07 18:26:41");
INSERT INTO accounts VALUES("2","3","1111.001","PENDAPATAN PENJUALAN","0","0","Auto-generated for account: PENDAPATAN PENJUALAN","","1","2026-03-10 21:52:14","2026-08-07 18:26:41");
INSERT INTO accounts VALUES("3","40","1112.001","KAS BRANKAS","","0","","","0","2026-07-13 12:33:36","2026-07-13 13:27:09");
INSERT INTO accounts VALUES("4","4","1113.001","KAS KECIL","","0","","","1","2026-07-13 13:44:46","2026-08-07 18:26:41");
INSERT INTO accounts VALUES("5","5","1123.001","REK. BRI","","0","","","1","2026-07-13 18:27:40","2026-08-07 18:26:41");
INSERT INTO accounts VALUES("6","4","1112.1","Kas Brankas","0","0","","0","1","2026-07-29 14:42:58","2026-07-29 14:42:58");
INSERT INTO accounts VALUES("7","5","1211.1","Limit Sp Layter","0","0","","0","1","2026-07-29 15:13:19","2026-07-30 15:53:23");



CREATE TABLE `adjustments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `reference_no` varchar(191) NOT NULL,
  `warehouse_id` int(11) NOT NULL,
  `document` varchar(191) DEFAULT NULL,
  `total_qty` double NOT NULL,
  `item` int(11) NOT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `attendances` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `employee_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `checkin` varchar(191) NOT NULL,
  `checkout` varchar(191) DEFAULT NULL,
  `status` int(11) NOT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_attendance` (`date`,`employee_id`,`checkin`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `billers` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `image` varchar(191) DEFAULT NULL,
  `company_name` varchar(191) NOT NULL,
  `vat_number` varchar(191) DEFAULT NULL,
  `email` varchar(191) NOT NULL,
  `phone_number` varchar(191) NOT NULL,
  `address` varchar(191) NOT NULL,
  `city` varchar(191) NOT NULL,
  `state` varchar(191) DEFAULT NULL,
  `postal_code` varchar(191) DEFAULT NULL,
  `country` varchar(191) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `brands` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(191) NOT NULL,
  `image` varchar(191) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO brands VALUES("1","UMUM","","1","2026-08-07 18:31:13","2026-08-07 18:31:13");



CREATE TABLE `cash_registers` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `cash_in_hand` double NOT NULL,
  `user_id` int(11) NOT NULL,
  `warehouse_id` int(11) NOT NULL,
  `status` tinyint(1) NOT NULL,
  `expected_cash_amount` double DEFAULT NULL,
  `closing_cash_amount` double DEFAULT NULL,
  `deposit_amount` double DEFAULT NULL,
  `cash_difference` double DEFAULT NULL,
  `closing_note` text DEFAULT NULL,
  `approval_status` varchar(191) NOT NULL DEFAULT 'pending',
  `approved_by` int(11) DEFAULT NULL,
  `approved_at` timestamp NULL DEFAULT NULL,
  `approval_note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `categories` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `image` varchar(191) DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO categories VALUES("1","BAHAN POKOK","20260807071510.jpg","","1","2026-08-07 18:31:22","2026-08-07 18:31:22");
INSERT INTO categories VALUES("2","MINUMAN","20260807071702.jpg","","1","2026-08-07 19:15:38","2026-08-07 19:15:38");
INSERT INTO categories VALUES("3","MAKANAN","","","1","2026-08-07 19:59:54","2026-08-07 19:59:54");



CREATE TABLE `chart_of_accounts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `type` varchar(255) NOT NULL,
  `normal_balance` varchar(255) NOT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `opening_balance` double NOT NULL DEFAULT 0,
  `description` text DEFAULT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT 0,
  `is_cash_account` tinyint(1) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `chart_of_accounts_code_unique` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO chart_of_accounts VALUES("1","1101","Kas","asset","debit","","0","Auto-created because the standard account 1101 was missing.","1","0","1","2026-08-07 18:26:41","2026-08-07 18:26:41");
INSERT INTO chart_of_accounts VALUES("2","1101.1","PENDAPATAN PENJUALAN (1111.001)","asset","debit","1","0","Auto-generated for account: PENDAPATAN PENJUALAN","0","0","1","2026-08-07 18:26:41","2026-08-07 18:26:41");
INSERT INTO chart_of_accounts VALUES("3","1101.2","PENDAPATAN PENJUALAN (1111.001)","asset","debit","1","0","Auto-generated for account: PENDAPATAN PENJUALAN","0","0","1","2026-08-07 18:26:41","2026-08-07 18:26:41");
INSERT INTO chart_of_accounts VALUES("4","1101.3","KAS KECIL (1113.001)","asset","debit","1","0","Auto-generated for account: KAS KECIL","0","0","1","2026-08-07 18:26:41","2026-08-07 18:26:41");
INSERT INTO chart_of_accounts VALUES("5","1101.4","REK. BRI (1123.001)","asset","debit","1","0","Auto-generated for account: REK. BRI","0","0","1","2026-08-07 18:26:41","2026-08-07 18:26:41");



CREATE TABLE `coupons` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(191) NOT NULL,
  `type` varchar(191) NOT NULL,
  `amount` double NOT NULL,
  `minimum_amount` double DEFAULT NULL,
  `quantity` int(11) NOT NULL,
  `used` int(11) NOT NULL,
  `expired_date` date NOT NULL,
  `user_id` int(11) NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `couriers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `phone_number` varchar(255) NOT NULL,
  `address` text NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `currencies` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `code` varchar(191) NOT NULL,
  `exchange_rate` double NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO currencies VALUES("1","Rupiah","Rp","1","1","2023-06-21 21:04:32","2026-07-19 20:33:13");
INSERT INTO currencies VALUES("2","Rupiah","Rp.","1","0","2026-07-14 18:34:42","2026-07-14 18:34:42");



CREATE TABLE `custom_fields` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `belongs_to` varchar(191) NOT NULL,
  `name` varchar(191) NOT NULL,
  `type` varchar(191) NOT NULL,
  `default_value` text DEFAULT NULL,
  `option_value` text DEFAULT NULL,
  `grid_value` int(11) NOT NULL,
  `is_table` tinyint(1) NOT NULL,
  `is_invoice` tinyint(1) NOT NULL,
  `is_required` tinyint(1) NOT NULL,
  `is_admin` tinyint(1) NOT NULL,
  `is_disable` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `customer_groups` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `percentage` varchar(191) NOT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `customers` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `customer_group_id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `name` varchar(191) NOT NULL,
  `company_name` varchar(191) DEFAULT NULL,
  `email` varchar(191) DEFAULT NULL,
  `phone_number` varchar(191) NOT NULL,
  `tax_no` varchar(191) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `state` varchar(191) DEFAULT NULL,
  `postal_code` varchar(191) DEFAULT NULL,
  `country` varchar(191) DEFAULT NULL,
  `points` double DEFAULT NULL,
  `deposit` double DEFAULT NULL,
  `expense` double DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `deliveries` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `reference_no` varchar(191) NOT NULL,
  `sale_id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `courier_id` int(11) DEFAULT NULL,
  `address` text NOT NULL,
  `delivered_by` varchar(191) DEFAULT NULL,
  `recieved_by` varchar(191) DEFAULT NULL,
  `file` varchar(191) DEFAULT NULL,
  `note` varchar(191) DEFAULT NULL,
  `status` varchar(191) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `departments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `deposits` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `amount` double NOT NULL,
  `customer_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `discount_plan_customers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `discount_plan_id` int(11) NOT NULL,
  `customer_id` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `discount_plan_discounts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `discount_id` int(11) NOT NULL,
  `discount_plan_id` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `discount_plans` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `discounts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `applicable_for` varchar(191) NOT NULL,
  `product_list` longtext DEFAULT NULL,
  `valid_from` date NOT NULL,
  `valid_till` date NOT NULL,
  `type` varchar(191) NOT NULL,
  `value` double NOT NULL,
  `minimum_qty` double NOT NULL,
  `maximum_qty` double NOT NULL,
  `days` varchar(191) NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `dso_alerts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `product_info` longtext NOT NULL,
  `number_of_products` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `employees` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `email` varchar(191) NOT NULL,
  `phone_number` varchar(191) NOT NULL,
  `department_id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `image` varchar(191) DEFAULT NULL,
  `address` varchar(191) DEFAULT NULL,
  `city` varchar(191) DEFAULT NULL,
  `country` varchar(191) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `staff_id` varchar(191) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `expense_categories` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(191) NOT NULL,
  `name` varchar(191) NOT NULL,
  `chart_of_account_id` int(11) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `expenses` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `reference_no` varchar(191) NOT NULL,
  `expense_category_id` int(11) NOT NULL,
  `warehouse_id` int(11) NOT NULL,
  `account_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `cash_register_id` int(11) DEFAULT NULL,
  `amount` double NOT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `external_services` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `details` longtext DEFAULT NULL,
  `active` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `failed_jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `general_settings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `site_title` varchar(191) NOT NULL,
  `site_logo` varchar(191) DEFAULT NULL,
  `is_rtl` tinyint(1) DEFAULT NULL,
  `currency` varchar(191) NOT NULL,
  `package_id` int(11) DEFAULT NULL,
  `staff_access` varchar(191) NOT NULL,
  `date_format` varchar(191) NOT NULL,
  `developed_by` varchar(191) DEFAULT NULL,
  `invoice_format` varchar(191) DEFAULT NULL,
  `decimal` int(11) DEFAULT 2,
  `state` int(11) DEFAULT NULL,
  `theme` varchar(191) NOT NULL,
  `modules` text CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `currency_position` varchar(191) NOT NULL,
  `expiry_date` date DEFAULT NULL,
  `is_zatca` tinyint(1) DEFAULT NULL,
  `company_name` varchar(191) DEFAULT NULL,
  `vat_registration_number` varchar(191) DEFAULT NULL,
  `without_stock` varchar(255) DEFAULT 'no',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO general_settings VALUES("1","DekatPOS","","0","1","","own","Y-m-d","ThreeGency","standard","2","1","default.css","","2023-06-21 07:00:00","2023-06-21 07:00:00","suffix","","0","","","no");



CREATE TABLE `gift_card_recharges` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `gift_card_id` int(11) NOT NULL,
  `amount` double NOT NULL,
  `user_id` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `gift_cards` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `card_no` varchar(191) NOT NULL,
  `amount` double NOT NULL,
  `expense` double NOT NULL,
  `customer_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `expired_date` date DEFAULT NULL,
  `created_by` int(11) NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `holidays` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `from_date` date NOT NULL,
  `to_date` date NOT NULL,
  `note` text DEFAULT NULL,
  `is_approved` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `hrm_settings` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `checkin` varchar(191) NOT NULL,
  `checkout` varchar(191) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `journal_details` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `journal_id` int(11) NOT NULL,
  `chart_of_account_id` int(11) NOT NULL,
  `debit` double NOT NULL DEFAULT 0,
  `credit` double NOT NULL DEFAULT 0,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;




CREATE TABLE `journals` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `journal_no` varchar(255) NOT NULL,
  `journal_date` date NOT NULL,
  `description` text DEFAULT NULL,
  `reference_type` varchar(255) DEFAULT NULL,
  `reference_id` int(11) DEFAULT NULL,
  `is_manual` tinyint(1) NOT NULL DEFAULT 0,
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;




CREATE TABLE `languages` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(191) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO languages VALUES("1","en","2018-07-08 05:59:17","2019-12-25 00:34:20");




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

INSERT INTO migrations VALUES("1","2014_10_12_000000_create_users_table","1");
INSERT INTO migrations VALUES("2","2014_10_12_100000_create_password_resets_table","1");
INSERT INTO migrations VALUES("3","2018_02_17_060412_create_categories_table","1");
INSERT INTO migrations VALUES("4","2018_02_20_035727_create_brands_table","1");
INSERT INTO migrations VALUES("5","2018_02_25_100635_create_suppliers_table","1");
INSERT INTO migrations VALUES("6","2018_02_27_101619_create_warehouse_table","1");
INSERT INTO migrations VALUES("7","2018_03_03_040448_create_units_table","1");
INSERT INTO migrations VALUES("8","2018_03_04_041317_create_taxes_table","1");
INSERT INTO migrations VALUES("9","2018_03_10_061915_create_customer_groups_table","1");
INSERT INTO migrations VALUES("10","2018_03_10_090534_create_customers_table","1");
INSERT INTO migrations VALUES("11","2018_03_11_095547_create_billers_table","1");
INSERT INTO migrations VALUES("12","2018_04_05_054401_create_products_table","1");
INSERT INTO migrations VALUES("13","2018_04_06_133606_create_purchases_table","1");
INSERT INTO migrations VALUES("14","2018_04_06_154600_create_product_purchases_table","1");
INSERT INTO migrations VALUES("15","2018_04_06_154915_create_product_warhouse_table","1");
INSERT INTO migrations VALUES("16","2018_04_10_085927_create_sales_table","1");
INSERT INTO migrations VALUES("17","2018_04_10_090133_create_product_sales_table","1");
INSERT INTO migrations VALUES("18","2018_04_10_090254_create_payments_table","1");
INSERT INTO migrations VALUES("19","2018_04_10_090341_create_payment_with_cheque_table","1");
INSERT INTO migrations VALUES("20","2018_04_10_090509_create_payment_with_credit_card_table","1");
INSERT INTO migrations VALUES("21","2018_04_13_121436_create_quotation_table","1");
INSERT INTO migrations VALUES("22","2018_04_13_122324_create_product_quotation_table","1");
INSERT INTO migrations VALUES("23","2018_04_14_121802_create_transfers_table","1");
INSERT INTO migrations VALUES("24","2018_04_14_121913_create_product_transfer_table","1");
INSERT INTO migrations VALUES("25","2018_05_13_082847_add_payment_id_and_change_sale_id_to_payments_table","2");
INSERT INTO migrations VALUES("26","2018_05_13_090906_change_customer_id_to_payment_with_credit_card_table","3");
INSERT INTO migrations VALUES("27","2018_05_20_054532_create_adjustments_table","4");
INSERT INTO migrations VALUES("28","2018_05_20_054859_create_product_adjustments_table","4");
INSERT INTO migrations VALUES("29","2018_05_21_163419_create_returns_table","5");
INSERT INTO migrations VALUES("30","2018_05_21_163443_create_product_returns_table","5");
INSERT INTO migrations VALUES("31","2018_06_02_050905_create_roles_table","6");
INSERT INTO migrations VALUES("32","2018_06_02_073430_add_columns_to_users_table","7");
INSERT INTO migrations VALUES("33","2018_06_03_053738_create_permission_tables","8");
INSERT INTO migrations VALUES("34","2018_06_21_063736_create_pos_setting_table","9");
INSERT INTO migrations VALUES("35","2018_06_21_094155_add_user_id_to_sales_table","10");
INSERT INTO migrations VALUES("36","2018_06_21_101529_add_user_id_to_purchases_table","11");
INSERT INTO migrations VALUES("37","2018_06_21_103512_add_user_id_to_transfers_table","12");
INSERT INTO migrations VALUES("38","2018_06_23_061058_add_user_id_to_quotations_table","13");
INSERT INTO migrations VALUES("39","2018_06_23_082427_add_is_deleted_to_users_table","14");
INSERT INTO migrations VALUES("40","2018_06_25_043308_change_email_to_users_table","15");
INSERT INTO migrations VALUES("41","2018_07_06_115449_create_general_settings_table","16");
INSERT INTO migrations VALUES("42","2018_07_08_043944_create_languages_table","17");
INSERT INTO migrations VALUES("43","2018_07_11_102144_add_user_id_to_returns_table","18");
INSERT INTO migrations VALUES("44","2018_07_11_102334_add_user_id_to_payments_table","18");
INSERT INTO migrations VALUES("45","2018_07_22_130541_add_digital_to_products_table","19");
INSERT INTO migrations VALUES("46","2018_07_24_154250_create_deliveries_table","20");
INSERT INTO migrations VALUES("47","2018_08_16_053336_create_expense_categories_table","21");
INSERT INTO migrations VALUES("48","2018_08_17_115415_create_expenses_table","22");
INSERT INTO migrations VALUES("49","2018_08_18_050418_create_gift_cards_table","23");
INSERT INTO migrations VALUES("50","2018_08_19_063119_create_payment_with_gift_card_table","24");
INSERT INTO migrations VALUES("51","2018_08_25_042333_create_gift_card_recharges_table","25");
INSERT INTO migrations VALUES("52","2018_08_25_101354_add_deposit_expense_to_customers_table","26");
INSERT INTO migrations VALUES("53","2018_08_26_043801_create_deposits_table","27");
INSERT INTO migrations VALUES("54","2018_09_02_044042_add_keybord_active_to_pos_setting_table","28");
INSERT INTO migrations VALUES("55","2018_09_09_092713_create_payment_with_paypal_table","29");
INSERT INTO migrations VALUES("56","2018_09_10_051254_add_currency_to_general_settings_table","30");
INSERT INTO migrations VALUES("57","2018_10_22_084118_add_biller_and_store_id_to_users_table","31");
INSERT INTO migrations VALUES("58","2018_10_26_034927_create_coupons_table","32");
INSERT INTO migrations VALUES("59","2018_10_27_090857_add_coupon_to_sales_table","33");
INSERT INTO migrations VALUES("60","2018_11_07_070155_add_currency_position_to_general_settings_table","34");
INSERT INTO migrations VALUES("61","2018_11_19_094650_add_combo_to_products_table","35");
INSERT INTO migrations VALUES("62","2018_12_09_043712_create_accounts_table","36");
INSERT INTO migrations VALUES("63","2018_12_17_112253_add_is_default_to_accounts_table","37");
INSERT INTO migrations VALUES("64","2018_12_19_103941_add_account_id_to_payments_table","38");
INSERT INTO migrations VALUES("65","2018_12_20_065900_add_account_id_to_expenses_table","39");
INSERT INTO migrations VALUES("66","2018_12_20_082753_add_account_id_to_returns_table","40");
INSERT INTO migrations VALUES("67","2018_12_26_064330_create_return_purchases_table","41");
INSERT INTO migrations VALUES("68","2018_12_26_144210_create_purchase_product_return_table","42");
INSERT INTO migrations VALUES("69","2018_12_26_144708_create_purchase_product_return_table","43");
INSERT INTO migrations VALUES("70","2018_12_27_110018_create_departments_table","44");
INSERT INTO migrations VALUES("71","2018_12_30_054844_create_employees_table","45");
INSERT INTO migrations VALUES("72","2018_12_31_125210_create_payrolls_table","46");
INSERT INTO migrations VALUES("73","2018_12_31_150446_add_department_id_to_employees_table","47");
INSERT INTO migrations VALUES("74","2019_01_01_062708_add_user_id_to_expenses_table","48");
INSERT INTO migrations VALUES("75","2019_01_02_075644_create_hrm_settings_table","49");
INSERT INTO migrations VALUES("76","2019_01_02_090334_create_attendances_table","50");
INSERT INTO migrations VALUES("77","2019_01_27_160956_add_three_columns_to_general_settings_table","51");
INSERT INTO migrations VALUES("78","2019_02_15_183303_create_stock_counts_table","52");
INSERT INTO migrations VALUES("79","2019_02_17_101604_add_is_adjusted_to_stock_counts_table","53");
INSERT INTO migrations VALUES("80","2019_04_13_101707_add_tax_no_to_customers_table","54");
INSERT INTO migrations VALUES("81","2019_10_14_111455_create_holidays_table","55");
INSERT INTO migrations VALUES("82","2019_11_13_145619_add_is_variant_to_products_table","56");
INSERT INTO migrations VALUES("83","2019_11_13_150206_create_product_variants_table","57");
INSERT INTO migrations VALUES("84","2019_11_13_153828_create_variants_table","57");
INSERT INTO migrations VALUES("85","2019_11_25_134041_add_qty_to_product_variants_table","58");
INSERT INTO migrations VALUES("86","2019_11_25_134922_add_variant_id_to_product_purchases_table","58");
INSERT INTO migrations VALUES("87","2019_11_25_145341_add_variant_id_to_product_warehouse_table","58");
INSERT INTO migrations VALUES("88","2019_11_29_182201_add_variant_id_to_product_sales_table","59");
INSERT INTO migrations VALUES("89","2019_12_04_121311_add_variant_id_to_product_quotation_table","60");
INSERT INTO migrations VALUES("90","2019_12_05_123802_add_variant_id_to_product_transfer_table","61");
INSERT INTO migrations VALUES("91","2019_12_08_114954_add_variant_id_to_product_returns_table","62");
INSERT INTO migrations VALUES("92","2019_12_08_203146_add_variant_id_to_purchase_product_return_table","63");
INSERT INTO migrations VALUES("93","2020_02_28_103340_create_money_transfers_table","64");
INSERT INTO migrations VALUES("94","2020_07_01_193151_add_image_to_categories_table","65");
INSERT INTO migrations VALUES("95","2020_09_26_130426_add_user_id_to_deliveries_table","66");
INSERT INTO migrations VALUES("96","2020_10_11_125457_create_cash_registers_table","67");
INSERT INTO migrations VALUES("97","2020_10_13_155019_add_cash_register_id_to_sales_table","68");
INSERT INTO migrations VALUES("98","2020_10_13_172624_add_cash_register_id_to_returns_table","69");
INSERT INTO migrations VALUES("99","2020_10_17_212338_add_cash_register_id_to_payments_table","70");
INSERT INTO migrations VALUES("100","2020_10_18_124200_add_cash_register_id_to_expenses_table","71");
INSERT INTO migrations VALUES("101","2020_10_21_121632_add_developed_by_to_general_settings_table","72");
INSERT INTO migrations VALUES("102","2019_08_19_000000_create_failed_jobs_table","73");
INSERT INTO migrations VALUES("103","2020_10_30_135557_create_notifications_table","73");
INSERT INTO migrations VALUES("104","2020_11_01_044954_create_currencies_table","74");
INSERT INTO migrations VALUES("105","2020_11_01_140736_add_price_to_product_warehouse_table","75");
INSERT INTO migrations VALUES("106","2020_11_02_050633_add_is_diff_price_to_products_table","76");
INSERT INTO migrations VALUES("107","2020_11_09_055222_add_user_id_to_customers_table","77");
INSERT INTO migrations VALUES("108","2020_11_17_054806_add_invoice_format_to_general_settings_table","78");
INSERT INTO migrations VALUES("109","2021_02_10_074859_add_variant_id_to_product_adjustments_table","79");
INSERT INTO migrations VALUES("110","2021_03_07_093606_create_product_batches_table","80");
INSERT INTO migrations VALUES("111","2021_03_07_093759_add_product_batch_id_to_product_warehouse_table","80");
INSERT INTO migrations VALUES("112","2021_03_07_093900_add_product_batch_id_to_product_purchases_table","80");
INSERT INTO migrations VALUES("113","2021_03_11_132603_add_product_batch_id_to_product_sales_table","81");
INSERT INTO migrations VALUES("114","2021_03_25_125421_add_is_batch_to_products_table","82");
INSERT INTO migrations VALUES("115","2021_05_19_120127_add_product_batch_id_to_product_returns_table","82");
INSERT INTO migrations VALUES("116","2021_05_22_105611_add_product_batch_id_to_purchase_product_return_table","83");
INSERT INTO migrations VALUES("117","2021_05_23_124848_add_product_batch_id_to_product_transfer_table","84");
INSERT INTO migrations VALUES("118","2021_05_26_153106_add_product_batch_id_to_product_quotation_table","85");
INSERT INTO migrations VALUES("119","2021_06_08_213007_create_reward_point_settings_table","86");
INSERT INTO migrations VALUES("120","2021_06_16_104155_add_points_to_customers_table","87");
INSERT INTO migrations VALUES("121","2021_06_17_101057_add_used_points_to_payments_table","88");
INSERT INTO migrations VALUES("122","2021_07_06_132716_add_variant_list_to_products_table","89");
INSERT INTO migrations VALUES("123","2021_09_27_161141_add_is_imei_to_products_table","90");
INSERT INTO migrations VALUES("124","2021_09_28_170052_add_imei_number_to_product_warehouse_table","91");
INSERT INTO migrations VALUES("125","2021_09_28_170126_add_imei_number_to_product_purchases_table","91");
INSERT INTO migrations VALUES("126","2021_10_03_170652_add_imei_number_to_product_sales_table","92");
INSERT INTO migrations VALUES("127","2021_10_10_145214_add_imei_number_to_product_returns_table","93");
INSERT INTO migrations VALUES("128","2021_10_11_104504_add_imei_number_to_product_transfer_table","94");
INSERT INTO migrations VALUES("129","2021_10_12_160107_add_imei_number_to_purchase_product_return_table","95");
INSERT INTO migrations VALUES("130","2021_10_12_205146_add_is_rtl_to_general_settings_table","96");
INSERT INTO migrations VALUES("131","2021_10_23_142451_add_is_approve_to_payments_table","97");
INSERT INTO migrations VALUES("132","2022_01_13_191242_create_discount_plans_table","97");
INSERT INTO migrations VALUES("133","2022_01_14_174318_create_discount_plan_customers_table","97");
INSERT INTO migrations VALUES("134","2022_01_14_202439_create_discounts_table","98");
INSERT INTO migrations VALUES("135","2022_01_16_153506_create_discount_plan_discounts_table","98");
INSERT INTO migrations VALUES("136","2022_02_05_174210_add_order_discount_type_and_value_to_sales_table","99");
INSERT INTO migrations VALUES("137","2022_05_26_195506_add_daily_sale_objective_to_products_table","100");
INSERT INTO migrations VALUES("138","2022_05_28_104209_create_dso_alerts_table","101");
INSERT INTO migrations VALUES("139","2022_06_01_112100_add_is_embeded_to_products_table","102");
INSERT INTO migrations VALUES("140","2022_06_14_130505_add_sale_id_to_returns_table","103");
INSERT INTO migrations VALUES("141","2022_07_19_115504_add_variant_data_to_products_table","104");
INSERT INTO migrations VALUES("142","2022_07_25_194300_add_additional_cost_to_product_variants_table","104");
INSERT INTO migrations VALUES("143","2022_09_04_195610_add_purchase_id_to_return_purchases_table","105");
INSERT INTO migrations VALUES("144","2023_01_18_123842_alter_table_pos_setting","106");
INSERT INTO migrations VALUES("145","2023_01_18_125040_alter_table_general_settings","107");
INSERT INTO migrations VALUES("146","2023_01_18_133701_alter_table_pos_setting","108");
INSERT INTO migrations VALUES("147","2023_01_25_145309_add_expiry_date_to_general_settings_table","109");
INSERT INTO migrations VALUES("148","2023_02_23_125656_alter_table_sales","110");
INSERT INTO migrations VALUES("149","2023_02_26_124100_add_package_id_to_general_settings_table","111");
INSERT INTO migrations VALUES("150","2023_03_04_120325_create_custom_fields_table","111");
INSERT INTO migrations VALUES("151","2023_03_22_174352_add_currency_id_and_exchange_rate_to_returns_table","112");
INSERT INTO migrations VALUES("152","2023_03_27_114320_add_currency_id_and_exchange_rate_to_purchases_table","113");
INSERT INTO migrations VALUES("153","2023_03_27_132747_add_currency_id_and_exchange_rate_to_return_purchases_table","114");
INSERT INTO migrations VALUES("154","2023_04_25_150236_create_mail_settings_table","115");
INSERT INTO migrations VALUES("155","2023_05_13_125424_add_zatca_to_general_settings_table","116");
INSERT INTO migrations VALUES("156","2023_05_28_155540_create_tables_table","117");
INSERT INTO migrations VALUES("157","2023_05_29_115039_add_is_table_to_pos_setting_table","117");
INSERT INTO migrations VALUES("158","2023_05_29_115301_add_table_id_to_sales_table","117");
INSERT INTO migrations VALUES("159","2023_05_31_165049_add_queue_no_to_sales_table","117");
INSERT INTO migrations VALUES("160","2023_06_19_153445_add_muri_kha_to_sales_table","117");
INSERT INTO migrations VALUES("161","2023_06_12_161041_add_state_to_sales_table","118");
INSERT INTO migrations VALUES("162","2023_07_23_160254_create_couriers_table","118");
INSERT INTO migrations VALUES("163","2023_07_23_174343_add_courier_id_to_deliveries_table","118");
INSERT INTO migrations VALUES("164","2023_08_14_142608_add_is_active_to_currencies_table","118");
INSERT INTO migrations VALUES("165","2023_08_12_124016_add_staff_id_to_employees_table","119");
INSERT INTO migrations VALUES("166","2023_08_24_130203_change_columns_to_attendances_table","119");
INSERT INTO migrations VALUES("167","2023_09_10_134503_add_without_stock_to_general_settings_table","119");
INSERT INTO migrations VALUES("168","2026_07_14_090000_add_chart_of_account_id_to_expense_categories_table","120");
INSERT INTO migrations VALUES("169","2026_07_11_090000_create_chart_of_accounts_table","121");
INSERT INTO migrations VALUES("170","2026_07_11_090100_create_journals_table","121");
INSERT INTO migrations VALUES("171","2026_07_11_090200_create_journal_details_table","121");
INSERT INTO migrations VALUES("172","2026_07_11_090300_add_chart_of_account_id_to_accounts_table","121");
INSERT INTO migrations VALUES("173","2026_07_14_090100_add_is_cash_account_to_chart_of_accounts_table","121");
INSERT INTO migrations VALUES("174","2026_07_14_120000_add_selisih_kasir_account","121");
INSERT INTO migrations VALUES("175","2026_07_16_090000_add_purchase_discount_and_shipping_accounts","121");



CREATE TABLE `money_transfers` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `reference_no` varchar(191) NOT NULL,
  `from_account_id` int(11) NOT NULL,
  `to_account_id` int(11) NOT NULL,
  `amount` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




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,
  PRIMARY KEY (`id`),
  KEY `notifications_notifiable_type_notifiable_id_index` (`notifiable_type`,`notifiable_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `payment_with_cheque` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `payment_id` int(11) NOT NULL,
  `cheque_no` varchar(191) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `payment_with_credit_card` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `payment_id` int(11) NOT NULL,
  `customer_id` int(11) DEFAULT NULL,
  `customer_stripe_id` varchar(191) DEFAULT NULL,
  `charge_id` varchar(191) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `payment_with_gift_card` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `payment_id` int(11) NOT NULL,
  `gift_card_id` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `payment_with_paypal` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `payment_id` int(11) NOT NULL,
  `transaction_id` varchar(191) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `payments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `payment_reference` varchar(191) NOT NULL,
  `user_id` int(11) NOT NULL,
  `purchase_id` int(11) DEFAULT NULL,
  `sale_id` int(11) DEFAULT NULL,
  `cash_register_id` int(11) DEFAULT NULL,
  `account_id` int(11) NOT NULL,
  `payment_receiver` varchar(255) DEFAULT NULL,
  `amount` double NOT NULL,
  `used_points` double DEFAULT NULL,
  `change` double NOT NULL,
  `paying_method` varchar(191) NOT NULL,
  `payment_note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `payrolls` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `reference_no` varchar(191) NOT NULL,
  `employee_id` int(11) NOT NULL,
  `account_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `amount` double NOT NULL,
  `paying_method` varchar(191) NOT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




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

INSERT INTO permissions VALUES("4","products-edit","web","2018-06-03 08:00:09","2018-06-03 08:00:09");
INSERT INTO permissions VALUES("5","products-delete","web","2018-06-04 05:54:22","2018-06-04 05:54:22");
INSERT INTO permissions VALUES("6","products-add","web","2018-06-04 07:34:14","2018-06-04 07:34:14");
INSERT INTO permissions VALUES("7","products-index","web","2018-06-04 10:34:27","2018-06-04 10:34:27");
INSERT INTO permissions VALUES("8","purchases-index","web","2018-06-04 15:03:19","2018-06-04 15:03:19");
INSERT INTO permissions VALUES("9","purchases-add","web","2018-06-04 15:12:25","2018-06-04 15:12:25");
INSERT INTO permissions VALUES("10","purchases-edit","web","2018-06-04 16:47:36","2018-06-04 16:47:36");
INSERT INTO permissions VALUES("11","purchases-delete","web","2018-06-04 16:47:36","2018-06-04 16:47:36");
INSERT INTO permissions VALUES("12","sales-index","web","2018-06-04 17:49:08","2018-06-04 17:49:08");
INSERT INTO permissions VALUES("13","sales-add","web","2018-06-04 17:49:52","2018-06-04 17:49:52");
INSERT INTO permissions VALUES("14","sales-edit","web","2018-06-04 17:49:52","2018-06-04 17:49:52");
INSERT INTO permissions VALUES("15","sales-delete","web","2018-06-04 17:49:53","2018-06-04 17:49:53");
INSERT INTO permissions VALUES("16","quotes-index","web","2018-06-05 05:05:10","2018-06-05 05:05:10");
INSERT INTO permissions VALUES("17","quotes-add","web","2018-06-05 05:05:10","2018-06-05 05:05:10");
INSERT INTO permissions VALUES("18","quotes-edit","web","2018-06-05 05:05:10","2018-06-05 05:05:10");
INSERT INTO permissions VALUES("19","quotes-delete","web","2018-06-05 05:05:10","2018-06-05 05:05:10");
INSERT INTO permissions VALUES("20","transfers-index","web","2018-06-05 05:30:03","2018-06-05 05:30:03");
INSERT INTO permissions VALUES("21","transfers-add","web","2018-06-05 05:30:03","2018-06-05 05:30:03");
INSERT INTO permissions VALUES("22","transfers-edit","web","2018-06-05 05:30:03","2018-06-05 05:30:03");
INSERT INTO permissions VALUES("23","transfers-delete","web","2018-06-05 05:30:03","2018-06-05 05:30:03");
INSERT INTO permissions VALUES("24","returns-index","web","2018-06-05 05:50:24","2018-06-05 05:50:24");
INSERT INTO permissions VALUES("25","returns-add","web","2018-06-05 05:50:24","2018-06-05 05:50:24");
INSERT INTO permissions VALUES("26","returns-edit","web","2018-06-05 05:50:25","2018-06-05 05:50:25");
INSERT INTO permissions VALUES("27","returns-delete","web","2018-06-05 05:50:25","2018-06-05 05:50:25");
INSERT INTO permissions VALUES("28","customers-index","web","2018-06-05 06:15:54","2018-06-05 06:15:54");
INSERT INTO permissions VALUES("29","customers-add","web","2018-06-05 06:15:55","2018-06-05 06:15:55");
INSERT INTO permissions VALUES("30","customers-edit","web","2018-06-05 06:15:55","2018-06-05 06:15:55");
INSERT INTO permissions VALUES("31","customers-delete","web","2018-06-05 06:15:55","2018-06-05 06:15:55");
INSERT INTO permissions VALUES("32","suppliers-index","web","2018-06-05 06:40:12","2018-06-05 06:40:12");
INSERT INTO permissions VALUES("33","suppliers-add","web","2018-06-05 06:40:12","2018-06-05 06:40:12");
INSERT INTO permissions VALUES("34","suppliers-edit","web","2018-06-05 06:40:12","2018-06-05 06:40:12");
INSERT INTO permissions VALUES("35","suppliers-delete","web","2018-06-05 06:40:12","2018-06-05 06:40:12");
INSERT INTO permissions VALUES("36","product-report","web","2018-06-25 06:05:33","2018-06-25 06:05:33");
INSERT INTO permissions VALUES("37","purchase-report","web","2018-06-25 06:24:56","2018-06-25 06:24:56");
INSERT INTO permissions VALUES("38","sale-report","web","2018-06-25 06:33:13","2018-06-25 06:33:13");
INSERT INTO permissions VALUES("39","customer-report","web","2018-06-25 06:36:51","2018-06-25 06:36:51");
INSERT INTO permissions VALUES("40","due-report","web","2018-06-25 06:39:52","2018-06-25 06:39:52");
INSERT INTO permissions VALUES("41","users-index","web","2018-06-25 07:00:10","2018-06-25 07:00:10");
INSERT INTO permissions VALUES("42","users-add","web","2018-06-25 07:00:10","2018-06-25 07:00:10");
INSERT INTO permissions VALUES("43","users-edit","web","2018-06-25 07:01:30","2018-06-25 07:01:30");
INSERT INTO permissions VALUES("44","users-delete","web","2018-06-25 07:01:30","2018-06-25 07:01:30");
INSERT INTO permissions VALUES("45","profit-loss","web","2018-07-15 04:50:05","2018-07-15 04:50:05");
INSERT INTO permissions VALUES("46","best-seller","web","2018-07-15 05:01:38","2018-07-15 05:01:38");
INSERT INTO permissions VALUES("47","daily-sale","web","2018-07-15 05:24:21","2018-07-15 05:24:21");
INSERT INTO permissions VALUES("48","monthly-sale","web","2018-07-15 05:30:41","2018-07-15 05:30:41");
INSERT INTO permissions VALUES("49","daily-purchase","web","2018-07-15 05:36:46","2018-07-15 05:36:46");
INSERT INTO permissions VALUES("50","monthly-purchase","web","2018-07-15 05:48:17","2018-07-15 05:48:17");
INSERT INTO permissions VALUES("51","payment-report","web","2018-07-15 06:10:41","2018-07-15 06:10:41");
INSERT INTO permissions VALUES("52","warehouse-stock-report","web","2018-07-15 06:16:55","2018-07-15 06:16:55");
INSERT INTO permissions VALUES("53","product-qty-alert","web","2018-07-15 06:33:21","2018-07-15 06:33:21");
INSERT INTO permissions VALUES("54","supplier-report","web","2018-07-30 10:00:01","2018-07-30 10:00:01");
INSERT INTO permissions VALUES("55","expenses-index","web","2018-09-05 08:07:10","2018-09-05 08:07:10");
INSERT INTO permissions VALUES("56","expenses-add","web","2018-09-05 08:07:10","2018-09-05 08:07:10");
INSERT INTO permissions VALUES("57","expenses-edit","web","2018-09-05 08:07:10","2018-09-05 08:07:10");
INSERT INTO permissions VALUES("58","expenses-delete","web","2018-09-05 08:07:11","2018-09-05 08:07:11");
INSERT INTO permissions VALUES("59","general_setting","web","2018-10-20 06:10:04","2018-10-20 06:10:04");
INSERT INTO permissions VALUES("60","mail_setting","web","2018-10-20 06:10:04","2018-10-20 06:10:04");
INSERT INTO permissions VALUES("61","pos_setting","web","2018-10-20 06:10:04","2018-10-20 06:10:04");
INSERT INTO permissions VALUES("62","hrm_setting","web","2019-01-02 17:30:23","2019-01-02 17:30:23");
INSERT INTO permissions VALUES("63","purchase-return-index","web","2019-01-03 04:45:14","2019-01-03 04:45:14");
INSERT INTO permissions VALUES("64","purchase-return-add","web","2019-01-03 04:45:14","2019-01-03 04:45:14");
INSERT INTO permissions VALUES("65","purchase-return-edit","web","2019-01-03 04:45:14","2019-01-03 04:45:14");
INSERT INTO permissions VALUES("66","purchase-return-delete","web","2019-01-03 04:45:14","2019-01-03 04:45:14");
INSERT INTO permissions VALUES("67","account-index","web","2019-01-03 05:06:13","2019-01-03 05:06:13");
INSERT INTO permissions VALUES("68","balance-sheet","web","2019-01-03 05:06:14","2019-01-03 05:06:14");
INSERT INTO permissions VALUES("69","account-statement","web","2019-01-03 05:06:14","2019-01-03 05:06:14");
INSERT INTO permissions VALUES("70","department","web","2019-01-03 05:30:01","2019-01-03 05:30:01");
INSERT INTO permissions VALUES("71","attendance","web","2019-01-03 05:30:01","2019-01-03 05:30:01");
INSERT INTO permissions VALUES("72","payroll","web","2019-01-03 05:30:01","2019-01-03 05:30:01");
INSERT INTO permissions VALUES("73","employees-index","web","2019-01-03 05:52:19","2019-01-03 05:52:19");
INSERT INTO permissions VALUES("74","employees-add","web","2019-01-03 05:52:19","2019-01-03 05:52:19");
INSERT INTO permissions VALUES("75","employees-edit","web","2019-01-03 05:52:19","2019-01-03 05:52:19");
INSERT INTO permissions VALUES("76","employees-delete","web","2019-01-03 05:52:19","2019-01-03 05:52:19");
INSERT INTO permissions VALUES("77","user-report","web","2019-01-16 13:48:18","2019-01-16 13:48:18");
INSERT INTO permissions VALUES("78","stock_count","web","2019-02-17 17:32:01","2019-02-17 17:32:01");
INSERT INTO permissions VALUES("79","adjustment","web","2019-02-17 17:32:02","2019-02-17 17:32:02");
INSERT INTO permissions VALUES("80","sms_setting","web","2019-02-22 12:18:03","2019-02-22 12:18:03");
INSERT INTO permissions VALUES("81","create_sms","web","2019-02-22 12:18:03","2019-02-22 12:18:03");
INSERT INTO permissions VALUES("82","print_barcode","web","2019-03-07 12:02:19","2019-03-07 12:02:19");
INSERT INTO permissions VALUES("83","empty_database","web","2019-03-07 12:02:19","2019-03-07 12:02:19");
INSERT INTO permissions VALUES("84","customer_group","web","2019-03-07 12:37:15","2019-03-07 12:37:15");
INSERT INTO permissions VALUES("85","unit","web","2019-03-07 12:37:15","2019-03-07 12:37:15");
INSERT INTO permissions VALUES("86","tax","web","2019-03-07 12:37:15","2019-03-07 12:37:15");
INSERT INTO permissions VALUES("87","gift_card","web","2019-03-07 13:29:38","2019-03-07 13:29:38");
INSERT INTO permissions VALUES("88","coupon","web","2019-03-07 13:29:38","2019-03-07 13:29:38");
INSERT INTO permissions VALUES("89","holiday","web","2019-10-19 15:57:15","2019-10-19 15:57:15");
INSERT INTO permissions VALUES("90","warehouse-report","web","2019-10-22 13:00:23","2019-10-22 13:00:23");
INSERT INTO permissions VALUES("91","warehouse","web","2020-02-26 13:47:32","2020-02-26 13:47:32");
INSERT INTO permissions VALUES("92","brand","web","2020-02-26 13:59:59","2020-02-26 13:59:59");
INSERT INTO permissions VALUES("93","billers-index","web","2020-02-26 14:11:15","2020-02-26 14:11:15");
INSERT INTO permissions VALUES("94","billers-add","web","2020-02-26 14:11:15","2020-02-26 14:11:15");
INSERT INTO permissions VALUES("95","billers-edit","web","2020-02-26 14:11:15","2020-02-26 14:11:15");
INSERT INTO permissions VALUES("96","billers-delete","web","2020-02-26 14:11:15","2020-02-26 14:11:15");
INSERT INTO permissions VALUES("97","money-transfer","web","2020-03-02 12:41:48","2020-03-02 12:41:48");
INSERT INTO permissions VALUES("98","category","web","2020-07-13 19:13:16","2020-07-13 19:13:16");
INSERT INTO permissions VALUES("99","delivery","web","2020-07-13 19:13:16","2020-07-13 19:13:16");
INSERT INTO permissions VALUES("100","send_notification","web","2020-10-31 13:21:31","2020-10-31 13:21:31");
INSERT INTO permissions VALUES("101","today_sale","web","2020-10-31 13:57:04","2020-10-31 13:57:04");
INSERT INTO permissions VALUES("102","today_profit","web","2020-10-31 13:57:04","2020-10-31 13:57:04");
INSERT INTO permissions VALUES("103","currency","web","2020-11-09 07:23:11","2020-11-09 07:23:11");
INSERT INTO permissions VALUES("104","backup_database","web","2020-11-15 07:16:55","2020-11-15 07:16:55");
INSERT INTO permissions VALUES("105","reward_point_setting","web","2021-06-27 11:34:42","2021-06-27 11:34:42");
INSERT INTO permissions VALUES("106","revenue_profit_summary","web","2022-02-08 20:57:21","2022-02-08 20:57:21");
INSERT INTO permissions VALUES("107","cash_flow","web","2022-02-08 20:57:22","2022-02-08 20:57:22");
INSERT INTO permissions VALUES("108","monthly_summary","web","2022-02-08 20:57:22","2022-02-08 20:57:22");
INSERT INTO permissions VALUES("109","yearly_report","web","2022-02-08 20:57:22","2022-02-08 20:57:22");
INSERT INTO permissions VALUES("110","discount_plan","web","2022-02-16 16:12:26","2022-02-16 16:12:26");
INSERT INTO permissions VALUES("111","discount","web","2022-02-16 16:12:38","2022-02-16 16:12:38");
INSERT INTO permissions VALUES("112","product-expiry-report","web","2022-03-30 12:39:20","2022-03-30 12:39:20");
INSERT INTO permissions VALUES("113","purchase-payment-index","web","2022-06-05 21:12:27","2022-06-05 21:12:27");
INSERT INTO permissions VALUES("114","purchase-payment-add","web","2022-06-05 21:12:28","2022-06-05 21:12:28");
INSERT INTO permissions VALUES("115","purchase-payment-edit","web","2022-06-05 21:12:28","2022-06-05 21:12:28");
INSERT INTO permissions VALUES("116","purchase-payment-delete","web","2022-06-05 21:12:28","2022-06-05 21:12:28");
INSERT INTO permissions VALUES("117","sale-payment-index","web","2022-06-05 21:12:28","2022-06-05 21:12:28");
INSERT INTO permissions VALUES("118","sale-payment-add","web","2022-06-05 21:12:28","2022-06-05 21:12:28");
INSERT INTO permissions VALUES("119","sale-payment-edit","web","2022-06-05 21:12:28","2022-06-05 21:12:28");
INSERT INTO permissions VALUES("120","sale-payment-delete","web","2022-06-05 21:12:28","2022-06-05 21:12:28");
INSERT INTO permissions VALUES("121","all_notification","web","2022-06-05 21:12:29","2022-06-05 21:12:29");
INSERT INTO permissions VALUES("122","sale-report-chart","web","2022-06-05 21:12:29","2022-06-05 21:12:29");
INSERT INTO permissions VALUES("123","dso-report","web","2022-06-05 21:12:29","2022-06-05 21:12:29");
INSERT INTO permissions VALUES("124","product_history","web","2022-08-25 21:04:05","2022-08-25 21:04:05");
INSERT INTO permissions VALUES("125","supplier-due-report","web","2022-08-31 16:46:33","2022-08-31 16:46:33");
INSERT INTO permissions VALUES("126","custom_field","web","2023-05-02 14:41:35","2023-05-02 14:41:35");
INSERT INTO permissions VALUES("127","chart-of-account-index","web","2026-07-11 22:00:17","2026-07-11 22:00:17");
INSERT INTO permissions VALUES("128","journal-index","web","2026-07-11 22:00:18","2026-07-11 22:00:18");
INSERT INTO permissions VALUES("129","journal-add","web","2026-07-11 22:00:18","2026-07-11 22:00:18");
INSERT INTO permissions VALUES("130","journal-edit","web","2026-07-11 22:00:19","2026-07-11 22:00:19");
INSERT INTO permissions VALUES("131","general-ledger","web","2026-07-11 22:00:19","2026-07-11 22:00:19");
INSERT INTO permissions VALUES("132","trial-balance","web","2026-07-11 22:00:19","2026-07-11 22:00:19");
INSERT INTO permissions VALUES("133","cash_register-index","web","2026-08-07 10:40:06","2026-08-07 10:40:06");
INSERT INTO permissions VALUES("134","cash_register-add","web","2026-08-07 10:40:06","2026-08-07 10:40:06");
INSERT INTO permissions VALUES("135","cash_register-edit","web","2026-08-07 10:40:06","2026-08-07 10:40:06");
INSERT INTO permissions VALUES("136","cash_register-delete","web","2026-08-07 10:40:06","2026-08-07 10:40:06");



CREATE TABLE `product_adjustments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `adjustment_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `rack_id` int(11) DEFAULT NULL,
  `variant_id` int(11) DEFAULT NULL,
  `unit_cost` double DEFAULT NULL,
  `qty` double NOT NULL,
  `action` varchar(191) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `product_batches` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(11) NOT NULL,
  `batch_no` varchar(191) NOT NULL,
  `expired_date` date NOT NULL,
  `qty` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `product_purchases` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `purchase_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `product_batch_id` int(11) DEFAULT NULL,
  `variant_id` int(11) DEFAULT NULL,
  `imei_number` text DEFAULT NULL,
  `qty` double NOT NULL,
  `recieved` double NOT NULL,
  `purchase_unit_id` int(11) NOT NULL,
  `net_unit_cost` double NOT NULL,
  `discount` double NOT NULL,
  `tax_rate` double NOT NULL,
  `tax` double NOT NULL,
  `total` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `product_quotation` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `quotation_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `product_batch_id` int(11) DEFAULT NULL,
  `variant_id` int(11) DEFAULT NULL,
  `qty` double NOT NULL,
  `sale_unit_id` int(11) NOT NULL,
  `net_unit_price` double NOT NULL,
  `discount` double NOT NULL,
  `tax_rate` double NOT NULL,
  `tax` double NOT NULL,
  `total` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `product_returns` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `return_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `product_batch_id` int(11) DEFAULT NULL,
  `variant_id` int(11) DEFAULT NULL,
  `imei_number` text DEFAULT NULL,
  `qty` double NOT NULL,
  `sale_unit_id` int(11) NOT NULL,
  `net_unit_price` double NOT NULL,
  `discount` double NOT NULL,
  `tax_rate` double NOT NULL,
  `tax` double NOT NULL,
  `total` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `product_sales` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sale_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `product_batch_id` int(11) DEFAULT NULL,
  `variant_id` int(11) DEFAULT NULL,
  `imei_number` text DEFAULT NULL,
  `qty` double NOT NULL,
  `return_qty` double DEFAULT 0,
  `sale_unit_id` int(11) NOT NULL,
  `net_unit_price` double NOT NULL,
  `discount` double NOT NULL,
  `tax_rate` double NOT NULL,
  `tax` double NOT NULL,
  `total` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `product_transfer` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `transfer_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `product_batch_id` int(11) DEFAULT NULL,
  `variant_id` int(11) DEFAULT NULL,
  `imei_number` text DEFAULT NULL,
  `qty` double NOT NULL,
  `purchase_unit_id` int(11) NOT NULL,
  `net_unit_cost` double NOT NULL,
  `tax_rate` double NOT NULL,
  `tax` double NOT NULL,
  `total` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `product_unit_price_levels` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_unit_id` int(11) NOT NULL,
  `customer_group_id` int(11) NOT NULL,
  `markup_percent` double DEFAULT NULL,
  `price` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `pupl_unit_group_unique` (`product_unit_id`,`customer_group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;




CREATE TABLE `product_unit_price_tiers` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_unit_id` int(11) NOT NULL,
  `tier_no` tinyint(3) unsigned NOT NULL,
  `min_qty` double DEFAULT NULL,
  `markup_percent` double DEFAULT NULL,
  `price` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `puptier_unit_tier_unique` (`product_unit_id`,`tier_no`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO product_unit_price_tiers VALUES("1","1","1","3","7","16852.5","2026-08-07 19:05:41","2026-08-07 19:05:41");
INSERT INTO product_unit_price_tiers VALUES("2","1","2","6","7","16852.5","2026-08-07 19:05:41","2026-08-07 19:05:41");
INSERT INTO product_unit_price_tiers VALUES("3","1","3","12","5","16537.5","2026-08-07 19:05:41","2026-08-07 19:05:41");
INSERT INTO product_unit_price_tiers VALUES("4","1","4","24","4.5","16458.75","2026-08-07 19:05:41","2026-08-07 19:05:41");
INSERT INTO product_unit_price_tiers VALUES("5","2","1","3","10","4331.25","2026-08-07 19:05:41","2026-08-07 19:05:41");
INSERT INTO product_unit_price_tiers VALUES("6","2","2","6","9","4291.88","2026-08-07 19:05:41","2026-08-07 19:05:41");
INSERT INTO product_unit_price_tiers VALUES("7","2","3","12","8","4252.5","2026-08-07 19:05:41","2026-08-07 19:05:41");
INSERT INTO product_unit_price_tiers VALUES("8","2","4","24","7","4213.13","2026-08-07 19:05:41","2026-08-07 19:05:41");
INSERT INTO product_unit_price_tiers VALUES("9","3","1","3","8","8505","2026-08-07 19:05:42","2026-08-07 19:05:42");
INSERT INTO product_unit_price_tiers VALUES("10","3","2","6","7.5","8465.63","2026-08-07 19:05:42","2026-08-07 19:05:42");
INSERT INTO product_unit_price_tiers VALUES("11","3","3","12","7","8426.25","2026-08-07 19:05:42","2026-08-07 19:05:42");
INSERT INTO product_unit_price_tiers VALUES("12","3","4","24","5","8268.75","2026-08-07 19:05:42","2026-08-07 19:05:42");
INSERT INTO product_unit_price_tiers VALUES("13","5","1","3","50","484.38","2026-08-07 19:11:52","2026-08-07 19:11:52");
INSERT INTO product_unit_price_tiers VALUES("14","5","2","6","25","403.65","2026-08-07 19:11:52","2026-08-07 19:11:52");
INSERT INTO product_unit_price_tiers VALUES("15","5","3","12","20","387.5","2026-08-07 19:11:52","2026-08-07 19:11:52");
INSERT INTO product_unit_price_tiers VALUES("16","5","4","24","15","371.36","2026-08-07 19:11:52","2026-08-07 19:11:52");
INSERT INTO product_unit_price_tiers VALUES("17","6","1","3","12","17360.18","2026-08-07 19:11:52","2026-08-07 19:11:52");
INSERT INTO product_unit_price_tiers VALUES("18","6","2","6","10","17050.18","2026-08-07 19:11:52","2026-08-07 19:11:52");
INSERT INTO product_unit_price_tiers VALUES("19","6","3","12","8","16740.17","2026-08-07 19:11:52","2026-08-07 19:11:52");
INSERT INTO product_unit_price_tiers VALUES("20","6","4","24","5","16275.17","2026-08-07 19:11:52","2026-08-07 19:11:52");
INSERT INTO product_unit_price_tiers VALUES("21","7","1","3","50","484.38","2026-08-07 19:12:27","2026-08-07 19:12:27");
INSERT INTO product_unit_price_tiers VALUES("22","7","2","6","25","403.65","2026-08-07 19:12:27","2026-08-07 19:12:27");
INSERT INTO product_unit_price_tiers VALUES("23","7","3","12","20","387.5","2026-08-07 19:12:27","2026-08-07 19:12:27");
INSERT INTO product_unit_price_tiers VALUES("24","7","4","24","15","371.36","2026-08-07 19:12:27","2026-08-07 19:12:27");
INSERT INTO product_unit_price_tiers VALUES("25","8","1","3","12","17360.18","2026-08-07 19:12:27","2026-08-07 19:12:27");
INSERT INTO product_unit_price_tiers VALUES("26","8","2","6","10","17050.18","2026-08-07 19:12:27","2026-08-07 19:12:27");
INSERT INTO product_unit_price_tiers VALUES("27","8","3","12","8","16740.17","2026-08-07 19:12:27","2026-08-07 19:12:27");
INSERT INTO product_unit_price_tiers VALUES("28","8","4","24","5","16275.17","2026-08-07 19:12:27","2026-08-07 19:12:27");
INSERT INTO product_unit_price_tiers VALUES("29","9","1","3","15","13110","2026-08-07 20:50:18","2026-08-07 20:50:18");
INSERT INTO product_unit_price_tiers VALUES("30","10","1","3","20","3420","2026-08-07 20:50:18","2026-08-07 20:50:18");
INSERT INTO product_unit_price_tiers VALUES("31","11","1","3","0","5700","2026-08-07 20:50:18","2026-08-07 20:50:18");



CREATE TABLE `product_units` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(11) NOT NULL,
  `unit_id` int(11) NOT NULL,
  `cost` double DEFAULT NULL,
  `markup_percent` double DEFAULT NULL,
  `price` double DEFAULT NULL,
  `point` double DEFAULT NULL,
  `commission` double DEFAULT NULL,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `product_units_product_id_unit_id_unique` (`product_id`,`unit_id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO product_units VALUES("1","1","1","15750","7.94","17000","1","0","0","2026-08-07 19:05:41","2026-08-07 19:05:41");
INSERT INTO product_units VALUES("2","1","2","3937.5","14.29","4500","0","0","1","2026-08-07 19:05:41","2026-08-07 19:05:41");
INSERT INTO product_units VALUES("3","1","3","7875","7.94","8500","0","0","2","2026-08-07 19:05:41","2026-08-07 19:05:41");
INSERT INTO product_units VALUES("4","1","4","787500","5","826875","50","0","3","2026-08-07 19:05:42","2026-08-07 19:05:42");
INSERT INTO product_units VALUES("5","2","5","322.92","54.84","500","0","0","0","2026-08-07 19:11:52","2026-08-07 19:11:52");
INSERT INTO product_units VALUES("6","2","6","15500.16","12.9","24000","0","0","1","2026-08-07 19:11:52","2026-08-07 19:11:52");
INSERT INTO product_units VALUES("7","3","5","322.92","54.84","500","0","0","0","2026-08-07 19:12:27","2026-08-07 19:12:27");
INSERT INTO product_units VALUES("8","3","6","15500.16","12.9","17500","0","0","1","2026-08-07 19:12:27","2026-08-07 19:57:31");
INSERT INTO product_units VALUES("9","4","1","11400","18.42","13500","0","0","0","2026-08-07 20:50:18","2026-08-07 20:50:18");
INSERT INTO product_units VALUES("10","4","2","2850","25","3562.5","0","0","1","2026-08-07 20:50:18","2026-08-07 20:50:18");
INSERT INTO product_units VALUES("11","4","3","5700","20","6840","0","0","2","2026-08-07 20:50:18","2026-08-07 20:50:18");



CREATE TABLE `product_variants` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` int(11) NOT NULL,
  `variant_id` int(11) NOT NULL,
  `position` int(11) NOT NULL,
  `item_code` varchar(191) NOT NULL,
  `additional_cost` double DEFAULT NULL,
  `additional_price` double DEFAULT NULL,
  `qty` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `product_warehouse` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `product_id` varchar(191) NOT NULL,
  `product_batch_id` int(11) DEFAULT NULL,
  `variant_id` int(11) DEFAULT NULL,
  `imei_number` text DEFAULT NULL,
  `warehouse_id` int(11) NOT NULL,
  `rack_id` int(11) DEFAULT NULL,
  `qty` double NOT NULL,
  `price` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `products` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `code` varchar(191) NOT NULL,
  `type` varchar(191) NOT NULL,
  `barcode_symbology` varchar(191) NOT NULL,
  `brand_id` int(11) DEFAULT NULL,
  `category_id` int(11) NOT NULL,
  `unit_id` int(11) NOT NULL,
  `purchase_unit_id` int(11) NOT NULL,
  `sale_unit_id` int(11) NOT NULL,
  `product_sale_unit_ids` text DEFAULT NULL,
  `cost` double NOT NULL,
  `price` double NOT NULL,
  `wholesale_price` double DEFAULT NULL,
  `price_mode` varchar(255) NOT NULL DEFAULT 'single',
  `markup_percent` double DEFAULT NULL,
  `point` double DEFAULT NULL,
  `commission` double DEFAULT NULL,
  `qty` double DEFAULT NULL,
  `alert_quantity` double DEFAULT NULL,
  `daily_sale_objective` double DEFAULT NULL,
  `promotion` tinyint(4) DEFAULT NULL,
  `promotion_price` varchar(191) DEFAULT NULL,
  `starting_date` varchar(200) DEFAULT NULL,
  `last_date` date DEFAULT NULL,
  `tax_id` int(11) DEFAULT NULL,
  `tax_method` int(11) DEFAULT NULL,
  `image` longtext DEFAULT NULL,
  `file` varchar(191) DEFAULT NULL,
  `is_embeded` tinyint(1) DEFAULT NULL,
  `is_variant` tinyint(1) DEFAULT NULL,
  `is_batch` tinyint(1) DEFAULT NULL,
  `is_diffPrice` tinyint(1) DEFAULT NULL,
  `is_imei` tinyint(1) DEFAULT NULL,
  `featured` tinyint(4) DEFAULT NULL,
  `product_list` varchar(191) DEFAULT NULL,
  `variant_list` varchar(191) DEFAULT NULL,
  `qty_list` varchar(191) DEFAULT NULL,
  `price_list` varchar(191) DEFAULT NULL,
  `product_details` text DEFAULT NULL,
  `variant_option` text DEFAULT NULL,
  `variant_value` text DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO products VALUES("1","GULA PASIR BAGUS","77098310","standard","C128","1","1","1","1","1","1,2,3,4","15750","17000","0","qty","7.94","1","0","0","","","","","","","","1","zummXD2dvAtI.png","","","","","","","","","","","","","","","1","2026-08-07 19:05:41","2026-08-07 19:05:42");
INSERT INTO products VALUES("2","AMDK P2S2 220 ML","260596","standard","C128","1","1","5","5","5","5,6","322.92","500","0","qty","54.84","0","0","0","","","","","","","","1","zummXD2dvAtI.png","","","","","","","","","","","","","","","1","2026-08-07 19:11:52","2026-08-07 19:11:52");
INSERT INTO products VALUES("3","AMDK A3 FRESH O2","260390","standard","C128","1","1","5","5","5","5,6","322.92","500","0","qty","54.84","0","0","0","","","","","","","","1","zummXD2dvAtI.png","","0","","","0","","0","","","","","","","","1","2026-08-07 19:12:27","2026-08-07 19:57:31");
INSERT INTO products VALUES("4","TEPUNG KANJI BIASA","39328407","standard","C128","1","1","1","1","2","1,2,3","11400","13500","0","qty","18.42","0","0","0","","","","","","","","1","zummXD2dvAtI.png","","","","","","","","","","","","","","","1","2026-08-07 20:50:18","2026-08-07 20:50:18");



CREATE TABLE `purchase_product_return` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `return_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `product_batch_id` int(11) DEFAULT NULL,
  `variant_id` int(11) DEFAULT NULL,
  `imei_number` text DEFAULT NULL,
  `qty` double NOT NULL,
  `purchase_unit_id` int(11) NOT NULL,
  `net_unit_cost` double NOT NULL,
  `discount` double NOT NULL,
  `tax_rate` double NOT NULL,
  `tax` double NOT NULL,
  `total` double NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `purchases` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `reference_no` varchar(191) NOT NULL,
  `user_id` int(11) NOT NULL,
  `warehouse_id` int(11) NOT NULL,
  `supplier_id` int(11) DEFAULT NULL,
  `currency_id` int(11) DEFAULT NULL,
  `exchange_rate` double DEFAULT NULL,
  `item` int(11) NOT NULL,
  `total_qty` double NOT NULL,
  `total_discount` double NOT NULL,
  `total_tax` double NOT NULL,
  `total_cost` double NOT NULL,
  `order_tax_rate` double DEFAULT NULL,
  `order_tax` double DEFAULT NULL,
  `order_discount` double DEFAULT NULL,
  `shipping_cost` double DEFAULT NULL,
  `grand_total` double NOT NULL,
  `paid_amount` double NOT NULL,
  `status` int(11) NOT NULL,
  `payment_status` int(11) NOT NULL,
  `document` varchar(191) DEFAULT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `quotations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `reference_no` varchar(191) NOT NULL,
  `user_id` int(11) NOT NULL,
  `biller_id` int(11) NOT NULL,
  `supplier_id` int(11) DEFAULT NULL,
  `customer_id` int(11) NOT NULL,
  `warehouse_id` int(11) NOT NULL,
  `item` int(11) NOT NULL,
  `total_qty` double NOT NULL,
  `total_discount` double NOT NULL,
  `total_tax` double NOT NULL,
  `total_price` double NOT NULL,
  `order_tax_rate` double DEFAULT NULL,
  `order_tax` double DEFAULT NULL,
  `order_discount` double DEFAULT NULL,
  `shipping_cost` double DEFAULT NULL,
  `grand_total` double NOT NULL,
  `quotation_status` int(11) NOT NULL,
  `document` varchar(191) DEFAULT NULL,
  `note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `racks` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `warehouse_id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;




CREATE TABLE `return_purchases` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `reference_no` varchar(191) NOT NULL,
  `supplier_id` int(11) DEFAULT NULL,
  `warehouse_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `purchase_id` int(11) DEFAULT NULL,
  `account_id` int(11) NOT NULL,
  `currency_id` int(11) DEFAULT NULL,
  `exchange_rate` double DEFAULT NULL,
  `item` int(11) NOT NULL,
  `total_qty` double NOT NULL,
  `total_discount` double NOT NULL,
  `total_tax` double NOT NULL,
  `total_cost` double NOT NULL,
  `order_tax_rate` double DEFAULT NULL,
  `order_tax` double DEFAULT NULL,
  `grand_total` double NOT NULL,
  `document` varchar(191) DEFAULT NULL,
  `return_note` text DEFAULT NULL,
  `staff_note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `returns` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `reference_no` varchar(191) NOT NULL,
  `user_id` int(11) NOT NULL,
  `sale_id` int(11) DEFAULT NULL,
  `cash_register_id` int(11) DEFAULT NULL,
  `customer_id` int(11) NOT NULL,
  `warehouse_id` int(11) NOT NULL,
  `biller_id` int(11) NOT NULL,
  `account_id` int(11) NOT NULL,
  `currency_id` int(11) DEFAULT NULL,
  `exchange_rate` double DEFAULT NULL,
  `item` int(11) NOT NULL,
  `total_qty` double NOT NULL,
  `total_discount` double NOT NULL,
  `total_tax` double NOT NULL,
  `total_price` double NOT NULL,
  `order_tax_rate` double DEFAULT NULL,
  `order_tax` double DEFAULT NULL,
  `grand_total` double NOT NULL,
  `document` varchar(191) DEFAULT NULL,
  `return_note` text DEFAULT NULL,
  `staff_note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `reward_point_settings` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `per_point_amount` double NOT NULL,
  `minimum_amount` double NOT NULL,
  `duration` int(11) DEFAULT NULL,
  `type` varchar(191) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO reward_point_settings VALUES("1","10","100","3","Month","1","","2023-08-09 02:07:14");



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

INSERT INTO role_has_permissions VALUES("4","1");
INSERT INTO role_has_permissions VALUES("4","2");
INSERT INTO role_has_permissions VALUES("4","6");
INSERT INTO role_has_permissions VALUES("4","7");
INSERT INTO role_has_permissions VALUES("5","1");
INSERT INTO role_has_permissions VALUES("5","2");
INSERT INTO role_has_permissions VALUES("6","1");
INSERT INTO role_has_permissions VALUES("6","2");
INSERT INTO role_has_permissions VALUES("6","6");
INSERT INTO role_has_permissions VALUES("6","7");
INSERT INTO role_has_permissions VALUES("7","1");
INSERT INTO role_has_permissions VALUES("7","2");
INSERT INTO role_has_permissions VALUES("7","3");
INSERT INTO role_has_permissions VALUES("7","4");
INSERT INTO role_has_permissions VALUES("7","5");
INSERT INTO role_has_permissions VALUES("7","6");
INSERT INTO role_has_permissions VALUES("7","7");
INSERT INTO role_has_permissions VALUES("8","1");
INSERT INTO role_has_permissions VALUES("8","2");
INSERT INTO role_has_permissions VALUES("8","3");
INSERT INTO role_has_permissions VALUES("8","6");
INSERT INTO role_has_permissions VALUES("9","1");
INSERT INTO role_has_permissions VALUES("9","2");
INSERT INTO role_has_permissions VALUES("9","3");
INSERT INTO role_has_permissions VALUES("9","6");
INSERT INTO role_has_permissions VALUES("9","7");
INSERT INTO role_has_permissions VALUES("10","1");
INSERT INTO role_has_permissions VALUES("10","2");
INSERT INTO role_has_permissions VALUES("11","1");
INSERT INTO role_has_permissions VALUES("11","2");
INSERT INTO role_has_permissions VALUES("12","1");
INSERT INTO role_has_permissions VALUES("12","2");
INSERT INTO role_has_permissions VALUES("12","3");
INSERT INTO role_has_permissions VALUES("13","1");
INSERT INTO role_has_permissions VALUES("13","2");
INSERT INTO role_has_permissions VALUES("13","3");
INSERT INTO role_has_permissions VALUES("13","6");
INSERT INTO role_has_permissions VALUES("13","7");
INSERT INTO role_has_permissions VALUES("14","1");
INSERT INTO role_has_permissions VALUES("14","2");
INSERT INTO role_has_permissions VALUES("14","7");
INSERT INTO role_has_permissions VALUES("15","1");
INSERT INTO role_has_permissions VALUES("15","2");
INSERT INTO role_has_permissions VALUES("16","1");
INSERT INTO role_has_permissions VALUES("16","2");
INSERT INTO role_has_permissions VALUES("17","1");
INSERT INTO role_has_permissions VALUES("17","2");
INSERT INTO role_has_permissions VALUES("18","1");
INSERT INTO role_has_permissions VALUES("18","2");
INSERT INTO role_has_permissions VALUES("19","1");
INSERT INTO role_has_permissions VALUES("19","2");
INSERT INTO role_has_permissions VALUES("20","1");
INSERT INTO role_has_permissions VALUES("20","2");
INSERT INTO role_has_permissions VALUES("20","3");
INSERT INTO role_has_permissions VALUES("20","5");
INSERT INTO role_has_permissions VALUES("21","1");
INSERT INTO role_has_permissions VALUES("21","2");
INSERT INTO role_has_permissions VALUES("21","3");
INSERT INTO role_has_permissions VALUES("21","5");
INSERT INTO role_has_permissions VALUES("21","6");
INSERT INTO role_has_permissions VALUES("21","7");
INSERT INTO role_has_permissions VALUES("22","1");
INSERT INTO role_has_permissions VALUES("22","2");
INSERT INTO role_has_permissions VALUES("22","3");
INSERT INTO role_has_permissions VALUES("22","5");
INSERT INTO role_has_permissions VALUES("23","1");
INSERT INTO role_has_permissions VALUES("23","2");
INSERT INTO role_has_permissions VALUES("24","1");
INSERT INTO role_has_permissions VALUES("24","2");
INSERT INTO role_has_permissions VALUES("24","3");
INSERT INTO role_has_permissions VALUES("24","7");
INSERT INTO role_has_permissions VALUES("25","1");
INSERT INTO role_has_permissions VALUES("25","2");
INSERT INTO role_has_permissions VALUES("25","3");
INSERT INTO role_has_permissions VALUES("25","6");
INSERT INTO role_has_permissions VALUES("25","7");
INSERT INTO role_has_permissions VALUES("26","1");
INSERT INTO role_has_permissions VALUES("26","2");
INSERT INTO role_has_permissions VALUES("27","1");
INSERT INTO role_has_permissions VALUES("27","2");
INSERT INTO role_has_permissions VALUES("28","1");
INSERT INTO role_has_permissions VALUES("28","2");
INSERT INTO role_has_permissions VALUES("28","3");
INSERT INTO role_has_permissions VALUES("29","1");
INSERT INTO role_has_permissions VALUES("29","2");
INSERT INTO role_has_permissions VALUES("29","3");
INSERT INTO role_has_permissions VALUES("30","1");
INSERT INTO role_has_permissions VALUES("30","2");
INSERT INTO role_has_permissions VALUES("31","1");
INSERT INTO role_has_permissions VALUES("31","2");
INSERT INTO role_has_permissions VALUES("32","1");
INSERT INTO role_has_permissions VALUES("32","2");
INSERT INTO role_has_permissions VALUES("32","5");
INSERT INTO role_has_permissions VALUES("33","1");
INSERT INTO role_has_permissions VALUES("33","2");
INSERT INTO role_has_permissions VALUES("33","5");
INSERT INTO role_has_permissions VALUES("34","1");
INSERT INTO role_has_permissions VALUES("34","2");
INSERT INTO role_has_permissions VALUES("34","5");
INSERT INTO role_has_permissions VALUES("35","1");
INSERT INTO role_has_permissions VALUES("35","2");
INSERT INTO role_has_permissions VALUES("35","5");
INSERT INTO role_has_permissions VALUES("36","1");
INSERT INTO role_has_permissions VALUES("36","2");
INSERT INTO role_has_permissions VALUES("37","1");
INSERT INTO role_has_permissions VALUES("37","2");
INSERT INTO role_has_permissions VALUES("38","1");
INSERT INTO role_has_permissions VALUES("38","2");
INSERT INTO role_has_permissions VALUES("38","5");
INSERT INTO role_has_permissions VALUES("39","1");
INSERT INTO role_has_permissions VALUES("39","2");
INSERT INTO role_has_permissions VALUES("39","5");
INSERT INTO role_has_permissions VALUES("40","1");
INSERT INTO role_has_permissions VALUES("40","2");
INSERT INTO role_has_permissions VALUES("40","5");
INSERT INTO role_has_permissions VALUES("40","7");
INSERT INTO role_has_permissions VALUES("41","1");
INSERT INTO role_has_permissions VALUES("41","2");
INSERT INTO role_has_permissions VALUES("42","1");
INSERT INTO role_has_permissions VALUES("42","2");
INSERT INTO role_has_permissions VALUES("43","1");
INSERT INTO role_has_permissions VALUES("43","2");
INSERT INTO role_has_permissions VALUES("44","1");
INSERT INTO role_has_permissions VALUES("44","2");
INSERT INTO role_has_permissions VALUES("45","1");
INSERT INTO role_has_permissions VALUES("45","2");
INSERT INTO role_has_permissions VALUES("45","5");
INSERT INTO role_has_permissions VALUES("46","1");
INSERT INTO role_has_permissions VALUES("46","2");
INSERT INTO role_has_permissions VALUES("46","6");
INSERT INTO role_has_permissions VALUES("47","1");
INSERT INTO role_has_permissions VALUES("47","2");
INSERT INTO role_has_permissions VALUES("48","1");
INSERT INTO role_has_permissions VALUES("48","2");
INSERT INTO role_has_permissions VALUES("49","1");
INSERT INTO role_has_permissions VALUES("49","2");
INSERT INTO role_has_permissions VALUES("49","5");
INSERT INTO role_has_permissions VALUES("50","1");
INSERT INTO role_has_permissions VALUES("50","2");
INSERT INTO role_has_permissions VALUES("50","5");
INSERT INTO role_has_permissions VALUES("50","6");
INSERT INTO role_has_permissions VALUES("51","1");
INSERT INTO role_has_permissions VALUES("51","2");
INSERT INTO role_has_permissions VALUES("51","5");
INSERT INTO role_has_permissions VALUES("52","1");
INSERT INTO role_has_permissions VALUES("52","2");
INSERT INTO role_has_permissions VALUES("52","5");
INSERT INTO role_has_permissions VALUES("53","1");
INSERT INTO role_has_permissions VALUES("53","2");
INSERT INTO role_has_permissions VALUES("53","5");
INSERT INTO role_has_permissions VALUES("53","7");
INSERT INTO role_has_permissions VALUES("54","1");
INSERT INTO role_has_permissions VALUES("54","2");
INSERT INTO role_has_permissions VALUES("54","5");
INSERT INTO role_has_permissions VALUES("55","1");
INSERT INTO role_has_permissions VALUES("55","2");
INSERT INTO role_has_permissions VALUES("55","3");
INSERT INTO role_has_permissions VALUES("55","5");
INSERT INTO role_has_permissions VALUES("55","7");
INSERT INTO role_has_permissions VALUES("56","1");
INSERT INTO role_has_permissions VALUES("56","2");
INSERT INTO role_has_permissions VALUES("56","3");
INSERT INTO role_has_permissions VALUES("56","5");
INSERT INTO role_has_permissions VALUES("56","6");
INSERT INTO role_has_permissions VALUES("56","7");
INSERT INTO role_has_permissions VALUES("57","1");
INSERT INTO role_has_permissions VALUES("57","2");
INSERT INTO role_has_permissions VALUES("57","3");
INSERT INTO role_has_permissions VALUES("57","5");
INSERT INTO role_has_permissions VALUES("58","1");
INSERT INTO role_has_permissions VALUES("58","2");
INSERT INTO role_has_permissions VALUES("59","1");
INSERT INTO role_has_permissions VALUES("59","2");
INSERT INTO role_has_permissions VALUES("60","1");
INSERT INTO role_has_permissions VALUES("60","2");
INSERT INTO role_has_permissions VALUES("61","1");
INSERT INTO role_has_permissions VALUES("61","2");
INSERT INTO role_has_permissions VALUES("62","1");
INSERT INTO role_has_permissions VALUES("62","2");
INSERT INTO role_has_permissions VALUES("63","1");
INSERT INTO role_has_permissions VALUES("63","2");
INSERT INTO role_has_permissions VALUES("63","3");
INSERT INTO role_has_permissions VALUES("63","6");
INSERT INTO role_has_permissions VALUES("64","1");
INSERT INTO role_has_permissions VALUES("64","2");
INSERT INTO role_has_permissions VALUES("64","3");
INSERT INTO role_has_permissions VALUES("64","6");
INSERT INTO role_has_permissions VALUES("65","1");
INSERT INTO role_has_permissions VALUES("65","2");
INSERT INTO role_has_permissions VALUES("66","1");
INSERT INTO role_has_permissions VALUES("66","2");
INSERT INTO role_has_permissions VALUES("67","1");
INSERT INTO role_has_permissions VALUES("67","2");
INSERT INTO role_has_permissions VALUES("67","5");
INSERT INTO role_has_permissions VALUES("68","1");
INSERT INTO role_has_permissions VALUES("68","2");
INSERT INTO role_has_permissions VALUES("68","5");
INSERT INTO role_has_permissions VALUES("69","1");
INSERT INTO role_has_permissions VALUES("69","2");
INSERT INTO role_has_permissions VALUES("69","5");
INSERT INTO role_has_permissions VALUES("70","1");
INSERT INTO role_has_permissions VALUES("70","2");
INSERT INTO role_has_permissions VALUES("71","1");
INSERT INTO role_has_permissions VALUES("71","2");
INSERT INTO role_has_permissions VALUES("71","7");
INSERT INTO role_has_permissions VALUES("72","1");
INSERT INTO role_has_permissions VALUES("72","2");
INSERT INTO role_has_permissions VALUES("72","5");
INSERT INTO role_has_permissions VALUES("73","1");
INSERT INTO role_has_permissions VALUES("73","2");
INSERT INTO role_has_permissions VALUES("74","1");
INSERT INTO role_has_permissions VALUES("74","2");
INSERT INTO role_has_permissions VALUES("75","1");
INSERT INTO role_has_permissions VALUES("75","2");
INSERT INTO role_has_permissions VALUES("76","1");
INSERT INTO role_has_permissions VALUES("76","2");
INSERT INTO role_has_permissions VALUES("77","1");
INSERT INTO role_has_permissions VALUES("77","2");
INSERT INTO role_has_permissions VALUES("78","1");
INSERT INTO role_has_permissions VALUES("78","2");
INSERT INTO role_has_permissions VALUES("78","7");
INSERT INTO role_has_permissions VALUES("79","1");
INSERT INTO role_has_permissions VALUES("79","2");
INSERT INTO role_has_permissions VALUES("79","3");
INSERT INTO role_has_permissions VALUES("79","5");
INSERT INTO role_has_permissions VALUES("79","7");
INSERT INTO role_has_permissions VALUES("80","1");
INSERT INTO role_has_permissions VALUES("80","2");
INSERT INTO role_has_permissions VALUES("81","1");
INSERT INTO role_has_permissions VALUES("81","2");
INSERT INTO role_has_permissions VALUES("82","1");
INSERT INTO role_has_permissions VALUES("82","2");
INSERT INTO role_has_permissions VALUES("82","3");
INSERT INTO role_has_permissions VALUES("82","7");
INSERT INTO role_has_permissions VALUES("83","1");
INSERT INTO role_has_permissions VALUES("83","2");
INSERT INTO role_has_permissions VALUES("84","1");
INSERT INTO role_has_permissions VALUES("84","2");
INSERT INTO role_has_permissions VALUES("84","7");
INSERT INTO role_has_permissions VALUES("85","1");
INSERT INTO role_has_permissions VALUES("85","2");
INSERT INTO role_has_permissions VALUES("86","1");
INSERT INTO role_has_permissions VALUES("86","2");
INSERT INTO role_has_permissions VALUES("87","1");
INSERT INTO role_has_permissions VALUES("87","2");
INSERT INTO role_has_permissions VALUES("88","1");
INSERT INTO role_has_permissions VALUES("88","2");
INSERT INTO role_has_permissions VALUES("89","1");
INSERT INTO role_has_permissions VALUES("89","2");
INSERT INTO role_has_permissions VALUES("89","5");
INSERT INTO role_has_permissions VALUES("90","1");
INSERT INTO role_has_permissions VALUES("90","2");
INSERT INTO role_has_permissions VALUES("90","5");
INSERT INTO role_has_permissions VALUES("91","1");
INSERT INTO role_has_permissions VALUES("91","2");
INSERT INTO role_has_permissions VALUES("92","1");
INSERT INTO role_has_permissions VALUES("92","2");
INSERT INTO role_has_permissions VALUES("93","1");
INSERT INTO role_has_permissions VALUES("93","2");
INSERT INTO role_has_permissions VALUES("93","5");
INSERT INTO role_has_permissions VALUES("94","1");
INSERT INTO role_has_permissions VALUES("94","2");
INSERT INTO role_has_permissions VALUES("94","5");
INSERT INTO role_has_permissions VALUES("95","1");
INSERT INTO role_has_permissions VALUES("95","2");
INSERT INTO role_has_permissions VALUES("95","5");
INSERT INTO role_has_permissions VALUES("96","1");
INSERT INTO role_has_permissions VALUES("96","2");
INSERT INTO role_has_permissions VALUES("96","5");
INSERT INTO role_has_permissions VALUES("97","1");
INSERT INTO role_has_permissions VALUES("97","2");
INSERT INTO role_has_permissions VALUES("97","5");
INSERT INTO role_has_permissions VALUES("98","1");
INSERT INTO role_has_permissions VALUES("98","2");
INSERT INTO role_has_permissions VALUES("98","7");
INSERT INTO role_has_permissions VALUES("99","1");
INSERT INTO role_has_permissions VALUES("99","2");
INSERT INTO role_has_permissions VALUES("99","5");
INSERT INTO role_has_permissions VALUES("99","7");
INSERT INTO role_has_permissions VALUES("100","1");
INSERT INTO role_has_permissions VALUES("100","2");
INSERT INTO role_has_permissions VALUES("101","1");
INSERT INTO role_has_permissions VALUES("101","2");
INSERT INTO role_has_permissions VALUES("101","5");
INSERT INTO role_has_permissions VALUES("102","1");
INSERT INTO role_has_permissions VALUES("102","2");
INSERT INTO role_has_permissions VALUES("102","5");
INSERT INTO role_has_permissions VALUES("102","7");
INSERT INTO role_has_permissions VALUES("103","1");
INSERT INTO role_has_permissions VALUES("103","2");
INSERT INTO role_has_permissions VALUES("104","1");
INSERT INTO role_has_permissions VALUES("104","2");
INSERT INTO role_has_permissions VALUES("105","1");
INSERT INTO role_has_permissions VALUES("105","2");
INSERT INTO role_has_permissions VALUES("106","1");
INSERT INTO role_has_permissions VALUES("106","3");
INSERT INTO role_has_permissions VALUES("106","5");
INSERT INTO role_has_permissions VALUES("106","6");
INSERT INTO role_has_permissions VALUES("107","1");
INSERT INTO role_has_permissions VALUES("107","5");
INSERT INTO role_has_permissions VALUES("108","1");
INSERT INTO role_has_permissions VALUES("108","5");
INSERT INTO role_has_permissions VALUES("108","6");
INSERT INTO role_has_permissions VALUES("109","1");
INSERT INTO role_has_permissions VALUES("109","5");
INSERT INTO role_has_permissions VALUES("109","6");
INSERT INTO role_has_permissions VALUES("110","1");
INSERT INTO role_has_permissions VALUES("110","7");
INSERT INTO role_has_permissions VALUES("111","1");
INSERT INTO role_has_permissions VALUES("112","1");
INSERT INTO role_has_permissions VALUES("113","1");
INSERT INTO role_has_permissions VALUES("113","5");
INSERT INTO role_has_permissions VALUES("114","1");
INSERT INTO role_has_permissions VALUES("114","5");
INSERT INTO role_has_permissions VALUES("115","1");
INSERT INTO role_has_permissions VALUES("115","5");
INSERT INTO role_has_permissions VALUES("116","1");
INSERT INTO role_has_permissions VALUES("117","1");
INSERT INTO role_has_permissions VALUES("117","3");
INSERT INTO role_has_permissions VALUES("117","5");
INSERT INTO role_has_permissions VALUES("117","6");
INSERT INTO role_has_permissions VALUES("117","7");
INSERT INTO role_has_permissions VALUES("118","1");
INSERT INTO role_has_permissions VALUES("118","3");
INSERT INTO role_has_permissions VALUES("118","5");
INSERT INTO role_has_permissions VALUES("118","6");
INSERT INTO role_has_permissions VALUES("118","7");
INSERT INTO role_has_permissions VALUES("119","1");
INSERT INTO role_has_permissions VALUES("119","5");
INSERT INTO role_has_permissions VALUES("120","1");
INSERT INTO role_has_permissions VALUES("121","1");
INSERT INTO role_has_permissions VALUES("122","1");
INSERT INTO role_has_permissions VALUES("123","1");
INSERT INTO role_has_permissions VALUES("124","1");
INSERT INTO role_has_permissions VALUES("124","3");
INSERT INTO role_has_permissions VALUES("124","7");
INSERT INTO role_has_permissions VALUES("125","1");
INSERT INTO role_has_permissions VALUES("125","5");
INSERT INTO role_has_permissions VALUES("126","1");
INSERT INTO role_has_permissions VALUES("127","1");
INSERT INTO role_has_permissions VALUES("127","5");
INSERT INTO role_has_permissions VALUES("128","1");
INSERT INTO role_has_permissions VALUES("128","5");
INSERT INTO role_has_permissions VALUES("129","1");
INSERT INTO role_has_permissions VALUES("129","5");
INSERT INTO role_has_permissions VALUES("130","1");
INSERT INTO role_has_permissions VALUES("131","1");
INSERT INTO role_has_permissions VALUES("131","5");
INSERT INTO role_has_permissions VALUES("132","1");
INSERT INTO role_has_permissions VALUES("132","5");
INSERT INTO role_has_permissions VALUES("133","1");
INSERT INTO role_has_permissions VALUES("133","2");
INSERT INTO role_has_permissions VALUES("133","3");
INSERT INTO role_has_permissions VALUES("133","4");
INSERT INTO role_has_permissions VALUES("133","5");
INSERT INTO role_has_permissions VALUES("133","6");
INSERT INTO role_has_permissions VALUES("133","7");
INSERT INTO role_has_permissions VALUES("134","1");
INSERT INTO role_has_permissions VALUES("134","2");
INSERT INTO role_has_permissions VALUES("134","3");
INSERT INTO role_has_permissions VALUES("134","4");
INSERT INTO role_has_permissions VALUES("134","5");
INSERT INTO role_has_permissions VALUES("134","6");
INSERT INTO role_has_permissions VALUES("134","7");
INSERT INTO role_has_permissions VALUES("135","1");
INSERT INTO role_has_permissions VALUES("135","2");
INSERT INTO role_has_permissions VALUES("135","3");
INSERT INTO role_has_permissions VALUES("135","4");
INSERT INTO role_has_permissions VALUES("135","5");
INSERT INTO role_has_permissions VALUES("135","6");
INSERT INTO role_has_permissions VALUES("135","7");
INSERT INTO role_has_permissions VALUES("136","1");
INSERT INTO role_has_permissions VALUES("136","2");



CREATE TABLE `roles` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `description` text DEFAULT NULL,
  `guard_name` varchar(191) DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO roles VALUES("1","Admin","Admin can access all data","web","1","2018-06-02 06:46:44","2023-06-21 21:38:36");
INSERT INTO roles VALUES("2","DIREKTUR","Staff of shop","web","1","2018-10-22 09:38:13","2026-07-24 19:23:43");
INSERT INTO roles VALUES("3","KASIR","kasir memiliki akses khusus atau kasir mempunyai hak akses tertentu.","web","0","2018-06-02 07:05:27","2026-07-24 19:25:25");
INSERT INTO roles VALUES("4","PELANGGAN","UNTUK COUSTEMER YANG MEMILIKI KARTU MEMBER","web","0","2020-11-05 13:43:16","2026-07-24 19:25:37");
INSERT INTO roles VALUES("5","1. KEUANGAN","AKSES MANAJEMEN KEUANGAN SEBAGIAN","web","1","2026-07-24 19:22:12","2026-07-24 19:25:56");
INSERT INTO roles VALUES("6","2. PRODUK","MANAJEMEN PRODUK","web","1","2026-07-24 19:22:34","2026-07-24 19:26:08");
INSERT INTO roles VALUES("7","3. PEMASARAN","","web","1","2026-07-24 19:22:52","2026-07-24 19:26:17");



CREATE TABLE `salepro_journal_backfill_log` (
  `journal_id` int(11) NOT NULL,
  `task` varchar(64) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`journal_id`,`task`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;




CREATE TABLE `sales` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `reference_no` varchar(191) NOT NULL,
  `user_id` int(11) NOT NULL,
  `cash_register_id` int(11) DEFAULT NULL,
  `table_id` int(11) DEFAULT NULL,
  `queue` int(11) DEFAULT NULL,
  `customer_id` int(11) NOT NULL,
  `warehouse_id` int(11) NOT NULL,
  `biller_id` int(11) DEFAULT NULL,
  `item` int(11) NOT NULL,
  `total_qty` double NOT NULL,
  `total_discount` double NOT NULL,
  `total_tax` double NOT NULL,
  `total_price` double NOT NULL,
  `grand_total` double NOT NULL,
  `currency_id` int(11) DEFAULT NULL,
  `exchange_rate` double DEFAULT NULL,
  `order_tax_rate` double DEFAULT NULL,
  `order_tax` double DEFAULT NULL,
  `order_discount_type` varchar(191) DEFAULT NULL,
  `order_discount_value` double DEFAULT NULL,
  `order_discount` double DEFAULT NULL,
  `coupon_id` int(11) DEFAULT NULL,
  `coupon_discount` double DEFAULT NULL,
  `shipping_cost` double DEFAULT NULL,
  `sale_status` int(11) NOT NULL,
  `payment_status` int(11) NOT NULL,
  `document` varchar(191) DEFAULT NULL,
  `state` int(11) DEFAULT 1,
  `paid_amount` double DEFAULT NULL,
  `sale_note` text DEFAULT NULL,
  `staff_note` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `muri_kha` varchar(191) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `sms_templates` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `content` text DEFAULT NULL,
  `is_default` tinyint(1) DEFAULT 0,
  `is_default_ecommerce` tinyint(1) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;




CREATE TABLE `stock_counts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `reference_no` varchar(191) NOT NULL,
  `warehouse_id` int(11) NOT NULL,
  `category_id` varchar(191) DEFAULT NULL,
  `brand_id` varchar(191) DEFAULT NULL,
  `user_id` int(11) NOT NULL,
  `type` varchar(191) NOT NULL,
  `initial_file` varchar(191) DEFAULT NULL,
  `final_file` varchar(191) DEFAULT NULL,
  `note` text DEFAULT NULL,
  `is_adjusted` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `suppliers` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `image` varchar(191) DEFAULT NULL,
  `company_name` varchar(191) NOT NULL,
  `vat_number` varchar(191) DEFAULT NULL,
  `email` varchar(191) NOT NULL,
  `phone_number` varchar(191) NOT NULL,
  `address` varchar(191) NOT NULL,
  `city` varchar(191) NOT NULL,
  `state` varchar(191) DEFAULT NULL,
  `postal_code` varchar(191) DEFAULT NULL,
  `country` varchar(191) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `tables` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `number_of_person` int(11) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `taxes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `rate` double NOT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `transfers` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `reference_no` varchar(191) NOT NULL,
  `user_id` int(11) NOT NULL,
  `status` int(11) NOT NULL,
  `from_warehouse_id` int(11) NOT NULL,
  `to_warehouse_id` int(11) NOT NULL,
  `item` int(11) NOT NULL,
  `total_qty` double NOT NULL,
  `total_tax` double NOT NULL,
  `total_cost` double NOT NULL,
  `shipping_cost` double DEFAULT NULL,
  `grand_total` double NOT NULL,
  `document` varchar(191) DEFAULT NULL,
  `note` text DEFAULT NULL,
  `is_sent` tinyint(1) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `units` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `unit_code` varchar(191) NOT NULL,
  `unit_name` varchar(191) NOT NULL,
  `base_unit` int(11) DEFAULT NULL,
  `operator` varchar(191) DEFAULT NULL,
  `operation_value` double DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO units VALUES("1","D001","KG","","*","1","1","2026-08-07 18:31:44","2026-08-07 18:31:44");
INSERT INTO units VALUES("2","K001","1/4 KG","1","/","4","1","2026-08-07 18:32:17","2026-08-07 18:32:17");
INSERT INTO units VALUES("3","K002","1/2 KG","1","/","2","1","2026-08-07 18:32:54","2026-08-07 18:33:04");
INSERT INTO units VALUES("4","K003","SAK50","1","*","50","1","2026-08-07 18:33:26","2026-08-07 18:33:26");
INSERT INTO units VALUES("5","D002","PCS","","*","1","1","2026-08-07 19:07:14","2026-08-07 19:07:14");
INSERT INTO units VALUES("6","K004","DUS48","5","*","48","1","2026-08-07 19:07:41","2026-08-07 19:07:41");



CREATE TABLE `variants` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;




CREATE TABLE `warehouses` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) NOT NULL,
  `phone` varchar(191) DEFAULT NULL,
  `email` varchar(191) DEFAULT NULL,
  `address` text NOT NULL,
  `type` varchar(255) NOT NULL DEFAULT 'gudang',
  `is_active` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


