From ceb04a546fa368803cf27b78de743a74c50a8900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihan=20=C5=9Eent=C3=BCrk?= <53110792+CihanSenturk@users.noreply.github.com> Date: Mon, 24 Jul 2023 14:37:03 +0300 Subject: [PATCH] import transaction type issue fixed --- app/Imports/Banking/Transactions.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Imports/Banking/Transactions.php b/app/Imports/Banking/Transactions.php index a7a41680d..3253d1be0 100644 --- a/app/Imports/Banking/Transactions.php +++ b/app/Imports/Banking/Transactions.php @@ -5,9 +5,12 @@ namespace App\Imports\Banking; use App\Abstracts\Import; use App\Http\Requests\Banking\Transaction as Request; use App\Models\Banking\Transaction as Model; +use App\Traits\Transactions as TraitsTransactions; class Transactions extends Import { + use TraitsTransactions; + public $request_class = Request::class; public function model(array $row) @@ -19,10 +22,12 @@ class Transactions extends Import { $row = parent::map($row); + $real_type = $this->getRealTypeTransaction($row['type']); + $row['currency_code'] = $this->getCurrencyCode($row); $row['account_id'] = $this->getAccountId($row); - $row['category_id'] = $this->getCategoryId($row); - $row['contact_id'] = $this->getContactId($row); + $row['category_id'] = $this->getCategoryId($row, $real_type); + $row['contact_id'] = $this->getContactId($row, $real_type); $row['document_id'] = $this->getDocumentId($row); $row['parent_id'] = $this->getParentId($row);