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

Rule mapping

This commit is contained in:
David Bomba 2024-04-15 10:52:35 +10:00
parent 5e5f9d0184
commit b9c8d42327
5 changed files with 206 additions and 0 deletions

View File

@ -0,0 +1,28 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\DataMapper\EDoc\FatturaPA;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\Attributes\WithTransformer;
use Spatie\LaravelData\Transformers\DateTimeInterfaceTransformer;
class DatiAnagraficiVettore extends Data
{
public function __construct(
public string $IdFiscaleIVA = '',
public string $CodiceFiscale = '',
public string $Anagrafica = '',
#[WithTransformer(DateTimeInterfaceTransformer::class, format: 'Y-m-d\TH:i:s.uP')]
public \DateTime $DataOraConsegna = new \DateTime(),
){}
}

View File

@ -0,0 +1,28 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\DataMapper\EDoc\FatturaPA;
use Spatie\LaravelData\Data;
class DatiContratto extends Data
{
public function __construct(
public string $RiferimentoNumeroLinea = '',
public string $IdDocumento = '',
public string $Data = '',
public string $NumItem = '',
public string $CodiceCommessaConvenzione = '',
public string $CodiceCUP = '',
public string $CodiceCIG = '',
) {
}
}

View File

@ -0,0 +1,28 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\DataMapper\EDoc\FatturaPA;
use Spatie\LaravelData\Data;
class DatiOrdineAcquisto extends Data
{
public function __construct(
public string $RiferimentoNumeroLinea = '',
public string $IdDocumento = '',
public string $Data = '',
public string $NumItem = '',
public string $CodiceCommessaConvenzione = '',
public string $CodiceCUP = '',
public string $CodiceCIG = '',
) {
}
}

View File

@ -0,0 +1,28 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\DataMapper\EDoc\FatturaPA;
use Spatie\LaravelData\Data;
class DatiRicezione extends Data
{
public function __construct(
public string $RiferimentoNumeroLinea = '',
public string $IdDocumento = '',
public string $Data = '',
public string $NumItem = '',
public string $CodiceCommessaConvenzione = '',
public string $CodiceCUP = '',
public string $CodiceCIG = '',
) {
}
}

View File

@ -0,0 +1,94 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\DataProviders;
class EDocRules
{
// [
// "key" => "",
// "label" => "",
// "type" => "dropdown/date/string/text",
// "resource" => "resource.json",
// "required" => true,
// ]
public function rules()
{
return [
'FatturaPA' => $this->FatturaPADefaults(),
];
}
private function FatturaPADefaults()
{
return [
[
"key" => "RegimeFiscale",
"label" => "Regime Fiscale",
"type" => "dropdown",
"resource" => "RegimeFiscale.json",
"required" => true,
],
[
"key" => "TipoDocumento",
"label" => "Tipo Documento",
"type" => "dropdown",
"resource" => "TipoDocumento.json",
"required" => true,
],
[
"key" => "ModalitaPagamento",
"label" => "Modalita Pagamento",
"type" => "dropdown",
"resource" => "ModalitaPagamento.json",
"required" => true,
],
[
"key" => "CondizioniPagamento",
"label" => "Condizioni Pagamento",
"type" => "dropdown",
"resource" => "CondizioniPagamento.json",
"required" => true,
],
[
"key" => "DatiRicezione",
"label" => "Dati Ricezione",
"type" => "dropdown",
"resource" => "CondizioniPagamento",
"required" => false,
],
[
"key" => "DatiContratto",
"label" => "Dati Contratto",
"type" => "object",
"resource" => "DatiContratto",
"required" => false,
],
[
"key" => "DatiOrdineAcquisto",
"label" => "Dati Ordine Acquisto",
"type" => "object",
"resource" => "DatiOrdineAcquisto",
"required" => false,
],
[
"key" => "DatiAnagraficiVettore",
"label" => "Dati Anagrafici Vettore",
"type" => "object",
"resource" => "DatiAnagraficiVettore",
"required" => false,
],
];
}
}