mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
fix: nordigen transaction id should be string
This commit is contained in:
parent
d53cc4c8c6
commit
27d105d6ff
@ -110,7 +110,7 @@ class TransactionTransformer implements BankRevenueInterface
|
|||||||
$transaction['creditorName'] : null);
|
$transaction['creditorName'] : null);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'transaction_id' => $transaction["transactionId"],
|
'nordigen_transaction_id' => $transaction["transactionId"],
|
||||||
'amount' => abs((int) $transaction["transactionAmount"]["amount"]),
|
'amount' => abs((int) $transaction["transactionAmount"]["amount"]),
|
||||||
'currency_id' => $this->convertCurrency($transaction["transactionAmount"]["currency"]),
|
'currency_id' => $this->convertCurrency($transaction["transactionAmount"]["currency"]),
|
||||||
'category_id' => null, // nordigen has no categories
|
'category_id' => null, // nordigen has no categories
|
||||||
|
@ -155,12 +155,13 @@ class ProcessBankTransactionsNordigen implements ShouldQueue
|
|||||||
|
|
||||||
foreach ($transactions as $transaction) {
|
foreach ($transactions as $transaction) {
|
||||||
|
|
||||||
if (BankTransaction::where('transaction_id', $transaction['transaction_id'])->where('company_id', $this->company->id)->where('bank_integration_id', $this->bank_integration->id)->withTrashed()->exists())
|
if (BankTransaction::where('nordigen_transaction_id', $transaction['nordigen_transaction_id'])->where('company_id', $this->company->id)->where('bank_integration_id', $this->bank_integration->id)->withTrashed()->exists())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//this should be much faster to insert than using ::create()
|
//this should be much faster to insert than using ::create()
|
||||||
\DB::table('bank_transactions')->insert(
|
\DB::table('bank_transactions')->insert(
|
||||||
array_merge($transaction, [
|
array_merge($transaction, [
|
||||||
|
'transaction_id' => 0,
|
||||||
'company_id' => $this->company->id,
|
'company_id' => $this->company->id,
|
||||||
'user_id' => $user_id,
|
'user_id' => $user_id,
|
||||||
'bank_integration_id' => $this->bank_integration->id,
|
'bank_integration_id' => $this->bank_integration->id,
|
||||||
|
@ -23,6 +23,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @property int $user_id
|
* @property int $user_id
|
||||||
* @property int $bank_integration_id
|
* @property int $bank_integration_id
|
||||||
* @property int $transaction_id
|
* @property int $transaction_id
|
||||||
|
* @property string $nordigen_transaction_id
|
||||||
* @property string $amount
|
* @property string $amount
|
||||||
* @property string|null $currency_code
|
* @property string|null $currency_code
|
||||||
* @property int|null $currency_id
|
* @property int|null $currency_id
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Models\Account;
|
||||||
|
use App\Models\BankIntegration;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration {
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
|
||||||
|
// FIX: used column transaction_id was int and resulted in wrong value in field
|
||||||
|
Schema::table('bank_transactions', function (Blueprint $table) {
|
||||||
|
$table->string('nordigen_transaction_id')->nullable();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user