-- MySQL dump 10.13  Distrib 8.0.37, for Linux (x86_64)
--
-- Host: localhost    Database: ziamart_db
-- ------------------------------------------------------
-- Server version	8.0.37-0ubuntu0.20.04.3

/*!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 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `cus_record`
--

DROP TABLE IF EXISTS `cus_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cus_record` (
  `id` int NOT NULL AUTO_INCREMENT,
  `sale_id` int NOT NULL,
  `date` date NOT NULL,
  `cus_number` varchar(50) DEFAULT NULL,
  `amt` bigint NOT NULL,
  `payment_method` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `sale_id` (`sale_id`)
) ENGINE=InnoDB AUTO_INCREMENT=33031 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customers`
--

DROP TABLE IF EXISTS `customers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `customers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `cus_name` varchar(50) NOT NULL,
  `cus_number` varchar(50) NOT NULL,
  `cus_add` varchar(50) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`),
  KEY `cus_name` (`cus_name`)
) ENGINE=InnoDB AUTO_INCREMENT=716 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `delivery_challan`
--

DROP TABLE IF EXISTS `delivery_challan`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `delivery_challan` (
  `del_id` int NOT NULL AUTO_INCREMENT,
  `sale_date` date NOT NULL,
  `customer_no` int NOT NULL,
  `bill_id` varchar(250) NOT NULL,
  `location` varchar(100) NOT NULL,
  `loader` varchar(50) NOT NULL,
  PRIMARY KEY (`del_id`)
) ENGINE=InnoDB AUTO_INCREMENT=22510 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `delivery_spots`
--

DROP TABLE IF EXISTS `delivery_spots`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `delivery_spots` (
  `id` int NOT NULL AUTO_INCREMENT,
  `spot` varchar(50) NOT NULL,
  `number` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=160 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `loaders`
--

DROP TABLE IF EXISTS `loaders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `loaders` (
  `id` int NOT NULL AUTO_INCREMENT,
  `loader_name` varchar(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `manager_admin`
--

DROP TABLE IF EXISTS `manager_admin`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `manager_admin` (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` varchar(30) CHARACTER SET latin1 COLLATE latin1_german2_ci DEFAULT NULL,
  `password` varchar(30) CHARACTER SET latin1 COLLATE latin1_german2_ci DEFAULT NULL,
  `admin_firstname` varchar(255) CHARACTER SET latin1 COLLATE latin1_german2_ci NOT NULL,
  `admin_lastname` varchar(255) CHARACTER SET latin1 COLLATE latin1_german2_ci NOT NULL,
  `admin_email` varchar(150) CHARACTER SET latin1 COLLATE latin1_german2_ci DEFAULT NULL,
  `site_name` varchar(255) CHARACTER SET latin1 COLLATE latin1_german2_ci NOT NULL,
  `site_email` varchar(255) CHARACTER SET latin1 COLLATE latin1_german2_ci NOT NULL,
  `paypal_email` varchar(255) CHARACTER SET latin1 COLLATE latin1_german2_ci NOT NULL,
  `site_url` varchar(255) CHARACTER SET latin1 COLLATE latin1_german2_ci NOT NULL,
  `sales_tax_rate` varchar(255) CHARACTER SET latin1 COLLATE latin1_german2_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `p_cus_record`
--

DROP TABLE IF EXISTS `p_cus_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `p_cus_record` (
  `id` int NOT NULL AUTO_INCREMENT,
  `p_sale_id` int NOT NULL,
  `p_date` date NOT NULL,
  `p_cus_number` varchar(50) DEFAULT NULL,
  `p_amt` bigint NOT NULL,
  `p_payment_method` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `p_pur_record`
--

DROP TABLE IF EXISTS `p_pur_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `p_pur_record` (
  `id` int NOT NULL AUTO_INCREMENT,
  `p_pur_id` int NOT NULL,
  `p_date` date NOT NULL,
  `p_supplier_number` varchar(50) DEFAULT NULL,
  `p_amt` bigint NOT NULL,
  `p_payment_method` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `products_paper`
--

DROP TABLE IF EXISTS `products_paper`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `products_paper` (
  `pr_paper_id` int NOT NULL AUTO_INCREMENT,
  `item_code` int NOT NULL,
  `brand_name` varchar(250) NOT NULL,
  PRIMARY KEY (`pr_paper_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `products_reg`
--

DROP TABLE IF EXISTS `products_reg`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `products_reg` (
  `pr_reg_id` int NOT NULL AUTO_INCREMENT,
  `item_code` int NOT NULL,
  `brand_name` varchar(250) NOT NULL,
  PRIMARY KEY (`pr_reg_id`)
) ENGINE=MyISAM AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `pur_record`
--

DROP TABLE IF EXISTS `pur_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `pur_record` (
  `id` int NOT NULL AUTO_INCREMENT,
  `pur_id` int NOT NULL,
  `date` date NOT NULL,
  `supplier_number` varchar(50) DEFAULT NULL,
  `amt` bigint NOT NULL,
  `payment_method` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pur_id` (`pur_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1320 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `salesmen`
--

DROP TABLE IF EXISTS `salesmen`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `salesmen` (
  `id` int NOT NULL AUTO_INCREMENT,
  `salesmen_name` varchar(100) NOT NULL,
  `salesmen_username` varchar(100) NOT NULL,
  `salesmen_mobile` varchar(30) NOT NULL,
  `salesmen_password` varchar(255) NOT NULL,
  `description` text,
  `token` text,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique` (`salesmen_mobile`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sp_customers`
--

DROP TABLE IF EXISTS `sp_customers`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `sp_customers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `salesmen_id` int NOT NULL,
  `sp_cus_name` varchar(70) NOT NULL,
  `sp_cus_number` varchar(70) NOT NULL,
  `sp_cus_add` varchar(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tbl_expenses`
--

DROP TABLE IF EXISTS `tbl_expenses`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tbl_expenses` (
  `id` int NOT NULL AUTO_INCREMENT,
  `expense_date` date NOT NULL,
  `expense_day` varchar(10) NOT NULL,
  `expense_type` varchar(250) NOT NULL,
  `amount` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5834 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tbl_p_purchase`
--

DROP TABLE IF EXISTS `tbl_p_purchase`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tbl_p_purchase` (
  `p_pur_id` int NOT NULL AUTO_INCREMENT,
  `p_bill_id` varchar(250) NOT NULL,
  `p_pur_date` date NOT NULL,
  `p_supplier_name` varchar(100) NOT NULL,
  `p_supplier_no` varchar(100) NOT NULL,
  `p_pur_discount` float NOT NULL,
  `p_sub_total` bigint NOT NULL,
  `p_total_weight` int DEFAULT NULL,
  `p_amount_paid` bigint NOT NULL,
  `p_amount_payable` int NOT NULL,
  `p_first_payment_method` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`p_pur_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tbl_p_purchase_detail`
--

DROP TABLE IF EXISTS `tbl_p_purchase_detail`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tbl_p_purchase_detail` (
  `p_p_d_id` int NOT NULL AUTO_INCREMENT,
  `p_pur_id` int NOT NULL,
  `p_bill_id` varchar(250) NOT NULL,
  `pr_paper_id` int NOT NULL,
  `p_qty` int NOT NULL,
  `p_paper_size` varchar(100) NOT NULL,
  `p_weight` float NOT NULL,
  `t_weight` int DEFAULT NULL,
  `p_rate` float NOT NULL,
  `p_total` double NOT NULL,
  PRIMARY KEY (`p_p_d_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tbl_p_sales`
--

DROP TABLE IF EXISTS `tbl_p_sales`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tbl_p_sales` (
  `p_sale_id` int NOT NULL AUTO_INCREMENT,
  `p_bill_id` varchar(250) NOT NULL,
  `p_sale_date` date NOT NULL,
  `sale_by` varchar(20) NOT NULL DEFAULT 'admin',
  `sp_id` int NOT NULL DEFAULT '0',
  `cus_type` varchar(20) NOT NULL DEFAULT 'admin_cus',
  `customer_name` varchar(100) NOT NULL,
  `customer_no` varchar(50) DEFAULT NULL,
  `customer_add` varchar(200) NOT NULL,
  `p_sale_rent` int NOT NULL,
  `p_sub_total` bigint NOT NULL,
  `p_amount_paid` bigint NOT NULL,
  `p_amount_receivable` bigint NOT NULL,
  `p_first_payment_method` varchar(50) DEFAULT NULL,
  `p_customer_balance` int DEFAULT NULL,
  PRIMARY KEY (`p_sale_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tbl_p_sales_detail`
--

DROP TABLE IF EXISTS `tbl_p_sales_detail`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tbl_p_sales_detail` (
  `p_sale_d_id` int NOT NULL AUTO_INCREMENT,
  `p_sale_id` int NOT NULL,
  `p_bill_id` varchar(250) NOT NULL,
  `pr_paper_id` int NOT NULL,
  `paper_size` varchar(100) NOT NULL,
  `p_weight` float NOT NULL,
  `p_rate` float NOT NULL,
  `p_qan_rate` int NOT NULL,
  `p_total` float NOT NULL,
  PRIMARY KEY (`p_sale_d_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tbl_purchase`
--

DROP TABLE IF EXISTS `tbl_purchase`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tbl_purchase` (
  `pur_id` int NOT NULL AUTO_INCREMENT,
  `bill_id` varchar(250) NOT NULL,
  `pur_date` date NOT NULL,
  `supplier_name` varchar(100) NOT NULL,
  `supplier_no` varchar(100) NOT NULL,
  `pur_discount` float NOT NULL,
  `sub_total` bigint NOT NULL,
  `total_weight` int NOT NULL,
  `amount_paid` bigint NOT NULL,
  `amount_payable` int NOT NULL,
  `first_payment_method` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`pur_id`),
  KEY `supplier_no` (`supplier_no`),
  KEY `pur_id` (`pur_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1354 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tbl_purchase_detail`
--

DROP TABLE IF EXISTS `tbl_purchase_detail`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tbl_purchase_detail` (
  `p_d_id` int NOT NULL AUTO_INCREMENT,
  `pur_id` int NOT NULL,
  `bill_id` varchar(250) NOT NULL,
  `pr_reg_id` int NOT NULL,
  `qty` int NOT NULL,
  `length` float NOT NULL,
  `width` float NOT NULL,
  `weight` float NOT NULL,
  `t_weight` int NOT NULL,
  `rate` float NOT NULL,
  `total` double NOT NULL,
  PRIMARY KEY (`p_d_id`),
  KEY `pur_id` (`pur_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2498 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tbl_sales`
--

DROP TABLE IF EXISTS `tbl_sales`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tbl_sales` (
  `sale_id` int NOT NULL AUTO_INCREMENT,
  `bill_id` varchar(250) NOT NULL,
  `sale_date` date NOT NULL,
  `customer_name` varchar(100) NOT NULL,
  `customer_no` varchar(50) NOT NULL,
  `customer_add` varchar(200) NOT NULL,
  `sale_rent` int NOT NULL,
  `sub_total` bigint NOT NULL,
  `amount_paid` bigint NOT NULL,
  `amount_receivable` bigint NOT NULL,
  `first_payment_method` varchar(50) DEFAULT NULL,
  `customer_balance` int DEFAULT NULL,
  PRIMARY KEY (`sale_id`),
  KEY `sale_id` (`sale_id`),
  KEY `customer_no` (`customer_no`),
  KEY `bill_id` (`bill_id`),
  KEY `customer_no_2` (`customer_no`)
) ENGINE=InnoDB AUTO_INCREMENT=40054 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tbl_sales_detail`
--

DROP TABLE IF EXISTS `tbl_sales_detail`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tbl_sales_detail` (
  `sale_d_id` int NOT NULL AUTO_INCREMENT,
  `sale_id` int NOT NULL,
  `bill_id` varchar(250) NOT NULL,
  `pr_reg_id` int NOT NULL,
  `length` float DEFAULT NULL,
  `width` float DEFAULT NULL,
  `weight` float NOT NULL,
  `rate` float NOT NULL,
  `qan_rate` int NOT NULL,
  `total` float NOT NULL,
  PRIMARY KEY (`sale_d_id`),
  KEY `sale_id` (`sale_id`)
) ENGINE=InnoDB AUTO_INCREMENT=35470 DEFAULT CHARSET=utf8mb3;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2024-10-14  9:21:50
