Add Entity Level Validation for Verifactu
This commit is contained in:
parent
cbc5cb5f9b
commit
03a39f33b8
|
|
@ -477,7 +477,7 @@ class CompanySettings extends BaseSettings
|
|||
|
||||
public $sync_invoice_quote_columns = true;
|
||||
|
||||
public $e_invoice_type = 'EN16931';
|
||||
public $e_invoice_type = 'EN16931'; //verifactu
|
||||
|
||||
public $e_quote_type = 'OrderX_Comfort';
|
||||
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ use Illuminate\Contracts\Translation\HasLocalePreference;
|
|||
* @property int|null $updated_at
|
||||
* @property int|null $deleted_at
|
||||
* @property string|null $id_number
|
||||
* @property string|null $classification
|
||||
* @property-read mixed $hashed_id
|
||||
* @property-read \App\Models\User|null $assigned_user
|
||||
* @property-read \App\Models\User $user
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2025. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Services\EDocument\Standards\Validation;
|
||||
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
use App\Models\Invoice;
|
||||
|
||||
interface EntityLevelInterface
|
||||
{
|
||||
|
||||
public function checkClient(Client $client): array;
|
||||
|
||||
public function checkCompany(Company $company): array;
|
||||
|
||||
public function checkInvoice(Invoice $invoice): array;
|
||||
|
||||
}
|
||||
|
|
@ -21,10 +21,11 @@ use App\Models\Invoice;
|
|||
use App\Models\PurchaseOrder;
|
||||
use App\Services\EDocument\Standards\Peppol;
|
||||
use App\Services\EDocument\Standards\Validation\XsltDocumentValidator;
|
||||
use App\Services\EDocument\Standards\Validation\EntityLevelInterface;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use XSLTProcessor;
|
||||
|
||||
class EntityLevel
|
||||
class EntityLevel implements EntityLevelInterface
|
||||
{
|
||||
private array $eu_country_codes = [
|
||||
'AT', // Austria
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2025. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Services\EDocument\Standards\Validation\Verifactu;
|
||||
|
||||
use App\Services\EDocument\Standards\Validation\EntityLevelInterface;
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
use App\Models\Invoice;
|
||||
|
||||
class EntityLevel implements EntityLevelInterface
|
||||
{
|
||||
public function checkClient(Client $client): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function checkCompany(Company $company): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function checkInvoice(Invoice $invoice): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
private function testClientState(Client $client): array
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace App\Services\EDocument\Standards\Verifactu\Validation;
|
||||
namespace App\Services\EDocument\Standards\Validation\Verifactu;
|
||||
|
||||
use App\Services\EDocument\Standards\Verifactu\Models\Invoice;
|
||||
use InvalidArgumentException;
|
||||
Loading…
Reference in New Issue