mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 00:24:36 -04:00
Working on bank transactions
This commit is contained in:
parent
654460758d
commit
17cb8b1b94
@ -37,11 +37,10 @@ class ProcessBankTransactions implements ShouldQueue
|
|||||||
/**
|
/**
|
||||||
* Create a new job instance.
|
* Create a new job instance.
|
||||||
*/
|
*/
|
||||||
public function __construct(string $bank_integration_account_id, BankIntegration $bank_integration, string $from_date = '2022-01-01')
|
public function __construct(string $bank_integration_account_id, BankIntegration $bank_integration)
|
||||||
{
|
{
|
||||||
$this->bank_integration_account_id = $bank_integration_account_id;
|
$this->bank_integration_account_id = $bank_integration_account_id;
|
||||||
$this->bank_integration = $bank_integration;
|
$this->bank_integration = $bank_integration;
|
||||||
$this->from_date = $from_date;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,6 +53,8 @@ class ProcessBankTransactions implements ShouldQueue
|
|||||||
{
|
{
|
||||||
//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';
|
||||||
|
|
||||||
do{
|
do{
|
||||||
$this->processTransactions();
|
$this->processTransactions();
|
||||||
}
|
}
|
||||||
@ -73,9 +74,16 @@ class ProcessBankTransactions implements ShouldQueue
|
|||||||
'accountId' => $this->bank_integration->bank_account_id,
|
'accountId' => $this->bank_integration->bank_account_id,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nlog($data);
|
||||||
|
|
||||||
$transaction_count = $yodlee->getTransactionCount($data);
|
$transaction_count = $yodlee->getTransactionCount($data);
|
||||||
|
|
||||||
|
nlog($transaction_count);
|
||||||
|
|
||||||
$count = $transaction_count->transaction->TOTAL->count;
|
$count = $transaction_count->transaction->TOTAL->count;
|
||||||
|
|
||||||
|
nlog($count);
|
||||||
|
|
||||||
//expense transactions
|
//expense transactions
|
||||||
$transactions = $yodlee->getTransactions($data);
|
$transactions = $yodlee->getTransactions($data);
|
||||||
|
|
||||||
|
@ -44,9 +44,9 @@ class BankTransactionSync implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
if (! Ninja::isHosted()) {
|
// if (! Ninja::isHosted()) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
//multiDB environment, need to
|
//multiDB environment, need to
|
||||||
foreach (MultiDB::$dbs as $db) {
|
foreach (MultiDB::$dbs as $db) {
|
||||||
|
@ -362,9 +362,9 @@ class Account extends BaseModel
|
|||||||
'plan_price' => $price,
|
'plan_price' => $price,
|
||||||
'trial' => false,
|
'trial' => false,
|
||||||
'plan' => $plan,
|
'plan' => $plan,
|
||||||
'started' => DateTime::createFromFormat('Y-m-d', $this->plan_started),
|
'started' => $this->plan_started ? DateTime::createFromFormat('Y-m-d', $this->plan_started) : false,
|
||||||
'expires' => $plan_expires,
|
'expires' => $plan_expires,
|
||||||
'paid' => DateTime::createFromFormat('Y-m-d', $this->plan_paid),
|
'paid' => $this->plan_paid ? DateTime::createFromFormat('Y-m-d', $this->plan_paid) : false,
|
||||||
'term' => $this->plan_term,
|
'term' => $this->plan_term,
|
||||||
'active' => $plan_active,
|
'active' => $plan_active,
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user