<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Aset extends Model
{
    protected $table = "ast_aset";

    function penyusutan(){
    	return $this->hasMany("App\AsetPenyusutan", "id_aset");
    }

    function akunAset()
    {
    	return $this->belongsTo("App\Perkiraan", 'id_akun_aset');
    }

    function akunPenyusutan()
    {
    	return $this->belongsTo("App\Perkiraan", 'id_akun_penyusutan');
    }

    function akunAkumulasiPenyusutan()
    {
    	return $this->belongsTo("App\Perkiraan", 'id_akun_akumulasi_penyusutan');
    }

    function pembelian(){
    	return $this->belongsTo("App\Pembelian", "id_pembelian");
    }

    function pembelianBarang(){
    	return $this->belongsTo("App\pembelianBarang", "id_pembelian_barang");
    }

    function asetJual()
    {
    	return $this->hasOne("App\AsetJual", "id_aset");
    }
}
