diff --git a/app/Http/ValidationRules/Account/BlackListRule.php b/app/Http/ValidationRules/Account/BlackListRule.php index a612808e2525..7213ff5e8855 100644 --- a/app/Http/ValidationRules/Account/BlackListRule.php +++ b/app/Http/ValidationRules/Account/BlackListRule.php @@ -28,6 +28,7 @@ class BlackListRule implements Rule 'wnpop.com', 'dataservices.space', 'karenkey.com', + 'sharklasers.com', ]; /** diff --git a/app/Import/Providers/Csv.php b/app/Import/Providers/Csv.php index fdf70ca691e7..ca100364f29f 100644 --- a/app/Import/Providers/Csv.php +++ b/app/Import/Providers/Csv.php @@ -87,7 +87,7 @@ class Csv extends BaseImport implements ImportInterface foreach($data as $key => $value) { - $data[$key]['bank.bank_integration_id'] = $this->decodePrimaryKey($this->request['bank_integration_id']); + $data[$key]['transaction.bank_integration_id'] = $this->decodePrimaryKey($this->request['bank_integration_id']); } } diff --git a/app/Import/Transformers/Bank/BankTransformer.php b/app/Import/Transformers/Bank/BankTransformer.php index cfdb2b01b9bf..da3e088fa052 100644 --- a/app/Import/Transformers/Bank/BankTransformer.php +++ b/app/Import/Transformers/Bank/BankTransformer.php @@ -31,17 +31,17 @@ class BankTransformer extends BaseTransformer $now = now(); $transformed = [ - 'bank_integration_id' => $transaction['bank.bank_integration_id'], - 'transaction_id' => $this->getNumber($transaction,'bank.transaction_id'), - 'amount' => abs($this->getFloat($transaction, 'bank.amount')), - 'currency_id' => $this->getCurrencyByCode($transaction, 'bank.currency'), - 'account_type' => strlen($this->getString($transaction, 'bank.account_type')) > 1 ? $this->getString($transaction, 'bank.account_type') : 'bank', - 'category_id' => $this->getNumber($transaction, 'bank.category_id') > 0 ? $this->getNumber($transaction, 'bank.category_id') : null, - 'category_type' => $this->getString($transaction, 'bank.category_type'), - 'date' => array_key_exists('bank.date', $transaction) ? $this->parseDate($transaction['bank.date']) + 'bank_integration_id' => $transaction['transaction.bank_integration_id'], + 'transaction_id' => $this->getNumber($transaction,'transaction.transaction_id'), + 'amount' => abs($this->getFloat($transaction, 'transaction.amount')), + 'currency_id' => $this->getCurrencyByCode($transaction, 'transaction.currency'), + 'account_type' => strlen($this->getString($transaction, 'transaction.account_type')) > 1 ? $this->getString($transaction, 'transaction.account_type') : 'bank', + 'category_id' => $this->getNumber($transaction, 'transaction.category_id') > 0 ? $this->getNumber($transaction, 'transaction.category_id') : null, + 'category_type' => $this->getString($transaction, 'transaction.category_type'), + 'date' => array_key_exists('transaction.date', $transaction) ? $this->parseDate($transaction['transaction.date']) : now()->format('Y-m-d'), - 'bank_account_id' => array_key_exists('bank.bank_account_id', $transaction) ? $transaction['bank.bank_account_id'] : 0, - 'description' => array_key_exists('bank.description', $transaction) ? $transaction['bank.description'] : '', + 'bank_account_id' => array_key_exists('transaction.bank_account_id', $transaction) ? $transaction['transaction.bank_account_id'] : 0, + 'description' => array_key_exists('transaction.description', $transaction) ? $transaction['transaction.description'] : '', 'base_type' => $this->calculateType($transaction), 'created_at' => $now, 'updated_at' => $now, @@ -56,22 +56,22 @@ class BankTransformer extends BaseTransformer private function calculateType($transaction) { - if(array_key_exists('bank.base_type', $transaction) && ($transaction['bank.base_type'] == 'CREDIT') || strtolower($transaction['bank.base_type']) == 'deposit') + if(array_key_exists('transaction.base_type', $transaction) && (($transaction['transaction.base_type'] == 'CREDIT') || strtolower($transaction['transaction.base_type']) == 'deposit')) return 'CREDIT'; - if(array_key_exists('bank.base_type', $transaction) && ($transaction['bank.base_type'] == 'DEBIT') || strtolower($transaction['bank.bank_type']) == 'withdrawal') + if(array_key_exists('transaction.base_type', $transaction) && (($transaction['transaction.base_type'] == 'DEBIT') || strtolower($transaction['transaction.bank_type']) == 'withdrawal')) return 'DEBIT'; - if(array_key_exists('bank.category_id', $transaction)) + if(array_key_exists('transaction.category_id', $transaction)) return 'DEBIT'; - if(array_key_exists('bank.category_type', $transaction) && $transaction['bank.category_type'] == 'Income') + if(array_key_exists('transaction.category_type', $transaction) && $transaction['transaction.category_type'] == 'Income') return 'CREDIT'; - if(array_key_exists('bank.category_type', $transaction)) + if(array_key_exists('transaction.category_type', $transaction)) return 'DEBIT'; - if(array_key_exists('bank.amount', $transaction) && is_numeric($transaction['bank.amount']) && $transaction['bank.amount'] > 0) + if(array_key_exists('transaction.amount', $transaction) && is_numeric($transaction['transaction.amount']) && $transaction['transaction.amount'] > 0) return 'CREDIT'; return 'DEBIT';