-- Table structure for table `tcashflow`
--

CREATE TABLE `tcashflow` (
  `Tahun` int(4) default NULL,
  `Jns_jurnal` varchar(10) default NULL,
  `Tanggal` date NOT NULL default '0000-00-00',
  `No_bukti` varchar(14) NOT NULL default '',
  `penerima` varchar(50) default NULL,
  `Keterangan` varchar(100) default NULL,
  `Row_id` int(11) NOT NULL default '0',
  `Kode_perk` varchar(15) default NULL,
  `Nama_perk` varchar(70) default NULL,
  `Debet` double default NULL,
  `Kredit` double default NULL,
  `No_kw` varchar(11) default NULL,
  PRIMARY KEY  (`Tanggal`,`No_bukti`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tcashflow`
--


--
-- Table structure for table `tcashflow_d`
--

CREATE TABLE `tcashflow_d` (
  `Tahun` int(4) default NULL,
  `Jns_jurnal` varchar(10) default NULL,
  `Tanggal` date NOT NULL default '0000-00-00',
  `No_bukti` varchar(14) NOT NULL default '',
  `Row_id` int(11) NOT NULL default '0',
  `Kode_perk` varchar(15) default NULL,
  `Debet` double default NULL,
  `Kredit` double default NULL,
  `kode_divisi` varchar(10) default NULL,
  PRIMARY KEY  (`Tanggal`,`No_bukti`,`Row_id`),
  KEY `Kode_perk` (`Kode_perk`,`Tahun`),
  KEY `fk_tjurnal_d1` (`Jns_jurnal`,`No_bukti`),
  KEY `Jns_jurnal` (`Jns_jurnal`,`Tanggal`,`No_bukti`),
  CONSTRAINT `tcashflow_d_ibfk_1` FOREIGN KEY (`Jns_jurnal`, `Tanggal`, `No_bukti`) REFERENCES `tcashflow_m` (`Jns_jurnal`, `Tgl_Validasi`, `No_bukti`),
  CONSTRAINT `tcashflow_d_ibfk_2` FOREIGN KEY (`Kode_perk`, `Tahun`) REFERENCES `mperkiraan` (`Kode_perk`, `Tahun`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tcashflow_d`
--


--
-- Table structure for table `tcashflow_m`
--

CREATE TABLE `tcashflow_m` (
  `Jns_jurnal` varchar(10) NOT NULL default '',
  `Tanggal` date NOT NULL default '0000-00-00',
  `Tgl_Validasi` date NOT NULL default '0000-00-00',
  `No_bukti` varchar(14) NOT NULL,
  `Keterangan` varchar(90) default NULL,
  `Pst` tinyint(4) default NULL,
  `Tgl_Edit` datetime default NULL,
  `User` varchar(25) default NULL,
  `Sandi_trans_id` varchar(2) default NULL,
  `Norek_Simp` varchar(10) default NULL,
  `Norek_Pinj` varchar(10) default NULL,
  `Norek_Dep` varchar(10) default NULL,
  `Status_Val` varchar(1) default NULL,
  `Status_AB` varchar(1) default NULL,
  `Nobukti_Rtl` varchar(11) default NULL,
  `penerima` varchar(50) default NULL,
  PRIMARY KEY  (`Jns_jurnal`,`Tgl_Validasi`,`No_bukti`),
  KEY `Jns_jurnal` (`Jns_jurnal`),
  KEY `No_bukti` (`No_bukti`),
  KEY `Jns_jurnal_2` (`Jns_jurnal`,`No_bukti`),
  KEY `Jns_jurnal_3` (`Jns_jurnal`,`Tgl_Validasi`,`No_bukti`),
  KEY `Jns_jurnal_4` (`Jns_jurnal`,`Tanggal`,`No_bukti`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tcashflow_m`
--


--
-- Table structure for table `thari`
--

CREATE TABLE `thari` (
  `kodehari` tinyint(4) NOT NULL,
  `namahari` varchar(21) default NULL,
  PRIMARY KEY  (`kodehari`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `thari`
--


--
-- Temporary table structure for view `tjurnal`
--

/*!50001 DROP VIEW IF EXISTS `tjurnal`*/;
/*!50001 CREATE TABLE `tjurnal` (
  `Jns_jurnal` varchar(10),
  `Tanggal` date,
  `Tgl_Validasi` date,
  `No_bukti` varchar(14),
  `Row_id` int(11),
  `Keterangan` varchar(90),
  `Pst` tinyint(4),
  `Tgl_Edit` datetime,
  `User` varchar(25),
  `Sandi_trans_id` varchar(2),
  `Norek_Simp` varchar(10),
  `Norek_Pinj` varchar(10),
  `Norek_Dep` varchar(10),
  `Status_Val` varchar(1),
  `Status_AB` varchar(1),
  `Nobukti_Rtl` varchar(11),
  `Kode_perk` varchar(10),
  `Debet` double,
  `Kredit` double
) */;

--
-- Table structure for table `tjurnal_d`
--

CREATE TABLE `tjurnal_d` (
  `Tahun` int(4) default NULL,
  `Jns_jurnal` varchar(10) NOT NULL,
  `Tanggal` date NOT NULL default '0000-00-00',
  `No_bukti` varchar(14) NOT NULL default '',
  `Row_id` int(11) NOT NULL default '0',
  `Kode_perk` varchar(10) default NULL,
  `Debet` double default NULL,
  `Kredit` double default NULL,
  PRIMARY KEY  (`Jns_jurnal`,`Tanggal`,`No_bukti`,`Row_id`),
  KEY `fk_tjurnal_d1` (`Jns_jurnal`,`No_bukti`),
  KEY `Jns_jurnal` (`Jns_jurnal`,`Tanggal`,`No_bukti`),
  KEY `tjurnal_d_ibfk_2` (`Tahun`,`Kode_perk`),
  CONSTRAINT `tjurnal_d_ibfk_1` FOREIGN KEY (`Jns_jurnal`, `Tanggal`, `No_bukti`) REFERENCES `tjurnal_m` (`Jns_jurnal`, `Tgl_Validasi`, `No_bukti`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tjurnal_d`
--


--
-- Table structure for table `tjurnal_m`
--

CREATE TABLE `tjurnal_m` (
  `Jns_jurnal` varchar(10) NOT NULL default '',
  `Tanggal` date NOT NULL default '0000-00-00',
  `Tgl_Validasi` date NOT NULL default '0000-00-00',
  `No_bukti` varchar(14) NOT NULL,
  `Keterangan` varchar(90) default NULL,
  `Pst` tinyint(4) default NULL,
  `Tgl_Edit` datetime default NULL,
  `User` varchar(25) default NULL,
  `Sandi_trans_id` varchar(2) default NULL,
  `Norek_Simp` varchar(10) default NULL,
  `Norek_Pinj` varchar(10) default NULL,
  `Norek_Dep` varchar(10) default NULL,
  `Status_Val` varchar(1) default NULL,
  `Status_AB` varchar(1) default NULL,
  `Nobukti_Rtl` varchar(11) default NULL,
  PRIMARY KEY  (`Jns_jurnal`,`Tgl_Validasi`,`No_bukti`),
  KEY `Jns_jurnal` (`Jns_jurnal`),
  KEY `No_bukti` (`No_bukti`),
  KEY `Jns_jurnal_2` (`Jns_jurnal`,`No_bukti`),
  KEY `Jns_jurnal_3` (`Jns_jurnal`,`Tgl_Validasi`,`No_bukti`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tjurnal_m`
--


--
-- Table structure for table `tm_barang`
--

CREATE TABLE `tm_barang` (
  `KodeBrg` varchar(20) NOT NULL default '',
  `Barcode` varchar(20) default NULL,
  `NamaBrg` varchar(200) default NULL,
  `KodeGol` varchar(10) NOT NULL,
  `KodeSuppB` varchar(10) default NULL,
  `HargaRetail` double default NULL,
  `HargaGrosir` double default NULL,
  `HargaMinim` double default NULL,
  `DiscRetail` double default NULL,
  `HargaAvg` double default NULL,
  `HargaSet1` double default NULL,
  `HargaSet2` double default NULL,
  `HargaSet3` double default NULL,
  `hargaset4` double default NULL,
  `hargaset5` double default NULL,
  `StockMin` double default NULL,
  `Stockmax` double default NULL,
  `JenisBrg` varchar(10) default NULL,
  `EditNamaBrg` varchar(1) default NULL,
  `Aktif` varchar(1) default 'Y',
  `EditHargaRetail` varchar(1) default NULL,
  `EditHargaJual` varchar(1) default NULL,
  `Keterangan` varchar(100) default NULL,
  `DefaultGdBeli` varchar(5) NOT NULL,
  `DefaultGdJual` varchar(5) NOT NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv1` double default NULL,
  `Satuan1` varchar(10) default NULL,
  `Konv2` double default NULL,
  `Satuan2` varchar(10) default NULL,
  `Konv3` double default NULL,
  `Satuan3` varchar(10) default NULL,
  `FieldBrg1` varchar(50) default NULL,
  `FieldBrg2` varchar(50) default NULL,
  `FieldBrg3` varchar(50) default NULL,
  `FieldBrg4` varchar(50) default NULL,
  `FieldBrg5` varchar(50) default NULL,
  `AccExp` varchar(20) default NULL,
  `AccInv` varchar(20) default NULL,
  `AccSales` varchar(20) default NULL,
  `AccRetSales` varchar(20) default NULL,
  `AccRetPurc` varchar(20) default NULL,
  `AccCOGS` varchar(20) default NULL,
  `JmlBatas1` double default NULL,
  `DiscBatas1` double default NULL,
  `PotBatas1` double default NULL,
  `JmlBatas2` double default NULL,
  `DiscBatas2` double default NULL,
  `PotBatas2` double default NULL,
  `JmlBatas3` double default NULL,
  `DiscBatas3` double default NULL,
  `QtySet1` double default NULL,
  `QtySet2` double default NULL,
  `QtySet3` double default NULL,
  `PotBatas3` double default NULL,
  `User` varchar(10) default NULL,
  `Tgl_edit` datetime default NULL,
  `PersenGrosir` double default NULL,
  `PersenRetail` double default NULL,
  `tgl_akhir` datetime default NULL,
  PRIMARY KEY  (`KodeBrg`),
  KEY `fk_MBarang1` (`KodeSuppB`),
  KEY `fk_MBarang2` (`KodeGol`),
  KEY `fk_MBarang3` (`DefaultGdBeli`),
  KEY `fk_MBarang4` (`DefaultGdJual`),
  KEY `fk_MBarang5` (`AccExp`),
  KEY `fk_MBarang10` (`AccCOGS`),
  KEY `idx_MBarang11` (`NamaBrg`),
  KEY `idx_Mbarang13` (`Aktif`),
  KEY `idx_MBarang12` USING BTREE (`KodeBrg`),
  CONSTRAINT `fk_MBarang3` FOREIGN KEY (`DefaultGdBeli`) REFERENCES `tm_gudang` (`KodeGd`),
  CONSTRAINT `fk_MBarang4` FOREIGN KEY (`DefaultGdJual`) REFERENCES `tm_gudang` (`KodeGd`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_barang`
--

INSERT INTO `tm_barang` VALUES ('MON1','','Monitor LG 19\"','MT01','AS01',1700000,0,0,NULL,1530000,0,0,0,NULL,NULL,0,0,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,11.1111,NULL),('MON2','','Monitor LG 22\'','MT01','AS01',2200000,0,0,NULL,1980000,0,0,0,NULL,NULL,0,1,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,11.1111,NULL),('MON3','','Monitor SPC 19\"','MT01','AS01',1400000,0,0,NULL,1260000,0,0,0,NULL,NULL,0,0,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,11.1111,NULL),('MON4','','Monitor Inforce 19\"','MT01','AS01',1350000,0,0,NULL,1080000,0,0,0,NULL,NULL,0,0,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,25,NULL),('MON5','','Monitor Magix 19\"','MT01','AS01',1200000,0,0,NULL,1080000,0,0,0,NULL,NULL,0,0,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,11.1111,NULL),('MON6','','Monitor Pixel 19\"','MT01','AS01',1300000,0,0,NULL,1170000,0,0,0,NULL,NULL,0,0,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,11.1111,NULL),('MON7','','Monitor Venus 17\"','MT01','AS01',800000,0,0,NULL,720000,0,0,0,NULL,NULL,0,0,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,11.1111,NULL),('MON8','','Monitor Ikedo 20\"','MT01','AS01',1200000,0,0,NULL,1080000,0,0,0,NULL,NULL,0,0,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,11.1111,NULL),('MON9','','Monitor Lenovo 19\"','MT01','AS01',1900000,0,0,NULL,1750000,0,0,0,NULL,NULL,0,0,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,8.5714,NULL),('OPPO1','','HP Oppo A16 3/32','ST01','WO01',2023700,0,0,NULL,1800000,0,0,0,NULL,NULL,0,0,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,11.0556,NULL),('OPPO2','','HP Oppo A16 4/64','ST01','WO01',2250000,0,0,NULL,2250000,0,0,0,NULL,NULL,0,0,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,0,NULL),('OPPO3','','HP Oppo A33 3/32','ST01','WO01',1800000,0,0,NULL,1800000,0,0,0,NULL,NULL,0,0,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,0,NULL),('OPPO4','','Oppo A53 4/128','ST01','WO01',2699000,0,0,NULL,2430000,0,0,0,NULL,NULL,0,0,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,11.07,NULL),('OPPO5','','Oppo A54 4/64','ST01','WO01',2499000,0,0,NULL,2249100,0,0,0,NULL,NULL,0,0,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,11.1111,NULL),('OPPO6','','Oppo A54 4/128','ST01','WO01',2699000,0,0,NULL,2429100,0,0,0,NULL,NULL,0,0,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,11.1111,NULL),('OPPO7','','Oppo A54 6/128','ST01','WO01',3099000,0,0,NULL,2789100,0,0,0,NULL,NULL,0,0,'Inventory','','Y',NULL,NULL,'','GD1','GD1','Pcs',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,NULL,NULL,NULL,0,11.1111,NULL);

DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `BeforeEdit` BEFORE UPDATE ON `tm_barang` FOR EACH ROW BEGIN

#if  (new.PersenRetail is Not Null) and (new.PersenRetail <> 0) then

  # set new.HargaRetail=  (Round( new.HargaAvg / ((100-new.PersenRetail) /100) ,-2))  ;

#end if;

END */;;

DELIMITER ;

--
-- Table structure for table `tm_cabang`
--

CREATE TABLE `tm_cabang` (
  `cabang_id` varchar(2) NOT NULL,
  `nama_cabang` varchar(30) default NULL,
  PRIMARY KEY  (`cabang_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_cabang`
--


--
-- Table structure for table `tm_custkirim`
--

CREATE TABLE `tm_custkirim` (
  `KodeCust` varchar(10) NOT NULL default '',
  `ItemCust` int(11) NOT NULL default '0',
  `NamaKirim` varchar(50) default NULL,
  `AlamatKirim` varchar(200) default NULL,
  `KotaKirim` varchar(50) default NULL,
  `Aktif` varchar(1) default NULL,
  PRIMARY KEY  (`KodeCust`,`ItemCust`),
  CONSTRAINT `fk_TM_CustKirim` FOREIGN KEY (`KodeCust`) REFERENCES `tm_customer` (`KodeCust`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_custkirim`
--


--
-- Table structure for table `tm_customer`
--

CREATE TABLE `tm_customer` (
  `KodeCust` varchar(10) NOT NULL default '',
  `NamaCust` varchar(50) default NULL,
  `Editnama` varchar(1) default NULL,
  `Alamat` varchar(200) default NULL,
  `Kota` varchar(30) default NULL,
  `Telp` varchar(30) default NULL,
  `Fax` varchar(30) default NULL,
  `email` varchar(50) default NULL,
  `webpage` varchar(50) default NULL,
  `CustType` varchar(10) default NULL,
  `CreditLimit` double default NULL,
  `Defvalas` varchar(10) default NULL,
  `SyaratByr` int(11) default NULL,
  `Keterangan` varchar(100) default NULL,
  `Aktif` varchar(1) default NULL,
  `Piutang` double default NULL,
  `PiutAw` double default NULL,
  `TglPiutAwal` datetime default NULL,
  `AccPiut` varchar(20) default NULL,
  `AccPiutBG` varchar(20) default NULL,
  `AccPiutDB` varchar(20) default NULL,
  `AccPiutCR` varchar(20) default NULL,
  `AccPiutTitip` varchar(20) default NULL,
  `DefD1` double default NULL,
  `DefD2` double default NULL,
  `DefD3` double default NULL,
  `DefD4` double default NULL,
  `DefTamb` double default NULL,
  `DefKetTamb` varchar(50) default NULL,
  `FieldCust1` varchar(100) default NULL,
  `FieldCust2` varchar(100) default NULL,
  `FieldCust3` varchar(100) default NULL,
  `FieldCust4` varchar(100) default NULL,
  `FieldCust5` varchar(100) default NULL,
  PRIMARY KEY  (`KodeCust`),
  KEY `fk_MCustomer1` (`AccPiut`),
  KEY `fk_MCustomer2` (`AccPiutBG`),
  KEY `fk_MCustomer3` (`AccPiutDB`),
  KEY `fk_MCustomer4` (`AccPiutCR`),
  KEY `fk_MCustomer5` (`AccPiutTitip`),
  CONSTRAINT `fk_MCustomer1` FOREIGN KEY (`AccPiut`) REFERENCES `mperkiraan` (`Kode_perk`),
  CONSTRAINT `fk_MCustomer2` FOREIGN KEY (`AccPiutBG`) REFERENCES `mperkiraan` (`Kode_perk`),
  CONSTRAINT `fk_MCustomer3` FOREIGN KEY (`AccPiutDB`) REFERENCES `mperkiraan` (`Kode_perk`),
  CONSTRAINT `fk_MCustomer4` FOREIGN KEY (`AccPiutCR`) REFERENCES `mperkiraan` (`Kode_perk`),
  CONSTRAINT `fk_MCustomer5` FOREIGN KEY (`AccPiutTitip`) REFERENCES `mperkiraan` (`Kode_perk`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_customer`
--


--
-- Table structure for table `tm_divisi`
--

CREATE TABLE `tm_divisi` (
  `kode_divisi` varchar(10) NOT NULL,
  `Nama_divisi` varchar(40) default NULL,
  `Keterangan` varchar(40) default NULL,
  `aktif` varchar(1) default NULL,
  PRIMARY KEY  (`kode_divisi`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_divisi`
--


--
-- Table structure for table `tm_golongan`
--

CREATE TABLE `tm_golongan` (
  `KodeGol` varchar(10) NOT NULL default '',
  `NamaGol` varchar(50) default NULL,
  `Keterangan` varchar(100) default NULL,
  `Margin` decimal(12,2) default NULL,
  `Aktif` varchar(1) default NULL,
  `DefAccExp` varchar(20) default NULL,
  `DefAccInv` varchar(20) default NULL,
  `DefAccSales` varchar(20) default NULL,
  `DefAccRetSales` varchar(20) default NULL,
  `DefAccRetPurc` varchar(20) default NULL,
  `DefAccCOGS` varchar(20) default NULL,
  PRIMARY KEY  (`KodeGol`),
  KEY `fk_MGolongan1` (`DefAccExp`),
  KEY `fk_MGolongan2` (`DefAccInv`),
  KEY `fk_MGolongan3` (`DefAccSales`),
  KEY `fk_MGolongan4` (`DefAccRetSales`),
  KEY `fk_MGolongan5` (`DefAccRetPurc`),
  KEY `fk_MGolongan6` (`DefAccCOGS`),
  CONSTRAINT `fk_MGolongan1` FOREIGN KEY (`DefAccExp`) REFERENCES `mperkiraan` (`Kode_perk`),
  CONSTRAINT `fk_MGolongan2` FOREIGN KEY (`DefAccInv`) REFERENCES `mperkiraan` (`Kode_perk`),
  CONSTRAINT `fk_MGolongan3` FOREIGN KEY (`DefAccSales`) REFERENCES `mperkiraan` (`Kode_perk`),
  CONSTRAINT `fk_MGolongan4` FOREIGN KEY (`DefAccRetSales`) REFERENCES `mperkiraan` (`Kode_perk`),
  CONSTRAINT `fk_MGolongan5` FOREIGN KEY (`DefAccRetPurc`) REFERENCES `mperkiraan` (`Kode_perk`),
  CONSTRAINT `fk_MGolongan6` FOREIGN KEY (`DefAccCOGS`) REFERENCES `mperkiraan` (`Kode_perk`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_golongan`
--

INSERT INTO `tm_golongan` VALUES ('CT01','CPU','PC Rakit','0.00','Y',NULL,NULL,NULL,NULL,NULL,NULL),('ET01','Etalase 1','Aksesoris','0.00','Y',NULL,NULL,NULL,NULL,NULL,NULL),('ET02','Etalase 2','Aksesoris','0.00','Y',NULL,NULL,NULL,NULL,NULL,NULL),('ET03','Etalase 3','Aksesoris','0.00','Y',NULL,NULL,NULL,NULL,NULL,NULL),('ET04','Etalase 4','Aksesoris ','0.00','Y',NULL,NULL,NULL,NULL,NULL,NULL),('ET05','Etalase 5','Aksesoris','0.00','Y',NULL,NULL,NULL,NULL,NULL,NULL),('ET06','Etalase 6','Aksesoris','0.00','Y',NULL,NULL,NULL,NULL,NULL,NULL),('ET07','Etalase 7','Aksesoris ','0.00','Y',NULL,NULL,NULL,NULL,NULL,NULL),('MT01','Monitor','Monitor CPU','0.00','Y',NULL,NULL,NULL,NULL,NULL,NULL),('NT01','Note Book','Laptop','0.00','Y',NULL,NULL,NULL,NULL,NULL,NULL),('PT01','Printer','Mesin Cetak','0.00','Y',NULL,NULL,NULL,NULL,NULL,NULL),('SPCOM01','SPAREPART KOMPUTER','SPAREPART','0.00','Y',NULL,NULL,NULL,NULL,NULL,NULL),('SPT01','SPAREPART PRINTER','SPAREPART','0.00','Y',NULL,NULL,NULL,NULL,NULL,NULL),('ST01','Smartphone','HP','0.00','Y',NULL,NULL,NULL,NULL,NULL,NULL),('TI01','Tinta Printer','Aksesoris','0.00','Y',NULL,NULL,NULL,NULL,NULL,NULL);

--
-- Table structure for table `tm_gudang`
--

CREATE TABLE `tm_gudang` (
  `KodeGd` varchar(5) NOT NULL default '',
  `NamaGd` varchar(50) default NULL,
  `Keterangan` varchar(100) default NULL,
  `Aktif` varchar(1) default NULL,
  PRIMARY KEY  (`KodeGd`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_gudang`
--

INSERT INTO `tm_gudang` VALUES ('GD1','Gudang Utama','','Y'),('GD2','Gudang Belakang','','Y');

--
-- Table structure for table `tm_mesin`
--

CREATE TABLE `tm_mesin` (
  `KodeMesin` varchar(15) NOT NULL,
  `NamaMesin` varchar(40) default NULL,
  `Tag` varchar(50) default NULL,
  `Keterangan` varchar(100) default NULL,
  PRIMARY KEY  (`KodeMesin`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_mesin`
--


--
-- Table structure for table `tm_produk`
--

CREATE TABLE `tm_produk` (
  `PRODUK_ID` varchar(3) NOT NULL,
  `JNS_PRODUK` varchar(5) default NULL,
  `NAMA` varchar(75) default NULL,
  `NO_AKUN` varchar(20) default NULL,
  `SALDO_MIN` double default NULL,
  `SETOR_MIN` double default NULL,
  `BIAYA_ADM` double default NULL,
  `BIAYA_ADM_NO_AKUN` varchar(20) default NULL,
  `DENDA` double default NULL,
  `DENDA_NO_AKUN` varchar(20) default NULL,
  `BLN_HR_MGGU` varchar(1) default NULL,
  `BUNGA` double default NULL,
  `ADM` double default NULL,
  `BUNGA_NO_AKUN` varchar(20) default NULL,
  `TITIP_BUNGA_NO_AKUN` varchar(20) default NULL,
  `SALDO_KENA_PAJAK` double default NULL,
  `PAJAK` double default NULL,
  `PAJAK_NO_AKUN` varchar(20) default NULL,
  `PINALTY` double default NULL,
  `PINALTY_NO_AKUN` varchar(20) default NULL,
  `JW` int(11) default NULL,
  `PENUTUPAN_NO_AKUN` varchar(20) default NULL,
  PRIMARY KEY  (`PRODUK_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_produk`
--


--
-- Table structure for table `tm_rab_re_pl`
--

CREATE TABLE `tm_rab_re_pl` (
  `Tahun_Pry_RC` varchar(5) default NULL,
  `kode_pry_RC` varchar(10) default NULL,
  `Nama_pry_RC` varchar(60) default NULL,
  `Kode_tb_Rc` varchar(10) default NULL,
  `Nama_tb_Rc` varchar(60) default NULL,
  `kode_brg_Rc` varchar(15) default NULL,
  `Nama_brg_Rc` varchar(80) default NULL,
  `Satuan_rc` varchar(10) default NULL,
  `jml_Rc` double default NULL,
  `HargaSat_b_Rc` double default NULL,
  `HargaSat_j_Rc` double default NULL,
  `Sub_total_Rc` double default NULL,
  `Acc_pry_Rc` varchar(12) default NULL,
  `Tahun_pry_RE` varchar(5) default NULL,
  `Kode_pry_RE` varchar(10) default NULL,
  `Nama_pry_Re` varchar(60) default NULL,
  `Kode_tb_re` varchar(10) default NULL,
  `Nama_tb_re` varchar(60) default NULL,
  `Kode_brg_Re` varchar(15) default NULL,
  `Nama_brg_re` varchar(80) default NULL,
  `Satuan_Re` varchar(10) default NULL,
  `Jml_re` double default NULL,
  `hargaSat_b_Re` double default NULL,
  `HargaSat_j_re` double default NULL,
  `Sub_Total_Re` double default NULL,
  `acc_pry_Re` varchar(12) default NULL,
  `Deviasi` double default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_rab_re_pl`
--


--
-- Table structure for table `tm_rakitan_d`
--

CREATE TABLE `tm_rakitan_d` (
  `KodeRakitan` varchar(20) NOT NULL,
  `ItemRakitan` int(11) NOT NULL,
  `KodeBrg` varchar(20) default NULL,
  `NamaBrg` varchar(50) default NULL,
  `Satuan` varchar(10) default NULL,
  `KodeGd` varchar(5) default NULL,
  `Jml` double default NULL,
  `Harga` double default NULL,
  `Disc` double default NULL,
  PRIMARY KEY  (`KodeRakitan`,`ItemRakitan`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_rakitan_d`
--


--
-- Table structure for table `tm_rakitan_m`
--

CREATE TABLE `tm_rakitan_m` (
  `KodeRakitan` varchar(20) NOT NULL default '',
  `NamaRakitan` varchar(50) default NULL,
  `TglRakitan` datetime default NULL,
  `Keterangan` varchar(100) default NULL,
  `Nilai` double default NULL,
  `Aktif` varchar(1) default NULL,
  PRIMARY KEY  (`KodeRakitan`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_rakitan_m`
--


--
-- Table structure for table `tm_rbp_d`
--

CREATE TABLE `tm_rbp_d` (
  `Kode_rbp` varchar(20) NOT NULL,
  `Itemrbp` int(11) NOT NULL,
  `Kode_ker` varchar(20) default NULL,
  `Jenis_ker` varchar(100) default NULL,
  `Sat` varchar(10) default NULL,
  `volume` float default NULL,
  `Hargasat` double default NULL,
  `subTotal` double default NULL,
  `kode_cetak` varchar(2) default NULL,
  `input` varchar(1) default NULL,
  PRIMARY KEY  (`Kode_rbp`,`Itemrbp`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_rbp_d`
--


--
-- Table structure for table `tm_saldo`
--

CREATE TABLE `tm_saldo` (
  `KodeGol` varchar(20) NOT NULL,
  `NamaGroup` varchar(40) default NULL,
  `SaldoAkhir` double default NULL,
  `Debuging` varchar(100) default NULL,
  PRIMARY KEY  (`KodeGol`),
  CONSTRAINT `tm_saldo_ibfk_1` FOREIGN KEY (`KodeGol`) REFERENCES `tm_golongan` (`KodeGol`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_saldo`
--


--
-- Table structure for table `tm_sales`
--

CREATE TABLE `tm_sales` (
  `KodeSales` varchar(10) NOT NULL default '',
  `NamaSales` varchar(50) default NULL,
  `Keterangan` varchar(100) default NULL,
  `Aktif` varchar(1) default NULL,
  PRIMARY KEY  (`KodeSales`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_sales`
--

INSERT INTO `tm_sales` VALUES ('01','RINA','','Y'),('02','KURNIA','','Y'),('03','MERY','','Y'),('04','NOVI','','Y'),('05','HANDOKO','','Y');

--
-- Table structure for table `tm_satuan`
--

CREATE TABLE `tm_satuan` (
  `satuan` varchar(10) NOT NULL default '',
  PRIMARY KEY  (`satuan`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_satuan`
--


--
-- Table structure for table `tm_service`
--

CREATE TABLE `tm_service` (
  `kodeservice` int(11) NOT NULL auto_increment,
  `namaservice` varchar(15) default NULL,
  `keterangan` varchar(255) default NULL,
  `aktif` varchar(2) default NULL,
  PRIMARY KEY  (`kodeservice`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_service`
--

INSERT INTO `tm_service` VALUES (1,'NoteBook','Laptop Besar','Y'),(2,'Printer','Mesin Cetak','Y'),(3,'Monitor','Layar Monitor','Y'),(4,'CPU','Tabung PC','Y'),(5,'Lain - lain','dan lain lain','Y');

--
-- Table structure for table `tm_setupall`
--

CREATE TABLE `tm_setupall` (
  `setupall_id` int(11) NOT NULL auto_increment,
  `groups` varchar(20) NOT NULL,
  `subgroups` varchar(20) NOT NULL default '',
  `nilainum` float default NULL,
  `nilaitgl` datetime default NULL,
  `nilaichar` varchar(100) default NULL,
  `ketnilai` varchar(255) default NULL,
  `visible` varchar(1) default 'Y',
  PRIMARY KEY  (`setupall_id`,`groups`,`subgroups`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_setupall`
--

INSERT INTO `tm_setupall` VALUES (1,'Masking','KodeBrg',0,NULL,'','Masking kode Barang untuk input kode barang','Y'),(2,'Masking','KodeCust',0,NULL,'','Masking kode Customer untuk input kode Customer','Y'),(3,'Masking','KodeGd',0,NULL,'','Masking kode Gudang untuk input kode Gudang','Y'),(4,'Masking','KodeGol',0,NULL,'','Masking kode Golongan untuk input kode Golongan','Y'),(5,'Masking','KodeSupp',0,NULL,'','Masking kode Supplier untuk input kode Supplier','Y'),(6,'Satuan','Satuan01',0,NULL,'Pcs','','Y'),(7,'Satuan','Satuan04',0,NULL,'Set','','Y'),(8,'Satuan','Satuan02',0,NULL,'Unit','','Y'),(9,'Satuan','Satuan07',0,NULL,'Kg','','Y'),(10,'Satuan','Satuan08',0,NULL,'Kw','Satuan Untuk Master Barang xx','Y'),(11,'Satuan','Satuan06',0,NULL,'Pak','','Y'),(12,'Satuan','Satuan03',0,NULL,'Mtr','','Y'),(13,'Satuan','Satuan05',0,NULL,'Dos','','Y'),(14,'Satuan','Satuan09',0,NULL,'Ton','','Y'),(15,'Satuan','Satuan10',0,NULL,'Botol',NULL,'Y'),(16,'Satuan','Satuan11',NULL,NULL,'Bks',NULL,'Y'),(17,'Satuan','Satuan12',NULL,NULL,'Gr',NULL,'Y'),(18,'Satuan','Satuan13',NULL,NULL,'Ml',NULL,'Y'),(25,'JenisBrg','JenisBrg1',0,NULL,'Inventory',NULL,'Y'),(26,'JenisBrg','JenisBrg2',0,NULL,'Non Inv',NULL,'Y'),(27,'JenisBrg','JenisBrg3',0,NULL,'Service',NULL,'Y'),(35,'Trans Beli','TrBeli1',0,NULL,'BT','No Bukti Pembelian','Y'),(37,'Trans Jual Retail','TrJualR1',0,NULL,'JR','No Bukti Penjualan Retail','Y'),(38,'Trans Jual Grosir','TrJual1',0,NULL,'JT','No Bukti Penjualan Grosir','Y'),(39,'Trans Jual Rakitan','TrJualRakitan1',0,NULL,'JK','No Bukti Penjualan Rakitan','Y'),(42,'Trans Retur Beli','TrReturBeli1',0,NULL,'RB','No Bukti Retur Pembelian','Y'),(43,'Trans Retur Jual','TrReturJual1',0,NULL,'RJ','No Bukti Retur Penjualan Grosir','Y'),(44,'Trans Retur Jual R','TrReturJualR1',NULL,NULL,'RR','No Bukti Retur Penjualan Retail','Y'),(45,'Trans Retur Jual Rkt','TrReturJualRakitan1',NULL,NULL,'RK','No Bukti Retur Penjualan Rakitan','Y'),(46,'Trans Bayar Beli','TrBayarBeli1',0,NULL,'YB','No Bukti Pembayaran Pembelian','Y'),(47,'Trans Bayar Jual','TrBayarJual1',0,NULL,'YJ','No Bukti Pembayaran Penjualan Grosir','Y'),(48,'Trans Bayar Jual Rkt','TrBayarJualRakitan1',0,NULL,'YK','No Bukti Pembayaran Penjualan Rakitan','Y'),(49,'Trans SO','TrSO1',0,NULL,'PJ','No Bukti Sales Order','Y'),(50,'Trans SO Rakitan','TrSORakitan1',NULL,NULL,'PK','No Bukti Sales Order Rakitan','Y'),(51,'Trans PO','TrPo1',NULL,NULL,'PO','No Bukti Purchase Order','Y'),(54,'Valas','Valas1',1,NULL,'IDR','Indonesian Rupiah','Y'),(55,'Valas','Valas2',3000,NULL,'SGD','Singapore Dolar','Y'),(56,'Valas','Valas3',8000,NULL,'USD','US Dolar','Y'),(60,'Nomor','BT',1,NULL,'15000035','Nomor Transaksi Pembelian; Jika Nilai Num  0 atau 1 format no sbb : yyxxxxxxR01;  untuk 2  :  yymmxxxxR01;  untuk 3 : yymmddxxxR1 -->  Nilai Char Diisi Angka (xx artinya angka 0-9)  ','Y'),(61,'Nomor','JT',3,NULL,'211213001','Nomor Transaksi Penjualan; Jika Nilai Num  0 atau 1 format no sbb : yyxxxxxxR01;  untuk 2  :  yymmxxxxR01;  untuk 3 : yymmddxxxR1 -->  Nilai Char Diisi Angka (xx artinya angka 0-9)  ','Y'),(62,'Nomor','YB',1,NULL,'15000001','Nomor Transaksi Pembayaran Pembelian; Jika Nilai Num  0 atau 1 format no sbb : yyxxxxxxR01;  untuk 2  :  yymmxxxxR01;  untuk 3 : yymmddxxxR1 -->  Nilai Char Diisi Angka (xx artinya angka 0-9)  ','Y'),(63,'Nomor','YJ',1,NULL,'12000058','Nomor Transaksi Pembayaran Penjualan; Jika Nilai Num  0 atau 1 format no sbb : yyxxxxxxR01;  untuk 2  :  yymmxxxxR01;  untuk 3 : yymmddxxxR1 -->  Nilai Char Diisi Angka (xx artinya angka 0-9)  ','Y'),(64,'Nomor','RB',1,NULL,'15000003','Nomor Transaksi Retur Pembelian; Jika Nilai Num  0 atau 1 format no sbb : yyxxxxxxR01;  untuk 2  :  yymmxxxxR01;  untuk 3 : yymmddxxxR1 -->  Nilai Char Diisi Angka (xx artinya angka 0-9)  ','Y'),(65,'Nomor','RJ',1,NULL,'21000001','Nomor Transaksi Retur Penjualan; Jika Nilai Num  0 atau 1 format no sbb : yyxxxxxxR01;  untuk 2  :  yymmxxxxR01;  untuk 3 : yymmddxxxR1 -->  Nilai Char Diisi Angka (xx artinya angka 0-9)  ','Y'),(67,'Nomor','PJ',2,NULL,'12020001','Nomor Transaksi PO Penjualan (Sales Order); Jika Nilai Num  0 atau 1 format no sbb : yyxxxxxxR01;  untuk 2  :  yymmxxxxR01;  untuk 3 : yymmddxxxR1 -->  Nilai Char Diisi Angka (xx artinya angka 0-9)  ','Y'),(68,'Nomor','PK',2,NULL,'07090005','Nomor Transaksi PO Penjualan Rakitan (Sales Order Rakitan); Jika Nilai Num  0 atau 1 format no sbb : yyxxxxxxR01;  untuk 2  :  yymmxxxxR01;  untuk 3 : yymmddxxxR1 -->  Nilai Char Diisi Angka (xx artinya angka 0-9)  ','Y'),(69,'Nomor','JR',3,NULL,'220419002','Nomor Transaksi Penjualan Retail; Jika Nilai Num  0 atau 1 format no sbb : yyxxxxxxR01;  untuk 2  :  yymmxxxxR01;  untuk 3 : yymmddxxxR1 -->  Nilai Char Diisi Angka (xx artinya angka 0-9)  ','Y'),(70,'Nomor','JK',3,NULL,'120119001','Nomor Transaksi Penjualan Rakitan; Jika Nilai Num  0 atau 1 format no sbb : yyxxxxxxR01;  untuk 2  :  yymmxxxxR01;  untuk 3 : yymmddxxxR1 -->  Nilai Char Diisi Angka (xx artinya angka 0-9)  ','Y'),(71,'Nomor','RK',3,NULL,'110819001','Nomor Transaksi Retur Penjualan Rakitan; Jika Nilai Num  0 atau 1 format no sbb : yyxxxxxxR01;  untuk 2  :  yymmxxxxR01;  untuk 3 : yymmddxxxR1 -->  Nilai Char Diisi Angka (xx artinya angka 0-9)  ','Y'),(72,'Nomor','PG',1,NULL,'15000003','Nomor Transaksi Pindah Gudang; Jika Nilai Num  0 atau 1 format no sbb : yyxxxxxxR01;  untuk 2  :  yymmxxxxR01;  untuk 3 : yymmddxxxR1 -->  Nilai Char Diisi Angka (xx artinya angka 0-9)  ','Y'),(73,'Nomor','BR',1,NULL,'11000085','Nomor Transaksi Barang Rusak per Gudang; Jika Nilai Num  0 atau 1 format no sbb : yyxxxxxxR01;  untuk 2  :  yymmxxxxR01;  untuk 3 : yymmddxxxR1 -->  Nilai Char Diisi Angka (xx artinya angka 0-9)  ','Y'),(74,'Nomor','CL',3,NULL,'150606001','Nomor Transaksi Untuk Closing; Jika Nilai Num  0 atau 1 format no sbb : yyxxxxxxR01;  untuk 2  :  yymmxxxxR01;  untuk 3 : yymmddxxxR1 -->  Nilai Char Diisi Angka (xx artinya angka 0-9)  ','Y'),(75,'Nomor','PO',2,NULL,'15050004','Nomor Transaksi Untuk Purchase Order; Jika Nilai Num  0 atau 1 format no sbb : yyxxxxxxR01;  untuk 2  :  yymmxxxxR01;  untuk 3 : yymmddxxxR1 -->  Nilai Char Diisi Angka (xx artinya angka 0-9)  ','Y'),(80,'Kode Bayar Beli','KodeByr1',0,NULL,'CASH','Tunai','Y'),(81,'Kode Bayar Beli','KodeByr2',0,NULL,'BG','Bilyet Giro','Y'),(83,'Kode Bayar Beli','KodeByr3',0,NULL,'TRANSFER','Transfer Via Bank','Y'),(85,'Default List Filter','ListBeli',0,NULL,'Tahun','Diisi : Semua,Tahun,Bulan,Tanggal','Y'),(86,'Default List Filter','ListBayarBeli',0,NULL,'Tahun','Diisi : Semua, Tahun, Bulan, Tanggal','Y'),(87,'Default List Filter','ListReturBeli',0,NULL,'Tahun','Diisi : Semua, Tahun, Bulan, Tanggal','Y'),(88,'Default List Filter','ListSO',0,NULL,'Tahun','Diisi : Semua, Tahun, Bulan, Tanggal','Y'),(89,'Default List Filter','ListSORakitan',0,NULL,'Tahun','Diisi : Semua, Tahun, Bulan, Tanggal','Y'),(90,'Default List Filter','ListJualRetail',0,NULL,'Tanggal','Diisi : Semua, Tahun, Bulan, Tanggal','Y'),(91,'Default List Filter','ListJualGrosir',0,NULL,'Tahun','Diisi : Semua, Tahun, Bulan, Tanggal','Y'),(92,'Default List Filter','ListJualRakitan',0,NULL,'Semua','Diisi : Semua, Tahun, Bulan, Tanggal','Y'),(93,'Default List Filter','ListMasterRakitan',0,NULL,'Semua','Diisi : Semua, Tahun, Bulan, Tanggal','Y'),(94,'Default List Filter','ListBayarJual',0,NULL,'Semua','Diisi : Semua, Tahun, Bulan, Tanggal','Y'),(95,'Default List Filter','ListMutasiGudang',0,NULL,'Tahun','Diisi : Semua, Tahun, Bulan, Tanggal','Y'),(96,'Default List Filter','ListBarangRusak',0,NULL,'Tahun','Diisi : Semua, Tahun, Bulan, Tanggal','Y'),(100,'Masking','KodeSales',0,NULL,'','Masking Master Sales untuk input Kode Sales','Y'),(101,'Masking','KodeRakitan',0,NULL,'','Masking Master Rakitan untuk input Kode Rakitan','Y'),(120,'Set Harga Penjualan','SalesOrder',0,NULL,'HargaGrosir','Digunakan Untuk Set Radio Button;  Diisi : HargaGrosir, HargaRetail','Y'),(121,'Set Harga Penjualan','SalesOrderRakitan',0,NULL,'HargaGrosir','Digunakan Untuk Set Radio Button;  Diisi : HargaGrosir, HargaRetail','Y'),(122,'Set Harga Penjualan','PenjualanRetail',0,NULL,'HargaRetail','Digunakan Untuk Set Radio Button;  Diisi : HargaRetail, HargaGrosir','Y'),(123,'Set Harga Penjualan','PenjualanGrosir',0,NULL,'HargaGrosir','Digunakan Untuk Set Radio Button;  Diisi : HargaGrosir, HargaRetail','Y'),(124,'Set Harga Penjualan','MasterRakitan',0,NULL,'HargaGrosir','Digunakan Untuk Set Radio Button;  Diisi : HargaGrosir, HargaRetail','Y'),(125,'Set Harga Penjualan','PenjualanRakitan',0,NULL,'HargaGrosir','Digunakan Untuk Set Radio Button;  Diisi : HargaGrosir, HargaRetail','Y'),(131,'Set Cetak Struk','MarginAtas',-3,NULL,'','Digunakan Untuk Set Jarak Spasi, Atas Kertas Ke Heder;  Diisi : 0 s/d 5\r\n','Y'),(132,'Set Cetak Struk','MarginKiri',1,NULL,'','Digunakan Untuk Set Jarak Spasi, Kiri Kertas Ke Heder dan Detil;  Diisi :0 s/d 10','Y'),(133,'Set Cetak Struk','SpasiHederKeDetail',1,NULL,'','Digunakan Untuk Set Jarak Spasi, Heder ke Detil;  Diisi : 0 s/d 5','Y'),(134,'Set Cetak Struk','MaxBaris',100,NULL,'','Digunakan Untuk Set Max Baris Cetak Struk; Minimal = 11  + ColumnHeder(2) + nDetil Data (>= 1) +  MarginAtas + SpasiHederKeDetail (1)+ MarginBawah; Diisi : 15 s/d 50','Y'),(135,'Set Cetak Struk','KeteranganFooter1',0,'2013-09-01 00:00:00','PROMO big cola 1 slop','Digunakan Untuk Set Catatan Footer;  Diisi : Lebih MURAH, ngapain ke yg lain *','Y'),(136,'Set Cetak Struk','GantiKertas',0,NULL,'N','Digunakan Untuk Set Ganti Kertas (Eject) atau Tidak  Bila Sudah Max Baris; Eject Merupakan Prioritas 1 bila diisi N baru digunakan MarginBawah dan CetakSampaiMaxBaris; Diisi : Y atau N','Y'),(137,'Set Cetak Struk','CetakSampaiMaxBaris',0,NULL,'N','Digunakan Untuk Set Cetak Blank, Bila Belum Max Baris;  Aktif bila GantiKertas diisi N; Diisi : Y atau N','Y'),(138,'Set Cetak Struk','KeteranganFooter2',0,NULL,'Hanya Rp.28500 stok terbatas ','Digunakan Untuk Set Catatan Footer;  Diisi : * Barang yg dibeli tidak dapat ditukar kembali *','Y'),(139,'Set Cetak Struk','MarginBawah',5,NULL,'','Digunakan Untuk Set Jarak Spasi, Bawah Kertas Ke Footer; Aktif bila GantiKertas diisi N;  Diisi : 0 s/d 3','Y'),(150,'Set Cetak Invoice','MarginBawah',2,NULL,'','Digunakan Untuk Set Jarak Spasi, Bawah Kertas Ke Footer; Aktif bila GantiKertas diisi N;  Diisi : 0 s/d 3','Y'),(151,'Set Cetak Invoice','MarginAtas',0,NULL,'','Digunakan Untuk Set Jarak Spasi, Atas Kertas Ke Heder;  Diisi : 0 s/d 5\r\n','Y'),(152,'Set Cetak Invoice','MarginKiri',5,NULL,'','Digunakan Untuk Set Jarak Spasi, Kiri Kertas Ke Heder dan Detil;  Diisi :0 s/d 10','Y'),(153,'Set Cetak Invoice','MaxBaris',32,NULL,'','Digunakan Untuk Set Max Baris Cetak Invoice Unutk Penjualan Grosir; Minimal = 20  + ColumnHeder(2) + nDetil Data (>= 8) +  MarginAtas + SpasiHederKeDetail (1)+ MarginBawah(1); Diisi : 32 s/d 64','Y'),(154,'Set Cetak Invoice','MaxBarisRakitan',32,NULL,'','Digunakan Untuk Set Max Baris Cetak Invoice untuk Penjualan Rakitan; Minimal = 18  + ColumnHeder(2) + nDetil Data (>= 1) +  MarginAtas + SpasiHederKeDetail (1)+ MarginBawah; Diisi : 22 s/d 50','Y'),(155,'Set Cetak Invoice','SpasiHederKeDetail',0.5,NULL,'','Digunakan Untuk Set Jarak Spasi, Heder ke Detil;  Diisi : 0 s/d 5','Y'),(156,'Set Cetak Invoice','MarginBwhDipindahkan',0,NULL,'','Digunakan Untuk Set Jarak Spasi Dipindahkan, Bawah kertas ke Detil data Untuk detil data yang banyak yang ngak cukup untuk 1 Lembar;  Diisi : 0 s/d 5','Y'),(157,'Set Cetak Invoice','MarginAtasPemindahan',0,NULL,'','Digunakan Untuk Set Jarak Spasi Pemindahan, Atas Kertas ke Heder Untuk detil data yang banyak yang ngak cukup untuk 1 Lembar;  Diisi : 0 s/d 5','Y'),(175,'Set Cetak Invoice','GantiKertas',0,NULL,'N','Digunakan Untuk Set Ganti Kertas (Eject) atau Tidak  Bila Sudah Max Baris; Prioritas 1 bila diisi N baru digunakan MarginBawah dan CetakSampaiMaxBaris; Diisi : Y atau N','Y'),(176,'Set Cetak Invoice','CetakSampaiMaxBaris',0,NULL,'Y','Digunakan Untuk Set Cetak Blank, Bila Belum Max Baris;  Aktif bila GantiKertas diisi N; Diisi : Y atau N','Y'),(177,'Set Cetak Invoice','KeteranganFooter1',0,NULL,'* Terima Kasih Atas Kunjungan Anda *','Digunakan Untuk Set Catatan Footer;  Diisi : * Terima Kasih Atas Kunjungan Anda *','Y'),(179,'Set Cetak Invoice','KeteranganFooter2',0,NULL,'* Barang yg dibeli tidak dapat ditukar/dikembalikan tanpa ada perjanjian *','Digunakan Untuk Set Catatan Footer;  Diisi : * Barang yg dibeli tidak dapat ditukar kembali *','Y'),(180,'Set Cetak Invoice','NamaCustLunas',0,NULL,'CASH','Digunakan Untuk Mengisi Nama Customer Di Format Cetak, Bila Pembayaran Sudah Lunas dan Namacust Blank, Diganti Dengan Default CASH','Y'),(190,'Set Cetak SalesOrder','MarginBawah',2,NULL,'','Digunakan Untuk Set Jarak Spasi, Bawah Kertas Ke Footer; Aktif bila GantiKertas diisi N;  Diisi : 0 s/d 3','Y'),(191,'Set Cetak SalesOrder','MarginAtas',0,NULL,'','Digunakan Untuk Set Jarak Spasi, Atas Kertas Ke Heder;  Diisi : 0 s/d 5\r\n','Y'),(192,'Set Cetak SalesOrder','MarginKiri',5,NULL,'','Digunakan Untuk Set Jarak Spasi, Kiri Kertas Ke Heder dan Detil;  Diisi :0 s/d 10','Y'),(193,'Set Cetak SalesOrder','MaxBaris',32,NULL,'','Digunakan Untuk Set Max Baris Cetak SalesOrder Unutk Penjualan Grosir; Minimal = 20  + ColumnHeder(2) + nDetil Data (>= 8) +  MarginAtas + SpasiHederKeDetail (1)+ MarginBawah(1); Diisi : 32 s/d 64','Y'),(194,'Set Cetak SalesOrder','MaxBarisRakitan',32,NULL,'','Digunakan Untuk Set Max Baris Cetak SalesOrder untuk Penjualan Rakitan; Minimal = 18  + ColumnHeder(2) + nDetil Data (>= 1) +  MarginAtas + SpasiHederKeDetail (1)+ MarginBawah; Diisi : 22 s/d 50','Y'),(195,'Set Cetak SalesOrder','SpasiHederKeDetail',0.5,NULL,'','Digunakan Untuk Set Jarak Spasi, Heder ke Detil;  Diisi : 0 s/d 5','Y'),(196,'Set Cetak SalesOrder','MarginBwhDipindahkan',0,NULL,'','Digunakan Untuk Set Jarak Spasi Dipindahkan, Bawah kertas ke Detil data Untuk detil data yang banyak yang ngak cukup untuk 1 Lembar;  Diisi : 0 s/d 5','Y'),(197,'Set Cetak SalesOrder','MarginAtasPemindahan',0,NULL,'','Digunakan Untuk Set Jarak Spasi Pemindahan, Atas Kertas ke Heder Untuk detil data yang banyak yang ngak cukup untuk 1 Lembar;  Diisi : 0 s/d 5','Y'),(200,'Set Cetak SalesOrder','GantiKertas',0,NULL,'N','Digunakan Untuk Set Ganti Kertas (Eject) atau Tidak  Bila Sudah Max Baris; Prioritas 1 bila diisi N baru digunakan MarginBawah dan CetakSampaiMaxBaris; Diisi : Y atau N','Y'),(201,'Set Cetak SalesOrder','CetakSampaiMaxBaris',0,NULL,'Y','Digunakan Untuk Set Cetak Blank, Bila Belum Max Baris;  Aktif bila GantiKertas diisi N; Diisi : Y atau N','Y'),(202,'Set Cetak SalesOrder','KeteranganFooter1',0,NULL,'* Kami Tidak Menerima Pembayaran berupa Cheque/BG *','Digunakan Untuk Set Catatan Footer;  Diisi : * Terima Kasih Atas Kunjungan Anda *','Y'),(203,'Set Cetak SalesOrder','KeteranganFooter2',0,NULL,'* Barang yg dibeli tidak dapat ditukar/dikembalikan tanpa ada perjanjian *','Digunakan Untuk Set Catatan Footer;  Diisi : * Barang yg dibeli tidak dapat ditukar kembali *','Y'),(204,'Set Cetak SalesOrder','NamaCustLunas',0,NULL,'CASH','Digunakan Untuk Mengisi Nama Customer Di Format Cetak, Bila Pembayaran Sudah Lunas dan Namacust Blank, Diganti Dengan Default CASH','Y'),(210,'Set Cetak Closing','MarginAtas',0,NULL,'','Digunakan Untuk Set Jarak Spasi, Atas Kertas Ke Heder;  Diisi : 0 s/d 5\r\n','Y'),(211,'Set Cetak Closing','MarginKiri',5,NULL,'','Digunakan Untuk Set Jarak Spasi, Kiri Kertas Ke Heder dan Detil;  Diisi :0 s/d 10','Y'),(212,'Set Cetak Closing','SpasiHederKeDetail',0.5,NULL,'','Digunakan Untuk Set Jarak Spasi, Heder ke Detil;  Diisi : 0 s/d 5','Y'),(213,'Set Cetak Closing','MaxBaris',24,NULL,'','Digunakan Untuk Set Max Baris Cetak Struk; Minimal = 11  + ColumnHeder(2) + nDetil Data (>= 1) +  MarginAtas + SpasiHederKeDetail (1)+ MarginBawah; Diisi : 15 s/d 50','Y'),(214,'Set Cetak Closing','GantiKertas',0,NULL,'N','Digunakan Untuk Set Ganti Kertas (Eject) atau Tidak  Bila Sudah Max Baris; Eject Merupakan Prioritas 1 bila diisi N baru digunakan MarginBawah dan CetakSampaiMaxBaris; Diisi : Y atau N','Y'),(215,'Set Cetak Closing','CetakSampaiMaxBaris',0,NULL,'N','Digunakan Untuk Set Cetak Blank, Bila Belum Max Baris;  Aktif bila GantiKertas diisi N; Diisi : Y atau N','Y'),(216,'Set Cetak Closing','KeteranganFooter2',0,NULL,'* Barang yg dibeli tidak dapat ditukar kembali *','Digunakan Untuk Set Catatan Footer;  Diisi : * Barang yg dibeli tidak dapat ditukar kembali *','Y'),(217,'Set Cetak Closing','MarginBawah',10,NULL,'','Digunakan Untuk Set Jarak Spasi, Bawah Kertas Ke Footer; Aktif bila GantiKertas diisi N;  Diisi : 0 s/d 3','Y'),(218,'Set Cetak Closing','MaxChar',42,NULL,'','Digunakan Untuk Jumlah Karakter, Kiri ke kanan;  Diisi : 40 s/d 50','Y'),(219,'Set Cetak Closing','MarginKanan',0,NULL,'','Digunakan Untuk Set Jarak Spasi, Kanan Kertas Ke Heder dan Detil;  Diisi :0 s/d 10','Y'),(245,'Penjualan Retail','FormatCetak',0,NULL,'Struk','Digunakan Untuk Set Format Cetakan Penjualan Retail; Diisi: Struk, Invoice','Y'),(246,'Penjualan Retail','ModeCetak',0,NULL,'Cetak','Digunakan Untuk Set Mode Cetak Penjualan Retail;  Diisi : Cetak, Lihat atau \'\' (bila tidak ingin dicetak atau dilihat)','Y'),(247,'Penjualan Grosir','FormatCetak',0,NULL,'Invoice','Digunakan Untuk Set Format Cetakan Penjualan Grosir; Diisi: Struk, Invoice','Y'),(248,'Penjualan Grosir','ModeCetak',0,NULL,'Cetak','Digunakan Untuk Set Mode Cetak Penjualan Grosir;  Diisi : Cetak, Lihat atau \'\' (bila tidak ingin dicetak atau dilihat)','Y'),(249,'Penjualan Rakitan','FormatCetak',0,NULL,'Invoice','Digunakan Untuk Set Format Cetakan Penjualan Rakitan; Diisi: Struk, Invoice','Y'),(250,'Penjualan Rakitan','ModeCetak',0,NULL,'Cetak','Digunakan Untuk Set Mode Cetak Penjualan Rakitan;  Diisi : Cetak, Lihat atau \'\' (bila tidak ingin dicetak atau dilihat)','Y'),(251,'Penjualan Retail','JmlBrsCetakGrafik',17,NULL,'','Digunakan Untuk Set Jumlah Baris Cetak Invoce Mode Grafik; Diisi 17 untuk panjang kertas 5,5 Inch (Setengah Kertas Letter)','Y'),(252,'Penjualan Grosir','JmlBrsCetakGrafik',17,NULL,'','Digunakan Untuk Set Jumlah Baris Cetak Invoce Mode Grafik; Diisi 17 untuk panjang kertas 5,5 Inch (Setengah Kertas Letter)','Y'),(253,'Penjualan Rakitan','JmlBrsCetakGrafik',17,NULL,'','Digunakan Untuk Set Jumlah Baris Cetak Invoce Mode Grafik; Diisi 17 untuk panjang kertas 5,5 Inch (Setengah Kertas Letter)','Y'),(255,'Sales Order Grosir','ModeCetak',NULL,NULL,'Cetak','Digunakan Untuk Set Mode Cetak Sales Order Grosir;  Diisi : Cetak, Lihat atau \'\' (bila tidak ingin dicetak atau dilihat)',NULL),(258,'Sales Order Rakitan','ModeCetak',0,NULL,'Lihat','Digunakan Untuk Set Mode Cetak Sales Order Rakitan;  Diisi : Cetak, Lihat atau \'\' (bila tidak ingin dicetak atau dilihat)',NULL),(300,'Masking','NoPol',0,NULL,'!!*4{1,2,3,4,5,6,7,8,9,0}','Masking No Polisi Kendaraan di input Penjualan Grosir; !!*4{1,2,3,4,5,6,7,8,9,0} contoh \'AE1234\'','Y'),(400,'Kode Bayar Jual','KodeByr1',0,NULL,'CASH','Tunai','Y'),(401,'Kode Bayar Jual','KodeByr2',0,NULL,'BG','Bilyet Giro','Y'),(402,'Kode Bayar Jual','KodeByr3',0,NULL,'TRANSFERbcaTHP','Transfer Via Bank','Y'),(500,'Kota Customer','Kota1',0,NULL,'MOJOKERTO','Digunakan Untuk Daftar Kota Pada Saat Input Master Customer','Y'),(501,'Kota Customer','Kota2',0,NULL,'MOJOSARI','Digunakan Untuk Daftar Kota Pada Saat Input Master Customer','Y'),(502,'Kota Customer','Kota3',0,NULL,'JOMBANG','Digunakan Untuk Daftar Kota Pada Saat Input Master Customer','Y'),(550,'Kota Supplier','Kota1',0,NULL,'MOJOKERTO','Digunakan Untuk Daftar Kota Pada Saat Input Master Supplier','Y'),(551,'Kota Supplier','Kota2',0,NULL,'SURABAYA','Digunakan Untuk Daftar Kota Pada Saat Input Master Supplier','Y'),(600,'Default List Order','ListJurnal',0,NULL,'No_bukti','Diisi Tanggal,No_bukti,Keterangan','Y'),(601,'Default List Order','ListBarang',0,NULL,'NamaBrg','Diisi KodeBrg,NamaBrg,NamaGol,NamaSupp','Y'),(602,'Default List Order','ListCustomer',0,NULL,'NamaCust','Diisi KodeCust,NamaCust,Alamat,Kota','Y'),(603,'Default List Order','ListSupplier',NULL,NULL,'NamaSupp','Diisi KodeSupp,NamaSupp,Alamat,Kota','Y'),(604,'Default List Order','ListGroupBarang',NULL,NULL,'NamaGol','Diisi KodeGol,NamaGol,Keterangan','Y'),(605,'Default List Order','ListGudang',NULL,NULL,'NamaGd','Diisi KodeGd,NamaGd,Keterangan','Y'),(700,'SuppType','SuppType1',0,NULL,'PPN','','Y'),(701,'SuppType','SuppType2',0,NULL,'NON PPN','','Y'),(710,'CustType','CustType1',NULL,NULL,'Lokal',NULL,'Y'),(711,'CustType','CustType2',NULL,NULL,'Luar Kota',NULL,'Y'),(790,'Template','LapCustomer',0,NULL,'Report','LapCustomer.rtm','Y'),(791,'Template','LapCustomerSummary',0,NULL,'Report','LapCustomerSummary.rtm','Y'),(793,'Template','LapSupplier',0,NULL,'Report','LapSupplier.rtm','Y'),(794,'Template','LapSupplierSummary',0,NULL,'Report','LapSupplierSummary.rtm','Y'),(796,'Template','LapMutasiGudang',0,NULL,'Report','LapMutasiGudang.rtm','Y'),(800,'Template','LapPosisiHutang',0,NULL,'Report','LapPosisiHutang.rtm','Y'),(801,'Template','LapKartuHutang',0,NULL,'Report','LapKartuHutang.rtm','Y'),(802,'Template','LapUmurHutang',0,NULL,'Report','LapUmurHutang.rtm','Y'),(803,'Template','LapHutangJt',0,NULL,'Report','LapHutangJt.rtm','Y'),(804,'Template','LapPiutangJt',0,NULL,'Report','LapPiutangJt.rtm','Y'),(805,'Template','LapPosisiPiutang',0,NULL,'Report','LapPosisiPiutang.rtm','Y'),(806,'Template','LapKartuPiutang',0,NULL,'Report','LapKartuPiutang.rtm','Y'),(807,'Template','LapUmurPiutang',0,NULL,'Report','LapUmurPiutang.rtm','Y'),(810,'Template','LapPosisiStock',0,NULL,'Report','LapPosisiStock.rtm','Y'),(811,'Template','LapPosisiStockNilai',0,NULL,'Report','LapPosisiStockNilai.rtm','Y'),(812,'Template','LapMinMaxStock',0,NULL,'Report','LapMinMaxStock.rtm','Y'),(813,'Template','LapKartuStock',0,NULL,'Report','LapKartuStock.rtm','Y'),(820,'Template','LapPembelianSummary',0,NULL,'Report','LapPembelianSummary.rtm','Y'),(821,'Template','LapPembelianDetail',0,NULL,'Report','LapPembelianDetail.rtm','Y'),(823,'Template','LapReturBeliSummary',0,NULL,'Report','LapReturPembelianSummary.rtm','Y'),(824,'Template','LapReturBeliDetail',0,NULL,'Report','LapReturPembelianDetail.rtm','Y'),(826,'Template','LapBayarBeliNota',0,NULL,'Report','LapPembayaranPembelianNota.rtm','Y'),(827,'Template','LapBayarBeliBayar',0,NULL,'Report','LapPembayaranPembelianBayar.rtm','Y'),(840,'Template','LapPoJualSummary',0,NULL,'Report','LapPoJualSummary.rtm','Y'),(842,'Template','LapSODetail',0,NULL,'Report','LapSODetail.rtm','Y'),(865,'Template','LapAnalisaJualSum',0,NULL,'Report','LapAnalisaPenjualanSummary.rtm','Y'),(866,'Template','LapAnalisaJualDtl',0,NULL,'Report','LapAnalisaPenjualanDetail.rtm','Y'),(871,'Template','LapAnalisaPenjualan',0,NULL,'Report','LapAnalisaPenjualan.rtm','Y'),(872,'Template','LapInvoiceRetail',0,NULL,'Report','LapInvoiceRetail.rtm','Y'),(873,'Template','LapInvoiceGrosir',0,NULL,'Report','LapInvoiceGrosir.rtm','Y'),(874,'Template','LapInvoiceRakitan',0,NULL,'Report','LapInvoiceRakitan.rtm','Y'),(875,'Template','LapRetJualRetailDtl',0,NULL,'Report','LapReturPenjualanRetailDetail.rtm','Y'),(876,'Template','LapRetJualRetailSum',0,NULL,'Report','LapReturPenjualanRetailSummary.rtm','Y'),(877,'Template','LapRetJualGrosirDtl',0,NULL,'Report','LapReturPenjualanGrosirDetail.rtm','Y'),(878,'Template','LapRetJualGrosirSum',0,NULL,'Report','LapReturPenjualanGrosirSummary.rtm','Y'),(879,'Template','LapRetJualRktDtl',0,NULL,'Report','LapReturPenjualanRakitanDetail.rtm','Y'),(880,'Template','MasterBarang',0,NULL,'Report','MasterBarang.rtm','Y'),(881,'Template','MasterBarangPersen',0,NULL,'Report','MasterBarangPersen.rtm','Y'),(882,'Template','LapPenjRetailSummary',0,NULL,'Report','LapPenjualanRetailSummary.rtm','Y'),(883,'Template','LapPenjRetailDetail',0,NULL,'Report','LapPenjualanRetailDetail.rtm','Y'),(884,'Template','LapPenjGrosirSummary',0,NULL,'Report','LapPenjualanGrosirSummary.rtm','Y'),(885,'Template','LapPenjGrosirDetail',0,NULL,'Report','LapPenjualanGrosirDetail.rtm','Y'),(886,'Template','LapPenjRakitanSumm',0,NULL,'Report','LapPenjualanRakitanSummary.rtm','Y'),(887,'Template','LapPenjRakitanDtl',0,NULL,'Report','LapPenjualanRakitanDetail.rtm','Y'),(888,'Template','PersediaanAwal',0,NULL,'Report','PersediaanAwal.rtm','Y'),(889,'Template','OpnameAwal',0,NULL,'Report','OpnameAwal.rtm','Y'),(890,'Template','LapPriceList',0,NULL,'Report','LapPriceList.rtm','Y'),(897,'Template','LapSuratJalan',0,NULL,'Report','LapSuratJalan.rtm','Y'),(898,'Template','NotaReturBeli',0,NULL,'Report','NotaReturBeli.rtm','Y'),(950,'UmurHut','1',-14,NULL,NULL,NULL,NULL),(951,'UmurHut','2',-7,NULL,NULL,NULL,NULL),(952,'UmurHut','3',0,NULL,NULL,NULL,NULL),(953,'UmurHut','4',8,NULL,NULL,NULL,NULL),(954,'UmurHut','5',15,NULL,NULL,NULL,NULL),(956,'UmurPiut','1',-14,NULL,NULL,NULL,NULL),(957,'UmurPiut','2',-7,NULL,NULL,NULL,NULL),(958,'UmurPiut','3',0,NULL,NULL,NULL,NULL),(959,'UmurPiut','4',8,NULL,NULL,NULL,NULL),(960,'UmurPiut','5',15,NULL,NULL,NULL,NULL),(971,'AutoJurnal','Hpp',0,NULL,'511001','Kode Perkiraan Jurnal Untuk Harga Pokok Penjualan','Y'),(972,'AutoJurnal','PendapatanPenjualan',0,NULL,'411001','Kode Perkiraan Jurnal Untuk Pendapatan Penjualan','Y'),(973,'AutoJurnal','ReturPenjualan',0,NULL,'411002\r\n411002\r\n411002','Kode Perkiraan Jurnal Untuk Retur Penjualan','Y'),(974,'AutoJurnal','MasterSupplier',0,NULL,'211001','Kode Perkiraan Awal Untuk Master Supplier','Y'),(975,'AutoJurnal','MasterCustomer',0,NULL,'112011','Kode Perkiraan Awal Untuk Master Customer','Y'),(976,'AutoJurnal','PendapatanDiskon',0,NULL,'411003','Kode Perkiraan Jurnal Untuk Pendapatan Diskon','Y'),(977,'AutoJurnal','Kas',0,NULL,'111001','Kode Perkiraan Jurnal Untuk Kas','Y'),(978,'AutoJurnal','PersediaanBarang',NULL,NULL,'113001','Kode Perkiraan Jurnal Untuk Persediaan Barang','Y'),(979,'AutoJurnal','BebanBarangRusak',NULL,NULL,'521009','Kode Perkiraan Jurnal Untuk Beban Atas Kerusakan Barang','Y'),(980,'Set Cetak Struk','MaxChar',40,NULL,'','Digunakan Untuk Set Banyaknya Karakter, Kiri Kertas Ke Kanan;  Diisi :40 s/d 50','Y'),(982,'Set Cetak Struk','MarginKanan',0,NULL,'','Digunakan Untuk Set Jarak Spasi, Kanan Kertas Ke Heder dan Detil;  Diisi :0 s/d 10','Y'),(983,'Kota Supplier','Kota3',0,NULL,'MADIUN','Digunakan Untuk Daftar Kota Pada Saat Input Master Supplier','Y'),(984,'Kota Supplier','Kota4',0,NULL,'PONOROGO','Digunakan Untuk Daftar Kota Pada Saat Input Master Supplier','Y'),(1000,'JnsPenjualan','Penjualan Pribadi',3,NULL,'KOP','Jenis Penjualan Koperasi','Y'),(1001,'JnsPenjualan','Penjualan Koperasi',2,NULL,'OB','Jenis Penjualan Pribadi','Y'),(1002,'Set Cetak Price List','MaxBaris',85,NULL,NULL,NULL,'Y'),(1003,'Kode Bayar Beli','KodeByr4',0,NULL,'AUTO DEBET',NULL,'Y'),(1004,'Kota Customer','Kota',NULL,NULL,'SURABAYA',NULL,'Y'),(1005,'Kode Bayar Jual','KodeByr4',0,NULL,'TransferBcaGold','BCA Gold','Y'),(1006,'Kode Bayar Jual','KodeByr5',0,NULL,'Mandiri','BAnk Mandiri','Y'),(1007,'Kode Bayar Beli','KodeByr5',NULL,NULL,'BISMAR',NULL,'Y'),(1008,'AutoJurnal','PendapatanLain',NULL,NULL,'411005',NULL,'Y'),(1009,'Teknisi','001',NULL,NULL,'Gimbus',NULL,'Y'),(1010,'Teknisi','002',NULL,NULL,'Nanang',NULL,'Y'),(1011,'Teknisi','003',NULL,NULL,'Heri',NULL,'Y'),(1012,'Teknisi','004',NULL,NULL,'Suandri',NULL,'Y'),(1013,'Teknisi','005',NULL,NULL,'Irul',NULL,'Y'),(1014,'AutoJurnal','ReturPembelian',NULL,NULL,'113001',NULL,'Y'),(1015,'Set Cetak Struk','KeteranganFooter3',NULL,NULL,'Keterangan Umum Test',NULL,'Y');

--
-- Table structure for table `tm_shift`
--

CREATE TABLE `tm_shift` (
  `KodeShift` varchar(15) NOT NULL,
  `NamaShift` varchar(25) default NULL,
  `JamStart` datetime NOT NULL,
  `JamEnd` datetime NOT NULL,
  PRIMARY KEY  (`KodeShift`,`JamStart`,`JamEnd`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_shift`
--


--
-- Table structure for table `tm_stockbrg`
--

CREATE TABLE `tm_stockbrg` (
  `KodeBrg` varchar(20) NOT NULL default '',
  `KodeGd` varchar(5) NOT NULL default '',
  `StockAwal` double default NULL,
  `StockAkhir` double default NULL,
  `NilaiAwal` double default NULL,
  `TglAwal` date default NULL,
  `Namabrg` varchar(200) default NULL,
  PRIMARY KEY  (`KodeBrg`,`KodeGd`),
  KEY `fk_MStockBrg2` (`KodeGd`),
  CONSTRAINT `fk_MStockBrg1` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`) ON DELETE CASCADE,
  CONSTRAINT `fk_MStockBrg2` FOREIGN KEY (`KodeGd`) REFERENCES `tm_gudang` (`KodeGd`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_stockbrg`
--

INSERT INTO `tm_stockbrg` VALUES ('MON1','GD1',0,0,NULL,NULL,'Monitor LG '),('MON2','GD1',0,0,NULL,NULL,'Monitor LG 22\''),('MON3','GD1',0,0,NULL,NULL,'Monitor SPC 19\"'),('MON4','GD1',0,0,NULL,NULL,'Monitor Inforce 19\"'),('MON5','GD1',0,0,NULL,NULL,'Monitor Magix 19\"'),('MON6','GD1',0,3,NULL,NULL,'Monitor Pixel 19\"'),('MON7','GD1',0,0,NULL,NULL,'Monitor Venus 17\"'),('MON8','GD1',0,0,NULL,NULL,'Monitor Ikedo 20\"'),('MON9','GD1',0,1,NULL,NULL,'Monitor Lenovo 19\"'),('OPPO1','GD1',0,0,NULL,NULL,'Oppo A16 3/32'),('OPPO2','GD1',0,0,NULL,NULL,'Oppo A16 4/64'),('OPPO3','GD1',0,0,NULL,NULL,'Oppo A33'),('OPPO4','GD1',0,0,NULL,NULL,'Oppo A53 4/128'),('OPPO5','GD1',0,0,NULL,NULL,'Oppo A54 4/64'),('OPPO6','GD1',0,0,NULL,NULL,'Oppo A54 4/128'),('OPPO7','GD1',0,0,NULL,NULL,'Oppo A54 6/128');

--
-- Table structure for table `tm_supplier`
--

CREATE TABLE `tm_supplier` (
  `KodeSupp` varchar(20) NOT NULL default '',
  `NamaSupp` varchar(50) default NULL,
  `Editnama` varchar(1) default NULL,
  `Alamat` varchar(200) default NULL,
  `Kota` varchar(30) default NULL,
  `Telp` varchar(30) default NULL,
  `Fax` varchar(30) default NULL,
  `email` varchar(50) default NULL,
  `webpage` varchar(50) default NULL,
  `SuppType` varchar(10) default NULL,
  `CreditLimit` double default NULL,
  `Defvalas` varchar(10) default NULL,
  `SyaratByr` int(11) default NULL,
  `Keterangan` varchar(100) default NULL,
  `Aktif` varchar(1) default 'Y',
  `Hutang` double default NULL,
  `HTAwal` double default NULL,
  `TglHtAwal` datetime default NULL,
  `AccHt` varchar(20) default NULL,
  `AccHtBG` varchar(20) default NULL,
  `AccHtDB` varchar(20) default NULL,
  `AccHtCR` varchar(20) default NULL,
  `AccHtTitip` varchar(20) default NULL,
  `DefD1` double default NULL,
  `DefD2` double default NULL,
  `DefD3` double default NULL,
  `DefD4` double default NULL,
  `DefTamb` double default NULL,
  `DefKetTamb` varchar(50) default NULL,
  `FieldSupp1` varchar(100) default NULL,
  `FieldSupp2` varchar(100) default NULL,
  `FieldSupp3` varchar(100) default NULL,
  `FieldSupp4` varchar(100) default NULL,
  `FieldSupp5` varchar(100) default NULL,
  PRIMARY KEY  (`KodeSupp`),
  KEY `fk_MSupplier1` (`AccHt`),
  KEY `fk_MSupplier2` (`AccHtBG`),
  KEY `fk_MSupplier3` (`AccHtDB`),
  KEY `fk_MSupplier4` (`AccHtCR`),
  KEY `fk_MSupplier5` (`AccHtTitip`),
  CONSTRAINT `fk_MSupplier1` FOREIGN KEY (`AccHt`) REFERENCES `mperkiraan` (`Kode_perk`),
  CONSTRAINT `fk_MSupplier2` FOREIGN KEY (`AccHtBG`) REFERENCES `mperkiraan` (`Kode_perk`),
  CONSTRAINT `fk_MSupplier3` FOREIGN KEY (`AccHtDB`) REFERENCES `mperkiraan` (`Kode_perk`),
  CONSTRAINT `fk_MSupplier4` FOREIGN KEY (`AccHtCR`) REFERENCES `mperkiraan` (`Kode_perk`),
  CONSTRAINT `fk_MSupplier5` FOREIGN KEY (`AccHtTitip`) REFERENCES `mperkiraan` (`Kode_perk`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_supplier`
--

INSERT INTO `tm_supplier` VALUES ('AC01','PT Angkasa Cerah Jaya','','Ruko Sentra Fortuna Kav.66-67, Jl. Jaksa Agung Suprapto No.39-41, Ketabang, Genteng, Surabaya City, East Java 60272','SURABAYA','(031) 5043685','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('AI01','PT Airmas Teknologi Grosiria','','Jl. Kenjeran No.452 A, RT.001/RW.14, Gading, Tambaksari, Surabaya','SURABAYA','(031) 38-222-89','','info@yourcompany.com','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('AN01','Andro Teknologi','','Lt. Dasar Blok D No. 01 - 02 Hi Tech Mall Jalan Kusuma Bangsa No.116-118 Tambaksari Tambaksari Surabaya Jawa Timur 60136 ID, Jl. Kusuma Bangsa No.116, RT.000/RW.00, Tambaksari, Kec. Tambaksari, Kota S','SURABAYA','(031) 5470611','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('AS01','Astrotech Computer','','Maspion Square, Jl. Ahmad Yani, Margorejo, Kec. Wonocolo, Kota SBY, Jawa Timur 60238','SURABAYA','0823-3304-2203','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('BE01','CV Betakom (Canon)','','Jl. Genteng Kali, Genteng, Kec. Genteng, Kota SBY, Jawa Timur 60275','SURABAYA','(031) 5465527','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('DO01','PT Doran Sukses Indonesia','','Jl. Lb. Jaya II Tengah No.2, Gading, Kec. Tambaksari, Kota SBY, Jawa Timur 60134','SURABAYA','0819873000','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('DQ01','DQ Computer','','Surabaya','SURABAYA','','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('DU01','Duta Sarana Computer','','Jl. Kalibokor Selatan No.168, Baratajaya, Kec. Gubeng, Kota SBY, Jawa Timur 60283','SURABAYA','(031) 5045291','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('HA01','PT Harapan Cellular Makmur (Realme)','','Jalan Gembong No. 20-0 ITC Mega Grosir Lantai 2 Blok D6 No.1-3 A, Kp. Seng Gg. III, Kapasan, Kec. Simokerto, Kota SBY, Jawa Timur 60141','SURABAYA','(031) 3743558','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('KG01','KGR Notebook','','Jl. Gembong No.20, Kapasan, Kec. Simokerto, Kota SBY, Jawa Timur 60141','SURABAYA','(031) 37391215','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('KR01','PT Kreasindo Cipta Nusantara','','Jl. Ketupa No.30 A, RT.005/RW.09, Ketabang, Kec. Genteng, Kota SBY, Jawa Timur 60272, Indonesia','SURABAYA','(031) 5465577','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('MA01','CV Mapan Jaya','','Jalan Ploso Baru 191B, Surabaya','SURABAYA','','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('MI01','Mitra Surya Computer','','Jl. Manyar Indah Raya No.11, Menur Pumpungan, Kec. Sukolilo, Kota SBY, Jawa Timur 60118','SURABAYA','','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('MU01','Multimedia Komputer Mojokerto','','Pertokoan Terminal Kertajaya, Jl. Raya Jabon, Mergelo, Meri, Kec. Mojoanyar, Kabupaten Mojokerto, Jawa Timur 61364','SURABAYA','08563338013','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PR01','PT Prima Pesona Perkasa (Xiomi)','','Depo Arjuna Surabaya','SURABAYA','','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('SS01','SSP COMPUTER','','Jl. Genteng Muhamadiyah No.38, Genteng, Kec. Genteng, Kota SBY, Jawa Timur 60275','SURABAYA','(031) 5326532','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('TE01','PT Teletama Artha Mandiri (Xiomi)','','Jl. Arjuno No.112, Sawahan, Kec. Sawahan, Kota SBY, Jawa Timur 60251','SURABAYA','(031) 8796067','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('TI01','Titan Komputer','','Titan Hi-Tech Mall No. 65 2nd Floor, JL. Kusuma Bangsa, No. 116-118, Tambaksari, Surabaya, Kota SBY, Jawa Timur 60272','SURABAYA','(031) 5316557','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('UT01','Utara Mitra Media Computer','','Jl. Raya Medokan Sawah No.121, Medokan Ayu, Kec. Rungkut, Kota SBY, Jawa Timur 60295, Indonesia','SURABAYA',' 0813-3132-6275','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('VG01','VGEN Surabaya','','Jl. Seruni No.45, RT.005/RW.09, Ketabang, Kec. Genteng, Kota SBY, Jawa Timur 60272','SURABAYA','081133318350','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('VI01','Viki Komputer','','Pondok Benowo Indah blok R no, RT.14, Babat Jerawat, Kec. Pakal, Kota SBY, Jawa Timur 60197','SURABAYA','085733664000','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('WO01','PT World Innovative Telecomunication (OPPO Surabay','','Raya Blok B, Jl. Dharmahusada Utara No.19-21, Mojo, Kec. Gubeng, Kota SBY, Jawa Timur 60285','SURABAYA','(031) 5945771','','','','',NULL,NULL,NULL,'','Y',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

--
-- Table structure for table `tm_teknisi`
--

CREATE TABLE `tm_teknisi` (
  `KodeTeknisi` varchar(20) NOT NULL default '',
  `NamaTeknisi` varchar(30) default NULL,
  PRIMARY KEY  (`KodeTeknisi`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tm_teknisi`
--


--
-- Table structure for table `tmenu`
--

CREATE TABLE `tmenu` (
  `menu_id` varchar(6) NOT NULL default '1',
  `menu` varchar(30) default NULL,
  `keterangan` varchar(50) default NULL,
  `Status_aktive` varchar(1) default NULL,
  PRIMARY KEY  (`menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tmenu`
--

INSERT INTO `tmenu` VALUES ('010000','file1','File','1'),('010100','login1','Login','1'),('010200','logout1','Logout','1'),('010300','rubahpassword1','Rubah Password','1'),('010400','settinguser1','Setting User','1'),('010500','settingleveluser1','Setting Level User','1'),('010600','formatrugilaba1','Format Laporan Rugi Laba','1'),('010700','konfigurasi1','Setting Konfigurasi','1'),('010800','konfigurasiproduk1','Konfigurasi Produk','0'),('010900','setup1','Setup','1'),('020000','master1','Master','1'),('020100','perkiraan1','Master Perkiraan','0'),('020200','supplier1','Master Supplier','1'),('020300','customer1','Master Customer','1'),('020400','barang1','Master Barang','1'),('020500','gudang1','Master Gudang','1'),('020501','sales1','Master Sales','1'),('020600','groupbarang1','Master Grup Barang','1'),('020700','sales1','Master Sales','0'),('020800','persedianawal1','Persediaan Awal','1'),('020900','opnameawal1','Opname Awal','0'),('021000','barangswalayan1','Master Barang Swalayan','0'),('030000','akuntansi1','Akuntansi','0'),('030100','jurnalumum1','Transaksi Jurnal Umum','1'),('040000','pembelian1','Pembelian','1'),('040100','pembelian2','Transaksi Pembelian','1'),('040101','pembelianbuat1','Transaksi Pembelian Pembuatan','1'),('040102','pembelianedit1','Transaksi Pembelian Edit','1'),('040200','pembelianbayar1','Transaksi Pembayaran','1'),('040201','pembelianbayarbuat1','Transaksi Pembayaran Pembuatan','1'),('040202','pembelianbayaredit1','Transaksi Pembayaran Edit','1'),('040300','returbeli1','Transaksi Retur Beli','1'),('040301','returbelibuat1','Transaksi Retur Beli Pembuatan','1'),('040302','returbeliedit1','Transaksi Retur Beli Edit','1'),('040400','diganti1','Transaksi Replace Returan','0'),('040401','gantipembuatan1','Transaksi Replace Returan Pembuatan','1'),('040402','gantiedit1','Transaksi Replace Returan Edit','1'),('040500','purchaseorder1','Transaksi Purchase Order','1'),('040501','purchaseorderbuat1','Transaksi Purchase Order Pembuatan','1'),('040502','purchaseorderedit1','Transaksi Purchase Order Edit','1'),('050000','penjualan1','Penjualan','1'),('050100','PenjualanRetailSwalayan1','Transaksi Penjualan Retail Swalayan','1'),('050101','PenjualanRetailSwalayanBuat1','Transaksi Penjualan Retail Swalayan Pembuatan','1'),('050102','PenjualanRetailSwalayanEdit1','Transaksi Penjualan Retail Swalayan Edit','1'),('050200','ReturJualRetail1','Transaksi Retur Jual Retail','1'),('050201','ReturJualRetailBuat1','Transaksi Retur Jual Retail Pembuatan','1'),('050202','ReturJualRetailEdit1','Transaksi Retur Jual Retail Edit','1'),('050300','SalesOrderGrosir1','Transaksi Sales Order','0'),('050301','SalesOrderGrosirBuat1','Transaksi Sales Order Pembuatan','1'),('050302','SalesOrderGrosirEdit1','Transaksi Sales Order Edit','1'),('050400','PenjualanGrosir1','Transaksi Penjualan Grosir','1'),('050401','PenjualanGrosirBuat1','Transaksi Penjualan Grosir Pembuatan','1'),('050402','PenjualanGrosirEdit1','Transaksi Penjualan Grosir Edit','1'),('050500','ReturJualGrosir1','Transaksi Retur Jual Grosir','1'),('050501','ReturJualGrosirBuat1','Transaksi Retur Jual Grosir Pembuatan','1'),('050502','ReturJualGrosirEdit1','Transaksi Retur Jual Grosir Edit','1'),('050600','PenjualanGrosirBayar1','Transaksi Pembayaran Penjualan Grosir','1'),('050601','PenjualanGrosirBayarBuat1','Transaksi Pembayaran Penjualan Grosir Pembuatan','1'),('050602','PenjualanGrosirBayarEdit1','Transaksi Pembayaran Penjualan Grosir Edit','1'),('050700','SalesOrderRakitan1','Transaksi Sales Order Rakitan','0'),('050701','SalesOrderRakitanBuat1','Transaksi Sales Order Rakitan Pembuatan','1'),('050702','SalesOrderRakitanEdit1','Transaksi Sales Order Rakitan Edit','1'),('050800','PenjualanRakitan1','Transaksi Penjualan Rakitan','0'),('050801','PenjualanRakitanMaster1','Transaksi Penjualan Rakitan Master','1'),('050802','PenjualanRakitanBuat1','Transaksi Penjualan Rakitan Buat','1'),('050803','PenjualanRakitanEdit1','Transaksi Penjualan Rakitan Edit','1'),('050900','ReturJualRakitan1','Transaksi Retur Jual Rakitan','0'),('050901','ReturJualRakitanBuat1','Transaksi Retur Jual Rakitan Pembuatan','1'),('050902','ReturJualRakitanEdit1','Transaksi Retur Jual Rakitan Edit','1'),('051000','PenjualanRakitanBayar1','Transaksi Pembayaran Penjualan Rakitan','0'),('051001','PenjualanRakitanBayarBuat1','Transaksi Pembayaran Penjualan Rakitan Pembuatan','1'),('051002','PenjualanRakitanBayarEdit1','Transaksi Pembayaran Penjualan Rakitan Edit','1'),('060000','laporan1','Laporan','1'),('060100','lapakuntansi1','Akuntansi','0'),('060101','perkiraan2','Laporan Perkiraan','1'),('060102','laporanjurnal1','Laporan Jurnal Umum','1'),('060103','bukubesarpembantu1','Laporan Buku Besar Pembantu','1'),('060104','bukubesar1','Laporan Buku Besar','1'),('060105','neraca1','Laporan Neraca','1'),('060106','rincianneraca1','Laporan Rincian Neraca','1'),('060107','rugilaba1','Laporan Rugi Laba','1'),('060108','rincianrugilaba1','Laporan Rincian Rugi Laba','1'),('060109','rincianrugilabaperperiode1','Laporan Rincian Rugi Laba Per Periode','1'),('060200','lapcustomer1','Laporan Customer','1'),('060300','lapsupplier1','Laporan Supplier','1'),('060400','lapbarang1','Laporan Barang','1'),('060401','lapkartustock1','Laporan Kartu Stock','1'),('060402','lapposisistock1','Laporan Posisi Stock','1'),('060403','lappricelist1','Laporan Price List','1'),('060405','lapmutasigudang1','Laporan Mutasi Gudang','0'),('060500','laphutang1','Laporan Hutang','1'),('060501','lapkartuhutang1','Laporan Kartu Hutang','1'),('060502','lapposisihutang1','Laporan Posisi Hutang','1'),('060503','lapumurhutang1','Laporan Umur Hutang','1'),('060504','jatuhtempo2','Laporan Jatuh Tempo Hutang','1'),('060600','lappiutang1','Laporan Piutang','1'),('060601','lapkartupiutang1','Laporan Kartu Piutang','1'),('060602','lapposisipiutang1','Laporan Posisi Piutang','1'),('060603','lapumurpiutang1','Laporan Umur Piutang','1'),('060604','jatuhtempo1','Laporan Jatuh Tempo Piutang','1'),('060700','lappembelian1','Laporan Pembelian','1'),('060701','lappembelianbeli1','Laporan Pembelian beli','1'),('060702','lappembelianretur1','Laporan Pembelian retur','1'),('060703','lappembelianbayar1','Laporan Pembelian bayar','1'),('060704','lappurchaseorder1','Laporan Purchase Order','1'),('060800','lappenjualanretail1','Laporan Penjualan Retail','1'),('060801','lappenjualanretailjual1','Laporan Penjualan Retail Jual','1'),('060802','lappenjualanretailretur1','Laporan Penjualan Retail Retur','1'),('060900','lappenjualangrosir1','Laporan Penjualan Grosir','1'),('060901','lappenjualangrosirso1','Laporan Penjualan Grosir Sales Order','1'),('060902','lappenjualangrosirjual1','Laporan Penjualan Grosir Jual','1'),('060903','lappenjualangrosirretur1','Laporan Penjualan Grosir Retur','1'),('060904','lappenjualangrosirbayar1','Laporan Penjualan Grosir Bayar','1'),('061000','lappenjualanrakitan1','Laporan Penjualan Rakitan','0'),('061001','lappenjualanrakitanso1','Laporan Penjualan Rakitan Sales Order','1'),('061002','lappenjualanrakitanjual1','Laporan Penjualan Rakitan Jual','1'),('061003','lappenjualanrakitanretur1','Laporan Penjualan Rakitan Retur','1'),('061004','lappenjualanrakitanbayar1','Laporan Penjualan Rakitan Bayar','1'),('061100','lapanalisapenjualan1','Laporan Analisa Penjualan','1'),('061101','lapanalisapenjualanrugilaba1','Laporan Analisa Penjualan Rugi Laba Detail','1'),('061102','lapanalisarlsummary1','Laporan Analisa Penj. Rugi Laba Summary','1'),('061103','lapanalisapenjualanjual1','Laporan Analisa Penjualan Jual','1'),('070000','proses1','Proses','0'),('070100','postingharian1','Proses Posting Harian','1'),('070200','akhirtahun1','Proses Akhir Tahun','1'),('070300','tutupbuku1','Proses Tutup Buku','0'),('070400','ValidasiJurnal1','Proses Valiasi Jurnal','1'),('070500','koreksivalidasijurnal1','Proses Koreksi Validasi Jurnal','1'),('070600','pemindahbukuan1','Proses Pemindah Bukuan Simp Berjangka','1'),('080000','utility1','Utility','1'),('080100','repairdatabase1','Utility Repair Database','1'),('080200','backup1','Utility BackUp Database','1'),('080300','restore1','Utility Restore Database','1'),('090000','lainlain1','Lain-Lain','1'),('090100','mutasigudang1','Mutasi Gudang','1'),('090101','mutasigudangbuat1','Mutasi Gudang Pembuatan','1'),('090102','mutasigudangedit1','Mutasi Gudang Edit','1'),('090200','barangrusak1','Barang Rusak','1'),('090201','barangrusakbuat1','Barang Rusak Pembuatan','1'),('090202','barangrusakedit1','Barang Rusak Edit','1'),('090203','cetakbarcode1','Cetak Barcode','1'),('090300','otorisasi1','Otorisasi','1'),('090400','log1','Log','1'),('100000','pembayaran1','Pembayaran','1'),('110000','keluar1','Keluar Program','1'),('120000','service1','Service','1'),('121000','servicemasuk1','Service Masuk ','1'),('121001','buatmasuk1','Service Masuk Buat','1'),('121002','editmasuk1','Service Masuk Edit','1'),('122000','servicekeluar1','Service Keluar','1'),('122001','buatkeluar1','Service Keluar Buat','1'),('122002','editkeluar1','Serivce Keluar Edit','1'),('123000','service2','Sub Menu Laporan Service','1'),('123001','laporanservice1','Laporan Service ','1');

--
-- Table structure for table `totoritas`
--

CREATE TABLE `totoritas` (
  `Trans` varchar(3) NOT NULL,
  `NoBukti` varchar(11) NOT NULL,
  `TglTrans` datetime default NULL,
  `Acc1` varchar(30) default NULL,
  `Acc2` varchar(30) default NULL,
  `Acc3` varchar(30) default NULL,
  `Acc4` varchar(30) default NULL,
  `Acc5` varchar(30) default NULL,
  `Acc6` varchar(30) default NULL,
  `Acc7` varchar(30) default NULL,
  `Acc8` varchar(30) default NULL,
  `Acc9` varchar(30) default NULL,
  `TglAcc1` datetime default NULL,
  `TglAcc2` datetime default NULL,
  `TglAcc3` datetime default NULL,
  `TglAcc4` datetime default NULL,
  `TglAcc5` datetime default NULL,
  `TglAcc6` datetime default NULL,
  `TglAcc7` datetime default NULL,
  `TglAcc8` datetime default NULL,
  `TglAcc9` datetime default NULL,
  PRIMARY KEY  (`Trans`,`NoBukti`),
  KEY `NoBukti` (`NoBukti`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `totoritas`
--

INSERT INTO `totoritas` VALUES ('PO','15030001','2015-03-24 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15030002','2015-03-25 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15030003','2015-03-25 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15030004','2015-03-26 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15030005','2015-03-29 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15030006','2015-03-29 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15030007','2015-03-29 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15030008','2015-03-29 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15040001','2015-04-11 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15040002','2015-04-11 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15040003','2015-04-11 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15040004','2015-04-12 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15040005','2015-04-12 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15040006','2015-04-12 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15050001','2015-05-08 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15050002','2015-05-08 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15050003','2015-05-09 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),('PO','15050004','2015-05-22 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

--
-- Table structure for table `tr_barangrusak_d`
--

CREATE TABLE `tr_barangrusak_d` (
  `NoBarangRusak` varchar(11) NOT NULL default '',
  `ItemDet` int(11) NOT NULL default '0',
  `KodeBrg` varchar(20) NOT NULL,
  `KodeGdAsal` varchar(5) NOT NULL,
  `Jumlah` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Hpp` double default NULL,
  `Konv` double default NULL,
  PRIMARY KEY  (`NoBarangRusak`,`ItemDet`),
  KEY `fk_BarangRusak_d2` (`KodeBrg`),
  KEY `fk_BarangRusak_d3` (`KodeGdAsal`),
  CONSTRAINT `fk_BarangRusak_d1` FOREIGN KEY (`NoBarangRusak`) REFERENCES `tr_barangrusak_m` (`NoBarangRusak`) ON DELETE CASCADE,
  CONSTRAINT `fk_BarangRusak_d2` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`),
  CONSTRAINT `fk_BarangRusak_d3` FOREIGN KEY (`KodeGdAsal`) REFERENCES `tm_gudang` (`KodeGd`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_barangrusak_d`
--


--
-- Table structure for table `tr_barangrusak_m`
--

CREATE TABLE `tr_barangrusak_m` (
  `NoBarangRusak` varchar(11) NOT NULL default '',
  `TglBarangRusak` datetime default NULL,
  `Keterangan` varchar(200) default NULL,
  `TglBatal` datetime default NULL,
  PRIMARY KEY  (`NoBarangRusak`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_barangrusak_m`
--


--
-- Table structure for table `tr_bayarbeli_d`
--

CREATE TABLE `tr_bayarbeli_d` (
  `NoBayarB` varchar(11) NOT NULL default '',
  `ItemDBayarB` int(11) NOT NULL default '0',
  `KodeByr` varchar(10) default NULL,
  `NoBG` varchar(20) default NULL,
  `Bank` varchar(20) default NULL,
  `Trans` varchar(2) default NULL,
  `NoBukti` varchar(11) default NULL,
  `TglJT` datetime default NULL,
  `Nilai` double default NULL,
  `Valas` varchar(10) default NULL,
  `ExRate` double default NULL,
  `TglLunas` datetime default NULL,
  PRIMARY KEY  (`NoBayarB`,`ItemDBayarB`),
  KEY `fk_Tr_BayarBeli_D1` (`NoBayarB`),
  CONSTRAINT `fk_Tr_BayarBeli_D1` FOREIGN KEY (`NoBayarB`) REFERENCES `tr_bayarbeli_m` (`NoBayarB`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_bayarbeli_d`
--


--
-- Table structure for table `tr_bayarbeli_m`
--

CREATE TABLE `tr_bayarbeli_m` (
  `NoBayarB` varchar(11) NOT NULL default '',
  `TglBayarB` datetime default NULL,
  `KodeSupp` varchar(10) default NULL,
  `Keterangan` varchar(200) default NULL,
  `TglBatal` datetime default NULL,
  `NoIDJurnal` varchar(10) default NULL,
  `NoIDJurnalB` varchar(10) default NULL,
  PRIMARY KEY  (`NoBayarB`),
  KEY `fk_BayarBeli` (`KodeSupp`),
  CONSTRAINT `fk_BayarBeli` FOREIGN KEY (`KodeSupp`) REFERENCES `tm_supplier` (`KodeSupp`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_bayarbeli_m`
--


--
-- Table structure for table `tr_bayarjual_d`
--

CREATE TABLE `tr_bayarjual_d` (
  `NoBayarJ` varchar(11) NOT NULL default '',
  `ItemDBayarJ` int(11) NOT NULL default '0',
  `KodeByr` varchar(10) default NULL,
  `KodeRek` varchar(20) default NULL,
  `NoBG` varchar(20) default NULL,
  `Bank` varchar(20) default NULL,
  `Trans` varchar(2) default NULL,
  `NoBukti` varchar(11) default NULL,
  `TglJT` datetime default NULL,
  `Nilai` double default NULL,
  `Valas` varchar(10) default NULL,
  `ExRate` double default NULL,
  `TglLunas` datetime default NULL,
  PRIMARY KEY  (`NoBayarJ`,`ItemDBayarJ`),
  KEY `fk_Tr_BayarJual_D1` (`NoBayarJ`),
  CONSTRAINT `fk_Tr_BayarJual_D2` FOREIGN KEY (`NoBayarJ`) REFERENCES `tr_bayarjual_m` (`NoBayarJ`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_bayarjual_d`
--


--
-- Table structure for table `tr_bayarjual_m`
--

CREATE TABLE `tr_bayarjual_m` (
  `NoBayarJ` varchar(11) NOT NULL default '',
  `TglBayarJ` datetime default NULL,
  `KodeCust` varchar(10) default NULL,
  `Keterangan` varchar(200) default NULL,
  `TglBatal` datetime default NULL,
  `NOiDJurnal` varchar(10) default NULL,
  `NoIDJurnalB` varchar(10) default NULL,
  PRIMARY KEY  (`NoBayarJ`),
  KEY `fk_Tr_BayarJual_M1` (`KodeCust`),
  CONSTRAINT `fk_Tr_BayarJual_M2` FOREIGN KEY (`KodeCust`) REFERENCES `tm_customer` (`KodeCust`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_bayarjual_m`
--


--
-- Table structure for table `tr_bayarjualrakitan_d`
--

CREATE TABLE `tr_bayarjualrakitan_d` (
  `NoBayarJ` varchar(11) NOT NULL default '',
  `ItemDBayarJ` int(11) NOT NULL default '0',
  `KodeByr` varchar(10) default NULL,
  `KodeRek` varchar(20) default NULL,
  `NoBG` varchar(20) default NULL,
  `Bank` varchar(20) default NULL,
  `Trans` varchar(2) default NULL,
  `NoBukti` varchar(11) default NULL,
  `TglJT` datetime default NULL,
  `Nilai` double default NULL,
  `Valas` varchar(10) default NULL,
  `ExRate` double default NULL,
  `TglLunas` datetime default NULL,
  PRIMARY KEY  (`NoBayarJ`,`ItemDBayarJ`),
  KEY `fk_Tr_BayarJual_D1` (`NoBayarJ`),
  CONSTRAINT `fk_Tr_BayarJualrakitan_D2` FOREIGN KEY (`NoBayarJ`) REFERENCES `tr_bayarjualrakitan_m` (`NoBayarJ`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_bayarjualrakitan_d`
--


--
-- Table structure for table `tr_bayarjualrakitan_m`
--

CREATE TABLE `tr_bayarjualrakitan_m` (
  `NoBayarJ` varchar(11) NOT NULL default '',
  `TglBayarJ` datetime default NULL,
  `KodeCust` varchar(10) default NULL,
  `Keterangan` varchar(200) default NULL,
  `TglBatal` datetime default NULL,
  `NOiDJurnal` varchar(10) default NULL,
  `NoIDJurnalB` varchar(10) default NULL,
  PRIMARY KEY  (`NoBayarJ`),
  KEY `fk_Tr_BayarJualrakitan_M1` (`KodeCust`),
  CONSTRAINT `fk_Tr_BayarJualRakitan_M2` FOREIGN KEY (`KodeCust`) REFERENCES `tm_customer` (`KodeCust`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_bayarjualrakitan_m`
--


--
-- Table structure for table `tr_beli_d`
--

CREATE TABLE `tr_beli_d` (
  `TransBeli` varchar(2) NOT NULL default '',
  `NoBeli` varchar(11) NOT NULL default '',
  `ItemBeli` int(11) NOT NULL default '0',
  `NoPO` varchar(11) default NULL,
  `ItemPO` int(11) default NULL,
  `KodeBrg` varchar(20) NOT NULL,
  `KodeGd` varchar(5) default NULL,
  `NamaBrg` varchar(50) default NULL,
  `Harga` double(10,0) default NULL,
  `Disc` double default NULL,
  `Jml` double default NULL,
  `JmlTitip` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv` double default NULL,
  `Diretur` double default NULL,
  `total` double default NULL,
  `hppLama` double(10,0) default NULL,
  `Margin` double(10,0) default NULL,
  `HargaJual` double(10,0) default NULL,
  `tglAkhir` datetime default NULL,
  `PPN` int(11) default NULL,
  `PotD` double default NULL,
  PRIMARY KEY  (`TransBeli`,`NoBeli`,`ItemBeli`),
  KEY `idx_tr_Beli_d1` (`KodeGd`),
  KEY `idx_tr_Beli_d2` (`KodeGd`),
  KEY `idx_tr_Beli_d3` (`KodeBrg`),
  CONSTRAINT `fk_tr_Beli_d1` FOREIGN KEY (`TransBeli`, `NoBeli`) REFERENCES `tr_beli_m` (`TransBeli`, `NoBeli`),
  CONSTRAINT `fk_tr_Beli_d2` FOREIGN KEY (`KodeGd`) REFERENCES `tm_gudang` (`KodeGd`),
  CONSTRAINT `fk_tr_Beli_d3` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_beli_d`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetBeliAdd` AFTER INSERT ON `tr_beli_d` FOR EACH ROW BEGIN
DECLARE HargaLama DOUBLE;
DECLARE StockLama DOUBLE;
DECLARE HitungLama DOUBLE;
DECLARE HargaBaru DOUBLE;
DECLARE JumlahBaru DOUBLE;
DECLARE HitungBaru DOUBLE;
DECLARE StockHasil DOUBLE;
DECLARE HitungHasil DOUBLE;
DECLARE HargaHasil DOUBLE;
DECLARE HargaDisc, hppdisc DOUBLE;
DECLARE NilaiPPN DOUBLE;
DECLARE vTemp DOUBLE;
SET StockLama=(SELECT ifnull(StockAkhir,0) FROM tm_StockBrg WHERE KodeBrg=new.KodeBrg and KodeGD=new.KodeGD);
IF StockLama is NULL THEN 
   SET StockLama=0;
END IF;
SET HargaLama=(SELECT ifnull(HargaAvg,0) FROM tm_barang WHERE KodeBrg=new.KodeBrg);
IF HargaLama is NULL THEN 
   SET HargaLama=0;
END IF;
SET HitungLama=HargaLama * StockLama;
set hppdisc = (ifnull(new.Harga,0) * (ifnull(new.disc,0)/100)); 
SET HargaBaru=(ifnull(new.Harga,0)- ifnull(Hargadisc,0)) /ifnull(new.konv,1);
SET JumlahBaru=ifnull(new.Jml,0) *ifnull( new.Konv,1);
SET HitungBaru=HargaBaru * JumlahBaru;
SET StockHasil=StockLama + JumlahBaru;
SET HitungHasil=HitungLama + HitungBaru;
SET HargaHasil= HitungHasil / StockHasil;
Set NilaiPPN = HargaBaru +(ifnull(hargaBaru,0)*(ifnull(new.PPN,0)/100));
UPDATE tm_barang SET HargaAvg= NilaiPPN WHERE KodeBrg=new.KodeBrg;
SELECT COUNT(*) into vTemp FROM tm_stockbrg WHERE kodebrg=new.kodebrg and kodeGd=new.KodeGD;
IF vTemp>0 THEN
     UPDATE tm_stockbrg SET stockakhir=ifnull(stockakhir,0) + JumlahBaru WHERE kodebrg=new.kodebrg and kodegd=new.kodegd;
END IF;
IF vTemp <=0 THEN
    INSERT INTO tm_stockbrg(kodebrg, kodegd, stockakhir) VALUES(new.kodebrg,new.kodegd,JumlahBaru);
END IF;
END */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetBeliUpdate` AFTER UPDATE ON `tr_beli_d` FOR EACH ROW BEGIN
Update tm_stockbrg set Stockakhir =  stockakhir-old.jml where kodebrg=old.kodebrg and kodeGd= old.KodeGD;
update tm_barang set hargaAvg=ifnull(old.harga,0) where kodebrg=old.kodebrg;
Update tm_stockbrg set Stockakhir =  stockakhir+new.jml where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
update tm_barang set hargaAvg=ifnull(new.harga,0) where kodebrg=new.kodebrg;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetBeliDelete` AFTER DELETE ON `tr_beli_d` FOR EACH ROW BEGIN
  Update tm_stockbrg set Stockakhir =  stockakhir-old.jml where kodebrg=Old.kodebrg and kodeGd= Old.KodeGD;
  update tm_barang set hargaAvg=ifnull(old.harga,0) where kodebrg=Old.kodebrg;
  
end */;;

DELIMITER ;

--
-- Table structure for table `tr_beli_m`
--

CREATE TABLE `tr_beli_m` (
  `TransBeli` varchar(2) NOT NULL default '',
  `NoBeli` varchar(11) NOT NULL default '',
  `TglBeli` datetime default NULL,
  `TglBatal` datetime default NULL,
  `KodeSupp` varchar(10) default NULL,
  `NamaSupp` varchar(50) default NULL,
  `Keterangan` varchar(100) default NULL,
  `NoSJ` varchar(30) default NULL,
  `TglJT` datetime default NULL,
  `DiscRp` double default NULL,
  `Tambahan` double default NULL,
  `KetTambahan` varchar(50) default NULL,
  `PPN` double default NULL,
  `Nilai` double default NULL,
  `Sisa` double default NULL,
  `NPWP` varchar(20) default NULL,
  `NoTitip` varchar(11) default NULL,
  `NilaiTitip` double default NULL,
  `Valas` varchar(10) default NULL,
  `ExRate` double default NULL,
  `PPNRps` double default NULL,
  `TipePPN` varchar(3) default NULL,
  `NoFPajak` varchar(20) default NULL,
  `TglFPajak` datetime default NULL,
  `Pot` double default NULL,
  PRIMARY KEY  (`TransBeli`,`NoBeli`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_beli_m`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TrBeliAdd` AFTER INSERT ON `tr_beli_m` FOR EACH ROW BEGIN
  Update tm_Supplier set Hutang =  ifnull(hutang,0) + (new.nilai * new.exrate) 
  where kodesupp = new.kodesupp;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TrBeliUpdate` AFTER UPDATE ON `tr_beli_m` FOR EACH ROW BEGIN
  Update tm_Supplier set Hutang =  ifnull(hutang,0) + (new.nilai * new.exrate)
  where kodesupp = new.kodesupp;
  Update tm_Supplier set Hutang =  ifnull(hutang,0) - (old.nilai * old.exrate)
  where kodesupp = old.kodesupp;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TrBeliDelete` AFTER DELETE ON `tr_beli_m` FOR EACH ROW BEGIN
  Update tm_Supplier set Hutang =  ifnull(hutang,0) - (Old.nilai * Old.exrate) 
  where kodesupp = Old.kodesupp;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_buanggd_d`
--

CREATE TABLE `tr_buanggd_d` (
  `NoBuangGd` varchar(11) NOT NULL default '',
  `ItemDet` int(11) NOT NULL default '0',
  `KodeBrg` varchar(20) NOT NULL,
  `KodeGdAsal` varchar(5) NOT NULL,
  `Jumlah` double default NULL,
  `Harga` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Hpp` double default NULL,
  `Konv` double default NULL,
  PRIMARY KEY  (`NoBuangGd`,`ItemDet`),
  KEY `fk_Tr_BuangGd_d2` (`KodeBrg`),
  KEY `fk_Tr_BuangGd_d3` (`KodeGdAsal`),
  CONSTRAINT `fk_Tr_BuangGd_d1` FOREIGN KEY (`NoBuangGd`) REFERENCES `tr_buanggd_m` (`NoBuangGd`) ON DELETE CASCADE,
  CONSTRAINT `fk_Tr_BuangGd_d2` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`),
  CONSTRAINT `fk_Tr_BuangGd_d3` FOREIGN KEY (`KodeGdAsal`) REFERENCES `tm_gudang` (`KodeGd`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_buanggd_d`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetBuangGdAdd` AFTER INSERT ON `tr_buanggd_d` FOR EACH ROW BEGIN
  Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)-new.jumlah*new.konv where kodeGd= new.KodeGDAsal and kodebrg=new.kodebrg;
END */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetBuangGdUpdate` AFTER UPDATE ON `tr_buanggd_d` FOR EACH ROW BEGIN
  Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)+old.Jumlah*old.konv where kodeGd= old.KodeGDasal and kodebrg=old.kodebrg;
  Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)-new.Jumlah*new.konv where kodeGd= new.KodeGDasal and kodebrg=new.kodebrg;
END */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetBuangGdDelete` AFTER DELETE ON `tr_buanggd_d` FOR EACH ROW BEGIN
  Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)+old.Jumlah*old.konv where kodeGd= old.KodeGDAsal and kodebrg=old.kodebrg;
END */;;

DELIMITER ;

--
-- Table structure for table `tr_buanggd_m`
--

CREATE TABLE `tr_buanggd_m` (
  `NoBuangGd` varchar(11) NOT NULL default '',
  `TglBuangGd` datetime default NULL,
  `Keterangan` varchar(200) default NULL,
  `TglBatal` datetime default NULL,
  PRIMARY KEY  (`NoBuangGd`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_buanggd_m`
--


--
-- Table structure for table `tr_data`
--

CREATE TABLE `tr_data` (
  `Notrans` varchar(20) NOT NULL,
  `KodeCust` varchar(10) default NULL,
  `Kodebrg` varchar(10) default NULL,
  `NoSeriBrg` varchar(50) default NULL,
  `TglMasuk` date default NULL,
  `TglKeluar` date default NULL,
  `SparePart` varchar(50) default NULL,
  `Kerusakan` varchar(200) default NULL,
  `Teknisi` varchar(50) default NULL,
  `Spesifikasi` text,
  PRIMARY KEY  (`Notrans`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_data`
--


--
-- Table structure for table `tr_destmodx`
--

CREATE TABLE `tr_destmodx` (
  `NoModx` varchar(11) NOT NULL default '',
  `ItemModX` int(11) NOT NULL default '0',
  `Kodebrg` varchar(20) NOT NULL,
  `KodeGd` varchar(5) NOT NULL,
  `Jumlah` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv` double default NULL,
  `BagHarga` double default NULL,
  PRIMARY KEY  (`NoModx`,`ItemModX`),
  KEY `fk_DestModX2` (`Kodebrg`),
  KEY `fk_DestModX3` (`KodeGd`),
  CONSTRAINT `fk_DestModX1` FOREIGN KEY (`NoModx`) REFERENCES `tr_modx` (`NoModX`) ON DELETE CASCADE,
  CONSTRAINT `fk_DestModX2` FOREIGN KEY (`Kodebrg`) REFERENCES `tm_barang` (`KodeBrg`),
  CONSTRAINT `fk_DestModX3` FOREIGN KEY (`KodeGd`) REFERENCES `tm_gudang` (`KodeGd`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_destmodx`
--


--
-- Table structure for table `tr_hasilproduksi_d`
--

CREATE TABLE `tr_hasilproduksi_d` (
  `TransProd` varchar(5) default NULL,
  `NoProduksi` varchar(20) default NULL,
  `KodeProduk` varchar(15) default NULL,
  `itembrg` int(11) default NULL,
  `kodebrg` varchar(20) default NULL,
  `namabrg` varchar(50) default NULL,
  `satuan` varchar(10) default NULL,
  `kodegd` varchar(10) default NULL,
  `JmlSebelum` double default NULL,
  `jml` double default NULL,
  `Konv` double default NULL,
  `harga` double default NULL,
  `total` double default NULL,
  `disc` double default NULL,
  `discpersen` double default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_hasilproduksi_d`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetHasilProduksiAdd` AFTER INSERT ON `tr_hasilproduksi_d` FOR EACH ROW BEGIN
  DECLARE vtemp double;
if (select jenisbrg from tm_barang where kodebrg=new.KodeBrg)="Inventory" then
  select stockakhir-new.jml into vtemp from tm_stockbrg where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
  Update tm_stockbrg set Stockakhir =  stockakhir-(new.jml*ifnull(new.konv,1))
  where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
end if;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetHasilProduksiUpdate` AFTER UPDATE ON `tr_hasilproduksi_d` FOR EACH ROW BEGIN
 
if (select jenisbrg from tm_barang where kodebrg=Old.KodeBrg)="Inventory" then
   Update tm_stockbrg set Stockakhir =  stockakhir+(Old.jml*ifnull(Old.konv,1))
   where kodebrg=Old.kodebrg and kodeGd= Old.KodeGD;
 
   Update tm_stockbrg set Stockakhir =  stockakhir-(new.jml*ifnull(new.konv,1))
   where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
end if;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetHasilProduksiDelete` AFTER DELETE ON `tr_hasilproduksi_d` FOR EACH ROW BEGIN
 
if (select jenisbrg from tm_barang where kodebrg=Old.KodeBrg)="Inventory" then
   Update tm_stockbrg set Stockakhir =  stockakhir+(Old.jml*ifnull(Old.konv,1))
   where kodebrg=Old.kodebrg and kodeGd= Old.KodeGD;
end if;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_hasilproduksi_m`
--

CREATE TABLE `tr_hasilproduksi_m` (
  `TransProd` varchar(5) default NULL,
  `NoProduksi` varchar(25) NOT NULL default '',
  `TglProduksi` date default NULL,
  `KodeMaster` varchar(15) default NULL,
  `KodeProduk` varchar(15) default NULL,
  `NamaProduk` varchar(40) default NULL,
  `Nilai` double default NULL,
  `Keterangan` varchar(100) default NULL,
  `JmlProduksi` double default NULL,
  PRIMARY KEY  (`NoProduksi`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_hasilproduksi_m`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TRHasilProduksiAdd` AFTER INSERT ON `tr_hasilproduksi_m` FOR EACH ROW BEGIN
   Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)+new.jmlproduksi
   where kodebrg=new.kodeProduk;
update tm_barang set hargaavg = New.Nilai/new.jmlProduksi where kodebrg=new.kodeProduk;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TRHasilProduksiUpdate` AFTER UPDATE ON `tr_hasilproduksi_m` FOR EACH ROW BEGIN
   Update tm_stockbrg set Stockakhir =  stockakhir-Old.jmlproduksi where kodebrg=Old.kodeProduk;
   Update tm_stockbrg set Stockakhir =  stockakhir+new.jmlproduksi where kodebrg=new.kodeProduk;
update tm_barang set hargaavg = New.Nilai/new.jmlProduksi where kodebrg=new.kodeProduk;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TRHasilProduksiDelete` AFTER DELETE ON `tr_hasilproduksi_m` FOR EACH ROW BEGIN
   Update tm_stockbrg set Stockakhir =  stockakhir-Old.jmlproduksi where kodebrg=Old.kodeProduk;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_jual_d`
--

CREATE TABLE `tr_jual_d` (
  `TransJual` varchar(2) NOT NULL default '',
  `NoJual` varchar(11) NOT NULL default '',
  `ItemJual` int(11) NOT NULL default '0',
  `NOPO` varchar(11) default NULL,
  `ItemPO` int(11) default NULL,
  `KodeBrg` varchar(20) NOT NULL,
  `KodeGd` varchar(5) NOT NULL,
  `NamaBrg` varchar(50) default NULL,
  `Harga` double default NULL,
  `Disc` double default NULL,
  `DiscPersen` double default NULL,
  `Jml` double default NULL,
  `JmlTitip` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv` double default NULL,
  `HargaAvg` double default NULL,
  `Total` double default NULL,
  `Diretur` double default NULL,
  `HPP` double default NULL,
  `Sales` varchar(50) default NULL,
  `Teknisi` varchar(50) default NULL,
  `HargaPeny` double default NULL,
  `JmlPeny` double default NULL,
  PRIMARY KEY  (`TransJual`,`NoJual`,`ItemJual`),
  KEY `fk_tr_Jual_d1` (`KodeBrg`),
  KEY `fk_tr_Jual_d2` (`KodeGd`),
  KEY `fk_tr_Jual_d4` (`NOPO`,`ItemPO`),
  CONSTRAINT `fk_tr_Jual_d1` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`),
  CONSTRAINT `fk_tr_Jual_d2` FOREIGN KEY (`KodeGd`) REFERENCES `tm_gudang` (`KodeGd`),
  CONSTRAINT `fk_tr_Jual_d3` FOREIGN KEY (`TransJual`, `NoJual`) REFERENCES `tr_jual_m` (`TransJual`, `NoJual`),
  CONSTRAINT `fk_tr_Jual_d4` FOREIGN KEY (`NOPO`, `ItemPO`) REFERENCES `tr_pojual_d` (`NoPO`, `ItemPO`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_jual_d`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetJualAdd` AFTER INSERT ON `tr_jual_d` FOR EACH ROW BEGIN
 DECLARE vtemp double;
 select count(*) into vtemp from tm_stockbrg where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
 if vtemp = 0 then
    insert  into tm_stockbrg (kodebrg,kodegd,StockAwal,stockakhir) values (new.kodebrg,new.kodegd,0,new.Jml);
 else
    Update tm_stockbrg set Stockakhir =  stockakhir+new.jml where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
 END if;
end */;;

/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetJualUpdate` AFTER UPDATE ON `tr_jual_d` FOR EACH ROW BEGIN
  Update tm_stockbrg set Stockakhir =  stockakhir+new.jml where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
  Update tm_stockbrg set Stockakhir =  stockakhir-old.jml where kodebrg=old.kodebrg and kodeGd= old.KodeGD;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetJualDelete` AFTER DELETE ON `tr_jual_d` FOR EACH ROW BEGIN
  Update tm_stockbrg set Stockakhir =  stockakhir+old.jml 
  where kodebrg=Old.kodebrg and kodeGd= Old.KodeGD;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_jual_m`
--

CREATE TABLE `tr_jual_m` (
  `TransJual` varchar(2) NOT NULL default '',
  `NoJual` varchar(11) NOT NULL default '',
  `TglJual` datetime default NULL,
  `KodeCust` varchar(10) default NULL,
  `NamaCust` varchar(50) default NULL,
  `Alamat` varchar(50) default NULL,
  `Kota` varchar(30) default NULL,
  `TglBatal` datetime default NULL,
  `DiscRp` double default NULL,
  `PPN` double default NULL,
  `Tambahan` double default NULL,
  `Sisa` double default NULL,
  `KetTambahan` varchar(50) default NULL,
  `Nilai` double default NULL,
  `KodeSales` varchar(10) default NULL,
  `TglJT` datetime default NULL,
  `NPWP` varchar(20) default NULL,
  `NoTitip` varchar(11) default NULL,
  `NilaiTitip` double default NULL,
  `Valas` varchar(10) default NULL,
  `ExRate` double default NULL,
  `PPNRps` double default NULL,
  `TipePPN` varchar(3) default NULL,
  `NoFPajak` varchar(20) default NULL,
  `TglFPajak` datetime default NULL,
  `Keterangan` varchar(100) default NULL,
  `ItemKirim` int(11) default NULL,
  `Kendaraan` varchar(50) default NULL,
  `NoPol` varchar(15) default NULL,
  `BayarCard` double default NULL,
  `TipeCard` varchar(20) default NULL,
  `NoCard` varchar(20) default NULL,
  `BankCard` varchar(20) default NULL,
  `NamaCard` varchar(30) default NULL,
  `BayarVoucher` double default NULL,
  `BayarTunai` double default NULL,
  `Kasir` varchar(7) default NULL,
  `Sales` varchar(50) default NULL,
  `Teknisi` varchar(50) default NULL,
  `NilaiPeny` double default NULL,
  `SisaPeny` double default NULL,
  `BayarTunaiPeny` double default NULL,
  `BayarVoucherPeny` double default NULL,
  `BayarCardPeny` double default NULL,
  PRIMARY KEY  (`TransJual`,`NoJual`),
  KEY `fk_TR_Jual_m2` (`KodeSales`),
  KEY `fk_TR_Jual_m3` (`KodeCust`,`ItemKirim`),
  CONSTRAINT `fk_TR_Jual_m1` FOREIGN KEY (`KodeCust`) REFERENCES `tm_customer` (`KodeCust`),
  CONSTRAINT `fk_TR_Jual_m3` FOREIGN KEY (`KodeCust`, `ItemKirim`) REFERENCES `tm_custkirim` (`KodeCust`, `ItemCust`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_jual_m`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TrJualAdd` AFTER INSERT ON `tr_jual_m` FOR EACH ROW BEGIN
  Update tm_Customer set Piutang =  ifnull(piutang,0) + ((new.nilai-new.bayartunai-new.bayarcard-new.bayarvoucher) * new.exrate)
  where kodecust = new.kodecust;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TrJualUpdate` AFTER UPDATE ON `tr_jual_m` FOR EACH ROW BEGIN
  Update tm_Customer set Piutang =  ifnull(piutang,0) + ((new.nilai-new.bayartunai-new.bayarcard-new.bayarvoucher) * new.exrate)
  where kodecust = new.kodecust;
  Update tm_Customer set Piutang =  ifnull(piutang,0) - ((old.nilai-old.bayartunai-old.bayarcard-old.bayarvoucher) * Old.exrate)
  where kodecust = old.kodecust;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TrJualDelete` AFTER DELETE ON `tr_jual_m` FOR EACH ROW BEGIN
  Update tm_Customer set Piutang =  ifnull(piutang,0) - ((old.nilai-old.bayartunai-old.bayarcard-old.bayarvoucher) * Old.exrate) 
  where kodecust = Old.kodecust;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_jualr_d`
--

CREATE TABLE `tr_jualr_d` (
  `TransRetail` varchar(2) NOT NULL default '',
  `NoJualR` varchar(11) NOT NULL default '',
  `ItemJual` int(11) NOT NULL default '0',
  `KodeBrg` varchar(20) NOT NULL,
  `KodeGd` varchar(5) NOT NULL,
  `NamaBrg` varchar(50) default NULL,
  `Harga` double default NULL,
  `Disc` double default NULL,
  `DiscPersen` double default NULL,
  `Jml` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv` double default NULL,
  `HargaRetail` double default NULL,
  `HargaAvg` double default NULL,
  `Diretur` double default NULL,
  `HPP` double default NULL,
  `total` double default NULL,
  `Sales` varchar(50) default NULL,
  `Teknisi` varchar(50) default NULL,
  `HargaPeny` double default NULL,
  `JmlPeny` double default NULL,
  PRIMARY KEY  (`TransRetail`,`NoJualR`,`ItemJual`),
  KEY `fk_tr_JualR_d1` (`KodeBrg`),
  KEY `fk_tr_JualR_d2` (`KodeGd`),
  KEY `idx_tr_jualr_d1` (`TransRetail`,`NoJualR`),
  KEY `idx_tr_jualr_d2` (`NoJualR`),
  CONSTRAINT `fk_tr_JualR_d1` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`),
  CONSTRAINT `fk_tr_JualR_d2` FOREIGN KEY (`KodeGd`) REFERENCES `tm_gudang` (`KodeGd`),
  CONSTRAINT `fk_tr_JualR_d3` FOREIGN KEY (`TransRetail`, `NoJualR`) REFERENCES `tr_jualr_m` (`TransRetail`, `NoJualR`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_jualr_d`
--

INSERT INTO `tr_jualr_d` VALUES ('JR','220419001',1,'MON3','GD1','Monitor SPC 19\"',1400000,0,0,1,'Pcs',NULL,0,1260000,NULL,NULL,NULL,'','',NULL,NULL),('JR','220419002',1,'MON2','GD1','Monitor LG 22\'',2200000,0,0,1,'Pcs',NULL,0,1980000,NULL,NULL,NULL,'','',NULL,NULL);

DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetJualRAdd` AFTER INSERT ON `tr_jualr_d` FOR EACH ROW BEGIN
  DECLARE vtemp double;
  DECLARE jenisbrgs varchar(25);
  select jenisbrg into jenisbrgs from tm_barang where kodebrg=new.kodebrg;
 if jenisbrgs = "Inventory" then
  select stockakhir-new.jml into vtemp from tm_stockbrg where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
  Update tm_stockbrg set Stockakhir =  stockakhir-new.jml
  where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
end if;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetJualRUpdate` AFTER UPDATE ON `tr_jualr_d` FOR EACH ROW BEGIN
 DECLARE vtemp double;
DECLARE jenisbrgs varchar(25);
  select jenisbrg into jenisbrgs from tm_barang where kodebrg=new.kodebrg;
 if jenisbrgs = "Inventory" then
 select stockakhir-(new.jml-old.jml) into vtemp from tm_stockbrg where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
   Update tm_stockbrg set Stockakhir =  stockakhir+old.jml
   where kodebrg=old.kodebrg and kodeGd= old.KodeGD;
   Update tm_stockbrg set Stockakhir =  stockakhir-new.jml
   where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
end if;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetJualRDelete` AFTER DELETE ON `tr_jualr_d` FOR EACH ROW BEGIN
DECLARE jenisbrgs varchar(25);
  select jenisbrg into jenisbrgs from tm_barang where kodebrg=old.kodebrg;
 if jenisbrgs = "Inventory" then
  Update tm_stockbrg set Stockakhir =  stockakhir+old.jml 
  where kodebrg=Old.kodebrg and kodeGd= Old.KodeGD;
end if;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_jualr_m`
--

CREATE TABLE `tr_jualr_m` (
  `TransRetail` varchar(2) NOT NULL default '',
  `NoJualR` varchar(11) NOT NULL default '',
  `TglJual` datetime default NULL,
  `TglEntry` datetime default NULL,
  `TglBatal` datetime default NULL,
  `NamaCust` varchar(50) default NULL,
  `Alamat` varchar(50) default NULL,
  `Kota` varchar(30) default NULL,
  `DiscRp` double default NULL,
  `PPN` double default NULL,
  `PPNRps` double default NULL,
  `Tambahan` double default NULL,
  `KetTambahan` varchar(200) default NULL,
  `BayarVoucher` double default NULL,
  `BayarTunai` double default NULL,
  `BayarCard` double default NULL,
  `TipeCard` varchar(20) default NULL,
  `NoCard` varchar(20) default NULL,
  `BankCard` varchar(20) default NULL,
  `NamaCard` varchar(30) default NULL,
  `Nilai` double default NULL,
  `NoClose` varchar(11) default NULL,
  `kasir` varchar(10) default NULL,
  `KodeSales` varchar(10) default NULL,
  `Sales` varchar(50) default NULL,
  `Teknisi` varchar(50) default NULL,
  `NilaiPeny` double default NULL,
  PRIMARY KEY  (`TransRetail`,`NoJualR`),
  KEY `Idx_tr_jualr_m` (`TransRetail`,`NoJualR`),
  KEY `idx_tr_jualr_m2` (`NoJualR`),
  KEY `idx_tr_jualr_m3` (`TglJual`),
  KEY `idx_tr_jualr_m4` (`NoJualR`,`TglJual`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_jualr_m`
--

INSERT INTO `tr_jualr_m` VALUES ('JR','220419001','2022-04-19 00:00:00',NULL,NULL,'CASH','','',0,0,0,0,'',0,1400000,0,'','','','',1400000,'','asp','','','',NULL),('JR','220419002','2022-04-19 00:00:00',NULL,NULL,'CASH','','',0,0,0,0,'',0,2200000,0,'','','','',2200000,'','asp','','','',NULL);

--
-- Table structure for table `tr_jualrakitan_d`
--

CREATE TABLE `tr_jualrakitan_d` (
  `TransJual` varchar(2) NOT NULL default '',
  `NoJual` varchar(11) NOT NULL default '',
  `ItemJual` int(11) NOT NULL default '0',
  `NOPO` varchar(11) default NULL,
  `ItemPO` int(11) default NULL,
  `KodeBrg` varchar(20) NOT NULL,
  `KodeGd` varchar(5) NOT NULL,
  `NamaBrg` varchar(50) default NULL,
  `Harga` double default NULL,
  `Disc` double default NULL,
  `DiscPersen` double default NULL,
  `Jml` double default NULL,
  `JmlTitip` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv` double default NULL,
  `HargaAvg` double default NULL,
  `Diretur` double default NULL,
  `HPP` double default NULL,
  `Sales` varchar(50) default NULL,
  `Teknisi` varchar(50) default NULL,
  `HargaPeny` double default NULL,
  `JmlPeny` double default NULL,
  PRIMARY KEY  (`TransJual`,`NoJual`,`ItemJual`),
  KEY `fk_tr_Jualrakitan_d1` (`KodeBrg`),
  KEY `fk_tr_Jualrakitan_d2` (`KodeGd`),
  KEY `fk_tr_Jualrakitan_d4` (`NOPO`,`ItemPO`),
  CONSTRAINT `fk_tr_Jualrakitan_d1` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`),
  CONSTRAINT `fk_tr_Jualrakitan_d2` FOREIGN KEY (`KodeGd`) REFERENCES `tm_gudang` (`KodeGd`),
  CONSTRAINT `fk_tr_Jualrakitan_d3` FOREIGN KEY (`TransJual`, `NoJual`) REFERENCES `tr_jualrakitan_m` (`TransJual`, `NoJual`) ON DELETE CASCADE,
  CONSTRAINT `fk_tr_Juarakitanl_d4` FOREIGN KEY (`NOPO`, `ItemPO`) REFERENCES `tr_pojualrakitan_d` (`NoPO`, `ItemPO`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_jualrakitan_d`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetJualRakitanAdd` AFTER INSERT ON `tr_jualrakitan_d` FOR EACH ROW BEGIN
DECLARE vtemp double;
 select stockakhir-new.jml into vtemp from tm_stockbrg where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
   Update tm_stockbrg set Stockakhir =  stockakhir-new.jml
   where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetJualRakitanUpdate` AFTER UPDATE ON `tr_jualrakitan_d` FOR EACH ROW BEGIN
 DECLARE vtemp double;
 select stockakhir-(new.jml-old.jml) into vtemp from tm_stockbrg where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
   Update tm_stockbrg set Stockakhir =  stockakhir+old.jml
   where kodebrg=old.kodebrg and kodeGd= old.KodeGD;
   Update tm_stockbrg set Stockakhir =  stockakhir-new.jml
   where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetJualRakitanDelete` AFTER DELETE ON `tr_jualrakitan_d` FOR EACH ROW BEGIN
  Update tm_stockbrg set Stockakhir =  stockakhir+old.jml 
  where kodebrg=Old.kodebrg and kodeGd= Old.KodeGD;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_jualrakitan_m`
--

CREATE TABLE `tr_jualrakitan_m` (
  `TransJual` varchar(2) NOT NULL default '',
  `NoJual` varchar(11) NOT NULL default '',
  `TglJual` datetime default NULL,
  `KodeCust` varchar(10) default NULL,
  `NamaCust` varchar(50) default NULL,
  `Alamat` varchar(50) default NULL,
  `Kota` varchar(30) default NULL,
  `NoPo` varchar(11) default NULL,
  `KodeRakitan` varchar(20) default NULL,
  `NamaRakitan` varchar(50) default NULL,
  `JmlRakitan` int(11) default NULL,
  `TglBatal` datetime default NULL,
  `DiscRp` double default NULL,
  `PPN` double default NULL,
  `Tambahan` double default NULL,
  `Sisa` double default NULL,
  `KetTambahan` varchar(50) default NULL,
  `Nilai` double default NULL,
  `KodeSales` varchar(10) default NULL,
  `TglJT` datetime default NULL,
  `NPWP` varchar(20) default NULL,
  `NoTitip` varchar(11) default NULL,
  `NilaiTitip` double default NULL,
  `Valas` varchar(10) default NULL,
  `ExRate` double default NULL,
  `PPNRps` double default NULL,
  `TipePPN` varchar(3) default NULL,
  `NoFPajak` varchar(20) default NULL,
  `TglFPajak` datetime default NULL,
  `Keterangan` varchar(100) default NULL,
  `ItemKirim` int(11) default NULL,
  `Kendaraan` varchar(50) default NULL,
  `NoPol` varchar(15) default NULL,
  `BayarCard` double default NULL,
  `TipeCard` varchar(20) default NULL,
  `NoCard` varchar(20) default NULL,
  `BankCard` varchar(20) default NULL,
  `NamaCard` varchar(30) default NULL,
  `BayarVoucher` double default NULL,
  `BayarTunai` double default NULL,
  `StatusCash` varchar(1) default NULL,
  `ReturRakitan` int(11) default NULL,
  `Sales` varchar(50) default NULL,
  `Teknisi` varchar(50) default NULL,
  `NilaiPeny` double default NULL,
  `SisaPeny` double default NULL,
  `BayarTunaiPeny` double default NULL,
  `BayarVoucherPeny` double default NULL,
  `BayarCardPeny` double default NULL,
  PRIMARY KEY  (`TransJual`,`NoJual`),
  KEY `fk_TR_Jualrakitan_m2` (`KodeSales`),
  KEY `fk_TR_Jualrakitan_m3` (`KodeCust`,`ItemKirim`),
  CONSTRAINT `fk_TR_Jualrakitan_m1` FOREIGN KEY (`KodeCust`) REFERENCES `tm_customer` (`KodeCust`),
  CONSTRAINT `fk_TR_Jualrakitan_m3` FOREIGN KEY (`KodeCust`, `ItemKirim`) REFERENCES `tm_custkirim` (`KodeCust`, `ItemCust`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_jualrakitan_m`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TrJualRakitanAdd` AFTER INSERT ON `tr_jualrakitan_m` FOR EACH ROW BEGIN
  Update tm_Customer set Piutang =  ifnull(piutang,0) + ((new.nilai-new.bayartunai-new.bayarcard-new.bayarvoucher)*new.exrate)
  where kodecust = new.kodecust;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TrJualRakitanUpdate` AFTER UPDATE ON `tr_jualrakitan_m` FOR EACH ROW BEGIN
  Update tm_Customer set Piutang =  ifnull(piutang,0) + ((new.nilai-new.bayartunai-new.bayarcard-new.bayarvoucher)*new.exrate)
  where kodecust = new.kodecust;
  Update tm_Customer set Piutang =  ifnull(piutang,0) - ((old.nilai-old.bayartunai-old.bayarcard-old.bayarvoucher)*old.exrate)
  where kodecust = old.kodecust;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TrJualRakitanDelete` AFTER DELETE ON `tr_jualrakitan_m` FOR EACH ROW BEGIN
  Update tm_Customer set Piutang =  ifnull(piutang,0) - ((old.nilai-old.bayartunai-old.bayarcard-old.bayarvoucher) * Old.exrate) 
  where kodecust = Old.kodecust;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_koreksistc_d`
--

CREATE TABLE `tr_koreksistc_d` (
  `NoKoreksi` varchar(15) default NULL,
  `ItemDet` int(11) default NULL,
  `kodebrg` varchar(20) default NULL,
  `Satuan` varchar(10) default NULL,
  `JmlSebelum` double default NULL,
  `JmlSesudah` double default NULL,
  `Konv` double default NULL,
  `SelisihKurang` double default NULL,
  `SelisihLebih` double default NULL,
  `Harga` double default NULL,
  `KodeGd` varchar(15) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_koreksistc_d`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DETKOREKSIADD` AFTER INSERT ON `tr_koreksistc_d` FOR EACH ROW BEGIN
  update TM_STOCKBRG SET STOCKAKHIR =IFNULL(NEW.JMLSESUDAH,0) WHERE KODEBRG = NEW.KODEBRG AND KODEGD = NEW.KODEGD;
END */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DETKOREKSIUPDATE` AFTER UPDATE ON `tr_koreksistc_d` FOR EACH ROW BEGIN
  update TM_STOCKBRG SET STOCKAKHIR =IFNULL(OLD.JMLSESUDAH,0) WHERE KODEBRG = OLD.KODEBRG AND KODEGD = OLD.KODEGD;
END */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DETKOREKSIDELETE` AFTER DELETE ON `tr_koreksistc_d` FOR EACH ROW BEGIN
  update TM_STOCKBRG SET STOCKAKHIR =IFNULL(OlD.JMLSebelum,0) WHERE KODEBRG = Old.KODEBRG AND KODEGD = Old.KODEGD;
END */;;

DELIMITER ;

--
-- Table structure for table `tr_koreksistc_m`
--

CREATE TABLE `tr_koreksistc_m` (
  `NoKoreksi` varchar(15) NOT NULL,
  `TglKoreksi` date default NULL,
  `Keterangan` varchar(255) default NULL,
  PRIMARY KEY  (`NoKoreksi`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_koreksistc_m`
--


--
-- Table structure for table `tr_log`
--

CREATE TABLE `tr_log` (
  `Log` varchar(50) NOT NULL default '',
  `NoBukti` varchar(20) default NULL,
  `Keterangan` varchar(500) default NULL,
  `Tanggal` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`Log`,`Tanggal`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_log`
--


--
-- Table structure for table `tr_modx`
--

CREATE TABLE `tr_modx` (
  `NoModX` varchar(11) NOT NULL default '',
  `TglModx` datetime default NULL,
  `Keterangan` varchar(200) default NULL,
  `TglBatal` datetime default NULL,
  PRIMARY KEY  (`NoModX`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_modx`
--


--
-- Table structure for table `tr_mutasibuku`
--

CREATE TABLE `tr_mutasibuku` (
  `TransMutasiBuku` varchar(2) NOT NULL,
  `NoMutasiBuku` varchar(11) NOT NULL,
  `NoJual` varchar(11) default NULL,
  `Tanggal` datetime default NULL,
  `ItemMutasi` varchar(11) default NULL,
  `KodeCustAsal` varchar(10) default NULL,
  `KodeCustTujuan` varchar(10) default NULL,
  `KodeBrg` varchar(50) default NULL,
  `NamaBrg` varchar(50) default NULL,
  `Tahun` int(11) default NULL,
  `Semester` int(11) default NULL,
  `Jml` double default NULL,
  `Harga` double default NULL,
  `Satuan` varchar(10) default NULL,
  `Nilai` double default NULL,
  `Keterangan` text,
  `itemjual` int(11) default NULL,
  PRIMARY KEY  (`TransMutasiBuku`,`NoMutasiBuku`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_mutasibuku`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `mutasibkAdd` AFTER INSERT ON `tr_mutasibuku` FOR EACH ROW BEGIN
update tm_customer set piutang=ifnull(piutang,0)-new.nilai where kodecust=new.kodecustasal;
update tm_customer set piutang=ifnull(piutang,0)+new.nilai where kodecust=new.kodecusttujuan;
update tr_jual_d set dimutasi=ifnull(dimutasi,0)+new.jml where nojual=new.nojual and itemjual=new.itemjual;
END */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `mutasibkUpdate` AFTER UPDATE ON `tr_mutasibuku` FOR EACH ROW BEGIN
update tm_customer set piutang=ifnull(piutang,0)+old.nilai where kodecust=old.kodecustasal;
update tm_customer set piutang=ifnull(piutang,0)-old.nilai where kodecust=old.kodecusttujuan;
update tm_customer set piutang=ifnull(piutang,0)-new.nilai where kodecust=new.kodecustasal;
update tm_customer set piutang=ifnull(piutang,0)+new.nilai where kodecust=new.kodecusttujuan;
update tr_jual_d set dimutasi=ifnull(dimutasi,0)+new.jml where nojual=new.nojual and itemjual=new.itemjual;
update tr_jual_d set dimutasi=ifnull(dimutasi,0)-old.jml where nojual=old.nojual and itemjual=old.itemjual;
END */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `mutasibkDel` AFTER DELETE ON `tr_mutasibuku` FOR EACH ROW BEGIN
update tm_customer set piutang=ifnull(piutang,0)+old.nilai where kodecust=old.kodecustasal;
update tm_customer set piutang=ifnull(piutang,0)-old.nilai where kodecust=old.kodecusttujuan;
update tr_jual_d set dimutasi=ifnull(dimutasi,0)-old.jml where nojual=old.nojual and itemjual=old.itemjual;
END */;;

DELIMITER ;

--
-- Table structure for table `tr_mutasigd`
--

CREATE TABLE `tr_mutasigd` (
  `NoPindah` varchar(11) default NULL,
  `TglPindah` date default NULL,
  `ItemPindah` int(11) default NULL,
  `KodeBrg` varchar(20) default NULL,
  `TokoAsal` varchar(1) default NULL,
  `KodeGDAsal` varchar(5) default NULL,
  `TokoTujuan` varchar(1) default NULL,
  `KodeGDTujuan` varchar(5) default NULL,
  `Jumlah` double default NULL,
  `Satuan` varchar(10) default NULL,
  `Konv` double default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_mutasigd`
--


--
-- Table structure for table `tr_opnameall`
--

CREATE TABLE `tr_opnameall` (
  `TglOpname` datetime NOT NULL default '0000-00-00 00:00:00',
  `KodeBrg` varchar(20) NOT NULL,
  `JmlStock` double default NULL,
  `JmlOpname` double default NULL,
  `JmlUpdate` double default NULL,
  `KodeGd` varchar(5) NOT NULL,
  PRIMARY KEY  (`TglOpname`,`KodeBrg`),
  KEY `fk_OpnameAll1` (`KodeGd`),
  KEY `fk_OpnameAll2` (`KodeBrg`),
  CONSTRAINT `fk_OpnameAll1` FOREIGN KEY (`KodeGd`) REFERENCES `tm_gudang` (`KodeGd`),
  CONSTRAINT `fk_OpnameAll2` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_opnameall`
--


--
-- Table structure for table `tr_pindahgd_d`
--

CREATE TABLE `tr_pindahgd_d` (
  `NoPindahGd` varchar(11) NOT NULL default '',
  `ItemDet` int(11) NOT NULL default '0',
  `KodeBrg` varchar(20) NOT NULL,
  `KodeGdAsal` varchar(5) NOT NULL,
  `KodeGdTujuan` varchar(5) NOT NULL,
  `Jumlah` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv` int(11) default NULL,
  PRIMARY KEY  (`NoPindahGd`,`ItemDet`),
  KEY `fk_DetPIndahGd2` (`KodeBrg`),
  KEY `fk_DetPindahGd3` (`KodeGdAsal`),
  KEY `fk_DetPindahGd4` (`KodeGdTujuan`),
  CONSTRAINT `fk_DetPindahGd1` FOREIGN KEY (`NoPindahGd`) REFERENCES `tr_pindahgd_m` (`NoPindahGd`),
  CONSTRAINT `fk_DetPIndahGd2` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`),
  CONSTRAINT `fk_DetPindahGd3` FOREIGN KEY (`KodeGdAsal`) REFERENCES `tm_gudang` (`KodeGd`),
  CONSTRAINT `fk_DetPindahGd4` FOREIGN KEY (`KodeGdTujuan`) REFERENCES `tm_gudang` (`KodeGd`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_pindahgd_d`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetPindahGdAdd` AFTER INSERT ON `tr_pindahgd_d` FOR EACH ROW BEGIN
Declare vtemp double;
Declare vJml double;
  select stockakhir-new.jumlah into vJml from tm_stockbrg where kodeGd=new.KodeGDasal and kodebrg=new.kodebrg;
     select count(*) into vtemp from tm_stockbrg where kodebrg=new.kodebrg and kodeGd= new.KodeGDTujuan;
     if vtemp = 0 then
        insert  into tm_stockbrg (kodebrg,kodegd,StockAwal,stockakhir) values (new.kodebrg,new.kodegdtujuan,0,new.Jumlah*new.konv);
        Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)-new.jumlah*new.konv where kodeGd= new.KodeGDAsal and kodebrg=new.kodebrg;
     else  
        Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)+new.jumlah*new.konv where kodeGd= new.KodeGDTujuan and kodebrg=new.kodebrg;
        Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)-new.jumlah*new.konv where kodeGd= new.KodeGDAsal and kodebrg=new.kodebrg;
     end if;
END */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetPindahGdUpdate` AFTER UPDATE ON `tr_pindahgd_d` FOR EACH ROW BEGIN
declare vtemp double;
declare vJmltujuan double;
declare vJmlasal   double;
declare vJml   double;
  select count(*) into vtemp from tm_stockbrg where kodeGd= new.KodeGDTujuan and kodebrg=new.kodebrg;
  select ifnull(stockakhir,0)-new.jumlah into vJmlAsal from tm_stockbrg where kodeGd= new.KodeGDAsal and kodebrg=new.kodebrg;
  select ifnull(stockakhir,0)-old.jumlah into vJmlTujuan from tm_stockbrg where kodeGd= old.KodeGDTujuan and kodebrg=old.kodebrg;
     if vtemp = 0 then
        insert  into tm_stockbrg (kodebrg,kodegd,StockAwal,stockakhir) values (new.kodebrg,new.kodegdtujuan,0,new.jumlah*new.konv);
 
        Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)+old.Jumlah*old.konv where kodeGd= old.KodeGDasal and kodebrg=old.kodebrg;
        Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)-new.Jumlah*new.konv where kodeGd= new.KodeGDasal and kodebrg=new.kodebrg;
        Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)-old.Jumlah*old.konv where kodeGd= old.KodeGDtujuan and kodebrg=old.kodebrg;
     else
        Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)+new.Jumlah*new.konv where kodeGd= new.KodeGDTujuan and kodebrg=new.kodebrg;
        Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)+old.Jumlah*old.konv where kodeGd= old.KodeGDasal and kodebrg=old.kodebrg;
        Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)-new.Jumlah*new.konv where kodeGd= new.KodeGDasal and kodebrg=new.kodebrg;
        Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)-old.Jumlah*old.konv where kodeGd= old.KodeGDtujuan and kodebrg=old.kodebrg;
     end if;
END */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetPindahGdDelete` AFTER DELETE ON `tr_pindahgd_d` FOR EACH ROW BEGIN
declare vtemp double;
Declare vJmlTujuan double;
  select ifnull(stockakhir,0)-old.jumlah into vJmlTujuan from tm_stockbrg where kodeGd= old.KodeGDTujuan and kodebrg=old.kodebrg;
  select count(*) into vtemp from tm_stockbrg where kodeGd= old.KodeGDtujuan and kodebrg=old.kodebrg;
  
     if vtemp > 0 then
       Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)-old.Jumlah*old.konv where kodeGd= old.KodeGDTujuan and kodebrg=old.kodebrg;
       Update tm_stockbrg set Stockakhir =  ifnull(stockakhir,0)+old.Jumlah*old.konv where kodeGd= old.KodeGDAsal and kodebrg=old.kodebrg;
     END if;
 
END */;;

DELIMITER ;

--
-- Table structure for table `tr_pindahgd_m`
--

CREATE TABLE `tr_pindahgd_m` (
  `NoPindahGd` varchar(11) NOT NULL default '',
  `TglPindahGd` datetime default NULL,
  `Keterangan` varchar(200) default NULL,
  `TglBatal` datetime default NULL,
  PRIMARY KEY  (`NoPindahGd`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_pindahgd_m`
--


--
-- Table structure for table `tr_piusem`
--

CREATE TABLE `tr_piusem` (
  `KodeCust` varchar(20) default NULL,
  `NamaCust` varchar(75) default NULL,
  `Alamat` varchar(75) default NULL,
  `Kota` varchar(50) default NULL,
  `Telp` varchar(20) default NULL,
  `Semester` varchar(20) default NULL,
  `Piutang_sem` double default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_piusem`
--


--
-- Table structure for table `tr_pobeli_d`
--

CREATE TABLE `tr_pobeli_d` (
  `NoPO` varchar(11) NOT NULL,
  `ItemPO` int(11) NOT NULL,
  `KodeBrg` varchar(20) default NULL,
  `Keterangan` varchar(100) default NULL,
  `Harga` double default NULL,
  `Disc` double default NULL,
  `Jml` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv` double default NULL,
  `SdhTerima` double default NULL,
  `TglFinish` datetime default NULL,
  `Sisa` double default NULL,
  PRIMARY KEY  (`NoPO`,`ItemPO`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_pobeli_d`
--


--
-- Table structure for table `tr_pobeli_m`
--

CREATE TABLE `tr_pobeli_m` (
  `NoPO` varchar(11) NOT NULL,
  `TglPO` datetime default NULL,
  `TglBatal` datetime default NULL,
  `KodeSupp` varchar(10) default NULL,
  `Keterangan` varchar(200) default NULL,
  `DiscRp` double default NULL,
  `Tambahan` double default NULL,
  `KetTambahan` varchar(50) default NULL,
  `PPN` double default NULL,
  `PPNRps` double default NULL,
  `SyaratByr` int(11) default NULL,
  `KetSyaratByr` varchar(50) default NULL,
  `Valas` varchar(10) default NULL,
  `ExRate` double default NULL,
  `TglJt` datetime default NULL,
  PRIMARY KEY  (`NoPO`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_pobeli_m`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `poBeliAdd` AFTER INSERT ON `tr_pobeli_m` FOR EACH ROW insert into totoritas(Trans,Nobukti,TglTrans) values ("PO",new.NOPO,new.TglPO) */;;

DELIMITER ;

--
-- Table structure for table `tr_pojual_d`
--

CREATE TABLE `tr_pojual_d` (
  `NoPO` varchar(11) NOT NULL default '',
  `ItemPO` int(11) NOT NULL default '0',
  `KodeBrg` varchar(20) default NULL,
  `Keterangan` varchar(100) default NULL,
  `Harga` double default NULL,
  `Disc` double default NULL,
  `Jml` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv` double default NULL,
  `SdhTerima` double default NULL,
  `TglFinish` datetime default NULL,
  PRIMARY KEY  (`NoPO`,`ItemPO`),
  KEY `fk_POJual_d2` (`KodeBrg`),
  CONSTRAINT `fk_POJual_d1` FOREIGN KEY (`NoPO`) REFERENCES `tr_pojual_m` (`NoPO`),
  CONSTRAINT `fk_POJual_d2` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_pojual_d`
--


--
-- Table structure for table `tr_pojual_m`
--

CREATE TABLE `tr_pojual_m` (
  `NoPO` varchar(11) NOT NULL default '',
  `TglPO` datetime default NULL,
  `TglBatal` datetime default NULL,
  `KodeCust` varchar(10) default NULL,
  `Keterangan` varchar(200) default NULL,
  `DiscRp` double default NULL,
  `Tambahan` double default NULL,
  `KetTambahan` varchar(50) default NULL,
  `PPN` double default NULL,
  `PPNRps` double default NULL,
  `SyaratByr` int(11) default NULL,
  `KetSyaratByr` varchar(50) default NULL,
  `Valas` varchar(10) default NULL,
  `Exrate` double default NULL,
  `nilai` double default NULL,
  PRIMARY KEY  (`NoPO`),
  KEY `fk_tr_POJual_m` (`KodeCust`),
  CONSTRAINT `fk_tr_POJual_m` FOREIGN KEY (`KodeCust`) REFERENCES `tm_customer` (`KodeCust`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_pojual_m`
--


--
-- Table structure for table `tr_pojualrakitan_d`
--

CREATE TABLE `tr_pojualrakitan_d` (
  `NoPO` varchar(11) NOT NULL default '',
  `ItemPO` int(11) NOT NULL default '0',
  `KodeBrg` varchar(20) default NULL,
  `Keterangan` varchar(100) default NULL,
  `Harga` double default NULL,
  `Disc` double default NULL,
  `Jml` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv` double default NULL,
  `SdhTerima` double default NULL,
  `TglFinish` datetime default NULL,
  PRIMARY KEY  (`NoPO`,`ItemPO`),
  KEY `fk_POJualrakitan_d2` (`KodeBrg`),
  CONSTRAINT `fk_POJualrakitan_d1` FOREIGN KEY (`NoPO`) REFERENCES `tr_pojualrakitan_m` (`NoPO`) ON DELETE CASCADE,
  CONSTRAINT `fk_POJualrakitan_d2` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_pojualrakitan_d`
--


--
-- Table structure for table `tr_pojualrakitan_m`
--

CREATE TABLE `tr_pojualrakitan_m` (
  `NoPO` varchar(11) NOT NULL default '',
  `TglPO` datetime default NULL,
  `TglBatal` datetime default NULL,
  `KodeCust` varchar(10) default NULL,
  `KodeRakitan` varchar(20) default NULL,
  `JmlRakitan` int(11) default NULL,
  `SdhTerima` int(11) default NULL,
  `Keterangan` varchar(200) default NULL,
  `DiscRp` double default NULL,
  `Tambahan` double default NULL,
  `KetTambahan` varchar(50) default NULL,
  `PPN` double default NULL,
  `PPNRps` double default NULL,
  `SyaratByr` int(11) default NULL,
  `KetSyaratByr` varchar(50) default NULL,
  `Valas` varchar(10) default NULL,
  `Exrate` double default NULL,
  PRIMARY KEY  (`NoPO`),
  KEY `fk_tr_POJualrakitan_m` (`KodeCust`),
  CONSTRAINT `fk_tr_POJualrakitan_m` FOREIGN KEY (`KodeCust`) REFERENCES `tm_customer` (`KodeCust`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_pojualrakitan_m`
--


--
-- Table structure for table `tr_retbeli_d`
--

CREATE TABLE `tr_retbeli_d` (
  `TransRetB` varchar(2) NOT NULL default '',
  `NoRetB` varchar(11) NOT NULL default '',
  `ItemRetB` int(11) NOT NULL default '0',
  `TransBeli` varchar(2) default NULL,
  `NoBeli` varchar(11) default NULL,
  `itemBeli` int(11) default NULL,
  `KodeBrg` varchar(20) NOT NULL,
  `KodeGd` varchar(5) NOT NULL,
  `Harga` double default NULL,
  `Disc` double default NULL,
  `Jml` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv` double default NULL,
  `Diganti` varchar(2) default NULL,
  `Replaced` varchar(1) default NULL,
  `Locked` varchar(1) default NULL,
  `Direplace` double default NULL,
  `Sisa` double default NULL,
  PRIMARY KEY  (`TransRetB`,`NoRetB`,`ItemRetB`),
  KEY `fk_tr_RetBeli_d2` (`KodeGd`),
  KEY `fk_tr_RetBeli_d3` (`KodeBrg`),
  KEY `fk_tr_RetBeli_d4` (`TransBeli`,`NoBeli`,`itemBeli`),
  CONSTRAINT `fk_tr_RetBeli_d1` FOREIGN KEY (`TransRetB`, `NoRetB`) REFERENCES `tr_retbeli_m` (`TransRetB`, `NoRetB`),
  CONSTRAINT `fk_tr_RetBeli_d2` FOREIGN KEY (`KodeGd`) REFERENCES `tm_gudang` (`KodeGd`),
  CONSTRAINT `fk_tr_RetBeli_d3` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`),
  CONSTRAINT `fk_tr_RetBeli_d4` FOREIGN KEY (`TransBeli`, `NoBeli`, `itemBeli`) REFERENCES `tr_beli_d` (`TransBeli`, `NoBeli`, `ItemBeli`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_retbeli_d`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetRetBeliAdd` AFTER INSERT ON `tr_retbeli_d` FOR EACH ROW BEGIN
declare vnoretb varchar(11);
DECLARE vjumlah  double; 
DECLARE vTglBatal datetime;
Declare vnobeli varchar(11);
declare vcode varchar(20);
declare vitemBeli int;
declare vtrans varchar(2);
declare vTransbeli varchar(2);
declare vKodeGd varchar(5);
 select TransRetB,NoretB,Kodebrg, ifnull(jml,0),kodegd, ifnull(TransBeli,''), ifnull(NoBeli,''), ifnull(itemBeli,0) into vtrans,vNoretB,vcode,vjumlah,vkodegd, vTransbeli, vNoBeli, vItemBeli 
 from Tr_RetBeli_d where TransRetB = new.TransRetB and NoretB = new.NoretB and ItemRetB=new.ItemretB;
 select Tglbatal into vTglbatal from Tr_RetBeli_M where new.TransRetB and NoretB = new.NoretB;
 update tm_stockbrg set stockakhir = ifnull(stockakhir,0) -new.jml where kodebrg=new.kodebrg and kodeGd= new.KodeGD; 
 
 if (vnobeli<>'') and (vTransBeli<>'') and (vItemBeli<>0) then
    update Tr_Beli_d set diretur = ifnull(diretur,0) + vJumlah where Transbeli=vTransBeli and nobeli=vnobeli and ItemBeli=vItemBeli;
 end if;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetRetBeliUpdate` AFTER UPDATE ON `tr_retbeli_d` FOR EACH ROW BEGIN
 declare vnoretb varchar(11);
 DECLARE vjumlah  double; 
 DECLARE vTglBatal datetime;
 Declare vnobeli varchar(11);
 declare vcode varchar(20);
 declare vitemBeli int;
 declare vtrans varchar(2);
 declare vTransbeli varchar(2);
 declare vKodeGd varchar(5);
  select TransRetB,NoretB,Kodebrg, ifnull(jml,0),kodegd, ifnull(TransBeli,''), ifnull(NoBeli,''), ifnull(itemBeli,0) into vtrans,vNoretB,vcode,vjumlah,vkodegd, vTransbeli, vNoBeli, vItemBeli 
  from Tr_RetBeli_d where TransRetB = new.TransRetB and NoretB = new.NoretB and ItemRetB=new.ItemretB;
  select Tglbatal into vTglbatal from Tr_RetBeli_M where new.TransRetB and NoretB = new.NoretB;
  update tm_stockbrg set stockakhir = ifnull(stockakhir,0) +Old.jml where kodebrg=Old.kodebrg and kodeGd= Old.KodeGD; 
  update tm_stockbrg set stockakhir = ifnull(stockakhir,0) -new.jml where kodebrg=new.kodebrg and kodeGd= new.KodeGD; 
  update tr_Beli_d set diretur = ifnull(diretur,0)-Old.Jml  where Transbeli=old.TransBeli and nobeli=old.nobeli and ItemBeli=old.ItemBeli;
  update tr_Beli_d set diretur = ifnull(diretur,0)+New.Jml  where Transbeli=new.TransBeli and nobeli=new.nobeli and ItemBeli=new.ItemBeli;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetRetBeliDelete` AFTER DELETE ON `tr_retbeli_d` FOR EACH ROW BEGIN
if ifNull(Old.locked,'N')<>'Y' then
 update tm_stockbrg set stockakhir = ifnull(stockakhir,0) +Old.jml where kodebrg=Old.kodebrg and kodeGd= Old.KodeGD; 
end if;
if ifNull(Old.locked,'N')='Y' then
 update tm_stockbrg set stockakhir = ifnull(stockakhir,0) +Old.sisa where kodebrg=Old.kodebrg and kodeGd= Old.KodeGD; 
end if;
 update tr_Beli_d set diretur = ifnull(diretur,0)-Old.Jml  where Transbeli=old.TransBeli and nobeli=old.nobeli and ItemBeli=old.ItemBeli;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_retbeli_m`
--

CREATE TABLE `tr_retbeli_m` (
  `TransRetB` varchar(2) NOT NULL default '',
  `NoRetB` varchar(11) NOT NULL default '',
  `TglRetB` datetime default NULL,
  `TglBatal` datetime default NULL,
  `KodeSupp` varchar(10) default NULL,
  `Keterangan` varchar(200) default NULL,
  `TRansBeli` varchar(2) default NULL,
  `NoBeli` varchar(11) default NULL,
  `DiscRp` double default NULL,
  `Tambahan` double default NULL,
  `KetTambahan` varchar(50) default NULL,
  `PPN` double default NULL,
  `PPNRps` double default NULL,
  `Nilai` double default NULL,
  `Sisa` double default NULL,
  `valas` varchar(10) default NULL,
  `ExRate` double default NULL,
  `TipeRetur` varchar(1) default NULL,
  PRIMARY KEY  (`TransRetB`,`NoRetB`),
  KEY `fk_tr_RetBeli_m1` (`KodeSupp`),
  KEY `fk_tr_RetBeli_m2` (`TRansBeli`,`NoBeli`),
  CONSTRAINT `fk_tr_RetBeli_m1` FOREIGN KEY (`KodeSupp`) REFERENCES `tm_supplier` (`KodeSupp`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_retbeli_m`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `trRetBeliAdd` AFTER INSERT ON `tr_retbeli_m` FOR EACH ROW BEGIN
  Update tm_Supplier set Hutang =  ifnull(hutang,0) - new.nilai * new.exrate 
  where kodesupp = new.kodesupp;
  Update tr_beli_m set sisa =  ifnull(sisa,0) - new.nilai * new.exrate 
  where TransBeli = new.TransBeli and NoBeli=New.NoBeli;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `trRetBeliUpdate` AFTER UPDATE ON `tr_retbeli_m` FOR EACH ROW BEGIN
  Update tm_Supplier set Hutang =  ifnull(hutang,0) +  old.nilai *  Old.exrate 
  where kodesupp = old.kodesupp;
  
  Update tm_Supplier set Hutang =  ifnull(hutang,0) -  new.nilai *  new.exrate 
  where kodesupp = new.kodesupp;
  Update tr_beli_m set sisa =  ifnull(sisa,0) - new.nilai * new.exrate 
  where TransBeli = new.TransBeli and NoBeli=New.NoBeli;
  Update tr_beli_m set sisa =  ifnull(sisa,0) + old.nilai * old.exrate 
  where TransBeli = old.TransBeli and NoBeli=old.NoBeli;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `trRetBeliDelete` AFTER DELETE ON `tr_retbeli_m` FOR EACH ROW BEGIN
  Update tm_Supplier set Hutang =  ifnull(hutang,0) + (Old.nilai * Old.exrate) 
  where kodesupp = Old.kodesupp;
  Update tr_beli_m set sisa =  ifnull(sisa,0) + old.nilai * old.exrate 
  where TransBeli = old.TransBeli and NoBeli=old.NoBeli;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_retjual_d`
--

CREATE TABLE `tr_retjual_d` (
  `TransRetJ` varchar(2) NOT NULL default '',
  `NoRetJ` varchar(11) NOT NULL default '',
  `ItemRetJ` int(11) NOT NULL default '0',
  `TransJual` varchar(2) default NULL,
  `NoJual` varchar(11) default NULL,
  `ItemJual` int(11) default NULL,
  `KodeBrg` varchar(20) NOT NULL,
  `KodeGd` varchar(5) NOT NULL,
  `Harga` double default NULL,
  `Disc` double default NULL,
  `Jml` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv` double default NULL,
  `Replace` varchar(1) default NULL,
  PRIMARY KEY  (`TransRetJ`,`NoRetJ`,`ItemRetJ`),
  KEY `fk_Tr_RetJual_D1` (`KodeGd`),
  KEY `fk_Tr_RetJual_D2` (`KodeBrg`),
  KEY `fk_Tr_RetJual_D3` (`TransJual`,`NoJual`,`ItemJual`),
  KEY `fk_Tr_RetJual_D7` (`TransJual`,`NoJual`,`ItemJual`),
  CONSTRAINT `fk_Tr_RetJual_D4` FOREIGN KEY (`TransRetJ`, `NoRetJ`) REFERENCES `tr_retjual_m` (`TransRetJ`, `NoRetJ`),
  CONSTRAINT `fk_Tr_RetJual_D5` FOREIGN KEY (`KodeGd`) REFERENCES `tm_gudang` (`KodeGd`),
  CONSTRAINT `fk_Tr_RetJual_D6` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`),
  CONSTRAINT `fk_Tr_RetJual_D7` FOREIGN KEY (`TransJual`, `NoJual`, `ItemJual`) REFERENCES `tr_jual_d` (`TransJual`, `NoJual`, `ItemJual`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_retjual_d`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetREtJualAdd` AFTER INSERT ON `tr_retjual_d` FOR EACH ROW BEGIN
  Update tm_StockBrg set stockakhir = ifnull(stockakhir,0) + new.jml where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
  update tr_jual_d set diretur = ifnull(diretur,0) + new.Jml  where nojual = new.nojual and TransJual=new.Transjual and ItemJual=new.ItemJual;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetREtJualUpdate` AFTER UPDATE ON `tr_retjual_d` FOR EACH ROW BEGIN
  Update tm_StockBrg set stockakhir = ifnull(stockakhir,0) - Old.jml where kodebrg=Old.kodebrg and kodeGd= Old.KodeGD;
  Update tm_StockBrg set stockakhir = ifnull(stockakhir,0) + New.jml where kodebrg=New.kodebrg and kodeGd= New.KodeGD;
  update tr_jual_d set diretur = ifnull(diretur,0) -Old.Jml  where nojual = Old.nojual and TransJual=Old.Transjual and ItemJual=Old.ItemJual;
  update tr_jual_d set diretur = ifnull(diretur,0) +New.Jml  where nojual = New.nojual and TransJual=New.Transjual and ItemJual=New.ItemJual;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetREtJualDelete` AFTER DELETE ON `tr_retjual_d` FOR EACH ROW BEGIN
Update tm_StockBrg set stockakhir = ifnull(stockakhir,0) - Old.jml where kodebrg=Old.kodebrg and kodeGd= Old.KodeGD;
update tr_jual_d set diretur = ifnull(diretur,0) - Old.Jml  where nojual = Old.nojual and TransJual=Old.Transjual and ItemJual=Old.ItemJual;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_retjual_m`
--

CREATE TABLE `tr_retjual_m` (
  `TransRetJ` varchar(2) NOT NULL default '',
  `NoRetJ` varchar(11) NOT NULL default '',
  `TglRetJ` datetime default NULL,
  `TglBatal` datetime default NULL,
  `KodeCust` varchar(10) default NULL,
  `Keterangan` varchar(200) default NULL,
  `TRansJual` varchar(2) default NULL,
  `NoJual` varchar(11) default NULL,
  `DiscRp` double default NULL,
  `Tambahan` double default NULL,
  `KetTambahan` varchar(50) default NULL,
  `PPN` double default NULL,
  `PPNRps` double default NULL,
  `Nilai` double default NULL,
  `Valas` varchar(10) default NULL,
  `ExRate` double default NULL,
  `Sisa` double default NULL,
  PRIMARY KEY  (`TransRetJ`,`NoRetJ`),
  KEY `fk_Tr_RetJual_M1` (`KodeCust`),
  KEY `fk_Tr_RetJual_M2` (`TRansJual`,`NoJual`),
  CONSTRAINT `fk_Tr_RetJual_M1` FOREIGN KEY (`KodeCust`) REFERENCES `tm_customer` (`KodeCust`),
  CONSTRAINT `fk_Tr_RetJual_M2` FOREIGN KEY (`TRansJual`, `NoJual`) REFERENCES `tr_jual_m` (`TransJual`, `NoJual`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_retjual_m`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TrRetJualAdd` AFTER INSERT ON `tr_retjual_m` FOR EACH ROW BEGIN
Declare vPiutang double;
Declare vSisa double;
  select ifnull(Piutang,0) into vPiutang from tm_Customer where kodeCust = new.kodeCust; 
  Update tm_Customer set Piutang =  ifnull(Piutang,0) - new.nilai * new.exrate 
  where kodeCust = new.kodeCust;
  Update tr_Jual_m set sisa =  ifnull(sisa,0) - new.nilai * new.exrate 
  where TransJual = new.TransJual and NoJual=New.NoJual;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TrRetJualUpdate` AFTER UPDATE ON `tr_retjual_m` FOR EACH ROW BEGIN
Declare vPiutang double;
Declare vSisa double;
  select ifnull(Piutang,0) into vPiutang from tm_Customer where kodeCust = new.kodeCust; 
  Update tm_Customer set Piutang =  ifnull(Piutang,0) - new.nilai * new.exrate 
  where kodeCust = new.kodeCust;
  Update tm_Customer set Piutang =  ifnull(Piutang,0) + Old.nilai * Old.exrate 
  where kodeCust = Old.kodeCust;
  Update tr_Jual_m set sisa =  ifnull(sisa,0) - new.nilai * new.exrate 
  where TransJual = new.TransJual and NoJual=New.NoJual;
  Update tr_Jual_m set sisa =  ifnull(sisa,0) + old.nilai * old.exrate 
  where TransJual = old.TransJual and NoJual=old.NoJual;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TrRetJualDelete` AFTER DELETE ON `tr_retjual_m` FOR EACH ROW BEGIN
Declare vSisa double;
  Update tm_Customer set Piutang =  ifnull(Piutang,0) + Old.nilai * Old.exrate 
  where kodeCust = Old.kodeCust;
  Update tr_Jual_m set sisa =  ifnull(sisa,0) + old.nilai * old.exrate 
  where TransJual = old.TransJual and NoJual=old.NoJual;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_retjualr_d`
--

CREATE TABLE `tr_retjualr_d` (
  `TransRetJ` varchar(2) NOT NULL default '',
  `NoRetJ` varchar(11) NOT NULL default '',
  `ItemRetJ` int(11) NOT NULL default '0',
  `TransJual` varchar(2) default NULL,
  `NoJual` varchar(11) default NULL,
  `ItemJual` int(11) default NULL,
  `KodeBrg` varchar(20) NOT NULL,
  `KodeGd` varchar(5) NOT NULL,
  `Harga` double default NULL,
  `Disc` double default NULL,
  `Jml` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv` double default NULL,
  PRIMARY KEY  (`TransRetJ`,`NoRetJ`,`ItemRetJ`),
  KEY `fk_Tr_RetJualr_D1` (`KodeGd`),
  KEY `fk_Tr_RetJualr_D2` (`KodeBrg`),
  KEY `fk_Tr_RetJualr_D3` (`TransJual`,`NoJual`,`ItemJual`),
  KEY `fk_Tr_RetJualr_D7` (`TransJual`,`NoJual`,`ItemJual`),
  CONSTRAINT `fk_Tr_RetJualr_D4` FOREIGN KEY (`TransRetJ`, `NoRetJ`) REFERENCES `tr_retjualr_m` (`TransRetJ`, `NoRetJ`),
  CONSTRAINT `fk_Tr_RetJualr_D5` FOREIGN KEY (`KodeGd`) REFERENCES `tm_gudang` (`KodeGd`),
  CONSTRAINT `fk_Tr_RetJualr_D6` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`),
  CONSTRAINT `fk_Tr_RetJualr_D7` FOREIGN KEY (`TransJual`, `NoJual`, `ItemJual`) REFERENCES `tr_jualr_d` (`TransRetail`, `NoJualR`, `ItemJual`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_retjualr_d`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetREtJualRAdd` AFTER INSERT ON `tr_retjualr_d` FOR EACH ROW BEGIN
  Update tm_StockBrg set stockakhir = ifnull(stockakhir,0) + new.jml where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
  update tr_jualR_d set diretur = ifnull(diretur,0) + new.Jml where nojualR = new.nojual and TransRetail=new.Transjual and ItemJual=new.ItemJual;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetREtJualRUpdate` AFTER UPDATE ON `tr_retjualr_d` FOR EACH ROW BEGIN
  Update tm_StockBrg set stockakhir = ifnull(stockakhir,0) - (old.jml-new.jml) where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
  update tr_jualR_d set diretur = ifnull(diretur,0) - (new.jml-old.jml) where nojualR=new.nojual and TransRetail=new.Transjual and ItemJual=new.ItemJual;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetREtJualRDelete` AFTER DELETE ON `tr_retjualr_d` FOR EACH ROW BEGIN
  Update tm_StockBrg set stockakhir = ifnull(stockakhir,0) - old.jml 
  where kodebrg=Old.kodebrg and kodeGd= Old.KodeGD;
  update tr_jualR_d set diretur = ifnull(diretur,0) - Old.Jml
  where nojualR=Old.nojual and TransRetail=Old.Transjual and ItemJual=Old.ItemJual;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_retjualr_m`
--

CREATE TABLE `tr_retjualr_m` (
  `TransRetJ` varchar(2) NOT NULL default '',
  `NoRetJ` varchar(11) NOT NULL default '',
  `TglRetJ` datetime default NULL,
  `TglBatal` datetime default NULL,
  `NamaCust` varchar(50) default NULL,
  `Alamat` varchar(50) default NULL,
  `Kota` varchar(30) default NULL,
  `Keterangan` varchar(200) default NULL,
  `TRansJual` varchar(2) default NULL,
  `NoJual` varchar(11) default NULL,
  `DiscRp` double default NULL,
  `Tambahan` double default NULL,
  `KetTambahan` varchar(50) default NULL,
  `PPN` double default NULL,
  `PPNRps` double default NULL,
  `Nilai` double default NULL,
  `Valas` varchar(10) default NULL,
  `ExRate` double default NULL,
  `Sisa` double default NULL,
  PRIMARY KEY  (`TransRetJ`,`NoRetJ`),
  KEY `fk_Tr_RetJualR_M2` (`TRansJual`,`NoJual`),
  CONSTRAINT `fk_Tr_RetJualR_M2` FOREIGN KEY (`TRansJual`, `NoJual`) REFERENCES `tr_jualr_m` (`TransRetail`, `NoJualR`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_retjualr_m`
--


--
-- Table structure for table `tr_retjualrakitan_d`
--

CREATE TABLE `tr_retjualrakitan_d` (
  `TransRetJ` varchar(2) NOT NULL default '',
  `NoRetJ` varchar(11) NOT NULL default '',
  `ItemRetJ` int(11) NOT NULL default '0',
  `TransJual` varchar(2) default NULL,
  `NoJual` varchar(11) default NULL,
  `ItemJual` int(11) default NULL,
  `KodeBrg` varchar(20) NOT NULL,
  `KodeGd` varchar(5) NOT NULL,
  `Harga` double default NULL,
  `Disc` double default NULL,
  `Jml` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv` double default NULL,
  PRIMARY KEY  (`TransRetJ`,`NoRetJ`,`ItemRetJ`),
  KEY `fk_Tr_RetJualRakitan_D1` (`KodeGd`),
  KEY `fk_Tr_RetJualRakitan_D2` (`KodeBrg`),
  KEY `fk_Tr_RetJualRakitan_D3` (`TransJual`,`NoJual`,`ItemJual`),
  KEY `fk_Tr_RetJualRakitan_D7` (`TransJual`,`NoJual`,`ItemJual`),
  CONSTRAINT `fk_Tr_RetJualRakitan_D4` FOREIGN KEY (`TransRetJ`, `NoRetJ`) REFERENCES `tr_retjualrakitan_m` (`TransRetJ`, `NoRetJ`) ON DELETE CASCADE,
  CONSTRAINT `fk_Tr_RetJualRakitan_D5` FOREIGN KEY (`KodeGd`) REFERENCES `tm_gudang` (`KodeGd`),
  CONSTRAINT `fk_Tr_RetJualRakitan_D6` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`),
  CONSTRAINT `fk_Tr_RetJualRakitan_D7` FOREIGN KEY (`TransJual`, `NoJual`, `ItemJual`) REFERENCES `tr_jualrakitan_d` (`TransJual`, `NoJual`, `ItemJual`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_retjualrakitan_d`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetREtJualRakitanAdd` AFTER INSERT ON `tr_retjualrakitan_d` FOR EACH ROW BEGIN
  Update tm_StockBrg set stockakhir = ifnull(stockakhir,0) + new.jml where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
  update tr_jualRakitan_d set diretur = ifnull(diretur,0) + new.Jml  where nojual = new.nojual and TransJual=new.Transjual and ItemJual=new.ItemJual;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetREtJualRakitanUpdate` AFTER UPDATE ON `tr_retjualrakitan_d` FOR EACH ROW BEGIN
  Update tm_StockBrg set stockakhir = ifnull(stockakhir,0) + new.jml where kodebrg=new.kodebrg and kodeGd= new.KodeGD;
  Update tm_StockBrg set stockakhir = ifnull(stockakhir,0) - Old.jml where kodebrg=Old.kodebrg and kodeGd= Old.KodeGD;
  update tr_jualrakitan_d set diretur = ifnull(diretur,0) + new.Jml  where nojual = new.nojual and TransJual=new.Transjual and ItemJual=new.ItemJual;
  update tr_jualrakitan_d set diretur = ifnull(diretur,0) - Old.Jml  where nojual = Old.nojual and TransJual=Old.Transjual and ItemJual=Old.ItemJual;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `DetREtJualRakitanDelete` AFTER DELETE ON `tr_retjualrakitan_d` FOR EACH ROW BEGIN
  Update tm_StockBrg set stockakhir = ifnull(stockakhir,0) - Old.jml where kodebrg=Old.kodebrg and kodeGd= Old.KodeGD;
  update tr_jualRakitan_d set diretur = ifnull(diretur,0) - Old.Jml  where nojual = Old.nojual and TransJual=Old.Transjual and ItemJual=Old.ItemJual;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_retjualrakitan_m`
--

CREATE TABLE `tr_retjualrakitan_m` (
  `TransRetJ` varchar(2) NOT NULL default '',
  `NoRetJ` varchar(11) NOT NULL default '',
  `TglRetJ` datetime default NULL,
  `TglBatal` datetime default NULL,
  `KodeCust` varchar(10) default NULL,
  `KodeRakitan` varchar(20) default NULL,
  `jmlrakitan` int(11) default NULL,
  `Keterangan` varchar(200) default NULL,
  `TRansJual` varchar(2) default NULL,
  `NoJual` varchar(11) default NULL,
  `DiscRp` double default NULL,
  `Tambahan` double default NULL,
  `KetTambahan` varchar(50) default NULL,
  `PPN` double default NULL,
  `PPNRps` double default NULL,
  `Nilai` double default NULL,
  `Valas` varchar(10) default NULL,
  `ExRate` double default NULL,
  `Sisa` double default NULL,
  PRIMARY KEY  (`TransRetJ`,`NoRetJ`),
  KEY `fk_Tr_RetJualR_M1` (`KodeCust`),
  KEY `fk_Tr_RetJualR_M2` (`TRansJual`,`NoJual`),
  CONSTRAINT `fk_Tr_RetJualR_M3` FOREIGN KEY (`KodeCust`) REFERENCES `tm_customer` (`KodeCust`),
  CONSTRAINT `fk_Tr_RetJualR_M4` FOREIGN KEY (`TRansJual`, `NoJual`) REFERENCES `tr_jualrakitan_m` (`TransJual`, `NoJual`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_retjualrakitan_m`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TrRetJualRakitanAdd` AFTER INSERT ON `tr_retjualrakitan_m` FOR EACH ROW BEGIN
Declare vPiutang double;
  select ifnull(Piutang,0) into vPiutang from tm_Customer where kodeCust = new.kodeCust; 
  Update tm_Customer set Piutang =  ifnull(Piutang,0) - new.nilai * new.exrate 
  where kodeCust = new.kodeCust;
  Update tr_Jualrakitan_m set sisa =  ifnull(sisa,0) - new.nilai * new.exrate 
  where TransJual = new.TransJual and NoJual=New.NoJual;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TrRetJualRakitanUpdate` AFTER UPDATE ON `tr_retjualrakitan_m` FOR EACH ROW BEGIN
Declare vPiutang double;
  select ifnull(Piutang,0) into vPiutang from tm_Customer where kodeCust = new.kodeCust; 
 
  Update tm_Customer set Piutang =  ifnull(Piutang,0) - new.nilai * new.exrate 
  where kodeCust = new.kodeCust;
  Update tm_Customer set Piutang =  ifnull(Piutang,0) + Old.nilai * Old.exrate 
  where kodeCust = Old.kodeCust;
  Update tr_Jualrakitan_m set sisa =  ifnull(sisa,0) - new.nilai * new.exrate 
  where TransJual = new.TransJual and NoJual=New.NoJual;
  Update tr_Jualrakitan_m set sisa =  ifnull(sisa,0) + old.nilai * old.exrate 
  where TransJual = old.TransJual and NoJual=old.NoJual;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `TrRetJualRakitanDelete` AFTER DELETE ON `tr_retjualrakitan_m` FOR EACH ROW BEGIN
  Update tm_Customer set Piutang =  ifnull(Piutang,0) + Old.nilai * Old.exrate 
  where kodeCust = Old.kodeCust;
  Update tr_Jualrakitan_m set sisa =  ifnull(sisa,0) + old.nilai * old.exrate 
  where TransJual = old.TransJual and NoJual=old.NoJual;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_saldocounter`
--

CREATE TABLE `tr_saldocounter` (
  `KodeShift` varchar(15) NOT NULL,
  `KodeMesin` varchar(15) NOT NULL,
  `NoClose` varchar(15) default NULL,
  `UserID` varchar(15) NOT NULL,
  `Tanggal` date NOT NULL,
  `SaldoAwal` int(11) NOT NULL,
  `SaldoAkhir` int(11) NOT NULL,
  `OverShiff` varchar(2) default NULL,
  PRIMARY KEY  (`KodeShift`,`UserID`,`Tanggal`,`KodeMesin`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_saldocounter`
--


--
-- Table structure for table `tr_savetmp`
--

CREATE TABLE `tr_savetmp` (
  `NoJualR` varchar(11) NOT NULL default '',
  `ItemJual` int(11) NOT NULL default '0',
  `KodeBrg` varchar(20) NOT NULL,
  `KodeGd` varchar(5) NOT NULL,
  `NamaBrg` varchar(50) default NULL,
  `Harga` double default NULL,
  `HargaAvg` double default NULL,
  `Disc` double default NULL,
  `DiscPersen` double default NULL,
  `Jml` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv` double default NULL,
  `Jam` datetime default NULL,
  `priceedits` varchar(1) default NULL,
  `cashr` int(11) default NULL,
  `kasir` varchar(10) default NULL,
  PRIMARY KEY  (`NoJualR`,`ItemJual`),
  KEY `fk_SaveTmp` (`KodeBrg`),
  CONSTRAINT `fk_SaveTmp` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_savetmp`
--


--
-- Table structure for table `tr_savetmpgrosir`
--

CREATE TABLE `tr_savetmpgrosir` (
  `NoJual` varchar(20) NOT NULL,
  `ItemJual` int(11) NOT NULL default '0',
  `kodebrg` varchar(15) default NULL,
  `kodegd` varchar(10) default NULL,
  `namabrg` varchar(50) default NULL,
  `harga` double default NULL,
  `hargaavg` double default NULL,
  `disc` double default NULL,
  `discpersen` double default NULL,
  `jml` double default NULL,
  `satuan` varchar(30) default NULL,
  `konv` double default NULL,
  `jam` time default NULL,
  `priceedits` double default NULL,
  `Kasir` varchar(50) default NULL,
  `Kodecust` varchar(15) default NULL,
  `NamaCust` varchar(50) default NULL,
  `AlamatCust` varchar(50) default NULL,
  PRIMARY KEY  (`NoJual`,`ItemJual`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_savetmpgrosir`
--


--
-- Table structure for table `tr_scrbayarbeli`
--

CREATE TABLE `tr_scrbayarbeli` (
  `NoBayarB` varchar(11) NOT NULL default '',
  `ItemSBayarB` int(11) NOT NULL default '0',
  `TransBeli` varchar(2) default NULL,
  `NoBeli` varchar(11) default NULL,
  `Nilai` double default NULL,
  `Valas` varchar(10) default NULL,
  `ExRate` double default NULL,
  PRIMARY KEY  (`NoBayarB`,`ItemSBayarB`),
  KEY `fk_tr_ScrBayarBeli` (`NoBayarB`),
  KEY `fk_tr_ScrBayarBeli1` (`TransBeli`,`NoBeli`),
  CONSTRAINT `fk_tr_ScrBayarBeli` FOREIGN KEY (`NoBayarB`) REFERENCES `tr_bayarbeli_m` (`NoBayarB`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_scrbayarbeli`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `ScrBayarBeliAdd` AFTER INSERT ON `tr_scrbayarbeli` FOR EACH ROW BEGIN
declare vTransbeli varchar (2);
DECLARE vNoBeli varchar (11);
DECLARE vNilai double; 
DECLARE vTglBatal datetime;
Declare vKodeSupp varchar(10);
declare vNoBayar varchar(11);
declare vExrate integer;
select ifnull(TransBeli,''), ifnull(NoBeli,''), ifnull(Nilai,0), ifnull(ExRate,1) into  vTransbeli, vNoBeli, vNilai ,vexrate 
from Tr_ScrBayarBeli where NoBayarB = new.NobayarB and ItemSBayarB=new.ItemSBayarB;
select Tglbatal,KodeSupp into vTglbatal,vKodeSupp from tr_BayarBeli_M where NoBayarB=new.NoBayarB;
if ifnull(vTglBatal,'')='' then
 update tr_beli_m set Sisa=ifnull(Sisa,0)-new.Nilai where NoBeli=vNoBeli and TransBeli=vTransBeli;
 update tM_Supplier set hutang= ifnull(Hutang,0)-new.Nilai*new.ExRate where KodeSupp=vKodeSupp;
END if;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `ScrBayarBeliUpdate` AFTER UPDATE ON `tr_scrbayarbeli` FOR EACH ROW BEGIN
declare vTransBelibaru varchar(2);
DECLARE vNoBeliBaru varchar(11);
DECLARE vNilaiBaru double; 
DECLARE vTglBatal datetime;
Declare vKodeSupp varchar(10);
declare vNoBayar varchar(11);
declare vExrateBaru integer;
declare vExrateLama integer;
declare vTransBelilama varchar(2);
declare vNoBeliLama varchar(11);
DECLARE vNilaiLama double; 
select ifnull(TransBeli,''), ifnull(NoBeli,''), ifnull(Nilai,0), ifnull(ExRate,1) into  vTransbeliBaru, vNoBeliBaru, vNilaiBaru ,vexrateBaru 
from Tr_ScrBayarBeli where NoBayarB = new.NobayarB and ItemSBayarB=new.ItemSBayarB;
select Tglbatal,KodeSupp into vTglbatal,vKodeSupp from tr_BayarBeli_M where NoBayarB=new.NoBayarB;
if ifnull(vTglBatal,'')='' then
 update tr_beli_m set Sisa=ifnull(Sisa,0)+Old.Nilai where NoBeli=Old.NoBeli and TransBeli=Old.TransBeli;
 update tr_beli_m set Sisa=ifnull(Sisa,0)-New.Nilai where NoBeli=New.NoBeli and TransBeli=New.TransBeli;
 update tM_Supplier set hutang= ifnull(Hutang,0)+(Old.Nilai*Old.ExRate ) where KodeSupp=vKodeSupp;
 update tM_Supplier set hutang= ifnull(Hutang,0)-(New.Nilai*New.ExRate) where KodeSupp=vKodeSupp;
END if;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `ScrBayarBeliDelete` AFTER DELETE ON `tr_scrbayarbeli` FOR EACH ROW BEGIN
declare vTransBelibaru varchar(2);
DECLARE vNoBeliBaru varchar(11);
DECLARE vNilaiBaru double; 
DECLARE vTglBatal datetime;
Declare vKodeSupp varchar(10);
declare vNoBayar varchar(11);
declare vExrateBaru integer;
declare vExrateLama integer;
declare vTransBelilama varchar(2);
declare vNoBeliLama varchar(11);
DECLARE vNilaiLama double; 
select ifnull(TransBeli,''), ifnull(NoBeli,''), ifnull(Nilai,0), ifnull(ExRate,1) into  vTransbeliBaru, vNoBeliBaru, vNilaiBaru ,vexrateBaru 
from Tr_ScrBayarBeli where NoBayarB = Old.NobayarB and ItemSBayarB=old.ItemSBayarB;
select Tglbatal,KodeSupp into vTglbatal,vKodeSupp from tr_BayarBeli_M where NoBayarB=Old.NoBayarB;
if ifnull(vTglBatal,'')='' then
 update tr_beli_m set Sisa=ifnull(Sisa,0)+Old.Nilai  where NoBeli=Old.NoBeli and TransBeli=Old.TransBeli;
 update tM_Supplier set hutang= ifnull(Hutang,0)+(Old.Nilai*Old.ExRate)  where KodeSupp=vKodeSupp;
END if;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_scrbayarjual`
--

CREATE TABLE `tr_scrbayarjual` (
  `NoBayarJ` varchar(11) NOT NULL default '',
  `ItemSBayarJ` int(11) NOT NULL default '0',
  `TransJual` varchar(2) default NULL,
  `NoJual` varchar(11) default NULL,
  `Nilai` double default NULL,
  `Valas` varchar(10) default NULL,
  `ExRate` double default NULL,
  `kodebyr` varchar(255) default NULL,
  PRIMARY KEY  (`NoBayarJ`,`ItemSBayarJ`),
  KEY `fk_tr_ScrBayarJual1` (`NoBayarJ`),
  KEY `fk_tr_ScrBayarJual2` (`TransJual`,`NoJual`),
  CONSTRAINT `fk_tr_ScrBayarJual3` FOREIGN KEY (`NoBayarJ`) REFERENCES `tr_bayarjual_m` (`NoBayarJ`) ON DELETE CASCADE,
  CONSTRAINT `fk_tr_ScrBayarJual4` FOREIGN KEY (`TransJual`, `NoJual`) REFERENCES `tr_jual_m` (`TransJual`, `NoJual`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_scrbayarjual`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `ScrBayarJualAdd` AFTER INSERT ON `tr_scrbayarjual` FOR EACH ROW BEGIN
declare vTransJual varchar (2);
DECLARE vNoJual varchar (11);
DECLARE vNilai double; 
DECLARE vTglBatal datetime;
Declare vKodeCust varchar(10);
declare vNoBayar varchar(11);
declare vExrate integer;
select Tglbatal,KodeCust into vTglbatal,vKodeCust from tr_BayarJual_M where NoBayarJ=new.NoBayarJ;
  Update tr_jual_m set sisa =  ifnull(sisa,0) - new.nilai * new.exrate 
  where TransJual = New.TransJual and NoJual=New.NoJual;
  Update tm_customer set piutang =  ifnull(piutang,0) - new.nilai * new.exrate 
  where KodeCust = vKodeCust;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `ScrBayarJualUpdate` AFTER UPDATE ON `tr_scrbayarjual` FOR EACH ROW BEGIN
declare vTransJual varchar (2);
DECLARE vNoJual varchar (11);
DECLARE vNilai double; 
DECLARE vTglBatal datetime;
Declare vKodeCust varchar(10);
declare vNoBayar varchar(11);
declare vExrate integer;
select Tglbatal,KodeCust into vTglbatal,vKodeCust from tr_BayarJual_M where NoBayarJ=new.NoBayarJ;
  Update tr_jual_m set sisa =  ifnull(sisa,0) - new.nilai * new.exrate 
  where TransJual = New.TransJual and NoJual=New.NoJual;
  Update tr_jual_m set sisa =  ifnull(sisa,0) + old.nilai * old.exrate 
  where TransJual = old.TransJual and NoJual = old.NoJual;
  Update tm_customer set piutang =  ifnull(piutang,0) - new.nilai * new.exrate 
  where KodeCust = vKodeCust;
  Update tm_customer set piutang =  ifnull(piutang,0) + old.nilai * old.exrate 
  where KodeCust = vKodeCust;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `ScrBayarJualDelete` AFTER DELETE ON `tr_scrbayarjual` FOR EACH ROW BEGIN
declare vTransJual varchar (2);
DECLARE vNoJual varchar (11);
DECLARE vNilai double; 
DECLARE vTglBatal datetime;
Declare vKodeCust varchar(10);
declare vNoBayar varchar(11);
declare vExrate integer;
select Tglbatal,KodeCust into vTglbatal,vKodeCust from tr_BayarJual_M where NoBayarJ=Old.NoBayarJ;
  Update tr_jual_m set sisa =  ifnull(sisa,0) + old.nilai * old.exrate 
  where TransJual = old.TransJual and NoJual = old.NoJual;
  Update tm_customer set piutang =  ifnull(piutang,0) + old.nilai * old.exrate 
  where KodeCust = vKodeCust;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_scrbayarjualrakitan`
--

CREATE TABLE `tr_scrbayarjualrakitan` (
  `NoBayarJ` varchar(11) NOT NULL default '',
  `ItemSBayarJ` int(11) NOT NULL default '0',
  `TransJual` varchar(2) default NULL,
  `NoJual` varchar(11) default NULL,
  `Nilai` double default NULL,
  `Valas` varchar(10) default NULL,
  `ExRate` double default NULL,
  `kodebyr` varchar(30) default NULL,
  PRIMARY KEY  (`NoBayarJ`,`ItemSBayarJ`),
  KEY `fk_tr_ScrBayarJualrakitan1` (`NoBayarJ`),
  KEY `fk_tr_ScrBayarJualrakitan2` (`TransJual`,`NoJual`),
  CONSTRAINT `fk_tr_ScrBayarJualrakitan3` FOREIGN KEY (`NoBayarJ`) REFERENCES `tr_bayarjualrakitan_m` (`NoBayarJ`) ON DELETE CASCADE,
  CONSTRAINT `fk_tr_ScrBayarJualrakitan4` FOREIGN KEY (`TransJual`, `NoJual`) REFERENCES `tr_jualrakitan_m` (`TransJual`, `NoJual`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_scrbayarjualrakitan`
--


DELIMITER ;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `ScrBayarJualRakitanAdd` AFTER INSERT ON `tr_scrbayarjualrakitan` FOR EACH ROW BEGIN
declare vTransJual varchar (2);
DECLARE vNoJual varchar (11);
DECLARE vNilai double; 
DECLARE vTglBatal datetime;
Declare vKodeCust varchar(10);
declare vNoBayar varchar(11);
declare vExrate integer;
select Tglbatal,KodeCust into vTglbatal,vKodeCust from tr_BayarJualRakitan_M where NoBayarJ=new.NoBayarJ;
  Update tr_JualRakitan_m set sisa =  ifnull(sisa,0) - new.nilai * new.exrate 
  where TransJual = New.TransJual and NoJual=New.NoJual;
  Update tm_customer set piutang =  ifnull(piutang,0) - new.nilai * new.exrate 
  where KodeCust = vKodeCust;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `ScrBayarJualRakitanUpdate` AFTER UPDATE ON `tr_scrbayarjualrakitan` FOR EACH ROW BEGIN
declare vTransJual varchar (2);
DECLARE vNoJual varchar (11);
DECLARE vNilai double; 
DECLARE vTglBatal datetime;
Declare vKodeCust varchar(10);
declare vNoBayar varchar(11);
declare vExrate integer;
select Tglbatal,KodeCust into vTglbatal,vKodeCust from tr_BayarJualRakitan_M where NoBayarJ=new.NoBayarJ;
  Update tr_JualRakitan_m set sisa =  ifnull(sisa,0) - new.nilai * new.exrate 
  where TransJual = New.TransJual and NoJual=New.NoJual;
  Update tr_JualRakitan_m set sisa =  ifnull(sisa,0) + old.nilai * old.exrate 
  where TransJual = old.TransJual and NoJual = old.NoJual;
  Update tm_customer set piutang =  ifnull(piutang,0) - new.nilai * new.exrate 
  where KodeCust = vKodeCust;
  Update tm_customer set piutang =  ifnull(piutang,0) + old.nilai * old.exrate 
  where KodeCust = vKodeCust;
end */;;

/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;;
/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `ScrBayarJualRakitanDelete` AFTER DELETE ON `tr_scrbayarjualrakitan` FOR EACH ROW BEGIN
declare vTransJual varchar (2);
DECLARE vNoJual varchar (11);
DECLARE vNilai double; 
DECLARE vTglBatal datetime;
Declare vKodeCust varchar(10);
declare vNoBayar varchar(11);
declare vExrate integer;
select Tglbatal,KodeCust into vTglbatal,vKodeCust from tr_BayarJualRakitan_M where NoBayarJ=Old.NoBayarJ;
  Update tr_JualRakitan_m set sisa =  ifnull(sisa,0) + old.nilai * old.exrate 
  where TransJual = old.TransJual and NoJual = old.NoJual;
  Update tm_customer set piutang =  ifnull(piutang,0) + old.nilai * old.exrate 
  where KodeCust = vKodeCust;
end */;;

DELIMITER ;

--
-- Table structure for table `tr_scrmodx`
--

CREATE TABLE `tr_scrmodx` (
  `NoModx` varchar(11) NOT NULL default '',
  `ItemModX` int(11) NOT NULL default '0',
  `Kodebrg` varchar(20) NOT NULL,
  `KodeGd` varchar(5) NOT NULL,
  `Jumlah` double default NULL,
  `Satuan` varchar(10) NOT NULL,
  `Konv` double default NULL,
  `BagHarga` double default NULL,
  PRIMARY KEY  (`NoModx`,`ItemModX`),
  KEY `fk_SCRModX2` (`Kodebrg`),
  KEY `fk_SCRModX3` (`KodeGd`),
  CONSTRAINT `fk_ScrModX1` FOREIGN KEY (`NoModx`) REFERENCES `tr_modx` (`NoModX`) ON DELETE CASCADE,
  CONSTRAINT `fk_SCRModX2` FOREIGN KEY (`Kodebrg`) REFERENCES `tm_barang` (`KodeBrg`),
  CONSTRAINT `fk_SCRModX3` FOREIGN KEY (`KodeGd`) REFERENCES `tm_gudang` (`KodeGd`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_scrmodx`
--


--
-- Table structure for table `tr_service_d`
--

CREATE TABLE `tr_service_d` (
  `TransJual` varchar(2) NOT NULL default '',
  `NoJual` varchar(11) NOT NULL default '',
  `ItemJual` int(11) NOT NULL default '0',
  `NOPO` varchar(11) default NULL,
  `ItemPO` int(11) default NULL,
  `KodeBrg` varchar(20) default NULL,
  `KodeGd` varchar(5) default NULL,
  `NamaBrg` varchar(50) default NULL,
  `Jml` double default NULL,
  `tglmasuk` datetime default NULL,
  `deadline` datetime default NULL,
  `Sales` varchar(50) default NULL,
  `Teknisi` varchar(50) default NULL,
  `service` varchar(50) default NULL,
  `status` varchar(15) default NULL,
  `noseri` varchar(20) default NULL,
  `kerusakan` varchar(50) default NULL,
  `spesifikasi` varchar(50) default NULL,
  `merek` varchar(50) default NULL,
  `model` varchar(50) default NULL,
  PRIMARY KEY  (`TransJual`,`NoJual`,`ItemJual`),
  KEY `fk_tr_Jual_d1` (`KodeBrg`),
  KEY `fk_tr_Jual_d2` (`KodeGd`),
  KEY `fk_tr_Jual_d4` (`NOPO`,`ItemPO`),
  CONSTRAINT `tr_service_d_ibfk_1` FOREIGN KEY (`KodeBrg`) REFERENCES `tm_barang` (`KodeBrg`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_service_d`
--


--
-- Table structure for table `tr_service_m`
--

CREATE TABLE `tr_service_m` (
  `TransJual` varchar(2) NOT NULL default '',
  `NoJual` varchar(11) NOT NULL default '',
  `KodeCust` varchar(10) default NULL,
  `NamaCust` varchar(50) default NULL,
  `Alamat` varchar(50) default NULL,
  `Kota` varchar(30) default NULL,
  `notelp` varchar(20) default NULL,
  `KodeSales` varchar(10) default NULL,
  `TglMasuk` datetime default NULL,
  `TglKeluar` datetime default NULL,
  `ItemKirim` int(11) default NULL,
  `Kasir` varchar(7) default NULL,
  `Teknisi` varchar(50) default NULL,
  `status` varchar(50) default NULL,
  `service` varchar(50) default NULL,
  PRIMARY KEY  (`TransJual`,`NoJual`),
  KEY `fk_TR_Jual_m2` (`KodeSales`),
  KEY `fk_TR_Jual_m3` (`KodeCust`,`ItemKirim`),
  CONSTRAINT `tr_service_m_ibfk_1` FOREIGN KEY (`KodeCust`) REFERENCES `tm_customer` (`KodeCust`),
  CONSTRAINT `tr_service_m_ibfk_2` FOREIGN KEY (`KodeCust`, `ItemKirim`) REFERENCES `tm_custkirim` (`KodeCust`, `ItemCust`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_service_m`
--


--
-- Table structure for table `tr_srckeluar_d`
--

CREATE TABLE `tr_srckeluar_d` (
  `TransRetJ` varchar(2) NOT NULL default '',
  `NoRetJ` varchar(11) NOT NULL default '',
  `ItemRetJ` int(11) NOT NULL default '0',
  `TransJual` varchar(2) default NULL,
  `NoJual` varchar(11) default NULL,
  `ItemJual` int(11) default NULL,
  `KodeBrg` varchar(20) NOT NULL,
  `KodeGd` varchar(5) NOT NULL,
  `Harga` double default NULL,
  `Disc` double default NULL,
  `Jml` double default NULL,
  `Satuan` varchar(10) default NULL,
  `Konv` double default NULL,
  `Replace` varchar(1) default NULL,
  `namabrg` varchar(25) default NULL,
  `noseri` varchar(15) default NULL,
  `tglpengerjaan` datetime default NULL,
  `kerusakan` varchar(30) default NULL,
  `spesifikasi` varchar(30) default NULL,
  `status` varchar(10) default NULL,
  `teknisi` varchar(10) default NULL,
  `tglkerja` datetime default NULL,
  PRIMARY KEY  (`TransRetJ`,`NoRetJ`,`ItemRetJ`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_srckeluar_d`
--


--
-- Table structure for table `tr_srckeluar_m`
--

CREATE TABLE `tr_srckeluar_m` (
  `TransRetJ` varchar(2) NOT NULL default '',
  `NoRetJ` varchar(11) NOT NULL default '',
  `TglRetJ` datetime default NULL,
  `TglKeluar` datetime default NULL,
  `KodeCust` varchar(10) default NULL,
  `TRansJual` varchar(2) default NULL,
  `NoJual` varchar(11) default NULL,
  `kodebrg` varchar(15) default NULL,
  `namabrg` varchar(15) default NULL,
  `namacust` varchar(30) default NULL,
  `kota` varchar(15) default NULL,
  `alamat` varchar(50) default NULL,
  `telp` varchar(15) default NULL,
  PRIMARY KEY  (`TransRetJ`,`NoRetJ`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tr_srckeluar_m`
--


--
-- Table structure for table `tuser`
--

CREATE TABLE `tuser` (
  `UserId` varchar(10) NOT NULL default '0',
  `UserName` varchar(25) default NULL,
  `Password` varchar(30) default NULL,
  `HakAkses` varchar(50) default NULL,
  `SuperUser` enum('Y','N','') default NULL,
  `IpLogin` varchar(15) default NULL,
  `AccPO` int(2) default NULL,
  `AccBeli` int(2) default NULL,
  `AccSO` int(2) default NULL,
  `AccJual` int(2) default NULL,
  PRIMARY KEY  (`UserId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tuser`
--

INSERT INTO `tuser` VALUES ('asp','asp','	I`¨ÈE¤½#E3úc','01','Y','*',NULL,NULL,NULL,NULL),('kasir','kasir','Nº^f·«´;\'_Ã1oÀ\\','03','N','*',NULL,NULL,NULL,NULL);

--
-- Table structure for table `tuserlevel`
--

CREATE TABLE `tuserlevel` (
  `userlevel_id` varchar(2) NOT NULL,
  `menu` varchar(6) NOT NULL,
  `status` varchar(1) default NULL,
  `Ket_level` varchar(20) default NULL,
  PRIMARY KEY  (`userlevel_id`,`menu`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tuserlevel`
--

INSERT INTO `tuserlevel` VALUES ('01','010000','1','MANAGER'),('01','010100','1','MANAGER'),('01','010200','1','MANAGER'),('01','010300','1','MANAGER'),('01','010400','1','MANAGER'),('01','010500','1','MANAGER'),('01','010600','1','MANAGER'),('01','010700','1','MANAGER'),('01','010900','1','MANAGER'),('01','020000','1','MANAGER'),('01','020100','1','MANAGER'),('01','020200','1','MANAGER'),('01','020300','1','MANAGER'),('01','020400','1','MANAGER'),('01','020500','1','MANAGER'),('01','020501','1','MANAGER'),('01','020600','1','MANAGER'),('01','020800','1','MANAGER'),('01','020900','1','MANAGER'),('01','021000','1','MANAGER'),('01','030000','1','MANAGER'),('01','030100','1','MANAGER'),('01','040000','1','MANAGER'),('01','040100','1','MANAGER'),('01','040101','1','MANAGER'),('01','040102','1','MANAGER'),('01','040200','1','MANAGER'),('01','040201','1','MANAGER'),('01','040202','1','MANAGER'),('01','040300','1','MANAGER'),('01','040301','1','MANAGER'),('01','040302','1','MANAGER'),('01','040401','1','MANAGER'),('01','040402','1','MANAGER'),('01','040500','1','MANAGER'),('01','040501','1','MANAGER'),('01','040502','1','MANAGER'),('01','050000','1','MANAGER'),('01','050100','1','MANAGER'),('01','050101','1','MANAGER'),('01','050102','1','MANAGER'),('01','050200','1','MANAGER'),('01','050201','1','MANAGER'),('01','050202','1','MANAGER'),('01','050301','1','MANAGER'),('01','050302','1','MANAGER'),('01','050400','1','MANAGER'),('01','050401','1','MANAGER'),('01','050402','1','MANAGER'),('01','050500','1','MANAGER'),('01','050501','1','MANAGER'),('01','050502','1','MANAGER'),('01','050600','1','MANAGER'),('01','050601','1','MANAGER'),('01','050602','1','MANAGER'),('01','050701','1','MANAGER'),('01','050702','1','MANAGER'),('01','050800','1','MANAGER'),('01','050801','1','MANAGER'),('01','050802','1','MANAGER'),('01','050803','1','MANAGER'),('01','050901','1','MANAGER'),('01','050902','1','MANAGER'),('01','051001','1','MANAGER'),('01','051002','1','MANAGER'),('01','060000','1','MANAGER'),('01','060100','1','MANAGER'),('01','060101','1','MANAGER'),('01','060102','1','MANAGER'),('01','060103','1','MANAGER'),('01','060104','1','MANAGER'),('01','060105','1','MANAGER'),('01','060106','1','MANAGER'),('01','060107','1','MANAGER'),('01','060108','1','MANAGER'),('01','060109','1','MANAGER'),('01','060200','1','MANAGER'),('01','060300','1','MANAGER'),('01','060400','1','MANAGER'),('01','060401','1','MANAGER'),('01','060402','1','MANAGER'),('01','060403','1','MANAGER'),('01','060500','1','MANAGER'),('01','060501','1','MANAGER'),('01','060502','1','MANAGER'),('01','060503','1','MANAGER'),('01','060504','1','MANAGER'),('01','060600','1','MANAGER'),('01','060601','1','MANAGER'),('01','060602','1','MANAGER'),('01','060603','1','MANAGER'),('01','060604','1','MANAGER'),('01','060700','1','MANAGER'),('01','060701','1','MANAGER'),('01','060702','1','MANAGER'),('01','060703','1','MANAGER'),('01','060704','1','MANAGER'),('01','060800','1','MANAGER'),('01','060801','1','MANAGER'),('01','060802','1','MANAGER'),('01','060900','1','MANAGER'),('01','060901','1','MANAGER'),('01','060902','1','MANAGER'),('01','060903','1','MANAGER'),('01','060904','1','MANAGER'),('01','061000','1','MANAGER'),('01','061001','1','MANAGER'),('01','061002','1','MANAGER'),('01','061003','1','MANAGER'),('01','061004','1','MANAGER'),('01','061100','1','MANAGER'),('01','061101','1','MANAGER'),('01','061102','1','MANAGER'),('01','061103','1','MANAGER'),('01','070000','1','MANAGER'),('01','070100','0','MANAGER'),('01','070200','0','MANAGER'),('01','070400','0','MANAGER'),('01','070500','0','MANAGER'),('01','070600','0','MANAGER'),('01','080000','1','MANAGER'),('01','080100','1','MANAGER'),('01','080200','1','MANAGER'),('01','080300','1','MANAGER'),('01','090000','1','MANAGER'),('01','090100','1','MANAGER'),('01','090101','1','MANAGER'),('01','090102','1','MANAGER'),('01','090200','1','MANAGER'),('01','090201','1','MANAGER'),('01','090202','1','MANAGER'),('01','090203','1','MANAGER'),('01','090300','1','MANAGER'),('01','090400','1','MANAGER'),('01','100000','1','MANAGER'),('01','110000','1','MANAGER'),('01','120000','1','MANAGER'),('01','121000','1','MANAGER'),('01','121001','1','MANAGER'),('01','121002','1','MANAGER'),('01','122000','1','MANAGER'),('01','122001','1','MANAGER'),('01','122002','1','MANAGER'),('01','123000','1','MANAGER'),('01','123001','1','MANAGER'),('03','010000','1','ADMIN & KASIR'),('03','010100','1','ADMIN & KASIR'),('03','010200','1','ADMIN & KASIR'),('03','010300','0','ADMIN & KASIR'),('03','010400','0','ADMIN & KASIR'),('03','010500','0','ADMIN & KASIR'),('03','010600','0','ADMIN & KASIR'),('03','010700','0','ADMIN & KASIR'),('03','010900','0','ADMIN & KASIR'),('03','020000','1','ADMIN & KASIR'),('03','020100','0','ADMIN & KASIR'),('03','020200','1','ADMIN & KASIR'),('03','020300','1','ADMIN & KASIR'),('03','020400','1','ADMIN & KASIR'),('03','020500','1','ADMIN & KASIR'),('03','020501','1','ADMIN & KASIR'),('03','020600','0','ADMIN & KASIR'),('03','020800','1','ADMIN & KASIR'),('03','020900','1','ADMIN & KASIR'),('03','021000','1','ADMIN & KASIR'),('03','030100','0','ADMIN & KASIR'),('03','040000','1','ADMIN & KASIR'),('03','040100','1','ADMIN & KASIR'),('03','040101','1','ADMIN & KASIR'),('03','040102','1','ADMIN & KASIR'),('03','040200','1','ADMIN & KASIR'),('03','040201','1','ADMIN & KASIR'),('03','040202','1','ADMIN & KASIR'),('03','040300','1','ADMIN & KASIR'),('03','040301','1','ADMIN & KASIR'),('03','040302','1','ADMIN & KASIR'),('03','040401','1','ADMIN & KASIR'),('03','040402','1','ADMIN & KASIR'),('03','040500','1','ADMIN & KASIR'),('03','040501','1','ADMIN & KASIR'),('03','040502','1','ADMIN & KASIR'),('03','050000','1','ADMIN & KASIR'),('03','050100','1','ADMIN & KASIR'),('03','050101','1','ADMIN & KASIR'),('03','050102','1','ADMIN & KASIR'),('03','050200','1','ADMIN & KASIR'),('03','050201','1','ADMIN & KASIR'),('03','050202','1','ADMIN & KASIR'),('03','050301','1','ADMIN & KASIR'),('03','050302','1','ADMIN & KASIR'),('03','050401','1','ADMIN & KASIR'),('03','050402','1','ADMIN & KASIR'),('03','050501','1','ADMIN & KASIR'),('03','050502','1','ADMIN & KASIR'),('03','050601','1','ADMIN & KASIR'),('03','050602','1','ADMIN & KASIR'),('03','050701','1','ADMIN & KASIR'),('03','050702','1','ADMIN & KASIR'),('03','050800','1','ADMIN & KASIR'),('03','050801','1','ADMIN & KASIR'),('03','050802','1','ADMIN & KASIR'),('03','050803','1','ADMIN & KASIR'),('03','050901','1','ADMIN & KASIR'),('03','050902','1','ADMIN & KASIR'),('03','051001','1','ADMIN & KASIR'),('03','051002','1','ADMIN & KASIR'),('03','060000','1','ADMIN & KASIR'),('03','060101','0','ADMIN & KASIR'),('03','060102','0','ADMIN & KASIR'),('03','060103','0','ADMIN & KASIR'),('03','060104','0','ADMIN & KASIR'),('03','060105','0','ADMIN & KASIR'),('03','060106','0','ADMIN & KASIR'),('03','060107','0','ADMIN & KASIR'),('03','060108','0','ADMIN & KASIR'),('03','060300','1','ADMIN & KASIR'),('03','060400','1','ADMIN & KASIR'),('03','060401','1','ADMIN & KASIR'),('03','060402','1','ADMIN & KASIR'),('03','060403','1','ADMIN & KASIR'),('03','060500','1','ADMIN & KASIR'),('03','060501','1','ADMIN & KASIR'),('03','060502','1','ADMIN & KASIR'),('03','060503','1','ADMIN & KASIR'),('03','060504','1','ADMIN & KASIR'),('03','060601','1','ADMIN & KASIR'),('03','060602','1','ADMIN & KASIR'),('03','060603','1','ADMIN & KASIR'),('03','060604','1','ADMIN & KASIR'),('03','060700','1','ADMIN & KASIR'),('03','060701','1','ADMIN & KASIR'),('03','060702','1','ADMIN & KASIR'),('03','060703','0','ADMIN & KASIR'),('03','060704','1','ADMIN & KASIR'),('03','060800','1','ADMIN & KASIR'),('03','060801','1','ADMIN & KASIR'),('03','060802','0','ADMIN & KASIR'),('03','060902','0','ADMIN & KASIR'),('03','060903','0','ADMIN & KASIR'),('03','060904','0','ADMIN & KASIR'),('03','061000','0','ADMIN & KASIR'),('03','061001','0','ADMIN & KASIR'),('03','061002','0','ADMIN & KASIR'),('03','061003','0','ADMIN & KASIR'),('03','061004','0','ADMIN & KASIR'),('03','061100','0','ADMIN & KASIR'),('03','061101','0','ADMIN & KASIR'),('03','061102','0','ADMIN & KASIR'),('03','061103','0','ADMIN & KASIR'),('03','070100','0','ADMIN & KASIR'),('03','070200','0','ADMIN & KASIR'),('03','070400','0','ADMIN & KASIR'),('03','070500','0','ADMIN & KASIR'),('03','070600','0','ADMIN & KASIR'),('03','080000','0','ADMIN & KASIR'),('03','080100','0','ADMIN & KASIR'),('03','080200','0','ADMIN & KASIR'),('03','080300','0','ADMIN & KASIR'),('03','090100','1','ADMIN & KASIR'),('03','090101','1','ADMIN & KASIR'),('03','090102','1','ADMIN & KASIR'),('03','090200','1','ADMIN & KASIR'),('03','090201','1','ADMIN & KASIR'),('03','090202','1','ADMIN & KASIR'),('03','090203','1','ADMIN & KASIR'),('03','100000','0','ADMIN & KASIR'),('03','110000','1','ADMIN & KASIR'),('60','010000','1','Test'),('60','010100','1','Test'),('60','010200','1','Test'),('60','010300','1','Test'),('60','020000','1','Test'),('60','020100','1','Test'),('60','020200','1','Test'),('60','020300','1','Test');

--
-- Table structure for table `userlog`
--

CREATE TABLE `userlog` (
  `tgllog` date NOT NULL default '0000-00-00',
  `jamlog` time NOT NULL default '00:00:00',
  `log` char(255) NOT NULL default '',
  `user` char(65) NOT NULL default '',
  `userip` char(15) NOT NULL default '',
  `userhost` char(60) NOT NULL default '',
  KEY `Index_tgl` (`tgllog`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `userlog`
--

INSERT INTO `userlog` VALUES ('2015-11-23','11:47:19','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:56:45','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Buat setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Buat setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Buat setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Buat setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Buat setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Buat setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:07','Buat setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:21','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','11:57:55','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','12:00:42','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','13:59:57','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:04:22','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:12','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Buat setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:44','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Buat setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:45','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:07:55','Login',' - asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:08:04','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:13:43','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-23','14:56:24','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','11:49:05','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','11:58:58','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','12:02:18','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','12:03:59','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','13:40:16','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','13:42:31','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','13:45:50','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','14:15:09','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','14:18:19','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','14:19:20','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','14:52:06','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','14:53:13','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','15:06:21','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','15:07:55','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','15:09:39','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','15:44:05','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','15:47:13','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','15:48:50','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','15:50:07','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','15:56:57','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:11:31','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:15:15','Insert master barang (KodeBrg=BRG00001)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:19:43','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:20:35','Transaksi Penjualan Grosir Baru (NoJual=151124001)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:21:10','Transaksi Penjualan Grosir Baru (NoJual=151124002)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:34:16','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:34:56','Transaksi Penjualan Grosir Baru (NoJual=151124001)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:36:00','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:36:49','Transaksi Penjualan Grosir Baru (NoJual=151124001)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:38:00','Transaksi Penjualan Grosir Baru (NoJual=151124002)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:38:35','Transaksi Penjualan Grosir Baru (NoJual=151124003)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:39:20','Transaksi Penjualan Grosir Baru (NoJual=151124004)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:39:26','Transaksi Penjualan Grosir Baru (NoJual=151124005)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:39:35','Transaksi Penjualan Grosir Baru (NoJual=151124006)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:40:02','Transaksi Penjualan Grosir Baru (NoJual=151124007)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','16:45:20','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','17:08:56','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','17:11:12','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-24','17:13:03','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','05:02:55','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','05:29:48','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','05:34:28','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','05:35:22','Transaksi Penjualan Grosir Baru (NoJual=151125001)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','05:45:14','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','05:48:49','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','05:52:50','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','06:08:58','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','06:09:46','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','06:11:35','Insert master barang (KodeBrg=PRT001)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','06:12:16','Transaksi Penjualan Grosir Baru (NoJual=151125002)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','06:14:38','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','06:15:07','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','06:16:41','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','06:22:40','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','06:24:14','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','06:38:44','Login',' - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','06:40:31','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','06:57:20','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','07:05:03','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','09:17:35','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','09:46:50','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','09:48:33','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','09:51:05','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','09:53:06','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','09:54:40','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','09:56:33','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','10:02:42','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','10:03:39','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','10:06:58','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','10:07:59','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','10:09:49','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','10:11:20','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','10:12:31','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','10:14:20','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','10:15:03','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','10:15:54','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','10:16:17','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','10:20:06','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','10:35:55','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','11:57:11','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','11:57:35','Transaksi Hapus Detail Penjualan Grosir (NoJual=151125002, KodeBrg=PRT001)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','11:57:36','Transaksi Hapus Penjualan Grosir (NoJual=151125002)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','11:57:38','Transaksi Hapus Penjualan Grosir (NoJual=151125002)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','12:03:07','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','13:06:56','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','13:08:21','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','13:41:55','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','13:44:46','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','13:46:17','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','13:47:19','Transaksi Penjualan Grosir Baru (NoJual=151125003)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','13:56:49','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','14:02:28','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','14:05:04','Transaksi Penjualan Grosir Baru (NoJual=151125004)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','14:05:17','Transaksi Hapus Detail Penjualan Grosir (NoJual=151125004, KodeBrg=PRT001)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','14:05:19','Transaksi Hapus Penjualan Grosir (NoJual=151125004)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','14:05:19','Transaksi Hapus Penjualan Grosir (NoJual=151125004)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','14:06:27','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','14:10:14','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','14:16:12','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','14:18:16','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','15:31:02','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','15:33:12','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-25','15:37:35','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','08:25:37','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','08:32:40','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','08:33:25','Transaksi Retur Penjualan Grosir Baru (NoJual=15000006)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','08:35:35','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','08:36:35','Transaksi Retur Penjualan Grosir Baru (NoJual=15000006)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','08:38:18','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','08:38:50','Transaksi Retur Penjualan Grosir Baru (NoJual=15000006)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','08:40:54','Transaksi Retur Penjualan Grosir Baru (NoJual=15000007)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','08:42:27','Transaksi Retur Penjualan Grosir Baru (NoJual=15000008)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','08:53:21','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','09:29:28','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','09:32:53','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','09:35:03','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','09:39:41','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','09:41:54','Transaksi Penjualan Grosir Baru (NoJual=151126001)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','09:43:09','Insert master barang (KodeBrg=RAM04)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','09:45:23','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:03:38','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:05:06','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:08:44','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:10:30','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:11:38','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:11:56','Transaksi Penjualan Grosir Baru (NoJual=151126001)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:13:51','Transaksi Penjualan Grosir Baru (NoJual=151126001)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:18:08','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:18:24','Transaksi Update Penjualan Grosir (NoJual=151126001)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:24:46','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:25:53','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:26:58','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:34:26','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:36:15','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:38:19','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:39:33','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:47:49','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:52:04','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:52:35','Transaksi Retur Penjualan Grosir Baru (NoJual=15000009)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:54:09','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','10:57:21','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','11:00:27','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','11:14:12','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','11:14:38','Transaksi Retur Penjualan Grosir Baru (NoJual=15000010)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','11:21:07','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','11:22:47','Transaksi Hapus Retur Penjualan Grosir (NoRetur=15000010)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','11:22:49','Transaksi Hapus Retur Penjualan Grosir (NoRetur=15000010)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','11:22:50','Transaksi Hapus Retur Penjualan Grosir (NoRetur=15000010)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','11:22:50','Transaksi Hapus Retur Penjualan Grosir (NoRetur=15000010)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','11:23:04','Transaksi Hapus Retur Penjualan Grosir (NoRetur=15000010)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','11:23:05','Transaksi Hapus Retur Penjualan Grosir (NoRetur=15000010)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','11:51:14','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','11:52:48','Transaksi Retur Penjualan Grosir Baru (NoJual=15000011)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','11:59:39','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','12:00:57','Transaksi Retur Penjualan Grosir Baru (NoJual=15000011)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','12:00:59','Transaksi Retur Penjualan Grosir Baru (NoJual=15000011)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','12:02:10','Transaksi Hapus Retur Penjualan Grosir (NoRetur=15000011)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','12:02:12','Transaksi Hapus Retur Penjualan Grosir (NoRetur=15000011)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','12:02:12','Transaksi Hapus Retur Penjualan Grosir (NoRetur=15000011)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','12:02:13','Transaksi Hapus Retur Penjualan Grosir (NoRetur=15000011)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','12:02:15','Transaksi Hapus Retur Penjualan Grosir (NoRetur=15000011)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','13:35:50','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:10','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:22','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Update setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Buat setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:23','Buat setting level user (level=01)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:12:38','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:19:56','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:21:42','Transaksi Hapus Retur Penjualan Grosir (NoRetur=15000010)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:21:50','Transaksi Hapus Retur Penjualan Grosir (NoRetur=15000010)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:22:38','Transaksi Retur Penjualan Grosir Baru (NoJual=15000012)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:36:28','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:36:44','Transaksi Hapus Retur Penjualan Grosir (NoRetur=15000012)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:38:07','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:38:59','Transaksi Retur Penjualan Grosir Baru (NoJual=15000013)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:49:20','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','14:49:43','Transaksi Update Retur Penjualan Grosir (NoRetur=15000013)','asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','15:00:39','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','15:16:44','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','15:21:23','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','15:29:27','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','15:32:48','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','15:46:34','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','15:48:23','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2015-11-26','15:52:54','Login','asp - asp','10.0.2.15','kerja-a3f610014'),('2021-11-16','09:53:19','Login','asp - asp','45.77.190.146',''),('2021-11-16','10:44:25','Login','asp - asp','45.77.190.146',''),('2021-11-16','11:02:19','Login','asp - asp','45.77.190.146',''),('2021-11-17','09:46:03','Login','asp - asp','45.32.139.59',''),('2021-11-17','09:50:43','Login','asp - asp','45.32.139.59',''),('2021-11-17','10:03:21','Login','asp - asp','45.32.139.59',''),('2021-11-17','10:38:16','Login','asp - asp','45.32.139.59',''),('2021-11-17','10:49:27','Login','asp - asp','45.32.139.59',''),('2021-11-17','10:51:04','Login','asp - asp','45.32.139.59',''),('2021-11-17','10:57:07','Login','asp - asp','45.32.139.59',''),('2021-11-17','11:07:51','Login','asp - asp','45.32.139.59',''),('2021-11-17','11:16:16','Login','asp - asp','45.32.139.59',''),('2021-11-17','13:44:18','Login','asp - asp','45.32.139.59',''),('2021-11-17','13:57:17','Login','asp - asp','45.32.139.59',''),('2021-11-17','14:29:03','Login','asp - asp','45.32.139.59',''),('2021-11-17','14:39:34','Login','asp - asp','45.32.139.59',''),('2021-11-17','15:29:09','Login','asp - asp','45.32.139.59',''),('2021-11-18','09:05:45','Login','asp - asp','149.28.214.75',''),('2021-11-18','09:06:07','Update master barang (KodeBrg=BRG00001)','asp','149.28.214.75',''),('2021-11-18','09:07:07','Transaksi Penjualan Grosir Baru (NoJual=211118001)','asp','149.28.214.75',''),('2021-11-18','09:08:29','Transaksi Penjualan Grosir Baru (NoJual=211118002)','asp','149.28.214.75',''),('2021-11-18','09:12:46','Login','asp - asp','149.28.214.75',''),('2021-11-18','09:13:41','Transaksi Penjualan Grosir Baru (NoJual=211118001)','asp','149.28.214.75',''),('2021-11-18','09:15:19','Login','asp - asp','149.28.214.75',''),('2021-11-18','09:15:58','Transaksi Penjualan Grosir Baru (NoJual=211118001)','asp','149.28.214.75',''),('2021-11-18','09:17:57','Login','asp - asp','149.28.214.75',''),('2021-11-18','09:18:22','Transaksi Retur Penjualan Grosir Baru (NoJual=21000001)','asp','149.28.214.75',''),('2021-11-18','09:19:19','Transaksi Penjualan Retail Baru (NoJual=211118001)','asp','149.28.214.75',''),('2021-11-18','09:20:15','Transaksi Penjualan Retail Baru (NoJual=211118002)','asp','149.28.214.75',''),('2021-11-18','09:29:22','Login','asp - asp','149.28.214.75',''),('2021-11-18','09:29:56','Transaksi Penjualan Retail Baru (NoJual=211118003)','asp','149.28.214.75',''),('2021-11-18','09:30:38','Transaksi Penjualan Retail Baru (NoJual=211118004)','asp','149.28.214.75',''),('2021-11-18','09:35:30','Transaksi Penjualan Retail Baru (NoJual=211118005)','asp','149.28.214.75',''),('2021-11-18','09:42:07','Login','asp - asp','149.28.214.75',''),('2021-11-18','11:06:16','Login','asp - asp','192.168.1.10',''),('2021-11-18','11:10:42','Insert master barang (KodeBrg=210001)','asp','192.168.1.10',''),('2021-11-18','11:11:25','Insert master barang (KodeBrg=210002)','asp','192.168.1.10',''),('2021-11-18','11:12:27','Insert master barang (KodeBrg=210003)','asp','192.168.1.10',''),('2021-11-18','11:15:45','Insert master barang (KodeBrg=210004)','asp','192.168.1.10',''),('2021-11-18','11:17:07','Insert master barang (KodeBrg=210005)','asp','192.168.1.10',''),('2021-11-18','11:17:59','Insert master barang (KodeBrg=210006)','asp','192.168.1.10',''),('2021-11-18','11:19:03','Insert master barang (KodeBrg=210007)','asp','192.168.1.10',''),('2021-11-18','11:19:44','Insert master barang (KodeBrg=210008)','asp','192.168.1.10',''),('2021-11-18','11:20:28','Insert master barang (KodeBrg=210009)','asp','192.168.1.10',''),('2021-11-18','11:20:51','Update master barang (KodeBrg=210008)','asp','192.168.1.10',''),('2021-11-18','11:21:53','Insert master barang (KodeBrg=210010)','asp','192.168.1.10',''),('2021-11-18','11:23:48','Login','asp - asp','192.168.1.10',''),('2021-11-18','11:29:58','Transaksi Penjualan Grosir Baru (NoJual=211118002)','asp','192.168.1.10',''),('2021-11-18','11:30:39','Update konfigurasi','asp','192.168.1.10',''),('2021-11-18','11:38:04','Transaksi Penjualan Retail Baru (NoJual=211118006)','asp','192.168.1.10',''),('2021-11-18','11:40:43','Update konfigurasi','asp','192.168.1.10',''),('2021-11-18','11:41:16','Login','asp - asp','192.168.1.10',''),('2021-11-18','14:18:45','Login','asp - asp','192.168.1.10',''),('2021-11-18','14:20:04','Transaksi Penjualan Retail Baru (NoJual=211118007)','asp','192.168.1.10',''),('2021-11-18','14:20:42','Login','asp - asp','192.168.1.10',''),('2021-11-18','15:13:25','Login','asp - asp','192.168.1.10',''),('2021-11-18','15:13:51','Buat user (userbaru=kasir)','asp','192.168.1.10',''),('2021-11-18','15:14:13','Login','kasir - kasir','192.168.1.10',''),('2021-11-18','15:14:36','Login','asp - asp','192.168.1.10',''),('2021-11-18','15:49:31','Login','asp - asp','192.168.1.10',''),('2021-11-18','15:51:08','Login','kasir - kasir','192.168.1.10',''),('2021-11-18','15:53:45','Transaksi Penjualan Retail Baru (NoJual=211118008)','kasir','192.168.1.10',''),('2021-11-18','15:53:45','Transaksi Penjualan Retail Baru (NoJual=211118008)','kasir','192.168.1.10',''),('2021-11-18','16:03:56','Login',' - kasir','192.168.1.10',''),('2021-11-18','16:04:05','Login','asp - asp','192.168.1.10',''),('2021-12-04','10:47:32','Login','asp - asp','192.168.0.101',''),('2021-12-04','10:49:54','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Buat setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Buat setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Buat setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Buat setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:56','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:49:57','Update setting level user (level=01)','asp','192.168.0.101',''),('2021-12-04','10:50:03','Login','asp - asp','192.168.0.101',''),('2021-12-04','10:51:59','Login','asp - asp','192.168.0.101',''),('2021-12-04','10:53:24','Login','asp - asp','192.168.0.101',''),('2021-12-05','16:15:27','Login dari IP lain','admin','127.0.0.1',''),('2021-12-05','16:17:28','Login dari IP lain','admin','127.0.0.1',''),('2021-12-05','16:23:09','Login dari IP lain','avi','127.0.0.1',''),('2021-12-05','19:22:37','Login','asp - asp','127.0.0.1',''),('2021-12-07','10:14:35','Login dari IP lain','admin','127.0.0.1',''),('2021-12-07','11:11:31','Login','asp - asp','127.0.0.1',''),('2021-12-07','12:21:02','Login','asp - asp','192.168.1.28',''),('2021-12-13','14:34:12','Login','asp - asp','192.168.0.111',''),('2021-12-13','14:37:26','Update master barang (KodeBrg=210003)','asp','192.168.0.111',''),('2021-12-13','14:38:13','Transaksi Penjualan Retail Baru (NoJual=211213001)','asp','192.168.0.111',''),('2021-12-13','15:18:35','Transaksi Penjualan Grosir Baru (NoJual=211213001)','asp','192.168.0.111',''),('2021-12-13','15:30:23','Transaksi Penjualan Retail Baru (NoJual=211213002)','asp','192.168.0.111',''),('2021-12-13','15:30:23','Transaksi Penjualan Retail Baru (NoJual=211213002)','asp','192.168.0.111',''),('2021-12-13','15:56:07','Login','asp - asp','192.168.0.111',''),('2021-12-22','08:53:49','Login','asp - asp','192.168.0.111',''),('2021-12-22','13:43:09','Insert master barang (KodeBrg=00001)','asp','192.168.0.111',''),('2021-12-29','11:01:38','Login','asp - asp','192.168.0.113',''),('2022-01-03','13:29:36','Login','asp - asp','127.0.0.1',''),('2022-01-03','13:40:41','Insert master barang (KodeBrg=MON1)','asp','127.0.0.1',''),('2022-01-03','13:44:23','Insert master barang (KodeBrg=MON2)','asp','127.0.0.1',''),('2022-01-03','14:02:53','Update master barang (KodeBrg=MON1)','asp','127.0.0.1',''),('2022-01-03','14:17:59','Hapus master barang (KodeBrg=00001)','asp','127.0.0.1',''),('2022-01-03','14:18:18','Hapus master barang (KodeBrg=MON1)','asp','127.0.0.1',''),('2022-01-03','14:23:11','Insert master barang (KodeBrg=MON1)','asp','127.0.0.1',''),('2022-01-03','14:25:06','Insert master barang (KodeBrg=MON3)','asp','127.0.0.1',''),('2022-01-03','14:26:46','Insert master barang (KodeBrg=MON4)','asp','127.0.0.1',''),('2022-01-03','14:33:58','Update master barang (KodeBrg=MON1)','asp','127.0.0.1',''),('2022-01-03','14:39:07','Insert master barang (KodeBrg=MON5)','asp','127.0.0.1',''),('2022-01-03','14:42:40','Insert master barang (KodeBrg=MON6)','asp','127.0.0.1',''),('2022-01-03','14:53:25','Insert master barang (KodeBrg=MON7)','asp','127.0.0.1',''),('2022-01-03','14:59:55','Insert master barang (KodeBrg=MON8)','asp','127.0.0.1',''),('2022-01-03','15:04:39','Insert master barang (KodeBrg=MON9)','asp','127.0.0.1',''),('2022-01-03','15:09:52','Insert master barang (KodeBrg=OPPO1)','asp','127.0.0.1',''),('2022-01-03','16:03:17','Insert master barang (KodeBrg=OPPO2)','asp','127.0.0.1',''),('2022-01-03','16:07:26','Insert master barang (KodeBrg=OPPO3)','asp','127.0.0.1',''),('2022-01-03','16:09:58','Insert master barang (KodeBrg=OPPO4)','asp','127.0.0.1',''),('2022-01-03','16:10:48','Update master barang (KodeBrg=OPPO3)','asp','127.0.0.1',''),('2022-01-03','16:11:18','Update master barang (KodeBrg=OPPO2)','asp','127.0.0.1',''),('2022-01-03','16:20:12','Update master barang (KodeBrg=OPPO2)','asp','127.0.0.1',''),('2022-01-03','16:22:39','Update master barang (KodeBrg=OPPO2)','asp','127.0.0.1',''),('2022-01-03','16:32:32','Update master barang (KodeBrg=OPPO2)','asp','127.0.0.1',''),('2022-01-03','19:22:57','Login dari IP lain','admin','127.0.0.1',''),('2022-01-03','19:23:07','Login dari IP lain','user','127.0.0.1',''),('2022-01-04','10:23:57','Login','asp - asp','127.0.0.1',''),('2022-01-04','11:57:22','Insert master barang (KodeBrg=OPPO5)','asp','127.0.0.1',''),('2022-01-04','12:04:22','Insert master barang (KodeBrg=OPPO6)','asp','127.0.0.1',''),('2022-01-04','12:06:11','Insert master barang (KodeBrg=OPPO7)','asp','127.0.0.1',''),('2022-01-04','12:07:45','Update master barang (KodeBrg=OPPO1)','asp','127.0.0.1',''),('2022-01-04','12:08:06','Update master barang (KodeBrg=OPPO2)','asp','127.0.0.1',''),('2022-01-04','12:08:30','Update master barang (KodeBrg=OPPO3)','asp','127.0.0.1',''),('2022-01-04','12:09:56','Update master barang (KodeBrg=MON1)','asp','127.0.0.1',''),('2022-01-04','12:12:20','Update master barang (KodeBrg=MON1)','asp','127.0.0.1',''),('2022-01-04','12:13:21','Update master barang (KodeBrg=MON1)','asp','127.0.0.1',''),('2022-01-04','12:16:04','Update master barang (KodeBrg=OPPO1)','asp','127.0.0.1',''),('2022-01-05','09:16:35','Login','asp - asp','45.63.85.5',''),('2022-01-05','09:24:13','Update master barang (KodeBrg=MON1)','asp','45.63.85.5',''),('2022-01-05','09:24:44','Update master barang (KodeBrg=MON1)','asp','45.63.85.5',''),('2022-01-05','09:25:59','Update master barang (KodeBrg=MON1)','asp','45.63.85.5',''),('2022-01-05','09:27:57','Update master barang (KodeBrg=MON1)','asp','45.63.85.5',''),('2022-01-05','14:56:52','Login','asp - asp','45.63.85.5',''),('2022-01-05','15:18:09','Login','asp - asp','45.63.85.5',''),('2022-01-05','16:40:17','Login','asp - asp','45.63.85.5',''),('2022-04-19','15:27:06','Login','asp - asp','45.63.85.5',''),('2022-04-19','15:27:56','Transaksi Penjualan Retail Baru (NoJual=220419001)','asp','45.63.85.5',''),('2022-04-19','15:29:06','Transaksi Penjualan Retail Baru (NoJual=220419002)','asp','45.63.85.5',''),('2022-04-19','15:32:13','Login','asp - asp','45.63.85.5','');

--
-- Table structure for table `v_stockbrg`
--

CREATE TABLE `v_stockbrg` (
  `KodeBrg` varchar(50) default NULL,
  `Namabrg` varchar(200) default NULL,
  `StockAkhir` decimal(10,0) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `v_stockbrg`
--


--
-- Temporary table structure for view `vcashflow`
--

/*!50001 DROP VIEW IF EXISTS `vcashflow`*/;
/*!50001 CREATE TABLE `vcashflow` (
  `Jns_jurnal` varchar(10),
  `Tanggal` date,
  `Tgl_Validasi` date,
  `No_bukti` varchar(14),
  `Row_id` int(11),
  `Keterangan` varchar(90),
  `penerima` varchar(50),
  `Pst` tinyint(4),
  `Tgl_Edit` datetime,
  `User` varchar(25),
  `Sandi_trans_id` varchar(2),
  `Norek_Simp` varchar(10),
  `Norek_Pinj` varchar(10),
  `Norek_Dep` varchar(10),
  `Status_Val` varchar(1),
  `Status_AB` varchar(1),
  `Nobukti_Rtl` varchar(11),
  `Kode_perk` varchar(15),
  `Debet` double,
  `Kode_divisi` varchar(10),
  `Kredit` double
) */;

--
-- Dumping routines for database 'dbavicomp'
--
DELIMITER ;;
/*!50003 DROP FUNCTION IF EXISTS `BuatNo` */;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO"*/;;
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `BuatNo`(Nama Varchar(20),Codes varchar(2),Tgl Varchar(10),Trans varchar(2),NoBaru varchar(11) ) RETURNS char(11) CHARSET latin1
BEGIN
  DECLARE yy Varchar(2) DEFAULT 0;
  DECLARE mm Varchar(2) DEFAULT 0;
  DECLARE dd Varchar(2) DEFAULT 0;
  DECLARE NoInt Integer DEFAULT 0;
  DECLARE NoStr Varchar(11) DEFAULT 0;
  DECLARE Nomer Varchar(11) DEFAULT 0;
  DECLARE thn Varchar(6) DEFAULT 0;
  DECLARE TipeNo Integer DEFAULT 0;
  Set yy=Substring(tgl,3,2);
  Set mm=Substring(tgl,6,2);
  Set dd=Substring(tgl,9,2);
  Select ifnull(nilainum,1) into TipeNo from tm_setupall where groups='Nomor' and subgroups=Codes;
  If (TipeNo=0) or (TipeNo=1) then
     select if(ifnull(substring(nilaichar,3,6),0)='',0,ifnull(substring(nilaichar,3,6),0)),ifnull(nilaichar,'00') into NoInt,Nomer from tm_setupall where groups='Nomor' and subgroups=Codes;
     set thn=substring(nomer,1,2);
     if thn=yy then
        set NoInt=NoInt+1;
        set NoStr=NoInt;
        set NoBaru=concat(yy,REPEAT('0',6-length(NoStr)),NoStr);
     else
        case upper(Nama)
             when upper('Tr_Beli') then select ifnull(max(substring(noBeli,3,6)),0) into NoInt from TR_Beli_m where left(NoBeli,2)=yy and transBeli=Trans;
             when upper('Tr_Jual') then select ifnull(max(substring(noJual,3,6)),0) into NoInt from TR_Jual_m where left(NoJual,2)=yy and TransJual=Trans;
             when upper('Tr_JualR') then select ifnull(max(substring(noJualR,3,6)),0) into NoInt from TR_JualR_m where left(NoJualR,2)=yy and TransRetail=Trans;
             when upper('Tr_JualRakitan') then select ifnull(max(substring(noJual,3,6)),0) into NoInt from TR_JualRakitan_m where left(NoJual,2)=yy and TransJual=Trans;
             when upper('Tr_BayarBeli') then select ifnull(max(substring(noBayarB,3,6)),0) into NoInt from TR_BayarBeli_m where left(NoBayarB,2)=yy;
             when upper('Tr_BayarJual') then select ifnull(max(substring(noBayarJ,3,6)),0) into NoInt from TR_BayarJual_m where left(NoBayarJ,2)=yy;
             when upper('Tr_BayarJualRakitan') then select ifnull(max(substring(noBayarJ,3,6)),0) into NoInt from TR_BayarJualRakitan_m where left(NoBayarJ,2)=yy;
             when upper('Tr_RetBeli') then select ifnull(max(substring(noRetB,3,6)),0) into NoInt from TR_RetBeli_m where left(NoRetB,2)=yy and TransRetB=Trans;
             when upper('Tr_RetJual') then select ifnull(max(substring(noRetJ,3,6)),0) into NoInt from TR_RetJual_m where left(NoRetJ,2)=yy and TransRetJ=Trans;
             when upper('Tr_RetJualR') then select ifnull(max(substring(noRetJ,3,6)),0) into NoInt from TR_RetJualR_m where left(NoRetJ,2)=yy and TransRetJ=Trans;
             when upper('Tr_RetJualRakitan') then select ifnull(max(substring(noRetJ,3,6)),0) into NoInt from TR_RetJualRakitan_m where left(NoRetJ,2)=yy and TransRetJ=Trans;
             when upper('Tr_PoJual') then select ifnull(max(substring(nopo,3,6)),0) into NoInt from TR_PoJual_m where left(NoPo,2)=yy;
             when upper('Tr_PoJualRakitan') then select ifnull(max(substring(nopo,3,6)),0) into NoInt from TR_PoJualRakitan_m where left(NoPo,2)=yy;
		 when upper('Tr_PoBeli') then select ifnull(max(substring(nopo,3,6)),0) into NoInt from TR_PoBeli_m where left(NoPo,2)=yy;
             when upper('Tr_PIndahGd') then select ifnull(max(substring(noPindahGd,3,6)),0) into NoInt from Tr_PindahGd_M where left(noPindahGd,2)=yy;
             when upper('Tr_BuangGd') then select ifnull(max(substring(noBuangGd,3,6)),0) into NoInt from Tr_BuangGd_M where left(noBuangGd,2)=yy;
             when upper('Close') then select ifnull(max(substring(noClose,3,6)),0) into NoInt from TR_JualR_m where left(NoJualR,2)=yy and TransRetail=Trans;
        end case;
        if NoInt=0 then
           set NoBaru = concat(yy,'000001');
        else
           set noInt = noInt + 1;
           set noStr = noInt;
           set NoBaru= concat(yy,repeat('0',6-length(NoStr)),NoStr);
        end if;
     end if;
  end if;
  If (TipeNo=2) then
     select if(ifnull(substring(nilaichar,5,4),0)='',0,ifnull(substring(nilaichar,5,4),0)),ifnull(nilaichar,'00') into NoInt,Nomer from tm_setupall where groups='Nomor' and subgroups=Codes;
     set thn=substring(nomer,1,4);
     if thn=concat(yy,mm) then
        set NoInt=NoInt+1;
        set NoStr=NoInt;
        set NoBaru=concat(yy,mm,REPEAT('0',4-length(NoStr)),NoStr);
     else
        case upper(Nama)
             when upper('Tr_Beli') then select ifnull(max(substring(noBeli,5,4)),0) into NoInt from TR_Beli_m where left(NoBeli,4)=concat(yy,mm) and transBeli=Trans;
             when upper('Tr_Jual') then select ifnull(max(substring(noJual,5,4)),0) into NoInt from TR_Jual_m where left(NoJual,4)=concat(yy,mm) and TransJual=Trans;
             when upper('Tr_JualR') then select ifnull(max(substring(noJualR,5,4)),0) into NoInt from TR_JualR_m where left(NoJualR,4)=concat(yy,mm) and TransRetail=Trans;
             when upper('Tr_JualRakitan') then select ifnull(max(substring(noJual,5,4)),0) into NoInt from TR_JualRakitan_m where left(NoJual,4)=concat(yy,mm) and TransJual=Trans;
             when upper('Tr_BayarBeli') then select ifnull(max(substring(noBayarB,5,4)),0) into NoInt from TR_BayarBeli_m where left(NoBayarB,4)=concat(yy,mm);
             when upper('Tr_BayarJual') then select ifnull(max(substring(noBayarJ,5,4)),0) into NoInt from TR_BayarJual_m where left(NoBayarJ,4)=concat(yy,mm);
             when upper('Tr_BayarJualRakitan') then select ifnull(max(substring(noBayarJ,5,4)),0) into NoInt from TR_BayarJualRakitan_m where left(NoBayarJ,4)=concat(yy,mm);
             when upper('Tr_RetBeli') then select ifnull(max(substring(noRetB,5,4)),0) into NoInt from TR_RetBeli_m where left(NoRetB,4)=concat(yy,mm) and TransRetB=Trans;
             when upper('Tr_RetJual') then select ifnull(max(substring(noRetJ,5,4)),0) into NoInt from TR_RetJual_m where left(NoRetJ,4)=concat(yy,mm) and TransRetJ=Trans;
             when upper('Tr_RetJualR') then select ifnull(max(substring(noRetJ,5,4)),0) into NoInt from TR_RetJualR_m where left(NoRetJ,4)=concat(yy,mm) and TransRetJ=Trans;
             when upper('Tr_RetJualRakitan') then select ifnull(max(substring(noRetJ,5,4)),0) into NoInt from TR_RetJualRakitan_m where left(NoRetJ,4)=concat(yy,mm) and TransRetJ=Trans;
             when upper('Tr_PoJual') then select ifnull(max(substring(nopo,5,4)),0) into NoInt from TR_PoJual_m where left(NoPo,4)=concat(yy,mm);
             when upper('Tr_PoJualRakitan') then select ifnull(max(substring(nopo,5,4)),0) into NoInt from TR_PoJualRakitan_m where left(NoPo,4)=concat(yy,mm);
             when upper('Tr_PoBeli') then select ifnull(max(substring(nopo,5,4)),0) into NoInt from TR_PoBeli_m where left(NoPo,4)=concat(yy,mm);
             when upper('Tr_PIndahGd') then select ifnull(max(substring(noPindahGd,5,4)),0) into NoInt from Tr_PindahGd_M where left(noPindahGd,4)=concat(yy,mm);
             when upper('Tr_BuangGd') then select ifnull(max(substring(noBuangGd,5,4)),0) into NoInt from Tr_BuangGd_M where left(noBuangGd,4)=concat(yy,mm);
             when upper('Close') then select ifnull(max(substring(noClose,5,4)),0) into NoInt from TR_JualR_m where left(NoJualR,4)=concat(yy,mm) and TransRetail=Trans;
       end case;
        if NoInt=0 then
           set NoBaru = concat(yy,mm,'0001');
        else
           set noInt = noInt + 1;
           set noStr = noInt;
           set NoBaru= concat(yy,mm,repeat('0',4-length(NoStr)),NoStr);
        end if;
     end if;
  end if;
 If (TipeNo=3) then
     select if(ifnull(substring(nilaichar,7,3),0)='',0,ifnull(substring(nilaichar,7,3),0)),ifnull(nilaichar,'00') into NoInt,Nomer from tm_setupall where groups='Nomor' and subgroups=Codes;
     set thn=substring(nomer,1,6);
     if thn=concat(yy,mm,dd) then
        set NoInt=NoInt+1;
        set NoStr=NoInt;
        set NoBaru=concat(yy,mm,dd,REPEAT('0',3-length(NoStr)),NoStr);
     else
        case upper(Nama)
             when upper('Tr_Beli') then select ifnull(max(substring(noBeli,7,3)),0) into NoInt from TR_Beli_m where left(NoBeli,6)=concat(yy,mm,dd) and transBeli=Trans;
             when upper('Tr_Jual') then select ifnull(max(substring(noJual,7,3)),0) into NoInt from TR_Jual_m where left(NoJual,6)=concat(yy,mm,dd) and TransJual=Trans;
             when upper('Tr_JualR') then select ifnull(max(substring(noJualR,7,3)),0) into NoInt from TR_JualR_m where left(NoJualR,6)=concat(yy,mm,dd) and TransRetail=Trans;
             when upper('Tr_JualRakitan') then select ifnull(max(substring(noJual,7,3)),0) into NoInt from TR_JualRakitan_m where left(NoJual,6)=concat(yy,mm,dd) and TransJual=Trans;
             when upper('Tr_BayarBeli') then select ifnull(max(substring(noBayarB,7,3)),0) into NoInt from TR_BayarBeli_m where left(NoBayarB,6)=concat(yy,mm,dd);
             when upper('Tr_BayarJual') then select ifnull(max(substring(noBayarJ,7,3)),0) into NoInt from TR_BayarJual_m where left(NoBayarJ,6)=concat(yy,mm,dd);
             when upper('Tr_BayarJualRakitan') then select ifnull(max(substring(noBayarJ,7,3)),0) into NoInt from TR_BayarJualRakitan_m where left(NoBayarJ,6)=concat(yy,mm,dd);
             when upper('Tr_RetBeli') then select ifnull(max(substring(noRetB,7,3)),0) into NoInt from TR_RetBeli_m where left(NoRetB,6)=concat(yy,mm,dd) and TransRetB=Trans;
             when upper('Tr_RetJual') then select ifnull(max(substring(noRetJ,7,3)),0) into NoInt from TR_RetJual_m where left(NoRetJ,6)=concat(yy,mm,dd) and TransRetJ=Trans;
             when upper('Tr_RetJualR') then select ifnull(max(substring(noRetJ,7,3)),0) into NoInt from TR_RetJualR_m where left(NoRetJ,6)=concat(yy,mm,dd) and TransRetJ=Trans;
             when upper('Tr_RetJualRakitan') then select ifnull(max(substring(noRetJ,7,3)),0) into NoInt from TR_RetJualRakitan_m where left(NoRetJ,6)=concat(yy,mm,dd) and TransRetJ=Trans;
             when upper('Tr_PoJual') then select ifnull(max(substring(nopo,7,3)),0) into NoInt from TR_PoJual_m where left(NoPo,6)=concat(yy,mm,dd);
             when upper('Tr_PoJualRakitan') then select ifnull(max(substring(nopo,7,3)),0) into NoInt from TR_PoJualRakitan_m where left(NoPo,6)=concat(yy,mm,dd);
             when upper('Tr_PoBeli') then select ifnull(max(substring(nopo,7,3)),0) into NoInt from TR_PoBeli_m where left(NoPo,6)=concat(yy,mm,dd);
             when upper('Tr_PIndahGd') then select ifnull(max(substring(noPindahGd,7,3)),0) into NoInt from Tr_PindahGd_M where left(noPindahGd,6)=concat(yy,mm,dd);
             when upper('Tr_BuangGd') then select ifnull(max(substring(noBuangGd,7,3)),0) into NoInt from Tr_BuangGd_M where left(noBuangGd,6)=concat(yy,mm,dd);
             when upper('Close') then select ifnull(max(substring(noClose,7,3)),0) into NoInt from TR_JualR_m where left(NoJualR,6)=concat(yy,mm,dd) and TransRetail=Trans;
      end case;
        if NoInt=0 then
           set NoBaru = concat(yy,mm,dd,'001');
        else
           set noInt = noInt + 1;
           set noStr = noInt;
           set NoBaru= concat(yy,mm,dd,repeat('0',3-length(NoStr)),NoStr);
        end if;
     end if;
  end if;
  update tm_setupall set nilaichar=NoBaru where groups='Nomor' and subgroups=codes;
  Return NoBaru;
END */;;
/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
/*!50003 DROP FUNCTION IF EXISTS `GenBarcode` */;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO"*/;;
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `GenBarcode`() RETURNS char(13) CHARSET latin1
BEGIN
  DECLARE nomor INTEGER DEFAULT 0;
  DECLARE VBR char(3) DEFAULT 0;
  DECLARE VPK char(13) DEFAULT 0;
  SELECT IFNULL(MAX(right(barcode,9)), 0)+1 INTO nomor FROM tm_barang where left(Barcode,4)='1048' ;
  SET vpk= INSERT('0000000',10-LENGTH(nomor), length(nomor), nomor);
  RETURN concat('1048',vPK);
END */;;
/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
/*!50003 DROP FUNCTION IF EXISTS `GenKodeCust` */;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO"*/;;
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `GenKodeCust`(NoBk char(10)) RETURNS char(13) CHARSET latin1
BEGIN
  DECLARE nomor INTEGER DEFAULT 0;
  DECLARE VPK char(3) DEFAULT 0;
  SELECT IFNULL(MAX(right(kodecust,3)), 0)+1 INTO nomor FROM tm_customer where left(kodecust,length(nobk))=NoBk;
  SET vpk=INSERT('000',4-LENGTH(nomor), length(nomor), nomor);
  RETURN upper( concat(NoBk,vPK));
END */;;
/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
/*!50003 DROP FUNCTION IF EXISTS `GenNoBukti` */;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO"*/;;
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `GenNoBukti`() RETURNS char(11) CHARSET latin1
BEGIN
  DECLARE nomor INTEGER DEFAULT 0;
  DECLARE VKW char(5) DEFAULT 0;
  DECLARE VThn char(7) DEFAULT 0;
  SELECT substring(now(),3,5) INTO VTHN ;
  SELECT IFNULL(MAX(right(No_bukti,3)), 0)+1 INTO nomor FROM Tcashflow_m where substring(Tanggal,3,5) =vthn;
  SET vKW=INSERT('000',4-LENGTH(nomor), length(nomor), nomor);
  RETURN concat(Vthn,vKw);
END */;;
/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
/*!50003 DROP FUNCTION IF EXISTS `gennobuktijurnal` */;;
/*!50003 SET SESSION SQL_MODE="NO_AUTO_VALUE_ON_ZERO"*/;;
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `gennobuktijurnal`(NoBk char(10)) RETURNS char(13) CHARSET latin1
BEGIN
  DECLARE nomor INTEGER DEFAULT 0;
  DECLARE VPK char(3) DEFAULT 0;
  SELECT IFNULL(MAX(right(no_bukti,3)), 0)+1 INTO nomor FROM tJurnal where left(no_bukti,length(nobk))=NoBk;
  SET vpk=INSERT('000',4-LENGTH(nomor), length(nomor), nomor);
  RETURN concat(NoBk,vPK);
END */;;
/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
DELIMITER ;

--
-- Final view structure for view `tjurnal`
--

/*!50001 DROP TABLE IF EXISTS `tjurnal`*/;
/*!50001 DROP VIEW IF EXISTS `tjurnal`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `tjurnal` AS select `a`.`Jns_jurnal` AS `Jns_jurnal`,`a`.`Tanggal` AS `Tanggal`,`a`.`Tgl_Validasi` AS `Tgl_Validasi`,`a`.`No_bukti` AS `No_bukti`,`b`.`Row_id` AS `Row_id`,`a`.`Keterangan` AS `Keterangan`,`a`.`Pst` AS `Pst`,`a`.`Tgl_Edit` AS `Tgl_Edit`,`a`.`User` AS `User`,`a`.`Sandi_trans_id` AS `Sandi_trans_id`,`a`.`Norek_Simp` AS `Norek_Simp`,`a`.`Norek_Pinj` AS `Norek_Pinj`,`a`.`Norek_Dep` AS `Norek_Dep`,`a`.`Status_Val` AS `Status_Val`,`a`.`Status_AB` AS `Status_AB`,`a`.`Nobukti_Rtl` AS `Nobukti_Rtl`,`b`.`Kode_perk` AS `Kode_perk`,`b`.`Debet` AS `Debet`,`b`.`Kredit` AS `Kredit` from (`tjurnal_m` `a` join `tjurnal_d` `b`) where ((`a`.`Jns_jurnal` = `b`.`Jns_jurnal`) and (`a`.`No_bukti` = `b`.`No_bukti`) and (`a`.`Tgl_Validasi` = `b`.`Tanggal`)) */;

--
-- Final view structure for view `vcashflow`
--

/*!50001 DROP TABLE IF EXISTS `vcashflow`*/;
/*!50001 DROP VIEW IF EXISTS `vcashflow`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `vcashflow` AS select `a`.`Jns_jurnal` AS `Jns_jurnal`,`a`.`Tanggal` AS `Tanggal`,`a`.`Tgl_Validasi` AS `Tgl_Validasi`,`a`.`No_bukti` AS `No_bukti`,`b`.`Row_id` AS `Row_id`,`a`.`Keterangan` AS `Keterangan`,`a`.`penerima` AS `penerima`,`a`.`Pst` AS `Pst`,`a`.`Tgl_Edit` AS `Tgl_Edit`,`a`.`User` AS `User`,`a`.`Sandi_trans_id` AS `Sandi_trans_id`,`a`.`Norek_Simp` AS `Norek_Simp`,`a`.`Norek_Pinj` AS `Norek_Pinj`,`a`.`Norek_Dep` AS `Norek_Dep`,`a`.`Status_Val` AS `Status_Val`,`a`.`Status_AB` AS `Status_AB`,`a`.`Nobukti_Rtl` AS `Nobukti_Rtl`,`b`.`Kode_perk` AS `Kode_perk`,`b`.`Debet` AS `Debet`,`b`.`kode_divisi` AS `Kode_divisi`,`b`.`Kredit` AS `Kredit` from (`tcashflow_m` `a` join `tcashflow_d` `b`) where ((`a`.`Jns_jurnal` = `b`.`Jns_jurnal`) and (`a`.`No_bukti` = `b`.`No_bukti`) and (`a`.`Tgl_Validasi` = `b`.`Tanggal`)) */;


