-- phpMyAdmin SQL Dump
-- version 4.7.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Jun 01, 2018 at 12:27 PM
-- Server version: 5.6.35
-- PHP Version: 7.1.8

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

--
-- Database: `boq_estimator`
--

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

--
-- Table structure for table `address`
--

CREATE TABLE `address` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `address_id` int(11) NOT NULL,
  `address_type` int(3) NOT NULL,
  `line1` varchar(255) NOT NULL,
  `line2` varchar(255) NOT NULL,
  `line3` varchar(255) NOT NULL,
  `city` varchar(255) NOT NULL,
  `state` varchar(255) NOT NULL,
  `country` varchar(255) NOT NULL,
  `postal_code` varchar(255) NOT NULL,
  `updated_by` int(11) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `address`
--

INSERT INTO `address` (`id`, `client_id`, `address_id`, `address_type`, `line1`, `line2`, `line3`, `city`, `state`, `country`, `postal_code`, `updated_by`, `updated_on`) VALUES
(1, 1, 1, 2, '5 Angus st.', '', '', 'Durbanville', 'Western Cape', 'South Africa', '7500', 1, '2018-05-29 07:41:29');

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

--
-- Table structure for table `address_type`
--

CREATE TABLE `address_type` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `address_type_id` int(11) NOT NULL,
  `description` varchar(255) NOT NULL,
  `updated_by` int(11) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `address_type`
--

INSERT INTO `address_type` (`id`, `client_id`, `address_type_id`, `description`, `updated_by`, `updated_on`) VALUES
(1, 1, 1, 'Postal Address', 1, '2018-05-29 07:00:09'),
(2, 1, 2, 'Physical Address', 1, '2018-05-29 07:00:31');

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

--
-- Table structure for table `bank_detail`
--

CREATE TABLE `bank_detail` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `bank_id` int(11) NOT NULL,
  `bank_name` varchar(255) NOT NULL,
  `account_holder` varchar(255) NOT NULL,
  `branch_name` varchar(255) NOT NULL,
  `branch_code` varchar(30) NOT NULL,
  `account_no` varchar(30) NOT NULL,
  `account_type` varchar(50) NOT NULL,
  `ref_note` varchar(255) NOT NULL,
  `updated_by` int(11) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `bank_detail`
--

INSERT INTO `bank_detail` (`id`, `client_id`, `bank_id`, `bank_name`, `account_holder`, `branch_name`, `branch_code`, `account_no`, `account_type`, `ref_note`, `updated_by`, `updated_on`) VALUES
(1, 1, 1, 'FNB', 'MJ Roofing Solutions T/A Avid Contractors', 'FNB Montaque Gardens', '250 742', '62 409 838 549', 'Cheque Account', 'Use Invoice# or Quote# as Reference', 18, '2018-05-24 14:40:08');

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

--
-- Table structure for table `bill_of_quantities`
--

CREATE TABLE `bill_of_quantities` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `category_id` int(11) NOT NULL,
  `sub_category_id` int(11) NOT NULL,
  `bill_of_qty_id` int(5) NOT NULL,
  `description` varchar(255) NOT NULL,
  `cost_price` decimal(9,2) NOT NULL,
  `sell_price` decimal(9,2) NOT NULL,
  `uom` int(3) NOT NULL,
  `relation_to_boq_id` int(5) NOT NULL,
  `relation_multiplier` int(3) NOT NULL,
  `updated_by` int(3) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `bill_of_quantities`
--

INSERT INTO `bill_of_quantities` (`id`, `client_id`, `category_id`, `sub_category_id`, `bill_of_qty_id`, `description`, `cost_price`, `sell_price`, `uom`, `relation_to_boq_id`, `relation_multiplier`, `updated_by`, `updated_on`) VALUES
(1, 1, 10, 1, 10, 'Site Setup - H&S (Health and Safety File)', '750.00', '2420.00', 50, 0, 1, 1, '2018-05-23 19:11:33'),
(3, 1, 10, 1, 9, 'Site Setup', '550.00', '1500.00', 50, 0, 1, 1, '2018-05-23 19:11:14'),
(4, 1, 10, 1, 15, 'Site Setup - S&T\'s (Supply and Transport)', '10000.00', '15000.00', 50, 0, 1, 1, '2018-05-23 19:11:44'),
(5, 1, 10, 1, 40, 'Site Setup - Additional Services (GREY WATER FOR BUILDING PURPOSES)', '2500.00', '2562.50', 50, 0, 1, 1, '2018-05-23 19:11:54'),
(6, 1, 10, 1, 50, 'Outside hoarding', '1500.00', '3050.00', 50, 0, 1, 1, '2018-05-23 19:12:06'),
(7, 1, 20, 7, 60, 'Demolish all single brick walls - SQM', '85.00', '145.00', 10, 0, 1, 1, '2018-05-23 19:12:22'),
(8, 1, 20, 7, 70, 'Demolish all double brick walls - SQM', '95.00', '145.00', 10, 0, 1, 1, '2018-05-23 19:12:31'),
(9, 1, 20, 7, 80, 'Timber Shopfront window demolition - SQM', '50.00', '125.00', 50, 0, 1, 1, '2018-05-23 20:02:47'),
(10, 1, 20, 3, 90, 'PS Amount ', '3500.00', '4500.00', 50, 0, 1, 1, '2018-05-23 20:04:03'),
(11, 1, 20, 3, 100, 'Cart all rubble off site with 6 cube skips- app cubes', '225.00', '300.00', 60, 0, 1, 1, '2018-05-23 20:05:00'),
(12, 1, 20, 5, 120, 'Demolish floor tiles in new area app. 200 sqm ', '20.00', '25.00', 10, 0, 1, 1, '2018-05-23 20:05:57'),
(13, 1, 30, 8, 130, 'Foundations (trenching/steel/casting/backfill) - app. LM', '1250.00', '1500.00', 20, 0, 1, 1, '2018-05-23 20:07:16'),
(14, 1, 30, 8, 140, 'Building of Plinth - per SQM', '580.00', '600.00', 10, 0, 1, 1, '2018-05-23 20:08:05'),
(15, 1, 30, 9, 150, 'Supply and install Single timber door&frame - hollo core - (painting/all iron monger) incl.', '2500.00', '3000.00', 50, 0, 1, 1, '2018-05-23 20:08:56'),
(17, 1, 30, 9, 170, 'Supply and install Door closures', '1800.00', '2500.00', 50, 0, 1, 1, '2018-05-23 20:22:01'),
(18, 1, 30, 10, 180, 'Supply and install 1200x800 aluminium sliding window - for office', '5500.00', '6500.00', 50, 0, 1, 1, '2018-05-23 20:23:30'),
(19, 1, 30, 11, 190, 'Prep all existing walls to receive paint - app. 200 SQM', '15.00', '25.00', 10, 0, 1, 1, '2018-05-23 20:25:38'),
(20, 1, 30, 11, 200, 'Supply and paint existing walls 1 x coat Plaster Primer - app. 200 SQM', '35.00', '35.00', 10, 0, 1, 1, '2018-05-23 20:26:38'),
(21, 1, 30, 11, 210, 'Supply and paint existing walls 2 x coats Finishing Paint - app. 200 SQM', '35.00', '55.00', 10, 0, 1, 1, '2018-05-23 20:27:21'),
(22, 1, 30, 13, 220, 'Additional Trenching work for other services', '120.00', '200.00', 20, 0, 1, 1, '2018-05-23 20:31:37'),
(23, 1, 30, 14, 230, 'Supply and install flat roof construction with IBR colorbond Roof sheets', '550.00', '1200.00', 10, 0, 1, 1, '2018-05-23 20:32:12'),
(24, 1, 30, 14, 240, 'Supply and install aluminium guttering including downpipes', '200.00', '501.30', 20, 0, 1, 1, '2018-05-23 20:33:02'),
(25, 1, 30, 14, 250, 'waterproofing', '350.00', '448.00', 10, 0, 1, 1, '2018-05-23 20:33:41'),
(26, 1, 30, 14, 260, 'A19 Certificate', '1500.00', '1650.00', 60, 0, 1, 1, '2018-05-23 20:34:20'),
(27, 1, 30, 14, 270, 'PC amount for roofing', '2500.00', '2500.00', 50, 0, 1, 1, '2018-05-23 20:34:57');

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

--
-- Table structure for table `boq_categories`
--

CREATE TABLE `boq_categories` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `category_id` int(3) NOT NULL,
  `description` varchar(255) NOT NULL,
  `updated_by` int(3) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `boq_categories`
--

INSERT INTO `boq_categories` (`id`, `client_id`, `category_id`, `description`, `updated_by`, `updated_on`) VALUES
(4, 1, 10, 'Site Setup', 1, '2018-05-28 12:34:14'),
(5, 1, 20, 'Demolition Work', 1, '2018-05-28 12:31:56'),
(6, 1, 30, 'Building Works', 1, '2018-05-28 12:34:22'),
(7, 1, 40, 'Plumbing Work', 1, '2018-05-28 12:34:28'),
(8, 1, 50, 'Wall And Floor Finishes', 1, '2018-05-28 12:34:34'),
(9, 1, 60, 'Electical work', 1, '2018-05-28 12:34:41'),
(10, 1, 70, 'Ceiling and Bulkheads', 1, '2018-05-28 12:34:48'),
(11, 1, 80, 'Omissions and variation orders', 1, '2018-05-28 12:34:55'),
(12, 1, 90, 'Variations', 1, '2018-05-28 12:35:02'),
(13, 1, 100, 'Waterproofing', 1, '2018-05-28 12:33:22'),
(14, 1, 110, 'Concrete Repairs', 1, '2018-05-28 12:35:09'),
(15, 1, 120, 'Joint Repairs', 1, '2018-05-28 12:35:16'),
(16, 1, 130, 'Joint Sealing', 1, '2018-05-28 12:35:23'),
(17, 1, 140, 'General Repairs', 1, '2018-05-28 12:35:30'),
(18, 1, 150, 'Roof Construction', 1, '2018-05-28 12:35:36'),
(19, 1, 160, 'General Maintenance', 1, '2018-05-28 12:35:43'),
(20, 4, 1, 'Site Setup', 18, '2018-05-28 10:45:02'),
(21, 4, 2, 'building work', 18, '2018-05-28 10:45:02');

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

--
-- Table structure for table `category_notes`
--

CREATE TABLE `category_notes` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `category_id` int(11) NOT NULL,
  `category_line_id` int(11) NOT NULL,
  `description` varchar(255) NOT NULL,
  `updated_by` int(11) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `category_notes`
--

INSERT INTO `category_notes` (`id`, `client_id`, `category_id`, `category_line_id`, `description`, `updated_by`, `updated_on`) VALUES
(1, 1, 10, 1, 'Demarcated areas for Rubble needed with no traffic allowed into this area supplied by Client', 18, '2018-05-23 09:24:54'),
(2, 1, 10, 2, 'Passage way to rubble area supplied clean and free of all traffic supplied by Client', 18, '2018-05-23 09:25:25'),
(3, 1, 10, 3, 'All hazard signs demarcation tape and hoarding for site setup is supplied by Client', 18, '2018-05-23 09:25:48'),
(4, 1, 10, 4, 'Site establishment and safety meetings held by AVID in accordance with Health and Safety Act', 18, '2018-05-23 09:26:13'),
(5, 1, 10, 5, 'Public Interest insurance of R 15 000 000 cover in the event of a claim', 18, '2018-05-23 09:26:38'),
(6, 1, 10, 6, 'Workman’s Compensation Compliance cert available on request', 18, '2018-05-23 09:27:03'),
(7, 1, 10, 7, 'Site office area to be supplied by Client', 18, '2018-05-23 09:27:25');

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

--
-- Table structure for table `client`
--

CREATE TABLE `client` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `legal_name` varchar(255) NOT NULL,
  `reg_no` varchar(255) NOT NULL,
  `tax_no` varchar(255) NOT NULL,
  `email_address` varchar(255) NOT NULL,
  `tel_no` varchar(30) NOT NULL,
  `cel_no` varchar(30) NOT NULL,
  `web_site` varchar(255) NOT NULL,
  `client_type_id` int(3) NOT NULL,
  `bank_id` int(11) NOT NULL,
  `db_server` varchar(255) NOT NULL,
  `db_user` int(3) NOT NULL,
  `db_name` varchar(255) NOT NULL,
  `logo` varchar(255) NOT NULL,
  `updated_by` int(3) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `client`
--

INSERT INTO `client` (`id`, `name`, `legal_name`, `reg_no`, `tax_no`, `email_address`, `tel_no`, `cel_no`, `web_site`, `client_type_id`, `bank_id`, `db_server`, `db_user`, `db_name`, `logo`, `updated_by`, `updated_on`) VALUES
(1, 'Avid Contractors', 'MJ Roofing Solutions T/A Avid Contractors', 'CK 2006/067518/23', 'VAT# - 432 0229 323', 'fjofrancois@gmail.com', '+27(21) - 981 - 7007', '+27(82) - 455 - 5543', 'www.avidcontractors.co.za', 1, 1, 'localhost', 19, 'boq_estimator', 'avid.png', 1, '2018-05-10 08:44:09'),
(3, 'Test Client', '', '', '', '', '', '', '', 1, 0, 'localhost', 19, 'boq_estimator', 'test.png', 1, '2018-05-10 08:54:18'),
(4, 'OB Systems', '', '', '', '', '', '', '', 2, 0, 'localhost', 19, 'boq_estimator', 'obslogo.png', 18, '2018-05-11 08:49:35');

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

--
-- Table structure for table `client_type`
--

CREATE TABLE `client_type` (
  `id` int(3) NOT NULL,
  `description` varchar(255) NOT NULL,
  `updated_by` int(3) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `client_type`
--

INSERT INTO `client_type` (`id`, `description`, `updated_by`, `updated_on`) VALUES
(1, 'client', 18, '2018-05-10 12:43:37'),
(2, 'owner', 18, '2018-05-10 12:44:15');

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

--
-- Table structure for table `completed_project`
--

CREATE TABLE `completed_project` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `completed_project_id` int(11) NOT NULL,
  `description` varchar(255) NOT NULL,
  `updated_by` int(11) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `completed_project`
--

INSERT INTO `completed_project` (`id`, `client_id`, `completed_project_id`, `description`, `updated_by`, `updated_on`) VALUES
(1, 1, 1, 'Parklands Spar - Ceiling and Bulkhead/Building work/Plumbing - 2016', 18, '2018-05-25 08:24:11'),
(2, 1, 2, 'Royal Ascot Spar - Ceilings and Bulkheads/Building work/Plumbing/Tiling - 2016', 18, '2018-05-25 08:24:33'),
(3, 1, 3, 'Welgelegen Spar - Ceilings and Bulkheads/Building work/Plumbing/Tiling - 2016', 18, '2018-05-25 08:25:56'),
(4, 1, 4, 'Bellville Spar - Complete revamp and additional shops incorporated - 2016', 18, '2018-05-25 08:26:22'),
(5, 1, 5, 'Edgmead Tops and Coffee Shop Renovation - 2017', 18, '2018-05-25 08:26:49'),
(6, 1, 6, 'Kuilsrivier Spar - Kitchen and Coffee Shop revamp - 2017', 18, '2018-05-25 08:27:12'),
(7, 1, 7, 'Welgedacht Complete renovation - 2017', 18, '2018-05-25 08:27:34');

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

--
-- Table structure for table `contact`
--

CREATE TABLE `contact` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `contact_id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `surname` varchar(255) NOT NULL,
  `email_address` varchar(255) NOT NULL,
  `celno` varchar(20) NOT NULL,
  `telno` varchar(20) NOT NULL,
  `contact_type` int(3) NOT NULL,
  `dept` varchar(255) NOT NULL,
  `updated_by` int(11) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `contact`
--

INSERT INTO `contact` (`id`, `client_id`, `contact_id`, `name`, `surname`, `email_address`, `celno`, `telno`, `contact_type`, `dept`, `updated_by`, `updated_on`) VALUES
(1, 1, 1, 'Timothy', 'Cross', 'fjofrancois@gmail.com', '0836520102', '(021)976-2134', 1, '1', 18, '2018-05-16 06:22:28'),
(2, 1, 2, 'John', 'Doe', 'fjofrancois@gmail.com', '0834456789', '(044)690-5555', 1, '1-55', 1, '2018-05-29 22:35:28'),
(5, 1, 20, 'Francois', 'Oosthuizen', 'fjofrancois@gmail.com', '0834456970', '', 1, '', 1, '2018-05-29 22:12:57');

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

--
-- Table structure for table `contact_type`
--

CREATE TABLE `contact_type` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `contact_type_id` int(11) NOT NULL,
  `description` varchar(255) NOT NULL,
  `updated_by` int(11) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `contact_type`
--

INSERT INTO `contact_type` (`id`, `client_id`, `contact_type_id`, `description`, `updated_by`, `updated_on`) VALUES
(1, 1, 1, 'Account Manager', 1, '2018-05-29 20:39:05');

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

--
-- Table structure for table `customer`
--

CREATE TABLE `customer` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `name` varchar(155) NOT NULL,
  `vat_no` varchar(100) NOT NULL,
  `address_id` int(3) NOT NULL,
  `preferred_contact_id` int(3) NOT NULL,
  `customer_type_id` int(3) NOT NULL,
  `preferred_template_id` int(3) NOT NULL,
  `show_projects` tinyint(1) NOT NULL DEFAULT '1',
  `updated_by` int(3) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `customer`
--

INSERT INTO `customer` (`id`, `client_id`, `name`, `vat_no`, `address_id`, `preferred_contact_id`, `customer_type_id`, `preferred_template_id`, `show_projects`, `updated_by`, `updated_on`) VALUES
(1, 1, 'SPAR', '498976321', 1, 1, 1, 17, 1, 1, '2018-05-29 20:30:13'),
(7, 1, 'Brights', '93233456', 1, 2, 1, 23, 0, 1, '2018-05-30 23:31:16');

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

--
-- Table structure for table `customer_type`
--

CREATE TABLE `customer_type` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `customer_type_id` int(11) NOT NULL,
  `description` varchar(255) NOT NULL,
  `updated_by` int(11) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `customer_type`
--

INSERT INTO `customer_type` (`id`, `client_id`, `customer_type_id`, `description`, `updated_by`, `updated_on`) VALUES
(1, 1, 1, 'Corporate', 1, '2018-05-28 22:45:31');

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

--
-- Table structure for table `db_user`
--

CREATE TABLE `db_user` (
  `user_id` int(3) NOT NULL,
  `name` varchar(25) NOT NULL,
  `password` varbinary(160) NOT NULL,
  `updated_by` int(3) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `db_user`
--

INSERT INTO `db_user` (`user_id`, `name`, `password`, `updated_by`, `updated_on`) VALUES
(19, 'webuser', 0x651b0ab3d3beaa1591224559a3c326ef, 1, '2018-05-10 07:42:50');

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

--
-- Table structure for table `footer_note`
--

CREATE TABLE `footer_note` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `footer_note_id` int(11) NOT NULL,
  `footer_note_line_no` int(11) NOT NULL,
  `description` varchar(255) NOT NULL,
  `updated_by` int(11) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `footer_note`
--

INSERT INTO `footer_note` (`id`, `client_id`, `footer_note_id`, `footer_note_line_no`, `description`, `updated_by`, `updated_on`) VALUES
(1, 1, 1, 1, 'Specialising in:', 18, '2018-05-22 09:37:43'),
(2, 1, 1, 2, 'Corporate Renovations', 18, '2018-05-22 09:38:24'),
(3, 1, 1, 3, 'Retail Construction', 18, '2018-05-22 09:38:49'),
(4, 1, 1, 4, 'Waterproofing', 18, '2018-05-22 09:39:11');

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

--
-- Table structure for table `header_note`
--

CREATE TABLE `header_note` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `header_note_id` int(11) NOT NULL,
  `header_note_line_no` int(11) NOT NULL,
  `description` varchar(255) NOT NULL,
  `updated_by` int(11) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `header_note`
--

INSERT INTO `header_note` (`id`, `client_id`, `header_note_id`, `header_note_line_no`, `description`, `updated_by`, `updated_on`) VALUES
(5, 1, 1, 1, 'Thank you for the opertunity to quote on the above mentioned work.', 18, '2018-05-23 07:53:51'),
(6, 1, 1, 2, 'Abreviations:', 18, '2018-05-23 07:53:51'),
(7, 1, 1, 3, 'DW - Demotition Work', 18, '2018-05-23 07:53:51'),
(8, 1, 1, 4, 'BW - Brick Work', 18, '2018-05-23 07:53:51'),
(9, 1, 1, 5, 'AC - Avid Contractors', 18, '2018-05-23 07:53:51'),
(10, 1, 1, 6, 'HS - Helderbosch Spar', 18, '2018-05-23 07:53:51');

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

--
-- Table structure for table `payment_terms`
--

CREATE TABLE `payment_terms` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `customer_id` int(11) NOT NULL,
  `payment_term_id` int(11) NOT NULL,
  `description` varchar(255) NOT NULL,
  `updated_by` int(11) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `payment_terms`
--

INSERT INTO `payment_terms` (`id`, `client_id`, `customer_id`, `payment_term_id`, `description`, `updated_by`, `updated_on`) VALUES
(1, 1, 1, 1, 'JOBS OVER R500 000.00 EXCL. VAT REQUIRES A 25% DEPOSIT BEFORE COMMENCEMENT - ADDITIONAL \"TOP UP\" DEPOSIT OF 25% DUE WITHIN THE FIRST 3 WEEKS AFTER ', 18, '2018-05-25 07:13:31'),
(2, 1, 1, 2, 'JOBS UNDER R500 000.00 EXCL. VAT REQUIRES A 50% DEPOSIT BEFORE COMMENCEMENT - ', 18, '2018-05-25 07:14:08'),
(3, 1, 1, 3, 'PROGRESS PAYMENTS TO BE MADE WEEKLY BASED ON PERCENTAGE PROGRESS AGREED BETWEEN AVID AND CLIENT - TO BE SIGNED OFF BY DEVELOPMENT MANAGER AND CLIENT', 18, '2018-05-25 07:14:54'),
(4, 1, 1, 4, 'NO RETENTIONS ALLOWED', 18, '2018-05-25 07:15:26'),
(5, 1, 1, 5, 'THE ABOVE QUOTE IS BASED ON THE PLANS SUBMITTED AND SITE MEETING AS BETWEEN AVID AND DEVELOPMENT MANAGER/CLIENT', 18, '2018-05-25 07:15:57'),
(6, 1, 1, 6, 'ANY ADDITIONAL WORK SCOPE NOT INCLUDED IN THIS QUOTE WILL BE DEEMED A V.O AND WILL BE COSTED SEPERATELY. SUCH COST WILL BE FOR THE CLIENTS ACCOUNT', 18, '2018-05-25 07:16:29'),
(7, 1, 1, 7, 'THIS QUOTE IS VALID FOR 90 DAYS ONLY', 18, '2018-05-25 07:16:59');

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

--
-- Table structure for table `quote`
--

CREATE TABLE `quote` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `customer_id` int(11) NOT NULL,
  `quote_no` varchar(30) NOT NULL,
  `revision` varchar(30) NOT NULL,
  `date` date NOT NULL,
  `plan` varchar(100) NOT NULL,
  `job` varchar(120) NOT NULL,
  `show_sub_categories` tinyint(1) NOT NULL DEFAULT '1',
  `contact_id` int(3) NOT NULL,
  `status_id` int(3) NOT NULL,
  `created_by` int(11) NOT NULL,
  `updated_by` int(3) NOT NULL,
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `quote`
--

INSERT INTO `quote` (`id`, `client_id`, `customer_id`, `quote_no`, `revision`, `date`, `plan`, `job`, `show_sub_categories`, `contact_id`, `status_id`, `created_by`, `updated_by`, `created_on`, `updated_on`) VALUES
(1, 4, 1, '1804022', 'REV0', '2018-05-16', '170106 12', 'Helderberg Spar', 1, 1, 1, 18, 18, '2018-05-16 09:37:26', '2018-05-16 05:58:58'),
(2, 1, 1, '1805001', 'REV0', '2018-05-16', 'Plan 120602 13', 'Sonstaal Spa', 1, 1, 30, 18, 1, '2018-05-16 09:37:26', '2018-05-28 17:04:02'),
(4, 4, 1, '1805001', 'REV0', '2018-05-25', 'Plan A', 'Welgemoed Spar', 1, 1, 2, 1, 18, '2018-05-16 10:20:16', '2018-05-17 06:38:48'),
(7, 4, 1, '1805001', 'REV1', '2018-05-25', 'Plan A', 'Welgemoed Spar', 1, 1, 2, 18, 18, '2018-05-17 06:38:48', '2018-05-17 07:33:09'),
(8, 4, 1, '1805001', 'REV2', '2018-05-25', 'Plan A1', 'Welgemoed Spara', 1, 1, 3, 18, 18, '2018-05-17 07:30:21', '2018-05-18 21:14:47'),
(9, 1, 1, '1805002', 'REV0', '2018-05-24', '2018 - 001', 'Goodwood Spar', 1, 1, 20, 1, 1, '2018-05-23 08:56:42', '2018-05-28 20:37:42'),
(11, 1, 1, '1805002', 'REV1', '2018-05-24', '2018 - 001', 'Goodwood Spar', 1, 1, 20, 1, 1, '2018-05-28 18:21:07', '2018-05-28 18:21:34'),
(12, 1, 1, '1805002', 'REV2', '2018-05-24', '2018 - 001', 'Goodwood Spar', 1, 1, 40, 1, 1, '2018-05-28 18:21:34', '2018-05-28 20:25:45'),
(14, 1, 1, '1805002', 'REV3', '2018-05-24', '2018 - 001', 'Goodwood Spar', 1, 1, 40, 1, 1, '2018-05-28 20:37:42', '2018-05-28 20:40:41'),
(15, 1, 1, '1805003', 'REV0', '2018-05-30', 'Plan xx2', 'Somerset West Super-Spar', 1, 1, 1, 1, 1, '2018-05-28 20:39:02', '2018-05-28 21:43:17'),
(16, 1, 7, '1805004', 'REV0', '2018-06-01', 'plan ABC', 'Jhb Spar', 1, 1, 1, 1, 1, '2018-05-31 09:30:54', '2018-05-31 09:30:54'),
(17, 1, 7, '1805005', 'REV0', '2018-06-01', 'plan ABC', 'Jhb Spar', 1, 1, 1, 1, 1, '2018-05-31 09:34:16', '2018-05-31 09:34:16'),
(18, 1, 7, '1805006', 'REV0', '2018-06-01', 'plan ABC', 'Jhb Spar', 1, 1, 1, 1, 1, '2018-05-31 09:34:30', '2018-05-31 09:34:30'),
(19, 1, 7, '1805007', 'REV0', '2018-06-01', 'X 123', 'jhb Spar', 1, 1, 1, 1, 1, '2018-05-31 09:37:09', '2018-05-31 09:37:09'),
(20, 1, 1, '1805008', 'REV0', '2018-06-01', 'aaaa', 'jkhhjkl', 1, 1, 1, 1, 1, '2018-05-31 09:43:23', '2018-05-31 09:43:23'),
(21, 1, 7, '1805009', 'REV0', '0000-00-00', 'jhhjk', 'poiiop', 1, 1, 1, 1, 1, '2018-05-31 09:43:57', '2018-05-31 09:43:57'),
(22, 1, 7, '1805010', 'REV0', '0000-00-00', 'jhhjk', 'poiiop', 1, 1, 1, 1, 1, '2018-05-31 09:45:01', '2018-05-31 09:45:01'),
(23, 1, 7, '1805011', 'REV0', '0000-00-00', 'jhhjk', 'poiiop', 1, 1, 1, 1, 1, '2018-05-31 09:46:32', '2018-05-31 09:46:32'),
(24, 1, 7, '1805012', 'REV0', '0000-00-00', 'jhhjk', 'poiiop', 1, 1, 1, 1, 1, '2018-05-31 09:47:04', '2018-05-31 09:47:04'),
(25, 1, 7, '1805013', 'REV0', '0000-00-00', 'jhhjk', 'poiiop', 1, 1, 1, 1, 1, '2018-05-31 09:47:46', '2018-05-31 09:47:46'),
(26, 1, 1, '1805014', 'REV0', '2018-06-01', 'Plan TT-3', 'Pta Spar', 1, 1, 1, 1, 1, '2018-05-31 09:49:18', '2018-05-31 09:50:30'),
(27, 1, 1, '1805015', 'REV0', '2018-06-02', 'Plan CCC', 'Dbn Spar', 1, 1, 1, 1, 1, '2018-05-31 09:51:39', '2018-05-31 09:51:39'),
(28, 1, 1, '1805016', 'REV0', '2018-06-02', 'CCX3', 'Dbn Spar', 1, 1, 1, 1, 1, '2018-05-31 09:53:00', '2018-05-31 09:53:00'),
(29, 1, 1, '1805017', 'REV0', '2018-06-02', 'CCCCCCx', 'Dbn Spar', 1, 1, 1, 1, 1, '2018-05-31 09:55:23', '2018-05-31 09:55:23'),
(30, 1, 1, '1805018', 'REV0', '2018-06-02', 'VVVx', 'Dbn Spar', 1, 1, 1, 1, 1, '2018-05-31 09:57:27', '2018-05-31 09:57:27'),
(31, 1, 1, '1805019', 'REV0', '2018-06-02', 'VVVx', 'Dbn Spar', 1, 1, 1, 1, 1, '2018-05-31 09:58:38', '2018-05-31 09:58:38'),
(32, 1, 1, '1805020', 'REV0', '2018-06-02', 'OOp', 'Dbn Spar', 1, 1, 1, 1, 1, '2018-05-31 10:00:37', '2018-05-31 10:00:37'),
(33, 1, 1, '1805021', 'REV0', '2018-06-01', 'abcdefg', 'Athlone Spar', 1, 1, 1, 20, 20, '2018-05-31 15:11:07', '2018-05-31 15:11:07');

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

--
-- Table structure for table `quote_line`
--

CREATE TABLE `quote_line` (
  `quote_id` int(11) NOT NULL,
  `id` int(11) NOT NULL,
  `bill_of_quantity_id` int(11) NOT NULL,
  `qty` int(11) NOT NULL,
  `price` decimal(11,2) NOT NULL,
  `updated_by` int(11) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `quote_line`
--

INSERT INTO `quote_line` (`quote_id`, `id`, `bill_of_quantity_id`, `qty`, `price`, `updated_by`, `updated_on`) VALUES
(4, 1, 9, 2, '1250.00', 18, '2018-05-16 14:54:01'),
(4, 2, 10, 2, '850.00', 18, '2018-05-16 14:54:13'),
(4, 3, 20, 3, '4000.00', 18, '2018-05-16 14:54:24'),
(4, 4, 15, 1, '5000.00', 1, '2018-05-16 14:45:42'),
(7, 5, 9, 2, '1250.00', 18, '2018-05-17 06:38:48'),
(7, 6, 10, 2, '850.00', 18, '2018-05-17 06:38:48'),
(7, 7, 20, 3, '4000.00', 18, '2018-05-17 06:38:48'),
(0, 8, 15, 5, '5000.00', 18, '2018-05-18 21:25:10'),
(8, 9, 9, 2, '1250.00', 18, '2018-05-17 07:30:21'),
(8, 10, 10, 2, '850.00', 18, '2018-05-17 07:30:21'),
(8, 11, 20, 3, '4000.00', 18, '2018-05-17 07:30:21'),
(8, 12, 15, 1, '5000.00', 18, '2018-05-17 07:30:21'),
(8, 13, 9, 2, '2345.00', 18, '2018-05-17 13:37:53'),
(2, 14, 9, 1, '4520.00', 1, '2018-05-20 08:50:26'),
(2, 21, 10, 1, '2345.00', 1, '2018-05-21 10:35:22'),
(9, 28, 9, 1, '2500.00', 1, '2018-05-23 18:57:17'),
(9, 29, 10, 1, '500.00', 1, '2018-05-23 18:57:28'),
(9, 30, 15, 1, '3500.00', 1, '2018-05-23 18:57:38'),
(9, 31, 40, 1, '850.00', 1, '2018-05-23 18:57:57'),
(9, 32, 50, 1, '456.00', 1, '2018-05-23 18:58:13'),
(9, 33, 60, 89, '145.00', 1, '2018-05-23 19:01:51'),
(9, 34, 70, 120, '145.00', 1, '2018-05-23 19:02:07'),
(9, 35, 80, 15, '125.00', 1, '2018-05-23 20:10:47'),
(9, 36, 90, 1, '4500.00', 1, '2018-05-23 20:11:19'),
(9, 37, 100, 25, '250.00', 1, '2018-05-23 20:11:57'),
(9, 38, 120, 230, '25.00', 1, '2018-05-23 20:12:29'),
(9, 39, 130, 100, '1500.00', 1, '2018-05-23 20:13:14'),
(9, 40, 140, 35, '600.00', 1, '2018-05-23 20:13:37'),
(9, 41, 150, 22, '9225.00', 1, '2018-05-23 20:15:01'),
(9, 42, 170, 12, '2500.00', 1, '2018-05-23 20:24:08'),
(9, 43, 180, 4, '6500.00', 1, '2018-05-23 20:24:21'),
(9, 44, 190, 220, '25.00', 1, '2018-05-23 20:27:58'),
(9, 45, 200, 220, '35.00', 1, '2018-05-23 20:28:21'),
(9, 46, 210, 220, '55.00', 1, '2018-05-23 20:28:32'),
(9, 47, 220, 25, '200.00', 1, '2018-05-23 20:35:39'),
(9, 48, 230, 300, '1200.00', 1, '2018-05-23 20:36:10'),
(9, 49, 240, 75, '501.30', 1, '2018-05-23 20:36:45'),
(9, 50, 250, 250, '448.00', 1, '2018-05-23 20:37:06'),
(9, 51, 260, 1, '1650.00', 1, '2018-05-23 20:37:22'),
(9, 52, 270, 1, '2500.00', 1, '2018-05-23 20:37:35'),
(11, 53, 9, 1, '2500.00', 1, '2018-05-28 18:21:07'),
(11, 54, 10, 1, '500.00', 1, '2018-05-28 18:21:07'),
(11, 55, 15, 1, '3500.00', 1, '2018-05-28 18:21:07'),
(11, 56, 40, 1, '850.00', 1, '2018-05-28 18:21:07'),
(11, 57, 50, 1, '456.00', 1, '2018-05-28 18:21:07'),
(11, 58, 60, 89, '145.00', 1, '2018-05-28 18:21:07'),
(11, 59, 70, 120, '145.00', 1, '2018-05-28 18:21:07'),
(11, 60, 80, 15, '125.00', 1, '2018-05-28 18:21:07'),
(11, 61, 90, 1, '4500.00', 1, '2018-05-28 18:21:07'),
(11, 62, 100, 25, '250.00', 1, '2018-05-28 18:21:07'),
(11, 63, 120, 230, '25.00', 1, '2018-05-28 18:21:07'),
(11, 64, 130, 100, '1500.00', 1, '2018-05-28 18:21:07'),
(11, 65, 140, 35, '600.00', 1, '2018-05-28 18:21:07'),
(11, 66, 150, 22, '9225.00', 1, '2018-05-28 18:21:07'),
(11, 67, 170, 12, '2500.00', 1, '2018-05-28 18:21:07'),
(11, 68, 180, 4, '6500.00', 1, '2018-05-28 18:21:07'),
(11, 69, 190, 220, '25.00', 1, '2018-05-28 18:21:07'),
(11, 70, 200, 220, '35.00', 1, '2018-05-28 18:21:07'),
(11, 71, 210, 220, '55.00', 1, '2018-05-28 18:21:07'),
(11, 72, 220, 25, '200.00', 1, '2018-05-28 18:21:07'),
(11, 73, 230, 300, '1200.00', 1, '2018-05-28 18:21:07'),
(11, 74, 240, 75, '501.30', 1, '2018-05-28 18:21:07'),
(11, 75, 250, 250, '448.00', 1, '2018-05-28 18:21:07'),
(11, 76, 260, 1, '1650.00', 1, '2018-05-28 18:21:07'),
(11, 77, 270, 1, '2500.00', 1, '2018-05-28 18:21:07'),
(12, 78, 9, 1, '2500.00', 1, '2018-05-28 18:21:34'),
(12, 79, 10, 1, '500.00', 1, '2018-05-28 18:21:34'),
(12, 80, 15, 1, '3500.00', 1, '2018-05-28 18:21:34'),
(12, 81, 40, 1, '850.00', 1, '2018-05-28 18:21:34'),
(12, 82, 50, 1, '456.00', 1, '2018-05-28 18:21:34'),
(12, 83, 60, 89, '145.00', 1, '2018-05-28 18:21:34'),
(12, 84, 70, 120, '145.00', 1, '2018-05-28 18:21:34'),
(12, 85, 80, 15, '125.00', 1, '2018-05-28 18:21:34'),
(12, 86, 90, 1, '4500.00', 1, '2018-05-28 18:21:34'),
(12, 87, 100, 25, '250.00', 1, '2018-05-28 18:21:34'),
(12, 88, 120, 230, '25.00', 1, '2018-05-28 18:21:34'),
(12, 89, 130, 100, '1500.00', 1, '2018-05-28 18:21:34'),
(12, 90, 140, 35, '600.00', 1, '2018-05-28 18:21:34'),
(12, 91, 150, 22, '9225.00', 1, '2018-05-28 18:21:34'),
(12, 92, 170, 12, '2500.00', 1, '2018-05-28 18:21:34'),
(12, 93, 180, 4, '6500.00', 1, '2018-05-28 18:21:34'),
(12, 94, 190, 220, '25.00', 1, '2018-05-28 18:21:34'),
(12, 95, 200, 220, '35.00', 1, '2018-05-28 18:21:34'),
(12, 96, 210, 220, '55.00', 1, '2018-05-28 18:21:34'),
(12, 97, 220, 25, '200.00', 1, '2018-05-28 18:21:34'),
(12, 98, 230, 300, '1200.00', 1, '2018-05-28 18:21:34'),
(12, 99, 240, 75, '501.30', 1, '2018-05-28 18:21:34'),
(12, 100, 250, 250, '448.00', 1, '2018-05-28 18:21:34'),
(12, 101, 260, 1, '1650.00', 1, '2018-05-28 18:21:34'),
(12, 102, 270, 1, '2500.00', 1, '2018-05-28 18:21:34'),
(14, 103, 9, 1, '2500.00', 1, '2018-05-28 20:37:42'),
(14, 104, 10, 1, '500.00', 1, '2018-05-28 20:37:42'),
(14, 105, 15, 1, '3500.00', 1, '2018-05-28 20:37:42'),
(14, 106, 40, 1, '850.00', 1, '2018-05-28 20:37:42'),
(14, 107, 50, 1, '456.00', 1, '2018-05-28 20:37:42'),
(14, 108, 60, 89, '145.00', 1, '2018-05-28 20:37:42'),
(14, 109, 70, 120, '145.00', 1, '2018-05-28 20:37:42'),
(14, 110, 80, 15, '125.00', 1, '2018-05-28 20:37:42'),
(14, 111, 90, 1, '4500.00', 1, '2018-05-28 20:37:42'),
(14, 112, 100, 25, '250.00', 1, '2018-05-28 20:37:42'),
(14, 113, 120, 230, '25.00', 1, '2018-05-28 20:37:42'),
(14, 114, 130, 100, '1500.00', 1, '2018-05-28 20:37:42'),
(14, 115, 140, 35, '600.00', 1, '2018-05-28 20:37:42'),
(14, 116, 150, 22, '9225.00', 1, '2018-05-28 20:37:42'),
(14, 117, 170, 12, '2500.00', 1, '2018-05-28 20:37:42'),
(14, 118, 180, 4, '6500.00', 1, '2018-05-28 20:37:42'),
(14, 119, 190, 220, '25.00', 1, '2018-05-28 20:37:42'),
(14, 120, 200, 220, '35.00', 1, '2018-05-28 20:37:42'),
(14, 121, 210, 220, '55.00', 1, '2018-05-28 20:37:42'),
(14, 122, 220, 25, '200.00', 1, '2018-05-28 20:37:42'),
(14, 123, 230, 300, '1200.00', 1, '2018-05-28 20:37:42'),
(14, 124, 240, 75, '501.30', 1, '2018-05-28 20:37:42'),
(14, 125, 250, 250, '448.00', 1, '2018-05-28 20:37:42'),
(14, 126, 260, 1, '1650.00', 1, '2018-05-28 20:37:42'),
(14, 127, 270, 1, '2500.00', 1, '2018-05-28 20:37:42'),
(15, 128, 9, 1, '1500.00', 1, '2018-05-28 21:42:42'),
(15, 129, 250, 1, '4500.00', 1, '2018-05-28 21:50:03'),
(15, 130, 120, 200, '30.00', 1, '2018-05-28 21:50:34'),
(26, 131, 9, 1, '1500.00', 1, '2018-05-31 09:49:18'),
(26, 132, 10, 1, '2420.00', 1, '2018-05-31 09:49:18'),
(26, 133, 15, 1, '15000.00', 1, '2018-05-31 09:49:18'),
(26, 134, 40, 2, '2562.50', 1, '2018-05-31 09:49:18'),
(26, 135, 50, 1, '3050.00', 1, '2018-05-31 09:49:18'),
(26, 136, 60, 75, '145.00', 1, '2018-05-31 09:49:18'),
(26, 137, 70, 50, '145.00', 1, '2018-05-31 09:49:18'),
(26, 138, 80, 15, '125.00', 1, '2018-05-31 09:49:18'),
(26, 139, 90, 1, '4500.00', 1, '2018-05-31 09:49:18'),
(26, 140, 100, 10, '300.00', 1, '2018-05-31 09:49:18'),
(26, 141, 120, 200, '25.00', 1, '2018-05-31 09:49:18'),
(26, 142, 130, 35, '1500.00', 1, '2018-05-31 09:49:18'),
(26, 143, 140, 12, '600.00', 1, '2018-05-31 09:49:18'),
(26, 144, 150, 7, '3000.00', 1, '2018-05-31 09:49:18'),
(26, 145, 170, 2, '2500.00', 1, '2018-05-31 09:49:18'),
(26, 146, 180, 1, '6500.00', 1, '2018-05-31 09:49:18'),
(26, 147, 190, 220, '25.00', 1, '2018-05-31 09:49:18'),
(26, 148, 200, 220, '35.00', 1, '2018-05-31 09:49:18'),
(26, 149, 210, 220, '55.00', 1, '2018-05-31 09:49:18'),
(26, 150, 220, 34, '200.00', 1, '2018-05-31 09:49:18'),
(26, 151, 230, 250, '1200.00', 1, '2018-05-31 09:49:18'),
(26, 152, 240, 88, '501.30', 1, '2018-05-31 09:49:18'),
(26, 153, 250, 200, '448.00', 1, '2018-05-31 09:49:18'),
(26, 154, 260, 1, '1650.00', 1, '2018-05-31 09:49:18'),
(26, 155, 270, 1, '2500.00', 1, '2018-05-31 09:49:18'),
(31, 156, 9, 1, '1500.00', 1, '2018-05-31 09:58:38'),
(31, 157, 10, 1, '2420.00', 1, '2018-05-31 09:58:38'),
(31, 158, 15, 1, '15000.00', 1, '2018-05-31 09:58:38'),
(31, 159, 40, 2, '2562.50', 1, '2018-05-31 09:58:38'),
(31, 160, 50, 1, '3050.00', 1, '2018-05-31 09:58:38'),
(31, 161, 60, 75, '145.00', 1, '2018-05-31 09:58:38'),
(31, 162, 70, 50, '145.00', 1, '2018-05-31 09:58:38'),
(31, 163, 80, 15, '125.00', 1, '2018-05-31 09:58:38'),
(31, 164, 90, 1, '4500.00', 1, '2018-05-31 09:58:38'),
(31, 165, 100, 10, '300.00', 1, '2018-05-31 09:58:38'),
(31, 166, 120, 200, '25.00', 1, '2018-05-31 09:58:38'),
(31, 167, 130, 35, '1500.00', 1, '2018-05-31 09:58:38'),
(31, 168, 140, 12, '600.00', 1, '2018-05-31 09:58:38'),
(31, 169, 150, 7, '3000.00', 1, '2018-05-31 09:58:38'),
(31, 170, 170, 2, '2500.00', 1, '2018-05-31 09:58:38'),
(31, 171, 180, 1, '6500.00', 1, '2018-05-31 09:58:38'),
(31, 172, 190, 220, '25.00', 1, '2018-05-31 09:58:38'),
(31, 173, 200, 220, '35.00', 1, '2018-05-31 09:58:38'),
(31, 174, 210, 220, '55.00', 1, '2018-05-31 09:58:38'),
(31, 175, 220, 34, '200.00', 1, '2018-05-31 09:58:38'),
(31, 176, 230, 250, '1200.00', 1, '2018-05-31 09:58:38'),
(31, 177, 240, 88, '501.30', 1, '2018-05-31 09:58:38'),
(31, 178, 250, 200, '448.00', 1, '2018-05-31 09:58:38'),
(31, 179, 260, 1, '1650.00', 1, '2018-05-31 09:58:38'),
(31, 180, 270, 1, '2500.00', 1, '2018-05-31 09:58:38'),
(32, 181, 9, 1, '2500.00', 1, '2018-05-31 10:00:37'),
(32, 182, 10, 1, '500.00', 1, '2018-05-31 10:00:37'),
(32, 183, 15, 1, '3500.00', 1, '2018-05-31 10:00:37'),
(32, 184, 40, 1, '850.00', 1, '2018-05-31 10:00:37'),
(32, 185, 50, 1, '456.00', 1, '2018-05-31 10:00:37'),
(32, 186, 60, 89, '145.00', 1, '2018-05-31 10:00:37'),
(32, 187, 70, 120, '145.00', 1, '2018-05-31 10:00:37'),
(32, 188, 80, 15, '125.00', 1, '2018-05-31 10:00:37'),
(32, 189, 90, 1, '4500.00', 1, '2018-05-31 10:00:37'),
(32, 190, 100, 25, '250.00', 1, '2018-05-31 10:00:37'),
(32, 191, 120, 230, '25.00', 1, '2018-05-31 10:00:37'),
(32, 192, 130, 100, '1500.00', 1, '2018-05-31 10:00:37'),
(32, 193, 140, 35, '600.00', 1, '2018-05-31 10:00:37'),
(32, 194, 150, 22, '9225.00', 1, '2018-05-31 10:00:37'),
(32, 195, 170, 12, '2500.00', 1, '2018-05-31 10:00:37'),
(32, 196, 180, 4, '6500.00', 1, '2018-05-31 10:00:37'),
(32, 197, 190, 220, '25.00', 1, '2018-05-31 10:00:37'),
(32, 198, 200, 220, '35.00', 1, '2018-05-31 10:00:37'),
(32, 199, 210, 220, '55.00', 1, '2018-05-31 10:00:37'),
(32, 200, 220, 25, '200.00', 1, '2018-05-31 10:00:37'),
(32, 201, 230, 300, '1200.00', 1, '2018-05-31 10:00:37'),
(32, 202, 240, 75, '501.30', 1, '2018-05-31 10:00:37'),
(32, 203, 250, 250, '448.00', 1, '2018-05-31 10:00:37'),
(32, 204, 260, 1, '1650.00', 1, '2018-05-31 10:00:37'),
(32, 205, 270, 1, '2500.00', 1, '2018-05-31 10:00:37'),
(33, 206, 9, 1, '1500.00', 20, '2018-05-31 15:11:07'),
(33, 207, 10, 1, '2420.00', 20, '2018-05-31 15:11:07'),
(33, 208, 15, 1, '15000.00', 20, '2018-05-31 15:11:07'),
(33, 209, 40, 2, '2562.50', 20, '2018-05-31 15:11:07'),
(33, 210, 50, 1, '3050.00', 20, '2018-05-31 15:11:07'),
(33, 211, 60, 75, '145.00', 20, '2018-05-31 15:11:07'),
(33, 212, 70, 50, '145.00', 20, '2018-05-31 15:11:07'),
(33, 213, 80, 15, '125.00', 20, '2018-05-31 15:11:07'),
(33, 214, 90, 1, '4500.00', 20, '2018-05-31 15:11:07'),
(33, 215, 100, 10, '300.00', 20, '2018-05-31 15:11:07'),
(33, 216, 120, 200, '25.00', 20, '2018-05-31 15:11:07'),
(33, 217, 130, 35, '1500.00', 20, '2018-05-31 15:11:07'),
(33, 218, 140, 12, '600.00', 20, '2018-05-31 15:11:07'),
(33, 219, 150, 7, '3000.00', 20, '2018-05-31 15:11:07'),
(33, 220, 170, 2, '2500.00', 20, '2018-05-31 15:11:07'),
(33, 221, 180, 1, '6500.00', 20, '2018-05-31 15:11:07'),
(33, 222, 190, 220, '25.00', 20, '2018-05-31 15:11:07'),
(33, 223, 200, 220, '35.00', 20, '2018-05-31 15:11:07'),
(33, 224, 210, 220, '55.00', 20, '2018-05-31 15:11:07'),
(33, 225, 220, 34, '200.00', 20, '2018-05-31 15:11:07'),
(33, 226, 230, 250, '1200.00', 20, '2018-05-31 15:11:07'),
(33, 227, 240, 88, '501.30', 20, '2018-05-31 15:11:07'),
(33, 228, 250, 200, '448.00', 20, '2018-05-31 15:11:07'),
(33, 229, 260, 1, '1650.00', 20, '2018-05-31 15:11:07'),
(33, 230, 270, 1, '2500.00', 20, '2018-05-31 15:11:07');

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

--
-- Table structure for table `quote_status`
--

CREATE TABLE `quote_status` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `quote_status_id` int(3) NOT NULL,
  `description` varchar(255) NOT NULL,
  `updated_by` int(11) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `quote_status`
--

INSERT INTO `quote_status` (`id`, `client_id`, `quote_status_id`, `description`, `updated_by`, `updated_on`) VALUES
(1, 1, 1, 'Draft', 1, '2018-05-28 16:07:04'),
(2, 4, 2, 'saved', 18, '2018-05-16 16:19:33'),
(3, 4, 1, 'Draft', 18, '2018-05-17 06:21:47'),
(4, 4, 3, 'Cancelled', 18, '2018-05-28 13:09:38'),
(6, 1, 20, 'Saved', 1, '2018-05-28 15:35:52'),
(7, 1, 30, 'Cancelled', 1, '2018-05-28 16:30:54'),
(8, 1, 40, 'Sent', 1, '2018-05-28 20:21:12');

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

--
-- Table structure for table `sections`
--

CREATE TABLE `sections` (
  `section_id` int(3) NOT NULL,
  `client_id` int(11) NOT NULL,
  `description` varchar(50) NOT NULL,
  `folder_name` varchar(50) NOT NULL,
  `section_status_id` int(3) NOT NULL,
  `order_seq` int(3) NOT NULL,
  `updated_by` int(3) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `sections`
--

INSERT INTO `sections` (`section_id`, `client_id`, `description`, `folder_name`, `section_status_id`, `order_seq`, `updated_by`, `updated_on`) VALUES
(1, 1, 'Sections', 'sections', 1, 1, 1, '2018-04-12 08:40:13'),
(4, 1, 'Users', 'users', 1, 4, 1, '2018-04-12 14:21:29'),
(5, 1, 'User Statusses', 'user_status', 1, 5, 1, '2018-04-12 14:22:03'),
(6, 1, 'User Types', 'user_types', 1, 60, 1, '2018-04-12 14:22:27'),
(14, 1, 'User Access', 'user_access', 1, 140, 18, '2018-05-11 11:17:07'),
(18, 1, 'Bill of Quantities', 'bill_of_quantity', 1, 150, 1, '2018-05-06 10:41:48'),
(19, 1, 'Categories', 'boq_category', 1, 160, 1, '2018-05-28 21:53:52'),
(20, 1, 'Unit Of Measure', 'unit_of_measure', 1, 30, 1, '2018-05-06 12:04:29'),
(21, 1, 'Sub Categories', 'sub_category', 1, 35, 1, '2018-05-07 07:12:34'),
(23, 1, 'DB Users', 'db_users', 1, 3, 1, '2018-05-10 06:39:24'),
(24, 1, 'testclient section', 'testclients', 1, 1000, 1, '2018-05-10 11:09:54'),
(25, 1, 'Section Statusses', 'section_status', 1, 111, 1, '2018-05-10 11:25:10'),
(26, 4, 'Sections', 'sections', 1, 10, 18, '2018-05-10 20:52:55'),
(27, 4, 'Clients', 'client', 1, 20, 18, '2018-05-10 20:52:02'),
(28, 4, 'User Access', 'user_access', 1, 30, 18, '2018-05-10 20:57:43'),
(29, 4, 'Users', 'users', 1, 40, 18, '2018-05-10 21:09:27'),
(30, 4, 'User Statusses', 'user_status', 1, 50, 18, '2018-05-10 21:31:50'),
(31, 4, 'Bill of Quantities', 'bill_of_quantity', 1, 60, 18, '2018-05-11 05:56:07'),
(32, 4, 'Categories', 'boq_category', 1, 70, 18, '2018-05-11 05:57:10'),
(33, 4, 'DB Users', 'db_users', 1, 80, 18, '2018-05-11 05:58:06'),
(34, 4, 'Images', 'images', 1, 90, 18, '2018-05-11 05:58:53'),
(35, 4, 'Section Statusses', 'section_status', 1, 100, 18, '2018-05-11 05:59:35'),
(36, 4, 'Sub Categories', 'sub_category', 1, 110, 18, '2018-05-11 06:00:06'),
(37, 4, 'Unit Of Measure', 'unit_of_measure', 1, 120, 18, '2018-05-11 06:00:40'),
(38, 4, 'User Types', 'user_types', 1, 130, 18, '2018-05-11 06:01:45'),
(39, 4, 'Client Types', 'client_type', 1, 140, 18, '2018-05-11 06:07:06'),
(40, 4, 'Change Client Perspective', 'change_client_perspective', 1, 200, 18, '2018-05-11 14:58:41'),
(41, 1, 'Change Client Perspective', 'change_client_perspective', 1, 110, 1, '2018-05-12 13:21:29'),
(42, 4, 'Quote', 'quote', 1, 220, 1, '2018-05-15 09:15:22'),
(43, 1, 'Quote', 'quote', 1, 220, 1, '2018-05-15 10:56:28'),
(44, 1, 'Quote Status', 'quote_status', 1, 152, 1, '2018-05-28 13:20:36'),
(45, 1, 'Customers', 'customer', 1, 11, 1, '2018-05-28 21:52:57'),
(46, 1, 'Template', 'template', 1, 130, 1, '2018-05-29 08:51:47'),
(47, 1, 'Contacts', 'contact', 1, 170, 1, '2018-05-29 21:03:42');

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

--
-- Table structure for table `section_status`
--

CREATE TABLE `section_status` (
  `section_status_id` int(3) NOT NULL,
  `description` varchar(50) NOT NULL,
  `updated_by` int(3) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `section_status`
--

INSERT INTO `section_status` (`section_status_id`, `description`, `updated_by`, `updated_on`) VALUES
(1, 'Active', 1, '2018-04-12 08:35:28'),
(3, 'Inactive', 1, '2018-04-12 11:07:00');

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

--
-- Table structure for table `sub_category`
--

CREATE TABLE `sub_category` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `category_id` int(3) NOT NULL,
  `sub_category_id` int(11) NOT NULL,
  `description` varchar(255) NOT NULL,
  `updated_by` int(3) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `sub_category`
--

INSERT INTO `sub_category` (`id`, `client_id`, `category_id`, `sub_category_id`, `description`, `updated_by`, `updated_on`) VALUES
(1, 1, 20, 7, 'Demolition - Brick/Mortar/Doors/Structures', 1, '2018-05-07 09:49:48'),
(2, 1, 20, 3, 'Demolition - Plumbing', 1, '2018-05-07 09:50:10'),
(3, 1, 20, 4, 'Demolition - Electrical', 1, '2018-05-07 09:50:29'),
(4, 1, 20, 5, 'Demolition - Wall and Floor covering', 1, '2018-05-07 09:50:49'),
(5, 1, 20, 6, 'Demolition - Ceiling and Bulkhead', 1, '2018-05-07 09:51:04'),
(7, 1, 30, 8, 'Building Work - Building Works', 1, '2018-05-07 12:57:19'),
(8, 1, 30, 9, 'Building Work - Doors', 1, '2018-05-07 12:57:31'),
(9, 1, 30, 10, 'Building Work - Glass and shopfronts', 1, '2018-05-07 12:57:52'),
(10, 1, 30, 11, 'Building Work - Shop Painting', 1, '2018-05-07 12:58:02'),
(11, 1, 30, 12, 'Building Work - Holding cages', 1, '2018-05-07 12:58:14'),
(12, 1, 30, 13, 'Building Work - Trenching', 1, '2018-05-07 12:58:23'),
(13, 1, 30, 14, 'Building Work - Roofing', 1, '2018-05-07 12:58:34'),
(14, 1, 40, 15, 'Plumbing Work - Plumbing/Sanitary/Drainage', 1, '2018-05-07 12:59:27'),
(15, 1, 50, 16, 'Wall & Floor Finishing - Tiling', 1, '2018-05-07 13:03:34'),
(16, 1, 50, 17, 'Wall & Floor Finishing - Tiles Supply', 1, '2018-05-07 13:03:22'),
(17, 1, 50, 18, 'Wall & Floor Finishing - Tiling Labour', 1, '2018-05-07 13:03:12'),
(18, 1, 50, 19, 'Wall & Floor Finishing - Carpeting', 1, '2018-05-07 13:04:16'),
(19, 1, 50, 20, 'Wall & Floor Finishing - Recessed Floors', 1, '2018-05-07 13:04:43'),
(20, 1, 50, 21, 'Wall & Floor Finishing - Floor Resins', 1, '2018-05-07 13:05:04'),
(21, 1, 70, 22, 'Ceiling and Bulkheads', 1, '2018-05-07 15:13:39'),
(22, 1, 80, 23, 'Omissions and variation orders', 1, '2018-05-07 15:16:59'),
(24, 1, 10, 2, 'Site Setup - P&G\'s - H&S - S&T', 1, '2018-05-14 09:49:30'),
(26, 1, 10, 1, 'Site Setup', 1, '2018-05-14 10:01:53'),
(29, 4, 1, 3, 'Site Setup', 18, '2018-05-14 13:50:07'),
(30, 4, 2, 1, 'Demolition - Plumbing', 18, '2018-05-14 13:51:45'),
(31, 4, 1, 4, 'Site Setup - P&G\'s - H&S - S&T', 18, '2018-05-14 13:55:59');

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

--
-- Table structure for table `template`
--

CREATE TABLE `template` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `created_by` int(11) NOT NULL,
  `updated_by` int(3) NOT NULL,
  `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `template`
--

INSERT INTO `template` (`id`, `client_id`, `name`, `created_by`, `updated_by`, `created_on`, `updated_on`) VALUES
(16, 1, 'Superspar Template', 1, 1, '2018-05-29 09:58:38', '2018-05-29 12:11:47'),
(17, 1, 'Spar Template', 1, 1, '2018-05-29 10:21:41', '2018-05-29 10:21:41'),
(18, 1, 'Private Client Template', 1, 1, '2018-05-29 10:34:59', '2018-05-29 10:34:59'),
(19, 1, 'test', 1, 1, '2018-05-29 10:46:30', '2018-05-29 10:46:30'),
(23, 1, 'test1', 1, 1, '2018-05-30 07:09:32', '2018-05-30 07:09:32');

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

--
-- Table structure for table `template_line`
--

CREATE TABLE `template_line` (
  `template_id` int(11) NOT NULL,
  `id` int(11) NOT NULL,
  `bill_of_quantity_id` int(11) NOT NULL,
  `qty` int(11) NOT NULL,
  `price` decimal(11,2) NOT NULL,
  `updated_by` int(11) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `template_line`
--

INSERT INTO `template_line` (`template_id`, `id`, `bill_of_quantity_id`, `qty`, `price`, `updated_by`, `updated_on`) VALUES
(16, 135, 9, 1, '1500.00', 1, '2018-05-29 13:19:24'),
(17, 136, 9, 1, '1500.00', 1, '2018-05-30 13:43:34'),
(17, 137, 10, 1, '2420.00', 1, '2018-05-30 13:43:42'),
(17, 138, 15, 1, '15000.00', 1, '2018-05-30 13:43:56'),
(17, 139, 40, 2, '2562.50', 1, '2018-05-30 13:44:10'),
(17, 140, 50, 1, '3050.00', 1, '2018-05-30 13:44:25'),
(17, 141, 60, 75, '145.00', 1, '2018-05-30 13:44:39'),
(17, 142, 70, 50, '145.00', 1, '2018-05-30 13:44:55'),
(17, 143, 80, 15, '125.00', 1, '2018-05-30 13:45:08'),
(17, 144, 90, 1, '4500.00', 1, '2018-05-30 13:45:22'),
(17, 145, 100, 10, '300.00', 1, '2018-05-30 13:45:38'),
(17, 146, 120, 200, '25.00', 1, '2018-05-30 13:45:52'),
(17, 147, 130, 35, '1500.00', 1, '2018-05-30 13:46:20'),
(17, 148, 140, 12, '600.00', 1, '2018-05-30 13:46:34'),
(17, 149, 150, 7, '3000.00', 1, '2018-05-30 13:46:47'),
(17, 150, 170, 2, '2500.00', 1, '2018-05-30 13:46:59'),
(17, 151, 180, 1, '6500.00', 1, '2018-05-30 13:47:18'),
(17, 152, 190, 220, '25.00', 1, '2018-05-30 13:47:30'),
(17, 153, 200, 220, '35.00', 1, '2018-05-30 13:47:43'),
(17, 154, 210, 220, '55.00', 1, '2018-05-30 13:47:54'),
(17, 155, 220, 34, '200.00', 1, '2018-05-30 13:48:14'),
(17, 156, 230, 250, '1200.00', 1, '2018-05-30 13:48:26'),
(17, 157, 240, 88, '501.30', 1, '2018-05-30 13:48:44'),
(17, 158, 250, 200, '448.00', 1, '2018-05-30 13:49:03'),
(17, 159, 260, 1, '1650.00', 1, '2018-05-30 13:49:11'),
(17, 160, 270, 1, '2500.00', 1, '2018-05-30 13:49:20');

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

--
-- Table structure for table `unit_of_measure`
--

CREATE TABLE `unit_of_measure` (
  `id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `uom_id` int(3) NOT NULL,
  `abbreviation` varchar(50) NOT NULL,
  `description` varchar(255) NOT NULL,
  `formula` varchar(255) NOT NULL,
  `updated_by` int(3) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `unit_of_measure`
--

INSERT INTO `unit_of_measure` (`id`, `client_id`, `uom_id`, `abbreviation`, `description`, `formula`, `updated_by`, `updated_on`) VALUES
(1, 1, 10, 'sqm', 'Square Metre', 'm*m', 18, '2018-05-14 06:40:33'),
(2, 1, 20, 'LM', 'Linear Meter', 'm', 18, '2018-05-14 06:40:40'),
(3, 1, 30, 'm', 'meter', 'm', 18, '2018-05-14 06:40:46'),
(4, 1, 40, 'm3', 'Cubic metre', 'l*w*h', 18, '2018-05-14 06:40:53'),
(5, 1, 50, 'fixed', 'Fixed Cost', '', 18, '2018-05-14 06:40:59'),
(6, 1, 60, 'PC', 'Prime Cost Item', 'Variable', 18, '2018-05-14 06:41:06'),
(7, 1, 25, 'PS', 'Provisional Sum', 'Variable', 18, '2018-05-14 06:41:11'),
(9, 4, 10, 'sqm', 'Square Metre', 'm * m', 18, '2018-05-14 06:45:23'),
(10, 1, 70, 'mm', 'Milimetre', 'mm', 1, '2018-05-14 08:52:14');

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

--
-- Table structure for table `user`
--

CREATE TABLE `user` (
  `user_id` int(3) NOT NULL,
  `client_id` int(11) NOT NULL,
  `status_id` int(3) NOT NULL,
  `name` varchar(25) NOT NULL,
  `surname` varchar(25) NOT NULL,
  `email_address` varchar(256) NOT NULL,
  `password` varbinary(160) NOT NULL,
  `user_type` int(3) NOT NULL,
  `updated_by` int(3) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `user`
--

INSERT INTO `user` (`user_id`, `client_id`, `status_id`, `name`, `surname`, `email_address`, `password`, `user_type`, `updated_by`, `updated_on`) VALUES
(1, 1, 1, 'Francois', 'Oosthuizen', 'fjofrancois@gmail.com', 0xaebcabe07e1d0d20198b287d219dff1d, 11, 1, '2018-05-10 12:01:45'),
(17, 3, 1, 'Terliana', 'Wessels', 'production@houseofmaria.com', 0x07ccb7bdd595e03598400873575c9adc, 9, 1, '2018-04-14 11:29:04'),
(18, 4, 1, 'Frans', 'Oosthuizen', 'francois@obsystems.co.za', 0xc2457b7537fe578b4d6e0df3c89205ad, 11, 1, '2018-05-10 11:28:21'),
(19, 0, 1, 'Morne', 'Gerber', 'francois@houseofmaria.com', 0x07ccb7bdd595e03598400873575c9adc, 1, 1, '2018-05-31 10:05:25'),
(20, 1, 1, 'Morne', 'Gerber', 'francois@houseofmaria.com', 0x07ccb7bdd595e03598400873575c9adc, 1, 20, '2018-05-31 15:03:25');

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

--
-- Table structure for table `user_access`
--

CREATE TABLE `user_access` (
  `id` int(5) NOT NULL,
  `client_id` int(11) NOT NULL,
  `user_type_id` int(3) NOT NULL,
  `section_id` int(3) NOT NULL,
  `access_level` char(5) NOT NULL,
  `updated_by` int(3) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `user_access`
--

INSERT INTO `user_access` (`id`, `client_id`, `user_type_id`, `section_id`, `access_level`, `updated_by`, `updated_on`) VALUES
(2, 4, 1, 2, '10000', 1, '2018-04-23 06:15:53'),
(4, 1, 1, 4, '10000', 18, '2018-05-11 08:27:13'),
(5, 1, 1, 5, '10010', 18, '2018-05-11 08:26:55'),
(9, 1, 1, 6, '10010', 18, '2018-05-11 08:27:05'),
(10, 4, 1, 7, '10010', 1, '2018-04-19 10:40:30'),
(11, 4, 1, 8, '10000', 1, '2018-04-23 06:15:44'),
(12, 4, 1, 9, '10100', 1, '2018-04-19 10:27:34'),
(13, 0, 1, 10, '10000', 1, '2018-04-23 06:15:34'),
(14, 0, 1, 11, '10000', 1, '2018-04-23 06:15:26'),
(15, 0, 1, 12, '10010', 1, '2018-05-04 14:22:30'),
(17, 1, 10, 1, '00100', 18, '2018-05-11 08:27:42'),
(29, 0, 10, 2, '01011', 1, '2018-04-16 09:08:32'),
(30, 1, 1, 14, '10000', 18, '2018-05-11 08:26:43'),
(31, 0, 1, 15, '10000', 1, '2018-04-23 06:14:44'),
(33, 1, 9, 4, '00100', 18, '2018-05-11 08:27:22'),
(35, 0, 9, 7, '01110', 0, '2018-04-16 14:17:04'),
(36, 0, 9, 9, '01110', 0, '2018-04-16 14:17:21'),
(37, 0, 9, 10, '01110', 0, '2018-04-16 14:17:35'),
(38, 0, 9, 11, '00100', 0, '2018-04-16 14:17:47'),
(39, 0, 9, 12, '00010', 1, '2018-05-04 12:15:22'),
(41, 0, 9, 2, '00000', 1, '2018-04-23 11:14:37'),
(46, 0, 9, 8, '01100', 1, '2018-04-23 11:14:15'),
(52, 0, 9, 13, '01111', 17, '2018-04-17 08:36:19'),
(54, 0, 9, 15, '10000', 17, '2018-04-17 08:36:34'),
(55, 0, 1, 13, '10000', 1, '2018-04-23 06:15:06'),
(56, 0, 1, 16, '10000', 1, '2018-04-19 07:15:24'),
(57, 0, 1, 17, '00101', 1, '2018-04-19 10:51:59'),
(58, 1, 1, 1, '10000', 18, '2018-05-11 08:26:14'),
(59, 1, 1, 18, '10000', 18, '2018-05-11 08:25:27'),
(60, 1, 1, 19, '10000', 18, '2018-05-11 08:25:38'),
(61, 1, 1, 20, '10000', 18, '2018-05-11 08:26:33'),
(62, 1, 1, 21, '10000', 18, '2018-05-11 08:26:21'),
(65, 4, 11, 4, '10000', 18, '2018-05-11 08:29:44'),
(66, 4, 11, 6, '10000', 18, '2018-05-11 08:29:34'),
(67, 4, 11, 5, '10000', 18, '2018-05-11 08:29:25'),
(69, 4, 11, 1, '10000', 18, '2018-05-11 11:52:47'),
(70, 4, 11, 23, '10000', 18, '2018-05-11 08:28:23'),
(71, 4, 11, 22, '10000', 18, '2018-05-11 08:27:54'),
(72, 4, 11, 25, '10000', 18, '2018-05-11 08:28:34'),
(75, 4, 11, 28, '10000', 18, '2018-05-11 11:56:57'),
(90, 1, 11, 14, '10000', 18, '2018-05-11 16:16:58'),
(94, 1, 11, 20, '10000', 1, '2018-05-14 08:46:36'),
(95, 1, 11, 21, '10000', 1, '2018-05-14 09:49:11'),
(96, 1, 11, 19, '10000', 1, '2018-05-15 06:37:48'),
(97, 4, 11, 42, '10000', 18, '2018-05-17 06:57:49'),
(98, 1, 11, 43, '10000', 1, '2018-05-20 08:44:12'),
(99, 1, 11, 18, '10000', 1, '2018-05-23 08:52:19'),
(100, 1, 11, 44, '10000', 1, '2018-05-28 13:21:00'),
(101, 1, 11, 45, '10000', 1, '2018-05-28 21:53:13'),
(102, 1, 11, 46, '10000', 1, '2018-05-29 08:52:03'),
(103, 1, 11, 47, '10000', 1, '2018-05-29 21:03:57'),
(104, 1, 1, 47, '10000', 19, '2018-05-31 11:27:13'),
(105, 1, 1, 22, '10000', 19, '2018-05-31 11:27:58'),
(106, 1, 1, 45, '10000', 20, '2018-05-31 15:06:04'),
(107, 1, 1, 43, '10000', 20, '2018-05-31 15:10:11');

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

--
-- Table structure for table `user_status`
--

CREATE TABLE `user_status` (
  `id` int(3) NOT NULL,
  `description` varchar(50) NOT NULL,
  `updated_by` int(3) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `user_status`
--

INSERT INTO `user_status` (`id`, `description`, `updated_by`, `updated_on`) VALUES
(1, 'active', 1, '2018-04-09 12:27:23'),
(2, 'inactive', 1, '2018-04-09 12:27:54');

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

--
-- Table structure for table `user_type`
--

CREATE TABLE `user_type` (
  `user_type_id` int(3) NOT NULL,
  `user_type_description` varchar(50) NOT NULL,
  `updated_by` int(3) NOT NULL,
  `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `user_type`
--

INSERT INTO `user_type` (`user_type_id`, `user_type_description`, `updated_by`, `updated_on`) VALUES
(1, 'Admin', 1, '2018-04-12 08:50:44'),
(9, 'Manager', 1, '2018-04-14 11:26:23'),
(10, 'Operator', 1, '2018-04-14 11:27:37'),
(11, 'Super', 1, '2018-05-10 06:43:25');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `address`
--
ALTER TABLE `address`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_address_client_address_id` (`client_id`,`address_id`),
  ADD KEY `fk_address_type` (`client_id`,`address_type`);

--
-- Indexes for table `address_type`
--
ALTER TABLE `address_type`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_addr_type_client_address_type_id` (`client_id`,`address_type_id`);

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

--
-- Indexes for table `bill_of_quantities`
--
ALTER TABLE `bill_of_quantities`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_bill_of_quantities_client_id_cat_id_sub_cat_id_bil_of_qty_id` (`client_id`,`category_id`,`sub_category_id`,`bill_of_qty_id`);

--
-- Indexes for table `boq_categories`
--
ALTER TABLE `boq_categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_boq_category_client_id_category_id` (`client_id`,`category_id`);

--
-- Indexes for table `category_notes`
--
ALTER TABLE `category_notes`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_category_notes_client_id_category_id_category_line_id` (`client_id`,`category_id`,`category_line_id`);

--
-- Indexes for table `client`
--
ALTER TABLE `client`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_client_type_id` (`client_type_id`);

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

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

--
-- Indexes for table `contact`
--
ALTER TABLE `contact`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_contact_client_contact` (`client_id`,`contact_id`),
  ADD KEY `fk_contact_contact_type` (`client_id`,`contact_type`);

--
-- Indexes for table `contact_type`
--
ALTER TABLE `contact_type`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_contact_type_client_id_contact_type_id_desc` (`client_id`,`contact_type_id`,`description`) USING BTREE;

--
-- Indexes for table `customer`
--
ALTER TABLE `customer`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_customer_client_id_name` (`client_id`,`name`),
  ADD KEY `fk_customer_address` (`client_id`,`address_id`),
  ADD KEY `fk_customer_template` (`client_id`,`preferred_template_id`),
  ADD KEY `fk_customer_contact` (`client_id`,`preferred_contact_id`),
  ADD KEY `fk_cust_cust_type` (`client_id`,`customer_type_id`);

--
-- Indexes for table `customer_type`
--
ALTER TABLE `customer_type`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_cust_type_client_id_cust_type_id_desc` (`client_id`,`customer_type_id`,`description`) USING BTREE;

--
-- Indexes for table `db_user`
--
ALTER TABLE `db_user`
  ADD PRIMARY KEY (`user_id`);

--
-- Indexes for table `footer_note`
--
ALTER TABLE `footer_note`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_footer_note_client_id_footer_note_id_footer_note_line_no` (`client_id`,`footer_note_id`,`footer_note_line_no`);

--
-- Indexes for table `header_note`
--
ALTER TABLE `header_note`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_header_note_client_id_header_note_id_header_note_line_no` (`client_id`,`header_note_id`,`header_note_line_no`);

--
-- Indexes for table `payment_terms`
--
ALTER TABLE `payment_terms`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_payment_terms_client_id_customer_id_payment_term_id` (`client_id`,`customer_id`,`payment_term_id`);

--
-- Indexes for table `quote`
--
ALTER TABLE `quote`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_quote_client_id_customer_id_quote_no_revision_id` (`client_id`,`customer_id`,`quote_no`,`revision`) USING BTREE,
  ADD KEY `fk_status` (`client_id`,`status_id`);

--
-- Indexes for table `quote_line`
--
ALTER TABLE `quote_line`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_quote_line_quote_id_id` (`quote_id`,`id`);

--
-- Indexes for table `quote_status`
--
ALTER TABLE `quote_status`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_quote_status_client_status` (`client_id`,`quote_status_id`);

--
-- Indexes for table `sections`
--
ALTER TABLE `sections`
  ADD PRIMARY KEY (`section_id`),
  ADD UNIQUE KEY `idx_sections_client_id_section_id` (`client_id`,`section_id`) USING BTREE;

--
-- Indexes for table `section_status`
--
ALTER TABLE `section_status`
  ADD PRIMARY KEY (`section_status_id`);

--
-- Indexes for table `sub_category`
--
ALTER TABLE `sub_category`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_sub_category_client_id_category_id_sub_category_id` (`client_id`,`category_id`,`sub_category_id`) USING BTREE;

--
-- Indexes for table `template`
--
ALTER TABLE `template`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_template_client_id` (`client_id`,`id`);

--
-- Indexes for table `template_line`
--
ALTER TABLE `template_line`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_template_line_template_id_id` (`template_id`,`id`);

--
-- Indexes for table `unit_of_measure`
--
ALTER TABLE `unit_of_measure`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_uom_client_id_uom_id` (`client_id`,`uom_id`);

--
-- Indexes for table `user`
--
ALTER TABLE `user`
  ADD PRIMARY KEY (`user_id`);

--
-- Indexes for table `user_access`
--
ALTER TABLE `user_access`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `idx_user_access_client_id_user_type_id_section_id` (`client_id`,`user_type_id`,`section_id`) USING BTREE;

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

--
-- Indexes for table `user_type`
--
ALTER TABLE `user_type`
  ADD PRIMARY KEY (`user_type_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `address`
--
ALTER TABLE `address`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `address_type`
--
ALTER TABLE `address_type`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `bank_detail`
--
ALTER TABLE `bank_detail`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `bill_of_quantities`
--
ALTER TABLE `bill_of_quantities`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
--
-- AUTO_INCREMENT for table `boq_categories`
--
ALTER TABLE `boq_categories`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
--
-- AUTO_INCREMENT for table `category_notes`
--
ALTER TABLE `category_notes`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `client`
--
ALTER TABLE `client`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `client_type`
--
ALTER TABLE `client_type`
  MODIFY `id` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `completed_project`
--
ALTER TABLE `completed_project`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `contact`
--
ALTER TABLE `contact`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `contact_type`
--
ALTER TABLE `contact_type`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `customer`
--
ALTER TABLE `customer`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `customer_type`
--
ALTER TABLE `customer_type`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `db_user`
--
ALTER TABLE `db_user`
  MODIFY `user_id` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
--
-- AUTO_INCREMENT for table `footer_note`
--
ALTER TABLE `footer_note`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `header_note`
--
ALTER TABLE `header_note`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `payment_terms`
--
ALTER TABLE `payment_terms`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `quote`
--
ALTER TABLE `quote`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;
--
-- AUTO_INCREMENT for table `quote_line`
--
ALTER TABLE `quote_line`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=231;
--
-- AUTO_INCREMENT for table `quote_status`
--
ALTER TABLE `quote_status`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `sections`
--
ALTER TABLE `sections`
  MODIFY `section_id` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=48;
--
-- AUTO_INCREMENT for table `section_status`
--
ALTER TABLE `section_status`
  MODIFY `section_status_id` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `sub_category`
--
ALTER TABLE `sub_category`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;
--
-- AUTO_INCREMENT for table `template`
--
ALTER TABLE `template`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
--
-- AUTO_INCREMENT for table `template_line`
--
ALTER TABLE `template_line`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=161;
--
-- AUTO_INCREMENT for table `unit_of_measure`
--
ALTER TABLE `unit_of_measure`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
  MODIFY `user_id` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT for table `user_access`
--
ALTER TABLE `user_access`
  MODIFY `id` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=108;
--
-- AUTO_INCREMENT for table `user_status`
--
ALTER TABLE `user_status`
  MODIFY `id` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `user_type`
--
ALTER TABLE `user_type`
  MODIFY `user_type_id` int(3) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- Constraints for dumped tables
--

--
-- Constraints for table `address`
--
ALTER TABLE `address`
  ADD CONSTRAINT `fk_address_client` FOREIGN KEY (`client_id`) REFERENCES `client` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_address_type` FOREIGN KEY (`client_id`,`address_type`) REFERENCES `address_type` (`client_id`, `address_type_id`) ON UPDATE CASCADE;

--
-- Constraints for table `address_type`
--
ALTER TABLE `address_type`
  ADD CONSTRAINT `fk_address_type_client` FOREIGN KEY (`client_id`) REFERENCES `client` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `bill_of_quantities`
--
ALTER TABLE `bill_of_quantities`
  ADD CONSTRAINT `fk_boq_sub_category` FOREIGN KEY (`client_id`,`category_id`,`sub_category_id`) REFERENCES `sub_category` (`client_id`, `category_id`, `sub_category_id`) ON UPDATE CASCADE;

--
-- Constraints for table `category_notes`
--
ALTER TABLE `category_notes`
  ADD CONSTRAINT `fk_cat_notes_category` FOREIGN KEY (`client_id`,`category_id`) REFERENCES `boq_categories` (`client_id`, `category_id`) ON UPDATE CASCADE;

--
-- Constraints for table `contact`
--
ALTER TABLE `contact`
  ADD CONSTRAINT `fk_contact_client` FOREIGN KEY (`client_id`) REFERENCES `client` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_contact_contact_type` FOREIGN KEY (`client_id`,`contact_type`) REFERENCES `contact_type` (`client_id`, `contact_type_id`) ON UPDATE CASCADE;

--
-- Constraints for table `contact_type`
--
ALTER TABLE `contact_type`
  ADD CONSTRAINT `fk_contact_type_client` FOREIGN KEY (`client_id`) REFERENCES `client` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `customer`
--
ALTER TABLE `customer`
  ADD CONSTRAINT `fk_cust_cust_type` FOREIGN KEY (`client_id`,`customer_type_id`) REFERENCES `customer_type` (`client_id`, `customer_type_id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_customer_address` FOREIGN KEY (`client_id`,`address_id`) REFERENCES `address` (`client_id`, `address_id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_customer_client` FOREIGN KEY (`client_id`) REFERENCES `client` (`id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_customer_contact` FOREIGN KEY (`client_id`,`preferred_contact_id`) REFERENCES `contact` (`client_id`, `contact_id`) ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_customer_template` FOREIGN KEY (`client_id`,`preferred_template_id`) REFERENCES `template` (`client_id`, `id`) ON UPDATE CASCADE;

--
-- Constraints for table `quote`
--
ALTER TABLE `quote`
  ADD CONSTRAINT `fk_status` FOREIGN KEY (`client_id`,`status_id`) REFERENCES `quote_status` (`client_id`, `quote_status_id`) ON UPDATE CASCADE;

--
-- Constraints for table `quote_status`
--
ALTER TABLE `quote_status`
  ADD CONSTRAINT `fk_client` FOREIGN KEY (`client_id`) REFERENCES `client` (`id`) ON UPDATE CASCADE;

--
-- Constraints for table `sub_category`
--
ALTER TABLE `sub_category`
  ADD CONSTRAINT `FK_sub_category_boq_categories` FOREIGN KEY (`client_id`,`category_id`) REFERENCES `boq_categories` (`client_id`, `category_id`) ON UPDATE CASCADE;

--
-- Constraints for table `template_line`
--
ALTER TABLE `template_line`
  ADD CONSTRAINT `fk_template_line_template` FOREIGN KEY (`template_id`) REFERENCES `template` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
