mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Tests for bank transaction matching
This commit is contained in:
parent
c9f50608f2
commit
45d658cf47
@ -239,7 +239,7 @@ class Yodlee
|
||||
|
||||
}
|
||||
|
||||
private function bankFormRequest(string $uri, string $verb, array $data = [], array $headers)
|
||||
private function bankFormRequest(string $uri, string $verb, array $data, array $headers)
|
||||
{
|
||||
|
||||
$response = Http::withHeaders($this->getFormHeaders($headers))->asForm()->{$verb}($this->getEndpoint() . $uri, $this->buildBody());
|
||||
|
@ -54,6 +54,7 @@ class BankService implements ShouldQueue
|
||||
|
||||
private function match()
|
||||
{
|
||||
|
||||
BankTransaction::where('company_id', $this->company->id)
|
||||
->where('is_matched', false)
|
||||
->where('provisional_match', false)
|
||||
@ -62,7 +63,7 @@ class BankService implements ShouldQueue
|
||||
|
||||
$invoice = $this->invoices->first(function ($value, $key) use ($bt){
|
||||
|
||||
return str_contains($value->number, $bt->description);
|
||||
return str_contains($bt->description, $value->number);
|
||||
|
||||
});
|
||||
|
||||
|
@ -74,9 +74,16 @@ class YodleeApiTest extends TestCase
|
||||
$this->assertGreaterThan(1, BankIntegration::count());
|
||||
$this->assertGreaterThan(1, BankTransaction::count());
|
||||
|
||||
$this->invoice->number = "XXXXXX8501";
|
||||
$this->invoice->save();
|
||||
|
||||
BankService::dispatchSync($this->company->id, $this->company->db);
|
||||
|
||||
// $transactions = $yodlee->getTransactions();
|
||||
$bt = BankTransaction::where('invoice_id', $this->invoice->id)->first();
|
||||
|
||||
$this->assertNotNull($bt);
|
||||
|
||||
$this->assertEquals(1, $bt->provisional_match);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user