-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Nov 10, 2021 at 06:41 AM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.3.12

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


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

--
-- Database: `css`
--

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

--
-- Table structure for table `tblbranch`
--

DROP TABLE IF EXISTS `tblbranch`;
CREATE TABLE IF NOT EXISTS `tblbranch` (
  `branchId` int(11) NOT NULL AUTO_INCREMENT,
  `branchName` varchar(255) NOT NULL,
  `branchAddress` varchar(255) NOT NULL,
  `branchContact` varchar(10) NOT NULL,
  `branchStatus` int(11) NOT NULL DEFAULT 0 COMMENT 'Delete=2',
  PRIMARY KEY (`branchId`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblbranch`
--

INSERT INTO `tblbranch` (`branchId`, `branchName`, `branchAddress`, `branchContact`, `branchStatus`) VALUES
(1, 'Kundasale', 'Kundasale', '0767716381', 0);

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

--
-- Table structure for table `tblcategory`
--

DROP TABLE IF EXISTS `tblcategory`;
CREATE TABLE IF NOT EXISTS `tblcategory` (
  `cat_Id` int(11) NOT NULL AUTO_INCREMENT,
  `cat_name` varchar(255) NOT NULL,
  `cat_Short` varchar(255) NOT NULL,
  `cat_status` int(11) NOT NULL DEFAULT 0 COMMENT 'delete=2',
  PRIMARY KEY (`cat_Id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblcategory`
--

INSERT INTO `tblcategory` (`cat_Id`, `cat_name`, `cat_Short`, `cat_status`) VALUES
(1, 'test category', 'TC', 0),
(2, 'test category 2', 'TC2', 0),
(3, 'test category 3', 'TC3', 0);

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

--
-- Table structure for table `tblcustomer`
--

DROP TABLE IF EXISTS `tblcustomer`;
CREATE TABLE IF NOT EXISTS `tblcustomer` (
  `cusId` int(11) NOT NULL AUTO_INCREMENT,
  `nic` varchar(255) NOT NULL,
  `cusName` varchar(255) NOT NULL,
  `cusAddress` varchar(255) NOT NULL,
  `cusContact1` varchar(255) NOT NULL,
  `cusContact2` varchar(255) NOT NULL,
  `cusStatus` int(11) NOT NULL DEFAULT 0 COMMENT 'blacklist=1,delete=2',
  PRIMARY KEY (`cusId`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblcustomer`
--

INSERT INTO `tblcustomer` (`cusId`, `nic`, `cusName`, `cusAddress`, `cusContact1`, `cusContact2`, `cusStatus`) VALUES
(1, '961021979v', 'K.M.T.D.Keerawella', 'No:5/1,Heerassagalla,Pilimathalawa', '0767716381', '', 0),
(2, '961021978v', 'Dilshan Perera', 'test Address', '0767716382', '', 0),
(3, '961021976v', 'Nadun Tharuka', 'test', '0767716345', '', 0);

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

--
-- Table structure for table `tblpayment`
--

DROP TABLE IF EXISTS `tblpayment`;
CREATE TABLE IF NOT EXISTS `tblpayment` (
  `rollNo` int(11) NOT NULL AUTO_INCREMENT,
  `billNumber` varchar(255) NOT NULL,
  `orderNo` varchar(255) NOT NULL,
  `paymentDate` datetime NOT NULL,
  `paymentType` varchar(255) NOT NULL,
  `amount` double(10,2) NOT NULL,
  PRIMARY KEY (`rollNo`),
  KEY `orderNo` (`orderNo`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblpayment`
--

INSERT INTO `tblpayment` (`rollNo`, `billNumber`, `orderNo`, `paymentDate`, `paymentType`, `amount`) VALUES
(1, 'I/N2021/11/05/01', 'R2021/11/05/01', '2021-11-05 16:39:43', 'Advance', 3500.00),
(2, 'I/N2021/11/07/02', 'R2021/11/05/01', '2021-11-07 10:25:36', 'Bill Payment', 1500.00),
(3, 'I/N2021/11/10/03', 'R2021/11/10/05', '2021-11-10 12:08:56', 'Advance', 4000.00);

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

--
-- Table structure for table `tblrent`
--

DROP TABLE IF EXISTS `tblrent`;
CREATE TABLE IF NOT EXISTS `tblrent` (
  `rentId` int(11) NOT NULL AUTO_INCREMENT,
  `orderNo` varchar(255) NOT NULL,
  `branchId` int(11) NOT NULL,
  `nic` varchar(255) NOT NULL,
  `itemCode` varchar(255) NOT NULL,
  `rentDate` datetime NOT NULL,
  `returnDate` datetime NOT NULL,
  `rentType` varchar(255) NOT NULL,
  `qty` int(11) NOT NULL,
  `rent` double(10,2) NOT NULL,
  `fine` double(10,2) NOT NULL DEFAULT 0.00,
  `totalPrice` double(10,2) NOT NULL,
  `subtotal` double(10,2) NOT NULL,
  `discount` double(10,2) NOT NULL,
  `amount` double(10,2) NOT NULL,
  `balance` double(10,2) NOT NULL,
  `returnStatus` int(11) NOT NULL DEFAULT 0 COMMENT 'return=1',
  `rentStatus` int(11) NOT NULL DEFAULT 0 COMMENT 'Incomplete=0,complete=1,delete=2',
  PRIMARY KEY (`rentId`),
  KEY `branchId` (`branchId`),
  KEY `nic` (`nic`),
  KEY `itemCode` (`itemCode`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblrent`
--

INSERT INTO `tblrent` (`rentId`, `orderNo`, `branchId`, `nic`, `itemCode`, `rentDate`, `returnDate`, `rentType`, `qty`, `rent`, `fine`, `totalPrice`, `subtotal`, `discount`, `amount`, `balance`, `returnStatus`, `rentStatus`) VALUES
(1, 'R2021/11/05/01', 1, '961021979v', 'TC011', '2021-11-05 16:37:04', '2021-11-05 19:37:04', 'Hour', 1, 125.00, 387.16, 512.16, 26182.64, 0.00, 26182.64, 21182.64, 1, 0),
(2, 'R2021/11/05/01', 1, '961021979v', 'TC012', '2021-11-05 16:37:04', '2021-11-05 19:37:04', 'Hour', 1, 125.00, 387.16, 512.16, 26182.64, 0.00, 26182.64, 21182.64, 1, 0),
(3, 'R2021/11/05/01', 1, '961021979v', 'TC2041', '2021-11-05 16:37:13', '2021-11-09 16:37:13', 'Day', 1, 24000.00, 1158.32, 25158.32, 26182.64, 0.00, 26182.64, 21182.64, 0, 0),
(4, 'R2021/11/07/04', 1, '961021978v', 'TC013', '2021-11-07 09:27:37', '2021-11-07 12:27:37', 'Hour', 1, 125.00, 736.39, 861.39, 861.39, 0.00, 861.39, 861.39, 0, 0),
(5, 'R2021/11/10/05', 1, '961021976v', 'TC2042', '2021-11-10 12:04:16', '2021-11-14 12:04:16', 'Day', 1, 24000.00, 0.00, 24000.00, 24000.00, 0.00, 24000.00, 20000.00, 0, 0);

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

--
-- Table structure for table `tblrentstock`
--

DROP TABLE IF EXISTS `tblrentstock`;
CREATE TABLE IF NOT EXISTS `tblrentstock` (
  `rentstockId` int(11) NOT NULL AUTO_INCREMENT,
  `catId` int(11) NOT NULL,
  `branchId` int(11) NOT NULL,
  `suplierId` int(11) NOT NULL,
  `itemCode` varchar(255) NOT NULL,
  `serialNumber` varchar(255) NOT NULL,
  `itemName` varchar(255) NOT NULL,
  `rentType` varchar(255) NOT NULL,
  `qty` int(11) NOT NULL,
  `price` double(10,2) NOT NULL,
  `find` double(10,2) NOT NULL,
  `rentStatus` int(11) NOT NULL DEFAULT 0 COMMENT 'free=0,rent=1,delete=2,repair=3',
  PRIMARY KEY (`rentstockId`),
  KEY `catId` (`catId`),
  KEY `branchId` (`branchId`),
  KEY `suplierId` (`suplierId`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblrentstock`
--

INSERT INTO `tblrentstock` (`rentstockId`, `catId`, `branchId`, `suplierId`, `itemCode`, `serialNumber`, `itemName`, `rentType`, `qty`, `price`, `find`, `rentStatus`) VALUES
(1, 1, 1, 1, 'TC011', '121212', 'Grill', 'Hour', 3, 1000.00, 250.00, 1),
(2, 1, 1, 1, 'TC012', '121212', 'Grill', 'Hour', 3, 1000.00, 250.00, 1),
(3, 1, 1, 1, 'TC013', '121212', 'Grill', 'Hour', 3, 1000.00, 250.00, 1),
(4, 2, 1, 1, 'TC2041', '11111', 'Concreat Mixer', 'Day', 5, 6000.00, 1500.00, 1),
(5, 2, 1, 1, 'TC2042', '11111', 'Concreat Mixer', 'Day', 5, 6000.00, 1500.00, 1),
(6, 2, 1, 1, 'TC2043', '11111', 'Concreat Mixer', 'Day', 5, 6000.00, 1500.00, 0),
(7, 2, 1, 1, 'TC2044', '11111', 'Concreat Mixer', 'Day', 5, 6000.00, 1500.00, 0),
(8, 2, 1, 1, 'TC2045', '11111', 'Concreat Mixer', 'Day', 5, 6000.00, 1500.00, 0);

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

--
-- Table structure for table `tblreturnitem`
--

DROP TABLE IF EXISTS `tblreturnitem`;
CREATE TABLE IF NOT EXISTS `tblreturnitem` (
  `returnId` int(11) NOT NULL AUTO_INCREMENT,
  `orderNo` varchar(255) NOT NULL,
  `itemCode` varchar(255) NOT NULL,
  `returnDateT` datetime NOT NULL,
  PRIMARY KEY (`returnId`),
  KEY `orderNo` (`orderNo`),
  KEY `itemCode` (`itemCode`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblreturnitem`
--

INSERT INTO `tblreturnitem` (`returnId`, `orderNo`, `itemCode`, `returnDateT`) VALUES
(1, 'R2021/11/05/01', 'TC011', '2021-11-07 09:47:06'),
(2, 'R2021/11/05/01', 'TC012', '2021-11-07 09:47:06');

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

--
-- Table structure for table `tblsellestock`
--

DROP TABLE IF EXISTS `tblsellestock`;
CREATE TABLE IF NOT EXISTS `tblsellestock` (
  `ssId` int(11) NOT NULL AUTO_INCREMENT,
  `cat_id` int(11) NOT NULL,
  `branchId` int(11) NOT NULL,
  `itemCode` varchar(255) NOT NULL,
  `serialNumber` varchar(255) NOT NULL,
  `itemName` varchar(255) NOT NULL,
  `unitPrice` double(10,2) NOT NULL,
  `sellingPrice` double(10,2) NOT NULL,
  `quantity` int(11) NOT NULL,
  `miniStock` int(11) NOT NULL,
  `ssStatus` int(11) NOT NULL COMMENT 'stock out=1,delete=2',
  PRIMARY KEY (`ssId`),
  KEY `branchId` (`branchId`),
  KEY `cat_id` (`cat_id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblsellestock`
--

INSERT INTO `tblsellestock` (`ssId`, `cat_id`, `branchId`, `itemCode`, `serialNumber`, `itemName`, `unitPrice`, `sellingPrice`, `quantity`, `miniStock`, `ssStatus`) VALUES
(1, 1, 1, 'D001', '2457871', 'item 01', 32.00, 32.00, 46, 10, 0),
(2, 1, 1, 'D002', '121212', 'Item 02', 35.00, 35.00, 50, 10, 0);

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

--
-- Table structure for table `tblsells`
--

DROP TABLE IF EXISTS `tblsells`;
CREATE TABLE IF NOT EXISTS `tblsells` (
  `sellId` int(11) NOT NULL AUTO_INCREMENT,
  `orderNo` varchar(255) NOT NULL,
  `itemCode` varchar(255) NOT NULL,
  `contact` varchar(10) NOT NULL,
  `unitPrice` double(10,2) NOT NULL,
  `quantity` int(11) NOT NULL,
  `discount` double(10,2) NOT NULL,
  `amount` double(10,2) NOT NULL,
  `salesDate` date NOT NULL,
  `sellStatus` int(11) NOT NULL DEFAULT 0 COMMENT 'delete=2',
  PRIMARY KEY (`sellId`),
  KEY `itemCode` (`itemCode`),
  KEY `contact` (`contact`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblsells`
--

INSERT INTO `tblsells` (`sellId`, `orderNo`, `itemCode`, `contact`, `unitPrice`, `quantity`, `discount`, `amount`, `salesDate`, `sellStatus`) VALUES
(1, 'S2021/10/23/01', 'D001', '0767716381', 32.00, 2, 5.00, 95.80, '2021-10-23', 0),
(2, 'S2021/10/23/02', 'D001', '0767716381', 32.00, 1, 0.00, 32.00, '2021-10-23', 0),
(3, 'S2021/10/24/03', 'D001', '0767716381', 32.00, 1, 0.00, 32.00, '2021-10-24', 0);

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

--
-- Table structure for table `tblsuplier`
--

DROP TABLE IF EXISTS `tblsuplier`;
CREATE TABLE IF NOT EXISTS `tblsuplier` (
  `suplierId` int(11) NOT NULL AUTO_INCREMENT,
  `suplierName` varchar(255) NOT NULL,
  `suplierAddress` varchar(255) NOT NULL,
  `suplierContact` varchar(255) NOT NULL,
  `suplierStatus` int(11) NOT NULL DEFAULT 0 COMMENT 'delete=2',
  PRIMARY KEY (`suplierId`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tblsuplier`
--

INSERT INTO `tblsuplier` (`suplierId`, `suplierName`, `suplierAddress`, `suplierContact`, `suplierStatus`) VALUES
(1, 'test suplier', 'test address', '0767716381', 0);

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

--
-- Table structure for table `tbluser`
--

DROP TABLE IF EXISTS `tbluser`;
CREATE TABLE IF NOT EXISTS `tbluser` (
  `uId` int(11) NOT NULL AUTO_INCREMENT,
  `branchId` int(11) NOT NULL,
  `image` varchar(255) NOT NULL,
  `userType` varchar(255) NOT NULL,
  `userName` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `userStatus` int(11) NOT NULL DEFAULT 0 COMMENT 'active=1,deactivate=0,delete=2',
  PRIMARY KEY (`uId`),
  KEY `branchId` (`branchId`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tbluser`
--

INSERT INTO `tbluser` (`uId`, `branchId`, `image`, `userType`, `userName`, `password`, `userStatus`) VALUES
(1, 1, '', 'Admin', 'admin', 'e10adc3949ba59abbe56e057f20f883e', 0);
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 */;
