示例#1
0
 function find($where = array())
 {
     $this->translateDateRange($where);
     $this->db->join('belanjadetail', 'belanjadetail.belanja=belanja.id', 'LEFT');
     $this->db->join('baranggudang', 'belanjadetail.barang=baranggudang.id', 'LEFT');
     return parent::find($where);
 }
示例#2
0
 function getTFoot($tbody)
 {
     $total = 0;
     foreach ($tbody[0] as $tb) {
         $total += preg_replace("/([^0-9\\.])/i", "", $tb->modal);
     }
     $this->tfoot[0][2] = 'TOTAL';
     $this->tfoot[0][3] = $this->toRp($total);
     $pcs = 0;
     $kg = 0;
     foreach ($tbody[1] as $tb) {
         $pcs += $tb->pcs;
         $kg += $tb->kg;
     }
     $this->tfoot[1][3] = 'TOTAL';
     $this->tfoot[1][4] = "{$pcs} PCs";
     $this->tfoot[1][5] = "{$kg} Kg";
     $total = 0;
     $satuan = '';
     foreach ($tbody[2] as $tb) {
         $total += $tb->qty;
         $satuan = $tb->satuan;
     }
     $this->tfoot[2][3] = 'TOTAL';
     $this->tfoot[2][4] = "{$total} {$satuan}";
     $total = 0;
     foreach ($tbody[3] as $tb) {
         $total += $tb->qty;
     }
     $this->tfoot[3][3] = 'TOTAL';
     $this->tfoot[3][4] = "{$total} PCs";
     return parent::getTFoot($tbody);
 }
示例#3
0
 function __construct()
 {
     parent::__construct();
     $this->table = 'karyawan';
     $this->thead = array(array('nama', 'NAMA KARYAWAN'));
     $this->inputFields = array(0 => array('nama', 'NAMA KARYAWAN'));
     $this->strings = array('nama');
     $this->required = array('nama');
 }
示例#4
0
 function __construct()
 {
     parent::__construct();
     $this->table = 'baranggudang';
     $this->thead = array(array('nama', 'NAMA BARANG'), array('type', 'GUDANG'));
     $this->inputFields = array(0 => array('nama', 'NAMA BARANG'), 1 => array('satuan', 'SATUAN'), 2 => array('type', 'GUDANG', array('DEPAN' => 'DEPAN', 'BELAKANG' => 'BELAKANG')));
     $this->strings = array('nama', 'satuan', 'type');
     $this->required = array('nama', 'satuan', 'type');
 }
示例#5
0
 function __construct()
 {
     parent::__construct();
     $this->table = 'distributor';
     $this->thead = array(array('nama', 'NAMA DISTRIBUTOR'));
     $this->inputFields = array(0 => array('nama', 'NAMA DISTRIBUTOR'));
     $this->strings = array('nama');
     $this->required = array('nama');
 }
示例#6
0
 function getTFoot($tbody)
 {
     $total = 0;
     foreach ($tbody as $tb) {
         $total += preg_replace("/([^0-9\\.])/i", "", $tb->saldo);
     }
     $this->tfoot[1] = 'TOTAL HUTANG';
     $this->tfoot[2] = $this->toRp($total);
     return parent::getTFoot($tbody);
 }
示例#7
0
 function getTFoot($tbody)
 {
     $total = 0;
     foreach ($tbody as $tb) {
         $total += preg_replace("/([^0-9\\.])/i", "", $tb->nominal);
     }
     $this->tfoot[3] = 'TOTAL';
     $this->tfoot[4] = $this->toRp($total);
     return parent::getTFoot($tbody);
 }
示例#8
0
 function __construct()
 {
     parent::__construct();
     $this->table = 'baranggudang';
     $this->thead = array();
     $this->thead[0] = array(array('nama', 'BAHAN'), array('type', 'GUDANG'), array('stock', 'STOK GUDANG'));
     $this->thead[1] = array(array('nama', 'AYAM MENTAH'), array('pcs', 'STOK ( PCs )'), array('kg', 'STOK ( Kg )'));
     $this->thead[2] = array(array('nama', 'PRODUK'), array('type', 'JENIS'), array('stock', 'STOK GUDANG'));
     $this->filters = array();
     $this->tfoot = array();
     foreach ($this->thead as $index => $th) {
         foreach ($th as $t => $h) {
             $this->tfoot[$index][$t] = '';
         }
         $this->tfoot[$index][] = '';
     }
 }
示例#9
0
 function __construct()
 {
     parent::__construct();
     $this->table = 'baranggudang';
     $this->thead = array();
     $this->thead[0] = array(array('outlet', 'OUTLET'), array('barang', 'BAHAN'), array('stock', 'STOK OUTLET'));
     $this->thead[1] = array(array('outlet', 'OUTLET'), array('ayam', 'AYAM MENTAH DI OUTLET'), array('pcs', 'STOK ( PCs )'), array('kg', 'STOK ( Kg )'));
     $this->thead[2] = array(array('outlet', 'OUTLET'), array('produk', 'PRODUK'), array('type', 'JENIS'), array('stock', 'STOK OUTLET'));
     $this->filters = array(0 => array('outlet', 'FILTER OUTLET'));
     $this->buildRelation($this->filters[0][2], 'outlet', array(), 'TAMPILKAN SEMUA');
     $this->tfoot = array();
     foreach ($this->thead as $index => $th) {
         foreach ($th as $t => $h) {
             $this->tfoot[$index][$t] = '';
         }
         $this->tfoot[$index][] = '';
     }
 }
示例#10
0
 function delete($data, $waktu, $reason)
 {
     $this->sirkulasiProduk($waktu, $data->produk, 'KELUAR', $reason, $data->id, $data->qty);
     $this->sirkulasiProduk($waktu, $data->produk, 'MASUK', $reason, $data->id, $data->qty);
     return parent::delete($data->id);
 }
示例#11
0
 function find($where = array())
 {
     $this->db->select('sirkulasibarangoutlet.*')->select('outlet.nama as outlet', false)->select("DATE_FORMAT(waktu,'%d %b %Y %T') AS waktu", false)->select('baranggudang.nama as barang')->select("CONCAT (sirkulasibarangoutlet.qty, ' ', baranggudang.satuan) AS qty", false)->select("CONCAT (sirkulasibarangoutlet.stock, ' ', baranggudang.satuan) AS stock", false)->join('baranggudang', 'baranggudang.id=sirkulasibarangoutlet.barang')->join('outlet', 'sirkulasibarangoutlet.outlet=outlet.id')->order_by('id', 'DESC');
     return parent::find($where);
 }
示例#12
0
 function find($where = array())
 {
     $this->db->select('ayamoutlet.*')->select("CONCAT(ayamoutlet.pcs, ' PCs') as stock", false)->select('outlet.nama as outlet')->join('outlet', 'ayamoutlet.outlet=outlet.id')->select('ayam.nama as ayam')->join('ayam', 'ayamoutlet.ayam=ayam.id', 'LEFT');
     return parent::find($where);
 }
示例#13
0
 function find($where = array())
 {
     $this->db->select('pinjaman.*')->select('debitur.nama as debitur')->select("DATE_FORMAT(waktu,'%d %b %Y %T') AS waktu", false)->select("CONCAT('Rp ', FORMAT(nominal, 2)) AS nominal", false)->join('debitur', 'debitur.id = pinjaman.debitur')->order_by('id', 'DESC')->where('type', 'PEMINJAMAN');
     return parent::find($where);
 }
示例#14
0
 function find($where = array())
 {
     return parent::find($where);
 }
示例#15
0
 function find($where = array())
 {
     $this->db->select('produksi.*')->select('karyawan.nama as karyawan', false)->select("IFNULL(outlet.nama, 'GUDANG') as outlet", false)->select("DATE_FORMAT(waktu,'%d %b %Y %T') AS waktu", false)->join('outlet', 'outlet.id = produksi.outlet', 'LEFT')->join('karyawan', 'karyawan.id = produksi.karyawan', 'LEFT');
     return parent::find($where);
 }
示例#16
0
 function find($where = array())
 {
     $this->translateDateRange($where);
     $this->db->select('sirkulasibarang.*')->select('baranggudang.satuan')->select("DATE_FORMAT(waktu,'%d %b %Y %T') AS waktu", false)->select('baranggudang.nama as barang')->select("CONCAT (IF (sirkulasibarang.type = 'MASUK', qty, 0), ' ', baranggudang.satuan) AS masuk", false)->select("CONCAT (IF (sirkulasibarang.type = 'KELUAR', qty, 0), ' ', baranggudang.satuan) AS keluar", false)->select("CONCAT (sirkulasibarang.stock, ' ', baranggudang.satuan) AS stock", false)->join('baranggudang', 'baranggudang.id=sirkulasibarang.barang');
     return parent::find($where);
 }
示例#17
0
 function delete($data, $waktu, $reason, $outlet)
 {
     $this->sirkulasiAyam($waktu, $data->ayam, 'MASUK', $reason, $data->id, $data->pcs, $data->kg);
     $this->sirkulasiAyamOutlet($waktu, $data->ayam, 'KELUAR', $reason, $data->id, $data->pcs, $data->kg, $outlet);
     return parent::delete($data->id);
 }
示例#18
0
 function find($where = array())
 {
     $this->db->select('sirkulasiprodukoutlet.*')->select('outlet.nama as outlet', false)->select('produk.nama as produk')->select("CONCAT (sirkulasiprodukoutlet.qty, ' PCs') AS qty", false)->select("CONCAT (sirkulasiprodukoutlet.stock, ' PCs') AS stock", false)->select("DATE_FORMAT(waktu,'%d %b %Y %T') AS waktu", false)->join('produk', 'produk.id=sirkulasiprodukoutlet.produk')->join('outlet', 'sirkulasiprodukoutlet.outlet=outlet.id')->order_by('id', 'DESC');
     return parent::find($where);
 }
示例#19
0
 function find($where = array())
 {
     $this->translateDateRange($where);
     $this->db->select('setoran.*')->select("DATE_FORMAT(waktu,'%d %b %Y %T') AS waktu", false)->select('produk.nama as produk', FALSE)->select('produk.type as type', FALSE)->select("CONCAT('Rp ', FORMAT(produk.harga, 2)) AS harga", false)->select("CONCAT (setoranpenjualan.qty, ' PCs') as qty", false)->select("CONCAT('Rp ', FORMAT(qty * harga, 2)) AS total", false)->join('setoranpenjualan', 'setoranpenjualan.setoran=setoran.id', 'LEFT')->join('produk', 'setoranpenjualan.produk=produk.id', 'LEFT');
     return parent::find($where);
 }
示例#20
0
 function find($where = array())
 {
     $this->db->select('barangoutlet.*')->select('outlet.nama as outlet')->select('baranggudang.nama as barang')->select("CONCAT(barangoutlet.stock, ' ', baranggudang.satuan) as stock", false)->join('outlet', 'barangoutlet.outlet=outlet.id')->join('baranggudang', 'barangoutlet.barang=baranggudang.id', 'LEFT');
     return parent::find($where);
 }
示例#21
0
 function delete($data, $waktu, $reason)
 {
     $this->sirkulasiAyam($waktu, $data->ayam, 'MASUK', $transaksi, $data->id, $data->pcs, $data->kg);
     return parent::delete($data->id);
 }
示例#22
0
 function find($where = array())
 {
     $this->db->select('outlet.*')->select("CONCAT('Rp ', FORMAT(saldo, 2)) AS saldo", false);
     return parent::find($where);
 }
示例#23
0
 function find($where = array())
 {
     $this->db->select('pesanan.*, outlet.nama as outlet', false)->select("DATE_FORMAT(pesanan.waktu,'%d %b %Y %T') AS waktu", false)->select("CONCAT('Rp ', FORMAT(total, 2)) AS total", false)->select("CONCAT('Rp ', FORMAT(SUM(pesananbayar.nominal), 2)) as dibayar", false)->join('pesananbayar', 'pesananbayar.pesanan = pesanan.id', 'LEFT')->join('outlet', 'outlet.id = pesanan.outlet', 'LEFT')->group_by('pesanan.id');
     return parent::find($where);
 }
示例#24
0
 function delete($id, $waktu, $reason)
 {
     $data = $this->findOne($id);
     $this->sirkulasiBarang($waktu, $data['barang'], 'KELUAR', $reason, $data['id'], $data['qty']);
     return parent::delete($id);
 }
示例#25
0
 function find($where = array())
 {
     $this->db->select('cashflowoutlet.*')->select("DATE_FORMAT(waktu,'%d %b %Y %T') AS waktu", false)->select("CONCAT('Rp ', FORMAT(nominal, 2)) AS nominal", false)->select("CONCAT('Rp ', FORMAT(cashflowoutlet.saldo, 2)) AS saldo", false)->select('outlet.nama as outlet')->join('outlet', 'cashflowoutlet.outlet=outlet.id', 'LEFT');
     // ->order_by('id', 'DESC');
     return parent::find($where);
 }
示例#26
0
 function find($where = array())
 {
     $this->translateDateRange($where);
     $this->db->select('*')->select("DATE_FORMAT(waktu,'%d %b %Y %T') AS waktu", false)->select("CONCAT('Rp ', FORMAT(IF (type = 'MASUK', nominal, 0), 2)) AS masuk", false)->select("CONCAT('Rp ', FORMAT(IF (type = 'KELUAR', nominal, 0), 2)) AS keluar", false)->select("CONCAT('Rp ', FORMAT(saldo, 2)) AS saldo", false)->where($where);
     return parent::find($where);
 }
示例#27
0
 function find($where = array())
 {
     $this->db->select('pemasukan.*, karyawan.nama as karyawan')->select("CONCAT('Rp ', FORMAT(nominal, 2)) AS nominal", false)->join('karyawan', 'karyawan.id = pemasukan.karyawan', 'LEFT');
     return parent::find($where);
 }
示例#28
0
 function delete($id, $reason, $waktu, $outlet)
 {
     $data = $this->findOne($id);
     parent::delete($id);
     return 0 == $outlet ? $this->sirkulasiBarang($waktu, $data['barang'], 'MASUK', $reason, $id, $data['qty']) : $this->sirkulasiBarangOutlet($waktu, $data['barang'], 'MASUK', $reason, $id, $data['qty'], $outlet);
 }
示例#29
0
 function find($where = array())
 {
     $this->db->select('bawaan.*')->select('outlet.nama as outlet')->select("DATE_FORMAT(waktu,'%d %b %Y %T') AS waktu", false)->join('outlet', 'bawaan.outlet = outlet.id');
     return parent::find($where);
 }
示例#30
0
 function delete($data, $waktu, $reason, $source, $destination)
 {
     $this->sirkulasiProdukOutlet($waktu, $data->produk, 'MASUK', $reason, $data->id, $data->qty, $source);
     $this->sirkulasiprodukOutlet($waktu, $data->produk, 'KELUAR', $reason, $data->id, $data->qty, $destination);
     return parent::delete($data->id);
 }