Fixes for tests

This commit is contained in:
David Bomba 2024-11-25 14:25:55 +11:00
parent f5c812d1a3
commit bb85d1d21c
2 changed files with 7 additions and 1 deletions

View File

@ -1047,6 +1047,9 @@ class Client extends BaseModel implements HasLocalePreference
public function checkDeliveryNetwork(): ?string public function checkDeliveryNetwork(): ?string
{ {
if(!isset($this->country->iso_3166_2))
return "Client has no country set!";
$br = new \App\DataMapper\Tax\BaseRule(); $br = new \App\DataMapper\Tax\BaseRule();
$government_countries = array_merge($br->peppol_business_countries, $br->peppol_government_countries); $government_countries = array_merge($br->peppol_business_countries, $br->peppol_government_countries);

View File

@ -363,7 +363,7 @@ class EInvoiceValidationTest extends TestCase
'company_id' => $company->id, 'company_id' => $company->id,
'classification' => 'individual', 'classification' => 'individual',
'vat_number' => '', 'vat_number' => '',
'country_id' => 1, 'country_id' => 276,
'address1' => '10 Wallaby Way', 'address1' => '10 Wallaby Way',
'address2' => '', 'address2' => '',
'city' => 'Sydney', 'city' => 'Sydney',
@ -383,6 +383,9 @@ class EInvoiceValidationTest extends TestCase
$el = new EntityLevel(); $el = new EntityLevel();
$validation = $el->checkClient($client); $validation = $el->checkClient($client);
if(!$validation['passes'])
nlog($validation);
$this->assertTrue($validation['passes']); $this->assertTrue($validation['passes']);
} }