bank, laporan bank, budgeting badge

This commit is contained in:
Wian Drs
2026-09-17 00:51:53 +07:00
parent e4d6245a3d
commit 2a77402c60
11 changed files with 82 additions and 16 deletions
+10 -1
View File
@@ -123,7 +123,16 @@ class Invoices extends MY_Controller
}
private function addPdfCompanySettings(array&$data)
{
$data['pdf_company']=$this->db->get_where('companies',array('id'=>$this->company()))->row();$currency=!empty($data['invoice']->transaction_currency)?$data['invoice']->transaction_currency:($data['pdf_company']->base_currency??'IDR');$data['pdf_currency']=$this->db->get_where('currencies',array('code'=>$currency))->row();$data['pdf_bank_accounts']=$this->db->table_exists('company_bank_accounts')?$this->db->where(array('company_id'=>$this->company(),'is_active'=>1))->order_by('is_primary','DESC')->order_by('id','ASC')->get('company_bank_accounts')->result():array();$data['pdf_logo_data']='';$path=$data['pdf_company']->logo_path??'';if($path!==''&&is_file(FCPATH.$path)){$mime=function_exists('mime_content_type')?mime_content_type(FCPATH.$path):'image/png';$data['pdf_logo_data']='data:'.$mime.';base64,'.base64_encode(file_get_contents(FCPATH.$path));}
$data['pdf_company']=$this->db->get_where('companies',array('id'=>$this->company()))->row();
$currency=!empty($data['invoice']->transaction_currency)?$data['invoice']->transaction_currency:($data['pdf_company']->base_currency??'IDR');
$data['pdf_currency']=$this->db->get_where('currencies',array('code'=>$currency))->row();
$data['pdf_bank_accounts']=array();
if($this->db->table_exists('company_bank_accounts')){
$this->db->where(array('company_id'=>$this->company(),'is_active'=>1));
if($this->db->field_exists('show_on_invoice','company_bank_accounts'))$this->db->where('show_on_invoice',1);
$data['pdf_bank_accounts']=$this->db->order_by('is_primary','DESC')->order_by('id','ASC')->get('company_bank_accounts')->result();
}
$data['pdf_logo_data']='';$path=$data['pdf_company']->logo_path??'';if($path!==''&&is_file(FCPATH.$path)){$mime=function_exists('mime_content_type')?mime_content_type(FCPATH.$path):'image/png';$data['pdf_logo_data']='data:'.$mime.';base64,'.base64_encode(file_get_contents(FCPATH.$path));}
}
private function mutation($permission,callable$callback,$message)
{