Update besar apk finance

This commit is contained in:
Wian Drs
2026-09-11 16:03:00 +07:00
parent d42483b350
commit 4ef15c22ae
897 changed files with 98056 additions and 15979 deletions
+24
View File
@@ -0,0 +1,24 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class InvoiceModel extends CI_Model
{
public function find($id)
{
return $this->db->get_where('invoices', array('id' => (int) $id))->row();
}
public function createDraft(array $data)
{
$data['status'] = 'draft';
if (!$this->db->insert('invoices', $data)) {
throw new RuntimeException('Gagal membuat draft invoice.');
}
return (int) $this->db->insert_id();
}
public function updateById($id, array $data)
{
return $this->db->where('id', (int) $id)->update('invoices', $data);
}
}