mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-09 17:44:38 -04:00
Fixes for bank transactions:
This commit is contained in:
parent
c2768eff34
commit
24644a2ba1
@ -34,6 +34,9 @@ class ProcessBankTransactions implements ShouldQueue
|
|||||||
private ?string $from_date;
|
private ?string $from_date;
|
||||||
|
|
||||||
private bool $stop_loop = true;
|
private bool $stop_loop = true;
|
||||||
|
|
||||||
|
private int $skip = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new job instance.
|
* Create a new job instance.
|
||||||
*/
|
*/
|
||||||
@ -56,7 +59,7 @@ class ProcessBankTransactions implements ShouldQueue
|
|||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
//Loop through everything until we are up to date
|
//Loop through everything until we are up to date
|
||||||
|
|
||||||
$this->from_date = $this->from_date ?: '2021-01-01';
|
$this->from_date = $this->from_date ?: '2020-01-01';
|
||||||
|
|
||||||
do{
|
do{
|
||||||
|
|
||||||
@ -76,8 +79,8 @@ class ProcessBankTransactions implements ShouldQueue
|
|||||||
$data = [
|
$data = [
|
||||||
'top' => 500,
|
'top' => 500,
|
||||||
'fromDate' => $this->from_date,
|
'fromDate' => $this->from_date,
|
||||||
'toDate' => now()->format('Y-m-d'),
|
|
||||||
'accountId' => $this->bank_integration->bank_account_id,
|
'accountId' => $this->bank_integration->bank_account_id,
|
||||||
|
'skip' => $this->skip,
|
||||||
];
|
];
|
||||||
|
|
||||||
//Get transaction count object
|
//Get transaction count object
|
||||||
@ -141,12 +144,14 @@ class ProcessBankTransactions implements ShouldQueue
|
|||||||
|
|
||||||
nlog("the bank integration from_date being set to: {$this->bank_integration->from_date}");
|
nlog("the bank integration from_date being set to: {$this->bank_integration->from_date}");
|
||||||
|
|
||||||
$this->from_date = \Carbon\Carbon::parse($this->bank_integration->from_date)->format('Y-m-d');
|
$this->skip = $this->skip + 500;
|
||||||
|
|
||||||
$this->bank_integration->save();
|
|
||||||
|
|
||||||
if($count < 500){
|
if($count < 500){
|
||||||
$this->stop_loop = false;
|
$this->stop_loop = false;
|
||||||
|
|
||||||
|
$this->from_date = now();
|
||||||
|
$this->bank_integration->save();
|
||||||
|
|
||||||
nlog("stopping while loop");
|
nlog("stopping while loop");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user