/*!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 utf8 */;
/*!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 */;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: invoice_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `invoice_table` (
  `Id` int(10) NOT NULL AUTO_INCREMENT,
  `InvoiceNo` varchar(20) DEFAULT NULL,
  `InvoiceDate` date DEFAULT NULL,
  `InvoiceDueDate` date DEFAULT NULL,
  `CollectionPeriod` varchar(20) DEFAULT NULL,
  `CusId` varchar(20) DEFAULT NULL,
  `CusName` varchar(150) DEFAULT NULL,
  `Address` varchar(200) DEFAULT NULL,
  `CollectionId` int(11) DEFAULT NULL,
  `CollectionDate` varchar(50) DEFAULT NULL,
  `Provider` varchar(100) DEFAULT NULL,
  `Collections` decimal(20, 2) DEFAULT NULL,
  `Rate` varchar(20) DEFAULT NULL,
  `Commission` decimal(20, 2) DEFAULT NULL,
  `TotalColl` decimal(20, 2) DEFAULT NULL,
  `TotalComm` decimal(20, 2) DEFAULT NULL,
  `BasePayment` decimal(20, 2) DEFAULT NULL,
  `GrandTotal` decimal(20, 2) DEFAULT NULL,
  `BalToPay` decimal(20, 2) DEFAULT NULL,
  `AmountPaid` decimal(20, 2) DEFAULT NULL,
  `ApprovalStatus` varchar(50) DEFAULT NULL,
  `Status` varchar(20) DEFAULT NULL,
  `CreatedBy` varchar(50) DEFAULT NULL,
  `CompanyName` varchar(250) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 1261 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: assigned_contractor_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `assigned_contractor_table` (
  `Id` int(20) NOT NULL AUTO_INCREMENT,
  `ProvId` varchar(50) DEFAULT NULL,
  `ProviderName` varchar(255) DEFAULT NULL,
  `ConId` varchar(50) DEFAULT NULL,
  `ContractorName` varchar(250) DEFAULT NULL,
  `PayRate` varchar(10) DEFAULT NULL,
  `StartDate` date DEFAULT NULL,
  `EndDate` date DEFAULT NULL,
  `ReasonToEnded` varchar(200) DEFAULT NULL,
  `CompanyName` varchar(250) NOT NULL,
  `CreatedBy` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 97 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: collection_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `collection_table` (
  `Id` int(20) NOT NULL AUTO_INCREMENT,
  `Date` varchar(20) DEFAULT NULL,
  `EmpId` varchar(50) DEFAULT NULL,
  `EmpName` varchar(250) DEFAULT NULL,
  `CusId` varchar(50) DEFAULT NULL,
  `CusName` varchar(250) DEFAULT NULL,
  `CollectionAmount` decimal(20, 2) DEFAULT NULL,
  `Rate` varchar(10) DEFAULT NULL,
  `Commission` decimal(20, 2) DEFAULT NULL,
  `Status` varchar(50) DEFAULT NULL,
  `CreatedBy` varchar(100) DEFAULT NULL,
  `CompanyName` varchar(250) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 784 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: company_details_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `company_details_table` (
  `Id` int(20) NOT NULL AUTO_INCREMENT,
  `CompanyName` varchar(200) NOT NULL,
  `TaxID` varchar(100) DEFAULT NULL,
  `Phone` varchar(100) DEFAULT NULL,
  `Email` varchar(250) DEFAULT NULL,
  `Web` varchar(250) DEFAULT NULL,
  `OwnerName` varchar(250) DEFAULT NULL,
  `OwnerPhone` varchar(200) DEFAULT NULL,
  `EstablishDate` date DEFAULT NULL,
  `DateCreated` date DEFAULT NULL,
  `Address` varchar(200) DEFAULT NULL,
  `OtherDetails` varchar(250) DEFAULT NULL,
  `DigitalSignature` mediumblob DEFAULT NULL,
  `Logo` mediumblob DEFAULT NULL,
  `CreatedBy` varchar(50) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 25 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: customer_receipt_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `customer_receipt_table` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `ReceiptNo` varchar(20) DEFAULT NULL,
  `PaidDate` date DEFAULT NULL,
  `PaymentType` varchar(20) DEFAULT NULL,
  `PaymentRefNo` varchar(100) DEFAULT NULL,
  `CusId` varchar(20) DEFAULT NULL,
  `CusName` varchar(100) DEFAULT NULL,
  `Address` varchar(200) DEFAULT NULL,
  `PaidTotal` decimal(20, 2) DEFAULT NULL,
  `InvoiceDate` date DEFAULT NULL,
  `InvoiceNo` varchar(20) DEFAULT NULL,
  `Period` varchar(20) DEFAULT NULL,
  `BasePayment` decimal(20, 2) DEFAULT NULL,
  `TotalComm` decimal(20, 2) DEFAULT NULL,
  `GrandTotal` decimal(20, 2) DEFAULT NULL,
  `BalToPay` decimal(20, 2) DEFAULT NULL,
  `AmountPaid` decimal(20, 2) DEFAULT NULL,
  `Status` varchar(20) DEFAULT NULL,
  `Payslip` varchar(20) DEFAULT NULL,
  `CreatedBy` varchar(50) DEFAULT NULL,
  `CompanyName` varchar(250) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 231 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: customer_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `customer_table` (
  `Id` int(10) NOT NULL AUTO_INCREMENT,
  `CusId` varchar(20) NOT NULL,
  `CusName` varchar(50) NOT NULL,
  `Phone` varchar(100) DEFAULT NULL,
  `Email` varchar(100) DEFAULT NULL,
  `Address` varchar(250) DEFAULT NULL,
  `GroupName` varchar(250) DEFAULT NULL,
  `StartDate` date DEFAULT NULL,
  `Status` varchar(50) NOT NULL,
  `CreatedBy` varchar(50) NOT NULL,
  `CompanyName` varchar(250) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 247 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: emp_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `emp_table` (
  `Id` int(20) NOT NULL AUTO_INCREMENT,
  `EmpName` varchar(255) DEFAULT NULL,
  `DOB` date DEFAULT NULL,
  `Gender` varchar(50) DEFAULT NULL,
  `Address` varchar(250) DEFAULT NULL,
  `Phone` varchar(50) DEFAULT NULL,
  `Email` varchar(250) DEFAULT NULL,
  `Status` varchar(50) DEFAULT NULL,
  `CreatedBy` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 8 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: employee_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `employee_table` (
  `Id` int(20) NOT NULL AUTO_INCREMENT,
  `EmpId` varchar(20) NOT NULL,
  `EmpName` varchar(100) DEFAULT NULL,
  `SSN` varchar(25) DEFAULT NULL,
  `PermanentAddress` varchar(250) DEFAULT NULL,
  `DateOfBirth` date DEFAULT NULL,
  `StartDate` date DEFAULT NULL,
  `EndDate` date DEFAULT NULL,
  `BasePayment` decimal(20, 2) DEFAULT NULL,
  `Phone` varchar(50) DEFAULT NULL,
  `Email` varchar(250) DEFAULT NULL,
  `Gender` varchar(50) DEFAULT NULL,
  `Status` varchar(30) DEFAULT NULL,
  `CreatedBy` varchar(50) DEFAULT NULL,
  `CompanyName` varchar(250) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 47 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: file_upload_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `file_upload_table` (
  `Id` int(20) NOT NULL AUTO_INCREMENT,
  `EmpId` varchar(100) DEFAULT NULL,
  `EmpName` varchar(255) DEFAULT NULL,
  `FileName` varchar(250) DEFAULT NULL,
  `Description` varchar(250) DEFAULT NULL,
  `AttachedDate` date DEFAULT NULL,
  `IsShared` varchar(20) DEFAULT NULL,
  `CreatedBy` varchar(100) DEFAULT NULL,
  `CompanyName` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 53 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: backup_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `backup_table` (
  `Id` int(20) NOT NULL AUTO_INCREMENT,
  `Filename` varchar(100) DEFAULT NULL,
  `DateCreated` varchar(100) DEFAULT NULL,
  `CreatedBy` varchar(100) DEFAULT NULL,
  `CompanyName` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 14 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: mail_config_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `mail_config_table` (
  `Id` int(20) NOT NULL AUTO_INCREMENT,
  `RefNo` varchar(50) DEFAULT NULL,
  `FromEmail` varchar(250) DEFAULT NULL,
  `Password` varchar(250) DEFAULT NULL,
  `Service` varchar(250) DEFAULT NULL,
  `ToEmail` varchar(250) DEFAULT NULL,
  `CreatedBy` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 2 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: pay_slip_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `pay_slip_table` (
  `Id` int(20) NOT NULL AUTO_INCREMENT,
  `PaySlipNo` varchar(50) DEFAULT NULL,
  `CusId` varchar(100) DEFAULT NULL,
  `CusName` varchar(250) DEFAULT NULL,
  `Address` varchar(250) DEFAULT NULL,
  `SSN` varchar(100) DEFAULT NULL,
  `Period` varchar(50) DEFAULT NULL,
  `PaymentDate` date DEFAULT NULL,
  `PaymentRefNo` varchar(100) DEFAULT NULL,
  `PaymentType` varchar(50) DEFAULT NULL,
  `RegularPay` decimal(20, 2) DEFAULT NULL,
  `Overtime` decimal(20, 2) DEFAULT NULL,
  `BasePayment` decimal(20, 2) DEFAULT NULL,
  `Commission` decimal(20, 2) DEFAULT NULL,
  `GrossPay` decimal(20, 2) DEFAULT NULL,
  `FedIncomeTax` decimal(20, 2) DEFAULT NULL,
  `SocialSecTax` decimal(20, 2) DEFAULT NULL,
  `MedicareTax` decimal(20, 2) DEFAULT NULL,
  `StateIncomeTax` decimal(20, 2) DEFAULT NULL,
  `TotalDeduction` decimal(20, 2) DEFAULT NULL,
  `NetPay` decimal(20, 2) DEFAULT NULL,
  `RefNo` varchar(20) DEFAULT NULL,
  `CreatedBy` varchar(100) DEFAULT NULL,
  `CompanyName` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 21 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: settings_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `settings_table` (
  `Id` int(10) NOT NULL AUTO_INCREMENT,
  `RefId` varchar(20) NOT NULL,
  `RefName` varchar(200) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 7 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: shared_document_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `shared_document_table` (
  `Id` int(20) NOT NULL AUTO_INCREMENT,
  `FileName` varchar(255) DEFAULT NULL,
  `Description` varchar(250) DEFAULT NULL,
  `SharedOn` date DEFAULT NULL,
  `SharedBy` varchar(100) DEFAULT NULL,
  `SharedTo` varchar(100) DEFAULT NULL,
  `CompanyName` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 45 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: task_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `task_table` (
  `Id` int(20) NOT NULL AUTO_INCREMENT,
  `EmpId` varchar(100) DEFAULT NULL,
  `EmpName` varchar(250) NOT NULL,
  `Type` varchar(100) NOT NULL,
  `Title` varchar(250) NOT NULL,
  `Description` varchar(250) NOT NULL,
  `DueDate` date NOT NULL,
  `Status` varchar(50) NOT NULL,
  `CreatedBy` varchar(50) NOT NULL,
  `CompanyName` varchar(250) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 29 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: user_access_permission_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `user_access_permission_table` (
  `Id` int(20) NOT NULL AUTO_INCREMENT,
  `UserName` varchar(30) NOT NULL,
  `DB` int(2) NOT NULL,
  `CP` int(2) NOT NULL,
  `COM` int(2) NOT NULL,
  `EM` int(2) NOT NULL,
  `ADD_CONT` int(2) NOT NULL,
  `ASSIGN_CONT` int(2) NOT NULL,
  `CM` int(2) NOT NULL,
  `COLL` int(2) NOT NULL,
  `INV` int(2) NOT NULL,
  `PMT` int(2) NOT NULL,
  `PS` int(2) NOT NULL,
  `TASK` int(2) NOT NULL,
  `DOC` int(2) NOT NULL,
  `USER` int(2) NOT NULL,
  `COLL_REPORT` int(2) NOT NULL,
  `INV_REPORT` int(2) NOT NULL,
  `BP_REPORT` int(2) NOT NULL,
  `PS_REPORT` int(2) NOT NULL,
  `CLIENT_REPORT` int(2) NOT NULL,
  `EMP_REPORT` int(2) NOT NULL,
  `SETTINGS` int(2) NOT NULL,
  `BACKUP` int(2) NOT NULL,
  `CreatedBy` varchar(50) NOT NULL,
  `CompanyName` varchar(250) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 52 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: user_login_session_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `user_login_session_table` (
  `Id` int(10) NOT NULL AUTO_INCREMENT,
  `UserName` varchar(50) NOT NULL,
  `LoginDate` date NOT NULL,
  `LoginTime` time NOT NULL,
  `IsLogin` int(2) NOT NULL,
  `Status` varchar(20) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 13 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: user_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `user_table` (
  `Id` int(20) NOT NULL AUTO_INCREMENT,
  `EmpId` varchar(25) NOT NULL,
  `EmpName` varchar(100) NOT NULL,
  `UserName` varchar(50) NOT NULL,
  `Password` varchar(250) NOT NULL,
  `UserType` varchar(50) NOT NULL,
  `Status` varchar(25) NOT NULL,
  `CreatedBy` varchar(50) NOT NULL,
  `CompanyName` varchar(250) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 64 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# SCHEMA DUMP FOR TABLE: user_type_table
# ------------------------------------------------------------

CREATE TABLE IF NOT EXISTS `user_type_table` (
  `Id` int(20) NOT NULL AUTO_INCREMENT,
  `UserType` varchar(100) NOT NULL,
  `CreatedBy` varchar(50) NOT NULL,
  `CompanyName` varchar(250) NOT NULL,
  PRIMARY KEY (`Id`)
) ENGINE = InnoDB AUTO_INCREMENT = 38 DEFAULT CHARSET = latin1 COLLATE = latin1_swedish_ci;

# ------------------------------------------------------------
# DATA DUMP FOR TABLE: invoice_table
# ------------------------------------------------------------

INSERT INTO
  `invoice_table` (
    `Id`,
    `InvoiceNo`,
    `InvoiceDate`,
    `InvoiceDueDate`,
    `CollectionPeriod`,
    `CusId`,
    `CusName`,
    `Address`,
    `CollectionId`,
    `CollectionDate`,
    `Provider`,
    `Collections`,
    `Rate`,
    `Commission`,
    `TotalColl`,
    `TotalComm`,
    `BasePayment`,
    `GrandTotal`,
    `BalToPay`,
    `AmountPaid`,
    `ApprovalStatus`,
    `Status`,
    `CreatedBy`,
    `CompanyName`
  )
VALUES
  (
    327,
    'INV000001',
    '2021-05-23',
    NULL,
    '2021-04',
    'EMP000017',
    'Anura Kumara',
    'ff',
    39,
    'Apr 2021',
    'maduranga-updated',
    5000.00,
    '23',
    1150.00,
    55000.00,
    2650.00,
    0.00,
    2650.00,
    2650.00,
    0.00,
    NULL,
    'Unpaid',
    'admin',
    'RapidGnix'
  );
