akaunting/app/Models/Banking/Reconciliation.php

55 lines
1.2 KiB
PHP
Raw Normal View History

2018-10-27 17:57:40 +03:00
<?php
namespace App\Models\Banking;
2019-11-16 10:21:14 +03:00
use App\Abstracts\Model;
2021-06-18 10:52:20 +03:00
use Illuminate\Database\Eloquent\Factories\HasFactory;
2018-10-27 17:57:40 +03:00
class Reconciliation extends Model
{
2021-06-18 10:52:20 +03:00
use HasFactory;
2018-10-27 17:57:40 +03:00
protected $table = 'reconciliations';
protected $dates = ['deleted_at', 'started_at', 'ended_at'];
/**
* Attributes that should be mass-assignable.
*
* @var array
*/
2021-06-17 10:59:07 +03:00
protected $fillable = ['company_id', 'account_id', 'started_at', 'ended_at', 'closing_balance', 'reconciled', 'created_by'];
2018-10-27 17:57:40 +03:00
2020-11-13 15:15:27 +03:00
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'closing_balance' => 'double',
'reconciled' => 'boolean',
];
2018-10-27 17:57:40 +03:00
/**
* Sortable columns.
*
* @var array
*/
public $sortable = ['created_at', 'account_id', 'started_at', 'ended_at', 'closing_balance', 'reconciled'];
public function account()
{
return $this->belongsTo('App\Models\Banking\Account');
}
2021-06-18 10:52:20 +03:00
/**
* Create a new factory instance for the model.
*
* @return \Illuminate\Database\Eloquent\Factories\Factory
*/
protected static function newFactory()
{
return \Database\Factories\Reconciliation::new();
}
2018-10-27 17:57:40 +03:00
}