mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Logging
This commit is contained in:
parent
c15c1572e9
commit
9b74cb4615
@ -79,8 +79,6 @@ 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);
|
||||||
|
|
||||||
$count = $transaction_count->transaction->TOTAL->count;
|
$count = $transaction_count->transaction->TOTAL->count;
|
||||||
@ -99,16 +97,12 @@ nlog($data);
|
|||||||
|
|
||||||
BankTransaction::unguard();
|
BankTransaction::unguard();
|
||||||
|
|
||||||
nlog("transactions = " . count($transactions));
|
|
||||||
|
|
||||||
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', $company->id)->withTrashed()->exists())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
nlog("inserting");
|
|
||||||
|
|
||||||
//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,[
|
||||||
@ -124,8 +118,6 @@ nlog("transactions = " . count($transactions));
|
|||||||
|
|
||||||
$last_transaction = reset($transactions);
|
$last_transaction = reset($transactions);
|
||||||
|
|
||||||
nlog("last tranny = " . $last_transaction['id']);
|
|
||||||
|
|
||||||
$this->bank_integration->from_date = isset($last_transaction['date']) ? \Carbon\Carbon::parse($last_transaction['date']) : now();
|
$this->bank_integration->from_date = isset($last_transaction['date']) ? \Carbon\Carbon::parse($last_transaction['date']) : now();
|
||||||
|
|
||||||
$this->from_date = \Carbon\Carbon::parse($this->bank_integration->from_date)->format('Y-m-d');
|
$this->from_date = \Carbon\Carbon::parse($this->bank_integration->from_date)->format('Y-m-d');
|
||||||
|
@ -231,7 +231,7 @@ class CompanyTransformer extends EntityTransformer
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function includeBankTransactions(Company $company)
|
public function includeBankTransactions(Company $company)
|
||||||
{
|
{nlog("GEEETTTTTTTT");
|
||||||
$transformer = new BankTransactionTransformer($this->serializer);
|
$transformer = new BankTransactionTransformer($this->serializer);
|
||||||
|
|
||||||
return $this->includeCollection($company->bank_transactions, $transformer, BankTransaction::class);
|
return $this->includeCollection($company->bank_transactions, $transformer, BankTransaction::class);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user