human friendly invoice import/export

This commit is contained in:
denisdulici
2020-01-20 22:58:49 +03:00
parent 8562223ff3
commit 6923a3d6e4
27 changed files with 497 additions and 76 deletions

View File

@ -4,11 +4,11 @@ namespace App\Models\Sale;
use App\Abstracts\Model;
use App\Traits\Currencies;
use Znck\Eloquent\Traits\BelongsToThrough;
class InvoiceItemTax extends Model
{
use Currencies;
use Currencies, BelongsToThrough;
protected $table = 'invoice_item_taxes';
@ -24,9 +24,14 @@ class InvoiceItemTax extends Model
return $this->belongsTo('App\Models\Sale\Invoice');
}
public function item()
{
return $this->belongsToThrough('App\Models\Common\Item', 'App\Models\Sale\InvoiceItem', 'invoice_item_id')->withDefault(['name' => trans('general.na')]);
}
public function tax()
{
return $this->belongsTo('App\Models\Setting\Tax');
return $this->belongsTo('App\Models\Setting\Tax')->withDefault(['name' => trans('general.na')]);
}
/**