close #46 Enhancement: Bill and Invoice improve total status and system

This commit is contained in:
cuneytsenturk
2017-10-11 19:52:35 +03:00
parent 40dea7fa99
commit d36bcaaf13
14 changed files with 716 additions and 148 deletions

View File

@ -69,6 +69,11 @@ class Bill extends Model
return $this->hasMany('App\Models\Expense\BillItem');
}
public function totals()
{
return $this->hasMany('App\Models\Income\InvoiceTotal');
}
public function payment()
{
return $this->belongsTo('App\Models\Expense\BillPayment', 'id', 'bill_id');

View File

@ -0,0 +1,25 @@
<?php
namespace App\Models\Expense;
use App\Models\Model;
use App\Traits\DateTime;
class BillTotal extends Model
{
use DateTime;
protected $table = 'bill_totals';
/**
* Attributes that should be mass-assignable.
*
* @var array
*/
protected $fillable = ['company_id', 'bill_id', 'code', 'name', 'amount', 'sort_order'];
public function bill()
{
return $this->belongsTo('App\Models\Expense\Bill');
}
}