# SQL-Front 5.1  (Build 4.16)

/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE */;
/*!40101 SET SQL_MODE='' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES */;
/*!40103 SET SQL_NOTES='ON' */;


# Host: 192.168.1.47    Database: ds_mgk_4act
# ------------------------------------------------------
# Server version 5.5.34-0ubuntu0.13.04.1

#
# Source for table counters
#

DROP TABLE IF EXISTS `counters`;
CREATE TABLE `counters` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `label` varchar(45) DEFAULT NULL,
  `nilai` varchar(45) NOT NULL DEFAULT '1',
  `last_dtime` datetime DEFAULT NULL,
  `dev` varchar(45) DEFAULT NULL,
  `dev_info` varchar(45) DEFAULT NULL,
  `employee_id` int(11) NOT NULL,
  PRIMARY KEY (`id`,`employee_id`)
) ENGINE=InnoDB AUTO_INCREMENT=613 DEFAULT CHARSET=latin1;

#
# Source for table jurnal
#

DROP TABLE IF EXISTS `jurnal`;
CREATE TABLE `jurnal` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `jenis` varchar(32) NOT NULL DEFAULT '',
  `j_jenis` varchar(255) NOT NULL DEFAULT '',
  `rekening` varchar(32) DEFAULT NULL,
  `debet` int(11) NOT NULL DEFAULT '0',
  `kredit` int(11) NOT NULL DEFAULT '0',
  `transaksi_id` int(11) NOT NULL DEFAULT '0',
  `transaksi_no` varchar(255) DEFAULT NULL,
  `cabang_id` int(11) NOT NULL DEFAULT '0',
  `dtime` datetime DEFAULT NULL,
  `author` int(11) NOT NULL DEFAULT '0',
  `keterangan` varchar(250) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

#
# Source for table orders
#

DROP TABLE IF EXISTS `orders`;
CREATE TABLE `orders` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `orders_dtime` datetime DEFAULT NULL,
  `sellers_id` int(11) NOT NULL,
  `ipadd` varchar(50) NOT NULL,
  `sellers_nama` varchar(45) DEFAULT NULL,
  `supplier_id` int(11) NOT NULL DEFAULT '0',
  `supplier_nama` tinytext NOT NULL,
  `buyer_id` int(11) NOT NULL,
  `buyer_nama` varchar(45) DEFAULT NULL,
  `input_no` varchar(45) DEFAULT NULL,
  `nilai` int(11) NOT NULL,
  `pembayaran` varchar(6) DEFAULT NULL,
  `status` tinyint(2) NOT NULL DEFAULT '0',
  `bayar_dtime_0` datetime DEFAULT NULL,
  `bayar_dtime` datetime DEFAULT NULL,
  `bayar_keterangan` varchar(45) DEFAULT NULL,
  `pembayaran_nama` varchar(45) DEFAULT NULL,
  `rekber_id` int(11) DEFAULT NULL,
  `rekber_nama` varchar(45) DEFAULT NULL,
  `bank_id` int(11) DEFAULT NULL,
  `bank_nama` varchar(45) DEFAULT NULL,
  `kurir_id` int(11) NOT NULL,
  `kurir_nama` varchar(45) DEFAULT NULL,
  `kirim_dtime` datetime DEFAULT NULL,
  `kurir_service_id` int(11) NOT NULL DEFAULT '0',
  `kurir_service` varchar(45) DEFAULT NULL,
  `kurir_biaya` decimal(10,2) DEFAULT NULL,
  `kurir_biaya_real` decimal(10,2) DEFAULT NULL,
  `kurir_biaya_selisih` decimal(10,2) DEFAULT NULL,
  `kurir_resi` varchar(255) DEFAULT NULL,
  `sampai_dtime` datetime DEFAULT NULL,
  `cancel_dtime` datetime DEFAULT NULL,
  `cancel_alasan` tinytext,
  `cancel_by` int(11) NOT NULL,
  `lama_kiriman` timestamp NULL DEFAULT NULL,
  `alamat_1` tinytext,
  `alamat_2` tinytext,
  `tlp_1` varchar(13) DEFAULT NULL,
  `rt` varchar(4) DEFAULT NULL,
  `rw` varchar(4) DEFAULT NULL,
  `kelurahan_id` int(11) NOT NULL,
  `kelurahan_nama` varchar(45) DEFAULT NULL,
  `kecamatan_id` int(11) NOT NULL,
  `kecamatan_nama` varchar(45) DEFAULT NULL,
  `kabupaten_id` int(11) NOT NULL,
  `kabupaten_nama` varchar(45) DEFAULT NULL,
  `propinsi_id` int(11) NOT NULL,
  `propinsi_nama` varchar(45) DEFAULT NULL,
  `kodepos` varchar(6) DEFAULT NULL,
  `kodepos_id` int(11) NOT NULL DEFAULT '0',
  `laporan` int(11) NOT NULL,
  `print_alamat` tinyint(1) NOT NULL DEFAULT '0',
  `selesai_dtime` datetime DEFAULT NULL,
  `n_email` tinyint(1) NOT NULL DEFAULT '0',
  `r_komisi` tinyint(1) NOT NULL DEFAULT '0',
  `trash` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

#
# Source for table orders_data
#

DROP TABLE IF EXISTS `orders_data`;
CREATE TABLE `orders_data` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `orders_id` int(11) NOT NULL DEFAULT '0',
  `produk_id` int(11) NOT NULL DEFAULT '0',
  `produk_nama` varchar(255) DEFAULT NULL,
  `produk_ord_jml` int(11) NOT NULL DEFAULT '0',
  `produk_ord_hrg` int(11) NOT NULL DEFAULT '0',
  `produk_kir_jml` int(11) NOT NULL DEFAULT '0',
  `komisi` int(11) NOT NULL DEFAULT '0',
  `komisi_temp` int(11) NOT NULL DEFAULT '0',
  `hpp` int(11) NOT NULL DEFAULT '0',
  `laba` int(11) NOT NULL DEFAULT '0',
  `transaksi_id` int(11) NOT NULL DEFAULT '0',
  `trash` int(11) NOT NULL DEFAULT '0',
  `mlm_komisi` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

#
# Source for table rek_cache
#

DROP TABLE IF EXISTS `rek_cache`;
CREATE TABLE `rek_cache` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `rekening` varchar(255) DEFAULT NULL,
  `periode` varchar(255) DEFAULT NULL,
  `debet_saldo` decimal(14,2) NOT NULL DEFAULT '0.00',
  `kredit_saldo` decimal(14,2) NOT NULL DEFAULT '0.00',
  `after_saldo` decimal(14,2) NOT NULL DEFAULT '0.00',
  `keterangan` varchar(255) DEFAULT NULL,
  `tgl` tinyint(2) NOT NULL DEFAULT '0',
  `bln` tinyint(2) NOT NULL DEFAULT '0',
  `thn` smallint(4) NOT NULL DEFAULT '0',
  `dtime` datetime DEFAULT NULL,
  `cabang_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

#
# Source for table rek_cache_pembantu
#

DROP TABLE IF EXISTS `rek_cache_pembantu`;
CREATE TABLE `rek_cache_pembantu` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `produk_id` int(11) NOT NULL DEFAULT '0',
  `produk_nama` varchar(250) DEFAULT NULL,
  `unit_in` int(11) NOT NULL DEFAULT '0',
  `unit_ot` int(11) NOT NULL DEFAULT '0',
  `unit_af` int(11) NOT NULL DEFAULT '0',
  `nilai_in` decimal(14,2) NOT NULL DEFAULT '0.00',
  `nilai_ot` decimal(14,2) NOT NULL DEFAULT '0.00',
  `nilai_af` decimal(14,2) DEFAULT NULL,
  `omset_in` decimal(14,2) NOT NULL DEFAULT '0.00',
  `omset_ot` decimal(14,2) NOT NULL DEFAULT '0.00',
  `omset_af` decimal(14,2) NOT NULL DEFAULT '0.00',
  `tgl` varchar(2) DEFAULT NULL,
  `bln` varchar(2) DEFAULT NULL,
  `thn` varchar(2) DEFAULT NULL,
  `dtime` datetime DEFAULT NULL,
  `pembayaran` tinytext NOT NULL,
  `periode` varchar(32) DEFAULT NULL,
  `rekening` varchar(255) DEFAULT NULL,
  `cabang_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

#
# Source for table rek_hpp
#

DROP TABLE IF EXISTS `rek_hpp`;
CREATE TABLE `rek_hpp` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `before` decimal(14,2) NOT NULL DEFAULT '0.00',
  `debet` decimal(14,2) NOT NULL DEFAULT '0.00',
  `kredit` decimal(14,2) NOT NULL DEFAULT '0.00',
  `after` decimal(14,2) NOT NULL DEFAULT '0.00',
  `dtime` datetime DEFAULT NULL,
  `transaksi_id` int(11) NOT NULL DEFAULT '0',
  `transaksi_no` varchar(255) DEFAULT NULL,
  `keterangan` tinytext,
  `author` int(11) NOT NULL DEFAULT '0',
  `jenis` varchar(255) NOT NULL DEFAULT '',
  `pembayaran` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

#
# Source for table rek_hutang
#

DROP TABLE IF EXISTS `rek_hutang`;
CREATE TABLE `rek_hutang` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `v_before` decimal(14,2) NOT NULL DEFAULT '0.00',
  `v_debet` decimal(14,2) NOT NULL DEFAULT '0.00',
  `v_kredit` decimal(14,2) NOT NULL DEFAULT '0.00',
  `v_after` decimal(14,2) NOT NULL DEFAULT '0.00',
  `dtime` datetime DEFAULT NULL,
  `transaksi_id` int(11) NOT NULL DEFAULT '0',
  `transaksi_no` varchar(255) DEFAULT NULL,
  `keterangan` tinytext,
  `author` int(11) NOT NULL DEFAULT '0',
  `jenis` varchar(255) NOT NULL DEFAULT '',
  `pembayaran` varchar(255) DEFAULT '',
  `cabang_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

#
# Source for table rek_kas
#

DROP TABLE IF EXISTS `rek_kas`;
CREATE TABLE `rek_kas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `v_before` decimal(14,2) NOT NULL DEFAULT '0.00',
  `v_debet` decimal(14,2) NOT NULL DEFAULT '0.00',
  `v_kredit` decimal(14,2) NOT NULL DEFAULT '0.00',
  `v_after` decimal(14,2) NOT NULL DEFAULT '0.00',
  `dtime` datetime DEFAULT NULL,
  `transaksi_id` int(11) NOT NULL DEFAULT '0',
  `transaksi_no` varchar(255) DEFAULT NULL,
  `keterangan` tinytext,
  `author` int(11) NOT NULL DEFAULT '0',
  `jenis` varchar(255) NOT NULL DEFAULT '',
  `pembayaran` varchar(255) DEFAULT '',
  `cabang_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

#
# Source for table rek_lyd
#

DROP TABLE IF EXISTS `rek_lyd`;
CREATE TABLE `rek_lyd` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `before` decimal(14,2) NOT NULL DEFAULT '0.00',
  `debet` decimal(14,2) NOT NULL DEFAULT '0.00',
  `kredit` decimal(14,2) NOT NULL DEFAULT '0.00',
  `after` decimal(14,2) NOT NULL DEFAULT '0.00',
  `dtime` datetime DEFAULT NULL,
  `transaksi_id` int(11) NOT NULL DEFAULT '0',
  `transaksi_no` varchar(255) DEFAULT NULL,
  `keterangan` tinytext,
  `author` int(11) NOT NULL DEFAULT '0',
  `jenis` varchar(255) NOT NULL DEFAULT '',
  `pembayaran` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

#
# Source for table rek_modal
#

DROP TABLE IF EXISTS `rek_modal`;
CREATE TABLE `rek_modal` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `before` decimal(14,2) NOT NULL DEFAULT '0.00',
  `debet` decimal(14,2) NOT NULL DEFAULT '0.00',
  `kredit` decimal(14,2) NOT NULL DEFAULT '0.00',
  `after` decimal(14,2) NOT NULL DEFAULT '0.00',
  `dtime` datetime DEFAULT NULL,
  `transaksi_id` int(11) NOT NULL DEFAULT '0',
  `transaksi_no` varchar(255) DEFAULT NULL,
  `keterangan` tinytext,
  `author` int(11) NOT NULL DEFAULT '0',
  `jenis` varchar(255) NOT NULL DEFAULT '',
  `pembayaran` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

#
# Source for table rek_penjualan
#

DROP TABLE IF EXISTS `rek_penjualan`;
CREATE TABLE `rek_penjualan` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `before` decimal(14,2) NOT NULL DEFAULT '0.00',
  `debet` decimal(14,2) NOT NULL DEFAULT '0.00',
  `kredit` decimal(14,2) NOT NULL DEFAULT '0.00',
  `after` decimal(14,2) NOT NULL DEFAULT '0.00',
  `dtime` datetime DEFAULT NULL,
  `transaksi_id` int(11) NOT NULL DEFAULT '0',
  `transaksi_no` varchar(255) DEFAULT NULL,
  `keterangan` tinytext,
  `author` int(11) NOT NULL DEFAULT '0',
  `jenis` varchar(255) NOT NULL DEFAULT '',
  `pembayaran` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

#
# Source for table rek_persediaan
#

DROP TABLE IF EXISTS `rek_persediaan`;
CREATE TABLE `rek_persediaan` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `v_before` decimal(14,2) NOT NULL DEFAULT '0.00',
  `v_debet` decimal(14,2) NOT NULL DEFAULT '0.00',
  `v_kredit` decimal(14,2) NOT NULL DEFAULT '0.00',
  `v_after` decimal(14,2) NOT NULL DEFAULT '0.00',
  `dtime` datetime DEFAULT NULL,
  `transaksi_id` int(11) NOT NULL DEFAULT '0',
  `transaksi_no` varchar(255) DEFAULT NULL,
  `keterangan` tinytext,
  `author_id` int(11) NOT NULL DEFAULT '0',
  `cabang_id` int(11) NOT NULL DEFAULT '0',
  `jenis` varchar(255) NOT NULL DEFAULT '',
  `pembayaran` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

#
# Source for table rek_persediaan_barang
#

DROP TABLE IF EXISTS `rek_persediaan_barang`;
CREATE TABLE `rek_persediaan_barang` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `dtime` datetime DEFAULT NULL,
  `produk_id` int(11) NOT NULL DEFAULT '0',
  `produk_nama` varchar(250) DEFAULT '0',
  `unit_be` int(11) NOT NULL DEFAULT '0',
  `unit_in` int(11) NOT NULL DEFAULT '0',
  `unit_ot` int(11) NOT NULL DEFAULT '0',
  `unit_af` int(11) NOT NULL DEFAULT '0',
  `nilai_be` decimal(14,2) NOT NULL DEFAULT '0.00',
  `nilai_in` decimal(14,2) NOT NULL DEFAULT '0.00',
  `nilai_ot` decimal(14,2) NOT NULL DEFAULT '0.00',
  `nilai_af` decimal(14,2) NOT NULL DEFAULT '0.00',
  `on_komisi` decimal(14,2) NOT NULL DEFAULT '0.00',
  `on_harga` decimal(14,2) NOT NULL DEFAULT '0.00',
  `on_hpp` decimal(14,2) NOT NULL DEFAULT '0.00',
  `jml_omset_be` decimal(14,2) NOT NULL DEFAULT '0.00',
  `jml_omset_in` decimal(14,2) NOT NULL DEFAULT '0.00',
  `jml_omset_ot` decimal(14,2) NOT NULL DEFAULT '0.00',
  `jml_omset_af` decimal(14,2) NOT NULL DEFAULT '0.00',
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `transaksi_id` int(11) NOT NULL DEFAULT '0',
  `transaksi_no` varchar(250) DEFAULT '0',
  `transaksi_jenis` int(11) NOT NULL DEFAULT '0',
  `cabang_id` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

#
# Source for table rek_piutang
#

DROP TABLE IF EXISTS `rek_piutang`;
CREATE TABLE `rek_piutang` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `before` decimal(14,2) NOT NULL DEFAULT '0.00',
  `debet` decimal(14,2) NOT NULL DEFAULT '0.00',
  `kredit` decimal(14,2) NOT NULL DEFAULT '0.00',
  `after` decimal(14,2) NOT NULL DEFAULT '0.00',
  `dtime` datetime DEFAULT NULL,
  `transaksi_id` int(11) NOT NULL DEFAULT '0',
  `transaksi_no` varchar(255) DEFAULT NULL,
  `keterangan` tinytext,
  `author` int(11) NOT NULL DEFAULT '0',
  `jenis` varchar(255) NOT NULL DEFAULT '',
  `pembayaran` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

#
# Source for table transaksi
#

DROP TABLE IF EXISTS `transaksi`;
CREATE TABLE `transaksi` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `jenis` varchar(32) DEFAULT NULL,
  `nomer` varchar(40) DEFAULT NULL,
  `dtime` datetime DEFAULT NULL,
  `oleh_id` int(11) DEFAULT NULL COMMENT 'pelaku transaksi',
  `oleh_nama` varchar(255) DEFAULT NULL,
  `customers_id` int(11) NOT NULL DEFAULT '0',
  `customers_nama` varchar(255) DEFAULT NULL,
  `suppliers_id` int(11) NOT NULL DEFAULT '0',
  `suppliers_nama` varchar(255) DEFAULT NULL,
  `approvals_id` int(11) NOT NULL DEFAULT '0',
  `approvals_nama` varchar(255) DEFAULT NULL,
  `cabang_id` int(11) NOT NULL DEFAULT '0',
  `cabang_nama` varchar(255) DEFAULT NULL,
  `transaksi_nilai` decimal(14,2) NOT NULL DEFAULT '0.00',
  `sys_pembayaran` varchar(5) DEFAULT NULL,
  `keterangan` tinytext,
  `status` int(11) NOT NULL DEFAULT '0',
  `orders_id` int(11) NOT NULL DEFAULT '0',
  `orders_no` varchar(32) DEFAULT NULL,
  `bank_id` int(11) NOT NULL DEFAULT '0',
  `bank_nama` varchar(32) DEFAULT NULL,
  `pembayaran` varchar(16) DEFAULT '',
  `jatuh_tempo` int(11) NOT NULL DEFAULT '0' COMMENT 'dalam satuan detik (second)',
  `dtime_jatuh_tempo` datetime DEFAULT NULL,
  `diskon_jenis` varchar(32) DEFAULT NULL,
  `diskon_persen` varchar(32) DEFAULT NULL,
  `diskon_nillai` decimal(14,2) NOT NULL DEFAULT '0.00',
  `transaksi_net` decimal(14,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`id`),
  UNIQUE KEY `no_transaksi` (`nomer`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
