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
@@ -0,0 +1,29 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_Add_depreciation_account_mapping extends CI_Migration
{
public function up()
{
if (!$this->db->table_exists('system_account_mappings')) {
throw new RuntimeException('Jalankan migration accounting foundation terlebih dahulu.');
}
$exists = $this->db->where('mapping_key', 'depreciation_expense')->count_all_results('system_account_mappings') > 0;
$accountExists = $this->db->where('id', 54)->count_all_results('accounts') > 0;
if (!$exists && $accountExists) {
$this->db->insert('system_account_mappings', array(
'mapping_key' => 'depreciation_expense',
'account_id' => 54,
'description' => 'Beban penyusutan aset',
'is_active' => 1,
'created_at' => date('Y-m-d H:i:s')
));
}
}
public function down()
{
$this->db->where('mapping_key', 'depreciation_expense')->delete('system_account_mappings');
}
}