-- Table structure for `s_mas`
-- ----------------------------
CREATE TABLE `s_mas` (
  `SDATE` date DEFAULT NULL,
  `STK_NO` varchar(20) DEFAULT NULL,
  `GROUP1` varchar(30) DEFAULT NULL,
  `SUBSTITUTE` varchar(30) DEFAULT NULL,
  `BRAND_NAME` varchar(30) DEFAULT NULL,
  `GEN_NO` varchar(20) DEFAULT NULL,
  `PART_NO` varchar(20) DEFAULT NULL,
  `DESCRIPT` varchar(500) DEFAULT '',
  `LOCATE_1` varchar(20) DEFAULT NULL,
  `LOCATE_2` varchar(20) DEFAULT NULL,
  `LOCATE_3` varchar(20) DEFAULT NULL,
  `LOCATE_4` varchar(20) DEFAULT NULL,
  `CAT` varchar(20) DEFAULT NULL,
  `COST` decimal(15,2) DEFAULT 0.00,
  `MARGIN` decimal(15,2) DEFAULT 0.00,
  `SELLING` decimal(51,2) DEFAULT 0.00,
  `AR_selling` decimal(15,2) DEFAULT 0.00,
  `OPEN_STK` decimal(51,2) DEFAULT 0.00,
  `STKQTY` decimal(15,2) DEFAULT 0.00,
  `QTYINHAND` decimal(15,2) DEFAULT 0.00,
  `QTYINHAND_STORES` decimal(15,2) DEFAULT 0.00,
  `UNIT` decimal(15,2) DEFAULT 0.00,
  `SIZE` varchar(50) DEFAULT '0.00',
  `RE_O_LEVEL` decimal(15,2) DEFAULT 0.00,
  `RE_O_QTY` decimal(15,2) DEFAULT 0.00,
  `SALE01` decimal(15,2) DEFAULT 0.00,
  `SALE02` decimal(15,2) DEFAULT 0.00,
  `SALE03` decimal(15,2) DEFAULT NULL,
  `SALE04` decimal(15,2) DEFAULT 0.00,
  `SALE05` decimal(15,2) DEFAULT 0.00,
  `SALE06` decimal(15,2) DEFAULT 0.00,
  `SALE07` decimal(15,2) DEFAULT 0.00,
  `SALE08` decimal(15,2) DEFAULT 0.00,
  `SALE09` decimal(15,2) DEFAULT 0.00,
  `SALE10` decimal(15,2) DEFAULT 0.00,
  `SALE11` decimal(15,2) DEFAULT 0.00,
  `SALE12` decimal(15,2) DEFAULT 0.00,
  `ENT_DATE` datetime DEFAULT NULL,
  `model` varchar(50) DEFAULT NULL,
  `GROUP2` varchar(20) DEFAULT NULL,
  `GROUP3` varchar(20) DEFAULT NULL,
  `GROUP4` varchar(20) DEFAULT NULL,
  `Account` varchar(20) DEFAULT NULL,
  `costcenter` varchar(20) DEFAULT NULL,
  `acc_cost` varchar(20) DEFAULT '0',
  `cus_ord` varchar(20) DEFAULT NULL,
  `delivered` varchar(20) DEFAULT NULL,
  `type` varchar(100) DEFAULT '',
  `Cat1` varchar(100) DEFAULT '',
  `weight` varchar(20) DEFAULT NULL,
  `country` varchar(20) DEFAULT NULL,
  `spType` char(50) DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL,
  `active_t` float DEFAULT 0,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `active_t1` float DEFAULT 0,
  `disitem` varchar(100) DEFAULT NULL,
  `active` varchar(1) DEFAULT '1',
  `th1` float(20,0) DEFAULT NULL,
  `th2` float(20,0) DEFAULT NULL,
  `th3` float(20,0) DEFAULT NULL,
  `th4` float(20,0) DEFAULT NULL,
  `COST1` float(20,2) DEFAULT 0.00,
  `MAX_DIS` float(20,2) DEFAULT NULL,
  `CR_SELLING` float(20,2) DEFAULT 0.00,
  `CASHDIS` float(20,2) DEFAULT 0.00,
  `CREDITDIS` float(20,2) DEFAULT 0.00,
  `CANCELL` varchar(1) DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `s_mas` (`SDATE`,`STK_NO`) USING BTREE,
  KEY `QTYINHAND` (`QTYINHAND`) USING BTREE,
  KEY `STK_NO` (`STK_NO`) USING BTREE,
  FULLTEXT KEY `STK_NO_2` (`STK_NO`,`BRAND_NAME`)
) ENGINE=InnoDB AUTO_INCREMENT=30752 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of s_mas
-- ----------------------------
INSERT INTO `s_mas` VALUES ('2023-12-20', '100', '', null, 'TEST1', '', 'D', 'TOYOTA SUPRA', '', '', '', '', '', '410.26', '0.00', '1000.00', '0.00', '0.00', '0.00', '76.00', '0.00', '0.00', '195/76', '0.00', '0.00', '0.00', '0.00', null, '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', null, '', '', '', '', null, null, '410.26', '', '', 'PCR', 'TO BE EDIT ITEM', null, '', null, null, '0', '30740', '0', '', '1', null, null, null, null, '410.26', '0.00', '0.00', '0.00', '0.00', '0');
INSERT INTO `s_mas` VALUES ('2023-12-22', 'IT/0734', '', null, 'TEST2', '', '11', 'TEST111', '', '', '', '', 'Stock Item', '0.00', '55.84', '300.00', '300.00', '0.00', '0.00', '40.00', '0.00', '0.00', '11', '0.00', '0.00', '0.00', '0.00', null, '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', null, '', '', '', '', null, null, '0', '', '', 'TBR', 'OTHER', null, '', null, null, '0', '30741', '0', '', '1', null, null, null, null, '135.00', '0.00', '0.00', '0.00', '0.00', '0');
INSERT INTO `s_mas` VALUES ('2023-12-28', 'IT/0735', '', null, 'TEST1', '', 'D', 'TOYOTA SUPRA', '', '', '', '', '', '410.26', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '100/95', '0.00', '0.00', '0.00', '0.00', null, '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', null, '', '', '', '', null, null, '0', '', '', 'PCR', 'TO BE EDIT ITEM', null, '', null, null, '0', '30742', '0', '', '1', null, null, null, null, '0.00', '0.00', '0.00', '0.00', '0.00', '0');
INSERT INTO `s_mas` VALUES ('2023-12-28', 'IT/0736', '', null, 'TEST1', '', 'D', 'TOYOTA SUPRA', '', '', '', '', '', '410.26', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', null, '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', null, '', '', '', '', null, null, '0', '', '', 'PCR', 'TO BE EDIT ITEM', null, '', null, null, '0', '30743', '0', '', '1', null, null, null, null, '0.00', '0.00', '0.00', '0.00', '0.00', '0');
INSERT INTO `s_mas` VALUES ('2023-12-28', 'IT/0737', '', null, 'TEST1', '', 'D', 'TOYOTA SUPRA', '', '', '', '', '', '410.26', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', null, '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', null, '', '', '', '', null, null, '0', '', '', 'PCR', 'TO BE EDIT ITEM', null, '', null, null, '0', '30744', '0', '', '1', null, null, null, null, '0.00', '0.00', '0.00', '0.00', '0.00', '0');
INSERT INTO `s_mas` VALUES ('2023-12-28', 'IT/0738', '', null, 'AMORON', 'PR Rating', 'Pattern', 'AMORON BATTERY', '', '', '', '', 'Stock Item', '20000.00', '-100.00', '0.00', '0.00', '0.00', '0.00', '10.00', '0.00', '0.00', '200/100', '0.00', '0.00', '0.00', '0.00', null, '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', null, '', '', '', '', null, null, '20000', '', '', 'PCR', 'BATTERY', null, '', null, null, '0', '30745', '0', '', '1', null, null, null, null, '20000.00', '0.00', '0.00', '0.00', '0.00', '0');
INSERT INTO `s_mas` VALUES ('2023-12-28', 'IT/0739', '', null, 'DSI', 'PR Rating', 'Pattern', 'DSI TYRE', '', '', '', '', 'Stock Item', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '150/50', '0.00', '0.00', '0.00', '0.00', null, '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', null, '', '', '', '', null, null, '0', '', '', 'PCR', '3-Wheel', null, '', null, null, '0', '30746', '0', '', '1', null, null, null, null, '0.00', '0.00', '0.00', '0.00', '0.00', '0');
INSERT INTO `s_mas` VALUES ('2023-12-28', 'IT/0740', '', null, 'CEAT', 'PR Rating', 'Pattern', 'Description', '', '', '', '', 'Stock Item', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '120/80/18', '0.00', '0.00', '0.00', '0.00', null, '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', null, '', '', '', '', null, null, '0', '', '', 'TBR', 'Motocycle', null, '', null, null, '0', '30747', '0', '', '1', null, null, null, null, '0.00', '0.00', '0.00', '0.00', '0.00', '0');
INSERT INTO `s_mas` VALUES ('2023-12-28', 'IT/0741', '', null, 'EXIDE', 'PR Rating', 'Pattern', 'EXIDE BATTERY', '', '', '', '', 'Stock Item', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '12', '0.00', '0.00', '0.00', '0.00', null, '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', null, '', '', '', '', null, null, '0', '', '', 'LTR', 'BATTERY', null, '', null, null, '0', '30748', '0', '', '1', null, null, null, null, '0.00', '0.00', '0.00', '0.00', '0.00', '0');
INSERT INTO `s_mas` VALUES ('2023-12-28', 'IT/0742', '', null, 'AMORON', 'PR Rating', 'Pattern', 'A', '', '', '', '', 'Stock Item', '200.00', '25.00', '250.00', '250.00', '0.00', '0.00', '40.00', '0.00', '0.00', '100/95', '0.00', '0.00', '0.00', '0.00', null, '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', null, '', '', '', '', null, null, '200', '', '', 'PCR', 'BATTERY', null, '', null, null, '0', '30749', '0', '', '1', null, null, null, null, '200.00', '0.00', '0.00', '0.00', '0.00', '0');
INSERT INTO `s_mas` VALUES ('2023-12-28', 'IT/0743', '', null, 'AMORON', 'PR Rating', 'Pattern', 'B', '', '', '', '', 'Stock Item', '150.00', '33.33', '200.00', '200.00', '0.00', '0.00', '30.00', '0.00', '0.00', '11', '0.00', '0.00', '0.00', '0.00', null, '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', null, '', '', '', '', null, null, '150', '', '', 'PCR', 'BATTERY', null, '', null, null, '0', '30750', '0', '', '1', null, null, null, null, '150.00', '0.00', '0.00', '0.00', '0.00', '0');
INSERT INTO `s_mas` VALUES ('2023-12-28', 'IT/0744', '', null, 'AMORON', 'PR Rating', 'Pattern', 'C', '', '', '', '', 'Stock Item', '100.00', '50.00', '150.00', '150.00', '0.00', '0.00', '20.00', '0.00', '0.00', '200/100', '0.00', '0.00', '0.00', '0.00', null, '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', null, '', '', '', '', null, null, '100', '', '', 'PCR', 'BATTERY', null, '', null, null, '0', '30751', '0', '', '1', null, null, null, null, '100.00', '0.00', '0.00', '0.00', '0.00', '0');

-- ----------------------------
-- Table structure for `s_mas_category`
-- ----------------------------
CREATE TABLE `s_mas_category` (
  `id` int(10) NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of s_mas_category
-- ----------------------------
INSERT INTO `s_mas_category` VALUES ('6', 'NON STOCK');
INSERT INTO `s_mas_category` VALUES ('8', 'OTHER');
INSERT INTO `s_mas_category` VALUES ('13', 'TO BE EDIT ITEM');
INSERT INTO `s_mas_category` VALUES ('18', '3-Wheel');
INSERT INTO `s_mas_category` VALUES ('19', 'Agro');
INSERT INTO `s_mas_category` VALUES ('20', 'BATTERY');
INSERT INTO `s_mas_category` VALUES ('21', 'Industrial');
INSERT INTO `s_mas_category` VALUES ('22', 'Light Truck');
INSERT INTO `s_mas_category` VALUES ('23', 'Light Truck Radial');
INSERT INTO `s_mas_category` VALUES ('24', 'Motocycle');
INSERT INTO `s_mas_category` VALUES ('25', 'Motorcycle');
INSERT INTO `s_mas_category` VALUES ('26', 'OTHER');
INSERT INTO `s_mas_category` VALUES ('27', 'Radial');
INSERT INTO `s_mas_category` VALUES ('28', 'Truck/Bus');
INSERT INTO `s_mas_category` VALUES ('29', 'Truck/Bus Radial ');
INSERT INTO `s_mas_category` VALUES ('30', 'Tube Bike Treeweel');
INSERT INTO `s_mas_category` VALUES ('31', 'Tube Vehical');

-- ----------------------------
-- Table structure for `s_mas_group`
-- ----------------------------
CREATE TABLE `s_mas_group` (
  `id` int(10) NOT NULL,
  `name` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of s_mas_group
-- ----------------------------
INSERT INTO `s_mas_group` VALUES ('1', 'PCR');
INSERT INTO `s_mas_group` VALUES ('2', 'LTR');
INSERT INTO `s_mas_group` VALUES ('3', 'OTR');
INSERT INTO `s_mas_group` VALUES ('4', 'TBR');
INSERT INTO `s_mas_group` VALUES ('5', 'BIAS');
INSERT INTO `s_mas_group` VALUES ('6', 'MC');
INSERT INTO `s_mas_group` VALUES ('7', 'SUV');
INSERT INTO `s_mas_group` VALUES ('8', 'OIL');
INSERT INTO `s_mas_group` VALUES ('9', 'RFT');
INSERT INTO `s_mas_group` VALUES ('10', 'DAG');
INSERT INTO `s_mas_group` VALUES ('11', 'OTHER');
INSERT INTO `s_mas_group` VALUES ('12', 'FLAP');

-- ----------------------------
-- Table structure for `s_ordmas`
-- ----------------------------
CREATE TABLE `s_ordmas` (
  `REFNO` varchar(255) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `COUNTRY` varchar(255) DEFAULT NULL,
  `SUP_CODE` varchar(255) DEFAULT NULL,
  `SUP_NAME` varchar(255) DEFAULT NULL,
  `REMARK` varchar(255) DEFAULT NULL,
  `DEP_CODE` varchar(255) DEFAULT NULL,
  `DEP_NAME` varchar(255) DEFAULT NULL,
  `REP_CODE` varchar(255) DEFAULT NULL,
  `REP_NAME` varchar(255) DEFAULT NULL,
  `AMOUNT` float(20,2) DEFAULT 0.00,
  `cancel` varchar(255) DEFAULT '0',
  `S_date` varchar(255) DEFAULT NULL,
  `LC_No` varchar(255) DEFAULT NULL,
  `Brand` varchar(255) DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL,
  `tax1` varchar(30) DEFAULT NULL,
  `pi_no` varchar(50) DEFAULT NULL,
  `Attn` varchar(50) DEFAULT NULL,
  `invno` varchar(50) DEFAULT NULL,
  `blno` varchar(50) DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `VATRATE` float(20,2) DEFAULT 0.00,
  `VAT_VALUE` float(20,2) DEFAULT 0.00,
  `VAT` varchar(1) DEFAULT '0',
  `TOTQTY` float(20,2) DEFAULT 0.00,
  PRIMARY KEY (`id`),
  KEY `s_ordmas` (`REFNO`,`SDATE`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_ordmas
-- ----------------------------
INSERT INTO `s_ordmas` VALUES ('IS/PO/000242', '2023-11-28', '', 'V/0027', 'SISIRA  TYRE  HOUSE', '111', '04', null, 'R/013', '', '26.00', '2', '', '', 'TEST1', '6585420a38e14', null, '', null, '', 'ww', 'IS', '16', '0.00', '0.00', '1', '6.00');
INSERT INTO `s_ordmas` VALUES ('IS/PO/000242', '2023-11-28', '', 'V/0027', 'SISIRA  TYRE  HOUSE', '1122', '04', null, 'R/013', 'WWW', '26.00', '2', '', '', 'TEST1', '6585420a38e14', null, '', null, '', 'ee', 'IS', '18', '0.00', '0.00', '1', '6.00');
INSERT INTO `s_ordmas` VALUES ('IS/PO/000244', '2023-12-27', 'INDIA', 'V/0027', 'SISIRA  TYRE  HOUSE', '', 'SALES', null, 'R/015', '', '0.00', '0', '', '', 'TEST1', '658bb8aa9cc52', null, '', null, '', '', 'IS', '21', '0.00', '0.00', '0', '0.00');
INSERT INTO `s_ordmas` VALUES ('IS/PO/000243', '2023-12-27', 'INDIA', 'V/0026', 'Sanoon Tyre House', 'test note', '04', null, 'R/013', 'WWW', '30000.00', '0', '', 'LC/TT No', 'TEST2', '658baaac9a9d9', null, 'PI No', null, 'CI No', 'test bl', 'IS', '23', '15.00', '0.00', '1', '100.00');
INSERT INTO `s_ordmas` VALUES ('IS/PO/000245', '2023-12-28', 'UK', 'V/0027', 'SISIRA  TYRE  HOUSE', '', '04', null, 'R/013', '', '5000.00', '2', '', '', 'TEST1', '658d033e546f2', null, 'PI No', null, 'CI No', 'BL No', 'IS', '24', '15.00', '0.00', '0', '100.00');
INSERT INTO `s_ordmas` VALUES ('IS/PO/000246', '2023-12-28', 'UK', 'V/0026', 'Sanoon Tyre House', '', '04', null, 'R/013', 'WWW', '500.00', '2', '', 'LC No A', 'TEST1', '658d2814d39fc', null, 'PI No', null, 'CI No', 'BL No1', 'IS', '26', '15.00', '0.00', '0', '50.00');
INSERT INTO `s_ordmas` VALUES ('IS/PO/000247', '2023-12-28', 'UK', 'V/0026', 'Sanoon Tyre House', 'Remark', '08', null, 'R/016', '', '2000000.00', '0', '', 'LC/TT No', 'DSI', '658d54319f0a8', null, 'PI No', null, 'CI No', 'BL No', 'IS', '27', '15.00', '0.00', '0', '100.00');
INSERT INTO `s_ordmas` VALUES ('IS/PO/000248', '2023-12-28', 'CHINA', 'V/0027', 'SISIRA  TYRE  HOUSE', 'Remark', '04', null, 'R/013', '', '40000.00', '0', '', 'LC/TT No', 'DSI', '658d554d91eee', null, 'PI No', null, 'CI No', 'BL No', 'IS', '28', '15.00', '0.00', '0', '400.00');
INSERT INTO `s_ordmas` VALUES ('IS/PO/000249', '2023-12-28', 'INDIA', 'V/0027', 'SISIRA  TYRE  HOUSE', 'Remark', '05', null, 'R/016', '', '145000.00', '2', '', 'LC/TT No', 'AMORON', '658d57fa341cf', null, 'PI No', null, 'CI No', 'BL No', 'IS', '29', '15.00', '0.00', '0', '900.00');
INSERT INTO `s_ordmas` VALUES ('IS/PO/000250', '2023-12-28', 'INDIA', 'V/0027', 'SISIRA  TYRE  HOUSE', 'Remark', '05', null, 'R/016', '', '145000.00', '0', '', 'LC/TT No', 'AMORON', '658d57fa341cf', null, 'PI No', null, 'CI No', 'BL No', 'IS', '30', '15.00', '0.00', '0', '900.00');
INSERT INTO `s_ordmas` VALUES ('IS/PO/000251', '2024-01-30', 'INDIA', 'V/0027', 'SISIRA  TYRE  HOUSE', '', '04', null, 'R/016', '', '2000000.00', '2', '', '444', 'AMORON', '65b880ebe635f', null, '222', null, '333', '1111', 'IS', '31', '15.00', '0.00', '1', '100.00');

-- ----------------------------
-- Table structure for `s_ordtrn`
-- ----------------------------
CREATE TABLE `s_ordtrn` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `REFNO` varchar(255) DEFAULT NULL,
  `SDATE` varchar(255) DEFAULT NULL,
  `STK_NO` varchar(255) DEFAULT NULL,
  `DESCRIPT` varchar(255) DEFAULT NULL,
  `UNIT` varchar(255) DEFAULT NULL,
  `ORD_QTY` float(255,0) DEFAULT NULL,
  `REC_QTY` float(255,0) DEFAULT 0,
  `RATE` float(20,2) DEFAULT 0.00,
  `partno` varchar(255) DEFAULT NULL,
  `CANCEL` varchar(255) DEFAULT '0',
  `tmp_no` varchar(50) DEFAULT NULL,
  `SUBTOTAL` float(20,2) DEFAULT 0.00,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `s_ordtrn` (`REFNO`,`SDATE`,`STK_NO`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_ordtrn
-- ----------------------------
INSERT INTO `s_ordtrn` VALUES ('6', 'IS/PO/000242', '2023-12-22', 'IT/0734', 'TEST111', null, '2', '100', '3.00', '11', '1', '6585420a38e14', '6.00');
INSERT INTO `s_ordtrn` VALUES ('7', 'IS/PO/000242', '2023-12-22', '100', 'TOYOTA SUPRA', null, '4', '100', '5.00', 'D', '1', '6585420a38e14', '20.00');
INSERT INTO `s_ordtrn` VALUES ('8', 'IS/PO/000242', '2023-11-28', '100', 'TOYOTA SUPRA', null, '4', '100', '5.00', 'D', '1', '6585420a38e14', '20.00');
INSERT INTO `s_ordtrn` VALUES ('9', 'IS/PO/000242', '2023-11-28', 'IT/0734', 'TEST111', null, '2', '100', '3.00', '11', '1', '6585420a38e14', '6.00');
INSERT INTO `s_ordtrn` VALUES ('13', 'IS/PO/000243', '2023-12-27', 'IT/0734', 'TEST111', null, '100', '100', '300.00', '11', '0', '658baaac9a9d9', '30000.00');
INSERT INTO `s_ordtrn` VALUES ('14', 'IS/PO/000245', '2023-12-28', '100', 'TOYOTA SUPRA', null, '100', '80', '50.00', 'D', '1', '658d033e546f2', '5000.00');
INSERT INTO `s_ordtrn` VALUES ('16', 'IS/PO/000246', '2023-12-28', '100', 'TOYOTA SUPRA', null, '50', '20', '10.00', 'D', '1', '658d2814d39fc', '500.00');
INSERT INTO `s_ordtrn` VALUES ('17', 'IS/PO/000247', '2023-12-28', 'IT/0739', 'DSI TYRE', null, '100', '0', '20000.00', 'Pattern', '0', '658d54319f0a8', '2000000.00');
INSERT INTO `s_ordtrn` VALUES ('18', 'IS/PO/000248', '2023-12-28', 'IT/0738', 'AMORON BATTERY', null, '400', '0', '100.00', 'Pattern', '0', '658d554d91eee', '40000.00');
INSERT INTO `s_ordtrn` VALUES ('19', 'IS/PO/000249', '2023-12-28', 'IT/0744', 'C', null, '200', '-10', '100.00', 'Pattern', '1', '658d57fa341cf', '20000.00');
INSERT INTO `s_ordtrn` VALUES ('20', 'IS/PO/000249', '2023-12-28', 'IT/0743', 'B', null, '300', '-10', '150.00', 'Pattern', '1', '658d57fa341cf', '45000.00');
INSERT INTO `s_ordtrn` VALUES ('21', 'IS/PO/000249', '2023-12-28', 'IT/0742', 'A', null, '400', '-10', '200.00', 'Pattern', '1', '658d57fa341cf', '80000.00');
INSERT INTO `s_ordtrn` VALUES ('22', 'IS/PO/000250', '2023-12-28', 'IT/0742', 'A', null, '400', '0', '200.00', 'Pattern', '0', '658d57fa341cf', '80000.00');
INSERT INTO `s_ordtrn` VALUES ('23', 'IS/PO/000250', '2023-12-28', 'IT/0743', 'B', null, '300', '0', '150.00', 'Pattern', '0', '658d57fa341cf', '45000.00');
INSERT INTO `s_ordtrn` VALUES ('24', 'IS/PO/000250', '2023-12-28', 'IT/0744', 'C', null, '200', '0', '100.00', 'Pattern', '0', '658d57fa341cf', '20000.00');
INSERT INTO `s_ordtrn` VALUES ('25', 'IS/PO/000251', '2024-01-30', 'IT/0738', 'AMORON BATTERY', null, '100', '10', '20000.00', 'Pattern', '1', '65b880ebe635f', '2000000.00');

-- ----------------------------
-- Table structure for `s_paycard_type`
-- ----------------------------
CREATE TABLE `s_paycard_type` (
  `ID` int(20) NOT NULL,
  `REFNO` varchar(20) NOT NULL,
  `NAME` varchar(100) DEFAULT NULL,
  `CANCELL` varchar(1) DEFAULT '0',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of s_paycard_type
-- ----------------------------
INSERT INTO `s_paycard_type` VALUES ('1', 'VISA', 'VISA', '0');
INSERT INTO `s_paycard_type` VALUES ('2', 'MASTER', 'MASTER', '0');
INSERT INTO `s_paycard_type` VALUES ('3', 'AMEX', 'AMEX', '0');
INSERT INTO `s_paycard_type` VALUES ('4', 'OTHER', 'OTHER', '0');

-- ----------------------------
-- Table structure for `s_paytype`
-- ----------------------------
CREATE TABLE `s_paytype` (
  `ID` int(20) NOT NULL,
  `REFNO` varchar(100) DEFAULT NULL,
  `NAME` varchar(200) DEFAULT NULL,
  `CANCELL` varchar(1) DEFAULT '0',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of s_paytype
-- ----------------------------
INSERT INTO `s_paytype` VALUES ('1', 'CREDIT', 'CREDIT', '0');
INSERT INTO `s_paytype` VALUES ('3', 'CASH', 'CASH', '1');
INSERT INTO `s_paytype` VALUES ('5', 'CARD', 'CARD', '1');
INSERT INTO `s_paytype` VALUES ('6', 'CHEQUE', 'CHEQUE', '1');
INSERT INTO `s_paytype` VALUES ('7', 'GIFT CARD', 'GIFT CARD', '1');
INSERT INTO `s_paytype` VALUES ('8', 'BANK DEPOSIT', 'BANK DEPOSIT', '1');
INSERT INTO `s_paytype` VALUES ('9', 'ONLINE PAYMENT', 'ONLINE PAYMENT', '1');

-- ----------------------------
-- Table structure for `s_purmas`
-- ----------------------------
CREATE TABLE `s_purmas` (
  `REFNO` varchar(30) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `ORDNO` varchar(30) DEFAULT NULL,
  `LCNO` varchar(50) DEFAULT NULL,
  `COUNTRY` varchar(30) DEFAULT NULL,
  `SUP_CODE` varchar(30) DEFAULT NULL,
  `SUP_NAME` varchar(100) DEFAULT NULL,
  `REMARK` varchar(100) DEFAULT NULL,
  `DEPARTMENT` varchar(30) DEFAULT NULL,
  `AMOUNT` float(20,2) DEFAULT 0.00,
  `CANCEL` varchar(1) DEFAULT '0',
  `PUR_DATE` varchar(20) DEFAULT NULL,
  `brand` varchar(20) DEFAULT NULL,
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `TYPE` varchar(10) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `pi_no` varchar(50) DEFAULT NULL,
  `book_no` varchar(50) DEFAULT NULL,
  `invno` varchar(50) DEFAULT NULL,
  `blno` varchar(50) DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  `indate` date DEFAULT NULL,
  `total_dis` float(20,2) DEFAULT 0.00,
  `sub_value` float(20,2) DEFAULT 0.00,
  `VAT` float(20,2) DEFAULT 0.00,
  `VAT_AMOUNT` float(20,2) DEFAULT 0.00,
  `VATRATE` float(20,2) DEFAULT 0.00,
  `TOT_OQTY` float(20,2) DEFAULT 0.00,
  `TOT_RQTY` float(20,2) DEFAULT 0.00,
  `SAL_EX` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `s_purmas` (`REFNO`,`SDATE`,`ORDNO`) USING BTREE,
  KEY `REFNO` (`REFNO`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of s_purmas
-- ----------------------------
INSERT INTO `s_purmas` VALUES ('IS/GRN/000215', '2023-12-28', 'IS/PO/000243', 'LC/TT No', 'INDIA', 'V/0026', 'Sanoon Tyre House', '', '04', '25000.00', '1', '2023-12-28', 'TEST2', '1', 'Local', null, 'PI No', '', 'CI No', 'test bl', 'IS', '2023-12-28', '0.00', '25000.00', '0.00', '0.00', '0.00', '0.00', '0.00', null);
INSERT INTO `s_purmas` VALUES ('IS/GRN/000216', '2023-12-28', 'IS/PO/000242', '', '', 'V/0027', 'SISIRA  TYRE  HOUSE', '', '04', '13500.00', '0', '2023-12-28', 'TEST1', '3', 'Local', null, '', '', '', 'ww', 'IS', '2023-12-28', '1500.00', '15000.00', '1.00', '10.00', '15.00', '0.00', '0.00', null);
INSERT INTO `s_purmas` VALUES ('IS/GRN/000217', '2023-12-28', 'IS/PO/000245', '', 'UK', 'V/0027', 'SISIRA  TYRE  HOUSE', '', '04', '40000.00', '0', '2023-12-28', 'TEST1', '4', 'Local', '658d245d448cd', 'PI No', '', 'CI No', 'BL No', 'IS', '2023-12-28', '0.00', '40000.00', '0.00', '0.00', '15.00', '100.00', '80.00', null);
INSERT INTO `s_purmas` VALUES ('IS/GRN/000218', '2023-12-28', 'IS/PO/000246', 'LC No A', 'UK', 'V/0026', 'Sanoon Tyre House', '', '04', '4000.00', '1', '2023-12-28', 'TEST1', '5', 'Local', '658d2867c1f71', 'PI No', '', 'CI No', 'BL No1', 'IS', '2023-12-28', '0.00', '4000.00', '0.00', '0.00', '15.00', '50.00', '40.00', 'R/013');
INSERT INTO `s_purmas` VALUES ('IS/GRN/000219', '2023-12-28', 'IS/PO/000246', 'LC No A', 'UK', 'V/0026', 'Sanoon Tyre House', '', '04', '1026.00', '0', '2023-12-28', 'TEST1', '6', 'Local', '658d48493fbeb', 'PI No', '', 'CI No', 'BL No1', 'IS', '2023-12-28', '174.00', '1200.00', '0.00', '0.00', '15.00', '50.00', '20.00', 'R/013');
INSERT INTO `s_purmas` VALUES ('IS/GRN/000220', '2023-12-28', 'IS/PO/000249', 'LC/TT No', 'INDIA', 'V/0027', 'SISIRA  TYRE  HOUSE', 'Remark', '05', '14500.00', '0', '2023-12-28', 'AMORON', '7', 'Import', '658d5991df0c4', 'PI No', 'Container Size', 'CI No', 'BL No', 'IS', '2023-12-29', '0.00', '14500.00', '0.00', '0.00', '15.00', '900.00', '90.00', 'R/016');
INSERT INTO `s_purmas` VALUES ('IS/GRN/000221', '2024-02-07', 'IS/PO/000251', '444', 'INDIA', 'V/0027', 'SISIRA  TYRE  HOUSE', '', '04', '200000.00', '0', '2024-02-07', 'AMORON', '8', 'Local', '65c3483321ff7', '222', '', '333', '1111', 'IS', '2024-02-07', '0.00', '200000.00', '1.00', '0.00', '15.00', '100.00', '10.00', 'R/016');

-- ----------------------------
-- Table structure for `s_purmas_stores`
-- ----------------------------
CREATE TABLE `s_purmas_stores` (
  `REFNO` varchar(30) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `ORDNO` varchar(30) DEFAULT NULL,
  `LCNO` varchar(50) DEFAULT NULL,
  `COUNTRY` varchar(50) DEFAULT NULL,
  `SUP_CODE` varchar(30) DEFAULT NULL,
  `SUP_NAME` varchar(100) DEFAULT NULL,
  `REMARK` varchar(150) DEFAULT NULL,
  `DEPARTMENT` varchar(50) DEFAULT NULL,
  `AMOUNT` varchar(20) DEFAULT NULL,
  `CANCEL` varchar(5) DEFAULT '0',
  `PUR_DATE` varchar(20) DEFAULT NULL,
  `brand` varchar(20) DEFAULT NULL,
  `id` bigint(20) NOT NULL,
  `TYPE` varchar(255) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `pi_no` varchar(50) DEFAULT NULL,
  `book_no` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `s_purmas` (`REFNO`,`SDATE`,`ORDNO`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of s_purmas_stores
-- ----------------------------

-- ----------------------------
-- Table structure for `s_purrmas`
-- ----------------------------
CREATE TABLE `s_purrmas` (
  `REFNO` varchar(30) DEFAULT NULL,
  `SDATE` varchar(20) DEFAULT NULL,
  `ORDNO` varchar(20) DEFAULT NULL,
  `GRNNO` varchar(20) DEFAULT NULL,
  `COUNTRY` varchar(30) DEFAULT NULL,
  `SUP_CODE` varchar(30) DEFAULT NULL,
  `SUP_NAME` varchar(100) DEFAULT NULL,
  `REMARK` varchar(150) DEFAULT NULL,
  `DEPARTMENT` varchar(30) DEFAULT NULL,
  `AMOUNT` varchar(20) DEFAULT NULL,
  `CANCEL` varchar(5) DEFAULT '0',
  `LC_NO` varchar(20) DEFAULT NULL,
  `id` int(11) NOT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `s_purrmas` (`REFNO`,`SDATE`,`ORDNO`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_purrmas
-- ----------------------------

-- ----------------------------
-- Table structure for `s_purrmas_stores`
-- ----------------------------
CREATE TABLE `s_purrmas_stores` (
  `REFNO` varchar(30) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `ORDNO` varchar(30) DEFAULT NULL,
  `GRNNO` varchar(30) DEFAULT NULL,
  `COUNTRY` varchar(50) DEFAULT NULL,
  `SUP_CODE` varchar(30) DEFAULT NULL,
  `SUP_NAME` varchar(100) DEFAULT NULL,
  `REMARK` varchar(150) DEFAULT NULL,
  `DEPARTMENT` varchar(30) DEFAULT NULL,
  `AMOUNT` varchar(20) DEFAULT NULL,
  `CANCEL` varchar(5) DEFAULT '0',
  `LC_NO` varchar(50) DEFAULT NULL,
  `id` int(11) NOT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `s_purrmas` (`REFNO`,`SDATE`,`ORDNO`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_purrmas_stores
-- ----------------------------

-- ----------------------------
-- Table structure for `s_purrtrn`
-- ----------------------------
CREATE TABLE `s_purrtrn` (
  `REFNO` varchar(30) DEFAULT NULL,
  `sDATE` date DEFAULT NULL,
  `STK_NO` varchar(30) DEFAULT NULL,
  `DESCRIPT` varchar(50) DEFAULT NULL,
  `COST` decimal(20,5) DEFAULT 0.00000,
  `MARGIN` decimal(20,5) DEFAULT 0.00000,
  `SELLING` decimal(20,5) DEFAULT 0.00000,
  `REC_QTY` decimal(20,5) DEFAULT 0.00000,
  `FOB` decimal(20,0) DEFAULT 0,
  `DEPARTMENT` varchar(150) DEFAULT NULL,
  `QTYINHAND` decimal(20,2) DEFAULT 0.00,
  `O_QTY` decimal(20,2) DEFAULT 0.00,
  `DISCOUNT` decimal(20,2) DEFAULT 0.00,
  `ret_qty` decimal(20,2) DEFAULT 0.00,
  `Cost_c` decimal(20,2) DEFAULT 0.00,
  `cost_seling` decimal(20,2) DEFAULT 0.00,
  `cost_margin` decimal(20,2) DEFAULT 0.00,
  `acc_COST` decimal(20,2) DEFAULT 0.00,
  `acc_COST_c` decimal(20,2) DEFAULT 0.00,
  `vatrate` decimal(20,2) DEFAULT 0.00,
  `tmp_no` varchar(30) DEFAULT NULL,
  KEY `s_purrtrn` (`REFNO`,`sDATE`,`STK_NO`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_purrtrn
-- ----------------------------

-- ----------------------------
-- Table structure for `s_purrtrn_stores`
-- ----------------------------
CREATE TABLE `s_purrtrn_stores` (
  `REFNO` varchar(30) DEFAULT NULL,
  `sDATE` date DEFAULT NULL,
  `STK_NO` varchar(30) DEFAULT NULL,
  `DESCRIPT` varchar(50) DEFAULT NULL,
  `COST` decimal(20,5) DEFAULT 0.00000,
  `MARGIN` decimal(20,5) DEFAULT 0.00000,
  `SELLING` decimal(20,5) DEFAULT 0.00000,
  `REC_QTY` decimal(20,5) DEFAULT 0.00000,
  `FOB` decimal(20,0) DEFAULT 0,
  `DEPARTMENT` varchar(150) DEFAULT NULL,
  `QTYINHAND` decimal(20,2) DEFAULT 0.00,
  `O_QTY` decimal(20,2) DEFAULT 0.00,
  `DISCOUNT` decimal(20,2) DEFAULT 0.00,
  `ret_qty` decimal(20,2) DEFAULT 0.00,
  `Cost_c` decimal(20,2) DEFAULT 0.00,
  `cost_seling` decimal(20,2) DEFAULT 0.00,
  `cost_margin` decimal(20,2) DEFAULT 0.00,
  `acc_COST` decimal(20,2) DEFAULT 0.00,
  `acc_COST_c` decimal(20,2) DEFAULT 0.00,
  `vatrate` decimal(20,2) DEFAULT 0.00,
  `tmp_no` varchar(30) DEFAULT NULL,
  KEY `s_purrtrn` (`REFNO`,`sDATE`,`STK_NO`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_purrtrn_stores
-- ----------------------------

-- ----------------------------
-- Table structure for `s_purtrn`
-- ----------------------------
CREATE TABLE `s_purtrn` (
  `REFNO` varchar(30) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `STK_NO` varchar(30) DEFAULT NULL,
  `DESCRIPT` varchar(100) DEFAULT '',
  `COST` decimal(20,2) DEFAULT 0.00,
  `MARGIN` decimal(20,2) DEFAULT 0.00,
  `SELLING` decimal(20,2) DEFAULT 0.00,
  `REC_QTY` decimal(20,2) DEFAULT 0.00,
  `FOB` varchar(50) DEFAULT NULL,
  `DEPARTMENT` varchar(50) DEFAULT NULL,
  `QTYINHAND` decimal(10,2) DEFAULT 0.00,
  `O_QTY` decimal(10,2) DEFAULT 0.00,
  `DISCOUNT` decimal(10,2) DEFAULT 0.00,
  `ret_qty` decimal(10,2) DEFAULT 0.00,
  `Cost_c` decimal(10,2) DEFAULT 0.00,
  `cost_seling` decimal(10,2) DEFAULT 0.00,
  `cost_margin` decimal(10,2) DEFAULT 0.00,
  `CANCEL` varchar(5) DEFAULT '0',
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `acc_cost` float(20,2) DEFAULT 0.00,
  `acc_cost_c` float(20,2) DEFAULT 0.00,
  `soldqty` varchar(10) DEFAULT NULL,
  `brand` varchar(10) DEFAULT NULL,
  `days` int(11) DEFAULT NULL,
  `vatrate` decimal(10,2) DEFAULT 0.00,
  `tmp_no` varchar(30) DEFAULT NULL,
  `dis1` float(20,2) DEFAULT 0.00,
  `dis2` float(20,2) DEFAULT 0.00,
  `rec_cost` float(20,2) DEFAULT 0.00,
  `subtotal` float(20,2) DEFAULT 0.00,
  `TAX_VAL` float(20,2) DEFAULT 0.00,
  `COMPANY` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`ID`) USING BTREE,
  KEY `s_purtrn` (`REFNO`,`SDATE`,`STK_NO`) USING BTREE,
  KEY `STK_NO` (`STK_NO`,`CANCEL`) USING BTREE,
  KEY `REFNO` (`REFNO`) USING BTREE,
  KEY `REFNO_2` (`REFNO`,`STK_NO`) USING BTREE,
  KEY `SDATE` (`SDATE`,`STK_NO`) USING BTREE,
  KEY `SDATE_2` (`SDATE`,`STK_NO`,`CANCEL`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of s_purtrn
-- ----------------------------
INSERT INTO `s_purtrn` VALUES ('IS/GRN/000215', '2023-12-28', 'IT/0734', 'TEST111', '250.00', '250.00', '300.00', '100.00', null, '04', '0.00', '100.00', '0.00', '0.00', '0.00', '0.00', '0.00', '1', '1', '250.00', '0.00', '', 'TEST2', '0', '15.00', null, '0.00', '0.00', '250.00', '25000.00', '100.00', null);
INSERT INTO `s_purtrn` VALUES ('IS/GRN/000216', '2023-12-28', 'IT/0734', 'TEST111', '135.00', '135.00', '300.00', '100.00', null, '04', '100.00', '2.00', '0.00', '0.00', '250.00', '0.00', '0.00', '0', '2', '135.00', '250.00', '', 'TEST1', '0', '15.00', null, '10.00', '0.00', '150.00', '13500.00', '100.00', null);
INSERT INTO `s_purtrn` VALUES ('IS/GRN/000217', '2023-12-28', '100', 'TOYOTA SUPRA', '500.00', '500.00', '0.00', '80.00', null, '04', '0.00', '100.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0', '3', '500.00', '0.00', '', 'TEST1', '0', '15.00', null, '0.00', '0.00', '500.00', '40000.00', '100.00', null);
INSERT INTO `s_purtrn` VALUES ('IS/GRN/000218', '2023-12-28', '100', 'TOYOTA SUPRA', '100.00', '100.00', '0.00', '40.00', null, '04', '80.00', '50.00', '0.00', '0.00', '500.00', '0.00', '0.00', '1', '4', '100.00', '500.00', '', 'TEST1', '0', '15.00', null, '0.00', '0.00', '100.00', '4000.00', '100.00', null);
INSERT INTO `s_purtrn` VALUES ('IS/GRN/000219', '2023-12-28', '100', 'TOYOTA SUPRA', '51.30', '51.30', '65.00', '20.00', null, '04', '80.00', '50.00', '0.00', '0.00', '500.00', '0.00', '0.00', '0', '5', '51.30', '500.00', '', 'TEST1', '0', '15.00', null, '10.00', '0.00', '60.00', '1026.00', '8.00', null);
INSERT INTO `s_purtrn` VALUES ('IS/GRN/000220', '2023-12-28', 'IT/0742', 'A', '200.00', '0.00', '250.00', '40.00', null, '05', '0.00', '400.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0', '6', '200.00', '0.00', '', 'AMORON', '0', '15.00', null, '0.00', '0.00', '200.00', '8000.00', '100.00', null);
INSERT INTO `s_purtrn` VALUES ('IS/GRN/000220', '2023-12-28', 'IT/0743', 'B', '150.00', '0.00', '200.00', '30.00', null, '05', '0.00', '300.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0', '7', '150.00', '0.00', '', 'AMORON', '0', '15.00', null, '0.00', '0.00', '150.00', '4500.00', '100.00', null);
INSERT INTO `s_purtrn` VALUES ('IS/GRN/000220', '2023-12-28', 'IT/0744', 'C', '100.00', '0.00', '150.00', '20.00', null, '05', '0.00', '200.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0', '8', '100.00', '0.00', '', 'AMORON', '0', '15.00', null, '0.00', '0.00', '100.00', '2000.00', '100.00', null);
INSERT INTO `s_purtrn` VALUES ('IS/GRN/000221', '2024-02-07', 'IT/0738', 'AMORON BATTERY', '20000.00', '0.00', '0.00', '10.00', null, '04', '0.00', '100.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0', '9', '20000.00', '0.00', '', 'AMORON', '0', '15.00', null, '0.00', '0.00', '20000.00', '200000.00', '100.00', 'IS');

-- ----------------------------
-- Table structure for `s_purtrn_stores`
-- ----------------------------
CREATE TABLE `s_purtrn_stores` (
  `REFNO` varchar(30) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `STK_NO` varchar(30) DEFAULT NULL,
  `DESCRIPT` varchar(50) DEFAULT NULL,
  `COST` decimal(10,2) DEFAULT 0.00,
  `MARGIN` decimal(10,2) DEFAULT 0.00,
  `SELLING` decimal(10,2) DEFAULT 0.00,
  `REC_QTY` decimal(10,2) DEFAULT 0.00,
  `FOB` varchar(20) DEFAULT NULL,
  `DEPARTMENT` varchar(50) DEFAULT NULL,
  `QTYINHAND` decimal(10,2) DEFAULT 0.00,
  `O_QTY` decimal(10,2) DEFAULT 0.00,
  `DISCOUNT` decimal(10,2) DEFAULT 0.00,
  `ret_qty` decimal(10,2) DEFAULT 0.00,
  `Cost_c` decimal(10,2) DEFAULT 0.00,
  `cost_seling` decimal(10,2) DEFAULT 0.00,
  `cost_margin` decimal(10,2) DEFAULT 0.00,
  `CANCEL` varchar(5) DEFAULT '0',
  `ID` int(11) NOT NULL,
  `acc_cost` varchar(20) DEFAULT NULL,
  `acc_cost_c` varchar(20) DEFAULT NULL,
  `soldqty` varchar(20) DEFAULT NULL,
  `brand` varchar(255) DEFAULT NULL,
  `days` int(11) DEFAULT NULL,
  `vatrate` decimal(10,2) DEFAULT 0.00,
  `tmp_no` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`ID`) USING BTREE,
  KEY `s_purtrn` (`REFNO`,`SDATE`,`STK_NO`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of s_purtrn_stores
-- ----------------------------

-- ----------------------------
-- Table structure for `s_quomas`
-- ----------------------------
CREATE TABLE `s_quomas` (
  `id` int(11) NOT NULL,
  `REF_NO` varchar(15) DEFAULT NULL,
  `TRN_TYPE` varchar(4) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `C_CODE` varchar(20) DEFAULT '',
  `CUS_NAME` varchar(900) DEFAULT NULL,
  `C_ADD1` varchar(100) DEFAULT NULL,
  `TYPE` varchar(3) DEFAULT NULL,
  `SAL_EX` varchar(5) DEFAULT NULL,
  `DISCOU` decimal(15,2) DEFAULT 0.00,
  `AMOUNT` decimal(15,2) DEFAULT 0.00,
  `GST` decimal(15,2) DEFAULT 0.00,
  `GRAND_TOT` decimal(15,2) DEFAULT 0.00,
  `DUMMY_VAL` decimal(15,2) DEFAULT 0.00,
  `DIS` decimal(15,2) DEFAULT 0.00,
  `DIS1` decimal(15,2) DEFAULT 0.00,
  `DIS_RUP` decimal(15,2) DEFAULT 0.00,
  `CASH` decimal(15,2) DEFAULT 0.00,
  `TOTPAY` decimal(15,2) DEFAULT 0.00,
  `ORD_NO` varchar(30) DEFAULT NULL,
  `ORD_DA` date DEFAULT NULL,
  `SETTLED` char(1) DEFAULT NULL,
  `TOTPAY1` decimal(15,2) DEFAULT 0.00,
  `DES_CAT` varchar(10) DEFAULT NULL,
  `DEPARTMENT` varchar(5) DEFAULT NULL,
  `REMARK` varchar(800) DEFAULT NULL,
  `CANCELL` varchar(1) DEFAULT '0',
  `BTT` decimal(15,2) DEFAULT 0.00,
  `VAT` varchar(1) DEFAULT NULL,
  `Brand` varchar(30) DEFAULT NULL,
  `DEV` varchar(1) DEFAULT '0',
  `Account` char(15) DEFAULT NULL,
  `Accname` char(60) DEFAULT NULL,
  `Costcenter` char(2) DEFAULT NULL,
  `RET_AMO` decimal(15,2) DEFAULT 0.00,
  `cre_pe` int(11) DEFAULT NULL,
  `Comm` char(1) DEFAULT NULL,
  `red` char(10) DEFAULT NULL,
  `deli_date` date DEFAULT NULL,
  `seri_no` char(10) DEFAULT NULL,
  `points` decimal(15,2) DEFAULT 0.00,
  `LOCK` char(1) DEFAULT NULL,
  `deliin` decimal(15,2) DEFAULT 0.00,
  `Perform` varchar(900) DEFAULT NULL,
  `Chk1` smallint(6) DEFAULT 0,
  `chk2` smallint(6) DEFAULT 0,
  `chk3` smallint(6) DEFAULT 0,
  `chk4` smallint(6) DEFAULT 0,
  `chk5` smallint(6) DEFAULT 0,
  `chk6` smallint(6) DEFAULT 0,
  `chk7` smallint(6) DEFAULT 0,
  `warranty` char(250) DEFAULT NULL,
  `delivery` char(50) DEFAULT NULL,
  `pay_type` char(150) DEFAULT NULL,
  `validity` char(50) DEFAULT NULL,
  `Country` char(50) DEFAULT NULL,
  `GROUPS` char(50) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `TXTREMARK1` varchar(500) DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  `vat_no` varchar(100) DEFAULT NULL,
  `SVAT` varchar(20) DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `s_quomas` (`REF_NO`,`TRN_TYPE`,`C_CODE`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_quomas
-- ----------------------------

-- ----------------------------
-- Table structure for `s_quomas1`
-- ----------------------------
CREATE TABLE `s_quomas1` (
  `id` int(11) NOT NULL,
  `REF_NO` varchar(15) DEFAULT NULL,
  `TRN_TYPE` varchar(4) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `C_CODE` varchar(5) DEFAULT NULL,
  `CUS_NAME` varchar(900) DEFAULT NULL,
  `C_ADD1` varchar(100) DEFAULT NULL,
  `TYPE` varchar(3) DEFAULT NULL,
  `SAL_EX` varchar(5) DEFAULT NULL,
  `DISCOU` decimal(15,2) DEFAULT 0.00,
  `AMOUNT` decimal(15,2) DEFAULT 0.00,
  `GST` decimal(15,2) DEFAULT 0.00,
  `GRAND_TOT` decimal(15,2) DEFAULT 0.00,
  `DUMMY_VAL` decimal(15,2) DEFAULT 0.00,
  `DIS` decimal(15,2) DEFAULT 0.00,
  `DIS1` decimal(15,2) DEFAULT 0.00,
  `DIS_RUP` decimal(15,2) DEFAULT 0.00,
  `CASH` decimal(15,2) DEFAULT 0.00,
  `TOTPAY` decimal(15,2) DEFAULT 0.00,
  `ORD_NO` varchar(30) DEFAULT '0',
  `ORD_DA` date DEFAULT NULL,
  `SETTLED` char(1) DEFAULT NULL,
  `TOTPAY1` decimal(15,2) DEFAULT 0.00,
  `DES_CAT` varchar(10) DEFAULT NULL,
  `DEPARTMENT` varchar(5) DEFAULT NULL,
  `REMARK` varchar(800) DEFAULT NULL,
  `CANCELL` varchar(1) DEFAULT '0',
  `BTT` decimal(15,2) DEFAULT 0.00,
  `VAT` varchar(1) DEFAULT NULL,
  `Brand` varchar(30) DEFAULT NULL,
  `DEV` varchar(1) DEFAULT '0',
  `Account` char(15) DEFAULT NULL,
  `Accname` char(60) DEFAULT NULL,
  `Costcenter` char(2) DEFAULT NULL,
  `RET_AMO` decimal(15,2) DEFAULT 0.00,
  `cre_pe` int(11) DEFAULT NULL,
  `Comm` char(1) DEFAULT NULL,
  `red` char(10) DEFAULT NULL,
  `deli_date` date DEFAULT NULL,
  `seri_no` char(10) DEFAULT NULL,
  `points` decimal(15,2) DEFAULT 0.00,
  `LOCK` char(1) DEFAULT NULL,
  `deliin` decimal(15,2) DEFAULT 0.00,
  `Perform` varchar(900) DEFAULT NULL,
  `Chk1` smallint(6) DEFAULT 0,
  `chk2` smallint(6) DEFAULT 0,
  `chk3` smallint(6) DEFAULT 0,
  `chk4` smallint(6) DEFAULT 0,
  `chk5` smallint(6) DEFAULT 0,
  `chk6` smallint(6) DEFAULT 0,
  `chk7` smallint(6) DEFAULT 0,
  `warranty` char(250) DEFAULT NULL,
  `delivery` char(50) DEFAULT NULL,
  `pay_type` char(150) DEFAULT NULL,
  `validity` char(50) DEFAULT NULL,
  `Country` char(50) DEFAULT NULL,
  `GROUPS` char(50) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `s_quomas` (`REF_NO`,`TRN_TYPE`,`C_CODE`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_quomas1
-- ----------------------------

-- ----------------------------
-- Table structure for `s_quotrn`
-- ----------------------------
CREATE TABLE `s_quotrn` (
  `id` int(11) NOT NULL,
  `REF_NO` varchar(255) DEFAULT NULL,
  `SDATE` varchar(255) DEFAULT NULL,
  `STK_NO` varchar(255) DEFAULT NULL,
  `DESCRIPT` varchar(255) DEFAULT NULL,
  `UNIT` varchar(255) DEFAULT NULL,
  `PART_NO` varchar(255) DEFAULT NULL,
  `COST` varchar(255) DEFAULT NULL,
  `PRICE` varchar(255) DEFAULT NULL,
  `QTY` varchar(255) DEFAULT NULL,
  `DEPARTMENT` varchar(255) DEFAULT NULL,
  `DIS_per` varchar(255) DEFAULT NULL,
  `DIS_rs` varchar(255) DEFAULT NULL,
  `GROUP` varchar(255) DEFAULT NULL,
  `REP` varchar(255) DEFAULT NULL,
  `TAX_PER` varchar(255) DEFAULT NULL,
  `ret_qty` varchar(255) DEFAULT NULL,
  `BRAND` varchar(255) DEFAULT NULL,
  `DEV` varchar(255) DEFAULT '0',
  `CANCELL` varchar(255) DEFAULT '0',
  `c_code` varchar(255) DEFAULT NULL,
  `seri_no` varchar(255) DEFAULT NULL,
  `vatrate` varchar(255) DEFAULT NULL,
  `VAT` varchar(255) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `s_quotrn` (`REF_NO`,`SDATE`,`STK_NO`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_quotrn
-- ----------------------------

-- ----------------------------
-- Table structure for `s_quotrn1`
-- ----------------------------
CREATE TABLE `s_quotrn1` (
  `id` int(11) NOT NULL,
  `REF_NO` varchar(255) DEFAULT NULL,
  `SDATE` varchar(255) DEFAULT NULL,
  `STK_NO` varchar(255) DEFAULT NULL,
  `DESCRIPT` varchar(255) DEFAULT NULL,
  `UNIT` varchar(255) DEFAULT NULL,
  `PART_NO` varchar(255) DEFAULT NULL,
  `COST` varchar(255) DEFAULT NULL,
  `PRICE` varchar(255) DEFAULT NULL,
  `QTY` varchar(255) DEFAULT NULL,
  `DEPARTMENT` varchar(255) DEFAULT NULL,
  `DIS_per` varchar(255) DEFAULT NULL,
  `DIS_rs` varchar(255) DEFAULT NULL,
  `GROUP` varchar(255) DEFAULT NULL,
  `REP` varchar(255) DEFAULT NULL,
  `TAX_PER` varchar(255) DEFAULT NULL,
  `ret_qty` varchar(255) DEFAULT NULL,
  `BRAND` varchar(255) DEFAULT NULL,
  `DEV` varchar(255) DEFAULT '0',
  `CANCELL` varchar(255) DEFAULT '0',
  `c_code` varchar(255) DEFAULT NULL,
  `seri_no` varchar(255) DEFAULT NULL,
  `vatrate` varchar(255) DEFAULT NULL,
  `VAT` varchar(255) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `s_quotrn` (`REF_NO`,`SDATE`,`STK_NO`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_quotrn1
-- ----------------------------

-- ----------------------------
-- Table structure for `s_repordtrn`
-- ----------------------------
CREATE TABLE `s_repordtrn` (
  `id` int(11) NOT NULL,
  `REFNO` varchar(255) DEFAULT NULL,
  `SDATE` varchar(255) DEFAULT NULL,
  `STK_NO` varchar(255) DEFAULT NULL,
  `DESCRIPT` varchar(255) DEFAULT NULL,
  `UNIT` varchar(255) DEFAULT NULL,
  `ORD_QTY` varchar(255) DEFAULT NULL,
  `REC_QTY` varchar(255) DEFAULT NULL,
  `RATE` varchar(255) DEFAULT NULL,
  `PARTNO` varchar(255) DEFAULT NULL,
  `CANCEL` varchar(255) DEFAULT '0',
  `tmp_no` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_repordtrn
-- ----------------------------

-- ----------------------------
-- Table structure for `s_salma`
-- ----------------------------
CREATE TABLE `s_salma` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `REF_NO` varchar(100) DEFAULT '',
  `TRN_TYPE` varchar(10) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `C_CODE` varchar(20) DEFAULT NULL,
  `CUS_NAME` varchar(200) DEFAULT '',
  `C_ADD1` varchar(100) DEFAULT NULL,
  `TYPE` varchar(10) DEFAULT NULL,
  `SAL_EX` varchar(20) DEFAULT NULL,
  `DISCOU` decimal(20,2) DEFAULT 0.00,
  `AMOUNT` decimal(20,2) DEFAULT 0.00,
  `GST` decimal(20,2) DEFAULT 0.00,
  `GRAND_TOT` decimal(20,2) DEFAULT 0.00,
  `DUMMY_VAL` decimal(20,2) DEFAULT 0.00,
  `DIS` decimal(20,2) DEFAULT 0.00,
  `DIS1` decimal(20,2) DEFAULT 0.00,
  `DIS2` decimal(20,2) DEFAULT 0.00,
  `DIS_RUP` decimal(20,2) DEFAULT 0.00,
  `CASH` decimal(20,2) DEFAULT 0.00,
  `TOTPAY` decimal(20,2) DEFAULT 0.00,
  `ORD_NO` varchar(25) DEFAULT NULL,
  `ORD_DA` varchar(25) DEFAULT NULL,
  `SETTLED` varchar(10) DEFAULT NULL,
  `TOTPAY1` varchar(1) DEFAULT '1',
  `DES_CAT` varchar(20) DEFAULT NULL,
  `DEPARTMENT` varchar(20) DEFAULT NULL,
  `REMARK` varchar(50) DEFAULT NULL,
  `CANCELL` varchar(10) DEFAULT '0',
  `BTT` float(20,2) DEFAULT 0.00,
  `VAT` float(20,2) DEFAULT 0.00,
  `VAT_VAL` decimal(20,2) DEFAULT 0.00,
  `Brand` varchar(20) DEFAULT NULL,
  `DEV` varchar(10) DEFAULT '0',
  `Account` varchar(10) DEFAULT NULL,
  `Accname` varchar(10) DEFAULT NULL,
  `Costcenter` varchar(10) DEFAULT NULL,
  `RET_AMO` decimal(20,2) DEFAULT 0.00,
  `cre_pe` int(11) DEFAULT NULL,
  `Comm` varchar(20) DEFAULT NULL,
  `red` varchar(20) DEFAULT NULL,
  `deli_date` date DEFAULT NULL,
  `seri_no` varchar(20) DEFAULT NULL,
  `points` varchar(20) DEFAULT NULL,
  `LOCK1` varchar(10) DEFAULT NULL,
  `deliin` varchar(10) DEFAULT NULL,
  `SVAT` decimal(8,0) DEFAULT 0,
  `REQ_DATE` date DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `vat_no` varchar(20) DEFAULT NULL,
  `s_vat_no` varchar(20) DEFAULT NULL,
  `veheno` varchar(30) DEFAULT NULL,
  `driver` varchar(30) DEFAULT NULL,
  `loaddate` date DEFAULT NULL,
  `pirnt_serial` varchar(5) DEFAULT '0',
  `userid` varchar(20) DEFAULT NULL,
  `transp` varchar(50) DEFAULT 'NORMAL',
  `c_code1` varchar(20) DEFAULT NULL,
  `deli_name` varchar(50) DEFAULT NULL,
  `deli_add` varchar(100) DEFAULT NULL,
  `maindepartment` varchar(100) DEFAULT NULL,
  `sdate1` date DEFAULT NULL,
  `prob` varchar(50) DEFAULT NULL,
  `transamou` float(20,2) DEFAULT 0.00,
  `trans_thtamou` float(20,2) DEFAULT 0.00,
  `trans_type` varchar(100) DEFAULT NULL,
  `trans_remark` varchar(100) DEFAULT NULL,
  `trans_no` varchar(50) DEFAULT NULL,
  `trans_cancell` varchar(1) DEFAULT '0',
  `transdate` date DEFAULT NULL,
  `note` varchar(500) DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  `jobno` varchar(100) DEFAULT NULL,
  `millage` varchar(100) DEFAULT NULL,
  `type1` varchar(100) DEFAULT NULL,
  `TEL` varchar(100) DEFAULT NULL,
  `labour` varchar(100) DEFAULT NULL,
  `type2` varchar(100) DEFAULT NULL,
  `PAY_TYPE` varchar(100) DEFAULT NULL,
  `INQUIRY_NO` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `s_salma` (`REF_NO`,`SDATE`,`C_CODE`,`SAL_EX`) USING BTREE,
  KEY `REF_NO` (`REF_NO`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of s_salma
-- ----------------------------
INSERT INTO `s_salma` VALUES ('3', 'IS/INV/CB/000003', 'INV', '2024-01-23', 'V/0027', 'SISIRA  TYRE  HOUSE', 'Katupitiya Road, Kosgolla,Kurunagala ', 'CA', 'R/016', '0.00', '16000.00', '0.00', '16000.00', '0.00', '0.00', '0.00', '0.00', '0.00', '16000.00', '16000.00', '', '2024-01-23', '0', '1', 'N', '04', 'IS/INV/CB/000003', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-23', '', '0', '0', '', '0', '2024-01-23', '662', '', '', '', null, null, '0', null, 'NORMAL', 'V/0001', '', '', '', '2024-01-23', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', '', '', null, '353354779', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('4', 'IS/INV/CB/000004', 'INV', '2024-01-23', 'V/0027', 'SISIRA  TYRE  HOUSE', 'Katupitiya Road, Kosgolla,Kurunagala ', 'CA', 'R/016', '0.00', '16000.00', '0.00', '16000.00', '0.00', '0.00', '0.00', '0.00', '0.00', '16000.00', '16000.00', '', '2024-01-23', '0', '1', 'N', '04', 'IS/INV/CB/000004', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-23', '', '0', '0', '', '0', '2024-01-23', '662', '', '', '', null, null, '0', null, 'NORMAL', 'V/0001', '', '', '', '2024-01-23', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', '', '', null, '353354779', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('5', 'IS/INV/CB/000005', 'INV', '2024-01-23', 'V/0027', 'SISIRA  TYRE  HOUSE', 'Katupitiya Road, Kosgolla,Kurunagala ', 'CA', 'R/016', '0.00', '16000.00', '0.00', '16000.00', '0.00', '0.00', '0.00', '0.00', '0.00', '16000.00', '16000.00', '', '2024-01-23', '0', '1', 'N', '04', 'IS/INV/CB/000005', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-23', '', '0', '0', '', '0', '2024-01-23', '662', '', '', '', null, null, '0', null, 'NORMAL', 'V/0001', '', '', '', '2024-01-23', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', '', '', null, '353354779', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('6', 'IS/INV/CB/000006', 'INV', '2024-01-23', 'V/0027', 'SISIRA  TYRE  HOUSE', 'Katupitiya Road, Kosgolla,Kurunagala ', 'CA', 'R/016', '0.00', '16000.00', '0.00', '16000.00', '0.00', '0.00', '0.00', '0.00', '0.00', '16000.00', '16000.00', '', '2024-01-23', '0', '1', 'N', '04', 'IS/INV/CB/000006', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-23', '', '0', '0', '', '0', '2024-01-23', '662', '', '', '', null, null, '0', null, 'NORMAL', 'V/0001', '', '', '', '2024-01-23', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', '', '', null, '353354779', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('7', 'IS/INV/CB/000007', 'INV', '2024-01-23', 'V/0027', 'SISIRA  TYRE  HOUSE', 'Katupitiya Road, Kosgolla,Kurunagala ', 'CA', 'R/016', '0.00', '15000.00', '0.00', '15000.00', '0.00', '0.00', '0.00', '0.00', '0.00', '15000.00', '15000.00', '', '2024-01-23', '0', '1', 'N', '04', 'IS/INV/CB/000007', '1', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-23', '', '0', '0', '', '0', '2024-01-23', '671', '', '', '', null, null, '0', null, 'NORMAL', 'V/0001', '', '', '', '2024-01-23', null, '0.00', '0.00', null, null, null, '0', null, 'REMARK', 'IS', '', '', null, '353354779', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('8', 'IS/INV/CB/000008', 'INV', '2024-01-23', 'V/0001', 'CASH SALE', '', 'CA', 'R/016', '22.20', '199.80', '0.00', '199.80', '0.00', '0.00', '0.00', '0.00', '0.00', '199.80', '199.80', '', '2024-01-23', '0', '1', 'N', '04', 'IS/INV/CB/000008', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-23', '', '0', '0', '', '0', '2024-01-23', '674', '', '', '', null, null, '0', null, 'NORMAL', 'V/0001', '', '', '', '2024-01-23', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', '', '', null, '', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('9', 'IS/INV/CB/000009', 'INV', '2024-01-23', 'V/0001', 'CASH SALE', '', 'CA', 'R/016', '0.00', '2000.00', '0.00', '2000.00', '0.00', '0.00', '0.00', '0.00', '0.00', '2000.00', '2000.00', '', '2024-01-23', '0', '1', 'N', '04', 'IS/INV/CB/000009', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-23', '', '0', '0', '', '0', '2024-01-23', '678', '', '', '', null, null, '0', null, 'NORMAL', 'V/0001', '', '', '', '2024-01-23', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', '', '', null, '', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('10', 'IS/INV/CB/000010', 'INV', '2024-01-23', 'V/0001', 'CASH SALE', '', 'CA', 'R/016', '0.00', '2000.00', '0.00', '2000.00', '0.00', '0.00', '0.00', '0.00', '0.00', '2000.00', '2000.00', '', '2024-01-23', '0', '1', 'N', '04', 'IS/INV/CB/000010', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-23', '', '0', '0', '', '0', '2024-01-23', '681', '', '', '', null, null, '0', null, 'NORMAL', 'V/0001', '', '', '', '2024-01-23', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', '', '', null, '', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('11', 'IS/INV/CB/000011', 'INV', '2024-01-23', 'V/0001', 'CASH SALE', '', 'CA', 'R/016', '0.00', '2000.00', '0.00', '2000.00', '0.00', '0.00', '0.00', '0.00', '0.00', '2000.00', '2000.00', '', '2024-01-23', '0', '1', 'N', '04', 'IS/INV/CB/000011', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-23', '', '0', '0', '', '0', '2024-01-23', '684', '', '', '', null, null, '0', null, 'NORMAL', 'V/0001', '', '', '', '2024-01-23', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', '', '', null, '', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('12', 'IS/INV/CB/000012', 'INV', '2024-01-23', 'V/0001', 'CASH SALE', '', 'CA', 'R/016', '0.00', '2000.00', '0.00', '2000.00', '0.00', '0.00', '0.00', '0.00', '0.00', '2000.00', '2000.00', '', '2024-01-23', '0', '1', 'N', '04', 'IS/INV/CB/000012', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-23', '', '0', '0', '', '0', '2024-01-23', '693', '', '', '', null, null, '0', null, 'NORMAL', 'V/0001', '', '', '', '2024-01-23', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', '', '', null, '', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('13', 'IS/INV/CB/000013', 'INV', '2024-01-23', 'V/0027', 'SISIRA  TYRE  HOUSE', 'Katupitiya Road, Kosgolla,Kurunagala ', 'CA', 'R/016', '1200.00', '10800.00', '0.00', '10800.00', '0.00', '0.00', '0.00', '0.00', '0.00', '10800.00', '10800.00', '', '2024-01-23', '0', '1', 'N', '04', 'IS/INV/CB/000013', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '200133.00', '30', 'N', '0', '2024-01-23', '', '0', '0', '', '0', '2024-01-23', '697', '', '', 'Vehicle no', null, null, '1', null, 'NORMAL', 'V/0001', '', '', '', '2024-01-23', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', 'Job no', 'Mileage', null, '353354779', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('14', 'IS/INV/CB/000014', 'INV', '2024-01-23', 'V/0027', 'SISIRA  TYRE  HOUSE', 'Katupitiya Road, Kosgolla,Kurunagala ', 'CA', 'R/016', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '', '2024-01-23', '0', '1', 'N', '05', 'IS/INV/CB/000014', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-23', '', '0', '0', '', '0', '2024-01-23', '822', '', '', 'Vehicle no', null, null, '1', null, 'NORMAL', 'V/0001', '', '', '', '2024-01-23', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', 'Job no', 'Mileage', null, '353354779', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('15', 'IS/INV/CB/000015', 'INV', '2024-01-23', 'V/0027', 'SISIRA  TYRE  HOUSE', 'Katupitiya Road, Kosgolla,Kurunagala ', 'CA', 'R/016', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '', '2024-01-23', '0', '1', 'N', '05', 'IS/INV/CB/000015', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-23', '', '0', '0', '', '0', '2024-01-23', '822', '', '', 'Vehicle no', null, null, '0', null, 'NORMAL', 'V/0001', '', '', '', '2024-01-23', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', 'Job no', 'Mileage', null, '353354779', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('16', 'IS/INV/CB/000016', 'INV', '2024-01-29', 'V/0001', 'CASH SALE', '', 'CA', 'R/016', '0.00', '300.00', '0.00', '300.00', '0.00', '0.00', '0.00', '0.00', '0.00', '300.00', '300.00', '', '2024-01-29', '0', '1', 'N', '04', 'IS/INV/CB/000016', '1', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-29', '', '0', '0', '', '0', '2024-01-29', '65b74a1ee88d8', '', '', '', null, null, '1', null, 'NORMAL', 'V/0001', '', '', '', '2024-01-29', null, '0.00', '0.00', null, null, null, '0', null, 'SDDSD', 'IS', '', '', null, '', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('17', 'IS/INV/CB/000017', 'INV', '2024-01-30', 'V/0027', 'SISIRA  TYRE  HOUSE', 'Katupitiya Road, Kosgolla,Kurunagala ', 'CA', 'R/016', '1300.00', '23700.00', '0.00', '23700.00', '0.00', '0.00', '0.00', '0.00', '0.00', '23700.00', '23700.00', '', '2024-01-30', '0', '1', 'N', '04', 'IS/INV/CB/000017', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-30', '', '0', '0', '', '0', '2024-01-30', '65b881e4998e0', '', '', 'AAJ_2345', null, null, '1', null, 'NORMAL', 'V/0001', '', '', '', '2024-01-30', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', '', '100', null, '353354779', 'IS/L/005', 'NORMAL', 'CREDIT', '/INQ/000002');
INSERT INTO `s_salma` VALUES ('18', 'IS/INV/CRM/000001', 'INV', '2024-01-31', 'V/0132', 'Name 7', 'maharagama', 'CR', 'R/016', '0.00', '1000.00', '0.00', '1000.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '', '2024-01-31', '0', '1', 'N', '04', 'IS/INV/CRM/000001', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-31', '', '0', '0', '', '0', '2024-01-31', '65ba2c5f26ce7', '', '', '', null, null, '1', null, 'NORMAL', '', '', '', '', '2024-01-31', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', '', '', null, '', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('19', 'IS/INV/CRM/000002', 'INV', '2024-01-31', 'V/0027', 'SISIRA  TYRE  HOUSE', 'Katupitiya Road, Kosgolla,Kurunagala ', 'CR', 'R/016', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '', '2024-01-31', '0', '1', 'N', '04', 'IS/INV/CRM/000002', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-31', '', '0', '0', '', '0', '2024-01-31', '65ba2c779ce7a', '', '', '', null, null, '1', null, 'NORMAL', '', '', '', '', '2024-01-31', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', '', '', null, '353354779', 'IS/L/005', 'NORMAL', 'CREDIT', '');
INSERT INTO `s_salma` VALUES ('20', 'IS/INV/CRM/000003', 'INV', '2024-01-31', 'V/0027', 'SISIRA  TYRE  HOUSE', 'Katupitiya Road, Kosgolla,Kurunagala ', 'CR', 'R/016', '0.00', '2000.00', '0.00', '2000.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '112.00', '', '2024-01-31', '0', '1', 'N', '04', 'IS/INV/CRM/000003', '0', '0.00', '0.00', '0.00', '', '0', 'NOTAUTH', 'OFFICE', '0', '0.00', '30', 'N', '0', '2024-01-31', '', '0', '0', '', '0', '2024-01-31', '65ba2d7059934', '', '', '', null, null, '1', null, 'NORMAL', '', '', '', '', '2024-01-31', null, '0.00', '0.00', null, null, null, '0', null, '', 'IS', '', '', null, '353354779', 'IS/L/005', 'NORMAL', 'CREDIT', '');

-- ----------------------------
-- Table structure for `s_salma_copy`
-- ----------------------------
CREATE TABLE `s_salma_copy` (
  `id` bigint(20) NOT NULL,
  `REF_NO` varchar(100) DEFAULT '',
  `TRN_TYPE` varchar(10) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `C_CODE` varchar(20) DEFAULT NULL,
  `CUS_NAME` varchar(200) DEFAULT '',
  `C_ADD1` varchar(100) DEFAULT NULL,
  `TYPE` varchar(10) DEFAULT NULL,
  `SAL_EX` varchar(20) DEFAULT NULL,
  `DISCOU` decimal(20,2) DEFAULT 0.00,
  `AMOUNT` decimal(20,2) DEFAULT 0.00,
  `GST` decimal(20,2) DEFAULT 0.00,
  `GRAND_TOT` decimal(20,2) DEFAULT 0.00,
  `DUMMY_VAL` decimal(20,2) DEFAULT 0.00,
  `DIS` decimal(20,2) DEFAULT 0.00,
  `DIS1` decimal(20,2) DEFAULT 0.00,
  `DIS2` decimal(20,2) DEFAULT 0.00,
  `DIS_RUP` decimal(20,2) DEFAULT 0.00,
  `CASH` decimal(20,2) DEFAULT 0.00,
  `TOTPAY` decimal(20,2) DEFAULT 0.00,
  `ORD_NO` varchar(25) DEFAULT NULL,
  `ORD_DA` varchar(25) DEFAULT NULL,
  `SETTLED` varchar(10) DEFAULT NULL,
  `TOTPAY1` varchar(1) DEFAULT '1',
  `DES_CAT` varchar(20) DEFAULT NULL,
  `DEPARTMENT` varchar(20) DEFAULT NULL,
  `REMARK` varchar(50) DEFAULT NULL,
  `CANCELL` varchar(10) DEFAULT '0',
  `BTT` float(20,2) DEFAULT 0.00,
  `VAT` float(20,2) DEFAULT 0.00,
  `VAT_VAL` decimal(20,2) DEFAULT 0.00,
  `Brand` varchar(20) DEFAULT NULL,
  `DEV` varchar(10) DEFAULT '0',
  `Account` varchar(10) DEFAULT NULL,
  `Accname` varchar(10) DEFAULT NULL,
  `Costcenter` varchar(10) DEFAULT NULL,
  `RET_AMO` decimal(20,2) DEFAULT 0.00,
  `cre_pe` int(11) DEFAULT NULL,
  `Comm` varchar(20) DEFAULT NULL,
  `red` varchar(20) DEFAULT NULL,
  `deli_date` date DEFAULT NULL,
  `seri_no` varchar(20) DEFAULT NULL,
  `points` varchar(20) DEFAULT NULL,
  `LOCK1` varchar(10) DEFAULT NULL,
  `deliin` varchar(10) DEFAULT NULL,
  `SVAT` decimal(8,0) DEFAULT 0,
  `REQ_DATE` date DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `vat_no` varchar(20) DEFAULT NULL,
  `s_vat_no` varchar(20) DEFAULT NULL,
  `veheno` varchar(30) DEFAULT NULL,
  `driver` varchar(30) DEFAULT NULL,
  `loaddate` date DEFAULT NULL,
  `pirnt_serial` varchar(5) DEFAULT '0',
  `userid` varchar(20) DEFAULT NULL,
  `transp` varchar(50) DEFAULT 'NORMAL',
  `c_code1` varchar(20) DEFAULT NULL,
  `deli_name` varchar(50) DEFAULT NULL,
  `deli_add` varchar(100) DEFAULT NULL,
  `maindepartment` varchar(100) DEFAULT NULL,
  `sdate1` date DEFAULT NULL,
  `prob` varchar(50) DEFAULT NULL,
  `transamou` float(20,2) DEFAULT 0.00,
  `trans_thtamou` float(20,2) DEFAULT 0.00,
  `trans_type` varchar(100) DEFAULT NULL,
  `trans_remark` varchar(100) DEFAULT NULL,
  `trans_no` varchar(50) DEFAULT NULL,
  `trans_cancell` varchar(1) DEFAULT '0',
  `transdate` date DEFAULT NULL,
  `note` varchar(500) DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  `jobno` varchar(100) DEFAULT NULL,
  `millage` varchar(100) DEFAULT NULL,
  `type1` varchar(100) DEFAULT NULL,
  `TEL` varchar(100) DEFAULT NULL,
  `labour` varchar(100) DEFAULT NULL,
  `type2` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `s_salma` (`REF_NO`,`SDATE`,`C_CODE`,`SAL_EX`) USING BTREE,
  KEY `REF_NO` (`REF_NO`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of s_salma_copy
-- ----------------------------

-- ----------------------------
-- Table structure for `s_salrep`
-- ----------------------------
CREATE TABLE `s_salrep` (
  `REPCODE` varchar(11) NOT NULL,
  `Name` varchar(100) DEFAULT NULL,
  `target` varchar(50) DEFAULT NULL,
  `DEL` varchar(50) DEFAULT NULL,
  `ordNo` varchar(50) DEFAULT NULL,
  `cat` varchar(50) DEFAULT NULL,
  `cancel` varchar(5) DEFAULT '0',
  `RGROUP` varchar(50) DEFAULT NULL,
  `DONO` decimal(15,2) DEFAULT 0.00,
  `tmp_no` varchar(30) DEFAULT NULL,
  `RGROUP1` varchar(30) DEFAULT NULL,
  `RGROUP2` varchar(30) DEFAULT NULL,
  `manager` varchar(20) DEFAULT NULL,
  `pactive` varchar(1) DEFAULT '0',
  `SCODE` varchar(100) DEFAULT NULL,
  `ID` int(20) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`ID`),
  KEY `s_salrep` (`REPCODE`,`Name`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of s_salrep
-- ----------------------------
INSERT INTO `s_salrep` VALUES ('16', '333', '', null, null, null, '0', '', '0.00', null, '', '', null, '0', 'I', '18');
INSERT INTO `s_salrep` VALUES ('17', '111', '', null, null, null, '0', '', '0.00', null, '', '', null, '0', 'IRUSHI TYRE HOUSE', '19');
INSERT INTO `s_salrep` VALUES ('R/013', 'WWW', '', null, null, null, '0', 'OFFICE', '0.00', null, '', '', null, '1', 'IRUSHI TYRE HOUSE', '20');
INSERT INTO `s_salrep` VALUES ('R/014', '122', '', null, null, null, '0', '', '0.00', null, '', '', null, '0', 'IRUSHI TYRE HOUSE', '21');
INSERT INTO `s_salrep` VALUES ('R/015', 'Display Name', '', null, null, null, '0', 'OFFICE', '0.00', null, '', '', null, '1', 'IRUSHI TYRE HOUSE', '22');
INSERT INTO `s_salrep` VALUES ('R/016', 'MILAN', '', null, null, null, '0', '', '0.00', null, '', '', null, '1', 'IS', '23');
INSERT INTO `s_salrep` VALUES ('R/017', 'PRAKASH', '100', null, null, null, '0', 'OFFICE', '0.00', null, 'AREA I', 'A', null, '1', 'IS', '24');

-- ----------------------------
-- Table structure for `s_salrep_det`
-- ----------------------------
CREATE TABLE `s_salrep_det` (
  `REPCODE` int(11) NOT NULL,
  `Name` varchar(100) DEFAULT NULL,
  `Address` varchar(100) DEFAULT NULL,
  `Mobile` varchar(100) DEFAULT NULL,
  `Join_Date` date DEFAULT NULL,
  `id` int(11) NOT NULL,
  `remark` varchar(100) DEFAULT NULL,
  `pic` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `REPCODE` (`REPCODE`) USING BTREE,
  KEY `s_salrep` (`REPCODE`,`Name`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_salrep_det
-- ----------------------------

-- ----------------------------
-- Table structure for `s_scratch`
-- ----------------------------
CREATE TABLE `s_scratch` (
  `id` int(11) NOT NULL,
  `Sdate` date DEFAULT NULL,
  `Inv_no` char(20) DEFAULT NULL,
  `Card_no_from` decimal(15,0) DEFAULT 0,
  `Card_no_to` decimal(15,0) DEFAULT 0,
  `Cancel` varchar(1) DEFAULT '0',
  `tmp_no` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_scratch
-- ----------------------------

-- ----------------------------
-- Table structure for `s_stomas`
-- ----------------------------
CREATE TABLE `s_stomas` (
  `CODE` varchar(15) DEFAULT '',
  `DESCRIPTION` varchar(50) DEFAULT NULL,
  `act` char(10) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `cancel` varchar(1) DEFAULT '0',
  `department` varchar(20) DEFAULT NULL,
  `SCODE` varchar(100) DEFAULT NULL,
  `SCOM` varchar(100) DEFAULT NULL,
  `id` int(20) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`),
  KEY `s_stomas` (`CODE`)
) ENGINE=InnoDB AUTO_INCREMENT=3114 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of s_stomas
-- ----------------------------
INSERT INTO `s_stomas` VALUES ('01', 'A', '1', null, '0', null, 'IAS', 'IAS', '1');
INSERT INTO `s_stomas` VALUES ('02', '222', '0', null, '0', null, 'IU', 'IU', '3107');
INSERT INTO `s_stomas` VALUES ('04', 'IT', '1', null, '0', null, 'IS', 'IS', '3109');
INSERT INTO `s_stomas` VALUES ('03', 'RRR', '0', null, '0', null, 'IAW', 'IAW', '3111');
INSERT INTO `s_stomas` VALUES ('05', 'ACCOUNT', '1', null, '0', null, 'IS', 'IS', '3112');
INSERT INTO `s_stomas` VALUES ('08', 'SALES', '1', null, '0', null, 'IS', 'IS', '3113');

-- ----------------------------
-- Table structure for `s_stomas_stores`
-- ----------------------------
CREATE TABLE `s_stomas_stores` (
  `CODE` varchar(5) DEFAULT NULL,
  `DESCRIPTION` varchar(50) DEFAULT NULL,
  `act` char(10) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `cancel` varchar(1) DEFAULT '0',
  KEY `s_stomas` (`CODE`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_stomas_stores
-- ----------------------------

-- ----------------------------
-- Table structure for `s_strginmas`
-- ----------------------------
CREATE TABLE `s_strginmas` (
  `SDATE` date DEFAULT NULL,
  `REF_NO` varchar(20) DEFAULT NULL,
  `TYPE` varchar(6) DEFAULT NULL,
  `DEP_FROM` varchar(5) DEFAULT NULL,
  `DEP_F_NAME` varchar(30) DEFAULT NULL,
  `DEP_TO` varchar(5) DEFAULT NULL,
  `DEP_T_NAME` varchar(30) DEFAULT NULL,
  `DEL_TO` varchar(60) DEFAULT NULL,
  `VEHICLE_N` varchar(12) DEFAULT NULL,
  `DEL_ORDNO` varchar(12) DEFAULT NULL,
  `cancel` varchar(1) DEFAULT '0',
  `AR_NO` char(20) DEFAULT NULL,
  `AR_DATE` date DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL,
  KEY `s_ginmas` (`SDATE`,`REF_NO`) USING BTREE,
  KEY `DEP_TO` (`DEP_TO`,`AR_NO`) USING BTREE,
  KEY `REF_NO` (`REF_NO`,`DEP_TO`) USING BTREE,
  KEY `REF_NO_2` (`REF_NO`,`DEP_TO`,`AR_NO`) USING BTREE,
  KEY `REF_NO_3` (`REF_NO`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of s_strginmas
-- ----------------------------

-- ----------------------------
-- Table structure for `s_sttr`
-- ----------------------------
CREATE TABLE `s_sttr` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `ST_REFNO` varchar(20) DEFAULT NULL,
  `ST_DATE` date DEFAULT NULL,
  `ST_INVONO` varchar(50) DEFAULT '',
  `ST_PAID` decimal(20,2) DEFAULT 0.00,
  `ST_FLAG` varchar(10) DEFAULT NULL,
  `ST_INDATE` date DEFAULT NULL,
  `st_chbank` varchar(50) DEFAULT NULL,
  `st_days` bigint(20) DEFAULT 0,
  `ST_CHNO` varchar(15) DEFAULT NULL,
  `DUE` decimal(15,2) DEFAULT 0.00,
  `SETTLED_NO` bigint(20) DEFAULT 0,
  `DEV` varchar(1) DEFAULT '0',
  `ret_chval` decimal(15,2) DEFAULT 0.00,
  `ret_chset` decimal(15,2) DEFAULT 0.00,
  `st_chedate` date DEFAULT NULL,
  `st_chdate` date DEFAULT NULL,
  `cus_code` char(20) DEFAULT '',
  `ap_days` int(11) DEFAULT 0,
  `comm` char(3) DEFAULT NULL,
  `ap_rem` varchar(100) DEFAULT NULL,
  `del_days` int(11) DEFAULT 0,
  `deliin_days` bigint(20) DEFAULT 0,
  `deliin_amo` decimal(15,2) DEFAULT 0.00,
  `deliin_lock` char(1) DEFAULT '0',
  `department` char(1) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `userid` varchar(50) DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  `PAY_TYPE` varchar(100) DEFAULT NULL,
  `NOTE` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`ID`) USING BTREE,
  KEY `s_sttr` (`ST_REFNO`,`ST_DATE`,`ST_INVONO`,`ST_CHNO`) USING BTREE,
  KEY `ST_INVONO` (`ST_INVONO`) USING BTREE,
  KEY `ST_REFNO` (`ST_REFNO`) USING BTREE,
  KEY `ST_CHNO` (`ST_CHNO`) USING BTREE,
  KEY `ST_REFNO_2` (`ST_REFNO`,`ST_INVONO`,`ST_CHNO`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_sttr
-- ----------------------------
INSERT INTO `s_sttr` VALUES ('3', 'IS/PR/000003', '2024-01-23', 'IS/INV/CB/000003', '16000.00', 'CAS', null, '', '0', '', '0.00', '0', '0', '0.00', '0.00', null, '2024-01-23', 'V/0027', '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', '', null);
INSERT INTO `s_sttr` VALUES ('4', 'IS/PR/000004', '2024-01-23', 'IS/INV/CB/000004', '16000.00', 'CAS', null, '', '0', '', '0.00', '0', '0', '0.00', '0.00', null, '2024-01-23', 'V/0027', '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', '', null);
INSERT INTO `s_sttr` VALUES ('5', 'IS/PR/000005', '2024-01-23', 'IS/INV/CB/000005', '16000.00', 'CAS', null, '', '0', '', '0.00', '0', '0', '0.00', '0.00', null, '2024-01-23', 'V/0027', '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', '', null);
INSERT INTO `s_sttr` VALUES ('6', 'IS/PR/000006', '2024-01-23', 'IS/INV/CB/000006', '16000.00', 'CAS', null, '', '0', '', '0.00', '0', '0', '0.00', '0.00', null, '2024-01-23', 'V/0027', '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', '', null);
INSERT INTO `s_sttr` VALUES ('7', 'IS/PR/000007', '2024-01-23', 'IS/INV/CB/000007', '15000.00', 'CAS', null, '', '0', '', '0.00', '0', '0', '0.00', '0.00', null, '2024-01-23', 'V/0027', '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', '', null);
INSERT INTO `s_sttr` VALUES ('8', 'IS/PR/000008', '2024-01-23', 'IS/INV/CB/000008', '199.80', 'CAS', null, '', '0', '', '0.00', '0', '0', '0.00', '0.00', null, '2024-01-23', 'V/0001', '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', '', null);
INSERT INTO `s_sttr` VALUES ('9', 'IS/PR/000009', '2024-01-23', 'IS/INV/CB/000009', '2000.00', 'CAS', null, '', '0', '', '0.00', '0', '0', '0.00', '0.00', null, '2024-01-23', 'V/0001', '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', '', null);
INSERT INTO `s_sttr` VALUES ('10', 'IS/PR/000010', '2024-01-23', 'IS/INV/CB/000010', '2000.00', 'CAS', null, '', '0', '', '0.00', '0', '0', '0.00', '0.00', null, '2024-01-23', 'V/0001', '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', '', null);
INSERT INTO `s_sttr` VALUES ('11', 'IS/PR/000011', '2024-01-23', 'IS/INV/CB/000011', '2000.00', 'CAS', null, '', '0', '', '0.00', '0', '0', '0.00', '0.00', null, '2024-01-23', 'V/0001', '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', '', null);
INSERT INTO `s_sttr` VALUES ('12', 'IS/PR/000012', '2024-01-23', 'IS/INV/CB/000012', '2000.00', 'CAS', null, '', '0', '', '0.00', '0', '0', '0.00', '0.00', null, '2024-01-23', 'V/0001', '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', '', null);
INSERT INTO `s_sttr` VALUES ('13', 'IS/PR/000013', '2024-01-23', 'IS/INV/CB/000013', '10800.00', 'CAS', null, '', '0', '', '0.00', '0', '0', '0.00', '0.00', null, '2024-01-23', 'V/0027', '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', '', null);
INSERT INTO `s_sttr` VALUES ('14', 'IS/PR/000014', '2024-01-23', 'IS/INV/CB/000014', '0.00', 'CAS', null, '', '0', '', '0.00', '0', '0', '0.00', '0.00', null, '2024-01-23', 'V/0027', '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', '', null);
INSERT INTO `s_sttr` VALUES ('15', 'IS/PR/000015', '2024-01-23', 'IS/INV/CB/000015', '0.00', 'CAS', null, '', '0', '', '0.00', '0', '0', '0.00', '0.00', null, '2024-01-23', 'V/0027', '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', '', null);
INSERT INTO `s_sttr` VALUES ('16', 'IS/PR/000016', '2024-01-29', 'IS/INV/CB/000016', '300.00', 'CAS', null, '', '0', '', '0.00', '0', '0', '0.00', '0.00', null, '2024-01-29', 'V/0001', '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', '', null);
INSERT INTO `s_sttr` VALUES ('17', 'IS/PR/000017', '2024-01-30', 'IS/INV/CB/000017', '23700.00', 'CAS', null, '', '0', '', '0.00', '0', '0', '0.00', '0.00', null, '2024-01-30', 'V/0027', '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', '', null);
INSERT INTO `s_sttr` VALUES ('18', '', '2024-02-08', 'IS/INV/CRM/000003', '12.00', 'UT', null, null, '8', 'IS/CRN/000004', '0.00', '0', '0', '0.00', '0.00', null, null, '', '8', null, null, '0', '0', '0.00', '0', 'O', null, null, 'IS', null, null);
INSERT INTO `s_sttr` VALUES ('19', 'IS/CUTI/0000004', '2024-02-09', 'IS/INV/CRM/000003', '100.00', 'UT', null, null, '9', 'IS/CRN/000002', '0.00', '0', '0', '0.00', '0.00', null, null, '', '9', null, null, '0', '0', '0.00', '0', 'O', '65c63cd9eb054', null, 'IS', null, null);

-- ----------------------------
-- Table structure for `s_sttr_all`
-- ----------------------------
CREATE TABLE `s_sttr_all` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `ST_REFNO` varchar(20) DEFAULT NULL,
  `ST_DATE` date DEFAULT NULL,
  `ST_INVONO` varchar(50) DEFAULT '',
  `ST_PAID` decimal(20,2) DEFAULT 0.00,
  `balance` decimal(20,2) DEFAULT NULL,
  `netamount` decimal(20,2) DEFAULT NULL,
  `ST_FLAG` varchar(10) DEFAULT NULL,
  `ST_INDATE` date DEFAULT NULL,
  `st_chbank` varchar(50) DEFAULT NULL,
  `st_days` bigint(20) DEFAULT 0,
  `ST_CHNO` varchar(15) DEFAULT NULL,
  `DUE` decimal(15,2) DEFAULT 0.00,
  `SETTLED_NO` bigint(20) DEFAULT 0,
  `DEV` varchar(1) DEFAULT '0',
  `ret_chval` decimal(15,2) DEFAULT 0.00,
  `ret_chset` decimal(15,2) DEFAULT 0.00,
  `st_chedate` date DEFAULT NULL,
  `st_chdate` date DEFAULT NULL,
  `cus_code` char(20) DEFAULT '',
  `cusname` varchar(100) DEFAULT NULL,
  `sal_ex` varchar(50) DEFAULT NULL,
  `ap_days` int(11) DEFAULT 0,
  `comm` char(3) DEFAULT NULL,
  `ap_rem` varchar(100) DEFAULT NULL,
  `del_days` int(11) DEFAULT 0,
  `deliin_days` bigint(20) DEFAULT 0,
  `deliin_amo` decimal(15,2) DEFAULT 0.00,
  `deliin_lock` char(1) DEFAULT '0',
  `department` char(1) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `userid` varchar(20) DEFAULT NULL,
  `form_type` varchar(20) DEFAULT NULL,
  `trn_type` varchar(20) DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`ID`) USING BTREE,
  KEY `s_sttr` (`ST_REFNO`,`ST_DATE`,`ST_INVONO`,`ST_CHNO`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_sttr_all
-- ----------------------------
INSERT INTO `s_sttr_all` VALUES ('4', 'IS/GRN/000216', '2023-12-28', 'IS/GRN/000216', '13500.00', '13500.00', '-13500.00', null, null, null, '0', null, '0.00', '0', '0', '0.00', '0.00', null, null, 'V/0027', 'SISIRA  TYRE  HOUSE', null, '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'ARN', 'OVER', null);
INSERT INTO `s_sttr_all` VALUES ('6', 'IS/GRN/000217', '2023-12-28', 'IS/GRN/000217', '40000.00', '40000.00', '-40000.00', null, null, null, '0', null, '0.00', '0', '0', '0.00', '0.00', null, null, 'V/0027', 'SISIRA  TYRE  HOUSE', null, '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'ARN', 'OVER', null);
INSERT INTO `s_sttr_all` VALUES ('8', 'IS/GRN/000219', '2023-12-28', 'IS/GRN/000219', '1026.00', '1026.00', '-1026.00', null, null, null, '0', null, '0.00', '0', '0', '0.00', '0.00', null, null, 'V/0026', 'Sanoon Tyre House', null, '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'ARN', 'OVER', null);
INSERT INTO `s_sttr_all` VALUES ('9', 'IS/GRN/000220', '2023-12-28', 'IS/GRN/000220', '14500.00', '14500.00', '-14500.00', null, null, null, '0', null, '0.00', '0', '0', '0.00', '0.00', null, null, 'V/0027', 'SISIRA  TYRE  HOUSE', null, '0', null, null, '0', '0', '0.00', '0', 'O', null, null, 'ARN', 'OVER', null);
INSERT INTO `s_sttr_all` VALUES ('12', 'IS/GRN/000001', '2024-01-26', 'IS/GRN/000001', '10800.00', '10800.00', '-10800.00', null, null, null, '0', null, '0.00', '0', '0', '0.00', '0.00', null, null, 'V/0027', 'SISIRA  TYRE  HOUSE', 'R/016', '0', null, null, '0', '0', '0.00', '0', '0', null, null, 'GRN', 'OVER', null);
INSERT INTO `s_sttr_all` VALUES ('15', 'IS/GRN/000002', '2024-01-26', 'IS/GRN/000002', '10800.00', '10800.00', '-10800.00', null, null, null, '0', null, '0.00', '0', '0', '0.00', '0.00', null, null, 'V/0027', 'SISIRA  TYRE  HOUSE', 'R/016', '0', null, null, '0', '0', '0.00', '0', '0', null, null, 'GRN', 'OVER', null);
INSERT INTO `s_sttr_all` VALUES ('16', 'IS/GRN/000003', '2024-01-29', 'IS/GRN/000003', '2000.00', '2000.00', '-2000.00', null, null, null, '0', null, '0.00', '0', '0', '0.00', '0.00', null, null, 'V/0001', 'CASH SALE', 'R/016', '0', null, null, '0', '0', '0.00', '0', '0', '65b785c12815a', null, 'GRN', 'OVER', null);
INSERT INTO `s_sttr_all` VALUES ('17', 'IS/GRN/000004', '2024-01-29', 'IS/GRN/000004', '9000.00', '9000.00', '-9000.00', null, null, null, '0', null, '0.00', '0', '0', '0.00', '0.00', null, null, 'V/0027', 'SISIRA  TYRE  HOUSE', 'R/016', '0', null, null, '0', '0', '0.00', '0', '0', '65b7bcd75faa4', null, 'GRN', 'OVER', null);
INSERT INTO `s_sttr_all` VALUES ('18', 'IS/GRN/000005', '2024-01-29', 'IS/GRN/000005', '4500.00', '4500.00', '-4500.00', null, null, null, '0', null, '0.00', '0', '0', '0.00', '0.00', null, null, 'V/0027', 'SISIRA  TYRE  HOUSE', 'R/016', '0', null, null, '0', '0', '0.00', '0', '0', '65b7bf5315615', null, 'GRN', 'OVER', null);
INSERT INTO `s_sttr_all` VALUES ('19', 'IS/GRN/000006', '2024-01-29', 'IS/GRN/000006', '1800.00', '1800.00', '-1800.00', null, null, null, '0', null, '0.00', '0', '0', '0.00', '0.00', null, null, 'V/0027', 'SISIRA  TYRE  HOUSE', 'R/016', '0', null, null, '0', '0', '0.00', '0', '0', '65b7c77c36941', null, 'GRN', 'OVER', null);
INSERT INTO `s_sttr_all` VALUES ('20', 'IS/GRN/000007', '2024-01-29', 'IS/GRN/000007', '900.00', '900.00', '-900.00', null, null, null, '0', null, '0.00', '0', '0', '0.00', '0.00', null, null, 'V/0027', 'SISIRA  TYRE  HOUSE', 'R/016', '0', null, null, '0', '0', '0.00', '0', '0', '65b7c7f9dfbe1', null, 'GRN', 'OVER', null);
INSERT INTO `s_sttr_all` VALUES ('21', 'IS/GRN/000008', '2024-01-29', 'IS/GRN/000008', '2000.00', '2000.00', '-2000.00', null, null, null, '0', null, '0.00', '0', '0', '0.00', '0.00', null, null, 'V/0001', 'CASH SALE', 'R/016', '0', null, null, '0', '0', '0.00', '0', '0', '65b7df789816b', null, 'GRN', 'OVER', null);
INSERT INTO `s_sttr_all` VALUES ('22', 'IS/GRN/000009', '2024-01-29', 'IS/GRN/000009', '3600.00', '3600.00', '-3600.00', null, null, null, '0', null, '0.00', '0', '0', '0.00', '0.00', null, null, 'V/0027', 'SISIRA  TYRE  HOUSE', 'R/016', '0', null, null, '0', '0', '0.00', '0', '0', '65b7e125dd638', null, 'GRN', 'OVER', null);
INSERT INTO `s_sttr_all` VALUES ('23', 'IS/GRN/000221', '2024-02-07', 'IS/GRN/000221', '200000.00', '200000.00', '-200000.00', null, null, null, '0', null, '0.00', '0', '0', '0.00', '0.00', null, null, 'V/0027', 'SISIRA  TYRE  HOUSE', null, '0', null, null, '0', '0', '0.00', '0', 'O', '65c3483321ff7', null, 'ARN', 'OVER', null);

-- ----------------------------
-- Table structure for `s_submas`
-- ----------------------------
CREATE TABLE `s_submas` (
  `STO_CODE` varchar(5) DEFAULT NULL,
  `STK_NO` varchar(20) DEFAULT '',
  `DESCRIPt` varchar(100) DEFAULT '',
  `OPEN_STK` decimal(20,2) DEFAULT 0.00,
  `OPENT_DATE` datetime DEFAULT NULL,
  `QTYINHAND` double(20,2) DEFAULT 0.00,
  `tmp_no` varchar(30) DEFAULT NULL,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `CANCELL` varchar(1) DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `s_submas` (`STO_CODE`,`STK_NO`) USING BTREE,
  KEY `STK_NO` (`STK_NO`) USING BTREE,
  KEY `QTYINHAND` (`QTYINHAND`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=274973 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of s_submas
-- ----------------------------
INSERT INTO `s_submas` VALUES ('01', '100', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274901', '1');
INSERT INTO `s_submas` VALUES ('02', '100', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274902', '1');
INSERT INTO `s_submas` VALUES ('04', '100', 'TOYOTA SUPRA', '0.00', null, '67.00', null, '274903', '1');
INSERT INTO `s_submas` VALUES ('03', '100', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274904', '1');
INSERT INTO `s_submas` VALUES ('05', '100', 'TOYOTA SUPRA', '0.00', null, '9.00', null, '274905', '1');
INSERT INTO `s_submas` VALUES ('01', 'IT/0734', 'TEST111', '0.00', null, '0.00', null, '274906', '0');
INSERT INTO `s_submas` VALUES ('02', 'IT/0734', 'TEST111', '0.00', null, '0.00', null, '274907', '0');
INSERT INTO `s_submas` VALUES ('04', 'IT/0734', 'TEST111', '0.00', null, '40.00', null, '274908', '0');
INSERT INTO `s_submas` VALUES ('03', 'IT/0734', 'TEST111', '0.00', null, '0.00', null, '274909', '0');
INSERT INTO `s_submas` VALUES ('05', 'IT/0734', 'TEST111', '0.00', null, '0.00', null, '274910', '0');
INSERT INTO `s_submas` VALUES ('01', 'IT/0735', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274911', '0');
INSERT INTO `s_submas` VALUES ('02', 'IT/0735', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274912', '0');
INSERT INTO `s_submas` VALUES ('04', 'IT/0735', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274913', '0');
INSERT INTO `s_submas` VALUES ('03', 'IT/0735', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274914', '0');
INSERT INTO `s_submas` VALUES ('05', 'IT/0735', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274915', '0');
INSERT INTO `s_submas` VALUES ('08', 'IT/0735', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274916', '0');
INSERT INTO `s_submas` VALUES ('01', 'IT/0736', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274917', '0');
INSERT INTO `s_submas` VALUES ('02', 'IT/0736', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274918', '0');
INSERT INTO `s_submas` VALUES ('04', 'IT/0736', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274919', '0');
INSERT INTO `s_submas` VALUES ('03', 'IT/0736', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274920', '0');
INSERT INTO `s_submas` VALUES ('05', 'IT/0736', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274921', '0');
INSERT INTO `s_submas` VALUES ('08', 'IT/0736', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274922', '0');
INSERT INTO `s_submas` VALUES ('01', 'IT/0737', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274923', '0');
INSERT INTO `s_submas` VALUES ('02', 'IT/0737', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274924', '0');
INSERT INTO `s_submas` VALUES ('04', 'IT/0737', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274925', '0');
INSERT INTO `s_submas` VALUES ('03', 'IT/0737', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274926', '0');
INSERT INTO `s_submas` VALUES ('05', 'IT/0737', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274927', '0');
INSERT INTO `s_submas` VALUES ('08', 'IT/0737', 'TOYOTA SUPRA', '0.00', null, '0.00', null, '274928', '0');
INSERT INTO `s_submas` VALUES ('08', '100', 'TOYOTA SUPRA', '0.00', null, '3.00', null, '274929', '0');
INSERT INTO `s_submas` VALUES ('01', 'IT/0738', 'AMORON BATTERY', '0.00', null, '0.00', null, '274930', '0');
INSERT INTO `s_submas` VALUES ('02', 'IT/0738', 'AMORON BATTERY', '0.00', null, '0.00', null, '274931', '0');
INSERT INTO `s_submas` VALUES ('04', 'IT/0738', 'AMORON BATTERY', '0.00', null, '10.00', null, '274932', '0');
INSERT INTO `s_submas` VALUES ('03', 'IT/0738', 'AMORON BATTERY', '0.00', null, '0.00', null, '274933', '0');
INSERT INTO `s_submas` VALUES ('05', 'IT/0738', 'AMORON BATTERY', '0.00', null, '0.00', null, '274934', '0');
INSERT INTO `s_submas` VALUES ('08', 'IT/0738', 'AMORON BATTERY', '0.00', null, '0.00', null, '274935', '0');
INSERT INTO `s_submas` VALUES ('01', 'IT/0739', 'DSI TYRE', '0.00', null, '0.00', null, '274936', '0');
INSERT INTO `s_submas` VALUES ('02', 'IT/0739', 'DSI TYRE', '0.00', null, '0.00', null, '274937', '0');
INSERT INTO `s_submas` VALUES ('04', 'IT/0739', 'DSI TYRE', '0.00', null, '0.00', null, '274938', '0');
INSERT INTO `s_submas` VALUES ('03', 'IT/0739', 'DSI TYRE', '0.00', null, '0.00', null, '274939', '0');
INSERT INTO `s_submas` VALUES ('05', 'IT/0739', 'DSI TYRE', '0.00', null, '0.00', null, '274940', '0');
INSERT INTO `s_submas` VALUES ('08', 'IT/0739', 'DSI TYRE', '0.00', null, '0.00', null, '274941', '0');
INSERT INTO `s_submas` VALUES ('01', 'IT/0740', 'Description', '0.00', null, '0.00', null, '274942', '0');
INSERT INTO `s_submas` VALUES ('02', 'IT/0740', 'Description', '0.00', null, '0.00', null, '274943', '0');
INSERT INTO `s_submas` VALUES ('04', 'IT/0740', 'Description', '0.00', null, '0.00', null, '274944', '0');
INSERT INTO `s_submas` VALUES ('03', 'IT/0740', 'Description', '0.00', null, '0.00', null, '274945', '0');
INSERT INTO `s_submas` VALUES ('05', 'IT/0740', 'Description', '0.00', null, '0.00', null, '274946', '0');
INSERT INTO `s_submas` VALUES ('08', 'IT/0740', 'Description', '0.00', null, '0.00', null, '274947', '0');
INSERT INTO `s_submas` VALUES ('01', 'IT/0741', 'EXIDE BATTERY', '0.00', null, '0.00', null, '274948', '0');
INSERT INTO `s_submas` VALUES ('02', 'IT/0741', 'EXIDE BATTERY', '0.00', null, '0.00', null, '274949', '0');
INSERT INTO `s_submas` VALUES ('04', 'IT/0741', 'EXIDE BATTERY', '0.00', null, '0.00', null, '274950', '0');
INSERT INTO `s_submas` VALUES ('03', 'IT/0741', 'EXIDE BATTERY', '0.00', null, '0.00', null, '274951', '0');
INSERT INTO `s_submas` VALUES ('05', 'IT/0741', 'EXIDE BATTERY', '0.00', null, '0.00', null, '274952', '0');
INSERT INTO `s_submas` VALUES ('08', 'IT/0741', 'EXIDE BATTERY', '0.00', null, '0.00', null, '274953', '0');
INSERT INTO `s_submas` VALUES ('01', 'IT/0742', 'A', '0.00', null, '0.00', null, '274954', '0');
INSERT INTO `s_submas` VALUES ('02', 'IT/0742', 'A', '0.00', null, '0.00', null, '274955', '0');
INSERT INTO `s_submas` VALUES ('04', 'IT/0742', 'A', '0.00', null, '-30.00', null, '274956', '0');
INSERT INTO `s_submas` VALUES ('03', 'IT/0742', 'A', '0.00', null, '0.00', null, '274957', '0');
INSERT INTO `s_submas` VALUES ('05', 'IT/0742', 'A', '0.00', null, '40.00', null, '274958', '0');
INSERT INTO `s_submas` VALUES ('08', 'IT/0742', 'A', '0.00', null, '30.00', null, '274959', '0');
INSERT INTO `s_submas` VALUES ('01', 'IT/0743', 'B', '0.00', null, '0.00', null, '274960', '0');
INSERT INTO `s_submas` VALUES ('02', 'IT/0743', 'B', '0.00', null, '0.00', null, '274961', '0');
INSERT INTO `s_submas` VALUES ('04', 'IT/0743', 'B', '0.00', null, '-10.00', null, '274962', '0');
INSERT INTO `s_submas` VALUES ('03', 'IT/0743', 'B', '0.00', null, '0.00', null, '274963', '0');
INSERT INTO `s_submas` VALUES ('05', 'IT/0743', 'B', '0.00', null, '30.00', null, '274964', '0');
INSERT INTO `s_submas` VALUES ('08', 'IT/0743', 'B', '0.00', null, '10.00', null, '274965', '0');
INSERT INTO `s_submas` VALUES ('01', 'IT/0744', 'C', '0.00', null, '0.00', null, '274966', '0');
INSERT INTO `s_submas` VALUES ('02', 'IT/0744', 'C', '0.00', null, '0.00', null, '274967', '0');
INSERT INTO `s_submas` VALUES ('04', 'IT/0744', 'C', '0.00', null, '0.00', null, '274968', '0');
INSERT INTO `s_submas` VALUES ('03', 'IT/0744', 'C', '0.00', null, '0.00', null, '274969', '0');
INSERT INTO `s_submas` VALUES ('05', 'IT/0744', 'C', '0.00', null, '20.00', null, '274970', '0');
INSERT INTO `s_submas` VALUES ('08', 'IT/0744', 'C', '0.00', null, '0.00', null, '274971', '0');
INSERT INTO `s_submas` VALUES ('', '100', 'TOYOTA SUPRA', '0.00', null, '-3.00', null, '274972', '0');

-- ----------------------------
-- Table structure for `s_submas_ad`
-- ----------------------------
CREATE TABLE `s_submas_ad` (
  `STO_CODE` varchar(5) DEFAULT NULL,
  `STK_NO` varchar(5) DEFAULT NULL,
  `DESCRIPt` varchar(55) DEFAULT NULL,
  `OPEN_STK` decimal(20,2) DEFAULT 0.00,
  `OPENT_DATE` datetime DEFAULT NULL,
  `QTYINHAND` double(20,2) DEFAULT 0.00,
  `tmp_no` varchar(30) DEFAULT NULL,
  KEY `s_submas` (`STO_CODE`,`STK_NO`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_submas_ad
-- ----------------------------

-- ----------------------------
-- Table structure for `s_submas_stores`
-- ----------------------------
CREATE TABLE `s_submas_stores` (
  `STO_CODE` varchar(5) DEFAULT NULL,
  `STK_NO` varchar(5) DEFAULT NULL,
  `DESCRIPt` varchar(55) DEFAULT NULL,
  `OPEN_STK` decimal(20,2) DEFAULT 0.00,
  `OPENT_DATE` datetime DEFAULT NULL,
  `QTYINHAND` double(20,2) DEFAULT 0.00,
  `tmp_no` varchar(30) DEFAULT NULL,
  KEY `s_submas` (`STO_CODE`,`STK_NO`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of s_submas_stores
-- ----------------------------

-- ----------------------------
-- Table structure for `s_tripmas`
-- ----------------------------
CREATE TABLE `s_tripmas` (
  `TRIPNO` varchar(255) DEFAULT NULL,
  `TRIPDATEFROM` varchar(255) DEFAULT NULL,
  `TRIPDATEFTO` varchar(255) DEFAULT NULL,
  `DRIVER` varchar(255) DEFAULT NULL,
  `HELPER` varchar(255) DEFAULT NULL,
  `REMARK` varchar(255) DEFAULT NULL,
  `ID` int(11) NOT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_tripmas
-- ----------------------------

-- ----------------------------
-- Table structure for `s_trn`
-- ----------------------------
CREATE TABLE `s_trn` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `SDATE` date DEFAULT NULL,
  `STK_NO` varchar(50) DEFAULT NULL,
  `REFNO` varchar(50) DEFAULT NULL,
  `QTY` decimal(15,2) DEFAULT 0.00,
  `LEDINDI` varchar(50) DEFAULT NULL,
  `DEPARTMENT` varchar(50) DEFAULT NULL,
  `seri_no` varchar(50) DEFAULT NULL,
  `Dev` varchar(50) DEFAULT '0',
  `SAL_EX` varchar(50) DEFAULT NULL,
  `ACTIVE` varchar(10) DEFAULT NULL,
  `DONO` char(20) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `tru_qty` float DEFAULT NULL,
  `sdate1` date DEFAULT NULL,
  `COST` float(20,2) DEFAULT 0.00,
  `SERIALNO` varchar(100) DEFAULT NULL,
  `SELLING` float(20,2) DEFAULT 0.00,
  `JOBNO` varchar(100) DEFAULT NULL,
  `TYPE` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`ID`) USING BTREE,
  KEY `STK_NO_2` (`STK_NO`,`DEPARTMENT`) USING BTREE,
  KEY `STK_NO_3` (`STK_NO`,`REFNO`,`DEPARTMENT`) USING BTREE,
  KEY `SDATE` (`SDATE`,`STK_NO`,`LEDINDI`) USING BTREE,
  KEY `ID` (`ID`,`STK_NO`,`LEDINDI`) USING BTREE,
  KEY `STK_NO` (`STK_NO`) USING BTREE,
  KEY `REFNO` (`REFNO`,`LEDINDI`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of s_trn
-- ----------------------------
INSERT INTO `s_trn` VALUES ('17', '2024-01-02', '100', 'IS/ST/0000139', '4.00', 'GINI', '04', '', '0', '', '1', '', null, null, null, '0.00', null, '0.00', null, null);
INSERT INTO `s_trn` VALUES ('18', '2024-01-02', '100', 'IS/ST/0000140', '3.00', 'GINI', '04', '', '0', '', '1', '', null, null, null, '0.00', null, '0.00', null, null);
INSERT INTO `s_trn` VALUES ('19', '2024-01-02', '100', 'IS/ST/0000140', '3.00', 'GINR', '05', '', '0', '', '1', '', null, null, null, '0.00', null, '0.00', null, null);
INSERT INTO `s_trn` VALUES ('20', '2024-01-02', '100', 'IS/ST/0000141', '3.00', 'GINI', '04', '', '0', '', '1', '', null, null, null, '0.00', null, '0.00', null, null);
INSERT INTO `s_trn` VALUES ('21', '2024-01-02', '100', 'IS/ST/0000141', '3.00', 'GINR', '08', '', '0', '', '1', '', null, null, null, '0.00', null, '0.00', null, null);
INSERT INTO `s_trn` VALUES ('27', '2024-01-23', 'IT/0734', 'IS/INV/CB/000003', '50.00', 'INV', '04', '', '0', '', '1', 'INV', null, null, '2024-01-23', '0.00', '', '300.00', null, null);
INSERT INTO `s_trn` VALUES ('28', '2024-01-23', '100', 'IS/INV/CB/000003', '10.00', 'INV', '04', '', '0', '', '1', 'INV', null, null, '2024-01-23', '410.26', '', '100.00', null, null);
INSERT INTO `s_trn` VALUES ('30', '2024-01-23', 'IT/0727', 'IS/INV/CB/000008', '1.00', 'INV', '04', '', '0', '', '1', 'INV', null, null, '2024-01-23', '2000.00', '2', '199.80', '22', 'DAGINV');
INSERT INTO `s_trn` VALUES ('31', '2024-01-23', 'IT/0727', 'IS/INV/CB/000009', '1.00', 'INV', '04', '', '0', '', '1', 'INV', null, null, '2024-01-23', '2000.00', '2', '2000.00', '22', 'DAGINV');
INSERT INTO `s_trn` VALUES ('32', '2024-01-23', 'IT/0727', 'IS/INV/CB/000010', '1.00', 'INV', '04', '', '0', '', '1', 'INV', null, null, '2024-01-23', '2000.00', '2', '2000.00', '22', 'DAGINV');
INSERT INTO `s_trn` VALUES ('33', '2024-01-23', 'IT/0727', 'IS/INV/CB/000011', '1.00', 'INV', '04', '', '0', '', '1', 'INV', null, null, '2024-01-23', '2000.00', '2', '2000.00', '22', 'DAGINV');
INSERT INTO `s_trn` VALUES ('34', '2024-01-23', 'IT/0727', 'IS/INV/CB/000012', '1.00', 'INV', '04', '', '0', '', '1', 'INV', null, null, '2024-01-23', '2000.00', '2', '2000.00', '22', 'DAGINV');
INSERT INTO `s_trn` VALUES ('35', '2024-01-23', '100', 'IS/INV/CB/000013', '10.00', 'INV', '04', '', '0', '', '1', 'INV', null, null, '2024-01-23', '410.26', '', '900.00', null, null);
INSERT INTO `s_trn` VALUES ('36', '2024-01-23', 'IT/0727', 'IS/INV/CB/000013', '1.00', 'INV', '04', '', '0', '', '1', 'INV', null, null, '2024-01-23', '2000.00', '2', '1800.00', '22', 'DAGINV');
INSERT INTO `s_trn` VALUES ('41', '2024-01-26', '100', 'IS/GRN/000002', '4.00', 'GRN', '04', '', '0', null, null, null, null, null, null, '0.00', null, '0.00', null, null);
INSERT INTO `s_trn` VALUES ('42', '2024-01-26', 'IT/0727', 'IS/GRN/000002', '2.00', 'GRN', '04', '', '0', null, null, null, null, null, null, '0.00', null, '0.00', null, null);
INSERT INTO `s_trn` VALUES ('45', '2024-01-29', '100', 'IS/GRN/000004', '10.00', 'GRN', '04', '', '0', null, null, null, null, null, null, '0.00', null, '0.00', null, null);
INSERT INTO `s_trn` VALUES ('47', '2024-01-29', '100', 'IS/GRN/000006', '2.00', 'GRN', '04', '', '0', null, null, null, null, null, null, '0.00', null, '0.00', null, null);
INSERT INTO `s_trn` VALUES ('48', '2024-01-29', '100', 'IS/GRN/000007', '1.00', 'GRN', '04', '', '0', null, null, null, null, null, null, '0.00', null, '0.00', null, null);
INSERT INTO `s_trn` VALUES ('50', '2024-01-29', '100', 'IS/GRN/000009', '2.00', 'GRN', '04', '', '0', null, null, null, null, null, null, '0.00', null, '0.00', null, null);
INSERT INTO `s_trn` VALUES ('51', '2024-01-29', 'IT/0727', 'IS/GRN/000009', '1.00', 'GRN', '04', '', '0', null, null, null, null, null, null, '0.00', null, '0.00', null, null);
INSERT INTO `s_trn` VALUES ('52', '2024-01-30', 'IT/0734', 'IS/INV/CB/000017', '10.00', 'INV', '04', '', '0', 'R/016', '1', 'INV', null, null, '2024-01-30', '0.00', '11111', '270.00', null, null);
INSERT INTO `s_trn` VALUES ('53', '2024-01-30', '100', 'IS/INV/CB/000017', '20.00', 'INV', '04', '', '0', 'R/016', '1', 'INV', null, null, '2024-01-30', '410.26', '2222', '950.00', null, null);
INSERT INTO `s_trn` VALUES ('54', '2024-01-30', 'IT/0727', 'IS/INV/CB/000017', '1.00', 'INV', '04', '', '0', '', '1', 'INV', null, null, '2024-01-30', '2000.00', '2', '2000.00', '22', 'DAGINV');
INSERT INTO `s_trn` VALUES ('55', '2024-01-31', '100', 'IS/INV/CRM/000001', '1.00', 'INV', '04', '', '0', 'R/016', '1', 'INV', null, null, '2024-01-31', '410.26', '', '1000.00', null, null);
INSERT INTO `s_trn` VALUES ('56', '2024-01-31', '100', 'IS/INV/CRM/000003', '2.00', 'INV', '04', '', '0', 'R/016', '1', 'INV', null, null, '2024-01-31', '410.26', '', '1000.00', null, null);
INSERT INTO `s_trn` VALUES ('57', '2024-02-07', 'IT/0738', 'IS/GRN/000221', '10.00', 'ARN', '04', '0', '0', '', '1', '', null, null, '2024-02-07', '20000.00', null, '0.00', null, null);

-- ----------------------------
-- Table structure for `s_trn_all`
-- ----------------------------
CREATE TABLE `s_trn_all` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `SDATE` date DEFAULT NULL,
  `STK_NO` varchar(50) DEFAULT NULL,
  `REFNO` varchar(50) DEFAULT NULL,
  `QTY` decimal(15,2) DEFAULT 0.00,
  `LEDINDI` varchar(50) DEFAULT NULL,
  `DEPARTMENT` varchar(50) DEFAULT NULL,
  `seri_no` varchar(50) DEFAULT NULL,
  `Dev` varchar(50) DEFAULT '0',
  `SAL_EX` varchar(50) DEFAULT NULL,
  `cuscode` varchar(50) DEFAULT NULL,
  `cusname` varchar(100) DEFAULT NULL,
  `ACTIVE` varchar(10) DEFAULT NULL,
  `DONO` char(20) DEFAULT NULL,
  `brand` varchar(50) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=208377 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_trn_all
-- ----------------------------
INSERT INTO `s_trn_all` VALUES ('208366', '2023-09-24', 'IT/193', 'R/GRN/000001', '3.00', 'GRN', '01', '', '0', '', 'V/4410', 'CASH NEW', '1', '', 'A Plus', null);
INSERT INTO `s_trn_all` VALUES ('208367', '2024-01-26', '100', 'IS/GRN/000002', '4.00', 'GRN', '04', '', '0', 'R/016', 'V/0027', 'SISIRA  TYRE  HOUSE', '1', '', '', null);
INSERT INTO `s_trn_all` VALUES ('208368', '2024-01-26', 'IT/0727', 'IS/GRN/000002', '2.00', 'GRN', '04', '', '0', 'R/016', 'V/0027', 'SISIRA  TYRE  HOUSE', '1', '', '', null);
INSERT INTO `s_trn_all` VALUES ('208370', '2024-01-29', '100', 'IS/GRN/000004', '10.00', 'GRN', '04', '', '0', 'R/016', 'V/0027', 'SISIRA  TYRE  HOUSE', '1', '', '', '65b7bcd75faa4');
INSERT INTO `s_trn_all` VALUES ('208372', '2024-01-29', '100', 'IS/GRN/000006', '2.00', 'GRN', '04', '', '0', 'R/016', 'V/0027', 'SISIRA  TYRE  HOUSE', '1', '', '', '65b7c77c36941');
INSERT INTO `s_trn_all` VALUES ('208373', '2024-01-29', '100', 'IS/GRN/000007', '1.00', 'GRN', '04', '', '0', 'R/016', 'V/0027', 'SISIRA  TYRE  HOUSE', '1', '', '', '65b7c7f9dfbe1');
INSERT INTO `s_trn_all` VALUES ('208375', '2024-01-29', '100', 'IS/GRN/000009', '2.00', 'GRN', '04', '', '0', 'R/016', 'V/0027', 'SISIRA  TYRE  HOUSE', '1', '', 'AMORON', '65b7e125dd638');
INSERT INTO `s_trn_all` VALUES ('208376', '2024-01-29', 'IT/0727', 'IS/GRN/000009', '1.00', 'GRN', '04', '', '0', 'R/016', 'V/0027', 'SISIRA  TYRE  HOUSE', '1', '', 'AMORON', '65b7e125dd638');

-- ----------------------------
-- Table structure for `s_trn_defective`
-- ----------------------------
CREATE TABLE `s_trn_defective` (
  `ID` int(11) NOT NULL,
  `SDATE` date DEFAULT NULL,
  `STK_NO` varchar(50) DEFAULT NULL,
  `REFNO` varchar(50) DEFAULT NULL,
  `QTY` decimal(15,2) DEFAULT 0.00,
  `LEDINDI` varchar(50) DEFAULT NULL,
  `DEPARTMENT` varchar(50) DEFAULT NULL,
  `seri_no` varchar(50) DEFAULT NULL,
  `Dev` varchar(50) DEFAULT '0',
  `SAL_EX` varchar(50) DEFAULT NULL,
  `ACTIVE` varchar(10) DEFAULT NULL,
  `DONO` char(20) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_trn_defective
-- ----------------------------

-- ----------------------------
-- Table structure for `s_trn_stores`
-- ----------------------------
CREATE TABLE `s_trn_stores` (
  `ID` int(11) NOT NULL,
  `SDATE` date DEFAULT NULL,
  `STK_NO` varchar(50) DEFAULT NULL,
  `REFNO` varchar(50) DEFAULT NULL,
  `QTY` decimal(15,2) DEFAULT 0.00,
  `LEDINDI` varchar(50) DEFAULT NULL,
  `DEPARTMENT` varchar(50) DEFAULT NULL,
  `seri_no` varchar(50) DEFAULT NULL,
  `Dev` varchar(50) DEFAULT '0',
  `SAL_EX` varchar(50) DEFAULT NULL,
  `ACTIVE` varchar(10) DEFAULT NULL,
  `DONO` char(20) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `tru_qty` float DEFAULT NULL,
  PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_trn_stores
-- ----------------------------

-- ----------------------------
-- Table structure for `s_trn_tmp`
-- ----------------------------
CREATE TABLE `s_trn_tmp` (
  `ID` int(11) NOT NULL,
  `SDATE` date DEFAULT NULL,
  `STK_NO` varchar(50) DEFAULT NULL,
  `REFNO` varchar(50) DEFAULT NULL,
  `QTY` decimal(15,2) DEFAULT 0.00,
  `LEDINDI` varchar(50) DEFAULT NULL,
  `DEPARTMENT` varchar(50) DEFAULT NULL,
  `seri_no` varchar(50) DEFAULT NULL,
  `Dev` varchar(50) DEFAULT '0',
  `SAL_EX` varchar(50) DEFAULT NULL,
  `cuscode` varchar(50) DEFAULT NULL,
  `cusname` varchar(100) DEFAULT NULL,
  `ACTIVE` varchar(10) DEFAULT NULL,
  `DONO` char(20) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `user_name` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_trn_tmp
-- ----------------------------

-- ----------------------------
-- Table structure for `s_ut`
-- ----------------------------
CREATE TABLE `s_ut` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `C_REFNO` varchar(30) DEFAULT NULL,
  `C_DATE` date DEFAULT NULL,
  `C_CODE` varchar(30) DEFAULT NULL,
  `C_INVNO` varchar(30) DEFAULT NULL,
  `C_PAYMENT` varchar(30) DEFAULT NULL,
  `C_REMARK` varchar(50) DEFAULT NULL,
  `C_REMARK1` varchar(50) DEFAULT NULL,
  `C_REMARK2` varchar(50) DEFAULT NULL,
  `C_REMARK3` varchar(50) DEFAULT NULL,
  `C_TOTREPAY` varchar(30) DEFAULT NULL,
  `C_GST` varchar(30) DEFAULT NULL,
  `D` varchar(30) DEFAULT NULL,
  `CRE_NO_NO` varchar(30) DEFAULT NULL,
  `TYPE` varchar(30) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of s_ut
-- ----------------------------
INSERT INTO `s_ut` VALUES ('1', '', '2024-02-08', 'V/0027', 'IS/INV/CRM/000003', '12', null, null, null, null, null, null, null, 'IS/CRN/000004', 'INV', null, 'IS');
INSERT INTO `s_ut` VALUES ('3', 'IS/CUTI/0000003', '2024-02-08', 'V/0027', 'CASH', '5', null, null, null, null, null, null, null, 'IS/CRN/000004', 'CAS', '65c4b50865d6d', 'IS');
INSERT INTO `s_ut` VALUES ('4', 'IS/CUTI/0000004', '2024-02-09', 'V/0027', 'IS/INV/CRM/000003', '100', null, null, null, null, null, null, null, 'IS/CRN/000002', 'INV', '65c63cd9eb054', 'IS');

-- ----------------------------
-- Table structure for `s_utmas`
-- ----------------------------
CREATE TABLE `s_utmas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `C_REFNO` varchar(30) DEFAULT NULL,
  `C_DATE` date DEFAULT NULL,
  `C_CODE` varchar(30) DEFAULT NULL,
  `C_CRNNo` varchar(30) DEFAULT NULL,
  `C_Amount` varchar(30) DEFAULT NULL,
  `C_cash` varchar(30) DEFAULT NULL,
  `c_chno` varchar(30) DEFAULT NULL,
  `c_chdate` date DEFAULT NULL,
  `ch_val` varchar(30) DEFAULT NULL,
  `ch_bank` varchar(50) DEFAULT NULL,
  `CANCEL` varchar(1) DEFAULT '0',
  `tmp_no` varchar(30) DEFAULT NULL,
  `company` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT;

-- ----------------------------
-- Records of s_utmas
-- ----------------------------
INSERT INTO `s_utmas` VALUES ('1', 'IS/CUTI/0000001', '2024-02-08', 'V/0027', 'IS/CRN/000004', '12.00', '', '', '0000-00-00', '', '', '0', '65c4aeed64d90', 'IS');
INSERT INTO `s_utmas` VALUES ('2', 'IS/CUTI/0000002', '2024-02-08', 'V/0027', 'IS/CRN/000004', '90', '90', '123456', '2024-02-12', '90', 'SAMPATH', '1', '65c4b3ebac16d', 'IS');
INSERT INTO `s_utmas` VALUES ('3', 'IS/CUTI/0000003', '2024-02-08', 'V/0027', 'IS/CRN/000004', '5', '5', '', '0000-00-00', '', '', '0', '65c4b50865d6d', 'IS');
INSERT INTO `s_utmas` VALUES ('4', 'IS/CUTI/0000004', '2024-02-09', 'V/0027', 'IS/CRN/000002', '100.00', '', '', '0000-00-00', '', '', '0', '65c63cd9eb054', 'IS');

-- ----------------------------
-- Table structure for `s_weeordtrn`
-- ----------------------------
CREATE TABLE `s_weeordtrn` (
  `id` int(11) NOT NULL,
  `REF_NO` varchar(255) DEFAULT NULL,
  `SDATE` varchar(255) DEFAULT NULL,
  `STK_NO` varchar(255) DEFAULT NULL,
  `DESCRIPT` varchar(255) DEFAULT NULL,
  `UNIT` varchar(255) DEFAULT NULL,
  `PART_NO` varchar(255) DEFAULT NULL,
  `COST` varchar(255) DEFAULT NULL,
  `PRICE` varchar(255) DEFAULT NULL,
  `QTY` varchar(255) DEFAULT NULL,
  `DEPARTMENT` varchar(255) DEFAULT NULL,
  `DIS_per` varchar(255) DEFAULT NULL,
  `DIS_rs` varchar(255) DEFAULT NULL,
  `GROUP` varchar(255) DEFAULT NULL,
  `REP` varchar(255) DEFAULT NULL,
  `TAX_PER` varchar(255) DEFAULT NULL,
  `ret_qty` varchar(255) DEFAULT NULL,
  `BRAND` varchar(255) DEFAULT NULL,
  `DEV` varchar(255) DEFAULT '0',
  `CANCELL` varchar(255) DEFAULT '0',
  `c_code` varchar(255) DEFAULT NULL,
  `Print_dis1` varchar(255) DEFAULT NULL,
  `Print_dis2` varchar(255) DEFAULT NULL,
  `vatrate` varchar(255) DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_weeordtrn
-- ----------------------------

-- ----------------------------
-- Table structure for `s_weeplan`
-- ----------------------------
CREATE TABLE `s_weeplan` (
  `refno` varchar(255) DEFAULT NULL,
  `stkno` varchar(255) DEFAULT NULL,
  `des` varchar(255) DEFAULT NULL,
  `qty` varchar(255) DEFAULT NULL,
  `dis` varchar(255) DEFAULT NULL,
  `stock` varchar(255) DEFAULT NULL,
  `rep` varchar(255) DEFAULT NULL,
  `id` int(11) NOT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `rate` varchar(255) DEFAULT NULL,
  `cuscode` varchar(255) DEFAULT NULL,
  `cusname` varchar(255) DEFAULT NULL,
  `dep` varchar(255) DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL,
  `sdate` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of s_weeplan
-- ----------------------------

-- ----------------------------
-- Table structure for `tb`
-- ----------------------------
CREATE TABLE `tb` (
  `stk_no` varchar(255) DEFAULT NULL,
  `acc_cost` float DEFAULT NULL,
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tb
-- ----------------------------

-- ----------------------------
-- Table structure for `tb_chkrtn`
-- ----------------------------
CREATE TABLE `tb_chkrtn` (
  `rtn_chk` varchar(255) DEFAULT NULL,
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tb_chkrtn
-- ----------------------------

-- ----------------------------
-- Table structure for `tb_driver`
-- ----------------------------
CREATE TABLE `tb_driver` (
  `driver` varchar(90) DEFAULT NULL,
  `id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tb_driver
-- ----------------------------

-- ----------------------------
-- Table structure for `tb_veheno`
-- ----------------------------
CREATE TABLE `tb_veheno` (
  `veheno` varchar(90) DEFAULT NULL,
  `id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tb_veheno
-- ----------------------------

-- ----------------------------
-- Table structure for `tempreg`
-- ----------------------------
CREATE TABLE `tempreg` (
  `REFNO` varchar(20) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `cus_name` varchar(200) DEFAULT NULL,
  `AMOUNT` decimal(20,2) DEFAULT 0.00,
  `BALANCE` decimal(20,2) DEFAULT 0.00,
  `dep` varchar(30) DEFAULT NULL,
  `SAL_EX` varchar(20) DEFAULT NULL,
  `TRN_TYPE` varchar(20) DEFAULT NULL,
  `user_nm` varchar(20) DEFAULT NULL,
  `c_code1` varchar(20) DEFAULT NULL,
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tempreg
-- ----------------------------

-- ----------------------------
-- Table structure for `test`
-- ----------------------------
CREATE TABLE `test` (
  `q` smallint(6) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of test
-- ----------------------------

-- ----------------------------
-- Table structure for `testtable`
-- ----------------------------
CREATE TABLE `testtable` (
  `code` varchar(20) DEFAULT NULL,
  `NAME` varchar(50) DEFAULT NULL,
  `DDATE` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of testtable
-- ----------------------------

-- ----------------------------
-- Table structure for `tmparanalysis`
-- ----------------------------
CREATE TABLE `tmparanalysis` (
  `stk_no` varchar(50) DEFAULT NULL,
  `des` varchar(100) DEFAULT NULL,
  `part_no` varchar(100) DEFAULT NULL,
  `arqty` int(11) DEFAULT NULL,
  `balqty` int(11) DEFAULT NULL,
  `cost` int(11) DEFAULT NULL,
  `soldQty` int(11) DEFAULT NULL,
  `user_id` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmparanalysis
-- ----------------------------

-- ----------------------------
-- Table structure for `tmparmove`
-- ----------------------------
CREATE TABLE `tmparmove` (
  `ardate` date DEFAULT NULL,
  `AR_NO` varchar(20) DEFAULT NULL,
  `STK_NO` varchar(20) DEFAULT NULL,
  `des` varchar(200) DEFAULT NULL,
  `PART_NO` varchar(20) DEFAULT NULL,
  `qty_hnd` int(11) DEFAULT NULL,
  `AR_QTY` int(11) DEFAULT NULL,
  `brand` varchar(20) DEFAULT NULL,
  `SUPPLIER` varchar(200) DEFAULT NULL,
  `LC_NO` varchar(20) DEFAULT NULL,
  `ARVALUE` double(10,2) DEFAULT 0.00,
  `period` int(11) DEFAULT NULL,
  `monsales` int(11) DEFAULT NULL,
  `UN_QTY` int(11) DEFAULT NULL,
  `sold` decimal(10,2) DEFAULT 0.00,
  `user_id` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmparmove
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpcard`
-- ----------------------------
CREATE TABLE `tmpcard` (
  `ID` bigint(20) NOT NULL,
  `sdate` date DEFAULT NULL,
  `refno` varchar(20) DEFAULT NULL,
  `ccode` varchar(20) DEFAULT NULL,
  `cname` varchar(50) DEFAULT NULL,
  `invqty` decimal(10,0) DEFAULT 0,
  `retqty` decimal(10,0) DEFAULT 0,
  `sal_ex` varchar(50) DEFAULT NULL,
  `repname` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpcard
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpcommition`
-- ----------------------------
CREATE TABLE `tmpcommition` (
  `SDATE` date DEFAULT NULL,
  `REFNO` varchar(30) DEFAULT NULL,
  `COS_CODE` varchar(30) DEFAULT NULL,
  `cus_name` varchar(100) DEFAULT NULL,
  `AMOUNT` decimal(20,2) DEFAULT 0.00,
  `DUE` decimal(20,2) DEFAULT 0.00,
  `pay_type` varchar(20) DEFAULT NULL,
  `PAY_DATE` date DEFAULT NULL,
  `PAY_AMOUNT` decimal(20,2) DEFAULT 0.00,
  `brand` varchar(30) DEFAULT NULL,
  `dev` varchar(10) DEFAULT NULL,
  `DATES` int(11) DEFAULT NULL,
  `apdays` int(11) DEFAULT NULL,
  `D_75` decimal(20,2) DEFAULT 0.00,
  `D_76_90` decimal(20,2) DEFAULT 0.00,
  `D_91` decimal(20,2) DEFAULT 0.00,
  `commission` decimal(20,2) DEFAULT 0.00,
  `return` decimal(20,2) DEFAULT 0.00,
  `id` bigint(20) NOT NULL,
  `type` varchar(255) DEFAULT NULL,
  `VAT` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpcommition
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpcomprint`
-- ----------------------------
CREATE TABLE `tmpcomprint` (
  `type1` varchar(20) DEFAULT NULL,
  `amt` varchar(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpcomprint
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpcrlmt`
-- ----------------------------
CREATE TABLE `tmpcrlmt` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sdate` varchar(255) DEFAULT NULL,
  `stime` varchar(255) DEFAULT NULL,
  `username` varchar(255) DEFAULT NULL,
  `tmpLmt` varchar(255) DEFAULT NULL,
  `Class` varchar(255) DEFAULT NULL,
  `Rep` varchar(255) DEFAULT NULL,
  `cusCode` varchar(255) DEFAULT NULL,
  `crLmt` varchar(255) DEFAULT NULL,
  `cat` varchar(255) DEFAULT NULL,
  `FLAG` varchar(255) DEFAULT NULL,
  `remark` varchar(150) DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpcrlmt
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpcrlmtrep`
-- ----------------------------
CREATE TABLE `tmpcrlmtrep` (
  `id` bigint(20) NOT NULL,
  `c_code` varchar(20) DEFAULT NULL,
  `c_name` varchar(100) DEFAULT NULL,
  `rep` varchar(50) DEFAULT NULL,
  `username` varchar(50) DEFAULT NULL,
  `tmpcrlmt` decimal(20,2) DEFAULT NULL,
  `crlmt` decimal(20,2) DEFAULT NULL,
  `cat` varchar(20) DEFAULT NULL,
  `remark` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpcrlmtrep
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpcustomerout`
-- ----------------------------
CREATE TABLE `tmpcustomerout` (
  `REF_NO` varchar(30) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `days` int(11) DEFAULT NULL,
  `AMOUNT` decimal(20,2) DEFAULT 0.00,
  `paid` decimal(20,2) DEFAULT 0.00,
  `SAL_EX` varchar(30) DEFAULT NULL,
  `barnd` varchar(30) DEFAULT NULL,
  `REPNAME` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpcustomerout
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpinvpara`
-- ----------------------------
CREATE TABLE `tmpinvpara` (
  `COMPANY` varchar(255) DEFAULT NULL,
  `ADD1` varchar(255) DEFAULT NULL,
  `ADD2` varchar(255) DEFAULT NULL,
  `ADD3` varchar(255) DEFAULT NULL,
  `TELE` varchar(255) DEFAULT NULL,
  `FAX` varchar(255) DEFAULT NULL,
  `EMAIL` varchar(255) DEFAULT NULL,
  `Purchase_acc` varchar(255) DEFAULT NULL,
  `Purchaseret_acc` varchar(255) DEFAULT '0',
  `Sales_acc` varchar(255) DEFAULT '0',
  `salesret_ac` varchar(255) DEFAULT '0',
  `creditnote_acc` varchar(255) DEFAULT '0',
  `DEFIT_acc` varchar(255) DEFAULT '0',
  `ADVA_ACC` varchar(255) DEFAULT '0',
  `RETCH_AC` varchar(255) DEFAULT '0',
  `RETCHPAY_AC` varchar(255) DEFAULT '0',
  `DAMA_AC` varchar(255) DEFAULT '0',
  `DAMAREC_AC` varchar(255) DEFAULT '0',
  `CAS_INV_NO` bigint(20) DEFAULT 0,
  `CRE_INV_NO` bigint(20) DEFAULT 0,
  `A` bigint(20) DEFAULT 0,
  `B` bigint(20) DEFAULT 0,
  `C` bigint(20) DEFAULT 0,
  `D` bigint(20) DEFAULT 0,
  `E` bigint(20) DEFAULT 0,
  `F` bigint(20) DEFAULT 0,
  `G` bigint(20) DEFAULT 0,
  `H` bigint(20) DEFAULT 0,
  `I` bigint(20) DEFAULT 0,
  `J` bigint(20) DEFAULT 0,
  `K` bigint(20) DEFAULT 0,
  `L` bigint(20) DEFAULT 0,
  `M` bigint(20) DEFAULT 0,
  `N` bigint(20) DEFAULT 0,
  `O` bigint(20) DEFAULT 0,
  `P` bigint(20) DEFAULT 0,
  `Q` bigint(20) DEFAULT 0,
  `R` bigint(20) DEFAULT 0,
  `S` bigint(20) DEFAULT 0,
  `T` bigint(20) DEFAULT 0,
  `U` bigint(20) DEFAULT 0,
  `V` bigint(20) DEFAULT 0,
  `W` bigint(20) DEFAULT 0,
  `X` bigint(20) DEFAULT 0,
  `Y` bigint(20) DEFAULT 0,
  `Z` bigint(20) DEFAULT 0,
  `itemno` bigint(20) DEFAULT 0,
  `GIN` bigint(20) DEFAULT 0,
  `ARN` bigint(20) DEFAULT 0,
  `AD_NO` varchar(255) DEFAULT NULL,
  `INV_RECNO` bigint(20) DEFAULT 0,
  `ORD_NO` bigint(20) DEFAULT 0,
  `ARR` bigint(20) DEFAULT 0,
  `grn` bigint(20) DEFAULT 0,
  `CHE_RET` varchar(255) DEFAULT NULL,
  `Guti` varchar(255) DEFAULT NULL,
  `CRN` bigint(20) DEFAULT 0,
  `VAT` varchar(255) DEFAULT NULL,
  `DGRN` bigint(20) DEFAULT 0,
  `last_update` varchar(255) DEFAULT NULL,
  `INV_RECNO_M` bigint(20) DEFAULT 0,
  `grn_m` varchar(255) DEFAULT NULL,
  `adj` varchar(255) DEFAULT NULL,
  `CHRET` varchar(255) DEFAULT NULL,
  `CAS_INV_NO_m` bigint(20) DEFAULT 0,
  `CRE_INV_NO_m` varchar(255) DEFAULT NULL,
  `CRN_m` varchar(255) DEFAULT NULL,
  `dgrn_m` varchar(255) DEFAULT NULL,
  `flag` varchar(255) DEFAULT NULL,
  `sysdate` varchar(255) DEFAULT NULL,
  `Cus_ord_no` varchar(255) DEFAULT NULL,
  `ORDNO` bigint(20) DEFAULT 0,
  `AuthCode` varchar(255) DEFAULT NULL,
  `Cus_Qua_no` varchar(255) DEFAULT NULL,
  `BinCardDate` varchar(255) DEFAULT NULL,
  `last_invdata` date DEFAULT NULL,
  `vatrate` varchar(200) DEFAULT NULL,
  `rno` bigint(20) DEFAULT 0,
  `debnoteno` varchar(255) DEFAULT NULL,
  `RECDATE` varchar(255) DEFAULT NULL,
  `delinno` varchar(255) DEFAULT NULL,
  `reportno` varchar(255) DEFAULT NULL,
  `traddebaccno` varchar(255) DEFAULT NULL,
  `cashinhandaccno` varchar(255) DEFAULT NULL,
  `voidchequesetcc` varchar(255) DEFAULT NULL,
  `shname` varchar(255) DEFAULT NULL,
  `QTNNO` varchar(255) DEFAULT '0',
  `svatno` varchar(255) DEFAULT NULL,
  `Claimno` varchar(200) DEFAULT NULL,
  `rebrefno` varchar(255) DEFAULT NULL,
  `STOINV` varchar(255) DEFAULT NULL,
  `STOINV_CODE` varchar(255) DEFAULT NULL,
  `STOrec_CODE` varchar(255) DEFAULT NULL,
  `STOrec` varchar(255) DEFAULT NULL,
  `Scratch_no` varchar(255) DEFAULT NULL,
  `CO_CHNO` varchar(255) DEFAULT NULL,
  `MA_CHNO` varchar(255) DEFAULT NULL,
  `RET_CHNO` varchar(255) DEFAULT NULL,
  `SPINV` bigint(20) DEFAULT 0,
  `crnfrmno` varchar(50) DEFAULT NULL,
  `CCRNNO` varchar(50) DEFAULT NULL,
  `weekly_ord` bigint(20) DEFAULT NULL,
  `strgin` bigint(20) DEFAULT NULL,
  `sal_com` bigint(20) DEFAULT NULL,
  `dealer_shr` bigint(20) DEFAULT NULL,
  `SPINV2` bigint(20) DEFAULT 0,
  `id` int(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of tmpinvpara
-- ----------------------------
INSERT INTO `tmpinvpara` VALUES ('IRUSHI TYRE HOUSE', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '136', null, '370', '164', '0', '7', null, null, '0', null, '0', null, '0', null, null, null, '0', null, null, null, 'IU', null, null, '0', null, null, null, null, null, '0', null, null, null, null, null, null, null, null, '0', null, null, null, null, null, null, null, null, null, null, null, '0', null, null, null, null, null, null, '251', '13');
INSERT INTO `tmpinvpara` VALUES ('IRUSHI TYRE HOUSE', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', null, '2', '2', '0', '0', null, null, '0', null, '0', null, '0', null, null, null, '0', null, null, null, 'IAS', null, null, '0', null, null, null, null, null, '0', null, null, null, null, null, null, null, null, '0', null, null, null, null, null, null, null, null, null, null, null, '0', null, null, null, null, null, null, '39', '14');
INSERT INTO `tmpinvpara` VALUES ('IRUSHI TYRE HOUSE', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '81', null, '182', '139', '0', '3', null, null, '0', null, '0', null, '0', null, null, null, '0', null, null, null, 'IAW', null, null, '0', null, null, null, null, null, '0', null, null, null, null, null, null, null, null, '0', null, null, null, null, null, null, null, null, null, null, null, '0', null, null, null, null, null, null, '244', '15');
INSERT INTO `tmpinvpara` VALUES ('IRUSHI TYRE HOUSE', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '442', null, '88', '949', '0', '372', null, null, '0', null, '0', null, '0', null, null, null, '0', null, null, null, 'IS', null, null, '0', null, null, null, null, null, '0', null, null, null, null, null, null, null, null, '0', null, null, null, null, null, null, null, null, null, null, null, '0', null, null, null, null, null, null, '827', '16');

-- ----------------------------
-- Table structure for `tmpitem`
-- ----------------------------
CREATE TABLE `tmpitem` (
  `itemcode` varchar(20) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `user_nm` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpitem
-- ----------------------------
INSERT INTO `tmpitem` VALUES ('IT/0211', '250/17 DSI Tube', 'stock');
INSERT INTO `tmpitem` VALUES ('IT/0215', '275/17 DSI Mega Star TT 40', 'stock');
INSERT INTO `tmpitem` VALUES ('IT/0259', '90/100/10 DSI Genx TL 64', 'stock');
INSERT INTO `tmpitem` VALUES ('IT/0158', '185/14 Nankang C CW25', 'stock');
INSERT INTO `tmpitem` VALUES ('IT/0159', '185/14 Nankang T CW25', 'stock');
INSERT INTO `tmpitem` VALUES ('IT/0156', '165/65/15 Nankang T AS1', 'stock');
INSERT INTO `tmpitem` VALUES ('IT/0301', 'Emtrac N100', 'stock');

-- ----------------------------
-- Table structure for `tmpord`
-- ----------------------------
CREATE TABLE `tmpord` (
  `stkno` varchar(50) DEFAULT NULL,
  `des` varchar(50) DEFAULT NULL,
  `Cuscode` varchar(20) DEFAULT NULL,
  `CUSNAME` varchar(50) DEFAULT NULL,
  `ordqty` decimal(20,2) DEFAULT 0.00,
  `cost` decimal(20,2) DEFAULT 0.00,
  `QTYINHAND` double(20,2) DEFAULT 0.00,
  `stk` varchar(20) DEFAULT NULL,
  `archqty` decimal(20,2) DEFAULT 0.00,
  `archval` decimal(20,2) DEFAULT 0.00,
  `tmp_no` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpord
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpoutgroup`
-- ----------------------------
CREATE TABLE `tmpoutgroup` (
  `C_CODE` varchar(50) DEFAULT NULL,
  `NAME` varchar(50) DEFAULT NULL,
  `out0` float DEFAULT NULL,
  `out1` float DEFAULT NULL,
  `id` int(10) unsigned NOT NULL,
  `user_nm` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpoutgroup
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpoutinv`
-- ----------------------------
CREATE TABLE `tmpoutinv` (
  `REF_NO` varchar(50) DEFAULT NULL,
  `Customer` varchar(100) DEFAULT NULL,
  `Cus_Code` varchar(30) DEFAULT NULL,
  `AMOUNT` decimal(20,2) DEFAULT 0.00,
  `paid` decimal(20,2) DEFAULT 0.00,
  `SDATE` date DEFAULT NULL,
  `sal_ex` varchar(30) DEFAULT NULL,
  `odr` varchar(1) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of tmpoutinv
-- ----------------------------

-- ----------------------------
-- Table structure for `tmppurcon`
-- ----------------------------
CREATE TABLE `tmppurcon` (
  `STK_NO` varchar(30) DEFAULT NULL,
  `desctript` varchar(50) DEFAULT NULL,
  `PART_NO` varchar(30) DEFAULT NULL,
  `group3` varchar(20) DEFAULT NULL,
  `arno` varchar(30) DEFAULT NULL,
  `ardate` date DEFAULT NULL,
  `larqty` decimal(20,2) DEFAULT 0.00,
  `ord_qty1` decimal(20,2) DEFAULT 0.00,
  `ord_qty2` decimal(20,2) DEFAULT 0.00,
  `ord_qty3` decimal(20,2) DEFAULT 0.00,
  `mon1` varchar(20) DEFAULT NULL,
  `mon2` varchar(20) DEFAULT NULL,
  `mon3` varchar(20) DEFAULT NULL,
  `pur0` decimal(20,2) DEFAULT 0.00,
  `con0` decimal(20,2) DEFAULT 0.00,
  `ordqty` decimal(20,2) DEFAULT 0.00,
  `pur1` decimal(20,2) DEFAULT 0.00,
  `con1` decimal(20,2) DEFAULT 0.00,
  `open_stk` decimal(20,2) DEFAULT 0.00,
  `pur2` decimal(20,2) DEFAULT 0.00,
  `con2` decimal(20,2) DEFAULT 0.00,
  `pur3` decimal(20,2) DEFAULT 0.00,
  `con3` decimal(20,2) DEFAULT 0.00,
  `pur4` decimal(20,2) DEFAULT 0.00,
  `con4` decimal(20,2) DEFAULT 0.00,
  `pur5` decimal(20,2) DEFAULT 0.00,
  `con5` decimal(20,2) DEFAULT 0.00,
  `QTYINHAND` decimal(20,2) DEFAULT 0.00,
  `over90` decimal(20,2) DEFAULT 0.00,
  `otherqty` int(11) DEFAULT NULL,
  `otherord` int(11) DEFAULT NULL,
  `user_nm` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmppurcon
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpqtysale`
-- ----------------------------
CREATE TABLE `tmpqtysale` (
  `sdate` date DEFAULT NULL,
  `refno` varchar(50) DEFAULT NULL,
  `ccode` varchar(20) DEFAULT NULL,
  `cname` varchar(50) DEFAULT NULL,
  `INVqty` decimal(20,2) DEFAULT NULL,
  `RETqty` decimal(20,2) DEFAULT 0.00,
  `stkno` varchar(20) DEFAULT NULL,
  `description` varchar(50) DEFAULT NULL,
  `sal_ex` varchar(30) DEFAULT NULL,
  `repname` varchar(30) DEFAULT NULL,
  `brand` varchar(30) DEFAULT NULL,
  `dis` varchar(30) DEFAULT NULL,
  `value` varchar(30) DEFAULT NULL,
  `user_id` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpqtysale
-- ----------------------------

-- ----------------------------
-- Table structure for `tmprct`
-- ----------------------------
CREATE TABLE `tmprct` (
  `recno` varchar(30) DEFAULT NULL,
  `SDATE` varchar(20) DEFAULT NULL,
  `REFNO` varchar(30) DEFAULT NULL,
  `AMOUNT` varchar(30) DEFAULT NULL,
  `balance` varchar(30) DEFAULT NULL,
  `paid` varchar(30) DEFAULT NULL,
  `OVERDUE` varchar(30) DEFAULT NULL,
  `CH_VAL` varchar(30) DEFAULT NULL,
  `flag` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmprct
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpreceipt`
-- ----------------------------
CREATE TABLE `tmpreceipt` (
  `id` bigint(20) NOT NULL,
  `REF_NO` varchar(30) DEFAULT NULL,
  `CUS_REF` varchar(100) DEFAULT NULL,
  `ptype` varchar(20) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `cash` decimal(20,2) DEFAULT 0.00,
  `DEPARTMENT` varchar(30) DEFAULT NULL,
  `ch_no` varchar(50) DEFAULT NULL,
  `branch` varchar(30) DEFAULT NULL,
  `ch_date` date DEFAULT NULL,
  `ch_amount` decimal(20,2) DEFAULT 0.00,
  `bank` varchar(50) DEFAULT NULL,
  `cust` varchar(50) DEFAULT NULL,
  `username` varchar(20) DEFAULT NULL,
  `CA_CODE` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpreceipt
-- ----------------------------

-- ----------------------------
-- Table structure for `tmprepsale`
-- ----------------------------
CREATE TABLE `tmprepsale` (
  `rep` varchar(100) DEFAULT NULL,
  `grossale` decimal(20,2) DEFAULT 0.00,
  `grossgrn` decimal(20,2) DEFAULT 0.00,
  `Name` varchar(50) DEFAULT NULL,
  `rgroup` varchar(50) DEFAULT NULL,
  `net` decimal(20,2) DEFAULT 0.00,
  `targ` decimal(10,0) DEFAULT NULL,
  `user_id` varchar(50) DEFAULT NULL,
  `rgroup1` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmprepsale
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpretchkana`
-- ----------------------------
CREATE TABLE `tmpretchkana` (
  `sdate` date DEFAULT NULL,
  `SAle` decimal(20,2) DEFAULT 0.00,
  `ret` decimal(20,2) DEFAULT 0.00,
  `Pr` decimal(20,2) DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpretchkana
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpseri`
-- ----------------------------
CREATE TABLE `tmpseri` (
  `adno` varchar(20) DEFAULT NULL,
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpseri
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpstk`
-- ----------------------------
CREATE TABLE `tmpstk` (
  `STK_NO` varchar(20) DEFAULT NULL,
  `DESCRIPT` varchar(150) DEFAULT NULL,
  `PARTNO` varchar(20) DEFAULT NULL,
  `COST` decimal(10,2) DEFAULT 0.00,
  `TOTCOST` decimal(10,2) DEFAULT 0.00,
  `QTYINHAND` decimal(10,2) DEFAULT 0.00,
  `BRAND` varchar(50) DEFAULT NULL,
  `group1` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpstk
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpstkbal`
-- ----------------------------
CREATE TABLE `tmpstkbal` (
  `brand` varchar(50) DEFAULT NULL,
  `stkbal` float(30,3) DEFAULT 0.000
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpstkbal
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpstkmve`
-- ----------------------------
CREATE TABLE `tmpstkmve` (
  `STK_NO` varchar(20) DEFAULT NULL,
  `BRAND_NAME` varchar(50) DEFAULT NULL,
  `DESCRIPT` varchar(50) DEFAULT NULL,
  `QTYINHAND` decimal(10,2) DEFAULT 0.00,
  `totcost` decimal(10,2) DEFAULT 0.00,
  `PART_NO` varchar(20) DEFAULT NULL,
  `AR_NO` varchar(20) DEFAULT NULL,
  `arqty` double(10,2) DEFAULT 0.00,
  `ardate` date DEFAULT NULL,
  `LCNO` varchar(10) DEFAULT NULL,
  `shdate` date DEFAULT NULL,
  `ordqty` decimal(10,2) DEFAULT 0.00,
  `m1` double(10,0) DEFAULT 0,
  `m2` double(10,0) DEFAULT 0,
  `m3` double(10,0) DEFAULT 0,
  `m4` double(10,0) DEFAULT 0,
  `m5` double(10,0) DEFAULT 0,
  `m6` double(10,0) DEFAULT 0,
  `m7` double(10,0) DEFAULT 0,
  `m8` double(10,0) DEFAULT 0,
  `m9` double(10,0) DEFAULT 0,
  `m10` double(10,0) DEFAULT 0,
  `m11` double(10,0) DEFAULT 0,
  `m12` double(10,0) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpstkmve
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpsttr`
-- ----------------------------
CREATE TABLE `tmpsttr` (
  `id` bigint(20) NOT NULL,
  `refno` varchar(20) DEFAULT NULL,
  `sdate` date DEFAULT NULL,
  `cheVal` decimal(20,2) DEFAULT NULL,
  `paid` decimal(20,2) DEFAULT NULL,
  `che_no` varchar(20) DEFAULT NULL,
  `code` varchar(20) DEFAULT NULL,
  `cusname` varchar(50) DEFAULT NULL,
  `rep` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpsttr
-- ----------------------------

-- ----------------------------
-- Table structure for `tmpsttr_ana`
-- ----------------------------
CREATE TABLE `tmpsttr_ana` (
  `id` bigint(20) NOT NULL,
  `refno` varchar(20) DEFAULT NULL,
  `sdate` date DEFAULT NULL,
  `cheval` decimal(20,2) DEFAULT NULL,
  `paid` decimal(20,2) DEFAULT NULL,
  `che_no` varchar(20) DEFAULT NULL,
  `code` varchar(20) DEFAULT NULL,
  `cusname` varchar(50) DEFAULT NULL,
  `st_recno` varchar(20) DEFAULT NULL,
  `st_flag` varchar(10) DEFAULT NULL,
  `st_amt` decimal(20,2) DEFAULT NULL,
  `st_date` date DEFAULT NULL,
  `st_chno` varchar(20) DEFAULT NULL,
  `rep` varchar(20) DEFAULT NULL,
  `days` decimal(10,0) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpsttr_ana
-- ----------------------------

-- ----------------------------
-- Table structure for `tmptotbrandsale`
-- ----------------------------
CREATE TABLE `tmptotbrandsale` (
  `brand` varchar(30) DEFAULT NULL,
  `gross` decimal(20,2) DEFAULT 0.00,
  `grn` decimal(20,2) DEFAULT 0.00,
  `nett` decimal(20,2) DEFAULT 0.00,
  `username` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmptotbrandsale
-- ----------------------------

-- ----------------------------
-- Table structure for `tmputi_chqdet`
-- ----------------------------
CREATE TABLE `tmputi_chqdet` (
  `c_code` varchar(50) DEFAULT NULL,
  `ret_chq_no` varchar(50) DEFAULT NULL,
  `ret_date` date DEFAULT NULL,
  `chq_amt` decimal(20,2) DEFAULT 0.00,
  `paid` decimal(20,2) DEFAULT 0.00,
  `balance` decimal(20,2) DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmputi_chqdet
-- ----------------------------

-- ----------------------------
-- Table structure for `tmputi_invdet`
-- ----------------------------
CREATE TABLE `tmputi_invdet` (
  `c_code` varchar(50) DEFAULT NULL,
  `inv_no` varchar(50) DEFAULT NULL,
  `inv_date` date DEFAULT NULL,
  `inv_amt` decimal(20,2) DEFAULT 0.00,
  `paid` decimal(20,2) DEFAULT 0.00,
  `balance` decimal(20,2) DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmputi_invdet
-- ----------------------------
INSERT INTO `tmputi_invdet` VALUES (null, 'R/INV/CRM/000112', '2023-09-24', '249711.00', '0.00', '249711.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'R/INV/CRM/000112', '2023-09-24', '249711.00', '74913.30', '174797.70');
INSERT INTO `tmputi_invdet` VALUES (null, 'R/INV/CRM/000112', '2023-09-24', '249711.00', '75113.30', '174597.70');
INSERT INTO `tmputi_invdet` VALUES (null, 'IAW/INV/CRM/000003', '2023-10-29', '5600.00', '0.00', '5600.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IAW/INV/CRM/000003', '2023-10-29', '5600.00', '0.00', '5600.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '0.00', '2000.00');
INSERT INTO `tmputi_invdet` VALUES (null, 'IS/INV/CRM/000003', '2024-01-31', '2000.00', '12.00', '1988.00');

-- ----------------------------
-- Table structure for `tmpvari`
-- ----------------------------
CREATE TABLE `tmpvari` (
  `STK_NO` varchar(20) DEFAULT NULL,
  `descript` varchar(50) DEFAULT NULL,
  `PART_NO` varchar(20) DEFAULT NULL,
  `QTYINHAND` decimal(10,2) DEFAULT 0.00,
  `cost` decimal(10,2) DEFAULT 0.00,
  `vari` decimal(10,2) DEFAULT 0.00,
  `stk_count` decimal(10,2) DEFAULT 0.00,
  `undeli` decimal(10,2) DEFAULT 0.00,
  `damage` decimal(10,2) DEFAULT NULL,
  `brand` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmpvari
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_ad_data`
-- ----------------------------
CREATE TABLE `tmp_ad_data` (
  `id` bigint(20) NOT NULL,
  `str_invno` varchar(20) NOT NULL DEFAULT '',
  `str_code` varchar(20) DEFAULT NULL,
  `str_description` varchar(50) DEFAULT NULL,
  `cur_rate` decimal(20,2) DEFAULT 0.00,
  `cur_qty` decimal(20,2) DEFAULT 0.00,
  `dis_per` decimal(20,10) DEFAULT 0.0000000000,
  `cur_discount` decimal(20,2) DEFAULT 0.00,
  `cur_subtot` decimal(20,2) DEFAULT 0.00,
  `actual_selling` decimal(20,2) DEFAULT 0.00,
  `brand` varchar(20) DEFAULT NULL,
  `ad` varchar(20) DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_ad_data
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_arn_data_stores`
-- ----------------------------
CREATE TABLE `tmp_arn_data_stores` (
  `tmp_no` varchar(30) DEFAULT NULL,
  `str_invno` varchar(20) NOT NULL DEFAULT '',
  `str_code` varchar(20) DEFAULT NULL,
  `str_description` varchar(50) DEFAULT NULL,
  `partno` varchar(20) DEFAULT NULL,
  `qty` decimal(20,2) DEFAULT 0.00,
  `subtotal` decimal(20,2) DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_arn_data_stores
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_auto_credit_note`
-- ----------------------------
CREATE TABLE `tmp_auto_credit_note` (
  `myear_mon` varchar(20) DEFAULT NULL,
  `code` varchar(30) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `sal_ex` varchar(50) DEFAULT NULL,
  `amount1` decimal(20,2) DEFAULT 0.00,
  `qty1` decimal(20,2) DEFAULT 0.00,
  `amount2` decimal(20,2) DEFAULT 0.00,
  `qty2` decimal(20,2) DEFAULT 0.00,
  `crnno` varchar(20) DEFAULT NULL,
  `txndate` date DEFAULT NULL,
  `amount` decimal(20,2) DEFAULT 0.00,
  `status` varchar(20) DEFAULT NULL,
  `user_id` varchar(50) DEFAULT NULL,
  `amount_c` decimal(10,0) DEFAULT NULL,
  `code1` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_auto_credit_note
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_cash_chq`
-- ----------------------------
CREATE TABLE `tmp_cash_chq` (
  `recno` varchar(20) DEFAULT NULL,
  `chqno` varchar(30) DEFAULT NULL,
  `chqdate` varchar(20) DEFAULT NULL,
  `chqbank` varchar(30) DEFAULT NULL,
  `chqamt` decimal(20,2) DEFAULT 0.00,
  `tmp_no` varchar(50) DEFAULT NULL,
  `tmp_count` smallint(6) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_cash_chq
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_cash_credit_note_form`
-- ----------------------------
CREATE TABLE `tmp_cash_credit_note_form` (
  `id` bigint(20) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `crn_form_no` varchar(20) NOT NULL DEFAULT '',
  `Inv_date` date DEFAULT NULL,
  `InvInv_date` date DEFAULT NULL,
  `inv_no` varchar(50) DEFAULT NULL,
  `Amount` varchar(20) DEFAULT NULL,
  `settleamt` decimal(20,2) DEFAULT NULL,
  `settledate` date DEFAULT NULL,
  `Qty` decimal(20,2) DEFAULT NULL,
  `days` int(11) DEFAULT NULL,
  `balance` float(20,2) DEFAULT NULL,
  `Incen_per` decimal(20,5) DEFAULT NULL,
  `Incen_val` decimal(20,2) DEFAULT NULL,
  `Brands` varchar(30) DEFAULT NULL,
  `disc` float(20,3) DEFAULT 0.000,
  `disc1` float(20,3) DEFAULT 0.000,
  `st_refno` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_cash_credit_note_form
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_credit_note_form`
-- ----------------------------
CREATE TABLE `tmp_credit_note_form` (
  `tmp_no` varchar(30) DEFAULT NULL,
  `crn_form_no` varchar(20) NOT NULL DEFAULT '',
  `Inv_date` date DEFAULT NULL,
  `inv_no` varchar(50) DEFAULT NULL,
  `Amount` varchar(20) DEFAULT NULL,
  `disc` float(20,3) DEFAULT 0.000,
  `Qty` decimal(20,2) DEFAULT 0.00,
  `Incen_per` decimal(20,2) DEFAULT 0.00,
  `Incen_val` decimal(20,2) DEFAULT 0.00,
  `Brands` varchar(30) DEFAULT NULL,
  `disc1` float(20,3) DEFAULT 0.000
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_credit_note_form
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_cus`
-- ----------------------------
CREATE TABLE `tmp_cus` (
  `id` int(11) NOT NULL,
  `CODE` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_cus
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_cusord_data`
-- ----------------------------
CREATE TABLE `tmp_cusord_data` (
  `str_invno` varchar(20) NOT NULL DEFAULT '',
  `str_code` varchar(20) DEFAULT NULL,
  `str_description` varchar(50) DEFAULT NULL,
  `cur_rate` decimal(20,2) DEFAULT 0.00,
  `cost` decimal(20,2) DEFAULT NULL,
  `cur_qty` decimal(20,2) DEFAULT 0.00,
  `dis_per` decimal(20,2) DEFAULT 0.00,
  `cur_discount` decimal(20,2) DEFAULT 0.00,
  `cur_subtot` decimal(20,2) DEFAULT 0.00,
  `brand` varchar(20) DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_cusord_data
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_dealerinc`
-- ----------------------------
CREATE TABLE `tmp_dealerinc` (
  `c_code` varchar(255) DEFAULT NULL,
  `ref_no` varchar(255) DEFAULT NULL,
  `sdate` date DEFAULT NULL,
  `st_refno` varchar(255) DEFAULT NULL,
  `st_paid` float DEFAULT NULL,
  `brand` varchar(255) DEFAULT NULL,
  `grand_tot` float DEFAULT NULL,
  `amount` float DEFAULT NULL,
  `st_date` date DEFAULT NULL,
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_dealerinc
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_dlr_sch`
-- ----------------------------
CREATE TABLE `tmp_dlr_sch` (
  `id` int(11) NOT NULL,
  `ref_no` varchar(50) DEFAULT NULL,
  `tmp_no` varchar(20) DEFAULT NULL,
  `c_code` varchar(20) DEFAULT NULL,
  `c_name` varchar(50) DEFAULT NULL,
  `inv_amo` float DEFAULT NULL,
  `out_amo` float DEFAULT NULL,
  `amo` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_dlr_sch
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_gin_data`
-- ----------------------------
CREATE TABLE `tmp_gin_data` (
  `str_invno` varchar(20) NOT NULL DEFAULT '',
  `str_code` varchar(20) DEFAULT NULL,
  `str_description` varchar(50) DEFAULT NULL,
  `partno` varchar(30) DEFAULT NULL,
  `cur_qty` decimal(20,2) DEFAULT 0.00,
  `tmp_no` varchar(50) DEFAULT NULL,
  `user_id` varchar(50) DEFAULT NULL,
  `id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_gin_data
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_gin_data_multi`
-- ----------------------------
CREATE TABLE `tmp_gin_data_multi` (
  `str_invno` varchar(20) NOT NULL DEFAULT '',
  `str_code` varchar(20) DEFAULT NULL,
  `str_description` varchar(50) DEFAULT NULL,
  `partno` varchar(30) DEFAULT NULL,
  `cur_qty` decimal(20,2) DEFAULT 0.00,
  `tmp_no` varchar(100) DEFAULT '',
  `user_id` varchar(50) DEFAULT NULL,
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `dep_from` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_gin_data_multi
-- ----------------------------
INSERT INTO `tmp_gin_data_multi` VALUES ('IS/ST/0000135', 'IT/0744', 'C', null, '2.00', '659399dea9a34', 'admin', '1', '04');
INSERT INTO `tmp_gin_data_multi` VALUES ('IS/ST/0000135', 'IT/0743', 'B', null, '3.00', '659399dea9a34', 'admin', '2', '04');
INSERT INTO `tmp_gin_data_multi` VALUES ('IS/ST/0000135', 'IT/0744', 'C', null, '10.00', '6593aa00f1898', 'admin', '4', '04');
INSERT INTO `tmp_gin_data_multi` VALUES ('IS/ST/0000135', 'IT/0742', 'A', null, '20.00', '6593ad5c14cc0', 'admin', '5', '04');
INSERT INTO `tmp_gin_data_multi` VALUES ('IS/ST/0000136', 'IT/0742', 'A', null, '30.00', '6593b105e71d8', 'admin', '6', '04');
INSERT INTO `tmp_gin_data_multi` VALUES ('IS/ST/0000136', 'IT/0743', 'B', null, '10.00', '6593b105e71d8', 'admin', '7', '04');
INSERT INTO `tmp_gin_data_multi` VALUES ('IS/ST/0000137', '100', 'TOYOTA SUPRA', null, '2.00', '6593dd9d5dbea', 'admin', '9', '04');
INSERT INTO `tmp_gin_data_multi` VALUES ('IS/ST/0000138', '100', 'TOYOTA SUPRA', null, '2.00', '6593de2b560e1', 'admin', '10', '04');
INSERT INTO `tmp_gin_data_multi` VALUES ('IS/ST/0000139', '100', 'TOYOTA SUPRA', null, '4.00', '6593dec0e77ee', 'admin', '11', '04');
INSERT INTO `tmp_gin_data_multi` VALUES ('IS/ST/0000140', '100', 'TOYOTA SUPRA', null, '3.00', '6593df34696e2', 'admin', '12', '04');
INSERT INTO `tmp_gin_data_multi` VALUES ('IS/ST/0000141', '100', 'TOYOTA SUPRA', null, '3.00', '6593dfd5a1f78', 'admin', '13', '04');
INSERT INTO `tmp_gin_data_multi` VALUES ('IS/ST/0000142', '100', 'TOYOTA SUPRA', null, '3.00', '6593e059c6e3d', 'admin', '14', '05');

-- ----------------------------
-- Table structure for `tmp_grn_data`
-- ----------------------------
CREATE TABLE `tmp_grn_data` (
  `str_invno` varchar(20) NOT NULL DEFAULT '',
  `str_code` varchar(20) DEFAULT NULL,
  `str_description` varchar(50) DEFAULT NULL,
  `cur_rate` decimal(20,3) DEFAULT 0.000,
  `cur_qty` decimal(20,3) DEFAULT 0.000,
  `pre_ret_qty` decimal(20,3) DEFAULT NULL,
  `ret_qty` decimal(20,3) DEFAULT NULL,
  `dis_per` decimal(20,10) DEFAULT 0.0000000000,
  `cur_discount` decimal(20,10) DEFAULT 0.0000000000,
  `cur_subtot` decimal(20,2) DEFAULT 0.00,
  `brand` varchar(20) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_grn_data
-- ----------------------------
INSERT INTO `tmp_grn_data` VALUES ('IS/INV/CB/000013', '100', 'TOYOTA SUPRA', '1000.000', '10.000', '8.000', '0.000', '10.0000000000', '1000.0000000000', '0.00', 'TEST1', '65b7ce2776ce5', '82');
INSERT INTO `tmp_grn_data` VALUES ('IS/INV/CB/000013', 'IT/0727', '', '2000.000', '1.000', '0.000', '0.000', '10.0000000000', '200.0000000000', '0.00', '', '65b7ce2776ce5', '83');
INSERT INTO `tmp_grn_data` VALUES ('IS/INV/CB/000010', 'IT/0727', '', '2000.000', '1.000', '0.000', '0.000', '0.0000000000', '0.0000000000', '0.00', '', '65b7deceaef3c', '85');
INSERT INTO `tmp_grn_data` VALUES ('IS/INV/CB/000003', '100', 'TOYOTA SUPRA', '100.000', '10.000', '0.000', '0.000', '0.0000000000', '0.0000000000', '0.00', 'TEST1', '65b7dee1c66c2', '89');
INSERT INTO `tmp_grn_data` VALUES ('IS/INV/CB/000003', 'IT/0734', 'TEST111', '300.000', '50.000', '0.000', '0.000', '0.0000000000', '0.0000000000', '0.00', 'TEST2', '65b7dee1c66c2', '90');
INSERT INTO `tmp_grn_data` VALUES ('IS/INV/CB/000013', '100', 'TOYOTA SUPRA', '1000.000', '10.000', '3.000', '0.000', '10.0000000000', '1000.0000000000', '0.00', 'TEST1', '65b7df1be90d4', '92');
INSERT INTO `tmp_grn_data` VALUES ('IS/INV/CB/000013', 'IT/0727', '', '2000.000', '1.000', '0.000', '0.000', '10.0000000000', '200.0000000000', '0.00', '', '65b7df1be90d4', '93');
INSERT INTO `tmp_grn_data` VALUES ('IS/INV/CB/000010', 'IT/0727', '', '2000.000', '1.000', '0.000', '0.000', '0.0000000000', '0.0000000000', '0.00', '', '65b7e1746c875', '100');
INSERT INTO `tmp_grn_data` VALUES ('IS/INV/CB/000009', 'IT/0727', '', '2000.000', '1.000', '0.000', '0.000', '0.0000000000', '0.0000000000', '0.00', '', '65b87eb52641e', '101');
INSERT INTO `tmp_grn_data` VALUES ('IS/INV/CB/000012', 'IT/0727', '', '2000.000', '1.000', '0.000', '0.000', '0.0000000000', '0.0000000000', '0.00', '', '65b87ed27065f', '103');
INSERT INTO `tmp_grn_data` VALUES ('IS/INV/CB/000017', '100', 'TOYOTA SUPRA', '1000.000', '20.000', '0.000', '0.000', '5.0000000000', '1000.0000000000', '0.00', 'TEST1', '65b88298b4d95', '104');
INSERT INTO `tmp_grn_data` VALUES ('IS/INV/CB/000017', 'IT/0727', '', '2000.000', '1.000', '0.000', '0.000', '0.0000000000', '0.0000000000', '0.00', '', '65b88298b4d95', '105');
INSERT INTO `tmp_grn_data` VALUES ('IS/INV/CB/000017', 'IT/0734', 'TEST111', '300.000', '10.000', '0.000', '0.000', '10.0000000000', '300.0000000000', '0.00', 'TEST2', '65b88298b4d95', '106');

-- ----------------------------
-- Table structure for `tmp_grn_data_stores`
-- ----------------------------
CREATE TABLE `tmp_grn_data_stores` (
  `str_invno` varchar(20) NOT NULL DEFAULT '',
  `str_code` varchar(20) DEFAULT NULL,
  `str_description` varchar(50) DEFAULT NULL,
  `cur_rate` decimal(20,2) DEFAULT 0.00,
  `cur_qty` decimal(20,2) DEFAULT 0.00,
  `pre_ret_qty` decimal(20,2) DEFAULT NULL,
  `ret_qty` decimal(20,2) DEFAULT NULL,
  `dis_per` decimal(20,2) DEFAULT 0.00,
  `cur_discount` decimal(20,2) DEFAULT 0.00,
  `cur_subtot` decimal(20,2) DEFAULT 0.00,
  `brand` varchar(20) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_grn_data_stores
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_inv_data`
-- ----------------------------
CREATE TABLE `tmp_inv_data` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `str_invno` varchar(20) NOT NULL DEFAULT '',
  `str_code` varchar(20) DEFAULT NULL,
  `str_description` varchar(150) DEFAULT NULL,
  `cur_rate` float(20,2) DEFAULT 0.00,
  `cur_qty` decimal(20,2) DEFAULT 0.00,
  `dis_per` decimal(30,20) DEFAULT 0.00000000000000000000,
  `cur_discount` decimal(30,20) DEFAULT 0.00000000000000000000,
  `cur_subtot` float(20,2) DEFAULT 0.00,
  `actual_selling` float(20,2) DEFAULT 0.00,
  `brand` varchar(20) DEFAULT NULL,
  `ad` varchar(20) DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL,
  `serialno` varchar(100) DEFAULT NULL,
  `type` varchar(100) DEFAULT NULL,
  `cost` float(20,2) DEFAULT 0.00,
  `make` varchar(100) DEFAULT NULL,
  `design` varchar(100) DEFAULT NULL,
  `size` varchar(100) DEFAULT NULL,
  `user` varchar(100) DEFAULT NULL,
  `jobno` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_inv_data
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_inv_data_stores`
-- ----------------------------
CREATE TABLE `tmp_inv_data_stores` (
  `id` bigint(20) NOT NULL,
  `str_invno` varchar(20) NOT NULL DEFAULT '',
  `str_code` varchar(20) DEFAULT NULL,
  `str_description` varchar(50) DEFAULT NULL,
  `cur_rate` decimal(20,2) DEFAULT 0.00,
  `cur_qty` decimal(20,2) DEFAULT 0.00,
  `dis_per` decimal(20,10) DEFAULT 0.0000000000,
  `cur_discount` decimal(20,2) DEFAULT 0.00,
  `cur_subtot` decimal(20,2) DEFAULT 0.00,
  `actual_selling` decimal(20,2) DEFAULT 0.00,
  `brand` varchar(20) DEFAULT NULL,
  `ad` varchar(20) DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_inv_data_stores
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_inv_grn_serino`
-- ----------------------------
CREATE TABLE `tmp_inv_grn_serino` (
  `serino` varchar(50) DEFAULT '',
  `REF_NO` varchar(50) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `deli_date` date DEFAULT NULL,
  `C_CODE` varchar(20) DEFAULT NULL,
  `CUS_NAME` varchar(50) DEFAULT NULL,
  `veheno` varchar(50) DEFAULT NULL,
  `driver` varchar(50) DEFAULT NULL,
  `seri_datetime` datetime DEFAULT NULL,
  `TRNTYPE` varchar(10) DEFAULT NULL,
  `user_id` varchar(50) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_inv_grn_serino
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_inv_serino`
-- ----------------------------
CREATE TABLE `tmp_inv_serino` (
  `refno` varchar(20) DEFAULT NULL,
  `stk_no` varchar(20) DEFAULT NULL,
  `serino` varchar(50) DEFAULT NULL,
  `seri_datetime` datetime DEFAULT NULL,
  `id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_inv_serino
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_inv_serino_grn`
-- ----------------------------
CREATE TABLE `tmp_inv_serino_grn` (
  `refno` varchar(20) DEFAULT NULL,
  `stk_no` varchar(20) DEFAULT NULL,
  `serino` varchar(50) DEFAULT NULL,
  `seri_datetime` datetime DEFAULT NULL,
  `id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_inv_serino_grn
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_ord_data`
-- ----------------------------
CREATE TABLE `tmp_ord_data` (
  `id` bigint(20) NOT NULL,
  `str_invno` varchar(20) NOT NULL DEFAULT '',
  `str_code` varchar(20) DEFAULT NULL,
  `str_description` varchar(150) DEFAULT NULL,
  `cur_rate` decimal(20,2) DEFAULT 0.00,
  `cur_qty` decimal(20,2) DEFAULT 0.00,
  `dis_per` decimal(20,10) DEFAULT 0.0000000000,
  `cur_discount` decimal(20,10) DEFAULT 0.0000000000,
  `cur_subtot` decimal(20,2) DEFAULT 0.00,
  `actual_selling` decimal(20,2) DEFAULT 0.00,
  `brand` varchar(20) DEFAULT NULL,
  `ad` varchar(20) DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL,
  `tbr` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_ord_data
-- ----------------------------
INSERT INTO `tmp_ord_data` VALUES ('251639', 'IU/SO/1/0000001', 'IT/0011', '12.4/11.28 Ceat', '83000.00', '2.00', '0.0000000000', '0.0000000000', '166000.00', '0.00', 'Ceat', null, 'IU/SO/', null);

-- ----------------------------
-- Table structure for `tmp_out`
-- ----------------------------
CREATE TABLE `tmp_out` (
  `id` int(11) NOT NULL,
  `cuscode` varchar(20) DEFAULT NULL,
  `amount` float(20,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_out
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_po_data`
-- ----------------------------
CREATE TABLE `tmp_po_data` (
  `stk_no` varchar(50) DEFAULT NULL,
  `descript` varchar(150) DEFAULT NULL,
  `qty` float DEFAULT NULL,
  `rate` float DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL,
  `id` int(11) NOT NULL,
  `subtot` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_po_data
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_purord_data`
-- ----------------------------
CREATE TABLE `tmp_purord_data` (
  `tmp_no` varchar(30) DEFAULT NULL,
  `str_invno` varchar(20) NOT NULL DEFAULT '',
  `str_code` varchar(20) DEFAULT NULL,
  `str_description` varchar(100) DEFAULT '',
  `partno` varchar(50) DEFAULT '',
  `qty` decimal(20,2) DEFAULT 0.00,
  `subtotal` decimal(20,2) DEFAULT 0.00,
  `rate` decimal(20,2) DEFAULT 0.00,
  `user` varchar(100) DEFAULT NULL,
  `ID` int(20) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=208 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_purord_data
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_quot_data`
-- ----------------------------
CREATE TABLE `tmp_quot_data` (
  `str_invno` varchar(20) NOT NULL DEFAULT '',
  `str_code` varchar(20) DEFAULT NULL,
  `str_description` varchar(50) DEFAULT NULL,
  `cur_rate` decimal(20,2) DEFAULT 0.00,
  `cur_qty` decimal(20,2) DEFAULT 0.00,
  `dis_per` decimal(20,2) DEFAULT 0.00,
  `cur_discount` decimal(20,2) DEFAULT 0.00,
  `cur_subtot` decimal(20,2) DEFAULT 0.00,
  `brand` varchar(20) DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_quot_data
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_ret_chq_sett`
-- ----------------------------
CREATE TABLE `tmp_ret_chq_sett` (
  `recno` varchar(20) DEFAULT NULL,
  `chqno` varchar(30) DEFAULT NULL,
  `chqdate` varchar(20) DEFAULT NULL,
  `chqbank` varchar(30) DEFAULT NULL,
  `chqamt` decimal(20,2) DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_ret_chq_sett
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_salprofile`
-- ----------------------------
CREATE TABLE `tmp_salprofile` (
  `sal_ex` varchar(25) DEFAULT NULL,
  `sal_amo` float DEFAULT NULL,
  `id` int(11) NOT NULL,
  `mon` float DEFAULT NULL,
  `year` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_salprofile
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_sal_com`
-- ----------------------------
CREATE TABLE `tmp_sal_com` (
  `id` int(11) NOT NULL,
  `ref_no` varchar(50) DEFAULT NULL,
  `tmp_no` varchar(20) DEFAULT NULL,
  `c_code` varchar(20) DEFAULT NULL,
  `c_name` varchar(50) DEFAULT NULL,
  `inv_amo` float DEFAULT NULL,
  `out_amo` float DEFAULT NULL,
  `amo` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_sal_com
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_stk_take`
-- ----------------------------
CREATE TABLE `tmp_stk_take` (
  `id` int(11) NOT NULL,
  `REF_NO` varchar(255) DEFAULT NULL,
  `SDATE` varchar(255) DEFAULT NULL,
  `STK_NO` varchar(255) DEFAULT NULL,
  `DESCRIPT` varchar(255) DEFAULT NULL,
  `UNIT` varchar(255) DEFAULT NULL,
  `PART_NO` varchar(255) DEFAULT NULL,
  `COST` varchar(255) DEFAULT NULL,
  `PRICE` varchar(255) DEFAULT NULL,
  `QTY` varchar(255) DEFAULT NULL,
  `DEPARTMENT` varchar(255) DEFAULT NULL,
  `DIS_PER` varchar(255) DEFAULT NULL,
  `DIS_RS` varchar(255) DEFAULT NULL,
  `GROUP` varchar(255) DEFAULT NULL,
  `REP` varchar(255) DEFAULT NULL,
  `TAX_PER` varchar(255) DEFAULT NULL,
  `ret_qty` varchar(255) DEFAULT NULL,
  `BRAND` varchar(255) DEFAULT NULL,
  `DEV` varchar(255) DEFAULT '0',
  `damage` bigint(20) DEFAULT 0,
  `tmp_no` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_stk_take
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_stk_take_mas_undelever`
-- ----------------------------
CREATE TABLE `tmp_stk_take_mas_undelever` (
  `id` int(11) NOT NULL,
  `ref_no` varchar(255) DEFAULT NULL,
  `sdate` varchar(255) DEFAULT NULL,
  `cancell` varchar(255) DEFAULT '0',
  `tmp_no` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_stk_take_mas_undelever
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_stk_take_undelever`
-- ----------------------------
CREATE TABLE `tmp_stk_take_undelever` (
  `id` int(11) NOT NULL,
  `REF_NO` varchar(255) DEFAULT NULL,
  `SDATE` varchar(255) DEFAULT NULL,
  `STK_NO` varchar(255) DEFAULT NULL,
  `DESCRIPT` varchar(255) DEFAULT NULL,
  `UNIT` varchar(255) DEFAULT NULL,
  `PART_NO` varchar(255) DEFAULT NULL,
  `COST` varchar(255) DEFAULT NULL,
  `PRICE` varchar(255) DEFAULT NULL,
  `QTY` varchar(255) DEFAULT NULL,
  `DEPARTMENT` varchar(255) DEFAULT NULL,
  `DIS_PER` varchar(255) DEFAULT NULL,
  `DIS_RS` varchar(255) DEFAULT NULL,
  `GROUP` varchar(255) DEFAULT NULL,
  `REP` varchar(255) DEFAULT NULL,
  `TAX_PER` varchar(255) DEFAULT NULL,
  `ret_qty` varchar(255) DEFAULT NULL,
  `BRAND` varchar(255) DEFAULT NULL,
  `DEV` varchar(255) DEFAULT '0',
  `damage` varchar(255) DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL,
  `user_name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_stk_take_undelever
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_stock_adjust_data`
-- ----------------------------
CREATE TABLE `tmp_stock_adjust_data` (
  `str_invno` varchar(20) NOT NULL DEFAULT '',
  `str_code` varchar(20) DEFAULT NULL,
  `str_description` varchar(50) DEFAULT NULL,
  `partno` varchar(30) DEFAULT NULL,
  `cur_qty` decimal(20,2) DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_stock_adjust_data
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_stock_adjust_data_stores`
-- ----------------------------
CREATE TABLE `tmp_stock_adjust_data_stores` (
  `str_invno` varchar(20) NOT NULL DEFAULT '',
  `str_code` varchar(20) DEFAULT NULL,
  `str_description` varchar(50) DEFAULT NULL,
  `partno` varchar(30) DEFAULT NULL,
  `cur_qty` decimal(20,2) DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_stock_adjust_data_stores
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_svatrepo`
-- ----------------------------
CREATE TABLE `tmp_svatrepo` (
  `s_vat_no` varchar(50) DEFAULT NULL,
  `vat_no` varchar(50) DEFAULT NULL,
  `NAME` varchar(50) DEFAULT NULL,
  `REF_NO` varchar(50) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `id` int(11) NOT NULL,
  `GRAND_TOT` float DEFAULT NULL,
  `SVAT` float DEFAULT NULL,
  `c_code` varchar(50) DEFAULT NULL,
  `rtype` varchar(50) DEFAULT NULL,
  `cname` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_svatrepo
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_s_salma`
-- ----------------------------
CREATE TABLE `tmp_s_salma` (
  `id` bigint(20) NOT NULL,
  `REF_NO` varchar(255) DEFAULT NULL,
  `TRN_TYPE` varchar(255) DEFAULT NULL,
  `SDATE` date DEFAULT NULL,
  `C_CODE` varchar(255) DEFAULT NULL,
  `CUS_NAME` varchar(255) DEFAULT NULL,
  `C_ADD1` varchar(255) DEFAULT NULL,
  `TYPE` varchar(255) DEFAULT NULL,
  `SAL_EX` varchar(255) DEFAULT NULL,
  `DISCOU` decimal(20,2) DEFAULT 0.00,
  `AMOUNT` decimal(20,2) DEFAULT 0.00,
  `GST` decimal(20,2) DEFAULT 0.00,
  `GRAND_TOT` decimal(20,2) DEFAULT 0.00,
  `DUMMY_VAL` decimal(20,2) DEFAULT 0.00,
  `DIS` decimal(20,2) DEFAULT 0.00,
  `DIS1` decimal(20,2) DEFAULT 0.00,
  `DIS2` decimal(20,2) DEFAULT 0.00,
  `DIS_RUP` decimal(20,2) DEFAULT 0.00,
  `CASH` decimal(20,2) DEFAULT 0.00,
  `TOTPAY` decimal(20,2) DEFAULT 0.00,
  `ORD_NO` varchar(255) DEFAULT NULL,
  `ORD_DA` varchar(255) DEFAULT NULL,
  `SETTLED` varchar(255) DEFAULT NULL,
  `TOTPAY1` varchar(255) DEFAULT NULL,
  `DES_CAT` varchar(255) DEFAULT NULL,
  `DEPARTMENT` varchar(255) DEFAULT NULL,
  `REMARK` varchar(255) DEFAULT NULL,
  `CANCELL` varchar(255) DEFAULT '0',
  `BTT` varchar(255) DEFAULT NULL,
  `VAT` varchar(255) DEFAULT NULL,
  `VAT_VAL` decimal(20,2) DEFAULT 0.00,
  `Brand` varchar(255) DEFAULT NULL,
  `DEV` varchar(10) DEFAULT '0',
  `Account` varchar(255) DEFAULT NULL,
  `Accname` varchar(255) DEFAULT NULL,
  `Costcenter` varchar(255) DEFAULT NULL,
  `RET_AMO` decimal(20,2) DEFAULT 0.00,
  `cre_pe` int(11) DEFAULT NULL,
  `Comm` varchar(255) DEFAULT NULL,
  `red` varchar(255) DEFAULT NULL,
  `deli_date` date DEFAULT NULL,
  `seri_no` varchar(255) DEFAULT NULL,
  `points` varchar(255) DEFAULT NULL,
  `LOCK1` varchar(255) DEFAULT NULL,
  `deliin` varchar(255) DEFAULT NULL,
  `SVAT` decimal(8,0) DEFAULT 0,
  `REQ_DATE` date DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `vat_no` varchar(20) DEFAULT NULL,
  `s_vat_no` varchar(20) DEFAULT NULL,
  `veheno` varchar(30) DEFAULT NULL,
  `driver` varchar(30) DEFAULT NULL,
  `loaddate` date DEFAULT NULL,
  `pirnt_serial` varchar(5) DEFAULT NULL,
  `chk` varchar(5) DEFAULT '0',
  `userid` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_s_salma
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_s_sttr`
-- ----------------------------
CREATE TABLE `tmp_s_sttr` (
  `ID` int(11) NOT NULL,
  `ST_REFNO` varchar(20) DEFAULT NULL,
  `ST_DATE` date DEFAULT NULL,
  `ST_INVONO` varchar(20) DEFAULT NULL,
  `ST_PAID` decimal(20,2) DEFAULT 0.00,
  `ST_FLAG` varchar(3) DEFAULT NULL,
  `ST_INDATE` date DEFAULT NULL,
  `st_chbank` varchar(50) DEFAULT NULL,
  `st_days` bigint(20) DEFAULT 0,
  `ST_CHNO` varchar(15) DEFAULT NULL,
  `DUE` decimal(15,2) DEFAULT 0.00,
  `SETTLED_NO` bigint(20) DEFAULT 0,
  `DEV` varchar(1) DEFAULT '0',
  `ret_chval` decimal(15,2) DEFAULT 0.00,
  `ret_chset` decimal(15,2) DEFAULT 0.00,
  `st_chedate` date DEFAULT NULL,
  `st_chdate` date DEFAULT NULL,
  `cus_code` char(20) DEFAULT '',
  `ap_days` int(11) DEFAULT NULL,
  `comm` char(3) DEFAULT NULL,
  `ap_rem` varchar(100) DEFAULT NULL,
  `del_days` int(11) DEFAULT NULL,
  `deliin_days` bigint(20) DEFAULT 0,
  `deliin_amo` decimal(15,2) DEFAULT 0.00,
  `deliin_lock` char(1) DEFAULT '0',
  `department` char(1) DEFAULT NULL,
  `tmp_no` varchar(30) DEFAULT NULL,
  `chk` varchar(5) DEFAULT '0',
  `userid` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_s_sttr
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_trans_pay`
-- ----------------------------
CREATE TABLE `tmp_trans_pay` (
  `id` int(11) NOT NULL,
  `invno` varchar(50) DEFAULT NULL,
  `invdate` date DEFAULT NULL,
  `transamou` float(20,2) DEFAULT NULL,
  `transthtamou` float(20,2) DEFAULT NULL,
  `type` varchar(50) DEFAULT NULL,
  `remark` varchar(100) DEFAULT NULL,
  `code` varchar(50) DEFAULT NULL,
  `ref_no` varchar(20) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_trans_pay
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_utilization`
-- ----------------------------
CREATE TABLE `tmp_utilization` (
  `id` bigint(20) NOT NULL,
  `recno` varchar(30) DEFAULT NULL,
  `invno` varchar(50) DEFAULT '',
  `org_invdate` date DEFAULT NULL,
  `invdate` date DEFAULT NULL,
  `chqno` varchar(20) DEFAULT NULL,
  `chqdate` date DEFAULT NULL,
  `chbank` varchar(50) DEFAULT NULL,
  `settled` decimal(20,2) DEFAULT 0.00,
  `days` int(11) DEFAULT NULL,
  `invval` decimal(10,0) DEFAULT 0,
  `c1` decimal(20,2) DEFAULT 0.00,
  `c2` decimal(20,2) DEFAULT 0.00,
  `tmp_no` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_utilization
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_utilization_ret_chq_set`
-- ----------------------------
CREATE TABLE `tmp_utilization_ret_chq_set` (
  `recno` varchar(30) DEFAULT NULL,
  `docno` varchar(20) DEFAULT NULL,
  `docdate` varchar(30) DEFAULT NULL,
  `chequeno` varchar(50) DEFAULT NULL,
  `chequedate` varchar(20) DEFAULT NULL,
  `settled` varchar(10) DEFAULT NULL,
  `days` varchar(10) DEFAULT NULL,
  `retchbal` varchar(20) DEFAULT NULL,
  `retchqval` varchar(20) DEFAULT NULL,
  `col1` varchar(20) DEFAULT NULL,
  `col2` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_utilization_ret_chq_set
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_vat`
-- ----------------------------
CREATE TABLE `tmp_vat` (
  `vatno` varchar(50) DEFAULT NULL,
  `invdt` varchar(50) DEFAULT NULL,
  `invno` varchar(20) DEFAULT NULL,
  `SDATE` varchar(20) DEFAULT NULL,
  `REFNO` varchar(20) DEFAULT NULL,
  `AMOUNT` float DEFAULT NULL,
  `vatrate` float DEFAULT NULL,
  `c_code` varchar(20) DEFAULT NULL,
  `id` int(11) NOT NULL,
  `cus_name` varchar(255) DEFAULT NULL,
  `grand_tot` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_vat
-- ----------------------------

-- ----------------------------
-- Table structure for `tmp_weekly_tar`
-- ----------------------------
CREATE TABLE `tmp_weekly_tar` (
  `sal_ref` varchar(100) DEFAULT NULL,
  `ref_no` varchar(50) DEFAULT NULL,
  `tar_date` date DEFAULT NULL,
  `cus_code` varchar(50) DEFAULT NULL,
  `cus_name` varchar(100) DEFAULT NULL,
  `target` decimal(20,2) DEFAULT 0.00,
  `sale` decimal(20,2) DEFAULT NULL,
  `remark` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tmp_weekly_tar
-- ----------------------------

-- ----------------------------
-- Table structure for `tragets`
-- ----------------------------
CREATE TABLE `tragets` (
  `tar_date` date DEFAULT NULL,
  `C_CODE` varchar(255) DEFAULT NULL,
  `cusNAME` varchar(255) DEFAULT NULL,
  `TRAGET` decimal(20,2) DEFAULT 0.00,
  `REMARK` varchar(255) DEFAULT NULL,
  `TARDATE` varchar(20) DEFAULT NULL,
  `sale` decimal(20,2) DEFAULT 0.00,
  `tmp_no` varchar(50) DEFAULT NULL,
  `user_id` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of tragets
-- ----------------------------

-- ----------------------------
-- Table structure for `trans_pay_item`
-- ----------------------------
CREATE TABLE `trans_pay_item` (
  `id` int(11) NOT NULL,
  `ref_no` varchar(20) DEFAULT NULL,
  `invno` varchar(20) DEFAULT NULL,
  `invdate` date DEFAULT NULL,
  `transamou` float(20,2) DEFAULT NULL,
  `transthtamou` float(20,2) DEFAULT NULL,
  `type` varchar(20) DEFAULT NULL,
  `remark` varchar(200) DEFAULT NULL,
  `code` varchar(20) DEFAULT NULL,
  `sdate` date DEFAULT NULL,
  `cancel` varchar(1) DEFAULT '0',
  `name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Table structure for `vatgroup`
-- ----------------------------
CREATE TABLE `vatgroup` (
  `code` varchar(50) DEFAULT NULL,
  `vatno` varchar(40) DEFAULT NULL,
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of vatgroup
-- ----------------------------

-- ----------------------------
-- Table structure for `vatrate`
-- ----------------------------
CREATE TABLE `vatrate` (
  `sdate` date DEFAULT NULL,
  `vatrate` float DEFAULT NULL,
  `id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

-- ----------------------------
-- Records of vatrate
-- ----------------------------
INSERT INTO `vatrate` VALUES ('2014-12-31', '12', '8');
INSERT INTO `vatrate` VALUES ('2015-01-01', '11', '9');
INSERT INTO `vatrate` VALUES ('2016-05-01', '15', '10');
INSERT INTO `vatrate` VALUES ('2016-07-12', '11', '11');
INSERT INTO `vatrate` VALUES ('2016-11-01', '15', '12');
INSERT INTO `vatrate` VALUES ('2019-12-01', '8', '13');
INSERT INTO `vatrate` VALUES ('2022-06-01', '12', '14');
INSERT INTO `vatrate` VALUES ('2022-09-01', '15', '15');

-- ----------------------------
-- Table structure for `vender_sub`
-- ----------------------------
CREATE TABLE `vender_sub` (
  `c_code` varchar(20) DEFAULT NULL,
  `c_name` varchar(150) DEFAULT NULL,
  `c_add` varchar(200) DEFAULT NULL,
  `c_tele` varchar(30) DEFAULT NULL,
  `c_vatno` varchar(20) DEFAULT NULL,
  `c_svatno` varchar(20) DEFAULT NULL,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `c_main` varchar(20) DEFAULT '',
  `type` varchar(20) DEFAULT NULL,
  `c_add1` varchar(50) DEFAULT NULL,
  `town` varchar(20) DEFAULT NULL,
  `conp` varchar(50) DEFAULT NULL,
  `c_tele1` varchar(50) DEFAULT NULL,
  `CANCELL` varchar(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15771 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of vender_sub
-- ----------------------------
INSERT INTO `vender_sub` VALUES ('V/0001', 'CASH SALE', '', '', null, null, '15586', 'V/0001', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0013', 'Dimuthu Rubber Intusry', '13 Industrial elcapi Pannala.', '375621505', null, null, '15598', 'V/0013', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0014', 'DTH Superdag  ( pvt ) LTD', '35/6  shop place kaduruwela  polonnaruwa', '273287575', null, null, '15599', 'V/0014', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0016', 'ITH Uhana', 'No;160, Kandy Road Uhana ', '777845231', null, null, '15601', 'V/0016', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0017', 'ITH W/Shop', 'Uh, 43/1 Uhana Road Ampara ', '777843539', null, null, '15602', 'V/0017', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0018', 'Leader Automobile', 'Colombo road weligampitiya', '114820821', null, null, '15603', 'V/0018', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0019', 'M J R Peeris', 'NO;65, Maligawatte Place, Colombo 10', '814582453', null, null, '15604', 'V/0019', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0020', 'New Pradeep Enterprice', 'No,6/11 Bogahawaththa Pinwala Panadura ', '724212296', null, null, '15605', 'V/0020', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0023', 'S.K. Munasinghe Motors', '436, Havelock  Road, ', '112589432', null, null, '15608', 'V/0023', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0024', 'S.S, Distributor (MRF)', 'No:335, Pothuvil Road Town Divistion 05, Akkarapathth', '672279845', null, null, '15609', 'V/0024', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0026', 'Sanoon Tyre House', 'Akkarapaththu ', '773547353', null, null, '15611', 'V/0026', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0028', 'Super side', 'kalmunai', '672229907', null, null, '15613', 'V/0028', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0029', 'TVS Automotives ( PVT ) LTD', 'Haide Park Kooner Colombo 2', '777311745', null, null, '15614', 'V/0029', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0032', 'Nande Aiya', 'Pole Yana ', '0776749585', '', '', '15617', 'V/0032', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0033', 'DR. DANUSHKA', 'GENARAL HOSPITAL AMPARA', '0716803762', '', '', '15618', 'V/0033', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0034', 'K A DAMMIKA  ', 'UHANA POLICE  UHANA ', '0712544265', '', '', '15619', 'V/0034', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0035', 'SAMEERA ', '11/5 HIMIDURAWA UHANA', '0771244514', '', '', '15620', 'V/0035', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0036', 'IRESH LANKA TYRE HOUSE', 'KAKIRIHENA,MAHAOYA', '0778710789', '', '', '15621', 'V/0036', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0037', 'NILANTHA', 'POLE MALLI', '0757269886', '', '', '15622', 'V/0037', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0038', 'CHINTHAKA', '21/03 THISSAPURA, UHANA', '0771130789', '', '', '15623', 'V/0038', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0039', 'FAZAR', 'GENARAL HOSPITAL , ACCOUNTAN', '', '', '', '15624', 'V/0039', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0040', 'DILANKA', 'DEHIATHTHAKANDIYAW / S ', '', '', '', '15625', 'V/0040', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0041', 'CTB AMPARA', 'AMPARA OFFICE', '', '', '', '15626', 'V/0041', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0042', 'D.S SENANAYAKA NATIONAL SCHOOL', 'AMPARA', '', '', '', '15627', 'V/0042', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0043', 'H.L CHAMINDA', 'RAJAWAWA', '0788289387', '', '', '15628', 'V/0043', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0044', 'W.L PRADEEP SANJEEWA', 'AMPARA  WATER BOARD', '0761216671', '', '', '15629', 'V/0044', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0045', 'LASANTHA ', 'MAHAOYA', '0766856300', '', '', '15630', 'V/0045', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0046', 'WIJERATHNA', 'KANITU WIDUHALA PITUPASA UHANA', '0774025113', '', '', '15631', 'V/0046', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0047', 'Maduranga', ' ', '', '', '', '15632', 'V/0047', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0048', 'H.M.Sagara Madushanka', ' ', '0773919383', '', '', '15633', 'V/0048', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0049', 'DAMMIKA TIPAR', 'AMPARA', '0777708992', '', '', '15634', 'V/0049', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0050', 'AGRI BEEJA', 'AMPARA', '779679888', '', '', '15635', 'V/0050', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0051', 'H.L SHANTHA', 'AMPARA', '0775820261', '', '', '15636', 'V/0051', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0052', 'EDIRIWEERA COUNSTRCION', 'AMPARA', '0773203997', '', '', '15637', 'V/0052', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0053', 'DINUSADA TRAVELS', 'AMPARA - COLOMBO', '0770416725', '', '', '15638', 'V/0053', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0054', 'JAYANTHI METAL CRUSHER', 'AMPARA', '0634925578', '', '', '15639', 'V/0054', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0055', 'BAAI TRANSPROT', 'AKKARAPATTU', '0779770537', '', '', '15640', 'V/0055', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0056', 'IRUSHI BUS ND-3566', 'UHANA', '0777041293', '', '', '15641', 'V/0056', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0057', 'LIFE LINE', 'AMPARA', '0771325100', '', '', '15642', 'V/0057', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0059', 'Ranpasindu Travels', 'Uhana ', '0774049752', '', '', '15644', 'V/0059', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0061', 'Kalu Aiya', '24 Kolaniya bar ', '0775159117', '', '', '15646', 'V/0061', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0062', 'Sewana Pela Thawana', ' ', '0635670127', '', '', '15647', 'V/0062', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0064', 'Prasanna Transport', 'Weranketagoda. Uhana', '0779879669', '', '', '15649', 'V/0064', 'M', null, 'Uhana', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0065', 'Upali', 'Pradesiya sabawa Uhana', '0771392667', '', '', '15650', 'V/0065', 'M', null, 'Uhana', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0067', 'Upali Rajapaksha', '27/141, Walagampura ', '0778971568', '', '', '15652', 'V/0067', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0060', 'Gunakaru Sarath', 'Uhana', '0632250969', '', '', '15654', 'V/0060', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0058', 'Weerasiri Travels', '28/158, Weranketagoda', '0772374174', '', '', '15655', 'V/0058', 'M', null, 'Uhana', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0068', 'Thilak Stors', 'Mahakndiya ', '0769023425', '', '', '15656', 'V/0068', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0069', 'MR.ARAVINDA', 'GALLA', '', '', '', '15657', 'V/0069', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0070', 'RIZVAN', 'MATHARA', '0774568486', '', '', '15658', 'V/0070', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0071', 'MR SAMAN', 'AMPARA HOSPITAL', '', '', '', '15659', 'V/0071', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0072', 'RAJAMAHA WIHARAYA  ABEPURA', 'ABEPURA', '0771367786', '', '', '15660', 'V/0072', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0073', 'HEMALATHA', 'WERENKETAGODA', '0712492639', '', '', '15661', 'V/0073', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0074', 'RANJI MUDALALI', 'KONGAS HANDIYA UHANA', '0713787277', '', '', '15662', 'V/0074', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0075', 'SDB  BANK', 'UHANA', '', '', '', '15663', 'V/0075', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0077', 'E.M.Sunil Shantha', 'XL Palam Kadaura Uhana. ', '0774168916', '', '', '15666', 'V/0077', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0078', 'GUNARATHNA', 'UHANA', '0742779658', '', '', '15667', 'V/0078', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0079', 'NIRMALA', 'B 33/1 WELIKAHAGOLLA.', '0758700511', '', '', '15668', 'V/0079', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0080', 'MR.BANDARA', 'POLICE', '', '', '', '15669', 'V/0080', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0081', 'ASANKA', 'AMPARA', '0711532018', '', '', '15670', 'V/0081', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0082', 'SUMITH', 'AMPARA', '0713776918', '', '', '15671', 'V/0082', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0083', 'WATER BOARD OFFICE', 'AMPARA', '', '', '', '15672', 'V/0083', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0085', 'PRADEEP COUNSTRUCION', 'AMPARA', '', '', '', '15674', 'V/0085', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0086', 'DAMMIKA SED', 'WADINAGALA', '', '', '', '15675', 'V/0086', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0084', 'HASIDI FASION', 'UHANA', '0755277198 ', '', '', '15676', 'V/0084', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0076', 'DISANAYAKA RICE MILL', 'KAHATAGASYAYA', '', '', '', '15678', 'V/0076', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0087', 'DISANAYAKA HAL MOLA', '31/102  GONAGALA GONAGALA ', '', '', '', '15679', 'V/0087', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0088', 'SITHUMINA  TYRE HOUE', 'GONAGOLLA ', '', '', '', '15680', 'V/0088', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0089', 'MATHARA JUWALARY', '2 KANUWA , AMPARA ', '0714496616', '', '', '15681', 'V/0089', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0091', 'SANJEEWA ARMY CAMP', 'B 19 , 2 MUWANGALA ', '0773540112', '', '', '15683', 'V/0091', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0092', 'PRIYANTHA ', 'AMPARA ', '0702634192', '', '', '15684', 'V/0092', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0093', 'CHAMIKA TRAVELS', 'AMPARA ', '0774783107', '', '', '15686', 'V/0093', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0063', 'RANGANA TRAVELS', 'GONAGOLLA', '0772896597', '', '', '15687', 'V/0063', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0094', 'RUWAN TRAVELS', 'NAWAGAMPURA , AMPARA ', '0712456132', '', '', '15688', 'V/0094', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0095', 'SANJAYA LANKA', 'WEHERAGALA , AMPARA ', '0771165424', '', '', '15689', 'V/0095', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0096', 'M.C.T COUNSTRUCION', 'AMPARA ', '0773163294', '', '', '15690', 'V/0096', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0097', 'RANJAN LANKA', 'AMPARA ', '', '', '', '15691', 'V/0097', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0098', 'SAMANTHA CONSTRUCION', 'POLWATHTHA , AMPARA ', '0760365301', '', '', '15692', 'V/0098', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0099', 'GAYAN JAYASENA', 'AMPARA ', '0777582221', '', '', '15693', 'V/0099', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0100', 'KAVISHKKA TRAVELS', 'DEHIATHTHAKANDIYA ', '0713397070', '', '', '15694', 'V/0100', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0101', 'CREDIT CUSTOMER', 'W/S BILL ', '', '', '', '15695', 'V/0101', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0102', 'MAYADUNNA PANSALA', 'MAYADUNNA ', '0771946577', '', '', '15696', 'V/0102', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0103', 'GENARAL HOSPITAL', 'AMPARA', '', '', '', '15697', 'V/0103', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0104', 'Sujeeva', 'Walagampura ', '', '', '', '15698', 'V/0104', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0105', 'Dinesh', ' ', '0771228734', '', '', '15699', 'V/0105', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0106', 'Darsana', ' ', '0762963194', '', '', '15700', 'V/0106', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0090', 'JAYANTHA HAYLEYS', 'AMPARA', '0710891969', '', '', '15702', 'V/0090', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0107', 'BUDDADASA MAMA', 'WEERAGODA BUS ', '0711801515', '', '', '15703', 'V/0107', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0108', 'NANDIYAS SUNIL', 'AMPARA ', '0714442576', '', '', '15704', 'V/0108', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0109', 'ATHTHANAYAKA', 'AMPARA ', '', '', '', '15705', 'V/0109', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0110', 'LAKSHITHA TRAVELS', 'AMPARA ', '', '', '', '15706', 'V/0110', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0111', 'SUNIL PREMARATHNNA', 'AMPARA KALMUNA BUS', '', '', '', '15707', 'V/0111', 'M', null, 'KALMUNA BUS', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0112', 'Piyangala Pansala', ' ', '0789000889', '', '', '15708', 'V/0112', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0113', 'Sujeewa', 'Walagampura ', '', '', '', '15709', 'V/0113', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0114', 'R.M Bandara', ' ', '', '', '', '15710', 'V/0114', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0118', 'JAYAWARDANA FARM', 'UDEGIRIYA', '', '', '', '15715', 'V/0118', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0119', 'THILAK SCHOLL BUS', 'WEERAGODA , UHANA', '0711553611', '', '', '15716', 'V/0119', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0120', 'SITHARA TRAVELS', 'NUGELANDA ', '0773037414', '', '', '15717', 'V/0120', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0121', 'SUDATH', 'AMPARA', '0760978714', '', '', '15718', 'V/0121', 'M', null, null, null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0117', 'U DAG CUSTOMER', '', '', '', '', '15719', 'V/0117', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0116', 'CHANDAN', 'Dimo', '', '', '', '15720', 'V/0116', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0115', 'KALUM', '', '', '', '', '15721', 'V/0115', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0002', ' 3K HOLDING PVT LTD', 'Bibile Road, Monaragala.', '552273370', '', '', '15722', 'V/0002', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0005', 'ABDEN TYRE SERVICE', 'Main street Akkaraipattu', '777678671', '', '', '15723', 'V/0005', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0006', 'ACCEL AUTOMOBAIL PVT LTD ', 'Colombo road weligampitiya', '114820821', '', '', '15724', 'V/0006', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0007', 'APPOLO POINT TYRE SERVICE', 'Bendiwewa,Polonnaruwa', '113658746', '', '', '15725', 'V/0007', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0008', 'ARKING RETRADERS', '146/1, Madawala Road, Digana,Rajawella.', '72-4658011', '', '', '15726', 'V/0008', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0009', 'AUTODROME PVT LTD', '304,Union Place, Colombo 02.', '117847443', '', '', '15727', 'V/0009', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0066', 'BANDARA', '27/42, Walagampura', '0752559061', '', '', '15728', 'V/0066', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0031', 'WHEELS (PVT) LTD', 'No;209 Union Place, Colombo', '773996777', '', '', '15729', 'V/0031', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0027', 'SISIRA  TYRE  HOUSE', 'Katupitiya Road, Kosgolla,Kurunagala ', '353354779', '', '', '15730', 'V/0027', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0012', 'CEAT KELANI INTERNATIONAL TYRE', 'P.O. Box 53 Nungamugoda, Kelaniya, Sri Lanka', '714534826', '', '', '15731', 'V/0012', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0011', ' BROWNS &  COMPANY LTD', 'Battery Division,107B,Havelock Road, Colombo 05.', '773139304', '', '', '15732', 'V/0011', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0025', 'SAMSON RUBBER INDUSTRY', 'Jinasena Mawatha Mahara Kadawatha, Sri Lanka', '777815621', '', '', '15733', 'V/0025', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0022', 'ROAD WIN INTERNATIONAL (PVT)  LTD', 'No. 1399/6, Hokandara Road,', '114971234', '', '', '15734', 'V/0022', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0021', 'PERERA  TYRE SERVICE  (PVT) LTD', 'No:773/1, Thalamgama North, Malabe ', '777311745', '', '', '15735', 'V/0021', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0030', 'TYRE  HOUSE  TRADING (PVT)  LTD', 'No;221.1/4 Siri Sangaraja Mawatha Colombo 10.', '714163346', '', '', '15736', 'V/0030', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0010', 'BENADICTSON', '221/1/2 Sri Sangaraja Mawatha Colombo 10.', '115445400', '', '', '15737', 'V/0010', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0004', 'RICHARD  PIRIS  ORGIN', 'P.O.Box 16, Navinna Maharagama Colombo ', '814476996', '', '', '15738', 'V/0004', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0003', 'RICHARD PIRIS  DAK', 'BOI industrial Park Pallecale, Kandy ', '114310710', '', '', '15739', 'V/0003', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0015', 'FERENTINO TYRE CORPORATION (PVT) LTD', '25,Alfred Plase, Colombo 3, Sri Lanka', '112144444', '', '', '15740', 'V/0015', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0122', 'CHANDANI JAYASINHA', 'POLICE AMPARA', '0757176574', '', '', '15741', 'V/0122', 'M', null, 'AMPARA', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0123', 'A', '', '', '', '', '15743', 'V/0123', 'M', null, '', null, null, '1');
INSERT INTO `vender_sub` VALUES ('V/0126', 'Name', ' ', '', '', '', '15748', 'V/0126', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0127', 'Name', ' ', '', '', '', '15749', 'V/0127', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0128', 'Name 3', ' ', '', '', '', '15750', 'V/0128', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0129', 'Name 4', ' ', '', '', '', '15751', 'V/0129', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0125', 'C', 'E', '1', 'J', 'M', '15754', 'V/0125', 'M', null, 'G', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0124', 'C', 'E', '1', 'I', 'L', '15759', 'V/0124', 'M', null, 'G', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0131', 'Name 6', '', '', '', '', '15764', 'V/0131', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0130', 'Name 5', '', '', '', '', '15767', 'V/0130', 'M', null, '', null, null, '0');
INSERT INTO `vender_sub` VALUES ('V/0132', 'Name 7', 'maharagama', '', '', '', '15770', 'V/0132', 'M', null, '', null, null, '1');

-- ----------------------------
-- Table structure for `vendor`
-- ----------------------------
CREATE TABLE `vendor` (
  `CODE` varchar(30) DEFAULT NULL,
  `NAME` varchar(100) DEFAULT NULL,
  `ADD1` varchar(100) DEFAULT NULL,
  `ADD2` varchar(100) DEFAULT NULL,
  `OPBAL` float(30,0) DEFAULT NULL,
  `TELE1` varchar(50) DEFAULT NULL,
  `TELE2` varchar(50) DEFAULT NULL,
  `CONT` varchar(50) DEFAULT NULL,
  `CUR_BAL` varchar(30) DEFAULT NULL,
  `OPDATE` date DEFAULT NULL,
  `cLIMIT` varchar(30) DEFAULT NULL,
  `PEN` varchar(30) DEFAULT NULL,
  `PENDA` varchar(30) DEFAULT NULL,
  `FAX` varchar(50) DEFAULT NULL,
  `EMAIL` varchar(50) DEFAULT NULL,
  `vatno` varchar(50) DEFAULT NULL,
  `acno` varchar(30) DEFAULT NULL,
  `CAT` varchar(10) DEFAULT NULL,
  `RET_CHEQ` varchar(30) DEFAULT NULL,
  `rep` varchar(20) DEFAULT NULL,
  `cus_type` varchar(30) DEFAULT NULL,
  `note` varchar(8000) DEFAULT NULL,
  `AltMessage` varchar(8000) DEFAULT NULL,
  `bank_gr_date` date DEFAULT NULL,
  `temp_limit` varchar(30) DEFAULT NULL,
  `blacklist` varchar(30) DEFAULT NULL,
  `o90` varchar(30) DEFAULT NULL,
  `Over_DUE_IG_Date` date DEFAULT NULL,
  `area` varchar(50) DEFAULT NULL,
  `provi` varchar(50) DEFAULT NULL,
  `pen2` varchar(50) DEFAULT NULL,
  `incdays` varchar(30) DEFAULT NULL,
  `chk_bangr` varchar(30) DEFAULT NULL,
  `field1` varchar(30) DEFAULT NULL,
  `PEN0` varchar(30) DEFAULT NULL,
  `svatno` varchar(50) DEFAULT NULL,
  `commoncode` varchar(50) DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL,
  `remark` varchar(200) DEFAULT NULL,
  `vatgroup` varchar(50) DEFAULT NULL,
  `m_code` varchar(10) DEFAULT NULL,
  `m_name` varchar(50) DEFAULT NULL,
  `district` varchar(50) DEFAULT NULL,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `province` varchar(90) DEFAULT NULL,
  `CANCELL` varchar(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13052 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of vendor
-- ----------------------------
INSERT INTO `vendor` VALUES ('V/0001', 'CASH SALE', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 'S', null, null, null, null, null, null, '0', '0', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, '12919', null, '0');
INSERT INTO `vendor` VALUES ('V/0019', 'M J R Peeris', 'NO;65, Maligawatte Place, Colombo 10', null, null, '814582453', null, null, null, null, null, null, null, null, null, null, null, 'S', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, '12937', null, '0');
INSERT INTO `vendor` VALUES ('V/0020', 'New Pradeep Enterprice', 'No,6/11 Bogahawaththa Pinwala Panadura ', null, null, '724212296', null, null, null, null, null, null, null, null, null, null, null, 'S', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, '12938', null, '0');
INSERT INTO `vendor` VALUES ('V/0021', 'PERERA  TYRE SERVICE  (PVT) LTD', 'No:773/1, Thalamgama North, Malabe ', '', null, '777311745', '', '', '', '0000-00-00', '0', '', '', '', '', '', '', 'S', null, '', '', null, '', '0000-00-00', null, null, null, null, '', null, null, '', '', '', null, '', '', null, '', '', null, null, '', '12939', '', '0');
INSERT INTO `vendor` VALUES ('V/0022', 'ROAD WIN INTERNATIONAL (PVT)  LTD', 'No. 1399/6, Hokandara Road,', '', null, '114971234', '', '', '', '0000-00-00', '0', '', '', '', '', '', '', 'S', null, '', '', null, '', '0000-00-00', null, null, null, null, '', null, null, '', '', '', null, '', '', null, '', '', null, null, '', '12940', '', '0');
INSERT INTO `vendor` VALUES ('V/0023', 'S.K. Munasinghe Motors', '436, Havelock  Road, ', null, null, '112589432', null, null, null, null, null, null, null, null, null, null, null, 'S', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, '12941', null, '0');
INSERT INTO `vendor` VALUES ('V/0024', 'S.S, Distributor (MRF)', 'No:335, Pothuvil Road Town Divistion 05, Akkarapathth', null, null, '672279845', null, null, null, null, null, null, null, null, null, null, null, 'S', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, '12942', null, '0');
INSERT INTO `vendor` VALUES ('V/0025', 'SAMSON RUBBER INDUSTRY', 'Jinasena Mawatha Mahara Kadawatha, Sri Lanka', '', null, '777815621', '', '', '', '0000-00-00', '0', '', '', '', '', '', '', 'S', null, '', '', null, '', '0000-00-00', null, null, null, null, '', null, null, '', '', '', null, '', '', null, '', '', null, null, '', '12943', '', '0');
INSERT INTO `vendor` VALUES ('V/0026', 'Sanoon Tyre House', 'Akkarapaththu ', null, null, '773547353', null, null, null, null, null, null, null, null, null, null, null, 'S', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, '12944', null, '0');
INSERT INTO `vendor` VALUES ('V/0027', 'SISIRA  TYRE  HOUSE', 'Katupitiya Road, Kosgolla,Kurunagala ', '', null, '353354779', '', '', '-343455', '0000-00-00', '0', '', '', '', '', '', '', 'S', null, '', '', null, '', '0000-00-00', '0', null, null, null, '', null, null, '', '', '', null, '', '', null, '', '', null, null, '', '12945', '', '0');
INSERT INTO `vendor` VALUES ('V/0124', 'C', 'E', 'G', null, '1', '2', 'A', 'F', '2023-12-13', '1', 'H', '', 'J', 'K', 'I', 'B', 'C', null, 'All', '', 'NOTE', 'MESSAGE', '0000-00-00', null, '1', null, '2023-12-11', '', null, null, '30', '', '', null, 'L', '', null, 'M', '', null, null, '', '13042', '', '0');
INSERT INTO `vendor` VALUES ('V/0125', 'C', 'E', 'G', null, '1', '2', 'A', 'F', '2023-12-11', '1', 'I', '', 'K', 'L', 'J', 'B', 'C', null, 'All', '', 'AA', '', '0000-00-00', null, '0', null, '2023-12-11', '', null, null, '30', '', '', null, 'M', '', null, 'N', 'PRIVATE', null, null, '2', '13043', 'Northern', '0');
INSERT INTO `vendor` VALUES ('V/0126', 'Name', '', '', null, '', '', '', '', '2023-12-11', '', '', null, '', '', '', '', 'C', null, '', '', null, '', '0000-00-00', null, null, null, null, '', null, null, '', '', '', null, '', null, null, '', '', null, null, '', '13044', '', '1');
INSERT INTO `vendor` VALUES ('V/0127', 'Name', '', '', null, '', '', '', '', '2023-12-11', '', '', null, '', '', '', '', 'C', null, '', '', null, '', '0000-00-00', null, null, null, null, '', null, null, '', '', '', null, '', null, null, '', '', null, null, '', '13045', '', '0');
INSERT INTO `vendor` VALUES ('V/0128', 'Name 3', '', '', null, '', '', '', '', '2023-12-11', '1', '', null, '', '', '', '', 'C', null, '', '', null, '', '0000-00-00', null, '0', null, null, '', null, null, '', '', '', null, '', null, null, '', 'PRIVATE', null, null, '3', '13046', 'Northern', '0');
INSERT INTO `vendor` VALUES ('V/0129', 'Name 4', '', '', null, '', '', '', '', '2023-12-11', '1', '', null, '', '', '', '', 'C', null, '', '', null, '', '0000-00-00', null, '1', null, null, '', null, null, '', '', '', null, '', null, null, '', 'GOVNON', null, null, '1', '13047', 'North Central', '0');
INSERT INTO `vendor` VALUES ('V/0130', 'Name 5', '', '', null, '', '', '', '', '2023-12-13', '339', '', '', '', '', '', '', 'C', null, '', '', null, '', '0000-00-00', null, '1', null, null, '', null, null, '', '', '', null, '', '', null, '', '', null, null, '', '13049', '', '0');
INSERT INTO `vendor` VALUES ('V/0131', 'Name 6', '', '', null, '', '', '', '', '2023-12-13', '', '', '', '', '', '', '', 'C', null, '', '', '', '', '0000-00-00', null, null, null, null, '', null, null, '', '', '', null, '', '', null, '', '', null, null, '', '13050', '', '1');
INSERT INTO `vendor` VALUES ('V/0132', 'Name 7', 'maharagama', '', null, '', '', '', '', '2023-12-20', '', '', '', '', '', '', '', 'C', null, '', '', 'HUTTOddsadasaasdasdoya wenne bnwwwwss', '', '0000-00-00', '0', null, null, null, '', null, null, '', '', '', null, '', '', null, '', '', null, null, '', '13051', '', '1');

-- ----------------------------
-- Table structure for `warrenty_details`
-- ----------------------------
CREATE TABLE `warrenty_details` (
  `id` int(11) NOT NULL,
  `arnno` varchar(50) DEFAULT NULL,
  `arndate` date DEFAULT NULL,
  `description` varchar(100) DEFAULT NULL,
  `stkno` varchar(20) DEFAULT NULL,
  `expdate` date DEFAULT NULL,
  `barcode` varchar(100) DEFAULT NULL,
  `cancel` varchar(1) DEFAULT '0',
  `invno` varchar(20) DEFAULT NULL,
  `invdate` date DEFAULT NULL,
  `cuscode` varchar(20) DEFAULT NULL,
  `cusname` varchar(50) DEFAULT NULL,
  `solddate` date DEFAULT NULL,
  `remark` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of warrenty_details
-- ----------------------------

-- ----------------------------
-- Table structure for `week`
-- ----------------------------
CREATE TABLE `week` (
  `id` int(11) NOT NULL,
  `syear` bigint(20) DEFAULT 0,
  `sMonth` bigint(20) DEFAULT 0,
  `week` bigint(20) DEFAULT 0,
  `dtFrom` date DEFAULT NULL,
  `Dtto` date DEFAULT NULL,
  `tmp_no` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of week
-- ----------------------------

-- ----------------------------
-- Table structure for `week_tragets`
-- ----------------------------
CREATE TABLE `week_tragets` (
  `refno` char(15) DEFAULT NULL,
  `rep` varchar(5) DEFAULT NULL,
  `Tardate` date DEFAULT NULL,
  `cus_code` char(10) DEFAULT NULL,
  `Target` decimal(12,2) DEFAULT 0.00,
  `remark` char(20) DEFAULT NULL,
  `Sale` decimal(15,2) DEFAULT 0.00,
  `dtfrom` date DEFAULT NULL,
  `DTTTO` date DEFAULT NULL,
  `id` int(11) NOT NULL,
  `Tyres` decimal(15,2) DEFAULT 0.00,
  `battery` decimal(15,2) DEFAULT 0.00,
  `MC_battery` decimal(15,2) DEFAULT 0.00,
  `Tube` decimal(15,2) DEFAULT 0.00,
  `a_wheel` decimal(15,2) DEFAULT 0.00,
  `tmp_no` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of week_tragets
-- ----------------------------

-- ----------------------------
-- View structure for `chk_crnfrm_salma`
-- ----------------------------
DROP VIEW IF EXISTS `chk_crnfrm_salma`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `chk_crnfrm_salma` AS select `s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`REF_NO` AS `REF_NO`,`s_crnfrmtrn`.`Inv_no` AS `Inv_no`,`s_crnfrmtrn`.`Incen_per` AS `Incen_per`,`s_crnfrmtrn`.`Incen_val` AS `Incen_val` from (`s_crnfrmtrn` join `s_salma` on(`s_crnfrmtrn`.`Inv_no` = `s_salma`.`REF_NO`));

-- ----------------------------
-- View structure for `chk_district_towns`
-- ----------------------------
DROP VIEW IF EXISTS `chk_district_towns`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `chk_district_towns` AS select `district_town_master`.`towns` AS `towns`,`district_town_master`.`district` AS `district`,`district_town_master`.`id` AS `id`,`district_province_master`.`province` AS `province`,`district_province_master`.`district` AS `dis_mas` from (`district_town_master` join `district_province_master` on(`district_town_master`.`province` = `district_province_master`.`province`));

-- ----------------------------
-- View structure for `chk_invstores`
-- ----------------------------
DROP VIEW IF EXISTS `chk_invstores`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `chk_invstores` AS select `s_trn`.`STK_NO` AS `STK_NO`,`s_trn`.`REFNO` AS `REFNO`,`s_trn`.`QTY` AS `QTY`,`s_trn_stores`.`STK_NO` AS `tstkno`,`s_trn_stores`.`REFNO` AS `trefno`,`s_trn_stores`.`QTY` AS `tqty` from (`s_trn` left join `s_trn_stores` on(`s_trn_stores`.`REFNO` = `s_trn`.`REFNO` and `s_trn_stores`.`STK_NO` = `s_trn`.`STK_NO`));

-- ----------------------------
-- View structure for `chk_stores_salma`
-- ----------------------------
DROP VIEW IF EXISTS `chk_stores_salma`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `chk_stores_salma` AS select `s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`deli_date` AS `deli_date`,`s_trn_stores`.`REFNO` AS `REFNO`,`s_trn_stores`.`SDATE` AS `strn_date`,`s_trn_stores`.`ID` AS `ID`,`s_trn_stores`.`STK_NO` AS `STK_NO`,`s_trn_stores`.`DONO` AS `DONO` from (`s_trn_stores` join `s_salma` on(`s_salma`.`REF_NO` = `s_trn_stores`.`REFNO`));

-- ----------------------------
-- View structure for `chk_strn_stores`
-- ----------------------------
DROP VIEW IF EXISTS `chk_strn_stores`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `chk_strn_stores` AS select `s_trn_stores`.`ID` AS `ID`,`s_trn_stores`.`STK_NO` AS `STK_NO`,`s_trn_stores`.`REFNO` AS `REFNO`,`s_trn_stores`.`SDATE` AS `SDATE`,`s_trn_stores`.`DONO` AS `DONO`,`chk_undelive`.`refno` AS `strnrefno` from (`s_trn_stores` join `chk_undelive` on(`s_trn_stores`.`REFNO` like concat('%',`chk_undelive`.`refno`,'%')));

-- ----------------------------
-- View structure for `chk_vendor_district`
-- ----------------------------
DROP VIEW IF EXISTS `chk_vendor_district`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `chk_vendor_district` AS select `vendor`.`CODE` AS `CODE`,`vendor`.`district` AS `district`,`vendor`.`province` AS `province`,`chk_import_dealer_province`.`import_district` AS `import_district`,`chk_import_dealer_province`.`import_province` AS `import_province`,`vendor`.`ADD1` AS `ADD1`,`vendor`.`NAME` AS `NAME`,`vendor`.`ADD2` AS `ADD2` from (`chk_import_dealer_province` join `vendor` on(`vendor`.`CODE` = `chk_import_dealer_province`.`c_code`));

-- ----------------------------
-- View structure for `printinv`
-- ----------------------------
DROP VIEW IF EXISTS `printinv`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `printinv` AS select `s_invo`.`id` AS `id`,`s_invo`.`REF_NO` AS `REF_NO`,`s_invo`.`SDATE` AS `SDATE`,`s_invo`.`STK_NO` AS `STK_NO`,`s_invo`.`DESCRIPT` AS `DESCRIPT`,`s_invo`.`UNIT` AS `UNIT`,`s_invo`.`PART_NO` AS `PART_NO`,`s_invo`.`COST` AS `COST`,`s_invo`.`PRICE` AS `PRICE`,`s_invo`.`QTY` AS `QTY`,`s_invo`.`DEPARTMENT` AS `DEPARTMENT`,`s_invo`.`DIS_per` AS `DIS_per`,`s_invo`.`DIS_rs` AS `DIS_rs`,`s_invo`.`REP` AS `REP`,`s_invo`.`TAX_PER` AS `TAX_PER`,`s_invo`.`ret_qty` AS `ret_qty`,`s_invo`.`BRAND` AS `BRAND`,`s_invo`.`DEV` AS `DEV`,`s_invo`.`CANCELL` AS `CANCELL`,`s_invo`.`c_code` AS `c_code`,`s_invo`.`seri_no` AS `seri_no`,`s_invo`.`Print_dis1` AS `Print_dis1`,`s_invo`.`Print_dis2` AS `Print_dis2`,`s_invo`.`vatrate` AS `vatrate`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`DEV` AS `SALMA_DEV` from (`s_invo` left join `s_salma` on(`s_invo`.`REF_NO` = `s_salma`.`REF_NO`));

-- ----------------------------
-- View structure for `print_repord`
-- ----------------------------
DROP VIEW IF EXISTS `print_repord`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `print_repord` AS select `s_cusordmas`.`VAT` AS `VAT`,`s_cusordtrn`.`id` AS `id`,`s_cusordtrn`.`REF_NO` AS `REF_NO`,`s_cusordtrn`.`SDATE` AS `SDATE`,`s_cusordtrn`.`STK_NO` AS `STK_NO`,`s_cusordtrn`.`DESCRIPT` AS `DESCRIPT`,`s_cusordtrn`.`UNIT` AS `UNIT`,`s_cusordtrn`.`PART_NO` AS `PART_NO`,`s_cusordtrn`.`COST` AS `COST`,`s_cusordtrn`.`PRICE` AS `PRICE`,`s_cusordtrn`.`QTY` AS `QTY`,`s_cusordtrn`.`DEPARTMENT` AS `DEPARTMENT`,`s_cusordtrn`.`DIS_per` AS `DIS_per`,`s_cusordtrn`.`DIS_rs` AS `DIS_rs`,`s_cusordtrn`.`REP` AS `REP`,`s_cusordtrn`.`TAX_PER` AS `TAX_PER`,`s_cusordtrn`.`ret_qty` AS `ret_qty`,`s_cusordtrn`.`BRAND` AS `BRAND`,`s_cusordtrn`.`DEV` AS `DEV`,`s_cusordtrn`.`CANCELL` AS `CANCELL`,`s_cusordtrn`.`c_code` AS `c_code`,`s_cusordtrn`.`stk` AS `stk`,`s_cusordtrn`.`inv_qty` AS `inv_qty` from (`s_cusordtrn` join `s_cusordmas` on(`s_cusordtrn`.`REF_NO` = `s_cusordmas`.`REF_NO`));

-- ----------------------------
-- View structure for `ret_ch_sett`
-- ----------------------------
DROP VIEW IF EXISTS `ret_ch_sett`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `ret_ch_sett` AS select `s_cheq`.`CR_REFNO` AS `CR_REFNO`,`s_cheq`.`CR_DATE` AS `CR_DATE`,`s_cheq`.`CR_REGEREF` AS `CR_REGEREF`,`s_cheq`.`CR_CRNO` AS `CR_CRNO`,`s_cheq`.`CR_CRVAL` AS `CR_CRVAL`,`s_cheq`.`CR_CRDATE` AS `CR_CRDATE`,`s_cheq`.`CR_C_CODE` AS `CR_C_CODE`,`s_cheq`.`CR_C_NAME` AS `CR_C_NAME`,`s_cheq`.`CR_C_ADD` AS `CR_C_ADD`,`s_cheq`.`CR_CHNO` AS `CR_CHNO`,`s_cheq`.`CR_CHEVAL` AS `CR_CHEVAL`,`s_cheq`.`CR_REPAY` AS `CR_REPAY`,`s_cheq`.`CR_CHDATE` AS `CR_CHDATE`,`s_cheq`.`CR_BANK` AS `CR_BANK`,`s_cheq`.`CR_RESON` AS `CR_RESON`,`s_cheq`.`CR_RESON1` AS `CR_RESON1`,`s_cheq`.`CR_REPOSIT` AS `CR_REPOSIT`,`s_cheq`.`REDEPOSITDATE` AS `REDEPOSITDATE`,`s_cheq`.`REDEPOSITREF` AS `REDEPOSITREF`,`s_cheq`.`CR_FLAG` AS `CR_FLAG`,`s_cheq`.`PAID` AS `PAID`,`s_cheq`.`S_REF` AS `S_REF`,`s_cheq`.`DEPARTMENT` AS `DEPARTMENT`,`s_cheq`.`REMARK` AS `REMARK`,`s_cheq`.`DEBACC` AS `DEBACC`,`s_cheq`.`CREACC` AS `CREACC`,`s_cheq`.`dev` AS `dev`,`ch_sttr`.`ST_REFNO` AS `ST_REFNO`,`ch_sttr`.`ST_DATE` AS `ST_DATE`,`ch_sttr`.`ST_INVONO` AS `ST_INVONO`,`ch_sttr`.`ST_PAID` AS `ST_PAID`,`ch_sttr`.`ST_FLAG` AS `ST_FLAG`,`ch_sttr`.`ST_CHBANK` AS `ST_CHBANK`,`ch_sttr`.`ST_DAYS` AS `ST_DAYS`,`ch_sttr`.`ST_CHNO` AS `ST_CHNO`,`ch_sttr`.`DUE` AS `DUE`,`ch_sttr`.`SETTLED_NO` AS `SETTLED_NO`,`ch_sttr`.`RET_CHVAL` AS `RET_CHVAL`,`ch_sttr`.`RET_CHSET` AS `RET_CHSET`,`ch_sttr`.`ST_CHEDATE` AS `ST_CHEDATE`,`ch_sttr`.`id` AS `id`,`ch_sttr`.`ex_flag` AS `ex_flag`,`s_cheq`.`ret_chno` AS `ret_chno`,`s_crec`.`pay_type` AS `pay_type` from ((`s_cheq` join `ch_sttr` on(`s_cheq`.`CR_REFNO` = `ch_sttr`.`ST_INVONO`)) join `s_crec` on(`ch_sttr`.`ST_REFNO` = `s_crec`.`CA_REFNO`));

-- ----------------------------
-- View structure for `sarath_salma`
-- ----------------------------
DROP VIEW IF EXISTS `sarath_salma`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `sarath_salma` AS select `s_salma`.`c_code1` AS `c_code1`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`C_ADD1` AS `C_ADD1` from `s_salma` group by `s_salma`.`CUS_NAME`,`s_salma`.`C_CODE`;

-- ----------------------------
-- View structure for `tmp_view_sttr_crec`
-- ----------------------------
DROP VIEW IF EXISTS `tmp_view_sttr_crec`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `tmp_view_sttr_crec` AS select `s_crec`.`CA_DATE` AS `CA_DATE`,`s_sttr`.`ST_REFNO` AS `ST_REFNO`,`s_sttr`.`ST_DATE` AS `ST_DATE` from (`s_sttr` join `s_crec` on(`s_sttr`.`ST_REFNO` = `s_crec`.`CA_REFNO`));

-- ----------------------------
-- View structure for `viewarn`
-- ----------------------------
DROP VIEW IF EXISTS `viewarn`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `viewarn` AS select `s_purtrn`.`REFNO` AS `REFNO`,`s_purtrn`.`SDATE` AS `SDATE`,`s_purtrn`.`STK_NO` AS `STK_NO`,`s_purtrn`.`DESCRIPT` AS `DESCRIPT`,`s_purtrn`.`COST` AS `COST`,`s_purtrn`.`MARGIN` AS `MARGIN`,`s_purtrn`.`SELLING` AS `SELLING`,`s_purtrn`.`REC_QTY` AS `REC_QTY`,`s_purtrn`.`FOB` AS `FOB`,`s_purtrn`.`DEPARTMENT` AS `DEPARTMENT`,`s_purtrn`.`QTYINHAND` AS `QTYINHAND`,`s_purtrn`.`O_QTY` AS `O_QTY`,`s_purtrn`.`DISCOUNT` AS `DISCOUNT`,`s_purtrn`.`ret_qty` AS `ret_qty`,`s_purtrn`.`Cost_c` AS `Cost_c`,`s_purtrn`.`cost_seling` AS `cost_seling`,`s_purtrn`.`cost_margin` AS `cost_margin`,`s_purtrn`.`CANCEL` AS `CANCEL`,`s_purtrn`.`ID` AS `ID`,`s_purtrn`.`acc_cost` AS `acc_cost`,`s_purtrn`.`acc_cost_c` AS `acc_cost_c`,`s_purtrn`.`soldqty` AS `soldqty`,`s_purtrn`.`brand` AS `brand`,`s_purtrn`.`days` AS `days`,`s_purtrn`.`vatrate` AS `vatrate`,`s_mas`.`UNIT` AS `UNIT`,`s_mas`.`SIZE` AS `SIZE`,`s_mas`.`QTYINHAND` AS `qty`,`s_mas`.`PART_NO` AS `PART_NO` from (`s_purtrn` left join `s_mas` on(`s_purtrn`.`STK_NO` = `s_mas`.`STK_NO`));

-- ----------------------------
-- View structure for `viewcrn2`
-- ----------------------------
DROP VIEW IF EXISTS `viewcrn2`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `viewcrn2` AS select `s_crnma`.`REF_NO` AS `REF_NO`,`s_crnma`.`DDATE` AS `DDATE`,`s_crnma`.`TRN_TYPE` AS `TRN_TYPE`,`s_crnma`.`INVOICENO` AS `INVOICENO`,`s_crnma`.`SDATE` AS `SDATE`,`s_crnma`.`C_CODE` AS `C_CODE`,`s_crnma`.`CUS_NAME` AS `CUS_NAME`,`s_crnma`.`TYPE` AS `TYPE`,`s_crnma`.`SAL_EX` AS `SAL_EX`,`s_crnma`.`DISCOU` AS `DISCOU`,`s_crnma`.`AMOUNT` AS `AMOUNT`,`s_crnma`.`GST` AS `GST`,`s_crnma`.`GRAND_TOT` AS `GRAND_TOT`,`s_crnma`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_crnma`.`DIS` AS `DIS`,`s_crnma`.`DIS1` AS `DIS1`,`s_crnma`.`DIS_RUP` AS `DIS_RUP`,`s_crnma`.`CASH` AS `CASH`,`s_crnma`.`TOT_REPAY` AS `TOT_REPAY`,`s_crnma`.`DEPARTMENT` AS `DEPARTMENT`,`s_crnma`.`CANCELL` AS `CANCELL`,`s_crnma`.`C_BAL` AS `C_BAL`,`s_crnma`.`DEP_CODE` AS `DEP_CODE`,`s_crnma`.`Brand` AS `Brand`,`s_crnma`.`DEV` AS `DEV`,`s_crnma`.`stoRef` AS `stoRef`,`s_crnma`.`seri_no` AS `seri_no`,`s_crnma`.`vatrate` AS `vatrate`,`s_mas`.`UNIT` AS `unit`,`s_crntrn`.`DESCRIPT` AS `descript`,`s_crntrn`.`PRICE` AS `price`,`s_crntrn`.`QTY` AS `qty`,`s_crntrn`.`STK_NO` AS `STK_NO`,`s_crntrn`.`DIS_P` AS `DIS_P`,`s_mas`.`PART_NO` AS `PART_NO`,`s_crntrn`.`VAT` AS `VAT`,`s_mas`.`GROUP1` AS `GROUP1`,`c_bal`.`c_code1` AS `c_code1`,`s_crntrn`.`s_price` AS `s_price`,`s_mas`.`type` AS `s_type`,`s_mas`.`disitem` AS `disitem`,`c_bal`.`sdate1` AS `sdate1`,`s_mas`.`model` AS `model` from (((`s_crnma` join `s_crntrn` on(`s_crnma`.`REF_NO` = `s_crntrn`.`REF_NO`)) join `s_mas` on(`s_crntrn`.`STK_NO` = `s_mas`.`STK_NO`)) join `c_bal` on(`c_bal`.`REFNO` = `s_crnma`.`REF_NO`));

-- ----------------------------
-- View structure for `viewcrntrn`
-- ----------------------------
DROP VIEW IF EXISTS `viewcrntrn`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `viewcrntrn` AS select `s_crnma`.`REF_NO` AS `REF_NO`,`s_crnma`.`DDATE` AS `DDATE`,`s_crnma`.`TRN_TYPE` AS `TRN_TYPE`,`s_crnma`.`INVOICENO` AS `INVOICENO`,`s_crnma`.`SDATE` AS `SDATE`,`s_crnma`.`C_CODE` AS `C_CODE`,`s_crnma`.`CUS_NAME` AS `CUS_NAME`,`s_crnma`.`TYPE` AS `TYPE`,`s_crnma`.`SAL_EX` AS `SAL_EX`,`s_crnma`.`DISCOU` AS `DISCOU`,`s_crnma`.`AMOUNT` AS `AMOUNT`,`s_crnma`.`GST` AS `GST`,`s_crnma`.`GRAND_TOT` AS `GRAND_TOT`,`s_crnma`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_crnma`.`DIS` AS `DIS`,`s_crnma`.`DIS1` AS `DIS1`,`s_crnma`.`DIS_RUP` AS `DIS_RUP`,`s_crnma`.`CASH` AS `CASH`,`s_crnma`.`TOT_REPAY` AS `TOT_REPAY`,`s_crnma`.`DEPARTMENT` AS `DEPARTMENT`,`s_crnma`.`CANCELL` AS `CANCELL`,`s_crnma`.`C_BAL` AS `C_BAL`,`s_crnma`.`DEP_CODE` AS `DEP_CODE`,`s_crnma`.`Brand` AS `Brand`,`s_crnma`.`DEV` AS `DEV`,`s_crnma`.`stoRef` AS `stoRef`,`s_crnma`.`seri_no` AS `seri_no`,`s_crnma`.`vatrate` AS `vatrate`,`s_mas`.`UNIT` AS `unit`,`s_crntrn`.`DESCRIPT` AS `descript`,`s_crntrn`.`PRICE` AS `price`,`s_crntrn`.`QTY` AS `qty`,`s_crntrn`.`STK_NO` AS `STK_NO`,`s_crntrn`.`DIS_P` AS `DIS_P`,`s_mas`.`PART_NO` AS `PART_NO`,`s_crntrn`.`VAT` AS `VAT`,`s_mas`.`GROUP1` AS `GROUP1`,`c_bal`.`c_code1` AS `c_code1`,`s_crntrn`.`s_price` AS `s_price`,`s_mas`.`type` AS `s_type`,`s_mas`.`disitem` AS `disitem`,`c_bal`.`sdate1` AS `sdate1` from (((`s_crnma` join `s_crntrn` on(`s_crnma`.`REF_NO` = `s_crntrn`.`REF_NO`)) join `s_mas` on(`s_crntrn`.`STK_NO` = `s_mas`.`STK_NO`)) join `c_bal` on(`c_bal`.`REFNO` = `s_crnma`.`REF_NO`));

-- ----------------------------
-- View structure for `viewdef`
-- ----------------------------
DROP VIEW IF EXISTS `viewdef`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `viewdef` AS select `s_deftrn`.`ID` AS `ID`,`s_deftrn`.`REFNO` AS `REFNO`,`s_deftrn`.`BAT_NO` AS `BAT_NO`,`s_deftrn`.`CLAM_NO` AS `CLAM_NO`,`s_deftrn`.`SDATE` AS `SDATE`,`s_deftrn`.`c_code` AS `c_code`,`s_deftrn`.`SAL_EX` AS `SAL_EX`,`s_deftrn`.`DEP` AS `DEP`,`s_deftrn`.`STK_NO` AS `STK_NO`,`s_deftrn`.`AMOUNT` AS `AMOUNT`,`s_deftrn`.`REsult` AS `REsult`,`s_deftrn`.`Remarks` AS `Remarks`,`s_deftrn`.`qty` AS `qty`,`s_deftrn`.`dis` AS `dis`,`s_deftrn`.`CANCELL` AS `CANCELL`,`s_deftrn`.`arno` AS `arno`,`s_deftrn`.`ref_per` AS `Ref_per`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME`,`s_mas`.`PART_NO` AS `PART_NO`,`s_mas`.`DESCRIPT` AS `DESCRIPT`,`s_deftrn`.`cl_no` AS `cl_no`,`s_deftrn`.`approve_md_wd` AS `approve_md_wd`,`c_bal`.`vatrate` AS `vatrate`,`c_bal`.`SAL_EX` AS `salex` from ((`s_deftrn` left join `s_mas` on(`s_deftrn`.`STK_NO` = `s_mas`.`STK_NO`)) join `c_bal` on(`c_bal`.`REFNO` = `s_deftrn`.`REFNO`));

-- ----------------------------
-- View structure for `viewdef_trn`
-- ----------------------------
DROP VIEW IF EXISTS `viewdef_trn`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `viewdef_trn` AS select `s_crnma`.`C_CODE` AS `CCODE`,`s_crnma`.`CUS_NAME` AS `CUS_NAME1`,`s_crnma`.`SAL_EX` AS `SALEX`,`s_crnma`.`GRAND_TOT` AS `Expr1`,`s_crnma`.`vatrate` AS `vatrate`,`s_crnma`.`CUS_NAME` AS `CUS_NAME`,`s_crnma`.`GRAND_TOT` AS `GRAND_TOT`,`s_crnma`.`tmp_no` AS `tmp_no`,`s_deftrn`.`ID` AS `ID`,`s_deftrn`.`REFNO` AS `REFNO`,`s_deftrn`.`BAT_NO` AS `BAT_NO`,`s_deftrn`.`CLAM_NO` AS `CLAM_NO`,`s_deftrn`.`SDATE` AS `SDATE`,`s_deftrn`.`c_code` AS `c_code`,`s_deftrn`.`SAL_EX` AS `SAL_EX`,`s_deftrn`.`DEP` AS `DEP`,`s_deftrn`.`STK_NO` AS `STK_NO`,`s_deftrn`.`AMOUNT` AS `AMOUNT`,`s_deftrn`.`REsult` AS `REsult`,`s_deftrn`.`Remarks` AS `Remarks`,`s_deftrn`.`qty` AS `qty`,`s_deftrn`.`dis` AS `dis`,`s_deftrn`.`CANCELL` AS `CANCELL`,`s_deftrn`.`arno` AS `arno`,`s_deftrn`.`ref_per` AS `ref_per`,`s_crnma`.`Brand` AS `Brand`,`s_deftrn`.`approve_md_wd` AS `approve_md_wd` from (`s_crnma` join `s_deftrn` on(`s_crnma`.`REF_NO` = `s_deftrn`.`REFNO`));

-- ----------------------------
-- View structure for `viewinv`
-- ----------------------------
DROP VIEW IF EXISTS `viewinv`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `viewinv` AS select `s_invo`.`id` AS `id`,`s_invo`.`REF_NO` AS `REF_NO`,`s_invo`.`SDATE` AS `SDATE`,`s_invo`.`STK_NO` AS `STK_NO`,`s_invo`.`DESCRIPT` AS `DESCRIPT`,`s_invo`.`UNIT` AS `UNIT`,`s_invo`.`PART_NO` AS `PART_NO`,`s_invo`.`COST` AS `COST`,`s_invo`.`PRICE` AS `PRICE`,`s_invo`.`QTY` AS `QTY`,`s_invo`.`DEPARTMENT` AS `DEPARTMENT`,`s_invo`.`DIS_per` AS `DIS_per`,`s_invo`.`DIS_rs` AS `DIS_rs`,`s_invo`.`REP` AS `REP`,`s_invo`.`TAX_PER` AS `TAX_PER`,`s_invo`.`ret_qty` AS `ret_qty`,`s_invo`.`BRAND` AS `BRAND`,`s_invo`.`DEV` AS `DEV`,`s_invo`.`CANCELL` AS `CANCELL`,`s_invo`.`c_code` AS `c_code`,`s_invo`.`seri_no` AS `seri_no`,`s_invo`.`Print_dis1` AS `Print_dis1`,`s_invo`.`Print_dis2` AS `Print_dis2`,`s_invo`.`vatrate` AS `vatrate`,`s_salma`.`C_CODE` AS `cus_code`,`s_salma`.`CUS_NAME` AS `cust_name`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`CANCELL` AS `cancel_m`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`Brand` AS `s_brand`,`s_salma`.`c_code1` AS `c_code1`,`s_salma`.`Costcenter` AS `Costcenter`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_mas`.`disitem` AS `disitem`,`s_salma`.`sdate1` AS `sdate1` from ((`s_salma` join `s_invo` on(`s_salma`.`REF_NO` = `s_invo`.`REF_NO`)) join `s_mas` on(`s_invo`.`STK_NO` = `s_mas`.`STK_NO`));

-- ----------------------------
-- View structure for `viewinv1`
-- ----------------------------
DROP VIEW IF EXISTS `viewinv1`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `viewinv1` AS select `s_invo`.`id` AS `id`,`s_invo`.`REF_NO` AS `REF_NO`,`s_invo`.`SDATE` AS `SDATE`,`s_invo`.`STK_NO` AS `STK_NO`,`s_invo`.`DESCRIPT` AS `DESCRIPT`,`s_invo`.`UNIT` AS `UNIT`,`s_invo`.`PART_NO` AS `PART_NO`,`s_invo`.`COST` AS `COST`,`s_invo`.`PRICE` AS `PRICE`,`s_invo`.`QTY` AS `QTY`,`s_invo`.`DEPARTMENT` AS `DEPARTMENT`,`s_invo`.`DIS_per` AS `DIS_per`,`s_invo`.`DIS_rs` AS `DIS_rs`,`s_invo`.`REP` AS `REP`,`s_invo`.`TAX_PER` AS `TAX_PER`,`s_invo`.`ret_qty` AS `ret_qty`,`s_invo`.`BRAND` AS `BRAND`,`s_invo`.`CANCELL` AS `CANCELL`,`s_invo`.`c_code` AS `c_code`,`s_invo`.`seri_no` AS `seri_no`,`s_invo`.`Print_dis1` AS `Print_dis1`,`s_invo`.`Print_dis2` AS `Print_dis2`,`s_invo`.`vatrate` AS `vatrate`,`s_salma`.`C_CODE` AS `cus_code`,`s_salma`.`CUS_NAME` AS `cust_name`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`CANCELL` AS `cancel_m`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`Brand` AS `s_brand`,`s_mas`.`GROUP1` AS `GROUP1`,`s_salma`.`c_code1` AS `c_code1`,`s_salma`.`Costcenter` AS `Costcenter`,`s_mas`.`Cat1` AS `Cat1`,`s_mas`.`SIZE` AS `SIZE`,`s_mas`.`BRAND_NAME` AS `MAS_BRAND`,`s_mas`.`type` AS `type`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_invo`.`sdate1` AS `sdate1`,`s_salma`.`company` AS `company` from ((`s_salma` join `s_invo` on(`s_salma`.`REF_NO` = `s_invo`.`REF_NO`)) join `s_mas` on(`s_mas`.`STK_NO` = `s_invo`.`STK_NO`));

-- ----------------------------
-- View structure for `vieword`
-- ----------------------------
DROP VIEW IF EXISTS `vieword`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `vieword` AS select `s_ordmas`.`REFNO` AS `REFNO`,`s_ordmas`.`SDATE` AS `SDATE`,`s_ordmas`.`COUNTRY` AS `COUNTRY`,`s_ordmas`.`SUP_CODE` AS `SUP_CODE`,`s_ordmas`.`SUP_NAME` AS `SUP_NAME`,`s_ordmas`.`REMARK` AS `REMARK`,`s_ordmas`.`DEP_CODE` AS `DEP_CODE`,`s_ordmas`.`DEP_NAME` AS `DEP_NAME`,`s_ordmas`.`REP_CODE` AS `REP_CODE`,`s_ordmas`.`REP_NAME` AS `REP_NAME`,`s_ordmas`.`AMOUNT` AS `AMOUNT`,`s_ordmas`.`cancel` AS `cancel`,`s_ordmas`.`S_date` AS `S_date`,`s_ordmas`.`LC_No` AS `LC_No`,`s_ordmas`.`Brand` AS `Brand`,`s_ordtrn`.`STK_NO` AS `STK_NO`,`s_ordtrn`.`DESCRIPT` AS `DESCRIPT`,`s_ordtrn`.`UNIT` AS `UNIT`,`s_ordtrn`.`ORD_QTY` AS `ORD_QTY`,`s_ordtrn`.`REC_QTY` AS `REC_QTY`,`s_ordtrn`.`RATE` AS `RATE`,`s_ordtrn`.`partno` AS `partno` from (`s_ordmas` join `s_ordtrn` on(`s_ordmas`.`REFNO` = `s_ordtrn`.`REFNO`));

-- ----------------------------
-- View structure for `vieword1`
-- ----------------------------
DROP VIEW IF EXISTS `vieword1`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `vieword1` AS select `s_ordmas`.`REFNO` AS `REFNO`,`s_ordmas`.`SDATE` AS `SDATE`,`s_ordmas`.`COUNTRY` AS `COUNTRY`,`s_ordmas`.`SUP_CODE` AS `SUP_CODE`,`s_ordmas`.`SUP_NAME` AS `SUP_NAME`,`s_ordmas`.`REMARK` AS `REMARK`,`s_ordmas`.`DEP_CODE` AS `DEP_CODE`,`s_ordmas`.`DEP_NAME` AS `DEP_NAME`,`s_ordmas`.`REP_CODE` AS `REP_CODE`,`s_ordmas`.`REP_NAME` AS `REP_NAME`,`s_ordmas`.`AMOUNT` AS `AMOUNT`,`s_ordmas`.`cancel` AS `cancel`,`s_ordmas`.`S_date` AS `S_date`,`s_ordmas`.`LC_No` AS `LC_No`,`s_ordmas`.`Brand` AS `Brand`,`s_ordtrn`.`STK_NO` AS `STK_NO`,`s_ordtrn`.`DESCRIPT` AS `DESCRIPT`,`s_ordtrn`.`UNIT` AS `UNIT`,`s_ordtrn`.`ORD_QTY` AS `ORD_QTY`,`s_ordtrn`.`REC_QTY` AS `REC_QTY`,`s_ordtrn`.`RATE` AS `RATE`,`s_ordtrn`.`partno` AS `partno`,`s_ordtrn`.`CANCEL` AS `cane1` from (`s_ordtrn` join `s_ordmas` on(_utf8''));

-- ----------------------------
-- View structure for `viewpur`
-- ----------------------------
DROP VIEW IF EXISTS `viewpur`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `viewpur` AS select `s_purtrn`.`REFNO` AS `REFNO`,`s_purtrn`.`SDATE` AS `SDATE`,`s_purtrn`.`STK_NO` AS `STK_NO`,`s_purtrn`.`DESCRIPT` AS `DESCRIPT`,`s_purtrn`.`COST` AS `COST`,`s_purtrn`.`MARGIN` AS `MARGIN`,`s_purtrn`.`SELLING` AS `SELLING`,`s_purtrn`.`REC_QTY` AS `REC_QTY`,`s_purtrn`.`FOB` AS `FOB`,`s_purtrn`.`DEPARTMENT` AS `DEPARTMENT`,`s_purtrn`.`QTYINHAND` AS `QTYINHAND`,`s_purtrn`.`O_QTY` AS `O_QTY`,`s_purtrn`.`DISCOUNT` AS `DISCOUNT`,`s_purtrn`.`ret_qty` AS `ret_qty`,`s_purtrn`.`Cost_c` AS `Cost_c`,`s_purtrn`.`cost_seling` AS `cost_seling`,`s_purtrn`.`cost_margin` AS `cost_margin`,`s_purtrn`.`CANCEL` AS `CANCEL`,`s_purtrn`.`ID` AS `ID`,`s_purtrn`.`acc_cost` AS `acc_cost`,`s_purtrn`.`acc_cost_c` AS `acc_cost_c`,`s_purtrn`.`soldqty` AS `soldqty`,`s_purtrn`.`brand` AS `brand`,`s_purtrn`.`days` AS `days`,`s_purtrn`.`vatrate` AS `vatrate`,`s_purmas`.`LCNO` AS `LCNO`,`s_purmas`.`COUNTRY` AS `COUNTRY`,`s_purmas`.`SUP_CODE` AS `SUP_CODE`,`s_purmas`.`SUP_NAME` AS `SUP_NAME`,`s_purmas`.`brand` AS `brand_name`,`s_purmas`.`TYPE` AS `TYPE`,`s_purmas`.`indate` AS `indate` from (`s_purmas` join `s_purtrn` on(`s_purmas`.`REFNO` = `s_purtrn`.`REFNO`));

-- ----------------------------
-- View structure for `viewpurret`
-- ----------------------------
DROP VIEW IF EXISTS `viewpurret`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `viewpurret` AS select `s_purrtrn`.`REFNO` AS `REFNO`,`s_purrtrn`.`sDATE` AS `sDATE`,`s_purrtrn`.`STK_NO` AS `STK_NO`,`s_purrtrn`.`DESCRIPT` AS `DESCRIPT`,`s_purrtrn`.`COST` AS `COST`,`s_purrtrn`.`MARGIN` AS `MARGIN`,`s_purrtrn`.`SELLING` AS `SELLING`,`s_purrtrn`.`REC_QTY` AS `REC_QTY`,`s_purrtrn`.`FOB` AS `FOB`,`s_purrtrn`.`DEPARTMENT` AS `DEPARTMENT`,`s_purrtrn`.`QTYINHAND` AS `QTYINHAND`,`s_purrtrn`.`O_QTY` AS `O_QTY`,`s_purrtrn`.`DISCOUNT` AS `DISCOUNT`,`s_purrtrn`.`ret_qty` AS `ret_qty`,`s_purrtrn`.`Cost_c` AS `Cost_c`,`s_purrtrn`.`cost_seling` AS `cost_seling`,`s_purrtrn`.`cost_margin` AS `cost_margin`,`s_purrtrn`.`acc_COST` AS `acc_COST`,`s_purrtrn`.`acc_COST_c` AS `acc_COST_c`,`s_purrtrn`.`vatrate` AS `vatrate`,`s_purrtrn`.`tmp_no` AS `tmp_no`,`s_purrmas`.`COUNTRY` AS `COUNTRY`,`s_purrmas`.`SUP_CODE` AS `SUP_CODE`,`s_purrmas`.`SUP_NAME` AS `SUP_NAME`,`s_purrmas`.`LC_NO` AS `LC_NO`,`s_purrmas`.`CANCEL` AS `CANCEL`,`s_purrmas`.`ORDNO` AS `ORDNO` from (`s_purrmas` join `s_purrtrn` on(`s_purrmas`.`REFNO` = `s_purrtrn`.`REFNO`));

-- ----------------------------
-- View structure for `viewreturn`
-- ----------------------------
DROP VIEW IF EXISTS `viewreturn`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `viewreturn` AS select `c_bal`.`ID` AS `ID`,`c_bal`.`REFNO` AS `REFNO`,`c_bal`.`SDATE` AS `SDATE`,`c_bal`.`CUSCODE` AS `CUSCODE`,`c_bal`.`AMOUNT` AS `AMOUNT`,`c_bal`.`BALANCE` AS `BALANCE`,`c_bal`.`DEP` AS `DEP`,`c_bal`.`SAL_EX` AS `SAL_EX`,`c_bal`.`CANCELL` AS `Cancell`,`c_bal`.`brand` AS `brand`,`c_bal`.`DEV` AS `DEV`,`c_bal`.`trn_type` AS `trn_type`,`c_bal`.`old` AS `old`,`c_bal`.`vatrate` AS `vatrate`,`c_bal`.`RNO` AS `RNO`,`c_bal`.`flag1` AS `flag1`,`c_bal`.`active` AS `active`,`c_bal`.`totpay` AS `totpay`,`vendor`.`NAME` AS `NAME`,`vendor`.`area` AS `area`,`vendor`.`provi` AS `provi` from (`c_bal` join `vendor` on(`c_bal`.`CUSCODE` = `vendor`.`CODE`));

-- ----------------------------
-- View structure for `viewreturn_svat`
-- ----------------------------
DROP VIEW IF EXISTS `viewreturn_svat`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `viewreturn_svat` AS select `c_bal`.`ID` AS `ID`,`c_bal`.`REFNO` AS `REFNO`,`c_bal`.`SDATE` AS `SDATE`,`c_bal`.`CUSCODE` AS `CUSCODE`,`c_bal`.`AMOUNT` AS `AMOUNT`,`c_bal`.`BALANCE` AS `BALANCE`,`c_bal`.`DEP` AS `DEP`,`c_bal`.`SAL_EX` AS `SAL_EX`,`c_bal`.`CANCELL` AS `Cancell`,`c_bal`.`brand` AS `brand`,`c_bal`.`DEV` AS `DEV`,`c_bal`.`trn_type` AS `trn_type`,`c_bal`.`old` AS `old`,`c_bal`.`vatrate` AS `vatrate`,`c_bal`.`RNO` AS `RNO`,`c_bal`.`flag1` AS `flag1`,`c_bal`.`active` AS `active`,`c_bal`.`totpay` AS `totpay`,`vendor`.`NAME` AS `NAME`,`vendor`.`area` AS `area`,`vendor`.`provi` AS `provi`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`SVAT` AS `SVAT`,`s_salma`.`vat_no` AS `vat_no`,`s_salma`.`s_vat_no` AS `s_vat_no` from (((`c_bal` join `vendor` on(`c_bal`.`CUSCODE` = `vendor`.`CODE`)) join `s_crnma` on(`c_bal`.`REFNO` = `s_crnma`.`REF_NO`)) join `s_salma` on(`s_crnma`.`INVOICENO` = `s_salma`.`REF_NO`));

-- ----------------------------
-- View structure for `viewstran`
-- ----------------------------
DROP VIEW IF EXISTS `viewstran`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `viewstran` AS select `s_trn`.`ID` AS `ID`,`s_trn`.`SDATE` AS `SDATE`,`s_trn`.`STK_NO` AS `STK_NO`,`s_trn`.`REFNO` AS `REFNO`,`s_trn`.`QTY` AS `QTY`,`s_trn`.`LEDINDI` AS `LEDINDI`,`s_trn`.`DEPARTMENT` AS `DEPARTMENT`,`s_trn`.`seri_no` AS `SERI_NO`,`s_trn`.`Dev` AS `Dev`,`s_trn`.`SAL_EX` AS `SAL_EX`,`s_trn`.`DONO` AS `DONO`,`s_mas`.`PART_NO` AS `PART_NO`,`s_mas`.`DESCRIPT` AS `DESCRIPT`,`s_mas`.`UNIT` AS `UNIT`,`s_mas`.`SIZE` AS `SIZE`,`s_mas`.`SELLING` AS `SELLING`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME`,`s_mas`.`GEN_NO` AS `GEN_NO` from (`s_mas` join `s_trn` on(`s_mas`.`STK_NO` = `s_trn`.`STK_NO`));

-- ----------------------------
-- View structure for `viewsubmas`
-- ----------------------------
DROP VIEW IF EXISTS `viewsubmas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `viewsubmas` AS select `s_submas`.`STO_CODE` AS `STO_CODE`,`s_submas`.`STK_NO` AS `STK_NO`,`s_submas`.`DESCRIPt` AS `DESCRIPt`,`s_submas`.`OPEN_STK` AS `OPEN_STK`,`s_submas`.`OPENT_DATE` AS `OPENT_DATE`,`s_submas`.`QTYINHAND` AS `QTYINHAND`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME`,`s_mas`.`COST` AS `COST`,`s_mas`.`PART_NO` AS `PART_NO`,`s_mas`.`SELLING` AS `SELLING`,`s_mas`.`DESCRIPT` AS `DESCRIPT1`,`s_mas`.`acc_cost` AS `acc_cost`,`s_mas`.`GROUP2` AS `GROUP2`,`s_mas`.`model` AS `model`,`s_mas`.`GROUP1` AS `GROUP1`,`s_stomas`.`DESCRIPTION` AS `DESCRIPTION`,`s_mas`.`Cat1` AS `Cat1` from ((`s_mas` join `s_submas` on(`s_mas`.`STK_NO` = `s_submas`.`STK_NO`)) join `s_stomas` on(`s_submas`.`STO_CODE` = `s_stomas`.`CODE`));

-- ----------------------------
-- View structure for `viewsubmas1`
-- ----------------------------
DROP VIEW IF EXISTS `viewsubmas1`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `viewsubmas1` AS select `s_mas`.`SDATE` AS `SDATE`,`s_mas`.`STK_NO` AS `STK_NO`,`s_mas`.`GROUP1` AS `GROUP1`,`s_mas`.`SUBSTITUTE` AS `SUBSTITUTE`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME`,`s_mas`.`GEN_NO` AS `GEN_NO`,`s_mas`.`PART_NO` AS `PART_NO`,`s_mas`.`DESCRIPT` AS `DESCRIPT`,`s_mas`.`LOCATE_1` AS `LOCATE_1`,`s_mas`.`LOCATE_2` AS `LOCATE_2`,`s_mas`.`LOCATE_3` AS `LOCATE_3`,`s_mas`.`LOCATE_4` AS `LOCATE_4`,`s_mas`.`CAT` AS `CAT`,`s_mas`.`COST` AS `COST`,`s_mas`.`MARGIN` AS `MARGIN`,`s_mas`.`SELLING` AS `SELLING`,`s_mas`.`AR_selling` AS `AR_selling`,`s_mas`.`OPEN_STK` AS `OPEN_STK`,`s_mas`.`STKQTY` AS `STKQTY`,`s_mas`.`QTYINHAND` AS `QTYINHAND`,`s_mas`.`QTYINHAND_STORES` AS `QTYINHAND_STORES`,`s_mas`.`UNIT` AS `UNIT`,`s_mas`.`SIZE` AS `SIZE`,`s_mas`.`RE_O_LEVEL` AS `RE_O_LEVEL`,`s_mas`.`RE_O_QTY` AS `RE_O_QTY`,`s_mas`.`SALE01` AS `SALE01`,`s_mas`.`SALE02` AS `SALE02`,`s_mas`.`SALE03` AS `SALE03`,`s_mas`.`SALE04` AS `SALE04`,`s_mas`.`SALE05` AS `SALE05`,`s_mas`.`SALE06` AS `SALE06`,`s_mas`.`SALE07` AS `SALE07`,`s_mas`.`SALE08` AS `SALE08`,`s_mas`.`SALE09` AS `SALE09`,`s_mas`.`SALE10` AS `SALE10`,`s_mas`.`SALE11` AS `SALE11`,`s_mas`.`SALE12` AS `SALE12`,`s_mas`.`ENT_DATE` AS `ENT_DATE`,`s_mas`.`model` AS `model`,`s_mas`.`GROUP2` AS `GROUP2`,`s_mas`.`GROUP3` AS `GROUP3`,`s_mas`.`GROUP4` AS `GROUP4`,`s_mas`.`Account` AS `Account`,`s_mas`.`costcenter` AS `costcenter`,`s_mas`.`acc_cost` AS `acc_cost`,`s_mas`.`cus_ord` AS `cus_ord`,`s_mas`.`delivered` AS `delivered`,`s_mas`.`type` AS `type`,`s_mas`.`Cat1` AS `Cat1`,`s_mas`.`weight` AS `weight`,`s_mas`.`country` AS `country`,`s_mas`.`spType` AS `spType`,`s_mas`.`tmp_no` AS `tmp_no`,`s_submas`.`STO_CODE` AS `STO_CODE`,`s_submas`.`QTYINHAND` AS `QTY1` from (`s_mas` join `s_submas` on(`s_mas`.`STK_NO` = `s_submas`.`STK_NO`));

-- ----------------------------
-- View structure for `view_adj`
-- ----------------------------
DROP VIEW IF EXISTS `view_adj`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_adj` AS select `inreq_trn`.`id` AS `id`,`inreq_trn`.`refno` AS `refno`,`inreq_trn`.`sdate` AS `sdate`,`inreq_trn`.`stk_no` AS `stk_no`,`inreq_trn`.`trn_type` AS `trn_type`,`inreq_trn`.`qty` AS `qty`,`inreq_trn`.`CANCELL` AS `CANCELL`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME`,`s_mas`.`PART_NO` AS `PART_NO`,`s_mas`.`DESCRIPT` AS `DESCRIPT`,`s_mas`.`COST` AS `COST`,`inreq_mas`.`remark` AS `remark`,`inreq_mas`.`dep` AS `dep` from ((`inreq_trn` left join `s_mas` on(`inreq_trn`.`stk_no` = `s_mas`.`STK_NO`)) join `inreq_mas` on(`inreq_mas`.`refno` = `inreq_trn`.`refno`));

-- ----------------------------
-- View structure for `view_allgrns`
-- ----------------------------
DROP VIEW IF EXISTS `view_allgrns`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_allgrns` AS select `s_mas`.`STK_NO` AS `STK_NO`,`s_mas`.`acc_cost` AS `acc_cost`,`s_trn`.`LEDINDI` AS `LEDINDI`,`s_trn`.`QTY` AS `QTY`,`s_trn`.`SDATE` AS `SDATE` from (`s_mas` join `s_trn` on(`s_mas`.`STK_NO` = `s_trn`.`STK_NO`));

-- ----------------------------
-- View structure for `view_batt_smas`
-- ----------------------------
DROP VIEW IF EXISTS `view_batt_smas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_batt_smas` AS select `battry_inv`.`c_code` AS `c_code`,`battry_inv`.`stk_no` AS `stk_no`,`battry_inv`.`sdate` AS `sdate`,`battry_inv`.`qty` AS `qty`,`battry_inv`.`id` AS `id`,`battry_inv`.`rep` AS `rep`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME` from (`battry_inv` join `s_mas` on(`battry_inv`.`stk_no` = `s_mas`.`STK_NO`));

-- ----------------------------
-- View structure for `view_brand_mas_s_salrep`
-- ----------------------------
DROP VIEW IF EXISTS `view_brand_mas_s_salrep`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_brand_mas_s_salrep` AS select `brand_mas`.`barnd_name` AS `barnd_name`,`brand_mas`.`class` AS `class`,`brand_mas`.`b60` AS `b60`,`brand_mas`.`d60to75` AS `d60to75`,`brand_mas`.`d75to90` AS `d75to90`,`brand_mas`.`o90` AS `o90`,`brand_mas`.`act` AS `act`,`brand_mas`.`flg` AS `flg`,`brand_mas`.`dis` AS `dis`,`brand_mas`.`delindays` AS `delindays`,`brand_mas`.`delinrate` AS `delinrate`,`brand_mas`.`MAX_INCEN_DIS` AS `MAX_INCEN_DIS`,`brand_mas`.`tmp_no` AS `tmp_no`,`brand_mas`.`costcenter` AS `costcenter`,`s_salrep`.`REPCODE` AS `REPCODE`,`s_salrep`.`Name` AS `Name` from (`brand_mas` join `s_salrep` on(`s_salrep`.`RGROUP1` = `brand_mas`.`costcenter`));

-- ----------------------------
-- View structure for `view_brand_smas`
-- ----------------------------
DROP VIEW IF EXISTS `view_brand_smas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_brand_smas` AS select `s_mas`.`STK_NO` AS `STK_NO`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME`,`s_mas`.`GEN_NO` AS `GEN_NO`,`s_mas`.`PART_NO` AS `PART_NO`,`s_mas`.`DESCRIPT` AS `DESCRIPT`,`s_mas`.`GROUP1` AS `GROUP1`,`s_mas`.`SUBSTITUTE` AS `SUBSTITUTE`,`s_mas`.`SIZE` AS `SIZE`,`brand_mas`.`class` AS `class` from (`brand_mas` join `s_mas` on(`s_mas`.`BRAND_NAME` = `brand_mas`.`barnd_name`));

-- ----------------------------
-- View structure for `view_brtrn_vendor`
-- ----------------------------
DROP VIEW IF EXISTS `view_brtrn_vendor`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_brtrn_vendor` AS select `br_trn`.`Class` AS `Class`,`br_trn`.`cus_code` AS `cus_code`,`br_trn`.`Rep` AS `Rep`,`br_trn`.`credit_lim` AS `credit_lim`,`br_trn`.`credit` AS `credit`,`br_trn`.`brand` AS `brand`,`br_trn`.`tmpLmt` AS `tmpLmt`,`br_trn`.`CAT` AS `CAT`,`br_trn`.`ID` AS `ID`,`vendor`.`OPDATE` AS `OPDATE`,`vendor`.`PEN0` AS `PEN0`,`vendor`.`field1` AS `field1`,`br_trn`.`days` AS `days`,`vendor`.`incdays` AS `incdays`,`vendor`.`NAME` AS `NAME`,`vendor`.`ADD2` AS `ADD2`,`vendor`.`ADD1` AS `ADD1`,`vendor`.`TELE1` AS `TELE1`,`vendor`.`EMAIL` AS `EMAIL`,`vendor`.`cus_type` AS `cus_type`,`vendor`.`CAT` AS `as V_cat`,`vendor`.`acno` AS `acno` from (`br_trn` left join `vendor` on(`br_trn`.`cus_code` = `vendor`.`CODE`));

-- ----------------------------
-- View structure for `view_cancelled_trns`
-- ----------------------------
DROP VIEW IF EXISTS `view_cancelled_trns`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_cancelled_trns` AS select `s_purtrn`.`REFNO` AS `REFNO`,`s_purtrn`.`STK_NO` AS `STK_NO`,`s_purtrn`.`DESCRIPT` AS `DESCRIPT`,`s_purtrn`.`REC_QTY` AS `REC_QTY`,`s_purtrn`.`CANCEL` AS `CANCEL`,`s_trn`.`QTY` AS `QTY`,`s_trn`.`LEDINDI` AS `LEDINDI` from (`s_purtrn` join `s_trn` on(`s_purtrn`.`REFNO` = `s_trn`.`REFNO` and `s_purtrn`.`STK_NO` = `s_trn`.`STK_NO`));

-- ----------------------------
-- View structure for `view_cbal_bmas_crnma_salma`
-- ----------------------------
DROP VIEW IF EXISTS `view_cbal_bmas_crnma_salma`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_cbal_bmas_crnma_salma` AS select `c_bal`.`ID` AS `ID`,`c_bal`.`REFNO` AS `REFNO`,`c_bal`.`SDATE` AS `SDATE`,`c_bal`.`CUSCODE` AS `CUSCODE`,`c_bal`.`AMOUNT` AS `AMOUNT`,`c_bal`.`BALANCE` AS `BALANCE`,`c_bal`.`DEP` AS `DEP`,`c_bal`.`SAL_EX` AS `SAL_EX`,`c_bal`.`CANCELL` AS `CANCELL`,`c_bal`.`brand` AS `brand`,`c_bal`.`DEV` AS `DEV`,`c_bal`.`trn_type` AS `trn_type`,`c_bal`.`old` AS `old`,`c_bal`.`vatrate` AS `vatrate`,`c_bal`.`RNO` AS `RNO`,`c_bal`.`flag1` AS `flag1`,`c_bal`.`active` AS `active`,`c_bal`.`totpay` AS `totpay`,`brand_mas`.`delinrate` AS `delinrate`,`brand_mas`.`b60` AS `b60`,`s_crnma`.`INVOICENO` AS `INVOICENO`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`s_salma`.`SDATE` AS `sal_sdate`,`cred`.`C_INVNO` AS `C_INVNO`,`s_salma_1`.`SDATE` AS `sal1_sdate`,`brand_mas`.`class` AS `class`,`c_bal`.`sdate1` AS `sdate1`,`s_salma`.`sdate1` AS `sal_sdate1` from (((`c_bal` left join (`cred` join `s_salma` `s_salma_1` on(`cred`.`C_INVNO` = `s_salma_1`.`REF_NO`)) on(`cred`.`C_REFNO` = `c_bal`.`REFNO`)) left join (`s_salma` join `s_crnma` on(`s_salma`.`REF_NO` = `s_crnma`.`INVOICENO`)) on(`c_bal`.`REFNO` = `s_crnma`.`REF_NO`)) left join `brand_mas` on(`c_bal`.`brand` = `brand_mas`.`barnd_name`));

-- ----------------------------
-- View structure for `view_cbal_brand`
-- ----------------------------
DROP VIEW IF EXISTS `view_cbal_brand`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_cbal_brand` AS select `c_bal`.`ID` AS `ID`,`c_bal`.`REFNO` AS `REFNO`,`c_bal`.`SDATE` AS `SDATE`,`c_bal`.`CUSCODE` AS `CUSCODE`,`c_bal`.`AMOUNT` AS `AMOUNT`,`c_bal`.`BALANCE` AS `BALANCE`,`c_bal`.`DEP` AS `DEP`,`c_bal`.`SAL_EX` AS `SAL_EX`,`c_bal`.`CANCELL` AS `Cancell`,`c_bal`.`brand` AS `brand`,`c_bal`.`DEV` AS `DEV`,`c_bal`.`trn_type` AS `trn_type`,`c_bal`.`old` AS `old`,`c_bal`.`vatrate` AS `vatrate`,`c_bal`.`RNO` AS `RNO`,`c_bal`.`flag1` AS `flag1`,`c_bal`.`active` AS `active`,`c_bal`.`totpay` AS `totpay`,`brand_mas`.`MAX_INCEN_DIS` AS `MAX_INCEN_DIS`,`brand_mas`.`delinrate` AS `delinrate`,`brand_mas`.`class` AS `class`,`brand_mas`.`b60` AS `b60`,`brand_mas`.`d60to75` AS `d60to75`,`brand_mas`.`costcenter` AS `costcenter` from (`c_bal` left join `brand_mas` on(`c_bal`.`brand` = `brand_mas`.`barnd_name`));

-- ----------------------------
-- View structure for `view_cbal_brand_incentive`
-- ----------------------------
DROP VIEW IF EXISTS `view_cbal_brand_incentive`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_cbal_brand_incentive` AS select `c_bal`.`ID` AS `ID`,`c_bal`.`REFNO` AS `REFNO`,`c_bal`.`SDATE` AS `SDATE`,`c_bal`.`CUSCODE` AS `CUSCODE`,`c_bal`.`AMOUNT` AS `AMOUNT`,`c_bal`.`BALANCE` AS `BALANCE`,`c_bal`.`DEP` AS `DEP`,`c_bal`.`SAL_EX` AS `SAL_EX`,`c_bal`.`CANCELL` AS `Cancell`,`c_bal`.`brand` AS `brand`,`c_bal`.`DEV` AS `DEV`,`c_bal`.`trn_type` AS `trn_type`,`c_bal`.`old` AS `old`,`c_bal`.`vatrate` AS `vatrate`,`c_bal`.`RNO` AS `RNO`,`c_bal`.`flag1` AS `flag1`,`c_bal`.`active` AS `active`,`c_bal`.`totpay` AS `totpay`,`brand_mas`.`MAX_INCEN_DIS` AS `MAX_INCEN_DIS`,`brand_mas`.`delinrate` AS `delinrate`,`brand_mas`.`class` AS `class`,`brand_mas`.`b60` AS `b60`,`brand_mas`.`d60to75` AS `d60to75`,`brand_mas`.`costcenter` AS `costcenter`,`insentive_scheme`.`sfrom` AS `sfrom`,`insentive_scheme`.`sto` AS `sto`,`insentive_scheme`.`inc_type` AS `inc_type`,`c_bal`.`sdate1` AS `sdate1` from ((`c_bal` left join `brand_mas` on(`c_bal`.`brand` = `brand_mas`.`barnd_name`)) join `insentive_scheme` on(`brand_mas`.`barnd_name` = `insentive_scheme`.`brand`));

-- ----------------------------
-- View structure for `view_cbal_cred`
-- ----------------------------
DROP VIEW IF EXISTS `view_cbal_cred`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_cbal_cred` AS select `c_bal`.`ID` AS `ID`,`c_bal`.`REFNO` AS `REFNO`,`c_bal`.`SDATE` AS `SDATE`,`c_bal`.`CUSCODE` AS `CUSCODE`,`c_bal`.`AMOUNT` AS `AMOUNT`,`c_bal`.`BALANCE` AS `BALANCE`,`c_bal`.`DEP` AS `DEP`,`c_bal`.`SAL_EX` AS `SAL_EX`,`c_bal`.`CANCELL` AS `Cancell`,`c_bal`.`brand` AS `brand`,`c_bal`.`DEV` AS `DEV`,`c_bal`.`trn_type` AS `trn_type`,`c_bal`.`old` AS `old`,`c_bal`.`vatrate` AS `vatrate`,`c_bal`.`RNO` AS `RNO`,`c_bal`.`flag1` AS `flag1`,`c_bal`.`active` AS `active`,`c_bal`.`totpay` AS `totpay`,`cred`.`C_INVNO` AS `C_INVNO`,`cred`.`C_SETINV` AS `C_SETINV` from (`cred` left join `c_bal` on(`c_bal`.`REFNO` = `cred`.`C_REFNO`));

-- ----------------------------
-- View structure for `view_cbal_credit_sinvo_smas`
-- ----------------------------
DROP VIEW IF EXISTS `view_cbal_credit_sinvo_smas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_cbal_credit_sinvo_smas` AS select `c_bal`.`REFNO` AS `REFNO`,`s_invo`.`STK_NO` AS `STK_NO`,`s_mas`.`type` AS `ittype` from (`c_bal` left join (`cred` left join (`s_invo` left join `s_mas` on(`s_invo`.`STK_NO` = `s_mas`.`STK_NO`)) on(`s_invo`.`REF_NO` = `cred`.`C_INVNO`)) on(`cred`.`C_REFNO` = `c_bal`.`REFNO`));

-- ----------------------------
-- View structure for `view_cbal_cred_salma`
-- ----------------------------
DROP VIEW IF EXISTS `view_cbal_cred_salma`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_cbal_cred_salma` AS select `c_bal`.`ID` AS `ID`,`c_bal`.`REFNO` AS `REFNO`,`c_bal`.`SDATE` AS `SDATE`,`c_bal`.`CUSCODE` AS `CUSCODE`,`c_bal`.`AMOUNT` AS `AMOUNT`,`c_bal`.`BALANCE` AS `BALANCE`,`c_bal`.`DEP` AS `DEP`,`c_bal`.`SAL_EX` AS `SAL_EX`,`c_bal`.`CANCELL` AS `Cancell`,`c_bal`.`brand` AS `brand`,`c_bal`.`DEV` AS `DEV`,`c_bal`.`trn_type` AS `trn_type`,`c_bal`.`old` AS `old`,`c_bal`.`vatrate` AS `vatrate`,`c_bal`.`RNO` AS `RNO`,`c_bal`.`flag1` AS `flag1`,`c_bal`.`active` AS `active`,`c_bal`.`totpay` AS `totpay`,`cred`.`C_INVNO` AS `C_INVNO`,`cred`.`C_SETINV` AS `C_SETINV`,`s_salma`.`vat_no` AS `vat_no`,`s_salma`.`s_vat_no` AS `s_vat_no`,`s_salma`.`SVAT` AS `SVAT`,`s_salma`.`GST` AS `GST` from ((`cred` left join `c_bal` on(`c_bal`.`REFNO` = `cred`.`C_REFNO`)) join `s_salma` on(`cred`.`C_INVNO` = `s_salma`.`REF_NO`));

-- ----------------------------
-- View structure for `view_cbal_crnma_sinvo_smas`
-- ----------------------------
DROP VIEW IF EXISTS `view_cbal_crnma_sinvo_smas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_cbal_crnma_sinvo_smas` AS select `c_bal`.`REFNO` AS `REFNO`,`s_crnma`.`INVOICENO` AS `INVOICENO`,`s_invo`.`STK_NO` AS `STK_NO`,`s_mas`.`type` AS `ittype` from (`c_bal` left join ((`s_invo` left join `s_mas` on(`s_invo`.`STK_NO` = `s_mas`.`STK_NO`)) left join `s_crnma` on(`s_invo`.`REF_NO` = `s_crnma`.`INVOICENO`)) on(`s_crnma`.`REF_NO` = `c_bal`.`REFNO`));

-- ----------------------------
-- View structure for `view_cbal_deftrn`
-- ----------------------------
DROP VIEW IF EXISTS `view_cbal_deftrn`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_cbal_deftrn` AS select `s_deftrn`.`ID` AS `ID`,`s_deftrn`.`REFNO` AS `REFNO`,`s_deftrn`.`BAT_NO` AS `BAT_NO`,`s_deftrn`.`CLAM_NO` AS `CLAM_NO`,`s_deftrn`.`SDATE` AS `SDATE`,`s_deftrn`.`c_code` AS `c_code`,`s_deftrn`.`SAL_EX` AS `SAL_EX`,`s_deftrn`.`DEP` AS `DEP`,`s_deftrn`.`STK_NO` AS `STK_NO`,`s_deftrn`.`AMOUNT` AS `AMOUNT`,`s_deftrn`.`REsult` AS `REsult`,`s_deftrn`.`Remarks` AS `Remarks`,`s_deftrn`.`qty` AS `qty`,`s_deftrn`.`dis` AS `dis`,`s_deftrn`.`CANCELL` AS `CANCELL`,`s_deftrn`.`arno` AS `arno`,`s_deftrn`.`ref_per` AS `Ref_per`,`c_bal`.`AMOUNT` AS `c_amount` from (`s_deftrn` left join `c_bal` on(`c_bal`.`REFNO` = `s_deftrn`.`REFNO`));

-- ----------------------------
-- View structure for `view_cbal_salma`
-- ----------------------------
DROP VIEW IF EXISTS `view_cbal_salma`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_cbal_salma` AS select `c_bal_s_salma`.`ret_no` AS `ret_no`,`c_bal_s_salma`.`ret_amo` AS `ret_amo`,`c_bal_s_salma`.`id` AS `id`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`vat_no` AS `vat_no`,`s_salma`.`s_vat_no` AS `s_vat_no`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`c_bal_s_salma`.`sdate` AS `rtn_date` from (`c_bal_s_salma` join `s_salma` on(`c_bal_s_salma`.`inv_no` = `s_salma`.`REF_NO`));

-- ----------------------------
-- View structure for `view_cbal_scrnma_salma`
-- ----------------------------
DROP VIEW IF EXISTS `view_cbal_scrnma_salma`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_cbal_scrnma_salma` AS select `c_bal`.`ID` AS `ID`,`c_bal`.`REFNO` AS `REFNO`,`c_bal`.`SDATE` AS `SDATE`,`c_bal`.`CUSCODE` AS `CUSCODE`,`c_bal`.`AMOUNT` AS `AMOUNT`,`c_bal`.`BALANCE` AS `BALANCE`,`c_bal`.`DEP` AS `DEP`,`c_bal`.`SAL_EX` AS `SAL_EX`,`c_bal`.`CANCELL` AS `Cancell`,`c_bal`.`brand` AS `brand`,`c_bal`.`DEV` AS `DEV`,`c_bal`.`trn_type` AS `trn_type`,`c_bal`.`vatrate` AS `vatrate`,`c_bal`.`RNO` AS `RNO`,`c_bal`.`flag1` AS `flag1`,`c_bal`.`active` AS `active`,`c_bal`.`Costcenter` AS `Costcenter`,`c_bal`.`totpay` AS `totpay`,`s_salma`.`SVAT` AS `SVAT`,`s_salma`.`GST` AS `GST`,`s_salma`.`VAT` AS `VAT` from (`c_bal` left join (`s_salma` join `s_crnma` on(`s_salma`.`REF_NO` = `s_crnma`.`INVOICENO`)) on(`s_crnma`.`REF_NO` = `c_bal`.`REFNO`));

-- ----------------------------
-- View structure for `view_chextend`
-- ----------------------------
DROP VIEW IF EXISTS `view_chextend`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_chextend` AS select `s_invcheq`.`cheque_no` AS `cheque_no`,`s_invcheq`.`che_date` AS `che_date`,`s_invcheq`.`che_amount` AS `che_amount`,`s_invcheq`.`sal_ex` AS `sal_ex`,`s_sttr`.`ST_PAID` AS `ST_PAID`,`s_salma`.`Brand` AS `Brand`,`brand_mas`.`class` AS `class`,`s_salma`.`C_CODE` AS `C_CODE`,`brand_mas`.`b60` AS `b60`,`s_invcheq`.`trn_type` AS `trn_type`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`SDATE` AS `SDATE`,`s_invcheq`.`ex_date1` AS `ex_date1`,`s_invcheq`.`ex_date2` AS `ex_date2`,`s_sttr`.`deliin_days` AS `deliin_days`,`s_sttr`.`deliin_amo` AS `deliin_amo`,`s_sttr`.`deliin_lock` AS `deliin_lock`,`s_cheque_extend`.`sdate` AS `sdate_extend`,`s_invcheq`.`cus_code` AS `cus_code`,`s_invcheq`.`CUS_NAME` AS `CUS_NAME`,`s_sttr`.`ST_REFNO` AS `ST_REFNO`,`s_cheque_extend`.`ded` AS `ded` from ((((`s_invcheq` left join `s_sttr` on(`s_invcheq`.`cheque_no` = `s_sttr`.`ST_CHNO` and `s_sttr`.`ST_REFNO` = `s_invcheq`.`refno`)) left join `s_salma` on(`s_sttr`.`ST_INVONO` = `s_salma`.`REF_NO`)) join `brand_mas` on(_utf8'' = _utf8'' and `brand_mas`.`barnd_name` = `s_salma`.`Brand`)) join `s_cheque_extend` on(`s_cheque_extend`.`ch_no` = `s_invcheq`.`cheque_no` and `s_cheque_extend`.`c_code` = `s_invcheq`.`cus_code`));

-- ----------------------------
-- View structure for `view_chk`
-- ----------------------------
DROP VIEW IF EXISTS `view_chk`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_chk` AS select `s_invcheq`.`refno` AS `refno`,`s_crec`.`CA_REFNO` AS `CA_REFNO`,`s_crec`.`FLAG` AS `FLAG`,`s_invcheq`.`ret_refno` AS `ret_refno`,`s_invcheq`.`cheque_no` AS `cheque_no`,`s_invcheq`.`che_date` AS `che_date`,`s_crec`.`pay_type` AS `pay_type` from (`s_crec` join `s_invcheq` on(`s_crec`.`CA_REFNO` = `s_invcheq`.`refno`));

-- ----------------------------
-- View structure for `view_chkord`
-- ----------------------------
DROP VIEW IF EXISTS `view_chkord`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_chkord` AS select `s_cusordmas`.`CUS_NAME` AS `CUS_NAME`,`vendor`.`CODE` AS `CODE`,`vendor`.`NAME` AS `NAME`,`s_cusordmas`.`REF_NO` AS `REF_NO`,`s_cusordmas`.`id` AS `id`,`s_cusordmas`.`SDATE` AS `SDATE`,`s_cusordmas`.`C_CODE` AS `C_CODE`,`s_cusordmas`.`INVNO` AS `INVNO`,`s_cusordmas`.`CANCELL` AS `CANCELL` from (`s_cusordmas` join `vendor` on(`s_cusordmas`.`C_CODE` = `vendor`.`CODE`));

-- ----------------------------
-- View structure for `view_chk_defective_name`
-- ----------------------------
DROP VIEW IF EXISTS `view_chk_defective_name`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_chk_defective_name` AS select `c_clamas`.`refno` AS `refno`,`c_clamas`.`ag_code` AS `ag_code`,`c_clamas`.`ag_name` AS `ag_name`,`s_crnma`.`CUS_NAME` AS `CUS_NAME`,`c_clamas`.`entdate` AS `entdate` from (`c_clamas` join `s_crnma` on(`s_crnma`.`REF_NO` = `c_clamas`.`DGRN_NO`));

-- ----------------------------
-- View structure for `view_chk_srnma`
-- ----------------------------
DROP VIEW IF EXISTS `view_chk_srnma`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_chk_srnma` AS select `s_crnma`.`REF_NO` AS `REF_NO`,`s_crnma`.`C_CODE` AS `C_CODE`,`s_crnma`.`CUS_NAME` AS `CUS_NAME`,`vendor`.`NAME` AS `NAME`,`s_crnma`.`SDATE` AS `SDATE`,`s_crnma`.`DDATE` AS `DDATE` from (`s_crnma` join `vendor` on(`vendor`.`CODE` = `s_crnma`.`C_CODE`));

-- ----------------------------
-- View structure for `view_chk_sttr`
-- ----------------------------
DROP VIEW IF EXISTS `view_chk_sttr`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_chk_sttr` AS select `s_crec`.`CA_REFNO` AS `CA_REFNO`,`s_crec`.`CA_DATE` AS `CA_DATE`,`s_sttr`.`ST_REFNO` AS `ST_REFNO`,`s_sttr`.`ST_DATE` AS `ST_DATE`,`s_sttr`.`ID` AS `ID` from (`s_crec` join `s_sttr` on(`s_crec`.`CA_REFNO` = `s_sttr`.`ST_REFNO`));

-- ----------------------------
-- View structure for `view_chstrrr`
-- ----------------------------
DROP VIEW IF EXISTS `view_chstrrr`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_chstrrr` AS select `ch_sttr`.`ST_REFNO` AS `ST_REFNO`,`ch_sttr`.`ST_CHNO` AS `ST_CHNO`,`ch_sttr`.`ST_CHBANK` AS `ST_CHBANK`,`s_invcheq`.`refno` AS `refno`,`s_invcheq`.`cheque_no` AS `cheque_no`,`s_invcheq`.`che_date` AS `che_date`,`s_invcheq`.`bank` AS `bank`,`ch_sttr`.`id` AS `id`,`ch_sttr`.`ST_CHEDATE` AS `ST_CHEDATE` from (`ch_sttr` join `s_invcheq` on(`s_invcheq`.`refno` = `ch_sttr`.`ST_REFNO` and `s_invcheq`.`cheque_no` = `ch_sttr`.`ST_CHNO`));

-- ----------------------------
-- View structure for `view_ch_sttr`
-- ----------------------------
DROP VIEW IF EXISTS `view_ch_sttr`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_ch_sttr` AS select `ch_sttr`.`ST_REFNO` AS `ST_REFNO`,`ch_sttr`.`ST_DATE` AS `ST_DATE`,`ch_sttr`.`ST_INVONO` AS `ST_INVONO`,`ch_sttr`.`ST_PAID` AS `ST_PAID`,`ch_sttr`.`ST_FLAG` AS `ST_FLAG`,`ch_sttr`.`ST_INDATE` AS `ST_INDATE`,`ch_sttr`.`ST_CHBANK` AS `ST_CHBANK`,`ch_sttr`.`ST_DAYS` AS `ST_DAYS`,`ch_sttr`.`ST_CHNO` AS `ST_CHNO`,`ch_sttr`.`DUE` AS `DUE`,`ch_sttr`.`SETTLED_NO` AS `SETTLED_NO`,`ch_sttr`.`DEV` AS `DEV`,`ch_sttr`.`RET_CHVAL` AS `RET_CHVAL`,`ch_sttr`.`RET_CHSET` AS `RET_CHSET`,`ch_sttr`.`ST_CHEDATE` AS `ST_CHEDATE`,`ch_sttr`.`cus_code` AS `cus_code`,`ch_sttr`.`ap_days` AS `ap_days`,`s_cheq`.`PAID` AS `PAID`,`s_cheq`.`CR_CHEVAL` AS `CR_CHEVAL`,`s_cheq`.`CR_FLAG` AS `CR_FLAG`,`s_cheq`.`CR_DATE` AS `CR_DATE`,`s_cheq`.`CR_C_CODE` AS `CR_C_CODE`,`s_cheq`.`CR_C_NAME` AS `CR_C_NAME`,`s_crec`.`pay_type` AS `pay_type`,`s_cheq`.`CR_CHNO` AS `CR_CHNO`,`s_cheq`.`CR_CHDATE` AS `CR_CHDATE`,`s_crec`.`AC_REFNO` AS `AC_REFNO`,`s_cheq`.`CR_REPAY` AS `CR_REPAY`,`s_cheq`.`CR_REFNO` AS `CR_REFNO`,`s_cheq`.`S_REF` AS `S_REF` from ((`s_cheq` left join `ch_sttr` on(`ch_sttr`.`ST_INVONO` = `s_cheq`.`CR_REFNO`)) left join `s_crec` on(`ch_sttr`.`ST_REFNO` = `s_crec`.`CA_REFNO`));

-- ----------------------------
-- View structure for `view_clamas_brand`
-- ----------------------------
DROP VIEW IF EXISTS `view_clamas_brand`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_clamas_brand` AS select `c_clamas`.`DGRN_NO` AS `DGRN_NO`,`c_clamas`.`DGRN_NO2` AS `DGRN_NO2`,`c_clamas`.`DGRN_NO3` AS `DGRN_NO3`,`c_clamas`.`refno` AS `refno`,`c_clamas`.`entdate` AS `entdate`,`c_clamas`.`cl_no` AS `cl_no`,`c_clamas`.`ag_code` AS `ag_code`,`c_clamas`.`ag_name` AS `ag_name`,`c_clamas`.`agadd` AS `agadd`,`c_clamas`.`cus_name` AS `cus_name`,`c_clamas`.`cus_add` AS `cus_add`,`c_clamas`.`stk_no` AS `stk_no`,`c_clamas`.`des` AS `des`,`c_clamas`.`brand` AS `brand`,`c_clamas`.`siz` AS `siz`,`c_clamas`.`pr` AS `pr`,`c_clamas`.`patt` AS `patt`,`c_clamas`.`seri_no` AS `seri_no`,`c_clamas`.`tc_ob` AS `tc_ob`,`c_clamas`.`Mn_ob` AS `Mn_ob`,`c_clamas`.`remin` AS `remin`,`c_clamas`.`cldate` AS `cldate`,`c_clamas`.`spec` AS `spec`,`c_clamas`.`remming` AS `remming`,`c_clamas`.`ref_per` AS `ref_per`,`c_clamas`.`CRD_no` AS `CRD_no`,`c_clamas`.`CRE_date` AS `CRE_date`,`c_clamas`.`CRE_amount` AS `CRE_amount`,`c_clamas`.`ID` AS `ID`,`c_clamas`.`remin1` AS `remin1`,`c_clamas`.`remin2` AS `remin2`,`c_clamas`.`remin3` AS `remin3`,`c_clamas`.`remin4` AS `remin4`,`c_clamas`.`remin5` AS `remin5`,`c_clamas`.`origin1` AS `origin1`,`c_clamas`.`origin2` AS `origin2`,`c_clamas`.`origin3` AS `origin3`,`c_clamas`.`origin4` AS `origin4`,`c_clamas`.`origin5` AS `origin5`,`c_clamas`.`rem_per` AS `rem_per`,`c_clamas`.`Refund` AS `Refund`,`c_clamas`.`recieve_date` AS `recieve_date`,`c_clamas`.`Commercialy` AS `Commercialy`,`c_clamas`.`add_ref1` AS `add_ref1`,`c_clamas`.`add_ref2` AS `add_ref2`,`c_clamas`.`Amount` AS `Amount`,`c_clamas`.`qty` AS `qty`,`c_clamas`.`type` AS `type`,`c_clamas`.`Sold_date` AS `Sold_date`,`c_clamas`.`Sold_date_c` AS `Sold_date_c`,`c_clamas`.`Chk_date` AS `Chk_date`,`c_clamas`.`Cell1_el` AS `Cell1_el`,`c_clamas`.`Cell2_el` AS `Cell2_el`,`c_clamas`.`Cell3_el` AS `Cell3_el`,`c_clamas`.`Cell4_el` AS `Cell4_el`,`c_clamas`.`Cell5_el` AS `Cell5_el`,`c_clamas`.`Cell6_el` AS `Cell6_el`,`c_clamas`.`Cell1_Ispg` AS `Cell1_Ispg`,`c_clamas`.`Cell2_Ispg` AS `Cell2_Ispg`,`c_clamas`.`Cell3_Ispg` AS `Cell3_Ispg`,`c_clamas`.`Cell4_Ispg` AS `Cell4_Ispg`,`c_clamas`.`Cell5_Ispg` AS `Cell5_Ispg`,`c_clamas`.`Cell6_Ispg` AS `Cell6_Ispg`,`c_clamas`.`Cell1_Aspg` AS `Cell1_Aspg`,`c_clamas`.`Cell2_Aspg` AS `Cell2_Aspg`,`c_clamas`.`Cell3_Aspg` AS `Cell3_Aspg`,`c_clamas`.`Cell4_Aspg` AS `Cell4_Aspg`,`c_clamas`.`Cell5_Aspg` AS `Cell5_Aspg`,`c_clamas`.`Cell6_Aspg` AS `Cell6_Aspg`,`c_clamas`.`approve_md_wd` AS `approve_md_wd`,`c_clamas`.`tmp_no` AS `tmp_no`,`c_clamas`.`gatepass` AS `gatepass`,`c_clamas`.`returndate` AS `returndate`,`c_clamas`.`OCV` AS `OCV`,`c_clamas`.`OCV2` AS `OCV2`,`c_clamas`.`OCV3` AS `OCV3`,`c_clamas`.`rbat_serino` AS `rbat_serino`,`brand_mas`.`class` AS `class`,`c_clamas`.`cl_approve` AS `cl_approve` from (`c_clamas` join `brand_mas` on(`brand_mas`.`barnd_name` = `c_clamas`.`brand`));

-- ----------------------------
-- View structure for `view_com_she_b_mas`
-- ----------------------------
DROP VIEW IF EXISTS `view_com_she_b_mas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_com_she_b_mas` AS select `com_she`.`Brand` AS `Brand`,`com_she`.`sal_ex` AS `sal_ex`,`com_she`.`T1_Cat1` AS `T1_Cat1`,`com_she`.`T1_cat2` AS `T1_cat2`,`com_she`.`T1_cat3` AS `T1_cat3`,`com_she`.`T2_Cat1` AS `T2_Cat1`,`com_she`.`T2_cat2` AS `T2_cat2`,`com_she`.`T2_Cat3` AS `T2_Cat3`,`com_she`.`T3_cat1` AS `T3_cat1`,`com_she`.`T3_cat2` AS `T3_cat2`,`com_she`.`T3_cat3` AS `T3_cat3`,`com_she`.`id` AS `id`,`com_she`.`Day1` AS `Day1`,`com_she`.`Day2` AS `Day2`,`brand_mas`.`act` AS `act` from (`brand_mas` join `com_she` on(`brand_mas`.`barnd_name` = `com_she`.`Brand`));

-- ----------------------------
-- View structure for `view_cred1`
-- ----------------------------
DROP VIEW IF EXISTS `view_cred1`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_cred1` AS select `cred`.`C_REFNO` AS `C_REFNO`,`cred`.`C_DATE` AS `C_DATE`,`cred`.`C_CODE` AS `C_CODE`,`cred`.`C_INVNO` AS `C_INVNO`,`cred`.`C_PAYMENT` AS `C_PAYMENT`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`SDATE` AS `SDATE`,`cred`.`CANCELL` AS `CANCELL`,`s_salma`.`GST` AS `GST` from (`cred` join `s_salma` on(`cred`.`C_INVNO` = `s_salma`.`REF_NO`));

-- ----------------------------
-- View structure for `view_crnma`
-- ----------------------------
DROP VIEW IF EXISTS `view_crnma`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_crnma` AS select `c_bal`.`trn_type` AS `trn_type2`,`s_crnma`.`REF_NO` AS `REF_NO`,`s_crnma`.`DDATE` AS `DDATE`,`s_crnma`.`TRN_TYPE` AS `TRN_TYPE`,`s_crnma`.`INVOICENO` AS `INVOICENO`,`s_crnma`.`SDATE` AS `SDATE`,`s_crnma`.`C_CODE` AS `C_CODE`,`s_crnma`.`CUS_NAME` AS `CUS_NAME`,`s_crnma`.`TYPE` AS `TYPE`,`s_crnma`.`SAL_EX` AS `SAL_EX`,`s_crnma`.`DISCOU` AS `DISCOU`,`s_crnma`.`AMOUNT` AS `AMOUNT`,`s_crnma`.`GST` AS `GST`,`s_crnma`.`GRAND_TOT` AS `GRAND_TOT`,`s_crnma`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_crnma`.`DIS` AS `DIS`,`s_crnma`.`DIS1` AS `DIS1`,`s_crnma`.`DIS_RUP` AS `DIS_RUP`,`s_crnma`.`CASH` AS `CASH`,`s_crnma`.`TOT_REPAY` AS `TOT_REPAY`,`s_crnma`.`DEPARTMENT` AS `DEPARTMENT`,`s_crnma`.`CANCELL` AS `CANCELL`,`s_crnma`.`C_BAL` AS `C_BAL`,`s_crnma`.`DEP_CODE` AS `DEP_CODE`,`s_crnma`.`Brand` AS `Brand`,`s_crnma`.`DEV` AS `DEV`,`s_crnma`.`stoRef` AS `stoRef`,`s_crnma`.`seri_no` AS `seri_no`,`s_crnma`.`vatrate` AS `vatrate`,`s_crnma`.`sdate1` AS `sdate1` from (`s_crnma` left join `c_bal` on(`c_bal`.`REFNO` = `s_crnma`.`REF_NO`));

-- ----------------------------
-- View structure for `view_crnma_crntrn`
-- ----------------------------
DROP VIEW IF EXISTS `view_crnma_crntrn`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_crnma_crntrn` AS select `s_crnma`.`REF_NO` AS `REF_NO`,`s_crnma`.`DDATE` AS `DDATE`,`s_crnma`.`INVOICENO` AS `INVOICENO`,`s_crnma`.`C_CODE` AS `C_CODE`,`s_crnma`.`CUS_NAME` AS `CUS_NAME`,`s_crnma`.`SAL_EX` AS `SAL_EX`,`s_crntrn`.`STK_NO` AS `STK_NO`,`s_crntrn`.`DESCRIPT` AS `DESCRIPT`,`s_crnma`.`CANCELL` AS `CANCELL`,`s_crntrn`.`DIS_RS` AS `DIS_RS`,`s_crntrn`.`DIS_P` AS `DIS_P`,`s_crntrn`.`PRICE` AS `PRICE`,`s_crntrn`.`QTY` AS `QTY`,`s_crnma`.`SDATE` AS `SDATE`,`s_crnma`.`TRN_TYPE` AS `TRN_TYPE` from (`s_crntrn` left join `s_crnma` on(`s_crnma`.`REF_NO` = `s_crntrn`.`REF_NO`));

-- ----------------------------
-- View structure for `view_crntrn_smas`
-- ----------------------------
DROP VIEW IF EXISTS `view_crntrn_smas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_crntrn_smas` AS select `s_crntrn`.`REF_NO` AS `REF_NO`,`s_crntrn`.`STK_NO` AS `STK_NO`,`s_crntrn`.`SDATE` AS `SDATE`,`s_crntrn`.`DESCRIPT` AS `DESCRIPT`,`s_crntrn`.`UNIT` AS `UNIT`,`s_crntrn`.`DIS_RS` AS `DIS_RS`,`s_crntrn`.`DIS_P` AS `DIS_P`,`s_crntrn`.`PRICE` AS `PRICE`,`s_crntrn`.`QTY` AS `QTY`,`s_crntrn`.`DEPARTMENT` AS `DEPARTMENT`,`s_crntrn`.`BRAND` AS `BRAND`,`s_crntrn`.`CANCELL` AS `CANCELL`,`s_crntrn`.`VAT` AS `VAT`,`s_crntrn`.`Seri_no` AS `Seri_no`,`s_crntrn`.`vatrate` AS `vatrate`,`s_mas`.`COST` AS `COST`,`s_crnma`.`SAL_EX` AS `SAL_EX`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME`,`s_mas`.`acc_cost` AS `acc_cost`,`s_crntrn`.`s_price` AS `s_price`,`s_crnma`.`CUS_NAME` AS `CUS_NAME`,`s_crnma`.`C_CODE` AS `C_CODE`,`s_mas`.`type` AS `type`,`s_mas`.`Cat1` AS `Cat1`,`s_crnma`.`company` AS `company` from ((`s_crntrn` join `s_mas` on(`s_crntrn`.`STK_NO` = `s_mas`.`STK_NO`)) join `s_crnma` on(`s_crntrn`.`REF_NO` = `s_crnma`.`REF_NO`));

-- ----------------------------
-- View structure for `view_cusorder_view`
-- ----------------------------
DROP VIEW IF EXISTS `view_cusorder_view`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_cusorder_view` AS select `s_cusordmas`.`REF_NO` AS `REF_NO`,`s_cusordmas`.`C_CODE` AS `C_CODE`,`s_cusordmas`.`SDATE` AS `SDATE`,`s_cusordtrn`.`STK_NO` AS `STK_NO`,`s_cusordtrn`.`DESCRIPT` AS `DESCRIPT`,`s_cusordtrn`.`QTY` AS `QTY`,`s_cusordtrn`.`BRAND` AS `BRAND` from (`s_cusordmas` join `s_cusordtrn` on(`s_cusordmas`.`REF_NO` = `s_cusordtrn`.`REF_NO`));

-- ----------------------------
-- View structure for `view_cusordmas_trn`
-- ----------------------------
DROP VIEW IF EXISTS `view_cusordmas_trn`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_cusordmas_trn` AS select `s_cusordmas`.`REF_NO` AS `REF_NO`,`s_cusordmas`.`SDATE` AS `SDATE`,`s_cusordmas`.`C_CODE` AS `C_CODE`,`s_cusordmas`.`CUS_NAME` AS `CUS_NAME`,`s_cusordmas`.`SAL_EX` AS `SAL_EX`,`s_cusordmas`.`DEPARTMENT` AS `DEPARTMENT`,`s_cusordmas`.`CANCELL` AS `CANCELL`,`s_cusordmas`.`INVNO` AS `INVNO`,`s_cusordtrn`.`STK_NO` AS `STK_NO`,`s_cusordtrn`.`QTY` AS `QTY` from (`s_cusordmas` join `s_cusordtrn` on(`s_cusordmas`.`REF_NO` = `s_cusordtrn`.`REF_NO`));

-- ----------------------------
-- View structure for `view_c_bal`
-- ----------------------------
DROP VIEW IF EXISTS `view_c_bal`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_c_bal` AS select `c_bal`.`ID` AS `ID`,`c_bal`.`REFNO` AS `REFNO`,`c_bal`.`SDATE` AS `SDATE`,`c_bal`.`CUSCODE` AS `CUSCODE`,`c_bal`.`AMOUNT` AS `AMOUNT`,`c_bal`.`BALANCE` AS `BALANCE`,`c_bal`.`DEP` AS `DEP`,`c_bal`.`SAL_EX` AS `SAL_EX`,`c_bal`.`CANCELL` AS `CANCELL`,`c_bal`.`brand` AS `brand`,`c_bal`.`DEV` AS `DEV`,`c_bal`.`trn_type` AS `trn_type`,`c_bal`.`vatrate` AS `vatrate`,`c_bal`.`RNO` AS `RNO`,`c_bal`.`flag1` AS `flag1`,`c_bal`.`active` AS `active`,`c_bal`.`Costcenter` AS `Costcenter`,`brand_mas`.`class` AS `class` from (`c_bal` join `brand_mas` on(`c_bal`.`brand` = `brand_mas`.`barnd_name`));

-- ----------------------------
-- View structure for `view_c_bal_s_deftrn`
-- ----------------------------
DROP VIEW IF EXISTS `view_c_bal_s_deftrn`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_c_bal_s_deftrn` AS select `c_bal`.`ID` AS `ID`,`c_bal`.`REFNO` AS `REFNO`,`c_bal`.`SDATE` AS `sdate`,`c_bal`.`CUSCODE` AS `CUSCODE`,`c_bal`.`AMOUNT` AS `AMOUNT`,`c_bal`.`BALANCE` AS `BALANCE`,`c_bal`.`DEP` AS `DEP`,`c_bal`.`SAL_EX` AS `sal_ex`,`c_bal`.`CANCELL` AS `CANCELL`,`c_bal`.`brand` AS `brand`,`c_bal`.`DEV` AS `DEV`,`c_bal`.`trn_type` AS `trn_type`,`c_bal`.`old` AS `old`,`c_bal`.`vatrate` AS `vatrate`,`c_bal`.`RNO` AS `RNO`,`c_bal`.`flag1` AS `flag1`,`c_bal`.`active` AS `active`,`c_bal`.`totpay` AS `totpay`,`s_deftrn`.`BAT_NO` AS `BAT_NO`,`s_mas`.`PART_NO` AS `PART_NO`,`s_deftrn`.`REsult` AS `REsult`,`s_mas`.`Cat1` AS `cat1`,`s_deftrn`.`CLAM_NO` AS `CLAM_NO`,`brand_mas`.`class` AS `class`,`s_mas`.`DESCRIPT` AS `DESCRIPT`,`c_bal`.`c_code1` AS `c_code1`,`s_deftrn`.`hide` AS `hide`,`s_deftrn`.`denie` AS `denie`,`c_bal`.`app2` AS `app2`,`c_bal`.`app1` AS `app1`,`c_bal`.`block` AS `block` from ((`c_bal` left join `brand_mas` on(`brand_mas`.`barnd_name` = `c_bal`.`brand`)) left join (`s_mas` left join `s_deftrn` on(`s_mas`.`STK_NO` = `s_deftrn`.`STK_NO`)) on(`c_bal`.`REFNO` = `s_deftrn`.`REFNO`));

-- ----------------------------
-- View structure for `view_c_bal_vendor`
-- ----------------------------
DROP VIEW IF EXISTS `view_c_bal_vendor`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_c_bal_vendor` AS select `c_bal`.`ID` AS `ID`,`c_bal`.`REFNO` AS `REFNO`,`c_bal`.`SDATE` AS `SDATE`,`c_bal`.`CUSCODE` AS `CUSCODE`,`c_bal`.`AMOUNT` AS `AMOUNT`,`c_bal`.`BALANCE` AS `BALANCE`,`c_bal`.`DEP` AS `DEP`,`c_bal`.`SAL_EX` AS `SAL_EX`,`c_bal`.`CANCELL` AS `Cancell`,`c_bal`.`brand` AS `brand`,`c_bal`.`DEV` AS `DEV`,`c_bal`.`trn_type` AS `trn_type`,`c_bal`.`old` AS `old`,`c_bal`.`vatrate` AS `vatrate`,`c_bal`.`RNO` AS `RNO`,`c_bal`.`flag1` AS `flag1`,`c_bal`.`active` AS `active`,`c_bal`.`totpay` AS `totpay`,`brand_mas`.`MAX_INCEN_DIS` AS `MAX_INCEN_DIS`,`brand_mas`.`delinrate` AS `delinrate`,`brand_mas`.`class` AS `class` from (`c_bal` left join `brand_mas` on(`c_bal`.`brand` = `brand_mas`.`barnd_name`));

-- ----------------------------
-- View structure for `view_c_bal_vendor_new`
-- ----------------------------
DROP VIEW IF EXISTS `view_c_bal_vendor_new`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_c_bal_vendor_new` AS select `c_bal`.`ID` AS `ID`,`c_bal`.`REFNO` AS `REFNO`,`c_bal`.`SDATE` AS `SDATE`,`c_bal`.`CUSCODE` AS `CUSCODE`,`c_bal`.`AMOUNT` AS `AMOUNT`,`c_bal`.`BALANCE` AS `BALANCE`,`c_bal`.`DEP` AS `DEP`,`c_bal`.`SAL_EX` AS `SAL_EX`,`c_bal`.`CANCELL` AS `CANCELL`,`c_bal`.`brand` AS `brand`,`c_bal`.`DEV` AS `DEV`,`c_bal`.`trn_type` AS `trn_type`,`c_bal`.`trn_type2` AS `trn_type2`,`c_bal`.`old` AS `old`,`c_bal`.`vatrate` AS `vatrate`,`c_bal`.`RNO` AS `RNO`,`c_bal`.`flag1` AS `flag1`,`c_bal`.`active` AS `active`,`c_bal`.`totpay` AS `totpay`,`c_bal`.`tmp_no` AS `tmp_no`,`c_bal`.`Costcenter` AS `Costcenter`,`c_bal`.`VAT` AS `VAT`,`c_bal`.`vat_no` AS `vat_no`,`c_bal`.`s_vat_no` AS `s_vat_no`,`c_bal`.`vat_val` AS `vat_val`,`vendor`.`NAME` AS `NAME`,`vendor`.`vatno` AS `vatno`,`vendor`.`svatno` AS `svatno`,`c_bal`.`c_code1` AS `c_code1` from (`c_bal` join `vendor` on(`c_bal`.`CUSCODE` = `vendor`.`CODE`));

-- ----------------------------
-- View structure for `view_import`
-- ----------------------------
DROP VIEW IF EXISTS `view_import`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_import` AS select `c_clamas`.`refno` AS `refno`,`c_clamas`.`entdate` AS `entdate`,`c_clamas`.`cl_no` AS `cl_no`,`c_clamas`.`ag_code` AS `ag_code`,`c_clamas`.`ag_name` AS `ag_name`,`c_clamas`.`stk_no` AS `stk_no`,`c_clamas`.`des` AS `des`,`c_clamas`.`brand` AS `brand` from (`c_clamas` join `tmpseri` on(`tmpseri`.`adno` = `c_clamas`.`cl_no`));

-- ----------------------------
-- View structure for `view_inv_item`
-- ----------------------------
DROP VIEW IF EXISTS `view_inv_item`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_inv_item` AS select `s_invo`.`id` AS `id`,`s_invo`.`REF_NO` AS `REF_NO`,`s_invo`.`SDATE` AS `SDATE`,`s_invo`.`STK_NO` AS `STK_NO`,`s_invo`.`DESCRIPT` AS `DESCRIPT`,`s_invo`.`UNIT` AS `UNIT`,`s_invo`.`PART_NO` AS `PART_NO`,`s_invo`.`COST` AS `COST`,`s_invo`.`PRICE` AS `PRICE`,`s_invo`.`QTY` AS `QTY`,`s_invo`.`DEPARTMENT` AS `DEPARTMENT`,`s_invo`.`DIS_per` AS `DIS_per`,`s_invo`.`DIS_rs` AS `DIS_rs`,`s_invo`.`REP` AS `REP`,`s_invo`.`TAX_PER` AS `TAX_PER`,`s_invo`.`ret_qty` AS `ret_qty`,`s_invo`.`BRAND` AS `BRAND`,`s_invo`.`DEV` AS `DEV`,`s_invo`.`CANCELL` AS `CANCELL`,`s_invo`.`c_code` AS `c_code`,`s_invo`.`Print_dis1` AS `Print_dis1`,`s_invo`.`Print_dis2` AS `Print_dis2`,`s_invo`.`vatrate` AS `vatrate`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME`,`s_mas`.`CAT` AS `CAT`,`s_mas`.`type` AS `type`,`s_mas`.`Cat1` AS `CAT1`,`s_salma`.`CANCELL` AS `CANCELL1`,`s_salma`.`C_CODE` AS `C_CODE1`,`s_salma`.`CUS_NAME` AS `CUS_NAME1` from ((`s_mas` join `s_invo` on(`s_mas`.`STK_NO` = `s_invo`.`STK_NO`)) join `s_salma` on(`s_invo`.`REF_NO` = `s_salma`.`REF_NO`));

-- ----------------------------
-- View structure for `view_inv_mas_chk`
-- ----------------------------
DROP VIEW IF EXISTS `view_inv_mas_chk`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_inv_mas_chk` AS select `s_invo`.`REF_NO` AS `REF_NO`,`s_invo`.`STK_NO` AS `STK_NO`,`s_invo`.`PRICE` AS `PRICE`,`s_mas`.`SELLING` AS `SELLING`,`s_invo`.`SDATE` AS `SDATE` from (`s_invo` join `s_mas` on(`s_invo`.`STK_NO` = `s_mas`.`STK_NO`));

-- ----------------------------
-- View structure for `view_led_vendor`
-- ----------------------------
DROP VIEW IF EXISTS `view_led_vendor`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_led_vendor` AS select `s_led`.`C_CODE` AS `C_CODE`,`vendor`.`NAME` AS `NAME`,`vendor`.`ADD1` AS `ADD1`,`s_led`.`SDATE` AS `SDATE`,`s_led`.`REF_NO` AS `REF_NO`,`s_led`.`FLAG` AS `FLAG`,`vendor`.`CODE` AS `CODE` from (`s_led` join `vendor` on(`s_led`.`C_CODE` = `vendor`.`CODE`));

-- ----------------------------
-- View structure for `view_list_aud`
-- ----------------------------
DROP VIEW IF EXISTS `view_list_aud`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_list_aud` AS select `list_price_aud`.`STK_NO` AS `STK_NO`,`list_price_aud`.`list` AS `list`,`s_invo`.`PRICE` AS `PRICE`,`s_invo`.`SDATE` AS `SDATE`,`s_invo`.`CANCELL` AS `CANCELL`,`s_invo`.`REF_NO` AS `REF_NO`,`s_invo`.`BRAND` AS `BRAND`,`s_invo`.`STK_NO` AS `INV_STKNO`,`s_invo`.`DIS_per` AS `DIS_per` from (`s_invo` left join `list_price_aud` on(`list_price_aud`.`STK_NO` = `s_invo`.`STK_NO`));

-- ----------------------------
-- View structure for `view_quomas_quotrn_s_mas`
-- ----------------------------
DROP VIEW IF EXISTS `view_quomas_quotrn_s_mas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_quomas_quotrn_s_mas` AS select `s_quomas`.`REF_NO` AS `REF_NO`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME`,`s_quotrn`.`id` AS `id`,`s_quotrn`.`SDATE` AS `SDATE`,`s_quotrn`.`STK_NO` AS `STK_NO`,`s_quotrn`.`DESCRIPT` AS `DESCRIPT`,`s_quotrn`.`UNIT` AS `UNIT`,`s_quotrn`.`PART_NO` AS `PART_NO`,`s_quotrn`.`COST` AS `COST`,`s_quotrn`.`PRICE` AS `PRICE`,`s_quotrn`.`QTY` AS `QTY`,`s_quotrn`.`DEPARTMENT` AS `DEPARTMENT`,`s_quotrn`.`DIS_per` AS `DIS_per`,`s_quotrn`.`DIS_rs` AS `DIS_rs`,`s_quotrn`.`GROUP` AS `GROUP`,`s_quotrn`.`REP` AS `REP`,`s_quotrn`.`TAX_PER` AS `TAX_PER`,`s_quotrn`.`ret_qty` AS `ret_qty`,`s_quotrn`.`DEV` AS `DEV`,`s_quotrn`.`vatrate` AS `vatrate`,`s_quotrn`.`VAT` AS `VAT` from ((`s_quomas` join `s_quotrn` on(`s_quomas`.`REF_NO` = `s_quotrn`.`REF_NO`)) join `s_mas` on(`s_mas`.`STK_NO` = `s_quotrn`.`STK_NO`));

-- ----------------------------
-- View structure for `view_repmas_reptarbrand`
-- ----------------------------
DROP VIEW IF EXISTS `view_repmas_reptarbrand`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_repmas_reptarbrand` AS select `s_salrep`.`REPCODE` AS `REPCODE`,`s_salrep`.`Name` AS `Name`,`s_salrep`.`DEL` AS `DEL`,`s_salrep`.`ordNo` AS `ordNo`,`s_salrep`.`cat` AS `cat`,`s_salrep`.`cancel` AS `cancel`,`s_salrep`.`RGROUP` AS `RGROUP`,`s_salrep`.`DONO` AS `DONO`,`s_salrep`.`tmp_no` AS `tmp_no`,`s_salrep`.`RGROUP1` AS `RGROUP1`,`s_salrep`.`RGROUP2` AS `RGROUP2`,`rep_targetbrand`.`target` AS `target`,`rep_targetbrand`.`month` AS `month`,`rep_targetbrand`.`brand` AS `brand` from (`rep_targetbrand` join `s_salrep` on(`s_salrep`.`REPCODE` = `rep_targetbrand`.`rep`));

-- ----------------------------
-- View structure for `view_repmas_reptrn`
-- ----------------------------
DROP VIEW IF EXISTS `view_repmas_reptrn`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_repmas_reptrn` AS select `s_salrep`.`REPCODE` AS `REPCODE`,`s_salrep`.`Name` AS `Name`,`s_salrep`.`DEL` AS `DEL`,`s_salrep`.`ordNo` AS `ordNo`,`s_salrep`.`cat` AS `cat`,`s_salrep`.`cancel` AS `cancel`,`s_salrep`.`RGROUP` AS `RGROUP`,`s_salrep`.`DONO` AS `DONO`,`s_salrep`.`tmp_no` AS `tmp_no`,`s_salrep`.`RGROUP1` AS `RGROUP1`,`s_salrep`.`RGROUP2` AS `RGROUP2`,`reptrn`.`Target` AS `Target`,`reptrn`.`BrAnd` AS `BrAnd` from (`reptrn` join `s_salrep` on(`s_salrep`.`REPCODE` = `reptrn`.`rep_code`));

-- ----------------------------
-- View structure for `view_repord_brand_btr`
-- ----------------------------
DROP VIEW IF EXISTS `view_repord_brand_btr`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_repord_brand_btr` AS select `s_cusordmas`.`id` AS `id`,`s_cusordmas`.`REF_NO` AS `REF_NO`,`s_cusordmas`.`TRN_TYPE` AS `TRN_TYPE`,`s_cusordmas`.`SDATE` AS `SDATE`,`s_cusordmas`.`C_CODE` AS `C_CODE`,`s_cusordmas`.`CUS_NAME` AS `CUS_NAME`,`s_cusordmas`.`C_ADD1` AS `C_ADD1`,`s_cusordmas`.`TYPE` AS `TYPE`,`s_cusordmas`.`SAL_EX` AS `SAL_EX`,`s_cusordmas`.`DISCOU` AS `DISCOU`,`s_cusordmas`.`AMOUNT` AS `AMOUNT`,`s_cusordmas`.`GST` AS `GST`,`s_cusordmas`.`GRAND_TOT` AS `GRAND_TOT`,`s_cusordmas`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_cusordmas`.`DIS` AS `DIS`,`s_cusordmas`.`DIS1` AS `DIS1`,`s_cusordmas`.`DIS_RUP` AS `DIS_RUP`,`s_cusordmas`.`CASH` AS `CASH`,`s_cusordmas`.`TOTPAY` AS `TOTPAY`,`s_cusordmas`.`ORD_NO` AS `ORD_NO`,`s_cusordmas`.`ORD_DA` AS `ORD_DA`,`s_cusordmas`.`SETTLED` AS `SETTLED`,`s_cusordmas`.`TOTPAY1` AS `TOTPAY1`,`s_cusordmas`.`DES_CAT` AS `DES_CAT`,`s_cusordmas`.`DEPARTMENT` AS `DEPARTMENT`,`s_cusordmas`.`REMARK` AS `REMARK`,`s_cusordmas`.`CANCELL` AS `CANCELL`,`s_cusordmas`.`BTT` AS `BTT`,`s_cusordmas`.`VAT` AS `VAT`,`s_cusordmas`.`Brand` AS `Brand`,`s_cusordmas`.`DEV` AS `DEV`,`s_cusordmas`.`Account` AS `Account`,`s_cusordmas`.`Accname` AS `Accname`,`s_cusordmas`.`Costcenter` AS `Costcenter`,`s_cusordmas`.`RET_AMO` AS `RET_AMO`,`s_cusordmas`.`comm` AS `comm`,`s_cusordmas`.`approveby` AS `approveby`,`s_cusordmas`.`appdate` AS `appdate`,`s_cusordmas`.`Rejectby` AS `Rejectby`,`s_cusordmas`.`rejectdate` AS `rejectdate`,`s_cusordmas`.`INVNO` AS `INVNO`,`s_cusordmas`.`REQ_DATE` AS `REQ_DATE`,`s_cusordmas`.`Limit_need` AS `Limit_need`,`s_cusordmas`.`Forward` AS `Forward`,`s_cusordmas`.`Result` AS `Result`,`brand_mas`.`class` AS `class`,`vendor`.`NAME` AS `NAME` from ((`s_cusordmas` left join `vendor` on(`s_cusordmas`.`C_CODE` = `vendor`.`CODE`)) left join `brand_mas` on(`s_cusordmas`.`Brand` = `brand_mas`.`barnd_name`));

-- ----------------------------
-- View structure for `view_repord_brand_btr1`
-- ----------------------------
DROP VIEW IF EXISTS `view_repord_brand_btr1`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_repord_brand_btr1` AS select `s_cusordmas`.`id` AS `id`,`s_cusordmas`.`REF_NO` AS `REF_NO`,`s_cusordmas`.`TRN_TYPE` AS `TRN_TYPE`,`s_cusordmas`.`SDATE` AS `SDATE`,`s_cusordmas`.`C_CODE` AS `C_CODE`,`s_cusordmas`.`CUS_NAME` AS `CUS_NAME`,`s_cusordmas`.`C_ADD1` AS `C_ADD1`,`s_cusordmas`.`TYPE` AS `TYPE`,`s_cusordmas`.`SAL_EX` AS `SAL_EX`,`s_cusordmas`.`DISCOU` AS `DISCOU`,`s_cusordmas`.`AMOUNT` AS `AMOUNT`,`s_cusordmas`.`GST` AS `GST`,`s_cusordmas`.`GRAND_TOT` AS `GRAND_TOT`,`s_cusordmas`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_cusordmas`.`DIS` AS `DIS`,`s_cusordmas`.`DIS1` AS `DIS1`,`s_cusordmas`.`DIS_RUP` AS `DIS_RUP`,`s_cusordmas`.`CASH` AS `CASH`,`s_cusordmas`.`TOTPAY` AS `TOTPAY`,`s_cusordmas`.`ORD_NO` AS `ORD_NO`,`s_cusordmas`.`ORD_DA` AS `ORD_DA`,`s_cusordmas`.`SETTLED` AS `SETTLED`,`s_cusordmas`.`TOTPAY1` AS `TOTPAY1`,`s_cusordmas`.`DES_CAT` AS `DES_CAT`,`s_cusordmas`.`DEPARTMENT` AS `DEPARTMENT`,`s_cusordmas`.`REMARK` AS `REMARK`,`s_cusordmas`.`CANCELL` AS `CANCELL`,`s_cusordmas`.`BTT` AS `BTT`,`s_cusordmas`.`VAT` AS `VAT`,`s_cusordmas`.`Brand` AS `Brand`,`s_cusordmas`.`DEV` AS `DEV`,`s_cusordmas`.`Account` AS `Account`,`s_cusordmas`.`Accname` AS `Accname`,`s_cusordmas`.`Costcenter` AS `Costcenter`,`s_cusordmas`.`RET_AMO` AS `RET_AMO`,`s_cusordmas`.`comm` AS `comm`,`s_cusordmas`.`approveby` AS `approveby`,`s_cusordmas`.`appdate` AS `appdate`,`s_cusordmas`.`Rejectby` AS `Rejectby`,`s_cusordmas`.`rejectdate` AS `rejectdate`,`s_cusordmas`.`INVNO` AS `INVNO`,`s_cusordmas`.`REQ_DATE` AS `REQ_DATE`,`s_cusordmas`.`Limit_need` AS `Limit_need`,`s_cusordmas`.`Forward` AS `Forward`,`s_cusordmas`.`Result` AS `Result`,`brand_mas`.`class` AS `class` from (`s_cusordmas` left join `brand_mas` on(`s_cusordmas`.`Brand` = `brand_mas`.`barnd_name`));

-- ----------------------------
-- View structure for `view_repwise`
-- ----------------------------
DROP VIEW IF EXISTS `view_repwise`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_repwise` AS select `s_ginmas`.`SDATE` AS `SDATE`,`s_ginmas`.`REF_NO` AS `REF_NO`,`s_ginmas`.`DEP_TO` AS `DEP_TO`,`s_purtrn`.`REFNO` AS `REFNO`,`s_purtrn`.`STK_NO` AS `STK_NO`,`s_purtrn`.`REC_QTY` AS `REC_QTY`,`s_trn`.`QTY` AS `QTY`,`s_purtrn`.`CANCEL` AS `CANCEL`,`s_purtrn`.`COST` AS `COST`,`s_purtrn`.`acc_cost` AS `acc_cost` from ((`s_ginmas` join `s_purtrn` on(`s_purtrn`.`REFNO` = `s_ginmas`.`AR_NO`)) join `s_trn` on(`s_trn`.`REFNO` = `s_ginmas`.`REF_NO` and `s_trn`.`DEPARTMENT` = `s_ginmas`.`DEP_TO` and `s_trn`.`STK_NO` = `s_purtrn`.`STK_NO`));

-- ----------------------------
-- View structure for `view_rep_scan`
-- ----------------------------
DROP VIEW IF EXISTS `view_rep_scan`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_rep_scan` AS select `pur_serino`.`serino` AS `serino`,`pur_serino`.`stk_no` AS `stk_no`,`pur_serino`.`arno` AS `arno`,`pur_serino`.`id` AS `id`,`inv_serino`.`refno` AS `refno`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_invo`.`DESCRIPT` AS `DESCRIPT`,`s_salma`.`SDATE` AS `SDATE`,`rep_serial_scan`.`sdate` AS `scan_date`,`rep_serial_scan`.`imei` AS `imei` from ((((`inv_serino` join `pur_serino` on(`pur_serino`.`serino` = `inv_serino`.`serino`)) join `s_salma` on(`inv_serino`.`refno` = `s_salma`.`REF_NO`)) join `s_invo` on(`s_invo`.`REF_NO` = `s_salma`.`REF_NO` and `s_invo`.`STK_NO` = `inv_serino`.`stk_no`)) join `rep_serial_scan` on(`rep_serial_scan`.`scan` = `inv_serino`.`serino`));

-- ----------------------------
-- View structure for `view_ret_chq_history`
-- ----------------------------
DROP VIEW IF EXISTS `view_ret_chq_history`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_ret_chq_history` AS select `ret_chq_history`.`Ref_no` AS `Ref_no`,`ret_chq_history`.`Inv_no` AS `Inv_no`,`ret_chq_history`.`Inv_date` AS `Inv_date`,`ret_chq_history`.`inv_Amt` AS `inv_Amt`,`ret_chq_history`.`st_amt` AS `st_amt`,`ret_chq_history`.`chk_no` AS `chk_no`,`ret_chq_history`.`tmp_no` AS `tmp_no`,`s_salma`.`deli_date` AS `deli_date` from (`ret_chq_history` join `s_salma` on(`ret_chq_history`.`Inv_no` = `s_salma`.`REF_NO`));

-- ----------------------------
-- View structure for `view_salama_strnstores`
-- ----------------------------
DROP VIEW IF EXISTS `view_salama_strnstores`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_salama_strnstores` AS select `s_salma`.`REF_NO` AS `REF_NO`,`s_trn_stores`.`STK_NO` AS `STK_NO`,`s_trn_stores`.`REFNO` AS `REFNO`,`s_trn_stores`.`QTY` AS `QTY`,`s_trn_stores`.`LEDINDI` AS `LEDINDI`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`SDATE` AS `SDATE`,`s_trn_stores`.`SDATE` AS `trndate`,`s_salma`.`deli_date` AS `deli_date` from (`s_salma` join `s_trn_stores` on(`s_salma`.`REF_NO` = `s_trn_stores`.`REFNO`));

-- ----------------------------
-- View structure for `view_salma_brand`
-- ----------------------------
DROP VIEW IF EXISTS `view_salma_brand`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_salma_brand` AS select `s_salma`.`id` AS `id`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`C_ADD1` AS `C_ADD1`,`s_salma`.`TYPE` AS `TYPE`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`DISCOU` AS `DISCOU`,`s_salma`.`AMOUNT` AS `AMOUNT`,`s_salma`.`GST` AS `GST`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_salma`.`DIS` AS `DIS`,`s_salma`.`DIS1` AS `DIS1`,`s_salma`.`DIS_RUP` AS `DIS_RUP`,`s_salma`.`CASH` AS `CASH`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`ORD_NO` AS `ORD_NO`,`s_salma`.`ORD_DA` AS `ORD_DA`,`s_salma`.`SETTLED` AS `SETTLED`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`s_salma`.`DES_CAT` AS `DES_CAT`,`s_salma`.`DEPARTMENT` AS `DEPARTMENT`,`s_salma`.`REMARK` AS `REMARK`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`BTT` AS `BTT`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`DEV` AS `DEV`,`s_salma`.`Account` AS `Account`,`s_salma`.`Accname` AS `Accname`,`s_salma`.`RET_AMO` AS `RET_AMO`,`s_salma`.`cre_pe` AS `cre_pe`,`s_salma`.`Comm` AS `Comm`,`s_salma`.`red` AS `red`,`s_salma`.`deli_date` AS `deli_date`,`s_salma`.`seri_no` AS `seri_no`,`s_salma`.`points` AS `points`,`s_salma`.`LOCK1` AS `LOCK1`,`s_salma`.`deliin` AS `deliin`,`s_salma`.`SVAT` AS `SVAT`,`brand_mas`.`MAX_INCEN_DIS` AS `MAX_INCEN_DIS`,`brand_mas`.`delinrate` AS `delinrate`,`brand_mas`.`b60` AS `b60`,`brand_mas`.`class` AS `class`,`s_salma`.`veheno` AS `veheno`,`s_salma`.`driver` AS `driver`,`s_salma`.`loaddate` AS `loaddate`,`s_salma`.`pirnt_serial` AS `pirnt_serial`,`s_salma`.`userid` AS `userid`,`brand_mas`.`costcenter` AS `costcenter`,`s_salma`.`sdate1` AS `sdate1` from (`s_salma` join `brand_mas` on(`s_salma`.`Brand` = `brand_mas`.`barnd_name`));

-- ----------------------------
-- View structure for `view_salma_invo_smas`
-- ----------------------------
DROP VIEW IF EXISTS `view_salma_invo_smas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_salma_invo_smas` AS select `s_salma`.`id` AS `id`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`C_ADD1` AS `C_ADD1`,`s_salma`.`TYPE` AS `TYPE`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`DISCOU` AS `DISCOU`,`s_salma`.`AMOUNT` AS `AMOUNT`,`s_salma`.`GST` AS `GST`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_salma`.`DIS` AS `DIS`,`s_salma`.`DIS1` AS `DIS1`,`s_salma`.`DIS_RUP` AS `DIS_RUP`,`s_salma`.`CASH` AS `CASH`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`ORD_NO` AS `ORD_NO`,`s_salma`.`ORD_DA` AS `ORD_DA`,`s_salma`.`SETTLED` AS `SETTLED`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`s_salma`.`DES_CAT` AS `DES_CAT`,`s_salma`.`DEPARTMENT` AS `DEPARTMENT`,`s_salma`.`REMARK` AS `REMARK`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`BTT` AS `BTT`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`DEV` AS `DEV`,`s_salma`.`Account` AS `Account`,`s_salma`.`Accname` AS `Accname`,`s_salma`.`Costcenter` AS `Costcenter`,`s_salma`.`RET_AMO` AS `RET_AMO`,`s_salma`.`Comm` AS `Comm`,`s_salma`.`red` AS `Red`,`s_salma`.`deli_date` AS `Deli_date`,`s_salma`.`seri_no` AS `seri_no`,`s_salma`.`LOCK1` AS `LOCK1`,`s_salma`.`deliin` AS `deliin`,`s_salma`.`SVAT` AS `SVAT`,`s_mas`.`type` AS `ittype`,`s_invo`.`STK_NO` AS `STK_NO`,`s_invo`.`DESCRIPT` AS `DESCRIPT`,`s_salma`.`cre_pe` AS `cre_pe`,`s_invo`.`QTY` AS `QTY`,`s_invo`.`PRICE` AS `PRICE`,`s_mas`.`SELLING` AS `SELLING`,`s_salma`.`sdate1` AS `sdate1` from (`s_salma` left join (`s_invo` left join `s_mas` on(`s_mas`.`STK_NO` = `s_invo`.`STK_NO`)) on(`s_invo`.`REF_NO` = `s_salma`.`REF_NO`));

-- ----------------------------
-- View structure for `view_salma_salrep`
-- ----------------------------
DROP VIEW IF EXISTS `view_salma_salrep`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_salma_salrep` AS select `s_salma`.`id` AS `id`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`C_ADD1` AS `C_ADD1`,`s_salma`.`TYPE` AS `TYPE`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`DISCOU` AS `DISCOU`,`s_salma`.`AMOUNT` AS `AMOUNT`,`s_salma`.`GST` AS `GST`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_salma`.`DIS` AS `DIS`,`s_salma`.`DIS1` AS `DIS1`,`s_salma`.`DIS2` AS `DIS2`,`s_salma`.`DIS_RUP` AS `DIS_RUP`,`s_salma`.`CASH` AS `CASH`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`ORD_NO` AS `ORD_NO`,`s_salma`.`ORD_DA` AS `ORD_DA`,`s_salma`.`SETTLED` AS `SETTLED`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`s_salma`.`DES_CAT` AS `DES_CAT`,`s_salma`.`DEPARTMENT` AS `DEPARTMENT`,`s_salma`.`REMARK` AS `REMARK`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`BTT` AS `BTT`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`VAT_VAL` AS `VAT_VAL`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`DEV` AS `DEV`,`s_salma`.`Account` AS `Account`,`s_salma`.`Accname` AS `Accname`,`s_salma`.`Costcenter` AS `Costcenter`,`s_salma`.`RET_AMO` AS `RET_AMO`,`s_salma`.`cre_pe` AS `cre_pe`,`s_salma`.`Comm` AS `Comm`,`s_salma`.`red` AS `red`,`s_salma`.`deli_date` AS `deli_date`,`s_salma`.`seri_no` AS `seri_no`,`s_salma`.`points` AS `points`,`s_salma`.`LOCK1` AS `LOCK1`,`s_salma`.`deliin` AS `deliin`,`s_salma`.`SVAT` AS `SVAT`,`s_salma`.`REQ_DATE` AS `REQ_DATE`,`s_salma`.`tmp_no` AS `tmp_no`,`s_salma`.`vat_no` AS `vat_no`,`s_salma`.`s_vat_no` AS `s_vat_no`,`s_salma`.`veheno` AS `veheno`,`s_salma`.`driver` AS `driver`,`s_salma`.`loaddate` AS `loaddate`,`s_salma`.`pirnt_serial` AS `pirnt_serial`,`s_salma`.`userid` AS `userid`,`s_salrep`.`REPCODE` AS `REPCODE`,`s_salrep`.`RGROUP` AS `RGROUP`,`s_salrep`.`RGROUP1` AS `RGROUP1`,`s_salrep`.`RGROUP2` AS `RGROUP2` from (`s_salma` left join `s_salrep` on(`s_salma`.`SAL_EX` = `s_salrep`.`REPCODE`));

-- ----------------------------
-- View structure for `view_salma_sinvo`
-- ----------------------------
DROP VIEW IF EXISTS `view_salma_sinvo`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_salma_sinvo` AS select `s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_invo`.`STK_NO` AS `STK_NO`,`s_invo`.`DESCRIPT` AS `DESCRIPT`,`s_invo`.`PRICE` AS `PRICE`,`s_invo`.`DIS_per` AS `DIS_per`,`s_invo`.`DIS_rs` AS `DIS_rs`,`s_invo`.`QTY` AS `QTY`,`s_invo`.`DEPARTMENT` AS `DEPARTMENT`,`s_salma`.`CANCELL` AS `CANCELL`,`s_invo`.`REF_NO` AS `REF_NO`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`cre_pe` AS `cre_pe` from (`s_salma` left join `s_invo` on(`s_salma`.`REF_NO` = `s_invo`.`REF_NO`));

-- ----------------------------
-- View structure for `view_salma_sttr`
-- ----------------------------
DROP VIEW IF EXISTS `view_salma_sttr`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_salma_sttr` AS select `s_sttr`.`ID` AS `ID`,`s_sttr`.`ST_REFNO` AS `ST_REFNO`,`s_sttr`.`ST_DATE` AS `ST_DATE`,`s_sttr`.`ST_INVONO` AS `ST_INVONO`,`s_sttr`.`ST_PAID` AS `ST_PAID`,`s_sttr`.`ST_FLAG` AS `ST_FLAG`,`s_sttr`.`ST_INDATE` AS `ST_INDATE`,`s_sttr`.`st_chbank` AS `st_chbank`,`s_sttr`.`st_days` AS `st_days`,`s_sttr`.`ST_CHNO` AS `ST_CHNO`,`s_sttr`.`DUE` AS `DUE`,`s_sttr`.`SETTLED_NO` AS `SETTLED_NO`,`s_sttr`.`DEV` AS `DEV`,`s_sttr`.`ret_chval` AS `ret_chval`,`s_sttr`.`ret_chset` AS `ret_chset`,`s_sttr`.`st_chedate` AS `st_chedate`,`s_sttr`.`st_chdate` AS `st_chdate`,`s_sttr`.`cus_code` AS `cus_code`,`s_sttr`.`ap_days` AS `ap_days`,`s_sttr`.`comm` AS `comm`,`s_sttr`.`ap_rem` AS `ap_rem`,`s_sttr`.`del_days` AS `del_days`,`s_sttr`.`deliin_days` AS `deliin_days`,`s_sttr`.`deliin_amo` AS `deliin_amo`,`s_sttr`.`deliin_lock` AS `deliin_lock`,`s_sttr`.`department` AS `department`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_crec`.`pay_type` AS `pay_type`,`s_salma`.`DEV` AS `DiV1`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`id` AS `salma_id`,`s_salma`.`deli_date` AS `Deli_date`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`s_salma`.`cre_pe` AS `cre_pe` from ((`s_salma` left join `s_sttr` on(`s_sttr`.`ST_INVONO` = `s_salma`.`REF_NO`)) left join `s_crec` on(`s_sttr`.`ST_REFNO` = `s_crec`.`CA_REFNO`));

-- ----------------------------
-- View structure for `view_salma_sttr1`
-- ----------------------------
DROP VIEW IF EXISTS `view_salma_sttr1`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_salma_sttr1` AS select `s_salma`.`id` AS `id`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`C_ADD1` AS `C_ADD1`,`s_salma`.`TYPE` AS `TYPE`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`DISCOU` AS `DISCOU`,`s_salma`.`AMOUNT` AS `AMOUNT`,`s_salma`.`GST` AS `GST`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_salma`.`DIS` AS `DIS`,`s_salma`.`DIS1` AS `DIS1`,`s_salma`.`DIS2` AS `DIS2`,`s_salma`.`DIS_RUP` AS `DIS_RUP`,`s_salma`.`CASH` AS `CASH`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`ORD_NO` AS `ORD_NO`,`s_salma`.`ORD_DA` AS `ORD_DA`,`s_salma`.`SETTLED` AS `SETTLED`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`s_salma`.`DES_CAT` AS `DES_CAT`,`s_salma`.`DEPARTMENT` AS `DEPARTMENT`,`s_salma`.`REMARK` AS `REMARK`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`BTT` AS `BTT`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`VAT_VAL` AS `VAT_VAL`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`DEV` AS `DEV`,`s_salma`.`Account` AS `Account`,`s_salma`.`Accname` AS `Accname`,`s_salma`.`Costcenter` AS `Costcenter`,`s_salma`.`RET_AMO` AS `RET_AMO`,`s_salma`.`cre_pe` AS `cre_pe`,`s_salma`.`Comm` AS `Comm`,`s_salma`.`red` AS `red`,`s_salma`.`deli_date` AS `deli_date`,`s_salma`.`seri_no` AS `seri_no`,`s_salma`.`points` AS `points`,`s_salma`.`LOCK1` AS `LOCK1`,`s_salma`.`deliin` AS `deliin`,`s_salma`.`SVAT` AS `SVAT`,`s_salma`.`REQ_DATE` AS `REQ_DATE`,`s_salma`.`tmp_no` AS `tmp_no`,`s_salma`.`vat_no` AS `vat_no`,`s_salma`.`s_vat_no` AS `s_vat_no`,`s_salma`.`veheno` AS `veheno`,`s_salma`.`driver` AS `driver`,`s_salma`.`loaddate` AS `loaddate`,`s_salma`.`pirnt_serial` AS `pirnt_serial`,`s_salma`.`userid` AS `userid`,`s_salma`.`transp` AS `transp`,`s_salma`.`c_code1` AS `c_code1`,`s_salma`.`deli_name` AS `deli_name`,`s_salma`.`deli_add` AS `deli_add`,`s_salma`.`maindepartment` AS `maindepartment`,`s_salma`.`sdate1` AS `sdate1`,`s_salma`.`prob` AS `prob`,`s_salma`.`transamou` AS `transamou`,`s_salma`.`trans_thtamou` AS `trans_thtamou`,`s_salma`.`trans_type` AS `trans_type`,`s_salma`.`trans_remark` AS `trans_remark`,`s_salma`.`trans_no` AS `trans_no`,`s_salma`.`trans_cancell` AS `trans_cancell`,`s_salma`.`transdate` AS `transdate`,`s_salma`.`note` AS `note`,`s_salma`.`company` AS `company`,`s_salma`.`jobno` AS `jobno`,`s_salma`.`millage` AS `millage`,`s_salma`.`type1` AS `type1`,`s_salma`.`TEL` AS `TEL`,`s_salma`.`labour` AS `labour`,`s_salma`.`type2` AS `type2`,`s_sttr`.`ST_REFNO` AS `ST_REFNO`,`s_sttr`.`ST_DATE` AS `ST_DATE`,`s_sttr`.`ST_PAID` AS `ST_PAID`,`s_sttr`.`ST_FLAG` AS `ST_FLAG`,`s_sttr`.`st_chedate` AS `st_chedate`,`s_sttr`.`st_chdate` AS `st_chdate` from (`s_salma` join `s_sttr` on(`s_salma`.`REF_NO` = `s_sttr`.`ST_INVONO`));

-- ----------------------------
-- View structure for `view_salma_sttr2`
-- ----------------------------
DROP VIEW IF EXISTS `view_salma_sttr2`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_salma_sttr2` AS select `s_salma`.`id` AS `id`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`C_ADD1` AS `C_ADD1`,`s_salma`.`TYPE` AS `TYPE`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`DISCOU` AS `DISCOU`,`s_salma`.`AMOUNT` AS `AMOUNT`,`s_salma`.`GST` AS `GST`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_salma`.`DIS` AS `DIS`,`s_salma`.`DIS1` AS `DIS1`,`s_salma`.`DIS2` AS `DIS2`,`s_salma`.`DIS_RUP` AS `DIS_RUP`,`s_salma`.`CASH` AS `CASH`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`ORD_NO` AS `ORD_NO`,`s_salma`.`ORD_DA` AS `ORD_DA`,`s_salma`.`SETTLED` AS `SETTLED`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`s_salma`.`DES_CAT` AS `DES_CAT`,`s_salma`.`DEPARTMENT` AS `DEPARTMENT`,`s_salma`.`REMARK` AS `REMARK`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`BTT` AS `BTT`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`VAT_VAL` AS `VAT_VAL`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`DEV` AS `DEV`,`s_salma`.`Account` AS `Account`,`s_salma`.`Accname` AS `Accname`,`s_salma`.`Costcenter` AS `Costcenter`,`s_salma`.`RET_AMO` AS `RET_AMO`,`s_salma`.`cre_pe` AS `cre_pe`,`s_salma`.`Comm` AS `Comm`,`s_salma`.`red` AS `red`,`s_salma`.`deli_date` AS `deli_date`,`s_salma`.`seri_no` AS `seri_no`,`s_salma`.`points` AS `points`,`s_salma`.`LOCK1` AS `LOCK1`,`s_salma`.`deliin` AS `deliin`,`s_salma`.`SVAT` AS `SVAT`,`s_salma`.`REQ_DATE` AS `REQ_DATE`,`s_salma`.`tmp_no` AS `tmp_no`,`s_salma`.`vat_no` AS `vat_no`,`s_salma`.`s_vat_no` AS `s_vat_no`,`s_salma`.`veheno` AS `veheno`,`s_salma`.`driver` AS `driver`,`s_salma`.`loaddate` AS `loaddate`,`s_salma`.`pirnt_serial` AS `pirnt_serial`,`s_salma`.`userid` AS `userid`,`s_salma`.`transp` AS `transp`,`s_salma`.`c_code1` AS `c_code1`,`s_salma`.`deli_name` AS `deli_name`,`s_salma`.`deli_add` AS `deli_add`,`s_salma`.`maindepartment` AS `maindepartment`,`s_salma`.`sdate1` AS `sdate1`,`s_salma`.`prob` AS `prob`,`s_salma`.`transamou` AS `transamou`,`s_salma`.`trans_thtamou` AS `trans_thtamou`,`s_salma`.`trans_type` AS `trans_type`,`s_salma`.`trans_remark` AS `trans_remark`,`s_salma`.`trans_no` AS `trans_no`,`s_salma`.`trans_cancell` AS `trans_cancell`,`s_salma`.`transdate` AS `transdate`,`s_salma`.`note` AS `note`,`s_salma`.`company` AS `company`,`s_salma`.`jobno` AS `jobno`,`s_salma`.`millage` AS `millage`,`s_salma`.`type1` AS `type1`,`s_salma`.`TEL` AS `TEL`,`s_salma`.`labour` AS `labour`,`s_salma`.`type2` AS `type2`,`s_sttr`.`ST_REFNO` AS `ST_REFNO`,`s_sttr`.`ST_DATE` AS `ST_DATE`,`s_sttr`.`ST_PAID` AS `ST_PAID`,`s_sttr`.`ST_FLAG` AS `ST_FLAG`,`s_sttr`.`st_chedate` AS `st_chedate`,`s_sttr`.`st_chdate` AS `st_chdate`,`s_sttr`.`st_days` AS `st_days`,`s_sttr`.`ST_CHNO` AS `ST_CHNO` from (`s_salma` join `s_sttr` on(`s_salma`.`REF_NO` = `s_sttr`.`ST_INVONO`));

-- ----------------------------
-- View structure for `view_salma_sttr_brand`
-- ----------------------------
DROP VIEW IF EXISTS `view_salma_sttr_brand`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_salma_sttr_brand` AS select `s_sttr`.`ID` AS `ID`,`s_sttr`.`ST_REFNO` AS `ST_REFNO`,`s_sttr`.`ST_DATE` AS `ST_DATE`,`s_sttr`.`ST_INVONO` AS `ST_INVONO`,`s_sttr`.`ST_PAID` AS `ST_PAID`,`s_sttr`.`ST_FLAG` AS `ST_FLAG`,`s_sttr`.`ST_INDATE` AS `ST_INDATE`,`s_sttr`.`st_chbank` AS `st_chbank`,`s_sttr`.`st_days` AS `st_days`,`s_sttr`.`ST_CHNO` AS `ST_CHNO`,`s_sttr`.`DUE` AS `DUE`,`s_sttr`.`SETTLED_NO` AS `SETTLED_NO`,`s_sttr`.`DEV` AS `DEV`,`s_sttr`.`ret_chval` AS `ret_chval`,`s_sttr`.`ret_chset` AS `ret_chset`,`s_sttr`.`st_chedate` AS `st_chedate`,`s_sttr`.`st_chdate` AS `st_chdate`,`s_sttr`.`cus_code` AS `cus_code`,`s_sttr`.`ap_days` AS `ap_days`,`s_sttr`.`comm` AS `comm`,`s_sttr`.`ap_rem` AS `ap_rem`,`s_sttr`.`del_days` AS `del_days`,`s_sttr`.`deliin_days` AS `deliin_days`,`s_sttr`.`deliin_amo` AS `deliin_amo`,`s_sttr`.`deliin_lock` AS `deliin_lock`,`s_sttr`.`department` AS `department`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_crec`.`pay_type` AS `pay_type`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`id` AS `salma_id`,`s_salma`.`deli_date` AS `deli_date`,`s_salma`.`cre_pe` AS `cre_pe`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`brand_mas`.`delinrate` AS `delinrate`,`s_salma`.`GST` AS `GST`,`brand_mas`.`d60to75` AS `d60to75`,`brand_mas`.`b60` AS `b60`,`brand_mas`.`class` AS `class` from (((`brand_mas` join `s_salma` on(`brand_mas`.`barnd_name` = `s_salma`.`Brand`)) left join `s_sttr` on(`s_salma`.`REF_NO` = `s_sttr`.`ST_INVONO`)) left join `s_crec` on(`s_sttr`.`ST_REFNO` = `s_crec`.`CA_REFNO`));

-- ----------------------------
-- View structure for `view_salma_sttr_brand_incentive`
-- ----------------------------
DROP VIEW IF EXISTS `view_salma_sttr_brand_incentive`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_salma_sttr_brand_incentive` AS select `s_sttr`.`ST_REFNO` AS `ST_REFNO`,`s_sttr`.`ST_DATE` AS `ST_DATE`,`s_sttr`.`ST_INVONO` AS `ST_INVONO`,`s_sttr`.`ST_PAID` AS `ST_PAID`,`s_sttr`.`ST_FLAG` AS `ST_FLAG`,`s_sttr`.`ST_INDATE` AS `ST_INDATE`,`s_sttr`.`st_chbank` AS `st_chbank`,`s_sttr`.`st_days` AS `st_days`,`s_sttr`.`ST_CHNO` AS `ST_CHNO`,`s_sttr`.`DUE` AS `DUE`,`s_sttr`.`SETTLED_NO` AS `SETTLED_NO`,`s_sttr`.`DEV` AS `DEV`,`s_sttr`.`ret_chval` AS `ret_chval`,`s_sttr`.`ret_chset` AS `ret_chset`,`s_sttr`.`st_chedate` AS `st_chedate`,`s_sttr`.`st_chdate` AS `st_chdate`,`s_sttr`.`cus_code` AS `cus_code`,`s_sttr`.`ap_days` AS `ap_days`,`s_sttr`.`comm` AS `comm`,`s_sttr`.`ap_rem` AS `ap_rem`,`s_sttr`.`del_days` AS `del_days`,`s_sttr`.`deliin_days` AS `deliin_days`,`s_sttr`.`deliin_amo` AS `deliin_amo`,`s_sttr`.`deliin_lock` AS `deliin_lock`,`s_sttr`.`department` AS `department`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_crec`.`pay_type` AS `pay_type`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`id` AS `salma_id`,`s_salma`.`deli_date` AS `deli_date`,`s_salma`.`cre_pe` AS `cre_pe`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`brand_mas`.`delinrate` AS `delinrate`,`s_salma`.`GST` AS `GST`,`brand_mas`.`d60to75` AS `d60to75`,`brand_mas`.`b60` AS `b60`,`brand_mas`.`class` AS `class`,`insentive_scheme`.`sfrom` AS `sfrom`,`insentive_scheme`.`sto` AS `sto`,`insentive_scheme`.`inc_type` AS `inc_type`,`s_salma`.`sdate1` AS `sdate1` from ((((`brand_mas` join `s_salma` on(`brand_mas`.`barnd_name` = `s_salma`.`Brand`)) left join `s_sttr` on(`s_salma`.`REF_NO` = `s_sttr`.`ST_INVONO`)) left join `s_crec` on(`s_sttr`.`ST_REFNO` = `s_crec`.`CA_REFNO`)) join `insentive_scheme` on(`brand_mas`.`barnd_name` = `insentive_scheme`.`brand`));

-- ----------------------------
-- View structure for `view_salma_sttr_vendor`
-- ----------------------------
DROP VIEW IF EXISTS `view_salma_sttr_vendor`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_salma_sttr_vendor` AS select `s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_sttr`.`userid` AS `userid`,`s_salma`.`cre_pe` AS `cre_pe`,`s_salma`.`deli_date` AS `deli_date`,`s_salma`.`type1` AS `type1`,`s_sttr`.`ID` AS `ID`,`s_sttr`.`ST_REFNO` AS `ST_REFNO`,`s_sttr`.`ST_DATE` AS `ST_DATE`,`s_sttr`.`ST_INVONO` AS `ST_INVONO`,`s_sttr`.`ST_PAID` AS `ST_PAID`,`s_sttr`.`ST_FLAG` AS `ST_FLAG`,`s_sttr`.`ST_INDATE` AS `ST_INDATE`,`s_sttr`.`st_chbank` AS `st_chbank`,`s_sttr`.`st_days` AS `st_days`,`s_sttr`.`ST_CHNO` AS `ST_CHNO`,`s_sttr`.`DUE` AS `DUE`,`s_sttr`.`SETTLED_NO` AS `SETTLED_NO`,`s_sttr`.`ret_chval` AS `ret_chval`,`s_sttr`.`ret_chset` AS `ret_chset`,`s_sttr`.`st_chedate` AS `st_chedate`,`s_sttr`.`st_chdate` AS `st_chdate`,`s_sttr`.`cus_code` AS `cus_code`,`s_sttr`.`ap_days` AS `ap_days`,`s_sttr`.`comm` AS `comm`,`s_sttr`.`ap_rem` AS `ap_rem`,`s_sttr`.`del_days` AS `del_days`,`s_sttr`.`deliin_days` AS `deliin_days`,`s_sttr`.`deliin_amo` AS `deliin_amo`,`s_sttr`.`deliin_lock` AS `deliin_lock`,`s_sttr`.`department` AS `department`,`s_sttr`.`tmp_no` AS `tmp_no`,`s_salma`.`DEV` AS `DEV`,`vendor`.`NAME` AS `NAME`,`s_salma`.`TEL` AS `TEL`,`s_salma`.`millage` AS `millage`,`s_salma`.`jobno` AS `jobno`,`s_salma`.`company` AS `company`,`s_salma`.`c_code1` AS `c_code1`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE` from ((`s_salma` left join `s_sttr` on(`s_salma`.`REF_NO` = `s_sttr`.`ST_INVONO`)) join `vendor` on(`s_salma`.`C_CODE` = `vendor`.`CODE`));

-- ----------------------------
-- View structure for `view_salma_s_sttr`
-- ----------------------------
DROP VIEW IF EXISTS `view_salma_s_sttr`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_salma_s_sttr` AS select `s_sttr`.`ID` AS `ID`,`s_sttr`.`ST_REFNO` AS `ST_REFNO`,`s_sttr`.`ST_DATE` AS `ST_DATE`,`s_sttr`.`ST_INVONO` AS `ST_INVONO`,`s_sttr`.`ST_PAID` AS `ST_PAID`,`s_sttr`.`ST_FLAG` AS `ST_FLAG`,`s_sttr`.`ST_INDATE` AS `ST_INDATE`,`s_sttr`.`st_chbank` AS `st_chbank`,`s_sttr`.`st_days` AS `st_days`,`s_sttr`.`ST_CHNO` AS `ST_CHNO`,`s_sttr`.`DUE` AS `DUE`,`s_sttr`.`SETTLED_NO` AS `SETTLED_NO`,`s_sttr`.`ret_chval` AS `ret_chval`,`s_sttr`.`ret_chset` AS `ret_chset`,`s_sttr`.`st_chedate` AS `st_chedate`,`s_sttr`.`st_chdate` AS `st_chdate`,`s_sttr`.`cus_code` AS `cus_code`,`s_sttr`.`ap_days` AS `ap_days`,`s_sttr`.`comm` AS `comm`,`s_sttr`.`ap_rem` AS `ap_rem`,`s_sttr`.`del_days` AS `del_days`,`s_sttr`.`deliin_days` AS `deliin_days`,`s_sttr`.`deliin_amo` AS `deliin_amo`,`s_sttr`.`deliin_lock` AS `deliin_lock`,`s_sttr`.`department` AS `department`,`s_sttr`.`tmp_no` AS `tmp_no`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`DEV` AS `DEV`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`GST` AS `GST`,`s_salma`.`DEPARTMENT` AS `SALMA_DEP`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_sttr`.`PAY_TYPE` AS `PAY_TYPE` from (`s_salma` join `s_sttr` on(`s_salma`.`REF_NO` = `s_sttr`.`ST_INVONO`));

-- ----------------------------
-- View structure for `view_salma_vendor`
-- ----------------------------
DROP VIEW IF EXISTS `view_salma_vendor`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_salma_vendor` AS select `s_salma`.`id` AS `id`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`C_ADD1` AS `C_ADD1`,`s_salma`.`TYPE` AS `TYPE`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`DISCOU` AS `DISCOU`,`s_salma`.`AMOUNT` AS `AMOUNT`,`s_salma`.`GST` AS `GST`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_salma`.`DIS` AS `DIS`,`s_salma`.`DIS1` AS `DIS1`,`s_salma`.`DIS2` AS `DIS2`,`s_salma`.`DIS_RUP` AS `DIS_RUP`,`s_salma`.`CASH` AS `CASH`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`ORD_NO` AS `ORD_NO`,`s_salma`.`ORD_DA` AS `ORD_DA`,`s_salma`.`SETTLED` AS `SETTLED`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`s_salma`.`DES_CAT` AS `DES_CAT`,`s_salma`.`DEPARTMENT` AS `DEPARTMENT`,`s_salma`.`REMARK` AS `REMARK`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`BTT` AS `BTT`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`VAT_VAL` AS `VAT_VAL`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`DEV` AS `DEV`,`s_salma`.`Account` AS `Account`,`s_salma`.`Accname` AS `Accname`,`s_salma`.`Costcenter` AS `Costcenter`,`s_salma`.`RET_AMO` AS `RET_AMO`,`s_salma`.`cre_pe` AS `cre_pe`,`s_salma`.`Comm` AS `Comm`,`s_salma`.`red` AS `red`,`s_salma`.`deli_date` AS `deli_date`,`s_salma`.`seri_no` AS `seri_no`,`s_salma`.`points` AS `points`,`s_salma`.`LOCK1` AS `LOCK1`,`s_salma`.`deliin` AS `deliin`,`s_salma`.`SVAT` AS `SVAT`,`s_salma`.`REQ_DATE` AS `REQ_DATE`,`s_salma`.`tmp_no` AS `tmp_no`,`vendor`.`NAME` AS `NAME`,`vendor`.`ADD1` AS `ADD1`,`vendor`.`ADD2` AS `ADD2`,`vendor`.`CAT` AS `CAT`,`vendor`.`cus_type` AS `cus_type`,`vendor`.`PEN0` AS `PEN0`,`vendor`.`o90` AS `o90`,`s_salma`.`c_code1` AS `c_code1`,`vendor`.`cLIMIT` AS `cLIMIT`,`vendor`.`incdays` AS `incdays`,`vendor`.`commoncode` AS `commoncode`,`s_salma`.`maindepartment` AS `maindepartment`,`s_salma`.`sdate1` AS `sdate1`,`s_salma`.`veheno` AS `veheno`,`s_salma`.`driver` AS `driver`,`s_salma`.`loaddate` AS `loaddate`,`vendor`.`province` AS `province`,`vendor`.`district` AS `district`,`s_salma`.`type1` AS `type1`,`s_salma`.`company` AS `company`,`s_salma`.`TEL` AS `TEL` from (`s_salma` join `vendor` on(`s_salma`.`C_CODE` = `vendor`.`CODE`));

-- ----------------------------
-- View structure for `view_salma_vendor_brand`
-- ----------------------------
DROP VIEW IF EXISTS `view_salma_vendor_brand`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_salma_vendor_brand` AS select `s_salma`.`id` AS `id`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`C_ADD1` AS `C_ADD1`,`s_salma`.`TYPE` AS `TYPE`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`DISCOU` AS `DISCOU`,`s_salma`.`AMOUNT` AS `AMOUNT`,`s_salma`.`GST` AS `GST`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_salma`.`DIS` AS `DIS`,`s_salma`.`DIS1` AS `DIS1`,`s_salma`.`DIS_RUP` AS `DIS_RUP`,`s_salma`.`CASH` AS `CASH`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`ORD_NO` AS `ORD_NO`,`s_salma`.`ORD_DA` AS `ORD_DA`,`s_salma`.`SETTLED` AS `SETTLED`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`s_salma`.`DES_CAT` AS `DES_CAT`,`s_salma`.`DEPARTMENT` AS `DEPARTMENT`,`s_salma`.`REMARK` AS `REMARK`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`BTT` AS `BTT`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`DEV` AS `DEV`,`s_salma`.`Account` AS `Account`,`s_salma`.`Accname` AS `Accname`,`s_salma`.`Costcenter` AS `Costcenter`,`s_salma`.`RET_AMO` AS `RET_AMO`,`s_salma`.`Comm` AS `Comm`,`s_salma`.`red` AS `Red`,`s_salma`.`deli_date` AS `Deli_date`,`s_salma`.`seri_no` AS `seri_no`,`s_salma`.`LOCK1` AS `LOCK1`,`s_salma`.`deliin` AS `deliin`,`s_salma`.`SVAT` AS `SVAT`,`vendor`.`PEN0` AS `Expr1`,`vendor`.`o90` AS `o90`,`vendor`.`NAME` AS `NAME`,`vendor`.`incdays` AS `incdays`,`brand_mas`.`delinrate` AS `delinrate`,`vendor`.`CAT` AS `CAT` from ((`s_salma` left join `brand_mas` on(`s_salma`.`Brand` = `brand_mas`.`barnd_name`)) left join `vendor` on(`s_salma`.`C_CODE` = `vendor`.`CODE`));

-- ----------------------------
-- View structure for `view_sal_exnot`
-- ----------------------------
DROP VIEW IF EXISTS `view_sal_exnot`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_sal_exnot` AS select `c_bal`.`ID` AS `ID`,`c_bal`.`REFNO` AS `REFNO`,`c_bal`.`SDATE` AS `SDATE`,`c_bal`.`SAL_EX` AS `SAL_EX`,`c_bal`.`AMOUNT` AS `AMOUNT`,`c_bal`.`CUSCODE` AS `CUSCODE`,`c_bal`.`brand` AS `brand`,`s_salma`.`SAL_EX` AS `salma_ex`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`Brand` AS `salma_brand`,`s_salma`.`SDATE` AS `salma_sdate` from (`s_salma` join `c_bal` on(`s_salma`.`C_CODE` = `c_bal`.`CUSCODE` and `c_bal`.`brand` = `s_salma`.`Brand`));

-- ----------------------------
-- View structure for `view_sal_invo_smas_2`
-- ----------------------------
DROP VIEW IF EXISTS `view_sal_invo_smas_2`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_sal_invo_smas_2` AS select `s_salma`.`id` AS `id`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`C_ADD1` AS `C_ADD1`,`s_salma`.`TYPE` AS `TYPE`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`DISCOU` AS `DISCOU`,`s_salma`.`AMOUNT` AS `AMOUNT`,`s_salma`.`GST` AS `GST`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_salma`.`DIS` AS `DIS`,`s_salma`.`DIS1` AS `DIS1`,`s_salma`.`DIS_RUP` AS `DIS_RUP`,`s_salma`.`CASH` AS `CASH`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`ORD_NO` AS `ORD_NO`,`s_salma`.`ORD_DA` AS `ORD_DA`,`s_salma`.`SETTLED` AS `SETTLED`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`s_salma`.`DES_CAT` AS `DES_CAT`,`s_salma`.`DEPARTMENT` AS `DEPARTMENT`,`s_salma`.`REMARK` AS `REMARK`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`BTT` AS `BTT`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`DEV` AS `DEV`,`s_salma`.`Account` AS `Account`,`s_salma`.`Accname` AS `Accname`,`s_salma`.`Costcenter` AS `Costcenter`,`s_salma`.`RET_AMO` AS `RET_AMO`,`s_salma`.`Comm` AS `Comm`,`s_salma`.`red` AS `Red`,`s_salma`.`deli_date` AS `Deli_date`,`s_salma`.`seri_no` AS `seri_no`,`s_salma`.`LOCK1` AS `LOCK1`,`s_salma`.`deliin` AS `deliin`,`s_salma`.`SVAT` AS `SVAT`,`s_mas`.`type` AS `ittype`,`s_invo`.`STK_NO` AS `STK_NO`,`s_invo`.`DESCRIPT` AS `DESCRIPT`,`s_salma`.`cre_pe` AS `cre_pe`,`s_invo`.`QTY` AS `QTY`,`s_invo`.`PRICE` AS `PRICE`,`s_mas`.`SELLING` AS `SELLING`,`s_salma`.`sdate1` AS `sdate1`,`s_mas`.`model` AS `model`,`s_invo`.`DIS_per` AS `DIS_per` from (`s_salma` left join (`s_invo` left join `s_mas` on(`s_mas`.`STK_NO` = `s_invo`.`STK_NO`)) on(`s_invo`.`REF_NO` = `s_salma`.`REF_NO`));

-- ----------------------------
-- View structure for `view_scheq_chsttr_vendor`
-- ----------------------------
DROP VIEW IF EXISTS `view_scheq_chsttr_vendor`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_scheq_chsttr_vendor` AS select `s_cheq`.`CR_REFNO` AS `CR_REFNO`,`s_cheq`.`CR_DATE` AS `CR_DATE`,`s_cheq`.`CR_REGEREF` AS `CR_REGEREF`,`s_cheq`.`CR_CRNO` AS `CR_CRNO`,`s_cheq`.`CR_CRVAL` AS `CR_CRVAL`,`s_cheq`.`CR_CRDATE` AS `CR_CRDATE`,`s_cheq`.`CR_C_CODE` AS `CR_C_CODE`,`s_cheq`.`CR_C_NAME` AS `CR_C_NAME`,`s_cheq`.`CR_C_ADD` AS `CR_C_ADD`,`s_cheq`.`CR_CHNO` AS `CR_CHNO`,`s_cheq`.`CR_CHEVAL` AS `CR_CHEVAL`,`s_cheq`.`CR_REPAY` AS `CR_REPAY`,`s_cheq`.`CR_CHDATE` AS `CR_CHDATE`,`s_cheq`.`CR_BANK` AS `CR_BANK`,`s_cheq`.`CR_RESON` AS `CR_RESON`,`s_cheq`.`CR_RESON1` AS `CR_RESON1`,`s_cheq`.`CR_REPOSIT` AS `CR_REPOSIT`,`s_cheq`.`REDEPOSITDATE` AS `REDEPOSITDATE`,`s_cheq`.`REDEPOSITREF` AS `REDEPOSITREF`,`s_cheq`.`CR_FLAG` AS `CR_FLAG`,`s_cheq`.`PAID` AS `PAID`,`s_cheq`.`S_REF` AS `S_REF`,`s_cheq`.`DEPARTMENT` AS `DEPARTMENT`,`s_cheq`.`REMARK` AS `REMARK`,`s_cheq`.`DEBACC` AS `DEBACC`,`s_cheq`.`CREACC` AS `CREACC`,`s_cheq`.`dev` AS `dev`,`s_cheq`.`ret_chno` AS `ret_chno`,`s_cheq`.`ret_chdate` AS `ret_chdate`,`s_cheq`.`noof` AS `noof`,`s_cheq`.`ret_refno` AS `ret_refno`,`s_cheq`.`rep_remark` AS `rep_remark`,`s_cheq`.`depobank` AS `depobank`,`s_cheq`.`id` AS `id`,`s_cheq`.`tmp` AS `tmp`,`s_cheq`.`FORwhat` AS `FORwhat`,`s_cheq`.`FORwhatDATE` AS `FORwhatDATE`,`s_cheq`.`crenoteno` AS `crenoteno`,`s_cheq`.`crenoteamo` AS `crenoteamo`,`s_cheq`.`debnoteno` AS `debnoteno`,`s_cheq`.`tmp_no` AS `tmp_no`,`s_cheq`.`Costcenter` AS `Costcenter`,`s_cheq`.`reason` AS `reason`,`s_cheq`.`retcout` AS `retcout`,`s_cheq`.`pdno` AS `pdno`,`s_cheq`.`clicked` AS `clicked`,`s_cheq`.`ch_count_ret` AS `ch_count_ret`,`s_cheq`.`company` AS `company`,`ch_sttr`.`ST_DATE` AS `ST_DATE`,`ch_sttr`.`ST_REFNO` AS `ST_REFNO`,`ch_sttr`.`ST_PAID` AS `ST_PAID`,`ch_sttr`.`ST_FLAG` AS `ST_FLAG`,`ch_sttr`.`ST_INDATE` AS `ST_INDATE`,`ch_sttr`.`ST_CHBANK` AS `ST_CHBANK`,`ch_sttr`.`ST_DAYS` AS `ST_DAYS`,`ch_sttr`.`ST_CHNO` AS `ST_CHNO`,`vendor`.`NAME` AS `NAME` from ((`s_cheq` left join `ch_sttr` on(`s_cheq`.`CR_REFNO` = `ch_sttr`.`ST_INVONO`)) join `vendor` on(`s_cheq`.`CR_C_CODE` = `vendor`.`CODE`));

-- ----------------------------
-- View structure for `view_serial`
-- ----------------------------
DROP VIEW IF EXISTS `view_serial`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_serial` AS select `inv_serino`.`serino` AS `serino`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`C_ADD1` AS `C_ADD1`,`inv_serino`.`id` AS `id`,`inv_serino`.`stk_no` AS `stk_no` from (`inv_serino` join `s_salma` on(`inv_serino`.`refno` = `s_salma`.`REF_NO`));

-- ----------------------------
-- View structure for `view_sh_de`
-- ----------------------------
DROP VIEW IF EXISTS `view_sh_de`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_sh_de` AS select `s_purmas`.`SDATE` AS `SDATE`,`s_purmas`.`REFNO` AS `REFNO`,`s_purmas`.`LCNO` AS `LCNO`,`s_purmas`.`brand` AS `brand`,`s_purmas`.`TYPE` AS `TYPE`,`s_purtrn`.`STK_NO` AS `STK_NO`,`s_purtrn`.`DESCRIPT` AS `DESCRIPT`,`s_purtrn`.`REC_QTY` AS `REC_QTY`,`s_mas`.`type` AS `TType`,`s_mas`.`Cat1` AS `cat1`,`s_purmas`.`CANCEL` AS `CANCEL` from (`s_purmas` left join (`s_purtrn` left join `s_mas` on(`s_purtrn`.`STK_NO` = `s_mas`.`STK_NO`)) on(`s_purtrn`.`REFNO` = `s_purmas`.`REFNO`));

-- ----------------------------
-- View structure for `view_sinvcheq_sttr_salma`
-- ----------------------------
DROP VIEW IF EXISTS `view_sinvcheq_sttr_salma`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_sinvcheq_sttr_salma` AS select `s_invcheq`.`cheque_no` AS `cheque_no`,`s_invcheq`.`che_date` AS `che_date`,`s_invcheq`.`che_amount` AS `che_amount`,`s_invcheq`.`sal_ex` AS `sal_ex`,`s_sttr`.`ST_PAID` AS `ST_PAID`,`s_salma`.`Brand` AS `Brand`,`brand_mas`.`class` AS `class`,`s_salma`.`C_CODE` AS `C_CODE`,`s_invcheq`.`CUS_NAME` AS `CUS_NAME`,`s_invcheq`.`ex_date1` AS `ex_date1`,`s_invcheq`.`ex_date2` AS `ex_date2`,`s_invcheq`.`cus_code` AS `cus_code`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`deli_date` AS `deli_date` from (((`s_invcheq` left join `s_sttr` on(`s_invcheq`.`cheque_no` = `s_sttr`.`ST_CHNO`)) left join `s_salma` on(`s_sttr`.`ST_INVONO` = `s_salma`.`REF_NO` and `s_salma`.`C_CODE` = `s_invcheq`.`cus_code`)) join `brand_mas` on(_utf8'' = _utf8'' and `brand_mas`.`barnd_name` = `s_salma`.`Brand`));

-- ----------------------------
-- View structure for `view_sinvcheq_sttr_salma1`
-- ----------------------------
DROP VIEW IF EXISTS `view_sinvcheq_sttr_salma1`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_sinvcheq_sttr_salma1` AS select `s_invcheq`.`cheque_no` AS `cheque_no`,`s_invcheq`.`che_date` AS `che_date`,`s_invcheq`.`che_amount` AS `che_amount`,`s_invcheq`.`sal_ex` AS `sal_ex`,`s_sttr`.`ST_PAID` AS `ST_PAID`,`s_salma`.`Brand` AS `Brand`,`brand_mas`.`class` AS `class`,`s_salma`.`C_CODE` AS `C_CODE`,`brand_mas`.`b60` AS `b60`,`s_invcheq`.`trn_type` AS `trn_type`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`SDATE` AS `SDATE`,`s_invcheq`.`ex_date1` AS `ex_date1`,`s_invcheq`.`ex_date2` AS `ex_date2`,`s_sttr`.`deliin_days` AS `deliin_days`,`s_sttr`.`deliin_amo` AS `deliin_amo`,`s_sttr`.`deliin_lock` AS `deliin_lock` from (((`s_invcheq` left join `s_sttr` on(`s_invcheq`.`cheque_no` = `s_sttr`.`ST_CHNO` and `s_sttr`.`ST_REFNO` = `s_invcheq`.`refno`)) left join `s_salma` on(`s_sttr`.`ST_INVONO` = `s_salma`.`REF_NO`)) join `brand_mas` on(_utf8'' = _utf8'' and `brand_mas`.`barnd_name` = `s_salma`.`Brand`));

-- ----------------------------
-- View structure for `view_sinvo_smas`
-- ----------------------------
DROP VIEW IF EXISTS `view_sinvo_smas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_sinvo_smas` AS select `s_invo`.`id` AS `id`,`s_invo`.`REF_NO` AS `REF_NO`,`s_invo`.`SDATE` AS `SDATE`,`s_invo`.`STK_NO` AS `STK_NO`,`s_invo`.`DESCRIPT` AS `DESCRIPT`,`s_invo`.`UNIT` AS `UNIT`,`s_invo`.`PART_NO` AS `PART_NO`,`s_invo`.`COST` AS `COST`,`s_invo`.`PRICE` AS `PRICE`,`s_invo`.`QTY` AS `QTY`,`s_invo`.`DEPARTMENT` AS `DEPARTMENT`,`s_invo`.`DIS_per` AS `DIS_per`,`s_invo`.`DIS_rs` AS `DIS_rs`,`s_invo`.`REP` AS `REP`,`s_invo`.`TAX_PER` AS `TAX_PER`,`s_invo`.`ret_qty` AS `ret_qty`,`s_invo`.`BRAND` AS `BRAND`,`s_invo`.`DEV` AS `DEV`,`s_invo`.`CANCELL` AS `CANCELL`,`s_invo`.`c_code` AS `c_code`,`s_invo`.`seri_no` AS `seri_no`,`s_invo`.`Print_dis1` AS `Print_dis1`,`s_invo`.`Print_dis2` AS `Print_dis2`,`s_invo`.`vatrate` AS `vatrate`,`s_mas`.`COST` AS `COST_smas`,`s_mas`.`acc_cost` AS `acc_cost` from (`s_invo` join `s_mas` on(`s_invo`.`STK_NO` = `s_mas`.`STK_NO`));

-- ----------------------------
-- View structure for `view_smas_submas`
-- ----------------------------
DROP VIEW IF EXISTS `view_smas_submas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_smas_submas` AS select `s_submas`.`STO_CODE` AS `STO_CODE`,`s_submas`.`STK_NO` AS `STK_NO`,`s_submas`.`DESCRIPt` AS `DESCRIPt`,`s_submas`.`OPEN_STK` AS `OPEN_STK`,`s_submas`.`OPENT_DATE` AS `OPENT_DATE`,`s_submas`.`QTYINHAND` AS `QTYINHAND`,`s_mas`.`COST` AS `COST`,`s_mas`.`acc_cost` AS `acc_cost` from (`s_mas` join `s_submas` on(`s_mas`.`STK_NO` = `s_submas`.`STK_NO`));

-- ----------------------------
-- View structure for `view_stktake`
-- ----------------------------
DROP VIEW IF EXISTS `view_stktake`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_stktake` AS select `stk_take_mas`.`location` AS `location`,`stk_take`.`STK_NO` AS `STK_NO`,`stk_take`.`QTY` AS `QTY`,`stk_take`.`damage` AS `damage`,`stk_take`.`DEPARTMENT` AS `DEPARTMENT`,`stk_take`.`DESCRIPT` AS `DESCRIPT` from (`stk_take` join `stk_take_mas` on(`stk_take`.`REF_NO` = `stk_take_mas`.`ref_no`));

-- ----------------------------
-- View structure for `view_stktake_s_mas`
-- ----------------------------
DROP VIEW IF EXISTS `view_stktake_s_mas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_stktake_s_mas` AS select `stk_take`.`id` AS `id`,`stk_take`.`REF_NO` AS `REF_NO`,`stk_take`.`SDATE` AS `SDATE`,`stk_take`.`STK_NO` AS `STK_NO`,`stk_take`.`DESCRIPT` AS `DESCRIPT`,`stk_take`.`UNIT` AS `UNIT`,`stk_take`.`PART_NO` AS `PART_NO`,`stk_take`.`COST` AS `COST`,`stk_take`.`PRICE` AS `PRICE`,`stk_take`.`QTY` AS `QTY`,`stk_take`.`DEPARTMENT` AS `DEPARTMENT`,`stk_take`.`DIS_PER` AS `DIS_PER`,`stk_take`.`DIS_RS` AS `DIS_RS`,`stk_take`.`GROUP` AS `GROUP`,`stk_take`.`REP` AS `REP`,`stk_take`.`TAX_PER` AS `TAX_PER`,`stk_take`.`ret_qty` AS `ret_qty`,`stk_take`.`BRAND` AS `BRAND`,`stk_take`.`DEV` AS `DEV`,`stk_take`.`damage` AS `damage`,`stk_take`.`tmp_no` AS `tmp_no`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME`,`s_mas`.`acc_cost` AS `acc_cost` from (`stk_take` join `s_mas` on(`stk_take`.`STK_NO` = `s_mas`.`STK_NO`));

-- ----------------------------
-- View structure for `view_strn_mas`
-- ----------------------------
DROP VIEW IF EXISTS `view_strn_mas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_strn_mas` AS select `s_mas`.`STK_NO` AS `STK_NO`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME`,`s_mas`.`PART_NO` AS `PART_NO`,`s_mas`.`QTYINHAND` AS `QTYINHAND`,`s_trn`.`SDATE` AS `SDATE`,`s_trn`.`tru_qty` AS `tru_qty`,`s_mas`.`COST` AS `COST`,`s_trn`.`COST` AS `cccc` from (`s_trn` join `s_mas` on(`s_trn`.`STK_NO` = `s_mas`.`STK_NO`));

-- ----------------------------
-- View structure for `view_strn_smas`
-- ----------------------------
DROP VIEW IF EXISTS `view_strn_smas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_strn_smas` AS select `s_trn`.`ID` AS `ID`,`s_trn`.`SDATE` AS `SDATE`,`s_trn`.`STK_NO` AS `STK_NO`,`s_trn`.`REFNO` AS `REFNO`,`s_trn`.`QTY` AS `QTY`,`s_trn`.`LEDINDI` AS `LEDINDI`,`s_trn`.`DEPARTMENT` AS `DEPARTMENT`,`s_trn`.`seri_no` AS `seri_no`,`s_trn`.`Dev` AS `Dev`,`s_trn`.`SAL_EX` AS `SAL_EX`,`s_trn`.`ACTIVE` AS `ACTIVE`,`s_trn`.`DONO` AS `DONO`,`s_trn`.`tmp_no` AS `tmp_no`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME`,`s_mas`.`DESCRIPT` AS `DESCRIPT`,`s_mas`.`GEN_NO` AS `GEN_NO`,`s_mas`.`GROUP1` AS `GROUP1`,`s_mas`.`GROUP2` AS `GROUP2`,`s_mas`.`model` AS `model` from (`s_trn` join `s_mas` on(`s_trn`.`STK_NO` = `s_mas`.`STK_NO`));

-- ----------------------------
-- View structure for `view_strn_smas_crnma`
-- ----------------------------
DROP VIEW IF EXISTS `view_strn_smas_crnma`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_strn_smas_crnma` AS select `s_trn`.`ID` AS `ID`,`s_trn`.`SDATE` AS `SDATE`,`s_trn`.`STK_NO` AS `STK_NO`,`s_trn`.`REFNO` AS `REFNO`,`s_trn`.`QTY` AS `QTY`,`s_trn`.`LEDINDI` AS `LEDINDI`,`s_trn`.`DEPARTMENT` AS `DEPARTMENT`,`s_trn`.`seri_no` AS `seri_no`,`s_trn`.`Dev` AS `Dev`,`s_trn`.`SAL_EX` AS `SAL_EX`,`s_trn`.`ACTIVE` AS `ACTIVE`,`s_trn`.`DONO` AS `SALEX`,`s_crnma`.`Brand` AS `Brand` from (`s_trn` join `s_crnma` on(`s_trn`.`REFNO` = `s_crnma`.`REF_NO`));

-- ----------------------------
-- View structure for `view_strn_smas_salma`
-- ----------------------------
DROP VIEW IF EXISTS `view_strn_smas_salma`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_strn_smas_salma` AS select `s_trn`.`ID` AS `ID`,`s_trn`.`SDATE` AS `SDATE`,`s_trn`.`STK_NO` AS `STK_NO`,`s_trn`.`REFNO` AS `REFNO`,`s_trn`.`QTY` AS `QTY`,`s_trn`.`LEDINDI` AS `LEDINDI`,`s_trn`.`DEPARTMENT` AS `DEPARTMENT`,`s_trn`.`seri_no` AS `seri_no`,`s_trn`.`Dev` AS `Dev`,`s_trn`.`SAL_EX` AS `SAL_EX`,`s_trn`.`ACTIVE` AS `ACTIVE`,`s_salma`.`SAL_EX` AS `SALEX`,`s_salma`.`Brand` AS `Brand` from (`s_trn` join `s_salma` on(`s_trn`.`REFNO` = `s_salma`.`REF_NO`));

-- ----------------------------
-- View structure for `view_sttr`
-- ----------------------------
DROP VIEW IF EXISTS `view_sttr`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_sttr` AS select `s_sttr`.`ID` AS `ID`,`s_sttr`.`ST_REFNO` AS `ST_REFNO`,`s_sttr`.`ST_DATE` AS `ST_DATE`,`s_sttr`.`ST_INVONO` AS `ST_INVONO`,`s_sttr`.`ST_PAID` AS `ST_PAID`,`s_sttr`.`ST_FLAG` AS `ST_FLAG`,`s_sttr`.`ST_INDATE` AS `ST_INDATE`,`s_sttr`.`st_chbank` AS `st_chbank`,`s_sttr`.`st_days` AS `st_days`,`s_sttr`.`ST_CHNO` AS `ST_CHNO`,`s_sttr`.`DUE` AS `DUE`,`s_sttr`.`SETTLED_NO` AS `SETTLED_NO`,`s_sttr`.`ret_chval` AS `ret_chval`,`s_sttr`.`ret_chset` AS `ret_chset`,`s_sttr`.`st_chedate` AS `st_chedate`,`s_sttr`.`st_chdate` AS `st_chdate`,`s_sttr`.`cus_code` AS `cus_code`,`s_sttr`.`ap_days` AS `ap_days`,`s_sttr`.`comm` AS `comm`,`s_sttr`.`ap_rem` AS `ap_rem`,`s_sttr`.`del_days` AS `del_days`,`s_sttr`.`deliin_days` AS `deliin_days`,`s_sttr`.`deliin_amo` AS `deliin_amo`,`s_sttr`.`deliin_lock` AS `deliin_lock`,`s_sttr`.`department` AS `department`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_crec`.`pay_type` AS `pay_type`,`s_salma`.`DEV` AS `DEV`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`id` AS `salma_id`,`s_sttr`.`ST_REFNO` AS `cbalST_REFNO`,`c_bal`.`trn_type` AS `cbaltrn_type`,`c_bal`.`flag1` AS `cbalflag1`,`s_salma`.`deli_date` AS `deli_date`,`s_crec`.`AC_REFNO` AS `AC_REFNO`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`cre_pe` AS `cre_pe`,`s_crec`.`CA_DATE` AS `CA_DATE`,`s_salma`.`sdate1` AS `sdate1` from ((((`s_salma` left join `s_sttr` on(`s_sttr`.`ST_INVONO` = `s_salma`.`REF_NO`)) left join `s_utmas` on(`s_sttr`.`ST_REFNO` = `s_utmas`.`C_REFNO`)) left join `c_bal` on(_utf8'' = _utf8'' and `s_utmas`.`C_CRNNo` = `c_bal`.`REFNO`)) left join `s_crec` on(_utf8'' = _utf8'' and `s_sttr`.`ST_REFNO` = `s_crec`.`CA_REFNO`));

-- ----------------------------
-- View structure for `view_sttr_brand_salma`
-- ----------------------------
DROP VIEW IF EXISTS `view_sttr_brand_salma`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_sttr_brand_salma` AS select `s_sttr`.`ID` AS `ID`,`s_sttr`.`ST_REFNO` AS `ST_REFNO`,`s_sttr`.`ST_DATE` AS `ST_DATE`,`s_sttr`.`ST_INVONO` AS `ST_INVONO`,`s_sttr`.`ST_PAID` AS `ST_PAID`,`s_sttr`.`ST_FLAG` AS `ST_FLAG`,`s_sttr`.`ST_INDATE` AS `ST_INDATE`,`s_sttr`.`st_chbank` AS `st_chbank`,`s_sttr`.`st_days` AS `st_days`,`s_sttr`.`ST_CHNO` AS `ST_CHNO`,`s_sttr`.`DUE` AS `DUE`,`s_sttr`.`SETTLED_NO` AS `SETTLED_NO`,`s_sttr`.`DEV` AS `DEV`,`s_sttr`.`ret_chval` AS `ret_chval`,`s_sttr`.`ret_chset` AS `ret_chset`,`s_sttr`.`st_chedate` AS `st_chedate`,`s_sttr`.`st_chdate` AS `st_chdate`,`s_sttr`.`cus_code` AS `cus_code`,`s_sttr`.`ap_days` AS `ap_days`,`s_sttr`.`comm` AS `comm`,`s_sttr`.`ap_rem` AS `ap_rem`,`s_sttr`.`del_days` AS `del_days`,`s_sttr`.`deliin_days` AS `deliin_days`,`s_sttr`.`deliin_amo` AS `deliin_amo`,`s_sttr`.`deliin_lock` AS `deliin_lock`,`s_sttr`.`department` AS `department`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`DEV` AS `s_dev`,`s_salma`.`Brand` AS `Brand`,`brand_mas`.`class` AS `class`,`s_salma`.`GST` AS `GST` from (`s_sttr` left join (`brand_mas` join `s_salma` on(`brand_mas`.`barnd_name` = `s_salma`.`Brand`)) on(`s_salma`.`REF_NO` = `s_sttr`.`ST_INVONO`));

-- ----------------------------
-- View structure for `view_sttr_salma1`
-- ----------------------------
DROP VIEW IF EXISTS `view_sttr_salma1`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_sttr_salma1` AS select `s_sttr`.`ID` AS `ID`,`s_sttr`.`ST_REFNO` AS `ST_REFNO`,`s_sttr`.`ST_DATE` AS `ST_DATE`,`s_sttr`.`ST_INVONO` AS `ST_INVONO`,`s_sttr`.`ST_PAID` AS `ST_PAID`,`s_sttr`.`ST_FLAG` AS `ST_FLAG`,`s_sttr`.`ST_INDATE` AS `ST_INDATE`,`s_sttr`.`st_chbank` AS `st_chbank`,`s_sttr`.`st_days` AS `st_days`,`s_sttr`.`ST_CHNO` AS `ST_CHNO`,`s_sttr`.`DUE` AS `DUE`,`s_sttr`.`SETTLED_NO` AS `SETTLED_NO`,`s_sttr`.`DEV` AS `DEV`,`s_sttr`.`ret_chval` AS `ret_chval`,`s_sttr`.`ret_chset` AS `ret_chset`,`s_sttr`.`st_chedate` AS `st_chedate`,`s_sttr`.`st_chdate` AS `st_chdate`,`s_sttr`.`cus_code` AS `cus_code`,`s_sttr`.`ap_days` AS `ap_days`,`s_sttr`.`comm` AS `comm`,`s_sttr`.`ap_rem` AS `ap_rem`,`s_sttr`.`del_days` AS `del_days`,`s_sttr`.`deliin_days` AS `deliin_days`,`s_sttr`.`deliin_amo` AS `deliin_amo`,`s_sttr`.`deliin_lock` AS `deliin_lock`,`s_sttr`.`department` AS `department`,`s_sttr`.`tmp_no` AS `tmp_no`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`CANCELL` AS `CANCELL`,`vendor`.`NAME` AS `NAME`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_sttr`.`userid` AS `userid`,`s_salma`.`cre_pe` AS `cre_pe`,`s_salma`.`deli_date` AS `deli_date`,`s_salma`.`type1` AS `type1`,`s_salma`.`TYPE` AS `TYPE`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE`,`s_salma`.`company` AS `company` from ((`s_sttr` join `s_salma` on(`s_sttr`.`ST_INVONO` = `s_salma`.`REF_NO`)) join `vendor` on(`s_salma`.`C_CODE` = `vendor`.`CODE`));

-- ----------------------------
-- View structure for `view_sub_mas_pur_gin_trn`
-- ----------------------------
DROP VIEW IF EXISTS `view_sub_mas_pur_gin_trn`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_sub_mas_pur_gin_trn` AS select `s_submas`.`STO_CODE` AS `STO_CODE`,`s_submas`.`STK_NO` AS `STK_NO`,`s_submas`.`QTYINHAND` AS `subqty`,`s_mas`.`DESCRIPT` AS `DESCRIPT`,`s_mas`.`PART_NO` AS `PART_NO`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME`,`s_mas`.`QTYINHAND` AS `masqty`,`s_mas`.`COST` AS `COST`,`s_mas`.`acc_cost` AS `acc_cost`,`s_purtrn`.`REC_QTY` AS `REC_QTY`,`s_purtrn`.`SDATE` AS `SDATE`,`s_purtrn`.`REFNO` AS `REFNO`,`s_ginmas`.`AR_NO` AS `AR_NO`,`s_ginmas`.`DEP_TO` AS `DEP_TO`,`s_trn`.`QTY` AS `trnqty` from ((((`s_submas` join `s_mas` on(`s_submas`.`STK_NO` = `s_mas`.`STK_NO`)) join `s_purtrn` on(`s_mas`.`STK_NO` = `s_purtrn`.`STK_NO`)) join `s_ginmas` on(`s_purtrn`.`REFNO` = `s_ginmas`.`AR_NO`)) join `s_trn` on(`s_ginmas`.`REF_NO` = `s_trn`.`REFNO`));

-- ----------------------------
-- View structure for `view_s_cheq_copy`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_cheq_copy`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_cheq_copy` AS select `s_cheq`.`CR_REFNO` AS `CR_REFNO`,`s_cheq`.`CR_DATE` AS `CR_DATE`,`ret_chq_history`.`Inv_no` AS `invoice_no`,`ret_chq_history`.`Inv_date` AS `invoice_date`,`ret_chq_history`.`st_amt` AS `invoice_amt`,`s_cheq`.`CR_C_CODE` AS `CR_C_CODE`,`s_cheq`.`CR_C_NAME` AS `CR_C_NAME`,`s_cheq`.`CR_CHEVAL` AS `CR_CHEVAL`,`s_cheq`.`CR_CHNO` AS `CR_CHNO`,`s_cheq`.`CR_FLAG` AS `CR_FLAG`,`s_cheq`.`PAID` AS `PAID`,`s_cheq`.`S_REF` AS `S_REF`,`s_cheq`.`dev` AS `dev`,`s_cheq`.`noof` AS `noof`,`s_cheq`.`rep_remark` AS `rep_remark`,`s_cheq`.`FORwhat` AS `FORwhat`,`ch_sttr`.`ST_CHNO` AS `ST_CHNO`,`ch_sttr`.`ST_PAID` AS `ST_PAID`,`ch_sttr`.`ST_FLAG` AS `ST_FLAG`,`ch_sttr`.`ST_INDATE` AS `ST_INDATE`,`ch_sttr`.`ST_DATE` AS `ST_DATE`,`vendor`.`CODE` AS `CODE`,`vendor`.`NAME` AS `NAME`,`vendor`.`ADD2` AS `ADD2`,`s_cheq`.`CR_CHDATE` AS `CR_CHDATE`,`ch_sttr`.`ST_REFNO` AS `ST_REFNO` from (((`s_cheq` left join `ret_chq_history` on(`ret_chq_history`.`Ref_no` = `s_cheq`.`CR_REFNO`)) left join `ch_sttr` on(`s_cheq`.`CR_REFNO` = `ch_sttr`.`ST_INVONO`)) join `vendor` on(`vendor`.`CODE` = `s_cheq`.`CR_C_CODE`)) order by `s_cheq`.`CR_REFNO` desc;

-- ----------------------------
-- View structure for `view_s_cheq_s_salrep`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_cheq_s_salrep`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_cheq_s_salrep` AS select `s_cheq`.`CR_REFNO` AS `CR_REFNO`,`s_cheq`.`CR_DATE` AS `CR_DATE`,`s_cheq`.`CR_REGEREF` AS `CR_REGEREF`,`s_cheq`.`CR_CRNO` AS `CR_CRNO`,`s_cheq`.`CR_CRVAL` AS `CR_CRVAL`,`s_cheq`.`CR_CRDATE` AS `CR_CRDATE`,`s_cheq`.`CR_C_CODE` AS `CR_C_CODE`,`s_cheq`.`CR_C_NAME` AS `CR_C_NAME`,`s_cheq`.`CR_C_ADD` AS `CR_C_ADD`,`s_cheq`.`CR_CHNO` AS `CR_CHNO`,`s_cheq`.`CR_CHEVAL` AS `CR_CHEVAL`,`s_cheq`.`CR_REPAY` AS `CR_REPAY`,`s_cheq`.`CR_CHDATE` AS `CR_CHDATE`,`s_cheq`.`CR_BANK` AS `CR_BANK`,`s_cheq`.`CR_RESON` AS `CR_RESON`,`s_cheq`.`CR_RESON1` AS `CR_RESON1`,`s_cheq`.`CR_REPOSIT` AS `CR_REPOSIT`,`s_cheq`.`REDEPOSITDATE` AS `REDEPOSITDATE`,`s_cheq`.`REDEPOSITREF` AS `REDEPOSITREF`,`s_cheq`.`CR_FLAG` AS `CR_FLAG`,`s_cheq`.`PAID` AS `PAID`,`s_cheq`.`S_REF` AS `S_REF`,`s_cheq`.`DEPARTMENT` AS `DEPARTMENT`,`s_cheq`.`REMARK` AS `REMARK`,`s_cheq`.`DEBACC` AS `DEBACC`,`s_cheq`.`CREACC` AS `CREACC`,`s_cheq`.`dev` AS `dev`,`s_cheq`.`ret_chno` AS `ret_chno`,`s_cheq`.`ret_chdate` AS `ret_chdate`,`s_cheq`.`noof` AS `noof`,`s_cheq`.`ret_refno` AS `ret_refno`,`s_cheq`.`rep_remark` AS `rep_remark`,`s_cheq`.`depobank` AS `depobank`,`s_cheq`.`id` AS `id`,`s_cheq`.`tmp` AS `tmp`,`s_cheq`.`FORwhat` AS `FORwhat`,`s_cheq`.`FORwhatDATE` AS `FORwhatDATE`,`s_cheq`.`crenoteno` AS `crenoteno`,`s_cheq`.`crenoteamo` AS `crenoteamo`,`s_cheq`.`debnoteno` AS `debnoteno`,`s_cheq`.`tmp_no` AS `tmp_no`,`s_cheq`.`Costcenter` AS `Costcenter`,`s_cheq`.`reason` AS `reason`,`s_cheq`.`retcout` AS `retcout`,`s_cheq`.`pdno` AS `pdno`,`s_salrep`.`Name` AS `Name` from (`s_cheq` join `s_salrep` on(`s_cheq`.`S_REF` = `s_salrep`.`REPCODE`));

-- ----------------------------
-- View structure for `view_s_crnma_s_salma`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_crnma_s_salma`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_crnma_s_salma` AS select `s_crnma`.`REF_NO` AS `REF_NO`,`s_crnma`.`DDATE` AS `DDATE`,`s_crnma`.`TRN_TYPE` AS `TRN_TYPE`,`s_crnma`.`INVOICENO` AS `INVOICENO`,`s_crnma`.`SDATE` AS `SDATE`,`s_crnma`.`SAL_EX` AS `SAL_EX`,`s_crnma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`GRAND_TOT` AS `invamo`,`s_salma`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_salma`.`SVAT` AS `SVAT`,`s_crnma`.`C_CODE` AS `C_CODE`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`Accname` AS `Accname` from (`s_crnma` left join `s_salma` on(`s_crnma`.`INVOICENO` = `s_salma`.`REF_NO`));

-- ----------------------------
-- View structure for `view_s_deftrn_vender`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_deftrn_vender`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_deftrn_vender` AS select `s_deftrn`.`ID` AS `ID`,`s_deftrn`.`REFNO` AS `REFNO`,`s_deftrn`.`BAT_NO` AS `BAT_NO`,`s_deftrn`.`CLAM_NO` AS `CLAM_NO`,`s_deftrn`.`SDATE` AS `SDATE`,`s_deftrn`.`c_code` AS `c_code`,`s_deftrn`.`SAL_EX` AS `SAL_EX`,`s_deftrn`.`DEP` AS `DEP`,`s_deftrn`.`STK_NO` AS `STK_NO`,`s_deftrn`.`AMOUNT` AS `AMOUNT`,`s_deftrn`.`REsult` AS `REsult`,`s_deftrn`.`Remarks` AS `Remarks`,`s_deftrn`.`qty` AS `qty`,`s_deftrn`.`dis` AS `dis`,`s_deftrn`.`CANCELL` AS `CANCELL`,`s_deftrn`.`arno` AS `arno`,`s_deftrn`.`ref_per` AS `ref_per`,`s_deftrn`.`tmp_no` AS `tmp_no`,`s_deftrn`.`cl_no` AS `cl_no`,`s_deftrn`.`approve_md_wd` AS `approve_md_wd`,`s_deftrn`.`ap_datetime` AS `ap_datetime`,`s_mas`.`DESCRIPT` AS `DESCRIPT`,`vendor`.`NAME` AS `NAME`,`s_deftrn`.`approve` AS `approve`,`s_crnma`.`GRAND_TOT` AS `GRAND_TOT`,`s_deftrn`.`denie` AS `denie` from (((`s_deftrn` join `vendor` on(`s_deftrn`.`c_code` = `vendor`.`CODE`)) join `s_mas` on(`s_deftrn`.`STK_NO` = `s_mas`.`STK_NO`)) join `s_crnma` on(`s_deftrn`.`REFNO` = `s_crnma`.`REF_NO`));

-- ----------------------------
-- View structure for `view_s_invcheq`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_invcheq`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_invcheq` AS select `s_invcheq`.`ID` AS `ID`,`s_invcheq`.`refno` AS `refno`,`s_invcheq`.`Sdate` AS `sdate`,`s_invcheq`.`cus_code` AS `cus_code`,`s_invcheq`.`CUS_NAME` AS `CUS_NAME`,`s_invcheq`.`cheque_no` AS `cheque_no`,`s_invcheq`.`che_date` AS `che_date`,`s_invcheq`.`bank` AS `bank`,`s_invcheq`.`che_amount` AS `che_amount`,`s_invcheq`.`dev` AS `dev`,`s_invcheq`.`sal_ex` AS `sal_ex`,`s_invcheq`.`trn_type` AS `trn_type`,`s_invcheq`.`ex_date1` AS `ex_date1`,`s_invcheq`.`ex_date2` AS `ex_date2`,`s_invcheq`.`ex_flag` AS `ex_flag`,`s_invcheq`.`ret_chno` AS `ret_chno`,`s_invcheq`.`ret_chdate` AS `ret_chdate`,`s_invcheq`.`noof` AS `noof`,`s_invcheq`.`ret_refno` AS `ret_refno`,`s_invcheq`.`ch_owner` AS `ch_owner`,`s_invcheq`.`ch_count_ret` AS `ch_count_ret`,`s_invcheq`.`department` AS `department`,`vendor`.`NAME` AS `CNAME`,`vendor`.`ADD1` AS `CADD`,`s_invcheq`.`refno` AS `Expr1`,`s_crec`.`CA_SALESEX` AS `sal_rep`,`s_crec`.`CANCELL` AS `CANCELL`,`s_crec`.`FLAG` AS `FLAG`,`s_crec`.`pay_type` AS `pay_type`,`s_crec`.`CA_CODE` AS `CA_CODE` from ((`s_invcheq` join `s_crec` on(`s_invcheq`.`refno` = `s_crec`.`CA_REFNO`)) left join `vendor` on(`s_invcheq`.`cus_code` = `vendor`.`CODE` and `s_crec`.`RET_CHNO` = `vendor`.`ADD2`));

-- ----------------------------
-- View structure for `view_s_invcheq_bankmas`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_invcheq_bankmas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_invcheq_bankmas` AS select `s_invcheq`.`ID` AS `ID`,`s_invcheq`.`refno` AS `refno`,`s_invcheq`.`Sdate` AS `Sdate`,`s_invcheq`.`cus_code` AS `cus_code`,`s_invcheq`.`CUS_NAME` AS `CUS_NAME`,`s_invcheq`.`cheque_no` AS `cheque_no`,`s_invcheq`.`che_date` AS `che_date`,`s_invcheq`.`bank` AS `bank`,`s_invcheq`.`che_amount` AS `che_amount`,`s_invcheq`.`dev` AS `dev`,`s_invcheq`.`sal_ex` AS `sal_ex`,`s_invcheq`.`trn_type` AS `trn_type`,`s_invcheq`.`ex_date1` AS `ex_date1`,`s_invcheq`.`ex_date2` AS `ex_date2`,`s_invcheq`.`ex_flag` AS `ex_flag`,`s_invcheq`.`ret_chno` AS `ret_chno`,`s_invcheq`.`ret_chdate` AS `ret_chdate`,`s_invcheq`.`noof` AS `noof`,`s_invcheq`.`ret_refno` AS `ret_refno`,`s_invcheq`.`ch_owner` AS `ch_owner`,`s_invcheq`.`ch_count_ret` AS `ch_count_ret`,`s_invcheq`.`department` AS `department`,`s_invcheq`.`SERI_NO` AS `SERI_NO`,`s_invcheq`.`W` AS `W`,`s_invcheq`.`tmp_no` AS `tmp_no`,`bankmas`.`bbcode` AS `bbcode`,`bankmas`.`bcode` AS `bcode` from (`s_invcheq` join `bankmas` on(`s_invcheq`.`bank` = `bankmas`.`bname`));

-- ----------------------------
-- View structure for `view_s_invcheq_copy`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_invcheq_copy`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_invcheq_copy` AS select `s_invcheq`.`ID` AS `ID`,`s_invcheq`.`refno` AS `refno`,`s_invcheq`.`Sdate` AS `sdate`,`s_invcheq`.`cus_code` AS `cus_code`,`s_invcheq`.`CUS_NAME` AS `CUS_NAME`,`s_invcheq`.`cheque_no` AS `cheque_no`,`s_invcheq`.`che_date` AS `che_date`,`s_invcheq`.`bank` AS `bank`,`s_invcheq`.`che_amount` AS `che_amount`,`s_invcheq`.`dev` AS `dev`,`s_invcheq`.`sal_ex` AS `sal_ex`,`s_invcheq`.`trn_type` AS `trn_type`,`s_invcheq`.`ex_date1` AS `ex_date1`,`s_invcheq`.`ex_date2` AS `ex_date2`,`s_invcheq`.`ex_flag` AS `ex_flag`,`s_invcheq`.`ret_chno` AS `ret_chno`,`s_invcheq`.`ret_chdate` AS `ret_chdate`,`s_invcheq`.`noof` AS `noof`,`s_invcheq`.`ret_refno` AS `ret_refno`,`s_invcheq`.`ch_owner` AS `ch_owner`,`s_invcheq`.`ch_count_ret` AS `ch_count_ret`,`s_invcheq`.`department` AS `department`,`vendor`.`NAME` AS `CNAME`,`vendor`.`ADD1` AS `CADD`,`s_invcheq`.`refno` AS `Expr1`,`s_crec`.`CA_SALESEX` AS `sal_rep`,`s_crec`.`CANCELL` AS `CANCELL`,`s_crec`.`FLAG` AS `FLAG`,`s_crec`.`pay_type` AS `pay_type`,`s_crec`.`CA_CODE` AS `CA_CODE`,`s_cheq`.`CR_REFNO` AS `CR_REFNO` from (((`s_invcheq` join `s_crec` on(`s_invcheq`.`refno` = `s_crec`.`CA_REFNO`)) left join `vendor` on(`s_invcheq`.`cus_code` = `vendor`.`CODE` and `s_crec`.`RET_CHNO` = `vendor`.`ADD2`)) join `s_cheq` on(`s_invcheq`.`cheque_no` = `s_cheq`.`CR_CHNO`));

-- ----------------------------
-- View structure for `view_s_invo`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_invo`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_invo` AS select `s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`CANCELL` AS `CANCELL`,`s_invo`.`STK_NO` AS `STK_NO`,`s_invo`.`DESCRIPT` AS `DESCRIPT`,`s_invo`.`UNIT` AS `UNIT`,`s_invo`.`PART_NO` AS `PART_NO`,`s_invo`.`COST` AS `COST`,`s_invo`.`PRICE` AS `PRICE`,`s_invo`.`QTY` AS `QTY`,`s_invo`.`DEPARTMENT` AS `DEPARTMENT`,`s_invo`.`DIS_per` AS `DIS_per`,`s_invo`.`DIS_rs` AS `DIS_rs`,`s_invo`.`REP` AS `REP`,`s_invo`.`ret_qty` AS `ret_qty`,`s_invo`.`TAX_PER` AS `TAX_PER`,`s_invo`.`BRAND` AS `BRAND`,`s_salma`.`DEV` AS `DEV`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`Brand` AS `Brand_name`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`GST` AS `GST`,`vendor`.`provi` AS `provi`,`s_salma`.`cre_pe` AS `cre_pe`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`type1` AS `type1`,`s_salma`.`company` AS `company` from ((`s_salma` join `s_invo` on(`s_salma`.`REF_NO` = `s_invo`.`REF_NO`)) left join `vendor` on(`s_salma`.`C_CODE` = `vendor`.`CODE`));

-- ----------------------------
-- View structure for `view_s_salma`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_salma`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_salma` AS select `s_salma`.`id` AS `id`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`C_ADD1` AS `C_ADD1`,`s_salma`.`TYPE` AS `TYPE`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`DISCOU` AS `DISCOU`,`s_salma`.`AMOUNT` AS `AMOUNT`,`s_salma`.`GST` AS `GST`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_salma`.`DIS` AS `DIS`,`s_salma`.`DIS1` AS `DIS1`,`s_salma`.`DIS2` AS `DIS2`,`s_salma`.`DIS_RUP` AS `DIS_RUP`,`s_salma`.`CASH` AS `CASH`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`ORD_NO` AS `ORD_NO`,`s_salma`.`ORD_DA` AS `ORD_DA`,`s_salma`.`SETTLED` AS `SETTLED`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`s_salma`.`DES_CAT` AS `DES_CAT`,`s_salma`.`DEPARTMENT` AS `DEPARTMENT`,`s_salma`.`REMARK` AS `REMARK`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`BTT` AS `BTT`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`VAT_VAL` AS `VAT_VAL`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`DEV` AS `DEV`,`s_salma`.`Account` AS `Account`,`s_salma`.`Accname` AS `Accname`,`s_salma`.`Costcenter` AS `Costcenter`,`s_salma`.`RET_AMO` AS `RET_AMO`,`s_salma`.`cre_pe` AS `cre_pe`,`s_salma`.`Comm` AS `Comm`,`s_salma`.`red` AS `red`,`s_salma`.`deli_date` AS `deli_date`,`s_salma`.`seri_no` AS `seri_no`,`s_salma`.`points` AS `points`,`s_salma`.`LOCK1` AS `LOCK1`,`s_salma`.`deliin` AS `deliin`,`s_salma`.`SVAT` AS `SVAT`,`s_salma`.`REQ_DATE` AS `REQ_DATE`,`s_salma`.`tmp_no` AS `tmp_no`,`brand_mas`.`class` AS `class`,`s_salma`.`c_code1` AS `c_code1` from (`s_salma` left join `brand_mas` on(`brand_mas`.`barnd_name` = `s_salma`.`Brand`));

-- ----------------------------
-- View structure for `view_s_salma_brand_mas`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_salma_brand_mas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_salma_brand_mas` AS select `s_salma`.`id` AS `id`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`C_ADD1` AS `C_ADD1`,`s_salma`.`TYPE` AS `TYPE`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`DISCOU` AS `DISCOU`,`s_salma`.`AMOUNT` AS `AMOUNT`,`s_salma`.`GST` AS `GST`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_salma`.`DIS` AS `DIS`,`s_salma`.`DIS1` AS `DIS1`,`s_salma`.`DIS2` AS `DIS2`,`s_salma`.`DIS_RUP` AS `DIS_RUP`,`s_salma`.`CASH` AS `CASH`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`ORD_NO` AS `ORD_NO`,`s_salma`.`ORD_DA` AS `ORD_DA`,`s_salma`.`SETTLED` AS `SETTLED`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`s_salma`.`DES_CAT` AS `DES_CAT`,`s_salma`.`DEPARTMENT` AS `DEPARTMENT`,`s_salma`.`REMARK` AS `REMARK`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`BTT` AS `BTT`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`VAT_VAL` AS `VAT_VAL`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`DEV` AS `DEV`,`s_salma`.`Account` AS `Account`,`s_salma`.`Accname` AS `Accname`,`s_salma`.`Costcenter` AS `Costcenter`,`s_salma`.`RET_AMO` AS `RET_AMO`,`s_salma`.`cre_pe` AS `cre_pe`,`s_salma`.`Comm` AS `Comm`,`s_salma`.`red` AS `red`,`s_salma`.`deli_date` AS `deli_date`,`s_salma`.`seri_no` AS `seri_no`,`s_salma`.`points` AS `points`,`s_salma`.`LOCK1` AS `LOCK1`,`s_salma`.`deliin` AS `deliin`,`s_salma`.`SVAT` AS `SVAT`,`s_salma`.`REQ_DATE` AS `REQ_DATE`,`s_salma`.`tmp_no` AS `tmp_no`,`brand_mas`.`class` AS `class`,`brand_mas`.`b60` AS `b60`,`brand_mas`.`d60to75` AS `d60to75` from (`s_salma` left join `brand_mas` on(`brand_mas`.`barnd_name` = `s_salma`.`Brand`));

-- ----------------------------
-- View structure for `view_s_salma_brand_mas_incentive`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_salma_brand_mas_incentive`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_salma_brand_mas_incentive` AS select `s_salma`.`id` AS `id`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`C_ADD1` AS `C_ADD1`,`s_salma`.`TYPE` AS `TYPE`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`DISCOU` AS `DISCOU`,`s_salma`.`AMOUNT` AS `AMOUNT`,`s_salma`.`GST` AS `GST`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`DUMMY_VAL` AS `DUMMY_VAL`,`s_salma`.`DIS` AS `DIS`,`s_salma`.`DIS1` AS `DIS1`,`s_salma`.`DIS2` AS `DIS2`,`s_salma`.`DIS_RUP` AS `DIS_RUP`,`s_salma`.`CASH` AS `CASH`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`ORD_NO` AS `ORD_NO`,`s_salma`.`ORD_DA` AS `ORD_DA`,`s_salma`.`SETTLED` AS `SETTLED`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`s_salma`.`DES_CAT` AS `DES_CAT`,`s_salma`.`DEPARTMENT` AS `DEPARTMENT`,`s_salma`.`REMARK` AS `REMARK`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`BTT` AS `BTT`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`VAT_VAL` AS `VAT_VAL`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`DEV` AS `DEV`,`s_salma`.`Account` AS `Account`,`s_salma`.`Accname` AS `Accname`,`s_salma`.`Costcenter` AS `Costcenter`,`s_salma`.`RET_AMO` AS `RET_AMO`,`s_salma`.`cre_pe` AS `cre_pe`,`s_salma`.`Comm` AS `Comm`,`s_salma`.`red` AS `red`,`s_salma`.`deli_date` AS `deli_date`,`s_salma`.`seri_no` AS `seri_no`,`s_salma`.`points` AS `points`,`s_salma`.`LOCK1` AS `LOCK1`,`s_salma`.`deliin` AS `deliin`,`s_salma`.`SVAT` AS `SVAT`,`s_salma`.`REQ_DATE` AS `REQ_DATE`,`s_salma`.`tmp_no` AS `tmp_no`,`brand_mas`.`class` AS `class`,`brand_mas`.`b60` AS `b60`,`brand_mas`.`d60to75` AS `d60to75`,`insentive_scheme`.`sfrom` AS `sfrom`,`insentive_scheme`.`sto` AS `sto`,`insentive_scheme`.`inc_type` AS `inc_type`,`s_salma`.`sdate1` AS `sdate1` from ((`s_salma` left join `brand_mas` on(`brand_mas`.`barnd_name` = `s_salma`.`Brand`)) join `insentive_scheme` on(`brand_mas`.`barnd_name` = `insentive_scheme`.`brand`));

-- ----------------------------
-- View structure for `view_s_salma_s_invo_s_mas`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_salma_s_invo_s_mas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_salma_s_invo_s_mas` AS select `s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`CANCELL` AS `CANCELL`,`s_invo`.`STK_NO` AS `STK_NO`,`s_invo`.`DESCRIPT` AS `DESCRIPT`,`s_invo`.`UNIT` AS `UNIT`,`s_invo`.`PART_NO` AS `PART_NO`,`s_invo`.`COST` AS `COST`,`s_invo`.`PRICE` AS `PRICE`,`s_invo`.`QTY` AS `QTY`,`s_invo`.`DEPARTMENT` AS `DEPARTMENT`,`s_invo`.`DIS_per` AS `DIS_per`,`s_invo`.`DIS_rs` AS `DIS_rs`,`s_invo`.`REP` AS `REP`,`s_invo`.`ret_qty` AS `ret_qty`,`s_invo`.`TAX_PER` AS `TAX_PER`,`s_invo`.`BRAND` AS `BRAND`,`s_salma`.`DEV` AS `DEV`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`VAT` AS `VAT`,`s_salma`.`Brand` AS `Brand_name`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`GST` AS `GST`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_mas`.`type` AS `type` from ((`s_salma` join `s_invo` on(`s_salma`.`REF_NO` = `s_invo`.`REF_NO`)) join `s_mas` on(`s_invo`.`STK_NO` = `s_mas`.`STK_NO`));

-- ----------------------------
-- View structure for `view_s_salma_s_sttr`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_salma_s_sttr`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_salma_s_sttr` AS select `s_salma`.`id` AS `id`,`s_salma`.`REF_NO` AS `REF_NO`,`s_salma`.`TRN_TYPE` AS `TRN_TYPE`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`TYPE` AS `TYPE`,`s_salma`.`AMOUNT` AS `AMOUNT`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT`,`s_salma`.`DIS_RUP` AS `DIS_RUP`,`s_salma`.`CASH` AS `CASH`,`s_salma`.`TOTPAY` AS `TOTPAY`,`s_salma`.`SETTLED` AS `SETTLED`,`s_salma`.`TOTPAY1` AS `TOTPAY1`,`s_salma`.`CANCELL` AS `CANCELL`,`s_salma`.`Brand` AS `Brand`,`s_salma`.`maindepartment` AS `maindepartment`,`s_salma`.`sdate1` AS `sdate1`,`s_salma`.`c_code1` AS `c_code1`,`s_salma`.`DEPARTMENT` AS `DEPARTMENT`,`s_salma`.`SAL_EX` AS `SAL_EX`,`s_salma`.`CUS_NAME` AS `CUS_NAME`,`s_salma`.`C_ADD1` AS `C_ADD1`,`s_sttr`.`ST_PAID` AS `ST_PAID`,`s_sttr`.`ST_FLAG` AS `ST_FLAG`,`s_sttr`.`ST_REFNO` AS `ST_REFNO`,`s_sttr`.`ST_DATE` AS `ST_DATE`,`s_salma`.`company` AS `company` from (`s_sttr` join `s_salma` on(`s_salma`.`REF_NO` = `s_sttr`.`ST_INVONO`));

-- ----------------------------
-- View structure for `view_s_sttr_copy`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_sttr_copy`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_sttr_copy` AS select `s_sttr`.`ID` AS `ID`,`s_sttr`.`ST_REFNO` AS `ST_REFNO`,`s_sttr`.`ST_DATE` AS `ST_DATE`,`s_sttr`.`ST_INVONO` AS `ST_INVONO`,`s_sttr`.`ST_PAID` AS `ST_PAID`,`s_sttr`.`ST_FLAG` AS `ST_FLAG`,`s_sttr`.`ST_INDATE` AS `ST_INDATE`,`s_sttr`.`st_chbank` AS `st_chbank`,`s_sttr`.`st_days` AS `st_days`,`s_sttr`.`ST_CHNO` AS `ST_CHNO`,`s_sttr`.`DUE` AS `DUE`,`s_sttr`.`SETTLED_NO` AS `SETTLED_NO`,`s_sttr`.`DEV` AS `DEV`,`s_sttr`.`ret_chval` AS `ret_chval`,`s_sttr`.`ret_chset` AS `ret_chset`,`s_sttr`.`st_chedate` AS `st_chedate`,`s_sttr`.`st_chdate` AS `st_chdate`,`s_sttr`.`cus_code` AS `cus_code`,`s_sttr`.`ap_days` AS `ap_days`,`s_sttr`.`comm` AS `comm`,`s_sttr`.`ap_rem` AS `ap_rem`,`s_sttr`.`del_days` AS `del_days`,`s_sttr`.`deliin_days` AS `deliin_days`,`s_sttr`.`deliin_amo` AS `deliin_amo`,`s_sttr`.`deliin_lock` AS `deliin_lock`,`s_sttr`.`department` AS `department`,`s_salma`.`SDATE` AS `SDATE`,`s_salma`.`DEV` AS `DEV_s`,`s_salma`.`C_CODE` AS `C_CODE`,`s_salma`.`deli_date` AS `deli_date`,`s_salma`.`GRAND_TOT` AS `GRAND_TOT` from (`s_salma` join `s_sttr` on(`s_salma`.`REF_NO` = `s_sttr`.`ST_INVONO`));

-- ----------------------------
-- View structure for `view_s_trn_def`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_trn_def`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_trn_def` AS select `s_mas`.`STK_NO` AS `STK_NO`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME`,`brand_mas`.`class` AS `class`,`s_trn_defective`.`REFNO` AS `REFNO`,`s_trn_defective`.`QTY` AS `QTY`,`s_trn_defective`.`LEDINDI` AS `LEDINDI`,`s_trn_defective`.`DEPARTMENT` AS `DEPARTMENT`,`s_mas`.`DESCRIPT` AS `DESCRIPT`,`s_trn_defective`.`SDATE` AS `SDATE` from ((`s_mas` join `s_trn_defective` on(`s_mas`.`STK_NO` = `s_trn_defective`.`STK_NO`)) join `brand_mas` on(`s_mas`.`BRAND_NAME` = `brand_mas`.`barnd_name`));

-- ----------------------------
-- View structure for `view_s_trn_def_copy_copy`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_trn_def_copy_copy`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_trn_def_copy_copy` AS select `s_mas`.`STK_NO` AS `STK_NO`,`s_mas`.`BRAND_NAME` AS `BRAND_NAME`,`brand_mas`.`class` AS `class`,`s_trn_defective`.`REFNO` AS `REFNO`,`s_trn_defective`.`QTY` AS `QTY`,`s_trn_defective`.`LEDINDI` AS `LEDINDI`,`s_trn_defective`.`DEPARTMENT` AS `DEPARTMENT`,`s_mas`.`DESCRIPT` AS `DESCRIPT` from ((`s_mas` join `s_trn_defective` on(`s_mas`.`STK_NO` = `s_trn_defective`.`STK_NO`)) join `brand_mas` on(`s_mas`.`BRAND_NAME` = `brand_mas`.`barnd_name`));

-- ----------------------------
-- View structure for `view_s_ut`
-- ----------------------------
DROP VIEW IF EXISTS `view_s_ut`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_s_ut` AS select `s_ut`.`id` AS `id`,`s_ut`.`C_REFNO` AS `C_REFNO`,`s_ut`.`C_DATE` AS `C_DATE`,`s_ut`.`C_CODE` AS `C_CODE`,`s_ut`.`C_INVNO` AS `C_INVNO`,`s_ut`.`C_PAYMENT` AS `C_PAYMENT`,`s_ut`.`C_REMARK` AS `C_REMARK`,`s_ut`.`C_REMARK1` AS `C_REMARK1`,`s_ut`.`C_REMARK2` AS `C_REMARK2`,`s_ut`.`C_REMARK3` AS `C_REMARK3`,`s_ut`.`C_TOTREPAY` AS `C_TOTREPAY`,`s_ut`.`C_GST` AS `C_GST`,`s_ut`.`D` AS `D`,`s_ut`.`CRE_NO_NO` AS `CRE_NO_NO`,`s_ut`.`TYPE` AS `TYPE`,`c_bal`.`SDATE` AS `grndate`,`s_salma`.`CUS_NAME` AS `name`,`c_bal`.`SAL_EX` AS `SAL_EX`,`s_salma`.`DEV` AS `DEV`,`s_utmas`.`c_chno` AS `c_chno`,`s_utmas`.`c_chdate` AS `c_chdate`,`s_utmas`.`ch_bank` AS `ch_bank` from (((`s_ut` join `c_bal` on(`s_ut`.`CRE_NO_NO` = `c_bal`.`REFNO`)) left join `s_salma` on(`s_ut`.`C_INVNO` = `s_salma`.`REF_NO`)) join `s_utmas` on(`s_ut`.`C_REFNO` = `s_utmas`.`C_REFNO`));

-- ----------------------------
-- View structure for `view_test`
-- ----------------------------
DROP VIEW IF EXISTS `view_test`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_test` AS select `s_purtrn`.`SDATE` AS `SDATE`,`s_purtrn`.`REFNO` AS `REFNO`,`testtable`.`code` AS `code` from (`testtable` join `s_purtrn` on(`testtable`.`code` = `s_purtrn`.`STK_NO`));

-- ----------------------------
-- View structure for `view_tmp_gin`
-- ----------------------------
DROP VIEW IF EXISTS `view_tmp_gin`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_tmp_gin` AS select `tmp_gin_data_multi`.`str_invno` AS `str_invno`,`tmp_gin_data_multi`.`str_code` AS `str_code`,`tmp_gin_data_multi`.`str_description` AS `str_description`,`tmp_gin_data_multi`.`partno` AS `partno`,`tmp_gin_data_multi`.`cur_qty` AS `cur_qty`,`tmp_gin_data_multi`.`tmp_no` AS `tmp_no`,`tmp_gin_data_multi`.`user_id` AS `user_id`,`tmp_gin_data_multi`.`id` AS `id`,`tmp_gin_data_multi`.`dep_from` AS `dep_from`,`s_stomas`.`DESCRIPTION` AS `DESCRIPTION` from (`tmp_gin_data_multi` join `s_stomas` on(`tmp_gin_data_multi`.`dep_from` = `s_stomas`.`CODE`));

-- ----------------------------
-- View structure for `view_tragers_vendor`
-- ----------------------------
DROP VIEW IF EXISTS `view_tragers_vendor`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_tragers_vendor` AS select `week_tragets`.`refno` AS `REFNO`,`week_tragets`.`rep` AS `REP`,`week_tragets`.`Tardate` AS `Tardate`,`week_tragets`.`cus_code` AS `Cus_Code`,`week_tragets`.`Target` AS `Target`,`week_tragets`.`remark` AS `Remark`,`week_tragets`.`Sale` AS `Sale`,`week_tragets`.`dtfrom` AS `DTFROM`,`week_tragets`.`DTTTO` AS `DTTTO`,`week_tragets`.`id` AS `id`,`week_tragets`.`Tyres` AS `Tyres`,`week_tragets`.`battery` AS `battery`,`week_tragets`.`MC_battery` AS `MC_battery`,`week_tragets`.`Tube` AS `Tube`,`vendor`.`NAME` AS `NAME` from (`week_tragets` left join `vendor` on(`week_tragets`.`cus_code` = `vendor`.`CODE`));

-- ----------------------------
-- View structure for `view_trn_smas`
-- ----------------------------
DROP VIEW IF EXISTS `view_trn_smas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_trn_smas` AS select `s_trn`.`SDATE` AS `SDATE`,`s_trn`.`tru_qty` AS `tru_qty`,`s_trn`.`DEPARTMENT` AS `DEPARTMENT`,`s_trn`.`ID` AS `ID`,`s_mas`.`STK_NO` AS `STK_NO`,`s_mas`.`QTYINHAND` AS `QTYINHAND`,`s_mas`.`CAT` AS `CAT` from (`s_trn` join `s_mas` on(`s_mas`.`STK_NO` = `s_trn`.`STK_NO`));

-- ----------------------------
-- View structure for `view_trn_submas`
-- ----------------------------
DROP VIEW IF EXISTS `view_trn_submas`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_trn_submas` AS select `s_submas`.`STK_NO` AS `STK_NO`,`s_submas`.`QTYINHAND` AS `QTYINHAND`,`s_trn`.`SDATE` AS `SDATE`,`s_trn`.`tru_qty` AS `tru_qty`,`s_trn`.`DEPARTMENT` AS `DEPARTMENT`,`s_trn`.`ID` AS `ID` from (`s_trn` join `s_submas` on(`s_trn`.`STK_NO` = `s_submas`.`STK_NO` and `s_submas`.`STO_CODE` = `s_trn`.`DEPARTMENT`));

-- ----------------------------
-- View structure for `view_userpermission`
-- ----------------------------
DROP VIEW IF EXISTS `view_userpermission`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_userpermission` AS select `doc`.`docname` AS `docname`,`doc`.`name` AS `name`,`doc`.`grp` AS `grp`,`doc`.`docid` AS `docid`,`userpermission`.`username` AS `username`,`userpermission`.`userpass` AS `userpass`,`userpermission`.`doc_view` AS `doc_view`,`userpermission`.`doc_feed` AS `doc_feed`,`userpermission`.`doc_mod` AS `doc_mod`,`userpermission`.`price_edit` AS `price_edit`,`userpermission`.`admin` AS `admin`,`userpermission`.`dev` AS `dev`,`userpermission`.`doc_print` AS `doc_print`,`userpermission`.`sal_ex` AS `sal_ex`,`userpermission`.`block` AS `block`,`doc`.`color` AS `color`,`doc`.`icon` AS `icon`,`doc`.`id` AS `id`,`userpermission`.`doc_cancel` AS `doc_cancel` from (`userpermission` join `doc` on(`userpermission`.`docid` = `doc`.`docid`));

-- ----------------------------
-- View structure for `view_venderchk`
-- ----------------------------
DROP VIEW IF EXISTS `view_venderchk`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_venderchk` AS select `vendor`.`CODE` AS `CODE`,`vendor`.`NAME` AS `NAME`,`vendor`.`ADD1` AS `ADD1`,`vendor`.`ADD2` AS `ADD2`,`vendor`.`vatno` AS `vatno`,`vendor`.`svatno` AS `svatno`,`vender_sub`.`c_name` AS `c_name`,`vender_sub`.`c_add` AS `c_add`,`vender_sub`.`c_tele` AS `c_tele`,`vender_sub`.`c_vatno` AS `c_vatno`,`vender_sub`.`c_svatno` AS `c_svatno`,`vender_sub`.`town` AS `town` from (`vendor` join `vender_sub` on(`vendor`.`CODE` = `vender_sub`.`c_code`));

-- ----------------------------
-- View structure for `view_vendor`
-- ----------------------------
DROP VIEW IF EXISTS `view_vendor`;
CREATE ALGORITHM=UNDEFINED DEFINER=`whitetil`@`%` SQL SECURITY DEFINER VIEW `view_vendor` AS select `vender_sub`.`c_code` AS `c_code`,`vender_sub`.`c_name` AS `c_name`,`vender_sub`.`c_add` AS `c_add`,`vender_sub`.`c_tele` AS `c_tele`,`vender_sub`.`c_vatno` AS `c_vatno`,`vender_sub`.`c_svatno` AS `c_svatno`,`vender_sub`.`c_main` AS `c_main`,`vendor`.`CAT` AS `CAT`,`vendor`.`CODE` AS `CODE`,`vender_sub`.`town` AS `town`,`vendor`.`ADD1` AS `ADD1`,`vendor`.`ADD2` AS `ADD2`,`vender_sub`.`id` AS `id`,`vender_sub`.`c_add1` AS `c_add1`,`vendor`.`m_name` AS `m_name`,`vender_sub`.`type` AS `type` from (`vender_sub` join `vendor` on(`vender_sub`.`c_main` = `vendor`.`CODE`));
