function setor_bank($id, $bank, $bukti, $total, $idKaryawan) { $id = $this->clearText($id); $bank = $this->clearText($bank); $bukti = $this->clearText($bukti); $total = $this->clearText($total); $idKaryawan = $this->clearText($idKaryawan); $tgl = date("Y-m-d"); $prefixID = substr($id, 0, 3); if ($prefixID == "KPP") { $query = "UPDATE `khusus_pelunasan` SET `id_bank` = '{$bank}', `no_bukti` = '{$bukti}' WHERE `id` = '{$id}';"; $keterangan = "Setoran Pelunasan " . $id; } else { $query = "UPDATE `khusus_penjualan` SET `id_bank` = '{$bank}', `no_bukti` = '{$bukti}' WHERE `id` = '{$id}';"; $keterangan = "Setoran Penjualan " . $id; } if ($result = $this->runQuery($query)) { $cbank = new bank_khusus(); $hasilBank = $cbank->transaksi_setor($bank, $bukti, $tgl, $keterangan, $total, $idKaryawan); if ($hasilBank) { return TRUE; } else { return FALSE; } } else { return FALSE; } }
function ambil_bg($idPelunasan, $tglBg, $totalBayar, $idBank, $bukti, $idKaryawan) { $idPelunasan = $this->clearText($idPelunasan); $tglBg = $this->clearText($tglBg); $totalBayar = $this->clearText($totalBayar); $idBank = $this->clearText($idBank); $bukti = $this->clearText($bukti); $idKaryawan = $this->clearText($idKaryawan); $query = "UPDATE `khusus_pelunasan` SET `ambil_bg` = '1' WHERE `id` = '{$idPelunasan}';"; if ($result = $this->runQuery($query)) { $bank = new bank_khusus(); $hasilBank = $bank->transaksi_setor($idBank, $bukti, $tglBg, "Pencairan BG " . $bukti, $totalBayar, $idKaryawan); if ($hasilBank) { return TRUE; } else { return FALSE; } } else { return FALSE; } }