-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 30, 2020 at 01:29 PM
-- Server version: 5.7.24
-- PHP Version: 7.2.11

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: `montzo_manufacture`
--

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

--
-- Table structure for table `purchasedetails`
--

DROP TABLE IF EXISTS `purchasedetails`;
CREATE TABLE `purchasedetails` (
  `id` bigint(20) NOT NULL,
  `purchaseId` bigint(20) NOT NULL DEFAULT '0',
  `itemId` int(11) NOT NULL DEFAULT '0',
  `price` double NOT NULL DEFAULT '0',
  `quantity` double NOT NULL DEFAULT '0',
  `gstRate` double NOT NULL DEFAULT '0',
  `cgstAmount` double NOT NULL DEFAULT '0',
  `sgstAmount` double NOT NULL DEFAULT '0',
  `igstAmount` double NOT NULL DEFAULT '0',
  `totalAmount` double NOT NULL DEFAULT '0',
  `cost` double NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `purchasefreight`
--

DROP TABLE IF EXISTS `purchasefreight`;
CREATE TABLE `purchasefreight` (
  `id` bigint(20) NOT NULL,
  `purchaseId` bigint(20) NOT NULL DEFAULT '0',
  `freightRate` double NOT NULL DEFAULT '0',
  `freightGstRate` double NOT NULL DEFAULT '0',
  `freightCgst` double NOT NULL DEFAULT '0',
  `freightSgst` double NOT NULL DEFAULT '0',
  `freightIgst` double NOT NULL DEFAULT '0',
  `freightNetAmount` double NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `purchases`
--

DROP TABLE IF EXISTS `purchases`;
CREATE TABLE `purchases` (
  `id` bigint(20) NOT NULL,
  `invoiceNumber` varchar(30) DEFAULT NULL,
  `invoiceDate` date DEFAULT NULL,
  `referenceNumber` int(11) NOT NULL DEFAULT '0',
  `receivedDate` date DEFAULT NULL,
  `supplierId` int(11) NOT NULL DEFAULT '0',
  `purchaseType` tinyint(4) NOT NULL DEFAULT '0',
  `otherExpense` double NOT NULL DEFAULT '0',
  `discountAmount` double NOT NULL DEFAULT '0',
  `roundOffAmount` double NOT NULL DEFAULT '0',
  `netAmount` double NOT NULL DEFAULT '0',
  `createdAt` datetime DEFAULT NULL,
  `updatedAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deletedAt` datetime DEFAULT NULL,
  `status` tinyint(4) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `purchasetypes`
--

DROP TABLE IF EXISTS `purchasetypes`;
CREATE TABLE `purchasetypes` (
  `id` tinyint(4) NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  `status` tinyint(4) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `purchasetypes`
--

INSERT INTO `purchasetypes` (`id`, `name`, `status`) VALUES
(1, 'Interstate', 1),
(2, 'Intrastate', 1);

--
-- Indexes for dumped tables
--

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

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `purchasedetails`
--
ALTER TABLE `purchasedetails`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `purchasefreight`
--
ALTER TABLE `purchasefreight`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `purchases`
--
ALTER TABLE `purchases`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `purchasetypes`
--
ALTER TABLE `purchasetypes`
  MODIFY `id` tinyint(4) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
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 */;
