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 InvoiceTransactions 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->account_name = $model->account->name;
$model->category_name = $model->category->name;
$model->contact_email = $model->contact->email;