-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 15, 2022 at 12:03 PM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.2.8

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


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

--
-- Database: `eazzey_erp`
--

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

--
-- Table structure for table `fiscal_year`
--

CREATE TABLE `fiscal_year` (
  `id` int(11) NOT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `is_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `is_closed` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `items`
--

CREATE TABLE `items` (
  `id` int(11) NOT NULL,
  `item_name` varchar(255) NOT NULL,
  `item_code` varchar(255) NOT NULL,
  `barcode` varchar(255) DEFAULT NULL,
  `item_unit_id` int(11) DEFAULT NULL,
  `item_type_id` int(11) DEFAULT NULL,
  `item_group_id` int(11) DEFAULT NULL,
  `item_dpt_id` int(11) NOT NULL,
  `item_cat_id` int(11) DEFAULT NULL,
  `has_sizes` tinyint(1) NOT NULL DEFAULT '0',
  `parent_item_id` int(11) DEFAULT NULL,
  `size` varchar(255) DEFAULT NULL,
  `expires` datetime DEFAULT NULL,
  `item_desc` varchar(3000) DEFAULT NULL,
  `is_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `item_categories`
--

CREATE TABLE `item_categories` (
  `id` int(11) NOT NULL,
  `cat_name` varchar(300) NOT NULL,
  `cat_code` varchar(255) DEFAULT NULL,
  `is_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `item_cost`
--

CREATE TABLE `item_cost` (
  `id` int(11) NOT NULL,
  `cost_price` float NOT NULL,
  `selling_price` float NOT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT '1',
  `is_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `item_departments`
--

CREATE TABLE `item_departments` (
  `id` int(11) NOT NULL,
  `dpt_name` varchar(255) NOT NULL,
  `dpt_code` varchar(255) DEFAULT NULL,
  `is_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `item_groups`
--

CREATE TABLE `item_groups` (
  `id` int(11) NOT NULL,
  `group_name` int(11) NOT NULL,
  `is_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `item_stock`
--

CREATE TABLE `item_stock` (
  `id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `qty` float NOT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT '1',
  `is_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `item_taxes`
--

CREATE TABLE `item_taxes` (
  `id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `tax_location_id` int(11) NOT NULL,
  `is_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `item_tax_calculations`
--

CREATE TABLE `item_tax_calculations` (
  `id` int(11) NOT NULL,
  `item_id` int(11) NOT NULL,
  `tax_cal_type_id` int(11) NOT NULL,
  `is_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `item_types`
--

CREATE TABLE `item_types` (
  `id` int(11) NOT NULL,
  `en_type_name` varchar(255) NOT NULL,
  `code_name` varchar(255) NOT NULL,
  `is_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `item_types`
--

INSERT INTO `item_types` (`id`, `en_type_name`, `code_name`, `is_disabled`, `created`) VALUES
(1, 'Inventory', 'inventory', 0, '2022-12-13 23:25:39'),
(2, 'Non-Inventory', 'non_inventory', 0, '2022-12-13 23:25:39'),
(3, 'Services', 'services', 0, '2022-12-13 23:25:39');

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

--
-- Table structure for table `item_units`
--

CREATE TABLE `item_units` (
  `id` int(11) NOT NULL,
  `unit_name` varchar(255) NOT NULL,
  `unit_abbrev` varchar(255) NOT NULL,
  `add_custom_plural_abbrev` tinyint(1) NOT NULL DEFAULT '0',
  `unit_plural_abbrev` varchar(255) DEFAULT NULL,
  `is_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `item_units`
--

INSERT INTO `item_units` (`id`, `unit_name`, `unit_abbrev`, `add_custom_plural_abbrev`, `unit_plural_abbrev`, `is_disabled`, `created`) VALUES
(1, 'package', 'package', 1, 'packages', 0, '2022-12-13 23:05:55'),
(2, 'year', 'year', 1, 'years', 0, '2022-12-13 23:05:55'),
(3, 'month', 'month', 1, NULL, 0, '2022-12-13 23:05:55');

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

--
-- Table structure for table `tax_calculation_types`
--

CREATE TABLE `tax_calculation_types` (
  `id` int(11) NOT NULL,
  `en_tax_calculation_type_name` varchar(300) NOT NULL,
  `code_name` varchar(255) NOT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  `is_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tax_calculation_types`
--

INSERT INTO `tax_calculation_types` (`id`, `en_tax_calculation_type_name`, `code_name`, `is_default`, `is_disabled`, `created`) VALUES
(1, 'Not Applicable', 'none', 1, 0, '2022-12-15 12:16:26'),
(2, 'Normal', 'normal', 0, 0, '2022-12-15 12:16:26'),
(3, 'Cumulative', 'cumulative', 0, 0, '2022-12-15 12:16:26');

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

--
-- Table structure for table `tax_categories`
--

CREATE TABLE `tax_categories` (
  `id` int(11) NOT NULL,
  `en_tax_cat_name` varchar(255) NOT NULL,
  `code_name` varchar(255) NOT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  `is_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tax_categories`
--

INSERT INTO `tax_categories` (`id`, `en_tax_cat_name`, `code_name`, `is_default`, `is_disabled`, `created`) VALUES
(1, 'Not Applicable', 'none', 1, 0, '2022-12-15 12:38:35'),
(2, 'Exclusive', 'exclusive', 0, 0, '2022-12-15 12:38:35'),
(3, 'Inclusive', 'inclusive', 0, 0, '2022-12-15 12:38:35');

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

--
-- Table structure for table `tax_locations`
--

CREATE TABLE `tax_locations` (
  `id` int(11) NOT NULL,
  `tax_location_name` varchar(300) DEFAULT NULL,
  `tax_print_mark` varchar(255) DEFAULT NULL,
  `tax_code` varchar(50) DEFAULT NULL,
  `code_name` varchar(255) DEFAULT NULL,
  `has_fixed_rate` tinyint(1) NOT NULL DEFAULT '0',
  `has_ranges` tinyint(1) NOT NULL DEFAULT '0',
  `default_tax_rate` float NOT NULL,
  `is_default` tinyint(1) NOT NULL DEFAULT '0',
  `is_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `sort_by` int(11) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tax_locations`
--

INSERT INTO `tax_locations` (`id`, `tax_location_name`, `tax_print_mark`, `tax_code`, `code_name`, `has_fixed_rate`, `has_ranges`, `default_tax_rate`, `is_default`, `is_disabled`, `sort_by`, `created`) VALUES
(1, 'No Tax', 'NONE', '', 'none', 0, 0, 0, 1, 0, 1, '2022-12-15 12:06:12'),
(2, 'Exempted', 'EXP', '', 'exempted', 0, 0, 0, 0, 0, 2, '2022-12-15 12:06:12'),
(3, 'Local Exercise Duty', 'LED', '', 'led', 0, 0, 12, 0, 0, 3, '2022-12-15 12:06:12'),
(4, 'Value added tax', 'VAT', '', 'vat', 0, 0, 18, 0, 0, 4, '2022-12-15 12:06:12');

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

--
-- Table structure for table `tax_location_ranges`
--

CREATE TABLE `tax_location_ranges` (
  `id` int(11) NOT NULL,
  `tax_location_id` int(11) NOT NULL,
  `from_amount` float NOT NULL,
  `to_amount` float NOT NULL,
  `tax_rate` float NOT NULL,
  `is_disabled` tinyint(1) NOT NULL DEFAULT '0',
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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