-- https://www.phpmyadmin.net/
--

START TRANSACTION;



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

--
-- Table structure for table `ospos_attribute_definitions`
--

CREATE TABLE `ospos_attribute_definitions` (
  `definition_id` int(10) NOT NULL,
  `definition_name` varchar(255) NOT NULL,
  `definition_type` varchar(45) NOT NULL,
  `definition_unit` varchar(16) DEFAULT NULL,
  `definition_flags` tinyint(1) NOT NULL,
  `definition_fk` int(10) DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_attribute_definitions`
--

INSERT INTO `ospos_attribute_definitions` (`definition_id`, `definition_name`, `definition_type`, `definition_unit`, `definition_flags`, `definition_fk`, `deleted`) VALUES
(-1, 'ospos_category', 'DROPDOWN', NULL, 0, NULL, 1),
(1, 'Service Att', 'TEXT', NULL, 3, NULL, 0);

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

--
-- Table structure for table `ospos_attribute_links`
--

CREATE TABLE `ospos_attribute_links` (
  `attribute_id` int(11) DEFAULT NULL,
  `definition_id` int(11) NOT NULL,
  `item_id` int(11) DEFAULT NULL,
  `sale_id` int(11) DEFAULT NULL,
  `receiving_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_attribute_links`
--

INSERT INTO `ospos_attribute_links` (`attribute_id`, `definition_id`, `item_id`, `sale_id`, `receiving_id`) VALUES
(1, 1, 2, NULL, NULL),
(1, 1, 2, 4, NULL),
(1, 1, 2, 5, NULL),
(1, 1, 2, 6, NULL),
(1, 1, 2, 7, NULL),
(1, 1, 2, 8, NULL),
(1, 1, 2, 9, NULL),
(1, 1, 2, 10, NULL),
(2, 1, 8, NULL, NULL),
(2, 1, 8, NULL, 1),
(2, 1, 8, NULL, 2),
(2, 1, 8, NULL, 3),
(2, 1, 8, NULL, 4),
(2, 1, 8, NULL, 5),
(2, 1, 8, 18, NULL),
(2, 1, 8, 21, NULL),
(2, 1, 8, 22, NULL),
(2, 1, 8, 23, NULL);

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

--
-- Table structure for table `ospos_attribute_values`
--

CREATE TABLE `ospos_attribute_values` (
  `attribute_id` int(11) NOT NULL,
  `attribute_value` varchar(255) DEFAULT NULL,
  `attribute_date` date DEFAULT NULL,
  `attribute_decimal` decimal(7,3) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_attribute_values`
--

INSERT INTO `ospos_attribute_values` (`attribute_id`, `attribute_value`, `attribute_date`, `attribute_decimal`) VALUES
(1, 'asasasa', NULL, NULL),
(2, 'lipstick', NULL, NULL);

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

--
-- Table structure for table `ospos_cash_up`
--

CREATE TABLE `ospos_cash_up` (
  `cashup_id` int(10) NOT NULL,
  `open_date` timestamp NULL DEFAULT current_timestamp(),
  `close_date` timestamp NULL DEFAULT NULL,
  `open_amount_cash` decimal(15,2) NOT NULL,
  `transfer_amount_cash` decimal(15,2) NOT NULL,
  `note` int(1) NOT NULL,
  `closed_amount_cash` decimal(15,2) NOT NULL,
  `closed_amount_card` decimal(15,2) NOT NULL,
  `closed_amount_check` decimal(15,2) NOT NULL,
  `closed_amount_total` decimal(15,2) NOT NULL,
  `description` varchar(255) NOT NULL,
  `open_employee_id` int(10) NOT NULL,
  `close_employee_id` int(10) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT 0,
  `closed_amount_due` decimal(15,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_cash_up`
--

INSERT INTO `ospos_cash_up` (`cashup_id`, `open_date`, `close_date`, `open_amount_cash`, `transfer_amount_cash`, `note`, `closed_amount_cash`, `closed_amount_card`, `closed_amount_check`, `closed_amount_total`, `description`, `open_employee_id`, `close_employee_id`, `deleted`, `closed_amount_due`) VALUES
(1, '2023-10-27 11:50:31', '2023-10-27 11:52:24', '100.00', '1000.00', 0, '191728.30', '57.00', '0.00', '190685.30', '', 3, 1, 1, '0.00'),
(2, '2023-10-28 12:30:58', '2023-10-27 11:52:58', '100.00', '100.00', 0, '0.00', '0.00', '0.00', '-200.00', '', 1, 1, 0, '0.00'),
(3, '2023-10-27 11:53:13', '2023-10-27 11:53:38', '100.00', '1000.00', 0, '191728.30', '57.00', '0.00', '190685.30', '', 3, 1, 1, '0.00'),
(4, '2023-10-27 11:58:57', '2023-10-27 11:58:57', '100.00', '1200.00', 0, '0.00', '0.00', '0.00', '-1300.00', '', 1, 3, 1, '0.00'),
(5, '2023-10-27 12:03:06', '2023-10-27 12:03:06', '500.00', '300.00', 0, '800.00', '200.00', '130.00', '450.00', '', 3, 1, 1, '120.00'),
(6, '2023-10-27 12:08:48', '2023-10-27 12:08:48', '0.00', '0.00', 0, '0.00', '0.00', '0.00', '0.00', '', 1, 1, 1, '0.00');

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

--
-- Table structure for table `ospos_customers`
--

CREATE TABLE `ospos_customers` (
  `person_id` int(10) NOT NULL,
  `company_name` varchar(255) DEFAULT NULL,
  `account_number` varchar(255) DEFAULT NULL,
  `taxable` tinyint(1) NOT NULL DEFAULT 1,
  `tax_id` varchar(32) NOT NULL DEFAULT '',
  `sales_tax_code_id` int(11) DEFAULT NULL,
  `discount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_type` tinyint(1) NOT NULL DEFAULT 0,
  `package_id` int(11) DEFAULT NULL,
  `points` int(11) DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT 0,
  `date` timestamp NOT NULL DEFAULT current_timestamp(),
  `employee_id` int(10) NOT NULL,
  `consent` int(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_customers`
--

INSERT INTO `ospos_customers` (`person_id`, `company_name`, `account_number`, `taxable`, `tax_id`, `sales_tax_code_id`, `discount`, `discount_type`, `package_id`, `points`, `deleted`, `date`, `employee_id`, `consent`) VALUES
(2, 'Cats', '154125971', 1, '11222058', NULL, '5.00', 0, NULL, NULL, 0, '2023-10-26 04:29:43', 1, 1),
(4, NULL, NULL, 1, '', NULL, '0.00', 0, NULL, NULL, 1, '2023-10-27 06:52:43', 1, 1),
(6, 'Centillion Solutions', NULL, 1, '', NULL, '0.00', 0, NULL, NULL, 1, '2023-10-27 06:54:07', 1, 1),
(7, NULL, NULL, 1, '', NULL, '50.00', 1, NULL, NULL, 1, '2023-10-27 06:54:57', 1, 1),
(8, NULL, NULL, 1, '', NULL, '50.00', 1, NULL, NULL, 0, '2023-10-27 06:55:33', 1, 1);

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

--
-- Table structure for table `ospos_customers_packages`
--

CREATE TABLE `ospos_customers_packages` (
  `package_id` int(11) NOT NULL,
  `package_name` varchar(255) DEFAULT NULL,
  `points_percent` float NOT NULL DEFAULT 0,
  `deleted` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_customers_packages`
--

INSERT INTO `ospos_customers_packages` (`package_id`, `package_name`, `points_percent`, `deleted`) VALUES
(1, 'Default', 0, 0),
(2, 'Bronze', 10, 0),
(3, 'Silver', 20, 0),
(4, 'Gold', 30, 0),
(5, 'Premium', 50, 0);

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

--
-- Table structure for table `ospos_customers_points`
--

CREATE TABLE `ospos_customers_points` (
  `id` int(11) NOT NULL,
  `person_id` int(11) NOT NULL,
  `package_id` int(11) NOT NULL,
  `sale_id` int(11) NOT NULL,
  `points_earned` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `ospos_dinner_tables`
--

CREATE TABLE `ospos_dinner_tables` (
  `dinner_table_id` int(11) NOT NULL,
  `name` varchar(30) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 0,
  `deleted` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_dinner_tables`
--

INSERT INTO `ospos_dinner_tables` (`dinner_table_id`, `name`, `status`, `deleted`) VALUES
(1, 'Delivery', 0, 0),
(2, 'Take Away', 0, 0);

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

--
-- Table structure for table `ospos_expenses`
--

CREATE TABLE `ospos_expenses` (
  `expense_id` int(10) NOT NULL,
  `date` timestamp NULL DEFAULT current_timestamp(),
  `amount` decimal(15,2) NOT NULL,
  `payment_type` varchar(40) NOT NULL,
  `expense_category_id` int(11) NOT NULL,
  `description` varchar(255) NOT NULL,
  `employee_id` int(10) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT 0,
  `supplier_tax_code` varchar(255) DEFAULT NULL,
  `tax_amount` decimal(15,2) DEFAULT NULL,
  `supplier_id` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_expenses`
--

INSERT INTO `ospos_expenses` (`expense_id`, `date`, `amount`, `payment_type`, `expense_category_id`, `description`, `employee_id`, `deleted`, `supplier_tax_code`, `tax_amount`, `supplier_id`) VALUES
(1, '2023-10-27 10:51:51', '100.00', 'Cash', 1, 'hgfh', 1, 1, '1', '5.00', NULL),
(2, '2023-10-27 10:52:40', '100.00', 'Cash', 1, 'hjhgj', 1, 1, 'fgh', '5.00', 9),
(3, '2023-10-27 11:01:40', '0.00', 'Cash', 1, '', 1, 1, 's', '0.00', 10),
(4, '2023-10-27 11:32:45', '100.00', 'Cash', 1, '', 1, 1, 'fgjuiyufytkj', '10.00', NULL),
(5, '2023-10-27 11:49:33', '1000.00', 'Cash', 3, 'Used too much electrivciy', 3, 1, 'Electricity', '0.00', NULL),
(6, '2023-10-27 11:49:55', '10.00', 'Cash', 2, '', 1, 1, 'Tea', '0.00', NULL);

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

--
-- Table structure for table `ospos_expense_categories`
--

CREATE TABLE `ospos_expense_categories` (
  `expense_category_id` int(10) NOT NULL,
  `category_name` varchar(255) DEFAULT NULL,
  `category_description` varchar(255) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_expense_categories`
--

INSERT INTO `ospos_expense_categories` (`expense_category_id`, `category_name`, `category_description`, `deleted`) VALUES
(1, 'CAT 1', '', 1),
(2, 'Entertainment', 'AAA', 1),
(3, 'Utilities', '', 1);

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

--
-- Table structure for table `ospos_giftcards`
--

CREATE TABLE `ospos_giftcards` (
  `record_time` timestamp NOT NULL DEFAULT current_timestamp(),
  `giftcard_id` int(11) NOT NULL,
  `giftcard_number` varchar(255) DEFAULT NULL,
  `value` decimal(15,2) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT 0,
  `person_id` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_giftcards`
--

INSERT INTO `ospos_giftcards` (`record_time`, `giftcard_id`, `giftcard_number`, `value`, `deleted`, `person_id`) VALUES
('2023-10-27 07:50:16', 1, '1', '0.00', 1, 8),
('2023-10-27 08:10:27', 2, '124', '200.00', 1, 8);

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

--
-- Table structure for table `ospos_grants`
--

CREATE TABLE `ospos_grants` (
  `permission_id` varchar(255) NOT NULL,
  `person_id` int(10) NOT NULL,
  `menu_group` varchar(32) DEFAULT 'home'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_grants`
--

INSERT INTO `ospos_grants` (`permission_id`, `person_id`, `menu_group`) VALUES
('attributes', 1, 'office'),
('cashups', 1, 'home'),
('cashups', 3, 'home'),
('config', 1, 'office'),
('config', 3, 'office'),
('customers', 1, 'home'),
('customers', 3, 'office'),
('employees', 1, 'office'),
('employees', 3, 'office'),
('expenses', 1, 'home'),
('expenses', 3, 'home'),
('expenses_categories', 1, 'office'),
('expenses_categories', 3, 'office'),
('giftcards', 1, 'home'),
('giftcards', 3, 'home'),
('home', 1, 'office'),
('home', 3, 'office'),
('items', 1, 'home'),
('items', 3, 'home'),
('items_Lounge', 1, 'home'),
('items_Parlour', 1, 'home'),
('items_Parlour', 3, '--'),
('items_Room', 1, 'home'),
('items_stock', 1, 'home'),
('item_kits', 1, 'home'),
('item_kits', 3, 'home'),
('messages', 1, 'home'),
('messages', 3, 'home'),
('office', 1, 'home'),
('office', 3, 'home'),
('receivings', 1, 'home'),
('receivings', 3, 'home'),
('receivings_Lounge', 1, 'home'),
('receivings_Parlour', 1, 'home'),
('receivings_Parlour', 3, '--'),
('receivings_Room', 1, 'home'),
('receivings_stock', 1, 'home'),
('reports', 1, 'home'),
('reports', 3, 'home'),
('reports_categories', 1, 'home'),
('reports_customers', 1, 'home'),
('reports_customers', 3, '--'),
('reports_discounts', 1, 'home'),
('reports_discounts', 3, '--'),
('reports_employees', 1, 'home'),
('reports_expenses_categories', 1, 'home'),
('reports_inventory', 1, 'home'),
('reports_items', 1, 'home'),
('reports_payments', 1, 'home'),
('reports_receivings', 1, 'home'),
('reports_sales', 1, 'home'),
('reports_sales_taxes', 1, 'home'),
('reports_suppliers', 1, 'home'),
('reports_taxes', 1, 'home'),
('sales', 1, 'home'),
('sales', 3, 'home'),
('sales_change_price', 1, '--'),
('sales_delete', 1, '--'),
('sales_Lounge', 1, 'home'),
('sales_Parlour', 1, 'home'),
('sales_Parlour', 3, '--'),
('sales_Room', 1, 'home'),
('sales_stock', 1, 'home'),
('suppliers', 1, 'home'),
('suppliers', 3, 'home'),
('taxes', 1, 'office'),
('taxes', 3, 'office');

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

--
-- Table structure for table `ospos_inventory`
--

CREATE TABLE `ospos_inventory` (
  `trans_id` int(11) NOT NULL,
  `trans_items` int(11) NOT NULL DEFAULT 0,
  `trans_user` int(11) NOT NULL DEFAULT 0,
  `trans_date` timestamp NOT NULL DEFAULT current_timestamp(),
  `trans_comment` text NOT NULL,
  `trans_location` int(11) NOT NULL,
  `trans_inventory` decimal(15,3) NOT NULL DEFAULT 0.000
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_inventory`
--

INSERT INTO `ospos_inventory` (`trans_id`, `trans_items`, `trans_user`, `trans_date`, `trans_comment`, `trans_location`, `trans_inventory`) VALUES
(1, 1, 1, '2023-10-26 04:17:49', 'Manual Edit of Quantity', 1, '11.000'),
(2, 1, 1, '2023-10-26 04:17:59', 'POS 1', 1, '-1.000'),
(3, 1, 1, '2023-10-26 15:03:50', 'Manual Edit of Quantity', 1, '-11.000'),
(4, 1, 1, '2023-10-26 15:03:50', 'Manual Edit of Quantity', 2, '-1.000'),
(5, 1, 1, '2023-10-26 15:04:08', 'POS 2', 1, '-1.000'),
(6, 1, 1, '2023-10-27 06:31:08', 'POS 3', 2, '-1.000'),
(7, 2, 1, '2023-10-27 07:00:34', 'Manual Edit of Quantity', 1, '0.000'),
(8, 2, 1, '2023-10-27 07:01:11', 'Manual Edit of Quantity', 1, '150000000.000'),
(9, 3, 1, '2023-10-27 07:20:52', 'Manual Edit of Quantity', 1, '0.000'),
(10, 4, 1, '2023-10-27 07:21:39', 'Manual Edit of Quantity', 1, '150.000'),
(11, 5, 1, '2023-10-27 07:23:12', 'Manual Edit of Quantity', 1, '0.000'),
(12, 6, 1, '2023-10-27 07:25:13', 'Manual Edit of Quantity', 1, '0.000'),
(13, 7, 1, '2023-10-27 07:26:54', 'Manual Edit of Quantity', 1, '0.000'),
(14, 8, 1, '2023-10-27 07:35:42', 'Manual Edit of Quantity', 1, '10.000'),
(15, 8, 1, '2023-10-27 07:37:08', 'RECV 1', 1, '10.000'),
(16, 6, 1, '2023-10-27 07:45:03', 'RECV 2', 1, '100.000'),
(17, 8, 1, '2023-10-27 07:45:03', 'RECV 2', 1, '500.000'),
(18, 8, 1, '2023-10-27 07:46:29', 'RECV 3', 1, '10.000'),
(19, 8, 1, '2023-10-27 07:47:10', 'RECV 4', 1, '1.000'),
(20, 8, 1, '2023-10-27 07:49:10', 'RECV 5', 1, '1.000'),
(21, 6, 1, '2023-10-27 07:50:11', 'POS 16', 1, '-1.000'),
(22, 6, 1, '2023-10-27 07:50:42', 'POS 17', 1, '-1.000'),
(23, 6, 1, '2023-10-27 07:51:13', 'POS 19', 1, '-1.000'),
(24, 6, 1, '2023-10-27 07:52:47', 'POS 20', 1, '-1.000'),
(25, 6, 1, '2023-10-27 07:55:55', 'POS 24', 1, '-90.000'),
(26, 6, 1, '2023-10-27 10:48:22', 'RECV 6', 1, '17.000'),
(27, 4, 1, '2023-10-27 10:48:22', 'RECV 6', 1, '70.000'),
(28, 7, 1, '2023-10-27 10:48:22', 'RECV 6', 1, '1.000'),
(29, 4, 1, '2023-10-27 10:49:08', 'RECV 7', 1, '70.000'),
(30, 6, 1, '2023-10-27 10:49:08', 'RECV 7', 1, '1.000'),
(31, 7, 1, '2023-10-27 10:49:08', 'RECV 7', 1, '1.000'),
(32, 2, 1, '2023-10-27 12:28:41', 'Deleted', 1, '-150000000.000'),
(33, 4, 1, '2023-10-27 12:28:41', 'Deleted', 1, '-290.000'),
(34, 6, 1, '2023-10-27 12:28:41', 'Deleted', 1, '-24.000'),
(35, 7, 1, '2023-10-27 12:28:41', 'Deleted', 1, '-2.000'),
(36, 8, 1, '2023-10-27 12:28:41', 'Deleted', 1, '-532.000');

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

--
-- Table structure for table `ospos_items`
--

CREATE TABLE `ospos_items` (
  `name` varchar(255) NOT NULL,
  `category` varchar(255) NOT NULL,
  `supplier_id` int(11) DEFAULT NULL,
  `item_number` varchar(255) DEFAULT NULL,
  `description` varchar(255) NOT NULL,
  `cost_price` decimal(15,2) NOT NULL,
  `unit_price` decimal(15,2) NOT NULL,
  `reorder_level` decimal(15,3) NOT NULL DEFAULT 0.000,
  `receiving_quantity` decimal(15,3) NOT NULL DEFAULT 1.000,
  `item_id` int(10) NOT NULL,
  `pic_filename` varchar(255) DEFAULT NULL,
  `allow_alt_description` tinyint(1) NOT NULL,
  `is_serialized` tinyint(1) NOT NULL,
  `stock_type` tinyint(1) NOT NULL DEFAULT 0,
  `item_type` tinyint(1) NOT NULL DEFAULT 0,
  `deleted` tinyint(1) NOT NULL DEFAULT 0,
  `tax_category_id` int(10) DEFAULT NULL,
  `qty_per_pack` decimal(15,3) NOT NULL DEFAULT 1.000,
  `pack_name` varchar(8) DEFAULT 'Each',
  `low_sell_item_id` int(10) DEFAULT 0,
  `hsn_code` varchar(32) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_items`
--

INSERT INTO `ospos_items` (`name`, `category`, `supplier_id`, `item_number`, `description`, `cost_price`, `unit_price`, `reorder_level`, `receiving_quantity`, `item_id`, `pic_filename`, `allow_alt_description`, `is_serialized`, `stock_type`, `item_type`, `deleted`, `tax_category_id`, `qty_per_pack`, `pack_name`, `low_sell_item_id`, `hsn_code`) VALUES
('a', 'a', NULL, '111', '', '100.00', '110.00', '-1.000', '-1.000', 1, NULL, 0, 0, 0, 0, 1, 0, '1.000', 'Each', 1, ''),
('Facial', 'makeup', NULL, '1211312342', '', '150.00', '60.00', '100.000', '150000000.000', 2, NULL, 0, 0, 1, 0, 1, 0, '1.000', 'Each', 2, ''),
('Onion', 'Veges', NULL, NULL, '', '0.00', '0.00', '0.000', '0.000', 3, NULL, 0, 0, 1, 0, 1, 0, '1.000', 'Each', 3, ''),
('Hands', 'Hand', NULL, NULL, '', '10.00', '152.00', '2.000', '70.000', 4, NULL, 0, 0, 1, 0, 1, 0, '1.000', 'Each', 4, ''),
('Manicure', 'Parlor', NULL, NULL, '', '0.00', '100.00', '0.000', '0.000', 5, NULL, 0, 0, 1, 0, 1, 0, '1.000', 'Each', 5, ''),
('ABC', 'ABC', NULL, NULL, '', '0.00', '0.00', '0.000', '0.000', 6, NULL, 0, 0, 0, 0, 1, 0, '1.000', 'Each', 6, ''),
('as', 'as', NULL, NULL, '', '100.00', '100.00', '0.000', '0.000', 7, NULL, 0, 0, 1, 0, 1, 0, '1.000', 'Each', 7, ''),
('receive lipstick', 'makeup', 9, '444', '', '150.00', '250.00', '1.000', '10.000', 8, NULL, 0, 0, 1, 0, 1, 0, '1.000', 'Each', 8, '');

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

--
-- Table structure for table `ospos_items_taxes`
--

CREATE TABLE `ospos_items_taxes` (
  `item_id` int(10) NOT NULL,
  `name` varchar(255) NOT NULL,
  `percent` decimal(15,3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_items_taxes`
--

INSERT INTO `ospos_items_taxes` (`item_id`, `name`, `percent`) VALUES
(4, '', '17.000'),
(8, '', '17.000');

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

--
-- Table structure for table `ospos_item_kits`
--

CREATE TABLE `ospos_item_kits` (
  `item_kit_id` int(11) NOT NULL,
  `item_kit_number` varchar(255) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `item_id` int(10) NOT NULL DEFAULT 0,
  `kit_discount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `kit_discount_type` tinyint(1) NOT NULL DEFAULT 0,
  `price_option` tinyint(1) NOT NULL DEFAULT 0,
  `print_option` tinyint(1) NOT NULL DEFAULT 0,
  `description` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `ospos_item_kit_items`
--

CREATE TABLE `ospos_item_kit_items` (
  `item_kit_id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `quantity` decimal(15,3) NOT NULL,
  `kit_sequence` int(3) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_item_kit_items`
--

INSERT INTO `ospos_item_kit_items` (`item_kit_id`, `item_id`, `quantity`, `kit_sequence`) VALUES
(2, 2, '1.000', 0),
(2, 4, '1.000', 0),
(3, 4, '1.000', 0),
(3, 6, '1.000', 0),
(3, 7, '1.000', 0);

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

--
-- Table structure for table `ospos_item_quantities`
--

CREATE TABLE `ospos_item_quantities` (
  `item_id` int(11) NOT NULL,
  `location_id` int(11) NOT NULL,
  `quantity` decimal(15,3) NOT NULL DEFAULT 0.000
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_item_quantities`
--

INSERT INTO `ospos_item_quantities` (`item_id`, `location_id`, `quantity`) VALUES
(1, 1, '0.000'),
(1, 2, '0.000'),
(2, 1, '0.000'),
(3, 1, '0.000'),
(4, 1, '0.000'),
(5, 1, '0.000'),
(6, 1, '0.000'),
(7, 1, '0.000'),
(8, 1, '0.000');

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

--
-- Table structure for table `ospos_migrations`
--

CREATE TABLE `ospos_migrations` (
  `version` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_migrations`
--

INSERT INTO `ospos_migrations` (`version`) VALUES
(20210714140000);

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

--
-- Table structure for table `ospos_modules`
--

CREATE TABLE `ospos_modules` (
  `name_lang_key` varchar(255) NOT NULL,
  `desc_lang_key` varchar(255) NOT NULL,
  `sort` int(10) NOT NULL,
  `module_id` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_modules`
--

INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES
('module_cashups', 'module_cashups_desc', 110, 'cashups'),
('module_config', 'module_config_desc', 900, 'config'),
('module_customers', 'module_customers_desc', 10, 'customers'),
('module_employees', 'module_employees_desc', 80, 'employees'),
('module_expenses', 'module_expenses_desc', 108, 'expenses'),
('module_expenses_categories', 'module_expenses_categories_desc', 109, 'expenses_categories'),
('module_giftcards', 'module_giftcards_desc', 90, 'giftcards'),
('module_home', 'module_home_desc', 1, 'home'),
('module_items', 'module_items_desc', 20, 'items'),
('module_item_kits', 'module_item_kits_desc', 30, 'item_kits'),
('module_office', 'module_office_desc', 999, 'office'),
('module_receivings', 'module_receivings_desc', 60, 'receivings'),
('module_reports', 'module_reports_desc', 50, 'reports'),
('module_sales', 'module_sales_desc', 70, 'sales'),
('module_suppliers', 'module_suppliers_desc', 40, 'suppliers'),
('module_taxes', 'module_taxes_desc', 105, 'taxes');

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

--
-- Table structure for table `ospos_people`
--

CREATE TABLE `ospos_people` (
  `first_name` varchar(255) NOT NULL,
  `last_name` varchar(255) NOT NULL,
  `gender` int(1) DEFAULT NULL,
  `phone_number` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `address_1` varchar(255) NOT NULL,
  `address_2` varchar(255) NOT NULL,
  `city` varchar(255) NOT NULL,
  `state` varchar(255) NOT NULL,
  `zip` varchar(255) NOT NULL,
  `country` varchar(255) NOT NULL,
  `comments` text NOT NULL,
  `person_id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_people`
--

INSERT INTO `ospos_people` (`first_name`, `last_name`, `gender`, `phone_number`, `email`, `address_1`, `address_2`, `city`, `state`, `zip`, `country`, `comments`, `person_id`) VALUES
('John', 'Doe', NULL, '555-555-5555', 'changeme@example.com', 'Address 1', '', '', '', '', '', '', 1),
('Shafy', 'Ali', 1, '03405555555', 'shafy@gmail.com', 'Johar town ', 'Khokhar Chowk', 'Lahore', 'Punjab', '54400', 'Pakistan', 'Permanent client', 2),
('Shafy', 'Ali', 1, '03000000000', 'shah@lhr.com', 'Masti gate', '', 'Lahore', 'Punjab', '', 'Pakistan', '', 3),
('Ali', 'Sajjad', NULL, '03000784155', 'alisajjad4969@gmail.com', 'Muhafiz Town', '', 'Lahore', '', '', '', 'asas', 4),
('Asim', 'Amin', NULL, '03218487144', 'asim_amin@hotmail.com', '25-H Block, Model Town', '', 'Lahore', '', '54700', '', '', 6),
('Asim', 'Aminaa', NULL, '03218487144', 'asim_amssin@hotmail.com', '25-H Block, Model Town', '', 'Lahore', '', '54700', '', '', 7),
('Asim', 'Amin', NULL, '03218487144', 'asim_amin@hotmail.com', '25-H Block, Model Town', '', 'Lahore', '', '54700', '', '', 8),
('Junaid', 'Junaid', 0, '', '', '', '', '', '', '', '', '', 9),
('Zubair', 'Qureshi', NULL, '', '', '', '', '', '', '', '', '', 10),
('Asim', 'Amin', 1, '3000000', 'amin@nestle', 'wqe', 'wqe', 'qwe', '', 'wqe', '', 'wqe', 11);

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

--
-- Table structure for table `ospos_permissions`
--

CREATE TABLE `ospos_permissions` (
  `permission_id` varchar(255) NOT NULL,
  `module_id` varchar(255) NOT NULL,
  `location_id` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_permissions`
--

INSERT INTO `ospos_permissions` (`permission_id`, `module_id`, `location_id`) VALUES
('attributes', 'attributes', NULL),
('cashups', 'cashups', NULL),
('config', 'config', NULL),
('customers', 'customers', NULL),
('employees', 'employees', NULL),
('expenses', 'expenses', NULL),
('expenses_categories', 'expenses_categories', NULL),
('giftcards', 'giftcards', NULL),
('home', 'home', NULL),
('items', 'items', NULL),
('items_Parlour', 'items', 1),
('item_kits', 'item_kits', NULL),
('messages', 'messages', NULL),
('office', 'office', NULL),
('receivings', 'receivings', NULL),
('receivings_Parlour', 'receivings', 1),
('reports', 'reports', NULL),
('reports_categories', 'reports', NULL),
('reports_customers', 'reports', NULL),
('reports_discounts', 'reports', NULL),
('reports_employees', 'reports', NULL),
('reports_expenses_categories', 'reports', NULL),
('reports_inventory', 'reports', NULL),
('reports_items', 'reports', NULL),
('reports_payments', 'reports', NULL),
('reports_receivings', 'reports', NULL),
('reports_sales', 'reports', NULL),
('reports_sales_taxes', 'reports', NULL),
('reports_suppliers', 'reports', NULL),
('reports_taxes', 'reports', NULL),
('sales', 'sales', NULL),
('sales_change_price', 'sales', NULL),
('sales_delete', 'sales', NULL),
('sales_Parlour', 'sales', 1),
('suppliers', 'suppliers', NULL),
('taxes', 'taxes', NULL);

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

--
-- Table structure for table `ospos_receivings`
--

CREATE TABLE `ospos_receivings` (
  `receiving_time` timestamp NOT NULL DEFAULT current_timestamp(),
  `supplier_id` int(10) DEFAULT NULL,
  `employee_id` int(10) NOT NULL DEFAULT 0,
  `comment` text DEFAULT NULL,
  `receiving_id` int(10) NOT NULL,
  `payment_type` varchar(20) DEFAULT NULL,
  `reference` varchar(32) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_receivings`
--

INSERT INTO `ospos_receivings` (`receiving_time`, `supplier_id`, `employee_id`, `comment`, `receiving_id`, `payment_type`, `reference`) VALUES
('2023-10-27 07:37:08', NULL, 1, '', 1, 'Cash', 'Ali'),
('2023-10-27 07:45:03', 9, 1, '', 2, 'Cash', NULL),
('2023-10-27 07:46:29', NULL, 1, '', 3, 'Cash', NULL),
('2023-10-27 07:47:10', NULL, 1, '', 4, 'Cash', NULL),
('2023-10-27 07:49:10', NULL, 1, '', 5, 'Due', 'Ali'),
('2023-10-27 10:48:22', 9, 1, '', 6, 'Cash', NULL),
('2023-10-27 10:49:08', NULL, 1, '', 7, 'Cash', NULL);

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

--
-- Table structure for table `ospos_receivings_items`
--

CREATE TABLE `ospos_receivings_items` (
  `receiving_id` int(10) NOT NULL DEFAULT 0,
  `item_id` int(10) NOT NULL DEFAULT 0,
  `description` varchar(30) DEFAULT NULL,
  `serialnumber` varchar(30) DEFAULT NULL,
  `line` int(3) NOT NULL,
  `quantity_purchased` decimal(15,3) NOT NULL DEFAULT 0.000,
  `item_cost_price` decimal(15,2) NOT NULL,
  `item_unit_price` decimal(15,2) NOT NULL,
  `discount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_type` tinyint(1) NOT NULL DEFAULT 0,
  `item_location` int(11) NOT NULL,
  `receiving_quantity` decimal(15,3) NOT NULL DEFAULT 1.000
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_receivings_items`
--

INSERT INTO `ospos_receivings_items` (`receiving_id`, `item_id`, `description`, `serialnumber`, `line`, `quantity_purchased`, `item_cost_price`, `item_unit_price`, `discount`, `discount_type`, `item_location`, `receiving_quantity`) VALUES
(1, 8, '', '', 1, '1.000', '150.00', '150.00', '15.00', 0, 1, '10.000'),
(2, 6, '', NULL, 1, '100.000', '0.00', '0.00', '0.00', 1, 1, '1.000'),
(2, 8, '', NULL, 2, '50.000', '150.00', '150.00', '15.00', 0, 1, '10.000'),
(3, 8, '', NULL, 1, '1.000', '150.00', '150.00', '15.00', 0, 1, '10.000'),
(4, 8, '', NULL, 1, '1.000', '150.00', '150.00', '15.00', 0, 1, '1.000'),
(5, 8, '', NULL, 1, '1.000', '150.00', '150.00', '15.00', 0, 1, '1.000'),
(6, 4, '', '', 2, '1.000', '10.00', '10.00', '15.00', 0, 1, '70.000'),
(6, 6, '', NULL, 1, '17.000', '0.00', '100.00', '15.00', 0, 1, '1.000'),
(6, 7, '', '', 3, '1.000', '100.00', '100.00', '15.00', 0, 1, '0.000'),
(7, 4, '', '', 1, '1.000', '10.00', '10.00', '15.00', 0, 1, '70.000'),
(7, 6, '', '', 2, '1.000', '0.00', '0.00', '15.00', 0, 1, '0.000'),
(7, 7, '', '', 3, '1.000', '100.00', '100.00', '15.00', 0, 1, '0.000');

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

--
-- Table structure for table `ospos_sales`
--

CREATE TABLE `ospos_sales` (
  `sale_time` timestamp NOT NULL DEFAULT current_timestamp(),
  `customer_id` int(10) DEFAULT NULL,
  `employee_id` int(10) NOT NULL DEFAULT 0,
  `comment` text DEFAULT NULL,
  `invoice_number` varchar(32) DEFAULT NULL,
  `quote_number` varchar(32) DEFAULT NULL,
  `sale_id` int(10) NOT NULL,
  `sale_status` tinyint(1) NOT NULL DEFAULT 0,
  `dinner_table_id` int(11) DEFAULT NULL,
  `work_order_number` varchar(32) DEFAULT NULL,
  `sale_type` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_sales`
--

INSERT INTO `ospos_sales` (`sale_time`, `customer_id`, `employee_id`, `comment`, `invoice_number`, `quote_number`, `sale_id`, `sale_status`, `dinner_table_id`, `work_order_number`, `sale_type`) VALUES
('2023-10-26 04:17:59', NULL, 1, '', NULL, NULL, 1, 0, NULL, NULL, 0),
('2023-10-26 15:04:07', NULL, 1, '', NULL, NULL, 2, 0, NULL, NULL, 0),
('2023-10-27 06:31:08', NULL, 1, '', NULL, NULL, 3, 0, NULL, NULL, 4),
('2023-10-27 07:05:20', 8, 1, '', NULL, NULL, 4, 0, NULL, NULL, 0),
('2023-10-27 07:08:04', 8, 1, '', '0', NULL, 5, 0, NULL, NULL, 1),
('2023-10-27 07:09:06', 8, 1, '', NULL, NULL, 6, 0, NULL, NULL, 0),
('2023-10-27 07:09:48', NULL, 1, '', NULL, NULL, 7, 0, NULL, NULL, 0),
('2023-10-27 07:10:33', 2, 1, '', NULL, 'Q23000001', 8, 2, NULL, NULL, 3),
('2023-10-27 07:11:07', 8, 1, '', NULL, NULL, 9, 0, NULL, NULL, 4),
('2023-10-27 07:12:54', NULL, 1, '', NULL, NULL, 10, 0, NULL, NULL, 0),
('2023-10-27 07:21:30', NULL, 1, '', NULL, NULL, 11, 0, NULL, NULL, 4),
('2023-10-27 07:22:12', NULL, 1, '', NULL, NULL, 12, 0, NULL, NULL, 0),
('2023-10-27 07:22:44', NULL, 1, '', NULL, NULL, 13, 0, NULL, NULL, 0),
('2023-10-27 07:23:56', NULL, 1, '', NULL, NULL, 14, 0, NULL, NULL, 0),
('2023-10-27 07:25:46', NULL, 1, '', NULL, NULL, 15, 0, NULL, NULL, 0),
('2023-10-27 07:50:11', NULL, 1, '', NULL, NULL, 16, 0, NULL, NULL, 0),
('2023-10-27 07:50:42', 2, 1, '', '1', NULL, 17, 0, NULL, NULL, 1),
('2023-10-27 07:51:08', 8, 1, '', NULL, NULL, 18, 0, NULL, NULL, 0),
('2023-10-27 07:51:13', 2, 1, '', '2', NULL, 19, 0, NULL, NULL, 1),
('2023-10-27 07:52:47', NULL, 1, '', NULL, NULL, 20, 0, NULL, NULL, 0),
('2023-10-27 07:53:40', NULL, 1, '', NULL, NULL, 21, 0, NULL, NULL, 0),
('2023-10-27 07:54:09', NULL, 1, '', NULL, NULL, 22, 0, NULL, NULL, 0),
('2023-10-27 07:54:33', NULL, 1, '', NULL, NULL, 23, 0, NULL, NULL, 0),
('2023-10-27 07:55:55', NULL, 1, '', NULL, NULL, 24, 0, NULL, NULL, 0);

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

--
-- Table structure for table `ospos_sales_items`
--

CREATE TABLE `ospos_sales_items` (
  `sale_id` int(10) NOT NULL DEFAULT 0,
  `item_id` int(10) NOT NULL DEFAULT 0,
  `description` varchar(255) DEFAULT NULL,
  `serialnumber` varchar(30) DEFAULT NULL,
  `line` int(3) NOT NULL DEFAULT 0,
  `quantity_purchased` decimal(15,3) NOT NULL DEFAULT 0.000,
  `item_cost_price` decimal(15,2) NOT NULL,
  `item_unit_price` decimal(15,2) NOT NULL,
  `discount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `discount_type` tinyint(1) NOT NULL DEFAULT 0,
  `item_location` int(11) NOT NULL,
  `print_option` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_sales_items`
--

INSERT INTO `ospos_sales_items` (`sale_id`, `item_id`, `description`, `serialnumber`, `line`, `quantity_purchased`, `item_cost_price`, `item_unit_price`, `discount`, `discount_type`, `item_location`, `print_option`) VALUES
(1, 1, '', '', 1, '1.000', '100.00', '110.00', '0.00', 0, 1, 0),
(2, 1, '', '', 1, '1.000', '100.00', '110.00', '5.00', 0, 1, 0),
(3, 1, '', '', 1, '1.000', '100.00', '110.00', '5.00', 0, 2, 0),
(4, 2, '', '', 1, '1.000', '150.00', '60.00', '5.00', 0, 1, 0),
(5, 2, '', '', 1, '2.000', '150.00', '60.00', '5.00', 1, 1, 0),
(6, 2, '', '', 1, '1.000', '150.00', '60.00', '55.00', 1, 1, 0),
(7, 2, '', '', 1, '1.000', '150.00', '60.00', '5.00', 0, 1, 0),
(8, 2, '', '', 1, '1.000', '150.00', '60.00', '5.00', 0, 1, 0),
(9, 2, '', '', 1, '-1.000', '150.00', '60.00', '5.00', 0, 1, 0),
(10, 2, '', '', 1, '1.000', '150.00', '60.00', '5.00', 0, 1, 0),
(11, 3, '', '', 1, '1.000', '0.00', '1000.00', '5.00', 0, 1, 0),
(12, 3, '', '', 1, '1000.000', '0.00', '100.00', '5.00', 0, 1, 0),
(13, 4, '', '', 1, '500.000', '10.00', '152.00', '5.00', 0, 1, 0),
(14, 5, '', '', 1, '1.000', '0.00', '100.00', '5.00', 1, 1, 0),
(15, 4, '', '', 1, '2.000', '10.00', '152.00', '5.00', 0, 1, 0),
(16, 5, '', '', 1, '1.000', '0.00', '100.00', '5.00', 0, 1, 0),
(16, 6, '', '', 2, '1.000', '0.00', '0.00', '0.00', 0, 1, 0),
(17, 6, '', '', 1, '1.000', '0.00', '100.00', '5.00', 0, 1, 0),
(18, 8, '', '', 1, '1.000', '150.00', '250.00', '5.00', 0, 1, 0),
(19, 6, '', '', 1, '1.000', '0.00', '100.00', '5.00', 0, 1, 0),
(20, 6, '', '', 1, '1.000', '0.00', '0.00', '0.00', 0, 1, 0),
(21, 8, '', '', 1, '10.000', '150.00', '0.00', '0.00', 0, 1, 0),
(22, 8, '', '', 1, '100.000', '150.00', '0.00', '0.00', 0, 1, 0),
(23, 8, '', '', 1, '100.000', '150.00', '250.00', '5.00', 0, 1, 0),
(24, 6, '', '', 2, '90.000', '0.00', '0.00', '0.00', 0, 1, 0);

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

--
-- Table structure for table `ospos_sales_items_taxes`
--

CREATE TABLE `ospos_sales_items_taxes` (
  `sale_id` int(10) NOT NULL,
  `item_id` int(10) NOT NULL,
  `line` int(3) NOT NULL DEFAULT 0,
  `name` varchar(255) NOT NULL,
  `percent` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `tax_type` tinyint(1) NOT NULL DEFAULT 0,
  `rounding_code` tinyint(1) NOT NULL DEFAULT 0,
  `cascade_sequence` tinyint(1) NOT NULL DEFAULT 0,
  `item_tax_amount` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `sales_tax_code_id` int(11) DEFAULT NULL,
  `jurisdiction_id` int(11) DEFAULT NULL,
  `tax_category_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_sales_items_taxes`
--

INSERT INTO `ospos_sales_items_taxes` (`sale_id`, `item_id`, `line`, `name`, `percent`, `tax_type`, `rounding_code`, `cascade_sequence`, `item_tax_amount`, `sales_tax_code_id`, `jurisdiction_id`, `tax_category_id`) VALUES
(13, 4, 1, '', '17.0000', 0, 1, 0, '10490.5983', NULL, NULL, NULL),
(15, 4, 1, '', '17.0000', 0, 1, 0, '41.9624', NULL, NULL, NULL),
(18, 8, 1, '', '17.0000', 0, 1, 0, '34.5086', NULL, NULL, NULL),
(21, 8, 1, '', '17.0000', 0, 1, 0, '0.0000', NULL, NULL, NULL),
(22, 8, 1, '', '17.0000', 0, 1, 0, '0.0000', NULL, NULL, NULL),
(23, 8, 1, '', '17.0000', 0, 1, 0, '3450.8548', NULL, NULL, NULL);

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

--
-- Table structure for table `ospos_sales_payments`
--

CREATE TABLE `ospos_sales_payments` (
  `payment_id` int(11) NOT NULL,
  `sale_id` int(10) NOT NULL,
  `payment_type` varchar(40) NOT NULL,
  `payment_amount` decimal(15,2) NOT NULL,
  `cash_refund` decimal(15,2) NOT NULL DEFAULT 0.00,
  `cash_adjustment` tinyint(4) NOT NULL DEFAULT 0,
  `employee_id` int(11) DEFAULT NULL,
  `payment_time` timestamp NOT NULL DEFAULT current_timestamp(),
  `reference_code` varchar(40) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_sales_payments`
--

INSERT INTO `ospos_sales_payments` (`payment_id`, `sale_id`, `payment_type`, `payment_amount`, `cash_refund`, `cash_adjustment`, `employee_id`, `payment_time`, `reference_code`) VALUES
(1, 1, 'Cash', '110.00', '0.00', 0, 1, '2023-10-26 13:17:59', ''),
(2, 2, 'Cash', '104.50', '0.00', 0, 1, '2023-10-26 15:04:07', ''),
(3, 4, 'Cash', '57.00', '0.00', 0, 1, '2023-10-27 07:05:20', ''),
(4, 5, 'Cash', '110.00', '0.00', 0, 1, '2023-10-27 07:08:04', ''),
(5, 6, 'Cash', '5.00', '0.00', 0, 1, '2023-10-27 07:09:06', ''),
(6, 7, 'Cash', '100.00', '43.00', 0, 1, '2023-10-27 07:09:48', ''),
(7, 8, 'Cash', '60.00', '3.00', 0, 1, '2023-10-27 07:10:33', ''),
(8, 9, 'Cash', '-57.00', '0.00', 0, 1, '2023-10-27 07:11:07', ''),
(9, 10, 'Debit Card', '57.00', '0.00', 0, 1, '2023-10-27 07:12:54', ''),
(10, 12, 'Cash', '95000.00', '0.00', 0, 1, '2023-10-27 07:22:12', ''),
(11, 13, 'Cash', '72200.00', '0.00', 0, 1, '2023-10-27 07:22:44', ''),
(12, 14, 'Cash', '95.00', '0.00', 0, 1, '2023-10-27 07:23:56', ''),
(13, 15, 'Cash', '288.80', '0.00', 0, 1, '2023-10-27 07:25:46', ''),
(14, 16, 'Cash', '95.00', '0.00', 0, 1, '2023-10-27 07:50:11', ''),
(15, 18, 'Gift Card:1', '200.00', '0.00', 0, 1, '2023-10-27 07:51:08', ''),
(16, 18, 'Cash', '37.50', '0.00', 0, 1, '2023-10-27 07:51:08', ''),
(17, 23, 'Cash', '23750.00', '0.00', 0, 1, '2023-10-27 07:54:33', '');

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

--
-- Table structure for table `ospos_sales_reward_points`
--

CREATE TABLE `ospos_sales_reward_points` (
  `id` int(11) NOT NULL,
  `sale_id` int(11) NOT NULL,
  `earned` float NOT NULL,
  `used` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `ospos_sales_taxes`
--

CREATE TABLE `ospos_sales_taxes` (
  `sales_taxes_id` int(11) NOT NULL,
  `sale_id` int(10) NOT NULL,
  `jurisdiction_id` int(11) DEFAULT NULL,
  `tax_category_id` int(11) DEFAULT NULL,
  `tax_type` smallint(2) NOT NULL,
  `tax_group` varchar(32) NOT NULL,
  `sale_tax_basis` decimal(15,4) NOT NULL,
  `sale_tax_amount` decimal(15,4) NOT NULL,
  `print_sequence` tinyint(1) NOT NULL DEFAULT 0,
  `name` varchar(255) NOT NULL,
  `tax_rate` decimal(15,4) NOT NULL,
  `sales_tax_code_id` int(11) DEFAULT NULL,
  `rounding_code` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_sales_taxes`
--

INSERT INTO `ospos_sales_taxes` (`sales_taxes_id`, `sale_id`, `jurisdiction_id`, `tax_category_id`, `tax_type`, `tax_group`, `sale_tax_basis`, `sale_tax_amount`, `print_sequence`, `name`, `tax_rate`, `sales_tax_code_id`, `rounding_code`) VALUES
(1, 13, NULL, NULL, 0, '', '72200.0000', '10490.6000', 1, '', '17.0000', NULL, 1),
(2, 15, NULL, NULL, 0, '', '288.8000', '41.9600', 1, '', '17.0000', NULL, 1),
(3, 18, NULL, NULL, 0, '', '237.5000', '34.5100', 1, '', '17.0000', NULL, 1),
(4, 23, NULL, NULL, 0, '', '23750.0000', '3450.8500', 1, '', '17.0000', NULL, 1);

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

--
-- Table structure for table `ospos_sessions`
--

CREATE TABLE `ospos_sessions` (
  `id` varchar(40) NOT NULL,
  `ip_address` varchar(45) NOT NULL,
  `timestamp` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `data` mediumblob NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_sessions`
--

INSERT INTO `ospos_sessions` (`id`, `ip_address`, `timestamp`, `data`) VALUES
('8qnidhgqb71lkh784eus691g9l0frjle', '::1', 1698384498, 0x5f5f63695f6c6173745f726567656e65726174657c693a313639383338343439383b),
('n5o1ckad8b2j4eo8q58qsk6galk2fect', '192.168.100.20', 1698385032, 0x5f5f63695f6c6173745f726567656e65726174657c693a313639383338353033323b706572736f6e5f69647c733a313a2231223b6d656e755f67726f75707c733a363a226f6666696365223b),
('i31s0ne131cqiv72h1iat8fnbffjqbft', '::1', 1698385458, 0x5f5f63695f6c6173745f726567656e65726174657c693a313639383338353435383b706572736f6e5f69647c733a313a2231223b6d656e755f67726f75707c733a343a22686f6d65223b),
('l38h3rktn5906e92ql3n19i3mutln7kf', '192.168.100.20', 1698385569, 0x5f5f63695f6c6173745f726567656e65726174657c693a313639383338353536393b706572736f6e5f69647c733a313a2231223b6d656e755f67726f75707c733a363a226f6666696365223b),
('j0omd0i7nlg0bp7khd0te1icoa38kff8', '::1', 1698385812, 0x5f5f63695f6c6173745f726567656e65726174657c693a313639383338353831323b706572736f6e5f69647c733a313a2231223b6d656e755f67726f75707c733a363a226f6666696365223b),
('48phd9uej4o0ceun5nhasj3ojhdntjv1', '192.168.100.20', 1698385963, 0x5f5f63695f6c6173745f726567656e65726174657c693a313639383338353936333b706572736f6e5f69647c733a313a2231223b6d656e755f67726f75707c733a363a226f6666696365223b),
('taa5vb4va6h2dqq4okjn4ln6nck53fa3', '::1', 1698386184, 0x5f5f63695f6c6173745f726567656e65726174657c693a313639383338363138343b706572736f6e5f69647c733a313a2231223b6d656e755f67726f75707c733a363a226f6666696365223b),
('n95f9ton288qla8gj2j6narda6l4at85', '192.168.100.20', 1698387083, 0x5f5f63695f6c6173745f726567656e65726174657c693a313639383338373038333b706572736f6e5f69647c733a313a2231223b6d656e755f67726f75707c733a363a226f6666696365223b),
('mvbsplrltg5t7dent1pe9mjf87uciq7s', '::1', 1698387083, 0x5f5f63695f6c6173745f726567656e65726174657c693a313639383338373038333b706572736f6e5f69647c733a313a2231223b6d656e755f67726f75707c733a363a226f6666696365223b),
('j0tsf22ktmp94u0lm9b6racpham5dqg7', '127.0.0.1', 1698386945, 0x5f5f63695f6c6173745f726567656e65726174657c693a313639383338363934353b),
('pnu97o56jouoc9sj77qak1qoqmnkphr3', '::1', 1698387474, 0x[BLOB]),
('0lf562pc8uu5vmm6o1vpst4ohnrbmvua', '192.168.100.20', 1698387409, 0x[BLOB]),
('49jgcb9jshrjrtveqmpj36dlllu98gs4', '192.168.100.20', 1698387911, 0x[BLOB]),
('7i3q2n6drt882cabn39khb9t4m6he630', '::1', 1698387978, 0x[BLOB]),
('28m0kndch5rruclirqoa9t39envll4jk', '192.168.100.20', 1698388220, 0x[BLOB]),
('i5sc96s1o9lgqms0f8cb7bp0jbhpgjnt', '::1', 1698388366, 0x[BLOB]),
('j2c072icvbm1cciqgbvrjggkn54p2cnq', '192.168.100.20', 1698388654, 0x[BLOB]),
('rk5vgb87mma7uoj88p7lou163vjvfr14', '::1', 1698388891, 0x[BLOB]),
('6o3envgtv9klgd6r3crkg3r0ljc89hrb', '192.168.100.20', 1698389349, 0x[BLOB]),
('0jfge42g0bq552782v12qemmj4pagnl2', '::1', 1698390194, 0x[BLOB]),
('8tbcccups5n32drjoq9asg2m8u1r10sj', '192.168.100.20', 1698389688, 0x[BLOB]),
('616tps6r74b88rp0f7n9q6i45m7pcs2f', '192.168.100.20', 1698390218, 0x[BLOB]),
('djkc5et3v8gc8sf09nca93pmnnvv8k43', '::1', 1698390902, 0x[BLOB]),
('v7qt3vc64m44vgt0trk5u3a42qe2jqvs', '192.168.100.20', 1698390527, 0x[BLOB]),
('97lgo5inqs9fr6ou6e2nnm2rb2qdcnrt', '192.168.100.20', 1698390907, 0x[BLOB]),
('qdp2lbtsqncugm3rj538otakfmsq9pk8', '::1', 1698391264, 0x[BLOB]),
('roroejh818ckjvv8se93p0qam2tsmlla', '192.168.100.20', 1698391303, 0x[BLOB]),
('td6v8cud71rtsuqjgtrlc5cbsrvfillg', '::1', 1698391573, 0x[BLOB]),
('2mhm8im5rmhgso5gieb003lidfgdm0pq', '192.168.100.20', 1698391800, 0x[BLOB]),
('nm5td4v1c80k0apqfrb9smjjsp6v9oco', '::1', 1698391916, 0x[BLOB]),
('2j5ritfon6lnbp20p1uucn8teu63nqkp', '192.168.100.20', 1698392142, 0x[BLOB]),
('eg4et8e98sc6giuvrolkcnu108q3ntl2', '::1', 1698392407, 0x[BLOB]),
('op18of0m8uiv5r8livc0grttig2oi01l', '192.168.100.20', 1698392731, 0x[BLOB]),
('la63add53b5ll3goifsliqqsqugrtrlv', '::1', 1698392710, 0x[BLOB]),
('tvai109ia57dr91impi9on8o46jnn8fr', '::1', 1698393011, 0x[BLOB]),
('5vdcni2147g3nh8ms4ruu766k9v6sq9n', '192.168.100.20', 1698393035, 0x[BLOB]),
('shlsqmp5e92qv2dfubahreqvtn934p52', '::1', 1698393324, 0x[BLOB]),
('hpkv8ff2mndcjfqt64p5rje8epqqocjn', '192.168.100.20', 1698393375, 0x[BLOB]);
INSERT INTO `ospos_sessions` (`id`, `ip_address`, `timestamp`, `data`) VALUES
('o17v4f2n56vvbogku5tl8la9s52li33c', '::1', 1698393852, 0x[BLOB]),
('k1tuaa3g8513797i9891629hksf7u171', '192.168.100.20', 1698393771, 0x[BLOB]),
('btn2egcbgddlkej0v5p1tls5m1cbni05', '192.168.100.20', 1698394196, 0x[BLOB]),
('tjom5k6mpmv3d5lsjmq3kde6qrullp45', '::1', 1698399944, 0x[BLOB]),
('6h6e9052knhj7dmf9gnefppc8l56htla', '192.168.100.20', 1698395883, 0x[BLOB]),
('tjb01n0dk9t65e0j9tqaf1vecufiv3fi', '192.168.100.20', 1698399950, 0x[BLOB]),
('m4rkd6g2ue57s443l61n1ivqr873rkbk', '::1', 1698400670, 0x[BLOB]),
('aobhcd5v643uenglnkmu7fsvmmsui7ef', '192.168.100.20', 1698400549, 0x[BLOB]),
('0uu0116sqrcf1pstjo865uh60kfnmmoe', '::1', 1698401135, 0x[BLOB]),
('mrsrb1p8vcei16ccb40vnlhc9r4lo7gr', '192.168.100.20', 1698402159, 0x5f5f63695f6c6173745f726567656e65726174657c693a313639383430323135393b706572736f6e5f69647c733a313a2233223b6d656e755f67726f75707c733a363a226f6666696365223b),
('1e6soqfrnkkpcev73pu149i8u6p5gujn', '::1', 1698401520, 0x[BLOB]),
('unui61eq6ngl5lca75a1h16u2tjepn5e', '::1', 1698402187, 0x[BLOB]),
('r1hott6cvr91mdf21n81bq2hlp5451de', '192.168.100.20', 1698403503, 0x[BLOB]),
('urjegtenggpm888bmeorkh9lku5n1mq2', '::1', 1698402504, 0x[BLOB]),
('se1s26b859suc1gn4qk0u9siv29drl6h', '::1', 1698402911, 0x[BLOB]),
('674st78vitg2skcrho646h48ouamhr90', '::1', 1698403217, 0x[BLOB]),
('l92h3bsg92nhis7so11h8an8ev6ffhcd', '::1', 1698403523, 0x[BLOB]),
('aij6s97f4fgipclrt94mgrdmdm0gbd97', '192.168.100.20', 1698405203, 0x[BLOB]),
('gp7mrdgosvcp5kfgeqiqlhrfe6m31hs0', '::1', 1698403875, 0x[BLOB]);
INSERT INTO `ospos_sessions` (`id`, `ip_address`, `timestamp`, `data`) VALUES
('uvb0k69lmkd866rcv3dj82u3967vlcs8', '::1', 1698404178, 0x[BLOB]),
('ejoo0nd0gf3bhaqmouhfrjds6brcmc2d', '::1', 1698404484, 0x[BLOB]),
('qq8s6jie34ovikr4nr4strspoo8gr4un', '::1', 1698404796, 0x[BLOB]),
('q12ilk7b0vj7f84drnf7790m0hlafcq8', '::1', 1698405141, 0x[BLOB]),
('7r5p4s600vkltag5nuitf1mqbmu78boi', '::1', 1698405453, 0x[BLOB]),
('jaj257095t2siq1biveju9phbu342dkd', '192.168.100.20', 1698406172, 0x[BLOB]),
('8gn1i3cd8d792fp3jncrn88mr2gjue7v', '::1', 1698406031, 0x[BLOB]),
('p70mbdibsbi7topo2clubppp6rb0je71', '::1', 1698406350, 0x[BLOB]),
('rqkjb19g220v7k2pu0ah4cu5vkq7qne2', '192.168.100.20', 1698406618, 0x[BLOB]),
('qgj9qv50bm7qv57eg0dhpum1cdn15b1i', '::1', 1698406982, 0x[BLOB]),
('frfuhvlu7tbb8b9sjqcssgrlkaibupsc', '192.168.100.20', 1698406714, 0x[BLOB]);
INSERT INTO `ospos_sessions` (`id`, `ip_address`, `timestamp`, `data`) VALUES
('f0cnv4gdaq8v7p175j7ssbjos1grp60h', '::1', 1698407284, 0x[BLOB]),
('teduhhe06p77tnn0qjsjfdd9bs05foua', '::1', 1698407591, 0x[BLOB]),
('9gmtsjt41d3rj49k98ciq167hrnihh7f', '::1', 1698407920, 0x[BLOB]),
('08mm8cmht6gpv378f9dcqstlhjp7olf7', '::1', 1698408320, 0x[BLOB]),
('v4vljespb5k5jrtduf2erea5s8ck2l0u', '::1', 1698408626, 0x[BLOB]),
('fg2jv0lodn6rt8ijs4mbqprf8eut44r6', '::1', 1698408932, 0x[BLOB]),
('05u2enq3crj3l6rcvmpnu2ueilco173a', '::1', 1698409236, 0x[BLOB]),
('95d6pltshqpmi1jl18miqur6hsjel74o', '::1', 1698409675, 0x[BLOB]);
INSERT INTO `ospos_sessions` (`id`, `ip_address`, `timestamp`, `data`) VALUES
('bgk2pmqop5b01esctibtokus0ad9chv5', '::1', 1698409757, 0x[BLOB]);

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

--
-- Table structure for table `ospos_stock_locations`
--

CREATE TABLE `ospos_stock_locations` (
  `location_id` int(11) NOT NULL,
  `location_name` varchar(255) DEFAULT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_stock_locations`
--

INSERT INTO `ospos_stock_locations` (`location_id`, `location_name`, `deleted`) VALUES
(1, 'Parlour', 0),
(2, 'Room', 1);

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

--
-- Table structure for table `ospos_suppliers`
--

CREATE TABLE `ospos_suppliers` (
  `person_id` int(10) NOT NULL,
  `company_name` varchar(255) NOT NULL,
  `agency_name` varchar(255) NOT NULL,
  `account_number` varchar(255) DEFAULT NULL,
  `tax_id` varchar(32) NOT NULL DEFAULT '',
  `deleted` tinyint(1) NOT NULL DEFAULT 0,
  `category` tinyint(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `ospos_suppliers`
--

INSERT INTO `ospos_suppliers` (`person_id`, `company_name`, `agency_name`, `account_number`, `tax_id`, `deleted`, `category`) VALUES
(9, 'Ponds', 'Ponds', NULL, '', 1, 0),
(10, 'Ponds', 'Ponds', NULL, '', 1, 1),
(11, 'Nestle', '', '21321wqe', '123qwe', 1, 1);

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

--
-- Table structure for table `ospos_tax_categories`
--

CREATE TABLE `ospos_tax_categories` (
  `tax_category_id` int(10) NOT NULL,
  `tax_category` varchar(32) NOT NULL,
  `tax_group_sequence` tinyint(1) NOT NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `ospos_tax_codes`
--

CREATE TABLE `ospos_tax_codes` (
  `tax_code_id` int(11) NOT NULL,
  `tax_code` varchar(32) NOT NULL,
  `tax_code_name` varchar(255) NOT NULL DEFAULT '',
  `city` varchar(255) NOT NULL DEFAULT '',
  `state` varchar(255) NOT NULL DEFAULT '',
  `deleted` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `ospos_tax_jurisdictions`
--

CREATE TABLE `ospos_tax_jurisdictions` (
  `jurisdiction_id` int(11) NOT NULL,
  `jurisdiction_name` varchar(255) DEFAULT NULL,
  `tax_group` varchar(32) NOT NULL,
  `tax_type` smallint(2) NOT NULL,
  `reporting_authority` varchar(255) DEFAULT NULL,
  `tax_group_sequence` tinyint(1) NOT NULL DEFAULT 0,
  `cascade_sequence` tinyint(1) NOT NULL DEFAULT 0,
  `deleted` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `ospos_tax_rates`
--

CREATE TABLE `ospos_tax_rates` (
  `tax_rate_id` int(11) NOT NULL,
  `rate_tax_code_id` int(11) NOT NULL,
  `rate_tax_category_id` int(10) NOT NULL,
  `rate_jurisdiction_id` int(11) NOT NULL,
  `tax_rate` decimal(15,4) NOT NULL DEFAULT 0.0000,
  `tax_rounding_code` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Indexes for table `ospos_attribute_definitions`
--
ALTER TABLE `ospos_attribute_definitions`
  ADD PRIMARY KEY (`definition_id`),
  ADD KEY `definition_fk` (`definition_fk`),
  ADD KEY `definition_name` (`definition_name`),
  ADD KEY `definition_type` (`definition_type`);

--
-- Indexes for table `ospos_attribute_links`
--
ALTER TABLE `ospos_attribute_links`
  ADD UNIQUE KEY `attribute_links_uq1` (`attribute_id`,`definition_id`,`item_id`,`sale_id`,`receiving_id`),
  ADD UNIQUE KEY `attribute_links_uq2` (`item_id`,`sale_id`,`receiving_id`,`definition_id`,`attribute_id`),
  ADD KEY `attribute_id` (`attribute_id`),
  ADD KEY `definition_id` (`definition_id`),
  ADD KEY `item_id` (`item_id`),
  ADD KEY `sale_id` (`sale_id`),
  ADD KEY `receiving_id` (`receiving_id`);

--
-- Indexes for table `ospos_attribute_values`
--
ALTER TABLE `ospos_attribute_values`
  ADD PRIMARY KEY (`attribute_id`),
  ADD UNIQUE KEY `attribute_value` (`attribute_value`),
  ADD UNIQUE KEY `attribute_date` (`attribute_date`),
  ADD UNIQUE KEY `attribute_decimal` (`attribute_decimal`);

--
-- Indexes for table `ospos_cash_up`
--
ALTER TABLE `ospos_cash_up`
  ADD PRIMARY KEY (`cashup_id`),
  ADD KEY `open_employee_id` (`open_employee_id`),
  ADD KEY `close_employee_id` (`close_employee_id`);

--
-- Indexes for table `ospos_customers`
--
ALTER TABLE `ospos_customers`
  ADD PRIMARY KEY (`person_id`),
  ADD UNIQUE KEY `account_number` (`account_number`),
  ADD KEY `package_id` (`package_id`),
  ADD KEY `sales_tax_code_id` (`sales_tax_code_id`),
  ADD KEY `company_name` (`company_name`);

--
-- Indexes for table `ospos_customers_packages`
--
ALTER TABLE `ospos_customers_packages`
  ADD PRIMARY KEY (`package_id`);

--
-- Indexes for table `ospos_customers_points`
--
ALTER TABLE `ospos_customers_points`
  ADD PRIMARY KEY (`id`),
  ADD KEY `person_id` (`person_id`),
  ADD KEY `package_id` (`package_id`),
  ADD KEY `sale_id` (`sale_id`);

--
-- Indexes for table `ospos_dinner_tables`
--
ALTER TABLE `ospos_dinner_tables`
  ADD PRIMARY KEY (`dinner_table_id`),
  ADD KEY `status` (`status`);

--
-- Indexes for table `ospos_expenses`
--
ALTER TABLE `ospos_expenses`
  ADD PRIMARY KEY (`expense_id`),
  ADD KEY `expense_category_id` (`expense_category_id`),
  ADD KEY `employee_id` (`employee_id`),
  ADD KEY `ospos_expenses_ibfk_3` (`supplier_id`),
  ADD KEY `date` (`date`),
  ADD KEY `payment_type` (`payment_type`),
  ADD KEY `amount` (`amount`);

--
-- Indexes for table `ospos_expense_categories`
--
ALTER TABLE `ospos_expense_categories`
  ADD PRIMARY KEY (`expense_category_id`),
  ADD UNIQUE KEY `category_name` (`category_name`),
  ADD KEY `category_description` (`category_description`);

--
-- Indexes for table `ospos_giftcards`
--
ALTER TABLE `ospos_giftcards`
  ADD PRIMARY KEY (`giftcard_id`),
  ADD UNIQUE KEY `giftcard_number` (`giftcard_number`),
  ADD KEY `person_id` (`person_id`);

--
-- Indexes for table `ospos_grants`
--
ALTER TABLE `ospos_grants`
  ADD PRIMARY KEY (`permission_id`,`person_id`);

--
-- Indexes for table `ospos_inventory`
--
ALTER TABLE `ospos_inventory`
  ADD PRIMARY KEY (`trans_id`),
  ADD KEY `trans_items` (`trans_items`),
  ADD KEY `trans_user` (`trans_user`),
  ADD KEY `trans_location` (`trans_location`),
  ADD KEY `trans_date` (`trans_date`);

--
-- Indexes for table `ospos_items`
--
ALTER TABLE `ospos_items`
  ADD PRIMARY KEY (`item_id`),
  ADD UNIQUE KEY `items_uq1` (`supplier_id`,`item_id`,`deleted`,`item_type`),
  ADD KEY `item_number` (`item_number`),
  ADD KEY `supplier_id` (`supplier_id`),
  ADD KEY `deleted` (`deleted`,`item_type`);

--
-- Indexes for table `ospos_items_taxes`
--
ALTER TABLE `ospos_items_taxes`
  ADD PRIMARY KEY (`item_id`,`name`,`percent`);

--
-- Indexes for table `ospos_item_kits`
--
ALTER TABLE `ospos_item_kits`
  ADD PRIMARY KEY (`item_kit_id`),
  ADD KEY `item_kit_number` (`item_kit_number`),
  ADD KEY `name` (`name`,`description`);

--
-- Indexes for table `ospos_item_kit_items`
--
ALTER TABLE `ospos_item_kit_items`
  ADD PRIMARY KEY (`item_kit_id`,`item_id`,`quantity`),
  ADD KEY `ospos_item_kit_items_ibfk_2` (`item_id`);

--
-- Indexes for table `ospos_item_quantities`
--
ALTER TABLE `ospos_item_quantities`
  ADD PRIMARY KEY (`item_id`,`location_id`),
  ADD KEY `item_id` (`item_id`),
  ADD KEY `location_id` (`location_id`);

--
-- Indexes for table `ospos_modules`
--
ALTER TABLE `ospos_modules`
  ADD PRIMARY KEY (`module_id`),
  ADD UNIQUE KEY `desc_lang_key` (`desc_lang_key`),
  ADD UNIQUE KEY `name_lang_key` (`name_lang_key`);

--
-- Indexes for table `ospos_people`
--
ALTER TABLE `ospos_people`
  ADD PRIMARY KEY (`person_id`),
  ADD KEY `email` (`email`),
  ADD KEY `first_name` (`first_name`,`last_name`,`email`,`phone_number`);

--
-- Indexes for table `ospos_permissions`
--
ALTER TABLE `ospos_permissions`
  ADD PRIMARY KEY (`permission_id`),
  ADD KEY `module_id` (`module_id`);

--
-- Indexes for table `ospos_receivings`
--
ALTER TABLE `ospos_receivings`
  ADD PRIMARY KEY (`receiving_id`),
  ADD KEY `supplier_id` (`supplier_id`),
  ADD KEY `employee_id` (`employee_id`),
  ADD KEY `reference` (`reference`),
  ADD KEY `receiving_time` (`receiving_time`);

--
-- Indexes for table `ospos_receivings_items`
--
ALTER TABLE `ospos_receivings_items`
  ADD PRIMARY KEY (`receiving_id`,`item_id`,`line`),
  ADD KEY `item_id` (`item_id`);

--
-- Indexes for table `ospos_sales`
--
ALTER TABLE `ospos_sales`
  ADD PRIMARY KEY (`sale_id`),
  ADD UNIQUE KEY `invoice_number` (`invoice_number`),
  ADD KEY `customer_id` (`customer_id`),
  ADD KEY `employee_id` (`employee_id`),
  ADD KEY `sale_time` (`sale_time`),
  ADD KEY `dinner_table_id` (`dinner_table_id`);

--
-- Indexes for table `ospos_sales_items`
--
ALTER TABLE `ospos_sales_items`
  ADD PRIMARY KEY (`sale_id`,`item_id`,`line`),
  ADD KEY `sale_id` (`sale_id`),
  ADD KEY `item_id` (`item_id`),
  ADD KEY `item_location` (`item_location`);

--
-- Indexes for table `ospos_sales_items_taxes`
--
ALTER TABLE `ospos_sales_items_taxes`
  ADD PRIMARY KEY (`sale_id`,`item_id`,`line`,`name`,`percent`),
  ADD KEY `sale_id` (`sale_id`),
  ADD KEY `item_id` (`item_id`);

--
-- Indexes for table `ospos_sales_payments`
--
ALTER TABLE `ospos_sales_payments`
  ADD PRIMARY KEY (`payment_id`),
  ADD KEY `payment_sale` (`sale_id`,`payment_type`),
  ADD KEY `employee_id` (`employee_id`),
  ADD KEY `payment_time` (`payment_time`);

--
-- Indexes for table `ospos_sales_reward_points`
--
ALTER TABLE `ospos_sales_reward_points`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sale_id` (`sale_id`);

--
-- Indexes for table `ospos_sales_taxes`
--
ALTER TABLE `ospos_sales_taxes`
  ADD PRIMARY KEY (`sales_taxes_id`),
  ADD KEY `print_sequence` (`sale_id`,`print_sequence`,`tax_group`);

--
-- Indexes for table `ospos_sessions`
--
ALTER TABLE `ospos_sessions`
  ADD KEY `ci_sessions_timestamp` (`timestamp`),
  ADD KEY `id` (`id`),
  ADD KEY `ip_address` (`ip_address`);

--
-- Indexes for table `ospos_stock_locations`
--
ALTER TABLE `ospos_stock_locations`
  ADD PRIMARY KEY (`location_id`);

--
-- Indexes for table `ospos_suppliers`
--
ALTER TABLE `ospos_suppliers`
  ADD PRIMARY KEY (`person_id`),
  ADD UNIQUE KEY `account_number` (`account_number`),
  ADD KEY `person_id` (`person_id`),
  ADD KEY `category` (`category`),
  ADD KEY `company_name` (`company_name`,`deleted`);

--
-- Indexes for table `ospos_tax_categories`
--
ALTER TABLE `ospos_tax_categories`
  ADD PRIMARY KEY (`tax_category_id`);

--
-- Indexes for table `ospos_tax_codes`
--
ALTER TABLE `ospos_tax_codes`
  ADD PRIMARY KEY (`tax_code_id`);

--
-- Indexes for table `ospos_tax_jurisdictions`
--
ALTER TABLE `ospos_tax_jurisdictions`
  ADD PRIMARY KEY (`jurisdiction_id`),
  ADD UNIQUE KEY `tax_jurisdictions_uq1` (`tax_group`);

--
-- Indexes for table `ospos_tax_rates`
--
ALTER TABLE `ospos_tax_rates`
  ADD PRIMARY KEY (`tax_rate_id`),
  ADD KEY `rate_tax_category_id` (`rate_tax_category_id`),
  ADD KEY `rate_tax_code_id` (`rate_tax_code_id`),
  ADD KEY `rate_jurisdiction_id` (`rate_jurisdiction_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `ospos_attribute_definitions`
--
ALTER TABLE `ospos_attribute_definitions`
  MODIFY `definition_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `ospos_attribute_values`
--
ALTER TABLE `ospos_attribute_values`
  MODIFY `attribute_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `ospos_cash_up`
--
ALTER TABLE `ospos_cash_up`
  MODIFY `cashup_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `ospos_customers_packages`
--
ALTER TABLE `ospos_customers_packages`
  MODIFY `package_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `ospos_customers_points`
--
ALTER TABLE `ospos_customers_points`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ospos_dinner_tables`
--
ALTER TABLE `ospos_dinner_tables`
  MODIFY `dinner_table_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `ospos_expenses`
--
ALTER TABLE `ospos_expenses`
  MODIFY `expense_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `ospos_expense_categories`
--
ALTER TABLE `ospos_expense_categories`
  MODIFY `expense_category_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `ospos_giftcards`
--
ALTER TABLE `ospos_giftcards`
  MODIFY `giftcard_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `ospos_inventory`
--
ALTER TABLE `ospos_inventory`
  MODIFY `trans_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37;

--
-- AUTO_INCREMENT for table `ospos_items`
--
ALTER TABLE `ospos_items`
  MODIFY `item_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `ospos_item_kits`
--
ALTER TABLE `ospos_item_kits`
  MODIFY `item_kit_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `ospos_people`
--
ALTER TABLE `ospos_people`
  MODIFY `person_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `ospos_receivings`
--
ALTER TABLE `ospos_receivings`
  MODIFY `receiving_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `ospos_sales`
--
ALTER TABLE `ospos_sales`
  MODIFY `sale_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;

--
-- AUTO_INCREMENT for table `ospos_sales_payments`
--
ALTER TABLE `ospos_sales_payments`
  MODIFY `payment_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT for table `ospos_sales_reward_points`
--
ALTER TABLE `ospos_sales_reward_points`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ospos_sales_taxes`
--
ALTER TABLE `ospos_sales_taxes`
  MODIFY `sales_taxes_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `ospos_stock_locations`
--
ALTER TABLE `ospos_stock_locations`
  MODIFY `location_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `ospos_tax_categories`
--
ALTER TABLE `ospos_tax_categories`
  MODIFY `tax_category_id` int(10) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ospos_tax_codes`
--
ALTER TABLE `ospos_tax_codes`
  MODIFY `tax_code_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ospos_tax_jurisdictions`
--
ALTER TABLE `ospos_tax_jurisdictions`
  MODIFY `jurisdiction_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `ospos_tax_rates`
--
ALTER TABLE `ospos_tax_rates`
  MODIFY `tax_rate_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `ospos_attribute_definitions`
--
ALTER TABLE `ospos_attribute_definitions`
  ADD CONSTRAINT `fk_ospos_attribute_definitions_ibfk_1` FOREIGN KEY (`definition_fk`) REFERENCES `ospos_attribute_definitions` (`definition_id`);

--
-- Constraints for table `ospos_attribute_links`
--
ALTER TABLE `ospos_attribute_links`
  ADD CONSTRAINT `ospos_attribute_links_ibfk_1` FOREIGN KEY (`definition_id`) REFERENCES `ospos_attribute_definitions` (`definition_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ospos_attribute_links_ibfk_2` FOREIGN KEY (`attribute_id`) REFERENCES `ospos_attribute_values` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ospos_attribute_links_ibfk_3` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`),
  ADD CONSTRAINT `ospos_attribute_links_ibfk_4` FOREIGN KEY (`receiving_id`) REFERENCES `ospos_receivings` (`receiving_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `ospos_attribute_links_ibfk_5` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`);

--
-- Constraints for table `ospos_cash_up`
--
ALTER TABLE `ospos_cash_up`
  ADD CONSTRAINT `ospos_cash_up_ibfk_1` FOREIGN KEY (`open_employee_id`) REFERENCES `ospos_employees` (`person_id`),
  ADD CONSTRAINT `ospos_cash_up_ibfk_2` FOREIGN KEY (`close_employee_id`) REFERENCES `ospos_employees` (`person_id`);

--
-- Constraints for table `ospos_customers`
--
ALTER TABLE `ospos_customers`
  ADD CONSTRAINT `ospos_customers_ibfk_3` FOREIGN KEY (`sales_tax_code_id`) REFERENCES `ospos_tax_codes` (`tax_code_id`);

--
-- Constraints for table `ospos_expenses`
--
ALTER TABLE `ospos_expenses`
  ADD CONSTRAINT `ospos_expenses_ibfk_1` FOREIGN KEY (`expense_category_id`) REFERENCES `ospos_expense_categories` (`expense_category_id`),
  ADD CONSTRAINT `ospos_expenses_ibfk_2` FOREIGN KEY (`employee_id`) REFERENCES `ospos_employees` (`person_id`),
  ADD CONSTRAINT `ospos_expenses_ibfk_3` FOREIGN KEY (`supplier_id`) REFERENCES `ospos_suppliers` (`person_id`);

--
-- Constraints for table `ospos_sales_payments`
--
ALTER TABLE `ospos_sales_payments`
  ADD CONSTRAINT `ospos_sales_payments_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`),
  ADD CONSTRAINT `ospos_sales_payments_ibfk_2` FOREIGN KEY (`employee_id`) REFERENCES `ospos_employees` (`person_id`);

--
-- Constraints for table `ospos_tax_rates`
--
ALTER TABLE `ospos_tax_rates`
  ADD CONSTRAINT `ospos_tax_rates_ibfk_1` FOREIGN KEY (`rate_tax_category_id`) REFERENCES `ospos_tax_categories` (`tax_category_id`),
  ADD CONSTRAINT `ospos_tax_rates_ibfk_2` FOREIGN KEY (`rate_tax_code_id`) REFERENCES `ospos_tax_codes` (`tax_code_id`),
  ADD CONSTRAINT `ospos_tax_rates_ibfk_3` FOREIGN KEY (`rate_jurisdiction_id`) REFERENCES `ospos_tax_jurisdictions` (`jurisdiction_id`);
COMMIT;

