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
@@ -0,0 +1,25 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_Add_invoice_visibility_to_company_bank_accounts extends CI_Migration
{
public function up()
{
if (!$this->db->table_exists('company_bank_accounts')) return;
if (!$this->db->field_exists('show_on_invoice', 'company_bank_accounts')) {
$this->db->query("ALTER TABLE `company_bank_accounts`
ADD `show_on_invoice` TINYINT(1) NOT NULL DEFAULT 1 AFTER `is_primary`");
}
if (!$this->db->query("SHOW INDEX FROM company_bank_accounts WHERE Key_name='idx_company_bank_invoice'")->row()) {
$this->db->query("ALTER TABLE `company_bank_accounts`
ADD KEY `idx_company_bank_invoice` (`company_id`,`is_active`,`show_on_invoice`,`is_primary`)");
}
}
public function down()
{
throw new RuntimeException('Pilihan rekening pada PDF Invoice dipertahankan untuk histori dokumen.');
}
}