1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Fixes for bank transactions:

This commit is contained in:
David Bomba 2022-09-14 16:48:56 +10:00
parent 8d91b7d85f
commit 73acc1b7d5
3 changed files with 5 additions and 6 deletions

View File

@ -449,7 +449,7 @@ class BaseController extends Controller
}
},
'company.bank_transactions'=> function ($query) use ($updated_at, $user) {
$query->whereNotNull('updated_at');
$query->where('updated_at', '>=', $updated_at);
if (! $user->isAdmin()) {
$query->where('bank_transactions.user_id', $user->id);

View File

@ -109,6 +109,8 @@ class ProcessBankTransactions implements ShouldQueue
'company_id' => $company->id,
'user_id' => $user_id,
'bank_integration_id' => $this->bank_integration->id,
'created_at' => now(),
'updated_at' => now(),
])
);

View File

@ -67,7 +67,6 @@ class CompanyTransformer extends EntityTransformer
* @var array
*/
protected $availableIncludes = [
'bank_transactions',
'documents',
'users',
'designs',
@ -104,6 +103,7 @@ class CompanyTransformer extends EntityTransformer
'recurring_expenses',
'purchase_orders',
'bank_integrations',
'bank_transactions',
];
/**
@ -226,10 +226,7 @@ class CompanyTransformer extends EntityTransformer
public function includeBankTransactions(Company $company)
{
$transformer = new BankTransactionTransformer($this->serializer);
nlog("GEET");
nlog($company->bank_transactions()->count());
return $this->includeCollection($company->bank_transactions, $transformer, BankTransaction::class);
}