Update besar apk finance
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
class Migration_Seed_asset_disposal_accounts extends CI_Migration
|
||||
{
|
||||
public function up(){foreach(array(array('asset_disposal_gain','4192','Laba Pelepasan Aset','revenue'),array('asset_disposal_loss','6193','Rugi Pelepasan Aset','expense'))as$d){$a=$this->db->get_where('accounts',array('kode_akun'=>$d[1]))->row();if(!$a){$this->db->insert('accounts',array('kode_akun'=>$d[1],'nama_akun'=>$d[2],'tipe'=>$d[3],'posisi'=>$d[3]==='expense'?'debit':'kredit','kategori'=>'laba_rugi','is_active'=>1,'is_header'=>0,'allow_posting'=>1));$id=$this->db->insert_id();}else$id=$a->id;if(!$this->db->where('mapping_key',$d[0])->count_all_results('system_account_mappings'))$this->db->insert('system_account_mappings',array('mapping_key'=>$d[0],'account_id'=>$id,'description'=>$d[2],'is_active'=>1,'created_at'=>date('Y-m-d H:i:s')));}}
|
||||
public function down(){throw new RuntimeException('Gunakan backup untuk rollback mapping Tahap 8.');}
|
||||
}
|
||||
Reference in New Issue
Block a user