added default value

This commit is contained in:
denisdulici 2020-02-25 16:21:04 +03:00
parent 084b597bc5
commit 95f1945f02
2 changed files with 3 additions and 3 deletions

View File

@ -26,12 +26,12 @@ class BillItemTax extends Model
public function item() public function item()
{ {
return $this->belongsToThrough('App\Models\Common\Item', 'App\Models\Purchase\BillItem', 'bill_item_id'); return $this->belongsToThrough('App\Models\Common\Item', 'App\Models\Purchase\BillItem', 'bill_item_id')->withDefault(['name' => trans('general.na')]);
} }
public function tax() public function tax()
{ {
return $this->belongsTo('App\Models\Setting\Tax')->withDefault(['name' => trans('general.na')]); return $this->belongsTo('App\Models\Setting\Tax')->withDefault(['name' => trans('general.na'), 'rate' => 0]);
} }
/** /**

View File

@ -31,7 +31,7 @@ class InvoiceItemTax extends Model
public function tax() public function tax()
{ {
return $this->belongsTo('App\Models\Setting\Tax')->withDefault(['name' => trans('general.na')]); return $this->belongsTo('App\Models\Setting\Tax')->withDefault(['name' => trans('general.na'), 'rate' => 0]);
} }
/** /**