Update Baru

This commit is contained in:
atuy
2026-06-27 10:23:13 +07:00
parent 3c599ef4a6
commit 0d9ba06af5
+11 -2
View File
@@ -412,9 +412,17 @@ class Invoice extends CI_Controller {
public function cetaktransaksi($no_pendaftaran) public function cetaktransaksi($no_pendaftaran)
{ {
$data['invoice'] = $this->invoice_model->detail($no_pendaftaran); $data['invoice'] = $this->invoice_model->detail($no_pendaftaran);
$data['data'] = $this->db->get_where('v_rpt_trans_invoice',['no_pendaftaran'=>$no_pendaftaran])->row();
$data['datatrx'] = $this->db->get_where('v_rpt_trans_invoice',['no_pendaftaran'=>$no_pendaftaran])->result(); // --- INI YANG KITA UBAH MIN ---
// Pakai data dari invoice_model untuk memunculkan Nama, No Pendaftaran, dll
$data['data'] = $this->invoice_model->detail($no_pendaftaran);
// Ambil rincian angsuran langsung dari tabel tr_invoice (bukan dari View)
$data['datatrx'] = $this->db->get_where('tr_invoice', ['no_pendaftaran'=>$no_pendaftaran])->result();
// ------------------------------
$datatrx = $this->db->get_where("tr_invoice", ["no_pendaftaran" => $no_pendaftaran])->result(); $datatrx = $this->db->get_where("tr_invoice", ["no_pendaftaran" => $no_pendaftaran])->result();
// Inisialisasi variabel untuk menyimpan total pembayaran // Inisialisasi variabel untuk menyimpan total pembayaran
$total_pembayaran = 0; $total_pembayaran = 0;
@@ -422,6 +430,7 @@ public function cetaktransaksi($no_pendaftaran)
foreach ($datatrx as $trx) { foreach ($datatrx as $trx) {
$total_pembayaran += $trx->bayar; $total_pembayaran += $trx->bayar;
} }
$data["total"] = $total_pembayaran; $data["total"] = $total_pembayaran;
$this->load->view('invoice/cetak',$data); $this->load->view('invoice/cetak',$data);
} }