43 lines
		
	
	
		
			950 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			950 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Models\Banking;
 | |
| 
 | |
| use App\Abstracts\Model;
 | |
| 
 | |
| class Reconciliation extends Model
 | |
| {
 | |
|     protected $table = 'reconciliations';
 | |
| 
 | |
|     protected $dates = ['deleted_at', 'started_at', 'ended_at'];
 | |
| 
 | |
|     /**
 | |
|      * Attributes that should be mass-assignable.
 | |
|      *
 | |
|      * @var array
 | |
|      */
 | |
|     protected $fillable = ['company_id', 'account_id', 'started_at', 'ended_at', 'closing_balance', 'reconciled'];
 | |
| 
 | |
|     /**
 | |
|      * 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');
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * Convert closing balance to double.
 | |
|      *
 | |
|      * @param  string  $value
 | |
|      * @return void
 | |
|      */
 | |
|     public function setClosingBalanceAttribute($value)
 | |
|     {
 | |
|         $this->attributes['closing_balance'] = (double) $value;
 | |
|     }
 | |
| }
 |