/*
SQLyog Community v9.61 
MySQL - 5.5.8-log : Database - db_mxerp
*********************************************************************
*/

/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!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 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`db_mxerp` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `db_mxerp`;

/*Table structure for table `salesorder` */

DROP TABLE IF EXISTS `salesorder`;

CREATE TABLE `salesorder` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `branch` varchar(10) DEFAULT NULL,
  `orderNo` varchar(30) DEFAULT NULL,
  `cost_center` varchar(255) DEFAULT NULL,
  `orderDate` date DEFAULT NULL,
  `PORefNo` varchar(30) DEFAULT NULL,
  `quotation_subject` varchar(255) DEFAULT NULL,
  `quotationType` varchar(20) DEFAULT NULL,
  `customerPODate` date DEFAULT NULL,
  `ammendmentDate` date DEFAULT NULL,
  `orderReceived` varchar(5) DEFAULT NULL,
  `orderType` varchar(5) DEFAULT NULL,
  `Sale_Key_Exec` varchar(255) DEFAULT NULL,
  `client` varchar(10) DEFAULT NULL,
  `salesMan` varchar(10) DEFAULT NULL,
  `quoteNo` int(5) DEFAULT NULL,
  `validTill` date DEFAULT NULL,
  `PPC` varchar(5) DEFAULT NULL,
  `freightStatus` varchar(8) DEFAULT NULL,
  `paymentAgainst` varchar(8) DEFAULT NULL,
  `dispatchTo` varchar(30) DEFAULT NULL,
  `basicAmount` double(10,2) DEFAULT NULL,
  `totalDiscountedPrice` double(10,2) DEFAULT NULL,
  `exciseDuty` int(5) DEFAULT NULL,
  `exciseValue` double(10,2) DEFAULT NULL,
  `ECessId` varchar(20) DEFAULT NULL,
  `ECessPercentage` double(10,2) DEFAULT NULL,
  `ECessValue` double(10,2) DEFAULT NULL,
  `SHECessId` varchar(20) DEFAULT NULL,
  `SAHCessPercentage` double(10,2) DEFAULT NULL,
  `SAHCessValue` double(10,2) DEFAULT NULL,
  `taxableAmount` double(10,2) DEFAULT NULL,
  `TotalExciseValue` double(10,2) DEFAULT NULL,
  `VatCst` int(5) DEFAULT NULL,
  `VatCstValue` double(10,2) DEFAULT NULL,
  `freightValue` double(10,2) DEFAULT NULL,
  `packagingCharges` double(10,2) DEFAULT NULL,
  `additionalCharges` double(10,2) DEFAULT NULL,
  `roundOff` int(5) DEFAULT NULL,
  `grandTotal` double(10,2) DEFAULT NULL,
  `status` varchar(15) DEFAULT 'pending',
  `createdBy` varchar(5) DEFAULT NULL,
  `createdDate` date DEFAULT NULL,
  `paymentTerms` varchar(40) DEFAULT NULL,
  `DeliveryDate` date DEFAULT NULL,
  `deliveryTerms` varchar(255) DEFAULT NULL,
  `otherTerm1` varchar(255) DEFAULT NULL,
  `otherTerm2` varchar(255) DEFAULT NULL,
  `narration` varchar(255) DEFAULT NULL,
  `advance` varchar(10) DEFAULT NULL,
  `totalqty` int(10) DEFAULT NULL,
  `totalTaxAmount` double(10,2) DEFAULT NULL,
  `indent_status` varchar(2) DEFAULT '0',
  `description` text,
  `SalesOrderType` varchar(20) DEFAULT 'leads',
  `CompanyId` int(10) DEFAULT NULL,
  `RoadPermit` varchar(25) DEFAULT NULL,
  `Transport` varchar(255) DEFAULT NULL,
  `freight` varchar(255) DEFAULT NULL,
  `TelStatus` varchar(255) DEFAULT NULL,
  `PendingPayment` varchar(255) DEFAULT NULL,
  `ContactPerson` varchar(255) DEFAULT NULL,
  `cate` varchar(255) DEFAULT NULL,
  `modifyBy` varchar(10) DEFAULT NULL,
  `order_type` varchar(255) DEFAULT NULL,
  `remarks` text,
  `pkg_charges` double(10,2) DEFAULT NULL,
  `frd_charges` double(10,2) DEFAULT NULL,
  `frieght_charges` double(10,2) DEFAULT NULL,
  `insurance_charges` double(10,2) DEFAULT NULL,
  `install_charges` double(10,2) DEFAULT NULL,
  `dsl_charges` double(10,2) DEFAULT NULL,
  `train_chages` double(10,2) DEFAULT NULL,
  `ser_per` double(10,2) DEFAULT NULL,
  `service_amt` double(10,2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=230 DEFAULT CHARSET=latin1;

/*Data for the table `salesorder` */

insert  into `salesorder`(`id`,`branch`,`orderNo`,`cost_center`,`orderDate`,`PORefNo`,`quotation_subject`,`quotationType`,`customerPODate`,`ammendmentDate`,`orderReceived`,`orderType`,`Sale_Key_Exec`,`client`,`salesMan`,`quoteNo`,`validTill`,`PPC`,`freightStatus`,`paymentAgainst`,`dispatchTo`,`basicAmount`,`totalDiscountedPrice`,`exciseDuty`,`exciseValue`,`ECessId`,`ECessPercentage`,`ECessValue`,`SHECessId`,`SAHCessPercentage`,`SAHCessValue`,`taxableAmount`,`TotalExciseValue`,`VatCst`,`VatCstValue`,`freightValue`,`packagingCharges`,`additionalCharges`,`roundOff`,`grandTotal`,`status`,`createdBy`,`createdDate`,`paymentTerms`,`DeliveryDate`,`deliveryTerms`,`otherTerm1`,`otherTerm2`,`narration`,`advance`,`totalqty`,`totalTaxAmount`,`indent_status`,`description`,`SalesOrderType`,`CompanyId`,`RoadPermit`,`Transport`,`freight`,`TelStatus`,`PendingPayment`,`ContactPerson`,`cate`,`modifyBy`,`order_type`,`remarks`,`pkg_charges`,`frd_charges`,`frieght_charges`,`insurance_charges`,`install_charges`,`dsl_charges`,`train_chages`,`ser_per`,`service_amt`) values (214,'B001','BG/SO/00001','CostCenter/BG/00001','2012-11-28','Client P.O. No.-987',NULL,NULL,'2012-11-28',NULL,NULL,NULL,'32','2',NULL,NULL,NULL,NULL,NULL,NULL,NULL,66750.00,NULL,22,NULL,'',2.00,133.50,'27',1.00,66.75,73625.25,6675.00,12,9663.31,NULL,NULL,NULL,NULL,83288.56,'pending','10',NULL,NULL,'2012-11-30',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0',NULL,'Tel',1,'NH4 Road Permit','1','Paid','Created','sgfdyhtgfuj','14','Urgent','10','Consolidate',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(216,'B001','BG/SO/00002','CostCenter/BG/00002','2012-11-29','Client P.O. No.-5487',NULL,NULL,'2012-11-29',NULL,NULL,NULL,'32','29',NULL,NULL,NULL,NULL,NULL,NULL,NULL,28600.00,NULL,22,NULL,'',2.00,57.20,'27',1.00,28.60,31545.80,2860.00,12,4140.39,NULL,NULL,NULL,NULL,35686.19,'pending','10',NULL,NULL,'2012-11-30',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0',NULL,'Tel',1,'NH8','1','Paid','Created','aefdsf','11','Urgent','10','Consolidate',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(217,'B001','BG/SO/00003','CostCenter/BG/00003','2012-12-11','',NULL,NULL,'2012-12-11',NULL,NULL,NULL,'34','3',NULL,42,NULL,NULL,NULL,NULL,NULL,13800.00,NULL,23,NULL,'',2.00,33.12,'',1.00,16.56,15505.68,1656.00,13,310.11,NULL,NULL,NULL,NULL,15815.79,'pending','10',NULL,NULL,'2012-12-11',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0',NULL,'Process',1,'NH10','Paid','Paid','Created','Test By Amit','15','Urgent','10','Consolidate',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(218,'B001','BG/SO/00004','CostCenter/BG/00004','2012-12-12','',NULL,NULL,'2012-12-12',NULL,NULL,NULL,'32','3',NULL,44,NULL,NULL,NULL,NULL,NULL,144.00,NULL,0,NULL,'',2.00,0.03,'',1.00,0.02,145.73,1.68,10,6.12,NULL,NULL,NULL,NULL,151.85,'pending','10',NULL,NULL,'2012-12-12',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0',NULL,'Process',1,'NH8','topay','topay','Created','gfhfgh','15','Urgent','10','MRP_Item',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(219,'B001','BG/SO/00005','CostCenter/BG/00005','2012-12-14','',NULL,NULL,'2012-12-22',NULL,NULL,NULL,'34','668',NULL,47,NULL,NULL,NULL,NULL,NULL,99999999.99,NULL,22,NULL,'',2.00,0.00,'',1.00,0.00,99999999.99,99999999.99,10,0.00,NULL,NULL,NULL,NULL,99999999.99,'pending','10',NULL,NULL,'2012-12-12',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0',NULL,'Process',1,'yes','topay','topay','Created','','0','Urgent','10','Consolidate',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(220,'B001','BG/SO/00006','CostCenter/BG/00006','2012-12-20','07878',NULL,NULL,'2012-12-19',NULL,NULL,NULL,'34','670',NULL,49,NULL,NULL,NULL,NULL,NULL,100000.00,NULL,22,NULL,'',2.00,200.00,'',1.00,100.00,110300.00,10000.00,11,13787.50,NULL,NULL,NULL,NULL,124087.50,'pending','10',NULL,NULL,'2012-12-19',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0',NULL,'Process',1,'Road','1','Paid','Created','','0','Urgent',NULL,'Consolidate',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(221,'B001','BG/SO/00007','CostCenter/BG/00007','2012-12-21','998727867676',NULL,NULL,'2012-12-20',NULL,NULL,NULL,'34','674',NULL,53,NULL,NULL,NULL,NULL,NULL,100000.00,NULL,22,NULL,'',2.00,200.00,'',1.00,100.00,110300.00,10000.00,10,0.00,NULL,NULL,NULL,NULL,110300.00,'pending','10',NULL,NULL,'2012-12-20',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0',NULL,'Process',1,'yes','3','Paid','Created','','0','Urgent',NULL,'Consolidate',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(222,'B001','BG/SO/00008','CostCenter/BG/00008','2012-12-30','58769',NULL,NULL,'2012-12-30',NULL,NULL,NULL,'34','4',NULL,NULL,NULL,NULL,NULL,NULL,NULL,20000.00,NULL,22,NULL,'26',2.00,40.00,'27',1.00,20.00,22060.00,2000.00,10,926.52,NULL,NULL,NULL,NULL,22986.52,'pending','10',NULL,NULL,'2012-12-31',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1',NULL,'Tel',1,'865','3','topay','Created','','0','Urgent',NULL,'Consolidate',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(224,'B001','BG/SO-0224',NULL,'0000-00-00','','','E',NULL,NULL,'000','000','0','',NULL,52,'2012-12-31','','AS','3','',21000.00,2100.00,0,0.00,NULL,NULL,42.00,NULL,NULL,21.00,2163.00,NULL,11,270.38,0.00,0.00,0.00,0,25596.38,'pending','10','2013-01-20',NULL,'0000-00-00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0','','leads',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(226,'B001','BG/SO/00011','CostCenter/BG/00011','2013-01-23','sfd',NULL,NULL,'2013-01-23',NULL,NULL,NULL,'32','3',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1000000.00,NULL,22,NULL,'26',2.00,2000.00,'27',1.00,1000.00,1103000.00,100000.00,11,137875.00,NULL,NULL,NULL,NULL,1240875.00,'pending','10',NULL,NULL,'0000-00-00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0',NULL,'Tel',1,'','1','Paid','Created','sdfdsf','15','Urgent',NULL,'Consolidate',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(227,'B001','BG/SO/00012','CostCenter/BG/00012','2013-01-24','fdgfdgfdgd',NULL,NULL,'2013-01-24',NULL,NULL,NULL,'32','3',NULL,NULL,NULL,NULL,NULL,NULL,NULL,15000.00,NULL,0,NULL,'',0.00,0.00,'',0.00,0.00,0.00,0.00,10,630.00,NULL,NULL,NULL,NULL,15809.00,'pending','10',NULL,NULL,'0000-00-00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0',NULL,'Tel',1,'','1','0','Created','','15','Urgent','10','Consolidate',NULL,10.00,20.00,15.00,4.00,20.00,8.00,100.00,8.00,2.00),(228,'B001','BG/SO/00013','CostCenter/BG/00013','2013-01-26','990088',NULL,NULL,'2013-01-20',NULL,NULL,NULL,'34','3',NULL,NULL,NULL,NULL,NULL,NULL,NULL,17000.00,NULL,0,NULL,'',0.00,0.00,'',0.00,0.00,0.00,0.00,11,2125.00,NULL,NULL,NULL,NULL,20375.00,'pending','10',NULL,NULL,'2013-01-31',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0',NULL,'Tel',1,'5343','1','topay','Created','','15','Urgent',NULL,'Consolidate',NULL,250.00,300.00,100.00,50.00,50.00,0.00,0.00,0.00,0.00),(229,'B001','BG/SO/00014','CostCenter/BG/00014','2013-01-26','35232',NULL,NULL,'2013-01-26',NULL,NULL,NULL,'32','5',NULL,NULL,NULL,NULL,NULL,NULL,NULL,200.00,NULL,0,NULL,'',0.00,0.00,'',0.00,0.00,0.00,0.00,10,8.40,NULL,NULL,NULL,NULL,200.00,'pending','10',NULL,NULL,'0000-00-00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0',NULL,'Tel',1,'','1','0','Created','dsfdsf','0','Urgent','10','Consolidate',NULL,200.00,100.00,200.00,10.00,2.00,8.00,200.00,8.00,4.00);

/*Table structure for table `salesorder_details` */

DROP TABLE IF EXISTS `salesorder_details`;

CREATE TABLE `salesorder_details` (
  `id` int(5) NOT NULL AUTO_INCREMENT,
  `masterId` int(5) DEFAULT NULL,
  `ItemCode` varchar(30) DEFAULT NULL,
  `BillingDesc` varchar(255) DEFAULT NULL,
  `unit` int(11) DEFAULT NULL,
  `Quantity` int(10) DEFAULT NULL,
  `Rate` double(10,2) DEFAULT NULL,
  `pricePer` int(8) DEFAULT '1',
  `Amount` double(10,2) DEFAULT NULL,
  `DiscountType` varchar(5) DEFAULT NULL,
  `Discount` double(10,2) NOT NULL,
  `valAfterDisc` double(10,2) DEFAULT NULL,
  `EDRate` varchar(10) DEFAULT NULL,
  `EDAmt` double(10,2) DEFAULT NULL,
  `reqDate` date DEFAULT NULL,
  `pendingForDispatch` varchar(2) DEFAULT '1',
  `pendingQty` int(10) DEFAULT NULL,
  `Approved_qty` int(11) DEFAULT NULL,
  `ApprovalStatus` varchar(10) DEFAULT NULL,
  `SalesCategory` varchar(10) DEFAULT NULL,
  `del_status` int(2) DEFAULT '0',
  `mrp_unit` double(10,2) DEFAULT NULL,
  `ass_price` double(10,2) DEFAULT NULL,
  `total_ass_price` double(10,2) DEFAULT NULL,
  `remarks` text,
  PRIMARY KEY (`id`,`Discount`),
  KEY `masterId` (`masterId`),
  CONSTRAINT `salesorder_details_ibfk_1` FOREIGN KEY (`masterId`) REFERENCES `salesorder` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=388 DEFAULT CHARSET=latin1;

/*Data for the table `salesorder_details` */

insert  into `salesorder_details`(`id`,`masterId`,`ItemCode`,`BillingDesc`,`unit`,`Quantity`,`Rate`,`pricePer`,`Amount`,`DiscountType`,`Discount`,`valAfterDisc`,`EDRate`,`EDAmt`,`reqDate`,`pendingForDispatch`,`pendingQty`,`Approved_qty`,`ApprovalStatus`,`SalesCategory`,`del_status`,`mrp_unit`,`ass_price`,`total_ass_price`,`remarks`) values (356,214,'1899',NULL,NULL,4,16000.00,1,64000.00,NULL,0.00,NULL,'0',0.00,NULL,'1',NULL,3,'3',NULL,0,0.00,0.00,0.00,''),(357,214,'1902',NULL,NULL,5,550.00,1,2750.00,NULL,0.00,NULL,'0',0.00,NULL,'1',NULL,2,'2',NULL,0,0.00,0.00,0.00,''),(360,216,'12',NULL,NULL,500,12.00,1,6000.00,NULL,0.00,NULL,'0',0.00,NULL,'1',150,250,'Approved','Urgent',0,0.00,0.00,0.00,''),(361,216,'19',NULL,NULL,1500,15.00,1,22500.00,NULL,0.00,NULL,'0',0.00,NULL,'1',100,300,'Approved','Urgent',0,0.00,0.00,0.00,''),(362,217,'26',NULL,NULL,600,15.00,1,9000.00,NULL,0.00,NULL,'0',0.00,NULL,'1',150,250,'Approved','Urgent',0,0.00,0.00,0.00,''),(363,217,'43',NULL,NULL,800,6.00,1,4800.00,NULL,0.00,NULL,'0',0.00,NULL,'1',250,300,'Approved','Urgent',0,0.00,0.00,0.00,''),(366,216,'5',NULL,NULL,50,2.00,1,100.00,NULL,0.00,NULL,'0',0.00,NULL,'1',NULL,20,'2',NULL,0,0.00,0.00,0.00,''),(369,218,'1',NULL,NULL,12,12.00,1,144.00,NULL,0.00,NULL,'22',1.68,NULL,'1',2,12,'Approved','Urgent',0,2.00,1.40,16.80,'No remark'),(370,220,'3',NULL,NULL,500,200.00,1,100000.00,NULL,0.00,NULL,'0',0.00,NULL,'1',NULL,500,'Approved','Urgent',0,0.00,0.00,0.00,''),(371,221,'1903',NULL,NULL,100,1000.00,1,100000.00,NULL,0.00,NULL,'22',10000.00,NULL,'1',0,100,'Approved','Urgent',0,0.00,0.00,0.00,''),(372,222,'1',NULL,NULL,100,200.00,1,20000.00,NULL,0.00,NULL,'0',0.00,NULL,'0',0,100,'Approved','Urgent',0,0.00,0.00,0.00,''),(376,224,'2',NULL,0,500,12.00,1,6000.00,'A',0.00,0.00,NULL,NULL,'2013-01-20','1',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL),(377,224,'6',NULL,0,600,25.00,1,15000.00,'A',0.00,0.00,NULL,NULL,'2013-01-20','1',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL),(379,226,'1',NULL,NULL,1000,1000.00,1,1000000.00,NULL,0.00,NULL,'0',0.00,NULL,'1',NULL,1000,'3','Urgent',0,0.00,0.00,0.00,''),(380,227,'1',NULL,NULL,200,10.00,1,2000.00,NULL,0.00,NULL,'',0.00,NULL,'1',NULL,NULL,'1',NULL,0,0.00,0.00,0.00,''),(381,227,'3',NULL,NULL,500,10.00,1,5000.00,NULL,0.00,NULL,'',0.00,NULL,'1',NULL,NULL,'1',NULL,0,0.00,0.00,0.00,''),(382,227,'1',NULL,NULL,200,20.00,1,4000.00,NULL,0.00,NULL,'',0.00,NULL,'1',NULL,NULL,'Pending',NULL,0,0.00,0.00,0.00,''),(383,227,'3',NULL,NULL,200,20.00,1,4000.00,NULL,0.00,NULL,'',0.00,NULL,'1',NULL,NULL,'',NULL,0,0.00,0.00,0.00,''),(384,228,'1',NULL,NULL,20,100.00,1,2000.00,NULL,0.00,NULL,'',0.00,NULL,'1',NULL,NULL,'1',NULL,0,0.00,0.00,0.00,'11'),(385,228,'2',NULL,NULL,50,200.00,1,10000.00,NULL,0.00,NULL,'',0.00,NULL,'1',NULL,NULL,'1',NULL,0,0.00,0.00,0.00,'22'),(386,228,'3',NULL,NULL,100,50.00,1,5000.00,NULL,0.00,NULL,'',0.00,NULL,'1',NULL,NULL,'1',NULL,0,0.00,0.00,0.00,'33'),(387,229,'1',NULL,NULL,20,10.00,1,200.00,NULL,0.00,NULL,'',0.00,NULL,'1',NULL,17,'2','Urgent',0,0.00,0.00,0.00,'');

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
