-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Oct 13, 2020 at 03:02 AM
-- 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',
  `variantId` 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;

--
-- Dumping data for table `PurchaseDetails`
--

INSERT INTO `PurchaseDetails` (`id`, `purchaseId`, `itemId`, `variantId`, `price`, `quantity`, `gstRate`, `cgstAmount`, `sgstAmount`, `igstAmount`, `totalAmount`, `cost`) VALUES
(1, 1, 3, 0, 200, 1, 12, 0, 0, 24, 224, 200),
(4, 1, 1, 0, 12, 1, 2, 0, 0, 0.24, 12.24, 12),
(5, 1, 1, 0, 12, 1, 2, 0, 0, 0.24, 12.24, 12),
(14, 1, 1, 0, 12, 1, 2, 0, 0, 0.24, 12.24, 12),
(15, 1, 1, 0, 12, 1, 2, 0, 0, 0.24, 12.24, 12),
(31, 1, 1, 0, 12, 1, 2, 0, 0, 0.24, 12.24, 12),
(41, 3, 3, 0, 123, 12, 12, 88.56, 88.56, 0, 1653.12, 123),
(42, 3, 1, 0, 1223, 12, 5, 366.9, 366.9, 0, 15409.8, 1223),
(47, 1, 2, 0, 221, 12, 6, 0, 0, 159.12, 2811.12, 221),
(48, 4, 3, 0, 123, 12, 12, 88.56, 88.56, 0, 1653.12, 123),
(49, 5, 12, 0, 12, 1.5, 5, 0, 0, 0.9, 18.9, 12),
(50, 5, 11, 9, 72.5, 6.9, 12, 0, 0, 60.03, 560.28, 72.5);

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

--
-- 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;

--
-- Dumping data for table `PurchaseFreight`
--

INSERT INTO `PurchaseFreight` (`id`, `purchaseId`, `freightRate`, `freightGstRate`, `freightCgst`, `freightSgst`, `freightIgst`, `freightNetAmount`) VALUES
(1, 1, 100, 5, 0, 0, 5, 105),
(2, 3, 122, 0, 0, 0, 0, 122),
(3, 4, 0, 0, 0, 0, 0, 0),
(4, 5, 0, 0, 0, 0, 0, 0);

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

--
-- 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;

--
-- Dumping data for table `Purchases`
--

INSERT INTO `Purchases` (`id`, `invoiceNumber`, `invoiceDate`, `referenceNumber`, `receivedDate`, `supplierId`, `purchaseType`, `otherExpense`, `discountAmount`, `roundOffAmount`, `netAmount`, `createdAt`, `updatedAt`, `deletedAt`, `status`) VALUES
(1, 'as1234', '2020-09-06', 1, '2020-11-12', 2, 1, 250, 50, -1.5, 3399.82, NULL, '2020-09-25 10:45:47', NULL, 1),
(3, 'A123456', '2020-09-24', 0, '2020-09-16', 2, 2, 0, 0, 0, 17324.56, NULL, '2020-09-30 12:28:28', NULL, 1),
(4, 'AS1212', '2020-09-16', 2, '2020-09-01', 1, 2, 0, 0, 0, 1653.12, NULL, '2020-09-30 18:55:52', NULL, 1),
(5, 'A1234', '2020-10-12', 3, '2020-10-12', 1, 1, 0, 0, 0, 579.18, NULL, '2020-10-12 07:21:57', NULL, 1);

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

--
-- 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=51;

--
-- AUTO_INCREMENT for table `PurchaseFreight`
--
ALTER TABLE `PurchaseFreight`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `Purchases`
--
ALTER TABLE `Purchases`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

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