<?php

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Akun extends Model
{
    protected $table = 'table_akun';
    public $timestamps = false;

    protected $casts = [
        'level' => 'int',
        'status' => 'int'
    ];

    protected $guarded = [];

    public function data_labarugi()
    {
        return $this->hasMany(DataLabaRugi::class, 'akun');
    }

    public function data_neraca()
    {
        return $this->hasMany(DataNeraca::class, 'akun');
    }

    public function data_inventaris_hapus_bukus()
    {
        return $this->hasMany(TransaksiHapusBukuInventaris::class, 'trans_akun');
    }

    public function data_inventaris_trans()
    {
        return $this->hasMany(TransaksiInventaris::class, 'trans_akun');
    }

    public function data_penempatan_masters()
    {
        return $this->hasMany(PenempatanBank::class, 'akun_penempatan');
    }

    public function data_tabungan_produks()
    {
        return $this->hasMany(ProdukTabungan::class, 'akun_simpanan_id');
    }

    public function data_trans_akuntansis()
    {
        return $this->hasMany(TransaksiAkuntansi::class, 'akun_kredit');
    }

    public function data_trans_akuntansi_nonkas()
    {
        return $this->hasMany(TransaksiNonKas::class, 'akun_kredit');
    }

    public function data_trans_jurnals()
    {
        return $this->hasMany(JurnalTrans::class, 'akun_jurnal');
    }
}
