From 1cf96028d2b23fe0de50714a0eb520c13d6158b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Sun, 17 Jan 2021 23:56:12 +0300 Subject: [PATCH] Document Transaction fixed bulkaction currency_code --- app/Jobs/Banking/CreateBankingDocumentTransaction.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Banking/CreateBankingDocumentTransaction.php b/app/Jobs/Banking/CreateBankingDocumentTransaction.php index ee7aa29cd..551ed2771 100644 --- a/app/Jobs/Banking/CreateBankingDocumentTransaction.php +++ b/app/Jobs/Banking/CreateBankingDocumentTransaction.php @@ -71,10 +71,12 @@ class CreateBankingDocumentTransaction extends Job $this->request['amount'] = $this->model->amount - $this->model->paid_amount; } + $currency_code = !empty($this->request['currency_code']) ? $this->request['currency_code'] : $this->model->currency_code; + $this->request['company_id'] = $this->model->company_id; $this->request['currency_code'] = isset($this->request['currency_code']) ? $this->request['currency_code'] : $this->model->currency_code; $this->request['paid_at'] = isset($this->request['paid_at']) ? $this->request['paid_at'] : Date::now()->format('Y-m-d'); - $this->request['currency_rate'] = config('money.' . $this->request['currency_code'] . '.rate'); + $this->request['currency_rate'] = config('money.' . $currency_code . '.rate'); $this->request['account_id'] = isset($this->request['account_id']) ? $this->request['account_id'] : setting('default.account'); $this->request['document_id'] = isset($this->request['document_id']) ? $this->request['document_id'] : $this->model->id; $this->request['contact_id'] = isset($this->request['contact_id']) ? $this->request['contact_id'] : $this->model->contact_id;