fixed exports

This commit is contained in:
denisdulici
2020-02-21 21:37:48 +03:00
parent 8100983b3a
commit 3fdf2d9915
11 changed files with 71 additions and 11 deletions

View File

@ -20,7 +20,13 @@ class InvoiceItems extends Export
public function map($model): array
{
$model->invoice_number = $model->invoice->invoice_number;
$invoice = $model->invoice;
if (empty($invoice)) {
return [];
}
$model->invoice_number = $invoice->invoice_number;
$model->item_name = $model->item->name;
return parent::map($model);