mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
fixes
This commit is contained in:
parent
27ab262a4f
commit
dcdd9112d0
@ -68,8 +68,6 @@ class TransactionTransformer implements BankRevenueInterface
|
||||
|
||||
public function transform($transactionResponse)
|
||||
{
|
||||
|
||||
Log::info($transactionResponse);
|
||||
$data = [];
|
||||
|
||||
if (!array_key_exists('transactions', $transactionResponse) || !array_key_exists('booked', $transactionResponse["transactions"]))
|
||||
|
@ -178,7 +178,7 @@ class NordigenController extends BaseController
|
||||
|
||||
$nordigen_account = $nordigen->getAccount($nordigenAccountId);
|
||||
|
||||
$existing_bank_integration = BankIntegration::where('bank_account_id', $nordigen_account['id'])->where('company_id', $company->id)->first();
|
||||
$existing_bank_integration = BankIntegration::where('nordigen_account_id', $nordigen_account['id'])->where('company_id', $company->id)->first();
|
||||
|
||||
if (!$existing_bank_integration) {
|
||||
|
||||
@ -199,7 +199,7 @@ class NordigenController extends BaseController
|
||||
$bank_integration->currency = $nordigen_account['account_currency'];
|
||||
$bank_integration->disabled_upstream = false;
|
||||
$bank_integration->auto_sync = true;
|
||||
$bank_integration->from_date = now()->subYear();
|
||||
$bank_integration->from_date = now()->subDays(90); // default max-fetch interval of nortigen is 90 days
|
||||
|
||||
$bank_integration->save();
|
||||
|
||||
@ -212,6 +212,7 @@ class NordigenController extends BaseController
|
||||
$existing_bank_integration->bank_account_status = $account['account_status'];
|
||||
$existing_bank_integration->disabled_upstream = false;
|
||||
$existing_bank_integration->auto_sync = true;
|
||||
$bank_integration->from_date = now()->subDays(90); // default max-fetch interval of nortigen is 90 days
|
||||
|
||||
$existing_bank_integration->save();
|
||||
|
||||
|
@ -304,7 +304,7 @@ class BankIntegrationController extends BaseController
|
||||
|
||||
$account = $user->account;
|
||||
|
||||
$bank_integration = BankIntegration::withTrashed()->where('bank_account_id', $acc_id)->company()->firstOrFail();
|
||||
$bank_integration = BankIntegration::withTrashed()->where('bank_account_id', $acc_id)->orWhere('nordigen_account_id', $acc_id)->company()->firstOrFail(); // @turbo124 please check
|
||||
|
||||
if ($bank_integration->integration_type == BankIntegration::INTEGRATION_TYPE_YODLEE)
|
||||
$this->removeAccountYodlee($account, $bank_integration);
|
||||
|
@ -24,6 +24,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Log;
|
||||
|
||||
class ProcessBankTransactionsNordigen implements ShouldQueue
|
||||
{
|
||||
@ -141,9 +142,9 @@ class ProcessBankTransactionsNordigen implements ShouldQueue
|
||||
|
||||
$this->nordigen_account = $this->nordigen->getAccount($this->bank_integration->nordigen_account_id);
|
||||
|
||||
$this->bank_integration->disabled_upstream = false;
|
||||
$this->bank_integration->bank_account_status = $this->nordigen_account['account_status'];
|
||||
$this->bank_integration->balance = $this->nordigen_account['current_balance'];
|
||||
$this->bank_integration->currency = $this->nordigen_account['account_currency'];
|
||||
|
||||
$this->bank_integration->save();
|
||||
|
||||
@ -155,6 +156,8 @@ class ProcessBankTransactionsNordigen implements ShouldQueue
|
||||
//Get transaction count object
|
||||
$transactions = $this->nordigen->getTransactions($this->bank_integration->nordigen_account_id, $this->from_date);
|
||||
|
||||
Log::Info($transactions);
|
||||
|
||||
//Get int count
|
||||
$count = sizeof($transactions);
|
||||
|
||||
@ -180,6 +183,7 @@ class ProcessBankTransactionsNordigen implements ShouldQueue
|
||||
|
||||
$now = now();
|
||||
|
||||
|
||||
foreach ($transactions as $transaction) {
|
||||
|
||||
if (BankTransaction::where('transaction_id', $transaction['transaction_id'])->where('company_id', $this->company->id)->withTrashed()->exists())
|
||||
|
Loading…
Reference in New Issue
Block a user