Skip to content

Commit

Permalink
added default value
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Feb 25, 2020
1 parent 084b597 commit 95f1945
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/Models/Purchase/BillItemTax.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ public function bill()

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()
{
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]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Sale/InvoiceItemTax.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function item()

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]);
}

/**
Expand Down

0 comments on commit 95f1945

Please sign in to comment.