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); }
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); }
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'); }
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'); }
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'); }
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); }
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); }
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][] = ''; } }
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][] = ''; } }
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); }
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); }
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); }
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); }
function find($where = array()) { return parent::find($where); }
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); }
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); }
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); }
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); }
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); }
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); }
function delete($data, $waktu, $reason) { $this->sirkulasiAyam($waktu, $data->ayam, 'MASUK', $transaksi, $data->id, $data->pcs, $data->kg); return parent::delete($data->id); }
function find($where = array()) { $this->db->select('outlet.*')->select("CONCAT('Rp ', FORMAT(saldo, 2)) AS saldo", false); return parent::find($where); }
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); }
function delete($id, $waktu, $reason) { $data = $this->findOne($id); $this->sirkulasiBarang($waktu, $data['barang'], 'KELUAR', $reason, $data['id'], $data['qty']); return parent::delete($id); }
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); }
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); }
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); }
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); }
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); }
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); }