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

DROP TABLE IF EXISTS `Bom`;
CREATE TABLE `Bom` (
  `id` int(11) NOT NULL,
  `bomNumber` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `itemId` int(11) NOT NULL,
  `variantId` int(11) NOT NULL,
  `outputQuantity` double NOT NULL COMMENT 'Quantity Of Items obtained after manufacturing',
  `transferMaterialAginst` int(11) NOT NULL COMMENT '2=>Job Card or 1=>Workorder',
  `branchId` int(11) NOT NULL DEFAULT '1',
  `createdAt` datetime NOT NULL,
  `updatedAt` datetime NOT NULL,
  `deletedAt` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `Bom`
--

INSERT INTO `Bom` (`id`, `bomNumber`, `itemId`, `variantId`, `outputQuantity`, `transferMaterialAginst`, `branchId`, `createdAt`, `updatedAt`, `deletedAt`) VALUES
(1, 'BOM-LV-101-YELLOW-S-0', 11, 7, 10, 1, 1, '2020-10-07 03:29:52', '2020-10-07 21:54:42', NULL),
(2, 'BOM-LV-101-YELLOW-M-1', 11, 4, 1, 1, 1, '2020-10-07 03:30:12', '2020-10-09 00:26:06', '2020-10-09 00:26:06'),
(3, 'BOM-LV-101-YELLOW-L-3', 11, 2, 100, 1, 1, '2020-10-08 01:57:45', '2020-10-09 00:11:12', '2020-10-09 00:11:12');

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

--
-- Table structure for table `BomMaterials`
--

DROP TABLE IF EXISTS `BomMaterials`;
CREATE TABLE `BomMaterials` (
  `id` int(11) NOT NULL,
  `bomId` int(11) NOT NULL,
  `linkedOperationId` int(11) NOT NULL,
  `itemId` int(11) NOT NULL,
  `variantId` int(11) NOT NULL DEFAULT '0',
  `quantity` double NOT NULL DEFAULT '0',
  `unitTypeId` int(11) NOT NULL DEFAULT '0',
  `rate` double NOT NULL DEFAULT '0',
  `amount` double NOT NULL DEFAULT '0',
  `sourceWarehouseId` int(11) NOT NULL,
  `scrapPercentage` double NOT NULL COMMENT 'E material E Operation chaithal ithra Waste Varam',
  `branchId` int(11) NOT NULL DEFAULT '1',
  `createdAt` datetime NOT NULL,
  `updatedAt` datetime NOT NULL,
  `deletedAt` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `BomMaterials`
--

INSERT INTO `BomMaterials` (`id`, `bomId`, `linkedOperationId`, `itemId`, `variantId`, `quantity`, `unitTypeId`, `rate`, `amount`, `sourceWarehouseId`, `scrapPercentage`, `branchId`, `createdAt`, `updatedAt`, `deletedAt`) VALUES
(2, 1, 17, 11, 3, 10000, 1, 350, 3500000, 1, 0, 1, '2020-10-08 23:06:27', '2020-10-08 23:53:35', '0000-00-00 00:00:00'),
(8, 1, 17, 11, 9, 1, 1, 150, 150, 6, 0, 1, '2020-10-08 23:54:05', '2020-10-08 23:54:05', '0000-00-00 00:00:00'),
(9, 1, 17, 11, 7, 12, 1, 320, 3840, 4, 0, 1, '2020-10-09 00:03:51', '2020-10-09 00:03:51', '0000-00-00 00:00:00'),
(10, 1, 18, 11, 8, 1, 1, 100, 100, 4, 0, 1, '2020-10-09 00:04:12', '2020-10-09 00:04:12', '0000-00-00 00:00:00');

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

--
-- Table structure for table `BomOperations`
--

DROP TABLE IF EXISTS `BomOperations`;
CREATE TABLE `BomOperations` (
  `id` int(11) NOT NULL,
  `bomId` int(11) NOT NULL,
  `operationId` int(11) NOT NULL,
  `workstationId` int(11) NOT NULL,
  `description` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `operationTime` int(11) NOT NULL COMMENT 'in Minute',
  `operationCost` double NOT NULL DEFAULT '0',
  `batchSize` int(11) NOT NULL,
  `branchId` int(11) NOT NULL DEFAULT '1',
  `createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedAt` datetime NOT NULL,
  `deletedAt` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `BomOperations`
--

INSERT INTO `BomOperations` (`id`, `bomId`, `operationId`, `workstationId`, `description`, `operationTime`, `operationCost`, `batchSize`, `branchId`, `createdAt`, `updatedAt`, `deletedAt`) VALUES
(1, 2, 13, 20, 'Cutting', 10, 1, 1, 1, '2020-10-07 03:36:25', '2020-10-07 03:36:25', '0000-00-00 00:00:00'),
(2, 2, 16, 1, 'Cutting', 10, 1, 1, 1, '2020-10-07 03:36:32', '2020-10-07 03:36:32', '0000-00-00 00:00:00'),
(5, 3, 19, 24, '', 15, 20.25, 1, 1, '2020-10-08 02:01:48', '2020-10-08 02:01:48', '0000-00-00 00:00:00'),
(6, 3, 19, 24, '', 15, 20.25, 0, 1, '2020-10-08 02:12:50', '2020-10-08 02:12:50', '0000-00-00 00:00:00'),
(7, 3, 19, 24, '', 15, 20.25, 0, 1, '2020-10-08 02:13:25', '2020-10-08 02:13:25', '0000-00-00 00:00:00'),
(27, 1, 17, 23, 'Cutting Operation', 12, 35, 1, 1, '2020-10-09 14:09:19', '0000-00-00 00:00:00', '0000-00-00 00:00:00'),
(28, 1, 17, 21, 'aas', 12, 60, 0, 1, '2020-10-09 03:39:35', '2020-10-09 03:39:35', '0000-00-00 00:00:00');

--
-- Indexes for dumped tables
--

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `Bom`
--
ALTER TABLE `Bom`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `BomMaterials`
--
ALTER TABLE `BomMaterials`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `BomOperations`
--
ALTER TABLE `BomOperations`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;
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 */;
