-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 23, 2026 at 01:05 AM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12

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


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

--
-- Database: `fund_request_system`
--

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

--
-- Table structure for table `activities`
--

CREATE TABLE `activities` (
  `id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `budget` decimal(15,2) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `activities`
--

INSERT INTO `activities` (`id`, `project_id`, `name`, `budget`) VALUES
(1, 1, 'Training', 6000.00),
(2, 1, 'workes', 2000.00),
(3, 1, 'Training', 2000.00),
(4, 1, 'workes', 2000.00),
(5, 2, 'Training', 30000.00),
(6, 2, 'making Bricks', 30000.00),
(7, 3, 'Pay', 3000.00),
(8, 3, 'Brick', 3000.00),
(10, 1, 'Dig Well', 2000000.00),
(11, 1, 'Dig Well', 2000000.00),
(12, 1, 'Install Pump', 3000000.00),
(13, 2, 'Paint Classrooms', 1000000.00),
(14, 2, 'Repair Roof', 2000000.00),
(15, 3, 'Upgrade Equipment', 2500000.00),
(16, 3, 'Staff Training', 1500000.00),
(17, 7, 'takin', 3000.00),
(18, 3, 'Trial', 300000.00);

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

--
-- Table structure for table `audit_logs`
--

CREATE TABLE `audit_logs` (
  `id` int(11) NOT NULL,
  `user_email` varchar(255) DEFAULT NULL,
  `action` varchar(100) NOT NULL,
  `requisition_id` int(11) DEFAULT NULL,
  `meta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`meta`)),
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

CREATE TABLE `bill_of_quantities` (
  `id` int(11) NOT NULL,
  `project_id` int(11) DEFAULT NULL,
  `boq_name` varchar(255) NOT NULL,
  `dbl_number` varchar(100) NOT NULL,
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `status` enum('Draft','Locked') NOT NULL DEFAULT 'Draft'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `bill_of_quantities` (`id`, `project_id`, `boq_name`, `dbl_number`, `created_by`, `created_at`, `status`) VALUES
(1, 1, '', '', 0, '2025-12-10 09:30:08', 'Draft'),
(2, 1, '', '', 0, '2025-12-10 09:55:09', 'Draft'),
(3, 1, '', '', 0, '2025-12-10 10:30:55', 'Draft'),
(4, 1, '', '', 0, '2025-12-10 10:52:40', 'Draft'),
(5, 1, '', '', 0, '2025-12-10 11:08:48', 'Draft'),
(6, 1, '', '', 0, '2025-12-10 11:19:57', 'Draft'),
(7, 1, '', '', 0, '2025-12-10 11:28:14', 'Draft'),
(8, 1, '', '', 0, '2025-12-10 11:29:14', 'Draft'),
(9, 1, 'Masumba Nkhunda Buildings', '', 0, '2025-12-10 11:39:01', 'Draft'),
(10, 1, 'Masumba', '', 0, '2025-12-10 12:28:26', 'Draft'),
(11, 1, 'Masumba', '', 0, '2025-12-10 12:28:50', 'Draft'),
(12, 1, 'Masumba', '', 0, '2025-12-10 12:29:16', 'Draft'),
(13, 1, 'Masumba', '', 0, '2025-12-10 12:29:25', 'Draft'),
(14, 1, 'Masumba', '', 0, '2025-12-10 13:08:01', 'Draft'),
(15, 1, '', '', 0, '2025-12-10 13:52:04', 'Draft'),
(16, 1, 'Masumba', '', 0, '2025-12-10 13:52:25', 'Draft'),
(17, 1, '', '', 0, '2025-12-10 13:53:37', 'Draft'),
(18, 1, '', '', 0, '2025-12-10 13:54:07', 'Draft'),
(19, NULL, 'ZOMBA TOILETS', '9518-7854-222A', NULL, '2025-12-12 08:34:43', 'Draft'),
(20, NULL, 'ZOMBA HOUSES', '9518-7854-222B', NULL, '2025-12-12 08:34:43', 'Draft'),
(21, 1, 'Three Room House', '1234-3425-A4', 0, '2025-12-18 10:28:28', 'Locked'),
(22, 1, 'Masumba Nkhunda Buildings', '1234-3425-A5', 0, '2025-12-18 11:24:42', 'Draft'),
(23, 2, 'Checking', '2234-1224-A421', 0, '2026-01-08 10:46:31', 'Locked'),
(24, 2, 'Two Roomed Hous', '1234-3425-A66', 0, '2026-01-13 10:00:11', 'Locked'),
(25, 3, 'one room houae', '1234-3425-A44', 0, '2026-01-26 06:43:15', 'Draft');

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

--
-- Table structure for table `boq_items`
--

CREATE TABLE `boq_items` (
  `id` int(11) NOT NULL,
  `boq_id` int(11) DEFAULT NULL,
  `item_id` int(11) DEFAULT NULL,
  `quantity` decimal(10,2) DEFAULT NULL,
  `unit_cost` decimal(10,2) DEFAULT NULL,
  `level` varchar(50) DEFAULT NULL,
  `parent_item_id` int(11) DEFAULT NULL,
  `total_cost` decimal(12,2) DEFAULT NULL,
  `level_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `boq_items`
--

INSERT INTO `boq_items` (`id`, `boq_id`, `item_id`, `quantity`, `unit_cost`, `level`, `parent_item_id`, `total_cost`, `level_id`) VALUES
(1, 1, 1, 100.00, 10000.00, NULL, NULL, NULL, 0),
(2, 3, 1, 100.00, 10000.00, NULL, NULL, NULL, 0),
(3, 5, 1, 100.00, 10000.00, NULL, NULL, NULL, 0),
(4, 6, 1, 100.00, 10000.00, 'foundation', NULL, NULL, 0),
(5, 7, 1, 100.00, 10000.00, 'foundation', NULL, NULL, 0),
(6, 8, 1, 100.00, 10000.00, 'foundation', NULL, NULL, 0),
(8, 9, 1, 100.00, 10000.00, 'walls', NULL, NULL, 0),
(9, 9, 2, 100.00, 100.00, 'roofing', NULL, NULL, 0),
(10, 10, 2, 123.00, 123.00, 'walls', NULL, NULL, 0),
(11, 10, 1, 345.00, 123.00, 'walls', NULL, NULL, 0),
(12, 11, 2, 123.00, 123.00, 'walls', NULL, NULL, 0),
(13, 11, 1, 345.00, 123.00, 'walls', NULL, NULL, 0),
(14, 12, 2, 123.00, 123.00, 'walls', NULL, NULL, 0),
(15, 12, 1, 345.00, 123.00, 'walls', NULL, NULL, 0),
(16, 13, 2, 123.00, 123.00, 'walls', NULL, NULL, 0),
(17, 13, 1, 345.00, 123.00, 'walls', NULL, NULL, 0),
(18, 14, 2, 123.00, 123.00, 'walls', NULL, NULL, 0),
(19, 14, 1, 345.00, 123.00, 'walls', NULL, NULL, 0),
(20, 15, 2, 123.00, 123.00, 'walls', NULL, NULL, 0),
(21, 15, 1, 345.00, 123.00, 'walls', NULL, NULL, 0),
(28, 16, 1, 345.00, 123.00, 'walls', NULL, NULL, 0),
(27, 16, 2, 123.00, 123.00, 'walls', NULL, NULL, 0),
(24, 17, 2, 123.00, 123.00, 'walls', NULL, NULL, 0),
(25, 17, 1, 345.00, 123.00, 'walls', NULL, NULL, 0),
(26, 18, 1, 100.00, 1000.00, 'walls', NULL, NULL, 0),
(29, 16, 2, 100.00, 3.00, 'walls', NULL, NULL, 0),
(30, 16, 2, 100.00, 2.00, 'walls', NULL, NULL, 0),
(34, 24, 1, 34.00, 2000.00, 'walls', NULL, NULL, 0),
(32, 22, 1, 1000.00, 100.00, 'walls', NULL, NULL, 0),
(33, 23, 1, 1.00, 2000.00, 'walls', NULL, NULL, 0),
(35, 24, 2, 30.00, 2000.00, 'roofing', NULL, NULL, 0),
(36, 24, 1, 42.00, 20000.00, 'foundation', NULL, NULL, 0),
(37, 25, 1, 230.00, 4000.00, 'walls', NULL, NULL, 0),
(38, 25, 1, 25.00, 4000.00, 'foundation', NULL, NULL, 0);

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

--
-- Table structure for table `boq_levels`
--

CREATE TABLE `boq_levels` (
  `id` int(11) NOT NULL,
  `level_name` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `boq_levels`
--

INSERT INTO `boq_levels` (`id`, `level_name`) VALUES
(1, 'Foundation'),
(2, 'Substructure'),
(3, 'Walling'),
(4, 'Roofing'),
(5, 'Finishing');

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

--
-- Table structure for table `boq_sub_items`
--

CREATE TABLE `boq_sub_items` (
  `id` int(11) NOT NULL,
  `boq_item_id` int(11) DEFAULT NULL,
  `sub_item_name` varchar(255) DEFAULT NULL,
  `quantity` decimal(10,2) DEFAULT NULL,
  `unit_cost` decimal(10,2) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `boq_sub_items`
--

INSERT INTO `boq_sub_items` (`id`, `boq_item_id`, `sub_item_name`, `quantity`, `unit_cost`) VALUES
(1, 10, '3.5', NULL, NULL),
(2, 11, 'check', NULL, NULL),
(3, 16, '3.5', NULL, NULL),
(4, 17, 'check', NULL, NULL),
(5, 18, '3.5', NULL, NULL),
(6, 19, 'check', NULL, NULL),
(11, 28, 'check', NULL, NULL),
(10, 27, '3.5', NULL, NULL),
(9, 26, '3.5', NULL, NULL),
(12, 29, 'check', NULL, NULL),
(13, 30, 'check', NULL, NULL),
(14, 32, '32.4', NULL, NULL),
(15, 33, '32.4', NULL, NULL),
(16, 34, '32.4', NULL, NULL),
(17, 35, '12 feet', NULL, NULL),
(18, 36, '42.4', NULL, NULL),
(19, 37, '32.4', NULL, NULL),
(20, 38, '41.6', NULL, NULL);

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

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

CREATE TABLE `categories` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `categories` (`id`, `name`) VALUES
(2, 'electronics'),
(3, 'furniture'),
(4, 'software'),
(1, 'stationery');

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

--
-- Table structure for table `documents`
--

CREATE TABLE `documents` (
  `id` int(11) NOT NULL,
  `requisition_id` int(11) NOT NULL,
  `document_type` enum('quotation','invoice','other') NOT NULL,
  `file_path` varchar(255) NOT NULL,
  `uploaded_by` varchar(150) NOT NULL,
  `uploaded_at` datetime DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `fund_requests`
--

CREATE TABLE `fund_requests` (
  `id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL,
  `activity_id` int(11) NOT NULL,
  `requester_email` varchar(255) NOT NULL,
  `approver_email` varchar(255) DEFAULT NULL,
  `amount` decimal(12,2) NOT NULL,
  `attachment` varchar(255) DEFAULT NULL,
  `status` enum('pending','approved','rejected') DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `boq_id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `fund_requests`
--

INSERT INTO `fund_requests` (`id`, `project_id`, `activity_id`, `requester_email`, `approver_email`, `amount`, `attachment`, `status`, `created_at`, `boq_id`) VALUES
(1, 1, 1, 'user1@habitatmw.org', 'manager1@habitatmw.org', 500000.00, 'request1.pdf', 'pending', '2025-10-30 08:50:25', NULL),
(2, 1, 2, 'user2@habitatmw.org', 'manager1@habitatmw.org', 1000000.00, 'request2.pdf', 'pending', '2025-10-30 08:50:25', NULL),
(3, 2, 3, 'user1@habitatmw.org', 'manager2@habitatmw.org', 500000.00, 'request3.pdf', 'pending', '2025-10-30 08:50:25', NULL),
(4, 3, 5, 'user2@habitatmw.org', 'manager2@habitatmw.org', 1000000.00, 'request4.pdf', 'approved', '2025-10-30 08:50:25', NULL),
(5, 3, 6, 'user1@habitatmw.org', 'manager2@habitatmw.org', 500000.00, 'request5.pdf', 'rejected', '2025-10-30 08:50:25', NULL),
(6, 3, 7, 'user1@habitatmw.org', 'manager@habitat.org', 500000.00, 'request5.pdf', 'rejected', '2025-10-30 08:53:17', NULL);

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

--
-- Table structure for table `invoices`
--

CREATE TABLE `invoices` (
  `id` int(11) NOT NULL,
  `requisition_id` int(11) NOT NULL,
  `invoice_number` varchar(255) NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `file` varchar(255) DEFAULT NULL,
  `uploaded_by` varchar(255) DEFAULT NULL,
  `uploaded_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

CREATE TABLE `items` (
  `id` int(11) NOT NULL,
  `item_name` varchar(255) DEFAULT NULL,
  `unit` varchar(50) DEFAULT NULL,
  `category` varchar(50) DEFAULT 'construction',
  `default_unit_cost` decimal(10,2) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `items`
--

INSERT INTO `items` (`id`, `item_name`, `unit`, `category`, `default_unit_cost`) VALUES
(1, 'Cement', 'Kg', 'construction', 0.00),
(2, 'Iron Sheet', 'feet', 'construction', NULL);

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

--
-- Table structure for table `messages`
--

CREATE TABLE `messages` (
  `id` int(11) NOT NULL,
  `requistion_id` int(11) NOT NULL,
  `supplier_id` int(11) NOT NULL,
  `sender_role` enum('procurement','supplier') NOT NULL,
  `message_text` varchar(255) NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `payments`
--

CREATE TABLE `payments` (
  `id` int(11) NOT NULL,
  `request_id` int(11) DEFAULT NULL,
  `amount` decimal(12,2) DEFAULT NULL,
  `paid_by` varchar(100) DEFAULT NULL,
  `paid_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `procurement_plan`
--

CREATE TABLE `procurement_plan` (
  `id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL,
  `dbl_number` varchar(255) NOT NULL,
  `boq_id` int(11) DEFAULT NULL,
  `description` text NOT NULL,
  `technical_specifications` text DEFAULT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `approved_budget` decimal(15,2) NOT NULL,
  `procurement_type` varchar(100) NOT NULL,
  `procurement_method` varchar(100) NOT NULL,
  `expected_due_date` date NOT NULL,
  `procurement_time` varchar(255) NOT NULL,
  `uploaded_by` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `project` varchar(255) DEFAULT NULL,
  `supplier_category` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `procurement_plan`
--

INSERT INTO `procurement_plan` (`id`, `project_id`, `dbl_number`, `boq_id`, `description`, `technical_specifications`, `quantity`, `approved_budget`, `procurement_type`, `procurement_method`, `expected_due_date`, `procurement_time`, `uploaded_by`, `created_at`, `project`, `supplier_category`) VALUES
(23, 0, '1234-3425-A5', NULL, 'TV screen', 'services', 1.00, 4000.00, 'goods', '0', '2025-12-22', 'check this', 'lucy@habitat.mw', '2025-12-18 08:51:23', 'BMZ', 'stationery, electronics'),
(30, 2, '1234-3425-A66', NULL, 'Laptop', '0', 2.00, 1000000.00, '0', 'OPEN TENDER', '2025-12-21', 'check this', 'lucy@habitat.mw', '2026-01-13 10:03:36', NULL, 'electronics'),
(25, 0, '1234-3425-A7', NULL, 'Stationary', 'goods for use', 245.00, 4000.00, 'services', '0', '2025-12-24', 'check this', 'lucy@habitat.mw', '2025-12-18 08:51:23', 'BMZ', 'stationery'),
(29, 2, '2234-1224-A421', NULL, 'Fire ex', '0', 1.00, 4000.00, '0', 'OPEN TENDER', '2025-12-21', 'check this', 'lucy@habitat.mw', '2026-01-08 10:46:53', NULL, 'furniture'),
(27, 0, '1234-3425-A4', NULL, 'Alonda', 'goods for use', 245.00, 4000.00, 'services', '0', '2025-12-21', 'check this', 'lucy@habitat.mw', '2025-12-18 10:34:52', 'BMZ', ''),
(28, 1, '1234-3425-A4', NULL, '', '0', 245.00, 4000.00, '0', 'OPEN TENDER', '2025-12-21', 'check this', 'lucy@habitat.mw', '2026-01-08 09:54:53', NULL, 'software');

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

--
-- Table structure for table `procurement_plans`
--

CREATE TABLE `procurement_plans` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `projects`
--

CREATE TABLE `projects` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `total_budget` decimal(15,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `manager_email` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `projects`
--

INSERT INTO `projects` (`id`, `name`, `total_budget`, `created_at`, `manager_email`) VALUES
(1, 'BMZ', 7012000.00, '2025-10-29 14:11:01', ''),
(2, 'COC', 60000.00, '2025-10-30 06:05:26', 'lucy@habitat.mw'),
(3, 'GMF', 4036000.00, '2025-10-30 06:05:26', ''),
(7, 'WASH', 3000.00, '2025-11-06 14:44:39', '');

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

--
-- Table structure for table `project_assignments`
--

CREATE TABLE `project_assignments` (
  `id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL,
  `requester_email` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `project_assignments`
--

INSERT INTO `project_assignments` (`id`, `project_id`, `requester_email`) VALUES
(1, 1, 'requester4@habitatt.mw'),
(2, 3, 'requester6@habitatt.mw'),
(3, 1, 'fmanager@habitatt.mw'),
(4, 2, 'fmanager@habitatt.mw'),
(5, 3, 'fmanager@habitatt.mw'),
(6, 4, 'fmanager@habitatt.mw'),
(7, 5, 'fmanager@habitatt.mw'),
(8, 6, 'fmanager@habitatt.mw'),
(9, 7, 'fmanager@habitatt.mw'),
(10, 1, 'mkapito@habitat.mw'),
(11, 2, 'mkapito@habitat.mw'),
(12, 3, 'mkapito@habitat.mw'),
(13, 7, 'mkapito@habitat.mw'),
(14, 1, 'mkapito@habitat.mw'),
(15, 2, 'mkapito@habitat.mw'),
(16, 3, 'mkapito@habitat.mw'),
(17, 7, 'mkapito@habitat.mw'),
(18, 1, 'manager1@habitatmw.org'),
(19, 2, 'manager1@habitatmw.org'),
(20, 3, 'manager1@habitatmw.org'),
(21, 7, 'manager1@habitatmw.org');

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

--
-- Table structure for table `purchase_requisitions`
--

CREATE TABLE `purchase_requisitions` (
  `id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL,
  `activity_id` int(11) DEFAULT NULL,
  `sub_activity_id` int(11) DEFAULT NULL,
  `requester_email` varchar(255) NOT NULL,
  `approver_email` varchar(255) DEFAULT NULL,
  `procurement_email` varchar(255) DEFAULT NULL,
  `amount` decimal(15,2) NOT NULL,
  `supplier` varchar(255) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `attachment` varchar(512) DEFAULT NULL,
  `status` varchar(32) NOT NULL DEFAULT 'Pending',
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `quotations`
--

CREATE TABLE `quotations` (
  `id` int(11) NOT NULL,
  `requisition_id` int(11) DEFAULT NULL,
  `supplier_name` varchar(100) DEFAULT NULL,
  `supplier_id` int(11) NOT NULL,
  `file` varchar(255) DEFAULT NULL,
  `token` varchar(60) DEFAULT NULL,
  `price` int(10) DEFAULT NULL,
  `uploaded_by` varchar(100) DEFAULT NULL,
  `uploaded_at` datetime NOT NULL DEFAULT current_timestamp(),
  `is_selected` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `quotations`
--

INSERT INTO `quotations` (`id`, `requisition_id`, `supplier_name`, `supplier_id`, `file`, `token`, `price`, `uploaded_by`, `uploaded_at`, `is_selected`, `created_at`) VALUES
(1, 23, 'tchili', 0, '1769725045_Oxford.pdf', NULL, NULL, 'mkapito@habitat.mw', '2026-02-19 16:35:27', 0, '2026-01-29 22:17:25'),
(2, 23, 'tchili', 0, '1769725094_Oxford.pdf', NULL, NULL, 'mkapito@habitat.mw', '2026-02-19 16:35:27', 0, '2026-01-29 22:18:14'),
(3, 23, 'tchili', 0, '1769725123_Oxford.pdf', NULL, NULL, 'mkapito@habitat.mw', '2026-02-19 16:35:27', 0, '2026-01-29 22:18:43'),
(4, 23, 'tchili', 0, '1769726323_Oxford.pdf', NULL, NULL, 'mkapito@habitat.mw', '2026-02-19 16:35:27', 0, '2026-01-29 22:38:43'),
(5, 19, 'electronics', 0, '1769752093_Oxford.pdf', NULL, NULL, 'mkapito@habitat.mw', '2026-02-19 16:35:27', 0, '2026-01-30 05:48:13'),
(29, 88, 'Mwakanemela', 48, '20260223_010146_699b98ea35e02.pdf', 'ece3b54e66b28708518405bdc149a1e8', 400000, NULL, '2026-02-22 16:01:46', 0, '2026-02-23 00:01:46');

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

--
-- Table structure for table `requests`
--

CREATE TABLE `requests` (
  `id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL,
  `activity_id` int(11) NOT NULL,
  `sub_activity_id` int(11) DEFAULT NULL,
  `requester_email` varchar(255) NOT NULL,
  `approver_email` varchar(255) NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `payment_method` varchar(50) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `attachments` text DEFAULT NULL,
  `status` enum('pending','approved','approve_for_payment','rejected','paid') DEFAULT 'pending',
  `created_at` datetime DEFAULT current_timestamp(),
  `attachment` text DEFAULT NULL,
  `manager_comment` varchar(255) DEFAULT NULL,
  `accountant_comment` text DEFAULT NULL,
  `paid_at` timestamp NULL DEFAULT NULL,
  `payment_provider` varchar(50) DEFAULT NULL,
  `phone_number` varchar(20) DEFAULT NULL,
  `account_number` varchar(30) DEFAULT NULL,
  `requisition_id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `requests`
--

INSERT INTO `requests` (`id`, `project_id`, `activity_id`, `sub_activity_id`, `requester_email`, `approver_email`, `amount`, `payment_method`, `description`, `attachments`, `status`, `created_at`, `attachment`, `manager_comment`, `accountant_comment`, `paid_at`, `payment_provider`, `phone_number`, `account_number`, `requisition_id`) VALUES
(1, 1, 2, NULL, 'requester@habitat.mw', 'manager@habitat.mw', 30000.00, NULL, NULL, '[]', 'rejected', '2025-10-30 12:29:23', NULL, 'check', NULL, NULL, NULL, NULL, NULL, NULL),
(37, 3, 18, 5, 'requester6@habitatt.mw', 'lucy@habitat.mw', 123.00, NULL, 'check', NULL, 'pending', '2025-11-23 16:23:46', '[]', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(3, 1, 8, NULL, 'requester@habitat.mw', 'manager@habitat.mw', 12.00, 'Bank Transfer', NULL, NULL, '', '2025-10-30 11:00:17', '[]', 'oj', 'Paid via Bank Transfer - Provider: National Bank, Transaction Ref: yes', '2025-11-19 09:05:18', 'National Bank', NULL, NULL, NULL),
(4, 2, 7, NULL, 'requester@habitat.mw', 'manager@habitat.mw', 113.00, 'Bank Transfer', NULL, NULL, '', '2025-10-30 11:35:53', '[]', 'this if fine', 'Paid via Bank Transfer - Provider: Standard Bank, Transaction Ref: check', '2025-11-19 08:52:57', 'Standard Bank', NULL, NULL, NULL),
(5, 2, 8, NULL, 'requester@habitat.mw', 'talindiamao@habitat.mw', 1234.00, 'Bank Transfer', NULL, NULL, 'paid', '2025-10-30 14:42:55', '[\"1761835375_Untitled-1.png\"]', 'ok', 'Paid via Bank Transfer - Provider: Standard Bank. Transaction Ref: check', '2025-11-20 12:15:50', 'Standard Bank', NULL, NULL, NULL),
(6, 1, 8, NULL, 'requester@habitat.mw', 'manager@habitat.mw', 1234.00, NULL, NULL, NULL, 'rejected', '2025-10-31 07:31:37', '[\"1761895897_LAND1.jpg\"]', 'tcjdisk', NULL, NULL, NULL, NULL, NULL, NULL),
(7, 1, 10, NULL, 'requester@habitat.mw', 'manager@habitat.mw', 1500000.00, 'Bank Transfer', NULL, NULL, '', '2025-10-31 10:51:48', '[]', 'co', 'Paid via Bank Transfer - Provider: Standard Bank, Transaction Ref: check', '2025-11-19 08:42:00', 'Standard Bank', NULL, NULL, NULL),
(8, 2, 6, NULL, 'requester@habitat.mw', 'manager@habitat.mw', 15000.00, 'Bank Transfer', NULL, NULL, '', '2025-10-31 11:26:22', '[]', 'kkk', 'Paid via Bank Transfer - Provider: National Bank, Transaction Ref: gfgg', '2025-11-19 08:24:20', 'National Bank', NULL, NULL, NULL),
(9, 1, 10, NULL, 'requester@habitat.mw', 'manager@habitat.mw', 450000.00, 'Bank Transfer', NULL, NULL, '', '2025-11-04 06:43:26', '[\"1762238606_MEAL Specialist.docx\"]', 'yes', 'Paid via Bank Transfer - Provider: Standard Bank, Transaction Ref: check', '2025-11-19 07:57:36', 'Standard Bank', NULL, NULL, NULL),
(10, 1, 2, NULL, 'requester@habitat.mw', 'manager@habitat.mw', 2000.00, 'Bank Transfer', NULL, NULL, '', '2025-11-04 06:45:54', '[]', 'fine', 'Paid via Bank Transfer - Provider: FDH Bank, Transaction Ref: sdf', '2025-11-19 07:56:44', 'FDH Bank', NULL, NULL, NULL),
(11, 2, 13, NULL, 'requester@habitat.mw', 'lucy@habitat.mw', 1234.00, NULL, NULL, NULL, '', '2025-11-05 06:53:39', '[]', 'yes', NULL, NULL, NULL, NULL, NULL, NULL),
(12, 2, 13, NULL, 'requester@habitat.mw', 'lucy@habitat.mw', 500000.00, NULL, NULL, NULL, '', '2025-11-05 08:58:12', '[\"1762333092_g3.jpeg\"]', 'yes', NULL, NULL, NULL, NULL, NULL, NULL),
(13, 1, 10, NULL, 'tada@habitat.mw', 'lucy@habitat.mw', 3000.00, 'Bank Transfer', 'thi is where we will be able to construct', NULL, '', '2025-11-06 07:12:10', '[\"1762413130_samuel Mahuka Asset.xlsx\"]', 'yes', 'Paid via Bank Transfer - Provider: Standard Bank, Transaction Ref: check', '2025-11-19 07:45:31', 'Standard Bank', NULL, NULL, NULL),
(14, 1, 10, NULL, 'tada@habitat.mw', 'talindiamao@habitat.mw', 23.00, 'Bank Transfer', 'check', NULL, 'paid', '2025-11-06 07:19:36', '[]', 'chec', 'Paid via Bank Transfer - Provider: Standard Bank. Transaction Ref: 123', '2025-11-20 09:57:54', 'Standard Bank', NULL, NULL, NULL),
(15, 1, 10, NULL, 'tada@habitat.mw', 'talindiamao@habitat.mw', 23.00, 'Bank Transfer', 'check', NULL, 'paid', '2025-11-06 07:42:03', '[]', 'check', 'Paid via Bank Transfer - Provider: National Bank, Transaction Ref: cghh', '2025-11-19 10:55:22', 'National Bank', NULL, NULL, NULL),
(16, 2, 13, NULL, 'tada@habitat.mw', 'talindiamao@habitat.mw', 123.00, 'Mobile Money', 'check', NULL, 'paid', '2025-11-06 07:42:34', '[]', 'ok 2', 'Paid via Mobile Money - Provider: Mpamba. Transaction Ref: 2345', '2025-11-20 11:17:57', 'Mpamba', NULL, NULL, NULL),
(17, 2, 13, NULL, 'tada@habitat.mw', 'talindiamao@habitat.mw', 123.00, 'Cash', 'check', NULL, 'paid', '2025-11-06 07:49:06', '[]', 'ok', 'Paid via Cash. Transaction Ref: 2300', '2025-11-20 11:08:45', '', NULL, NULL, NULL),
(18, 2, 13, NULL, 'tada@habitat.mw', 'talindiamao@habitat.mw', 123.00, 'Mobile Money', 'check', NULL, 'paid', '2025-11-06 08:06:03', '[]', 'check', 'Paid via Mobile Money - Provider: Mpamba, Transaction Ref: ched', '2025-11-19 10:46:26', 'Mpamba', NULL, NULL, NULL),
(19, 1, 12, NULL, 'tada@habitat.mw', 'lucy@habitat.mw', 345.00, NULL, 'check', NULL, '', '2025-11-06 08:06:32', '[]', '1234', NULL, NULL, NULL, NULL, NULL, NULL),
(20, 3, 8, NULL, 'requester@habitat.mw', 'talindiamao@habitat.mw', 123.00, 'Bank Transfer', 'che', NULL, 'paid', '2025-11-06 09:09:22', '[]', 'check', 'Paid via Bank Transfer - Provider: National Bank, Transaction Ref: check paid', '2025-11-19 09:12:42', 'National Bank', NULL, NULL, NULL),
(21, 1, 10, NULL, 'requester@habitat.mw', 'lucy@habitat.mw', 23330.00, 'Cash', '12333', NULL, 'paid', '2025-11-06 09:14:05', '[\"1762420445_LAND1.jpg\",\"1762420445_request for ads.docx\"]', 'yes', 'Paid via Cash, Transaction Ref: 234', '2025-11-19 09:53:37', '', NULL, NULL, NULL),
(22, 1, 1, 1, 'requester@habitat.mw', 'lucy@habitat.mw', 2000.00, NULL, 'checkkkkk', NULL, 'rejected', '2025-11-13 13:44:39', '[]', 'no', NULL, NULL, NULL, NULL, NULL, NULL),
(23, 1, 1, 3, 'requester@habitat.mw', 'lucy@habitat.mw', 1000.00, NULL, 'checkk123', NULL, '', '2025-11-13 13:49:16', '[]', 'ok', 'Paid via Cash, Transaction Ref: 2456', '2025-11-18 13:16:38', NULL, NULL, NULL, NULL),
(24, 1, 1, 1, 'requester@habitat.mw', 'lucy@habitat.mw', 23.00, 'Bank Transfer', 'check', NULL, 'paid', '2025-11-19 09:10:17', '[]', 'yes', 'Paid via Bank Transfer - Provider: National Bank, Transaction Ref: 23', '2025-11-19 09:53:14', 'National Bank', NULL, NULL, NULL),
(25, 1, 1, 1, 'requester4@habitatt.mw', 'lucy@habitat.mw', 100.00, 'Bank Transfer', 'kudya', NULL, 'paid', '2025-11-20 13:25:00', '[]', 'can you', 'Paid via Bank Transfer - Provider: Standard Bank - Account: 100267. Ref: 1234', '2025-11-23 08:38:24', 'Standard Bank', '', '100267', NULL),
(26, 1, 1, 2, 'requester4@habitatt.mw', 'talindiamao@habitat.mw', 12.00, 'Bank Transfer', 'check', NULL, 'paid', '2025-11-20 13:32:29', '[]', 'check', 'Paid via Bank Transfer - Provider: Standard Bank - Account: 1234. Ref: 2345', '2025-11-23 14:58:00', 'Standard Bank', '', '1234', NULL),
(27, 1, 1, 1, 'requester4@habitatt.mw', 'lucy@habitat.mw', 12.00, 'Bank Transfer', 'check', NULL, 'paid', '2025-11-20 13:39:39', '[]', 'check 123', 'Paid via Bank Transfer - Provider: Standard Bank. Transaction Ref: 236', '2025-11-20 14:02:46', 'Standard Bank', NULL, NULL, NULL),
(28, 1, 1, 1, 'requester4@habitatt.mw', 'lucy@habitat.mw', 123.00, 'Bank Transfer', 'can you do that', NULL, 'paid', '2025-11-20 13:42:02', '[]', 'check 12346', 'Paid via Bank Transfer - Provider: Standard Bank. Transaction Ref: check', '2025-11-20 13:43:14', 'Standard Bank', NULL, NULL, NULL),
(29, 1, 1, 1, 'requester4@habitatt.mw', 'lucy@habitat.mw', 1234.00, 'Bank Transfer', 'check', NULL, 'paid', '2025-11-20 14:10:43', '[]', 'check', 'Paid via Bank Transfer - Provider: National Bank - Account: 1234. Ref: check', '2025-11-23 08:24:33', 'National Bank', '', '1234', NULL),
(30, 1, 1, 1, 'requester4@habitatt.mw', 'lucy@habitat.mw', 234.00, 'Mobile Money', 'check', NULL, 'paid', '2025-11-20 14:37:27', '[]', 'check', 'Paid via Mobile Money - Provider: Airtel Money - Phone: 99999. Ref: chhhhhh', '2025-11-23 08:13:59', 'Airtel Money', '99999', NULL, NULL),
(31, 1, 1, 1, 'requester4@habitatt.mw', 'lucy@habitat.mw', 200.00, 'Bank Transfer', 'check', NULL, 'paid', '2025-11-20 15:08:33', '[]', 'check 12345 ndaweluka', 'Paid via Bank Transfer - Provider: Standard Bank. Transaction Ref: ndaweluka', '2025-11-20 15:09:59', 'Standard Bank', NULL, NULL, NULL),
(32, 3, 18, 5, 'requester6@habitatt.mw', 'lucy@habitat.mw', 2000.00, 'Bank Transfer', 'GMF start', NULL, 'paid', '2025-11-21 10:35:48', '[]', 'ok tiyen tiyambe', 'Paid via Bank Transfer - Provider: Standard Bank. Transaction Ref: 23456', '2025-11-21 10:46:08', 'Standard Bank', NULL, NULL, NULL),
(33, 3, 18, 5, 'requester6@habitatt.mw', 'lucy@habitat.mw', 200.00, 'Bank Transfer', 'check', NULL, 'paid', '2025-11-21 11:36:20', '[]', 'check', 'Paid via Bank Transfer - Provider: National Bank. Ref: check', '2025-11-23 07:58:31', 'National Bank', '', NULL, NULL),
(34, 3, 18, 5, 'requester6@habitatt.mw', 'lucy@habitat.mw', 27000.00, 'Mobile Money', 'yomaliza', NULL, 'paid', '2025-11-21 11:38:38', '[]', 'ok', 'Paid via Mobile Money - Provider: Airtel Money - Phone: 99999999. Ref: chs', '2025-11-23 07:44:03', 'Airtel Money', '99999999', NULL, NULL),
(35, 3, 18, 5, 'requester6@habitatt.mw', 'lucy@habitat.mw', 200.00, NULL, 'check', NULL, '', '2025-11-23 14:15:16', '[]', 'checj', NULL, NULL, NULL, NULL, NULL, NULL),
(36, 3, 18, 5, 'requester6@habitatt.mw', 'lucy@habitat.mw', 2345.00, 'Bank Transfer', '1234', NULL, 'paid', '2025-11-23 14:59:29', '[]', 'check', 'Paid via Bank Transfer - Provider: FDH Bank - Account: 1470000154415. Ref: check', '2025-11-23 15:00:38', 'FDH Bank', '', '1470000154415', NULL),
(38, 3, 18, 5, 'requester6@habitatt.mw', 'lucy@habitat.mw', 2000.00, 'Bank Transfer', 'toilet', NULL, 'paid', '2025-11-24 06:53:57', '[]', 'ok', 'Paid via Bank Transfer - Provider: National Bank - Account: 111111. Ref: payment for at', '2025-11-24 06:57:16', 'National Bank', '', '111111', NULL),
(39, 3, 18, 5, 'requester6@habitatt.mw', 'lucy@habitat.mw', 2000.00, 'Bank Transfer', 'check', NULL, 'paid', '2025-11-26 07:16:12', '[\"1764141372_check.png\"]', 'GO HEAD', 'Paid via Bank Transfer - Provider: Standard Bank - Account: 10000. Ref: chhc', '2025-11-26 07:19:03', 'Standard Bank', '', '10000', NULL),
(40, 3, 18, 5, 'requester6@habitatt.mw', 'lucy@habitat.mw', 200.00, 'Bank Transfer', 'rent', NULL, 'paid', '2025-12-08 05:04:38', '[]', 'check', 'Paid via Bank Transfer - Provider: National Bank - Account: 100267. Ref: toilet', '2025-12-08 06:00:03', 'National Bank', '', '100267', NULL),
(41, 3, 18, 5, 'requester6@habitatt.mw', 'lucy@habitat.mw', 2000.00, 'Bank Transfer', 'IWANT', NULL, 'paid', '2025-12-08 07:08:44', '[]', 'OK', 'Paid via Bank Transfer - Provider: FDH Bank - Account: 1470000154415. Ref: TR', '2025-12-08 07:12:03', 'FDH Bank', '', '1470000154415', NULL),
(42, 3, 18, 5, 'requester6@habitatt.mw', 'lucy@habitat.mw', 20000.00, 'Bank Transfer', 'check', NULL, 'paid', '2025-12-08 11:49:05', '[]', 'ok', 'Paid via Bank Transfer - Provider: Standard Bank - Account: 100267. Ref: checl', '2025-12-08 11:51:01', 'Standard Bank', '', '100267', NULL);

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

--
-- Table structure for table `requisition`
--

CREATE TABLE `requisition` (
  `id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL,
  `manager_level` enum('1','2') DEFAULT NULL,
  `requester_email` varchar(255) NOT NULL,
  `manager_email` varchar(100) NOT NULL,
  `requisition_type` enum('Construction','Non-Construction') NOT NULL,
  `boq_id` int(11) DEFAULT NULL,
  `procurement_plan_id` int(11) DEFAULT NULL,
  `justification` text DEFAULT NULL,
  `status` enum('Draft','Submitted','Approved','Rejected') DEFAULT 'Draft',
  `supplier_category` varchar(100) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `requisition`
--

INSERT INTO `requisition` (`id`, `project_id`, `manager_level`, `requester_email`, `manager_email`, `requisition_type`, `boq_id`, `procurement_plan_id`, `justification`, `status`, `supplier_category`, `created_at`, `updated_at`) VALUES
(1, 2, '1', 'lucy@habitat.mw', '', 'Construction', 24, NULL, 'needs', 'Draft', '', '2026-01-13 12:04:49', '2026-02-17 06:10:19'),
(2, 2, '1', 'requester4@habitatt.mw', 'lucy@habitat.mw', 'Construction', 24, NULL, 'check', 'Draft', '', '2026-01-13 13:21:15', '2026-02-17 06:10:19'),
(3, 2, '1', 'requester4@habitatt.mw', '', 'Construction', 24, NULL, 'just', 'Draft', '', '2026-01-14 14:27:52', '2026-02-17 06:10:19'),
(4, 2, '1', 'lucy@habitat.mw', '', 'Construction', 24, NULL, '', 'Draft', '', '2026-01-21 15:36:45', '2026-02-17 06:10:19'),
(5, 2, '1', 'requester4@habitatt.mw', '', 'Construction', 24, NULL, 'check', 'Submitted', '', '2026-01-26 10:08:40', '2026-02-17 06:10:19'),
(6, 2, '1', 'requester4@habitatt.mw', '', 'Construction', 24, NULL, 'check', 'Submitted', '', '2026-01-26 10:08:51', '2026-02-17 06:10:19'),
(7, 2, '1', 'requester4@habitatt.mw', '', 'Construction', 24, NULL, 'check', 'Submitted', '', '2026-01-26 10:25:08', '2026-02-17 06:10:19'),
(8, 2, '1', 'requester4@habitatt.mw', '', 'Construction', 24, NULL, 'check', 'Submitted', '', '2026-01-26 10:25:57', '2026-02-17 06:10:19'),
(9, 2, '1', 'requester4@habitatt.mw', '', 'Construction', 24, NULL, 'check', 'Submitted', '', '2026-01-26 11:08:28', '2026-02-17 06:10:19'),
(10, 2, '1', 'mkapito@habitat.mw', '', 'Construction', 24, NULL, 'check', 'Submitted', '', '2026-01-26 11:33:08', '2026-02-17 06:10:19'),
(11, 2, '1', 'mkapito@habitat.mw', '', 'Construction', 24, NULL, 'check', 'Submitted', '', '2026-01-26 11:46:54', '2026-02-17 06:10:19'),
(12, 2, '1', 'mkapito@habitat.mw', '', 'Construction', 24, NULL, 'check', 'Submitted', '', '2026-01-26 11:47:25', '2026-02-17 06:10:19'),
(13, 2, '1', 'mkapito@habitat.mw', '', 'Construction', 24, NULL, 'check', 'Submitted', '', '2026-01-26 14:14:28', '2026-02-17 06:10:19'),
(14, 2, '1', 'mkapito@habitat.mw', '', 'Construction', 23, NULL, 'check', 'Submitted', '', '2026-01-26 14:15:28', '2026-02-17 06:10:19'),
(15, 2, '1', 'mkapito@habitat.mw', '', 'Construction', 23, NULL, 'check', 'Submitted', '', '2026-01-26 14:43:51', '2026-02-17 06:10:19'),
(16, 2, '1', 'lucy@habitat.mw', '', 'Construction', 24, NULL, 'check', 'Submitted', '', '2026-01-27 10:07:28', '2026-02-17 06:10:19'),
(17, 2, '1', 'requester4@habitatt.mw', '', 'Construction', 24, 0, 'check 1', 'Submitted', '', '2026-01-27 15:28:20', '2026-02-17 06:10:19'),
(18, 2, '1', 'requester4@habitatt.mw', '', 'Construction', 24, 0, 'check', 'Submitted', '', '2026-01-27 15:46:39', '2026-02-17 06:10:19'),
(19, 2, '1', 'requester4@habitatt.mw', '', 'Construction', 24, 0, 'check', '', '', '2026-01-27 15:56:24', '2026-02-17 06:10:19'),
(20, 2, '1', 'requester4@habitatt.mw', '', 'Construction', 23, 0, 'qwee', 'Submitted', '', '2026-01-27 16:03:28', '2026-02-17 06:10:19'),
(21, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', 0, 30, 'qwdt', 'Submitted', '', '2026-01-27 16:04:34', '2026-02-17 06:10:19'),
(22, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', 0, 30, 'tchili', 'Submitted', '', '2026-01-28 08:16:13', '2026-02-17 06:10:19'),
(23, 2, '1', 'requester4@habitatt.mw', '', 'Construction', 24, 0, 'very important', '', '', '2026-01-28 11:43:16', '2026-02-17 06:10:19'),
(24, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', 0, 30, 'qweds', 'Submitted', '', '2026-01-28 11:58:36', '2026-02-17 06:10:19'),
(25, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', 0, 29, 'tchili8888', 'Submitted', '', '2026-01-28 12:30:33', '2026-02-17 06:10:19'),
(26, 2, '1', 'manager@habitat.mw', '', 'Non-Construction', 0, 29, 'try', 'Submitted', '', '2026-01-28 15:15:34', '2026-02-17 06:10:19'),
(27, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', 0, 29, 'try', 'Submitted', '', '2026-01-28 15:16:11', '2026-02-14 03:10:02'),
(28, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', 0, 30, 'tchili777', 'Submitted', '', '2026-01-28 17:47:29', '2026-02-17 06:10:19'),
(29, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', 0, 30, 'tchili777', '', '', '2026-01-28 17:47:54', '2026-02-17 06:10:19'),
(30, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', 0, 30, 'taa', '', '', '2026-01-28 20:07:59', '2026-02-17 06:10:19'),
(31, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 30, 'tada', 'Submitted', '', '2026-01-29 07:53:26', '2026-02-17 06:10:19'),
(32, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 30, 'tada', 'Submitted', '', '2026-01-29 07:53:46', '2026-02-17 06:10:19'),
(33, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 30, 'tada', 'Submitted', '', '2026-01-29 07:54:08', '2026-02-17 06:10:19'),
(34, 2, '1', 'requester4@habitatt.mw', '', 'Construction', 23, NULL, 'tada', '', '', '2026-01-29 07:54:27', '2026-02-17 06:10:19'),
(35, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 30, 'tada', 'Submitted', '', '2026-01-29 07:54:52', '2026-02-17 06:10:19'),
(36, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 30, 'tada', '', '', '2026-01-29 08:08:58', '2026-02-17 06:10:19'),
(37, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 30, 'cvj', '', '', '2026-01-29 14:22:45', '2026-02-17 06:10:19'),
(38, 2, '1', 'requester4@habitatt.mw', '', 'Construction', 24, NULL, 'masa', '', '', '2026-01-29 16:48:37', '2026-02-17 06:10:19'),
(39, 2, '1', 'manager@habitatmw.org', '', 'Non-Construction', NULL, 30, 'computer', '', '', '2026-01-29 16:51:01', '2026-02-17 06:10:19'),
(40, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 29, 'jus', '', '', '2026-01-29 16:51:55', '2026-02-17 06:10:19'),
(43, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 29, 'anything', 'Draft', '', '2026-02-12 21:10:09', '2026-02-17 06:10:19'),
(59, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 30, 'for mwaka to code', '', '', '2026-02-12 22:18:22', '2026-02-17 06:10:19'),
(60, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 30, 'for coding', 'Submitted', '', '2026-02-13 11:06:45', '2026-02-14 03:10:02'),
(61, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 29, 'Fire ex', 'Submitted', '', '2026-02-13 19:34:34', '2026-02-14 03:44:40'),
(62, 2, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 30, 'testing 1', 'Submitted', '', '2026-02-16 12:24:58', '2026-02-20 07:57:29'),
(63, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, '12345', '', '', '2026-02-16 22:05:39', '2026-02-20 07:57:29'),
(64, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'qwerty', '', '', '2026-02-16 22:50:36', '2026-02-20 07:57:29'),
(65, 1, '1', 'manager@habitatmw.org', '', 'Non-Construction', NULL, 28, 'testing items save', 'Submitted', '', '2026-02-17 11:07:16', '2026-02-20 20:10:33'),
(66, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 1', 'Submitted', '', '2026-02-17 11:08:18', '2026-02-20 20:10:33'),
(67, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:09:07', '2026-02-20 20:10:33'),
(68, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:13:29', '2026-02-20 20:10:33'),
(69, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:14:50', '2026-02-20 20:10:33'),
(70, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:19:01', '2026-02-20 20:10:33'),
(71, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:19:10', '2026-02-20 20:10:33'),
(72, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:19:10', '2026-02-20 20:10:33'),
(73, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:19:58', '2026-02-20 20:10:33'),
(74, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:20:32', '2026-02-20 20:10:33'),
(75, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:21:01', '2026-02-20 20:10:33'),
(76, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:21:27', '2026-02-20 20:10:33'),
(77, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:27:18', '2026-02-20 20:10:33'),
(78, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:28:00', '2026-02-20 20:10:33'),
(79, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:33:29', '2026-02-20 20:10:33'),
(80, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:41:29', '2026-02-20 20:10:33'),
(81, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:42:21', '2026-02-20 20:10:33'),
(82, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:42:38', '2026-02-20 20:10:33'),
(83, 1, '1', 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 28, 'testing 2', 'Submitted', '', '2026-02-17 11:45:04', '2026-02-20 20:10:33'),
(89, 2, NULL, 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 30, 'for gaming', '', 'electronics', '2026-02-22 15:56:23', '2026-02-22 23:56:23'),
(88, 2, NULL, 'requester4@habitatt.mw', '', 'Non-Construction', NULL, 30, 'for coding', '', 'electronics', '2026-02-22 15:56:07', '2026-02-22 23:56:07');

--
-- Triggers `requisition`
--
DELIMITER $$
CREATE TRIGGER `requisition_validate_before_insert` BEFORE INSERT ON `requisition` FOR EACH ROW BEGIN
    IF NEW.requisition_type = 'Construction' 
       AND NEW.boq_id IS NULL THEN
        SIGNAL SQLSTATE '45000'
        SET MESSAGE_TEXT = 'Construction requisition must have BOQ';
    END IF;

    IF NEW.requisition_type = 'Non-Construction' 
       AND NEW.procurement_plan_id IS NULL THEN
        SIGNAL SQLSTATE '45000'
        SET MESSAGE_TEXT = 'Non-construction requisition must have Procurement Plan';
    END IF;
END
$$
DELIMITER ;

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

--
-- Table structure for table `requisition_comments`
--

CREATE TABLE `requisition_comments` (
  `id` int(11) NOT NULL,
  `requisition_id` int(11) NOT NULL,
  `commented_by` varchar(100) NOT NULL,
  `role` varchar(50) NOT NULL,
  `comment` text NOT NULL,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `requisition_comments`
--

INSERT INTO `requisition_comments` (`id`, `requisition_id`, `commented_by`, `role`, `comment`, `created_at`) VALUES
(1, 23, 'manager@habitatmw.org', 'Manager', 'check', '2026-01-28 11:59:37'),
(2, 36, 'manager@habitatmw.org', 'Manager', 'goo', '2026-01-29 14:28:16'),
(3, 37, 'manager@habitatmw.org', 'Manager', 'nice', '2026-01-29 14:28:26'),
(4, 34, 'manager@habitatmw.org', 'Manager', 'tchu', '2026-01-29 14:44:16'),
(5, 30, 'manager@habitatmw.org', 'Manager', 'tch', '2026-01-29 14:44:22'),
(6, 38, 'manager@habitatmw.org', 'Manager', 'ok', '2026-01-29 16:50:05'),
(7, 40, 'manager@habitat.mw', 'Manager', 'tcj', '2026-01-29 16:55:48'),
(8, 40, 'manager@habitat.mw', 'Manager', 'tcj', '2026-01-29 16:55:52'),
(9, 39, 'manager@habitatmw.org', 'Manager', 'aprov', '2026-01-29 16:56:21'),
(10, 39, 'manager@habitatmw.org', 'Manager', 'aprov', '2026-01-29 16:56:26'),
(11, 19, 'manager@habitatmw.org', 'Manager', 'ok ok', '2026-01-30 07:41:17'),
(12, 29, 'lucy@habitat.mw', 'Manager', 'alright', '2026-02-12 20:57:03'),
(13, 59, 'talindiamao@habitat.mw', 'Manager', 'anything for mwaka is acceptable', '2026-02-12 22:22:19'),
(14, 60, 'manager1@habitatmw.org', 'Manager', 'Redirecting to manager level 1', '2026-02-13 16:47:13'),
(15, 27, 'manager@habitatmw.org', 'Manager', 'no reason', '2026-02-13 17:41:37'),
(16, 27, 'manager@habitatmw.org', 'Manager', 'no reason', '2026-02-13 17:43:22'),
(17, 63, 'manager1@habitatmw.org', 'Manager', 'ok', '2026-02-16 22:17:26'),
(18, 64, 'manager1@habitatmw.org', 'Manager', 'bye', '2026-02-16 23:16:04'),
(19, 84, 'manager1@habitatmw.org', 'Manager', 'within budget', '2026-02-19 23:58:04'),
(20, 85, 'manager1@habitatmw.org', 'Manager', 'alright', '2026-02-20 09:07:08'),
(21, 86, 'manager1@habitatmw.org', 'Manager', 'approve', '2026-02-20 12:11:07'),
(22, 87, 'manager1@habitatmw.org', 'Manager', 'just to test approve', '2026-02-22 15:14:42'),
(23, 89, 'manager1@habitatmw.org', 'Manager', 'ok', '2026-02-22 15:56:43'),
(24, 88, 'manager1@habitatmw.org', 'Manager', 'alright', '2026-02-22 15:56:53');

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

--
-- Table structure for table `requisition_items`
--

CREATE TABLE `requisition_items` (
  `id` int(11) NOT NULL,
  `requisition_id` int(11) NOT NULL,
  `source_item_id` int(11) NOT NULL,
  `requested_qty` decimal(15,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `requisition_items`
--

INSERT INTO `requisition_items` (`id`, `requisition_id`, `source_item_id`, `requested_qty`, `created_at`) VALUES
(1, 8, 36, 12.00, '2026-01-26 08:25:57'),
(2, 8, 35, 12.00, '2026-01-26 08:25:57'),
(3, 8, 34, 12.00, '2026-01-26 08:25:57'),
(4, 13, 36, 12.00, '2026-01-26 12:14:28'),
(5, 13, 35, 12.00, '2026-01-26 12:14:28'),
(6, 13, 34, 12.00, '2026-01-26 12:14:28'),
(7, 14, 33, 1.00, '2026-01-26 12:15:28'),
(8, 15, 33, 1.00, '2026-01-26 12:43:51'),
(9, 16, 36, 12.00, '2026-01-27 08:07:28'),
(10, 16, 35, 12.00, '2026-01-27 08:07:28'),
(11, 16, 34, 12.00, '2026-01-27 08:07:28'),
(12, 17, 36, 12.00, '2026-01-27 13:28:20'),
(13, 17, 35, 12.00, '2026-01-27 13:28:20'),
(14, 17, 34, 13.00, '2026-01-27 13:28:20'),
(15, 18, 36, 12.00, '2026-01-27 13:46:39'),
(16, 19, 36, 12.00, '2026-01-27 13:56:24'),
(17, 20, 33, 1.00, '2026-01-27 14:03:28'),
(18, 21, 0, 1.00, '2026-01-27 14:04:34'),
(19, 22, 0, 2.00, '2026-01-28 06:16:13'),
(20, 1, 3, 2.00, '2026-01-28 09:27:56'),
(21, 23, 36, 12.00, '2026-01-28 09:43:16'),
(22, 23, 35, 11.00, '2026-01-28 09:43:16'),
(23, 23, 34, 2.00, '2026-01-28 09:43:16'),
(24, 24, 0, 1.00, '2026-01-28 09:58:36'),
(25, 25, 0, 1.00, '2026-01-28 10:30:33'),
(26, 26, 0, 1.00, '2026-01-28 13:15:34'),
(27, 27, 0, 1.00, '2026-01-28 13:16:11'),
(28, 29, 0, 1.00, '2026-01-28 15:47:54'),
(29, 30, 0, 1.00, '2026-01-28 18:07:59'),
(30, 34, 33, 1.00, '2026-01-29 05:54:27'),
(31, 38, 36, 12.00, '2026-01-29 14:48:37'),
(32, 80, 28, 4.00, '2026-02-17 19:41:29'),
(33, 81, 28, 4.00, '2026-02-17 19:42:21'),
(34, 82, 28, 4.00, '2026-02-17 19:42:38'),
(35, 83, 28, 4.00, '2026-02-17 19:45:04'),
(36, 84, 30, 2.00, '2026-02-20 07:56:13'),
(37, 85, 30, 1.00, '2026-02-20 17:06:32'),
(38, 86, 30, 1.00, '2026-02-20 20:10:10'),
(39, 87, 30, 2.00, '2026-02-22 23:14:16'),
(40, 88, 30, 1.00, '2026-02-22 23:56:07'),
(41, 89, 30, 2.00, '2026-02-22 23:56:23');

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

--
-- Table structure for table `requisition_suppliers`
--

CREATE TABLE `requisition_suppliers` (
  `id` int(11) NOT NULL,
  `requisition_id` int(11) NOT NULL,
  `supplier_id` int(11) NOT NULL,
  `category_id` int(11) NOT NULL,
  `token` varchar(60) DEFAULT NULL,
  `procurement_status` varchar(60) DEFAULT NULL,
  `supplier_status` varchar(60) DEFAULT NULL,
  `sent_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `requisition_suppliers`
--

INSERT INTO `requisition_suppliers` (`id`, `requisition_id`, `supplier_id`, `category_id`, `token`, `procurement_status`, `supplier_status`, `sent_at`) VALUES
(35, 88, 47, 2, 'fd68f19102dd942c092c46a90aff6c52', NULL, NULL, '2026-02-22 16:00:11'),
(36, 88, 48, 2, 'ece3b54e66b28708518405bdc149a1e8', NULL, 'Sent', '2026-02-22 16:00:17');

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

--
-- Table structure for table `schema_migrations`
--

CREATE TABLE `schema_migrations` (
  `id` int(11) NOT NULL,
  `file` varchar(255) NOT NULL,
  `applied_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `sub_activities`
--

CREATE TABLE `sub_activities` (
  `id` int(11) NOT NULL,
  `activity_id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `budget` decimal(15,2) NOT NULL DEFAULT 0.00
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `sub_activities`
--

INSERT INTO `sub_activities` (`id`, `activity_id`, `name`, `budget`) VALUES
(1, 1, 'God', 2000.00),
(2, 1, 'God', 2000.00),
(3, 1, 'God', 2000.00),
(4, 17, 'GOD', 3000.00),
(5, 18, 'Trial1', 30000.00);

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

--
-- Table structure for table `supplier_categories`
--

CREATE TABLE `supplier_categories` (
  `user_id` int(11) NOT NULL,
  `category_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `supplier_categories`
--

INSERT INTO `supplier_categories` (`user_id`, `category_id`) VALUES
(47, 2),
(47, 3),
(48, 2),
(48, 4);

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

--
-- Table structure for table `supplier_scores`
--

CREATE TABLE `supplier_scores` (
  `id` int(11) NOT NULL,
  `quotation_id` int(11) NOT NULL,
  `price` int(11) DEFAULT 0,
  `delivery` int(11) DEFAULT 0,
  `warranty` int(11) DEFAULT 0,
  `compliance` int(11) DEFAULT 0,
  `total_score` int(11) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

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

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  `email` varchar(100) NOT NULL,
  `password` varchar(255) NOT NULL,
  `role` enum('admin','procurement','manager','requester','accountant','accountant_manager','supplier') NOT NULL,
  `supplier_category` enum('stationery','electronics') DEFAULT NULL,
  `manager_level` enum('1','2') DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `project_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `users` (`id`, `name`, `email`, `password`, `role`, `supplier_category`, `manager_level`, `created_at`, `project_id`) VALUES
(1, NULL, 'admin@habitat.mw', '$2y$10$N.2v2ZddYFbyxR49z5C5Re1Tjh9k06s9H3oVQeB2DaH1IYzZnxyOq', 'admin', NULL, NULL, '2025-10-29 07:41:30', NULL),
(2, NULL, 'admin@habitatt.mw', '$2y$10$RWiLj9vLN8/8xrNkImfSWeR5od4Tu7Oh39zpbZhWmcevDpRJEsrVO', 'admin', '', NULL, '2025-10-29 07:55:33', NULL),
(5, NULL, 'manager@habitat.mw', '$2y$10$qo4qCXhLWrPL.adggCV61eVb36hr6GWJJ2aZfm96KiUb8.TOzIACy', 'manager', '', NULL, '2025-10-29 12:32:54', NULL),
(6, '', 'admin@habitatmw.org', '$2y$10$VxkMyaOanB5xOX9IHl3S6uwF1ffhVFYczHXmOiFDFn0V/0.5edL6C', 'admin', '', NULL, '2025-10-30 09:11:40', NULL),
(8, NULL, 'requester@habitatmw.org', '$2y$10$VxkMyaOanB5xOX9IHl3S6uwF1ffhVFYczHXmOiFDFn0V/0.5edL6C', 'requester', '', NULL, '2025-10-30 09:11:40', NULL),
(9, 'Manager 1', 'manager@habitatmw.org', '$2y$10$8ah0fpQuYS4BhzFBXreNAe1s82Q16kS0DScPXA8TADeRV69M7gZZu', 'manager', '', '1', '2025-10-30 09:17:20', NULL),
(10, NULL, 'requester@habitat.mw', '$2y$10$D.rV2BhHTRLOLRbj7fcU/egzGQnssgwMcwC9gn5iTcA8lfq.tAhCu', 'requester', '', NULL, '2025-10-30 09:39:17', NULL),
(11, NULL, 'talindiamao@habitat.mw', '$2y$10$v0hs42JXS6bs2PbygYkHi.MSY4yeSW54T/Tas.6QLtwqiKLQy2BQC', 'manager', '', NULL, '2025-10-30 14:24:07', NULL),
(12, 'Tada', 'tada@habitat.mw', '$2y$10$Vl1D.IfWx5Uii/svRCJZn.Wrq2i1QqS1SkLfWtUSC9D7Kia4AyPUa', 'requester', '', NULL, '2025-11-04 13:37:09', 1),
(13, NULL, 'lucy@habitat.mw', '$2y$10$S5qOtGEbSAwDpp94sTjZj.gYalNYQFeDy/cbEJ12ehpCy7.dYmq22', 'manager', '', NULL, '2025-11-05 06:52:20', 1),
(20, NULL, 'flo@habitat.mw', '$2y$10$1HOKyXTBH1KU.19TW8BLNe/efPIfggyCfn6J89rkN4iFKOt34.l/G', '', '', NULL, '2025-11-18 10:31:02', 1),
(21, NULL, 'sella@habitat.mw', '$2y$10$OQV6PEhS1CtsYZrdMuaMhuvHmG/yZSEVnLlwHeX82pxpBUfkaiCba', 'accountant', '', NULL, '2025-11-18 10:40:13', 1),
(22, NULL, 'requester2@habitatt.mw', '$2y$10$ACkbGf/UAoXsB/52WgiTqOMIIzqxF3F8lJnsBUasnFYZlp5jvLjPW', 'requester', '', NULL, '2025-11-20 09:44:21', 2),
(23, NULL, 'requester3@habitatt.mw', '$2y$10$zbR0KID/ibLTATEJf4ga7eie1J/M2H6SfhENyfaDQjnz8qUFnOz1O', 'requester', '', NULL, '2025-11-20 13:01:31', 1),
(24, NULL, 'requester4@habitatt.mw', '$2y$10$K2zG.ROYnWhmfqqa1.Ifg.XKGoERAzHssbvR2jGafNSEtF/Tw88km', 'requester', '', NULL, '2025-11-20 13:23:32', NULL),
(25, NULL, 'requester6@habitatt.mw', '$2y$10$B0RKVIfENqFnOt3CgC3srOmp4qI0O3bnGS2tCarc1owCwkh.vNFaS', 'requester', '', NULL, '2025-11-21 10:34:35', NULL),
(26, NULL, 'fmanager@habitat.com', '827ccb0eea8a706c4c34a16891f84e7b', 'accountant_manager', '', NULL, '2025-11-23 09:23:31', NULL),
(27, 'Dumisani Mwalija', 'fmanager@habitatt.mw', '$2y$10$YnoX0YAJ5F7FAZr/6ve5x.7GsF0V.Fm1P.xAlap0DNkEdDNuxHDS6', 'accountant_manager', '', NULL, '2025-11-23 10:00:56', NULL),
(29, 'Mercy', 'mkapito@habitat.mw', '$2y$10$eqdcBts/iLYK55MDybmHq.mvSsKb7ExBi4PqJ2DF4ilW7Lgz03b/e', 'procurement', '', NULL, '2025-12-09 07:58:08', NULL),
(30, 'Dumisani Mwalija', 'manager1@habitatmw.org', '$2y$10$Q2vGJlj8eKkn5VViJU2OmOt.Q5wplAa4Ix5FfOVizjOdH6Mn6gLuy', 'manager', '', '2', '2026-01-27 14:42:26', NULL),
(47, 'Evance', 'eva@gmail.com', '$2y$10$j3H7rDpwFC06WmS4l1TKS.5HaEDcsji0EGqio7u.7eqNjuqAV3Zja', 'supplier', NULL, NULL, '2026-02-19 17:22:32', NULL),
(48, 'Mwakanemela', 'mwaka@gmail.com', '$2y$10$PHC5ayd1QUddThYje8YcbeYKXxevuybfrooybQ1ZxWzAezZDVRVL6', 'supplier', NULL, NULL, '2026-02-20 16:00:44', NULL);

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

--
-- Table structure for table `workflow_assignments`
--

CREATE TABLE `workflow_assignments` (
  `id` int(11) NOT NULL,
  `requisition_id` int(11) NOT NULL,
  `assigned_to` varchar(150) NOT NULL,
  `assigned_role` varchar(50) NOT NULL,
  `assigned_at` datetime DEFAULT current_timestamp(),
  `due_at` datetime NOT NULL,
  `is_active` tinyint(1) DEFAULT 1
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `workflow_assignments`
--

INSERT INTO `workflow_assignments` (`id`, `requisition_id`, `assigned_to`, `assigned_role`, `assigned_at`, `due_at`, `is_active`) VALUES
(1, 15, 'manager1@habitatmw.org', 'Manager', '2026-01-26 14:43:51', '2026-01-29 14:43:51', 1),
(2, 16, 'manager1@habitatmw.org', 'Manager', '2026-01-27 10:07:28', '2026-01-30 10:07:28', 1),
(3, 17, 'manager1@habitatmw.org', 'Manager', '2026-01-27 15:28:20', '2026-01-30 15:28:20', 1),
(4, 18, 'manager1@habitatmw.org', 'Manager', '2026-01-27 15:46:39', '2026-01-30 15:46:39', 1),
(5, 19, 'manager1@habitatmw.org', 'Manager', '2026-01-27 15:56:24', '2026-01-30 15:56:24', 0),
(6, 20, 'manager1@habitatmw.org', 'Manager', '2026-01-27 16:03:28', '2026-01-30 16:03:28', 1),
(7, 21, 'manager1@habitatmw.org', 'Manager', '2026-01-27 16:04:34', '2026-01-30 16:04:34', 1),
(8, 22, 'manager@habitat.mw', 'Manager', '2026-01-28 08:16:13', '2026-01-31 08:16:13', 1),
(9, 23, 'manager@habitat.mw', 'Manager', '2026-01-28 11:43:16', '2026-01-31 11:43:16', 0),
(10, 24, 'manager@habitat.mw', 'Manager', '2026-01-28 11:58:36', '2026-01-31 11:58:36', 1),
(11, 23, '', 'Procurement', '2026-01-28 11:59:37', '2026-02-02 11:59:37', 0),
(12, 25, 'manager@habitat.mw', 'Manager', '2026-01-28 12:30:33', '2026-01-31 12:30:33', 1),
(13, 26, 'manager@habitat.mw', 'Manager', '2026-01-28 15:15:34', '2026-01-31 15:15:34', 1),
(14, 27, 'manager@habitat.mw', 'Manager', '2026-01-28 15:16:11', '2026-01-31 15:16:11', 1),
(15, 29, 'manager@habitat.mw', 'Manager', '2026-01-28 17:47:54', '2026-01-31 17:47:54', 0),
(16, 30, 'manager@habitat.mw', 'Manager', '2026-01-28 20:07:59', '2026-01-31 20:07:59', 0),
(17, 34, 'manager@habitat.mw', 'Manager', '2026-01-29 07:54:27', '2026-02-01 07:54:27', 0),
(18, 36, 'manager@habitat.mw', 'Manager', '2026-01-29 08:08:59', '2026-02-01 08:08:59', 0),
(19, 37, 'manager@habitat.mw', 'Manager', '2026-01-29 14:22:45', '2026-02-01 14:22:45', 0),
(20, 36, '', 'Procurement', '2026-01-29 14:28:16', '2026-02-03 14:28:16', 1),
(21, 37, '', 'Procurement', '2026-01-29 14:28:26', '2026-02-03 14:28:26', 1),
(22, 34, '', 'Procurement', '2026-01-29 14:44:16', '2026-02-03 14:44:16', 1),
(23, 30, '', 'Procurement', '2026-01-29 14:44:22', '2026-02-03 14:44:22', 1),
(24, 38, 'manager@habitat.mw', 'Manager', '2026-01-29 16:48:37', '2026-02-01 16:48:37', 0),
(25, 38, '', 'Procurement', '2026-01-29 16:50:05', '2026-02-03 16:50:05', 1),
(26, 39, 'manager@habitat.mw', 'Manager', '2026-01-29 16:51:01', '2026-02-01 16:51:01', 0),
(27, 40, 'manager@habitat.mw', 'Manager', '2026-01-29 16:51:55', '2026-02-01 16:51:55', 0),
(28, 40, '', 'Procurement', '2026-01-29 16:55:48', '2026-02-03 16:55:48', 1),
(29, 40, '', 'Procurement', '2026-01-29 16:55:52', '2026-02-03 16:55:52', 1),
(30, 39, '', 'Procurement', '2026-01-29 16:56:21', '2026-02-03 16:56:21', 1),
(31, 39, '', 'Procurement', '2026-01-29 16:56:26', '2026-02-03 16:56:26', 1),
(32, 19, '', 'Procurement', '2026-01-30 07:41:17', '2026-02-04 07:41:17', 1),
(33, 29, '', 'Procurement', '2026-02-12 20:57:03', '2026-02-17 20:57:03', 1),
(34, 45, 'manager@habitat.mw', 'Manager', '2026-02-12 21:24:18', '2026-02-15 21:24:18', 1),
(35, 46, 'manager@habitat.mw', 'Manager', '2026-02-12 21:31:39', '2026-02-15 21:31:39', 1),
(36, 47, 'manager@habitat.mw', 'Manager', '2026-02-12 21:33:09', '2026-02-15 21:33:09', 1),
(37, 48, 'manager@habitat.mw', 'Manager', '2026-02-12 21:50:50', '2026-02-15 21:50:50', 1),
(38, 49, 'manager@habitat.mw', 'Manager', '2026-02-12 21:52:42', '2026-02-15 21:52:42', 1),
(39, 50, 'manager@habitat.mw', 'Manager', '2026-02-12 21:53:12', '2026-02-15 21:53:12', 1),
(40, 51, 'manager@habitat.mw', 'Manager', '2026-02-12 21:54:24', '2026-02-15 21:54:24', 1),
(41, 52, 'manager@habitat.mw', 'Manager', '2026-02-12 21:55:22', '2026-02-15 21:55:22', 1),
(42, 53, 'manager@habitat.mw', 'Manager', '2026-02-12 21:55:47', '2026-02-15 21:55:47', 1),
(43, 54, 'manager@habitat.mw', 'Manager', '2026-02-12 21:57:17', '2026-02-15 21:57:17', 1),
(44, 55, 'manager@habitat.mw', 'Manager', '2026-02-12 22:00:25', '2026-02-15 22:00:25', 1),
(45, 56, 'manager@habitat.mw', 'Manager', '2026-02-12 22:02:50', '2026-02-15 22:02:50', 1),
(46, 58, 'manager@habitat.mw', 'Manager', '2026-02-12 22:13:15', '2026-02-15 22:13:15', 1),
(47, 59, 'manager@habitat.mw', 'Manager', '2026-02-12 22:18:22', '2026-02-15 22:18:22', 0),
(48, 59, '', 'Procurement', '2026-02-12 22:22:19', '2026-02-17 22:22:19', 1),
(49, 60, 'manager@habitat.mw', 'Manager', '2026-02-13 11:06:45', '2026-02-16 11:06:45', 1),
(50, 61, 'manager@habitat.mw', 'Manager', '2026-02-13 19:34:34', '2026-02-16 19:34:34', 1),
(51, 62, 'manager@habitat.mw', 'Manager', '2026-02-16 12:24:58', '2026-02-19 12:24:58', 1),
(52, 63, 'manager@habitat.mw', 'Manager', '2026-02-16 22:05:39', '2026-02-19 22:05:39', 0),
(53, 63, '', 'Procurement', '2026-02-16 22:17:26', '2026-02-21 22:17:26', 1),
(54, 64, 'manager@habitat.mw', 'Manager', '2026-02-16 22:50:36', '2026-02-19 22:50:36', 0),
(55, 64, '', 'Procurement', '2026-02-16 23:16:04', '2026-02-21 23:16:04', 1),
(56, 65, 'manager@habitat.mw', 'Manager', '2026-02-17 11:07:16', '2026-02-20 11:07:16', 1),
(57, 66, 'manager@habitat.mw', 'Manager', '2026-02-17 11:08:18', '2026-02-20 11:08:18', 1),
(58, 67, 'manager@habitat.mw', 'Manager', '2026-02-17 11:09:07', '2026-02-20 11:09:07', 1),
(59, 68, 'manager@habitat.mw', 'Manager', '2026-02-17 11:13:29', '2026-02-20 11:13:29', 1),
(60, 69, 'manager@habitat.mw', 'Manager', '2026-02-17 11:14:50', '2026-02-20 11:14:50', 1),
(61, 70, 'manager@habitat.mw', 'Manager', '2026-02-17 11:19:01', '2026-02-20 11:19:01', 1),
(62, 71, 'manager@habitat.mw', 'Manager', '2026-02-17 11:19:10', '2026-02-20 11:19:10', 1),
(63, 72, 'manager@habitat.mw', 'Manager', '2026-02-17 11:19:10', '2026-02-20 11:19:10', 1),
(64, 73, 'manager@habitat.mw', 'Manager', '2026-02-17 11:19:58', '2026-02-20 11:19:58', 1),
(65, 74, 'manager@habitat.mw', 'Manager', '2026-02-17 11:20:32', '2026-02-20 11:20:32', 1),
(66, 75, 'manager@habitat.mw', 'Manager', '2026-02-17 11:21:01', '2026-02-20 11:21:01', 1),
(67, 76, 'manager@habitat.mw', 'Manager', '2026-02-17 11:21:27', '2026-02-20 11:21:27', 1),
(68, 77, 'manager@habitat.mw', 'Manager', '2026-02-17 11:27:18', '2026-02-20 11:27:18', 1),
(69, 78, 'manager@habitat.mw', 'Manager', '2026-02-17 11:28:00', '2026-02-20 11:28:00', 1),
(70, 79, 'manager@habitat.mw', 'Manager', '2026-02-17 11:33:29', '2026-02-20 11:33:29', 1),
(71, 80, 'manager@habitat.mw', 'Manager', '2026-02-17 11:41:29', '2026-02-20 11:41:29', 1),
(72, 81, 'manager@habitat.mw', 'Manager', '2026-02-17 11:42:21', '2026-02-20 11:42:21', 1),
(73, 82, 'manager@habitat.mw', 'Manager', '2026-02-17 11:42:38', '2026-02-20 11:42:38', 1),
(74, 83, 'manager@habitat.mw', 'Manager', '2026-02-17 11:45:04', '2026-02-20 11:45:04', 1),
(75, 84, 'manager@habitat.mw', 'Manager', '2026-02-19 23:56:13', '2026-02-22 23:56:13', 0),
(76, 84, '', 'Procurement', '2026-02-19 23:58:04', '2026-02-24 23:58:04', 1),
(77, 85, 'manager@habitat.mw', 'Manager', '2026-02-20 09:06:32', '2026-02-23 09:06:32', 0),
(78, 85, '', 'Procurement', '2026-02-20 09:07:08', '2026-02-25 09:07:08', 1),
(79, 86, 'manager@habitat.mw', 'Manager', '2026-02-20 12:10:10', '2026-02-23 12:10:10', 0),
(80, 86, '', 'Procurement', '2026-02-20 12:11:07', '2026-02-25 12:11:07', 1),
(81, 87, 'manager@habitat.mw', 'Manager', '2026-02-22 15:14:16', '2026-02-25 15:14:16', 0),
(82, 87, '', 'Procurement', '2026-02-22 15:14:42', '2026-02-27 15:14:42', 1),
(83, 88, 'manager@habitat.mw', 'Manager', '2026-02-22 15:56:07', '2026-02-25 15:56:07', 0),
(84, 89, 'manager@habitat.mw', 'Manager', '2026-02-22 15:56:23', '2026-02-25 15:56:23', 0),
(85, 89, '', 'Procurement', '2026-02-22 15:56:43', '2026-02-27 15:56:43', 1),
(86, 88, '', 'Procurement', '2026-02-22 15:56:53', '2026-02-27 15:56:53', 1);

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

--
-- Table structure for table `workflow_escalations`
--

CREATE TABLE `workflow_escalations` (
  `id` int(11) NOT NULL,
  `requisition_id` int(11) NOT NULL,
  `from_email` varchar(150) NOT NULL,
  `to_email` varchar(150) NOT NULL,
  `reason` varchar(255) DEFAULT NULL,
  `escalated_at` datetime DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `workflow_logs`
--

CREATE TABLE `workflow_logs` (
  `id` int(11) NOT NULL,
  `requisition_id` int(11) NOT NULL,
  `action` varchar(50) DEFAULT NULL,
  `from_user` varchar(100) DEFAULT NULL,
  `to_user` varchar(100) DEFAULT NULL,
  `remarks` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `workflow_steps`
--

CREATE TABLE `workflow_steps` (
  `id` int(11) NOT NULL,
  `requisition_id` int(11) NOT NULL,
  `step_name` varchar(100) NOT NULL,
  `action` enum('submitted','approved','rejected','forwarded','escalated','uploaded') NOT NULL,
  `actor_email` varchar(150) NOT NULL,
  `actor_role` varchar(50) NOT NULL,
  `comments` text DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `activities`
--
ALTER TABLE `activities`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_id` (`project_id`);

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

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

--
-- Indexes for table `boq_items`
--
ALTER TABLE `boq_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_boq_items_level` (`level_id`);

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

--
-- Indexes for table `boq_sub_items`
--
ALTER TABLE `boq_sub_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `boq_item_id` (`boq_item_id`);

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`);

--
-- Indexes for table `documents`
--
ALTER TABLE `documents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `requisition_id` (`requisition_id`);

--
-- Indexes for table `fund_requests`
--
ALTER TABLE `fund_requests`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_id` (`project_id`),
  ADD KEY `activity_id` (`activity_id`);

--
-- Indexes for table `invoices`
--
ALTER TABLE `invoices`
  ADD PRIMARY KEY (`id`),
  ADD KEY `requisition_id` (`requisition_id`);

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

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

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

--
-- Indexes for table `procurement_plan`
--
ALTER TABLE `procurement_plan`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_id` (`project_id`),
  ADD KEY `idx_dbl_number` (`dbl_number`(250));

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

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

--
-- Indexes for table `project_assignments`
--
ALTER TABLE `project_assignments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_id` (`project_id`);

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

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

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

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

--
-- Indexes for table `requisition_comments`
--
ALTER TABLE `requisition_comments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `requisition_id` (`requisition_id`);

--
-- Indexes for table `requisition_items`
--
ALTER TABLE `requisition_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `requisition_id` (`requisition_id`);

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

--
-- Indexes for table `schema_migrations`
--
ALTER TABLE `schema_migrations`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `file` (`file`);

--
-- Indexes for table `sub_activities`
--
ALTER TABLE `sub_activities`
  ADD PRIMARY KEY (`id`),
  ADD KEY `activity_id` (`activity_id`);

--
-- Indexes for table `supplier_categories`
--
ALTER TABLE `supplier_categories`
  ADD PRIMARY KEY (`user_id`,`category_id`);

--
-- Indexes for table `supplier_scores`
--
ALTER TABLE `supplier_scores`
  ADD PRIMARY KEY (`id`),
  ADD KEY `quotation_id` (`quotation_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`);

--
-- Indexes for table `workflow_assignments`
--
ALTER TABLE `workflow_assignments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `requisition_id` (`requisition_id`);

--
-- Indexes for table `workflow_escalations`
--
ALTER TABLE `workflow_escalations`
  ADD PRIMARY KEY (`id`),
  ADD KEY `requisition_id` (`requisition_id`);

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

--
-- Indexes for table `workflow_steps`
--
ALTER TABLE `workflow_steps`
  ADD PRIMARY KEY (`id`),
  ADD KEY `requisition_id` (`requisition_id`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT for table `invoices`
--
ALTER TABLE `invoices`
  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=3;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT for table `workflow_steps`
--
ALTER TABLE `workflow_steps`
  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 */;
