mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for bank transactions:
This commit is contained in:
parent
1128529ba1
commit
1c7acc161e
@ -113,10 +113,10 @@ class ProcessBankTransactions implements ShouldQueue
|
|||||||
|
|
||||||
//Harvest the company
|
//Harvest the company
|
||||||
|
|
||||||
MultiDB::setDb($company->db);
|
MultiDB::setDb($this->company->db);
|
||||||
|
|
||||||
/*Get the user */
|
/*Get the user */
|
||||||
$user_id = $company->owner()->id;
|
$user_id = $this->company->owner()->id;
|
||||||
|
|
||||||
/* Unguard the model to perform batch inserts */
|
/* Unguard the model to perform batch inserts */
|
||||||
BankTransaction::unguard();
|
BankTransaction::unguard();
|
||||||
@ -126,13 +126,13 @@ class ProcessBankTransactions implements ShouldQueue
|
|||||||
foreach($transactions as $transaction)
|
foreach($transactions as $transaction)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(BankTransaction::where('transaction_id', $transaction['transaction_id'])->where('company_id', $company->id)->withTrashed()->exists())
|
if(BankTransaction::where('transaction_id', $transaction['transaction_id'])->where('company_id', $this->company->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()
|
||||||
$bt = \DB::table('bank_transactions')->insert(
|
$bt = \DB::table('bank_transactions')->insert(
|
||||||
array_merge($transaction,[
|
array_merge($transaction,[
|
||||||
'company_id' => $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,
|
||||||
'created_at' => $now,
|
'created_at' => $now,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user