Merge Invoice and Bill into Document

This commit is contained in:
Burak Çakırel
2020-12-24 01:28:38 +03:00
parent 830cc05957
commit 0c1424db47
436 changed files with 31655 additions and 37350 deletions

View File

@ -12,7 +12,7 @@ class Item extends TransformerAbstract
/**
* @var array
*/
protected $defaultIncludes = ['tax', 'category'];
protected $defaultIncludes = ['taxes', 'category'];
/**
* @param Model $model
@ -28,7 +28,7 @@ class Item extends TransformerAbstract
'sale_price' => $model->sale_price,
'purchase_price' => $model->purchase_price,
'category_id' => $model->category_id,
'tax_id' => $model->tax_id,
'tax_ids' => $model->tax_ids,
'picture' => $model->picture,
'enabled' => $model->enabled,
'created_at' => $model->created_at ? $model->created_at->toIso8601String() : '',
@ -40,13 +40,13 @@ class Item extends TransformerAbstract
* @param Model $model
* @return mixed
*/
public function includeTax(Model $model)
public function includeTaxes(Model $model)
{
if (!$model->tax) {
if (!$model->taxes) {
return $this->null();
}
return $this->item($model->tax, new Tax());
return $this->item($model->taxes, new Tax());
}
/**