mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 09:54:34 -04:00
PHP classes for FatturaPA
This commit is contained in:
parent
331bdabfb1
commit
1db95e3e32
35
app/DataMapper/EDoc/FatturaPA/Allegati.php
Normal file
35
app/DataMapper/EDoc/FatturaPA/Allegati.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?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\Optional;
|
||||
use App\DataMapper\EDoc\FatturaPA\DatiVeicoli;
|
||||
use App\DataMapper\EDoc\FatturaPA\Body\DatiGenerali;
|
||||
|
||||
class Allegati extends Data
|
||||
{
|
||||
//string 60
|
||||
public string $NomeAttachment;
|
||||
|
||||
//base64 binary
|
||||
public mixed $Attachment;
|
||||
|
||||
//string 10
|
||||
public string|Optional $AlgoritmoCompressione;
|
||||
|
||||
//string 10
|
||||
public string|Optional $FormatoAttachment;
|
||||
|
||||
//string 100
|
||||
public string|Optional $DescrizioneAttachment;
|
||||
}
|
36
app/DataMapper/EDoc/FatturaPA/AltriDatiGestionali.php
Normal file
36
app/DataMapper/EDoc/FatturaPA/AltriDatiGestionali.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?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\Optional;
|
||||
use Spatie\LaravelData\Attributes\WithTransformer;
|
||||
use Spatie\LaravelData\Transformers\DateTimeInterfaceTransformer;
|
||||
|
||||
class AltriDatiGestionali extends Data
|
||||
{
|
||||
//string 10
|
||||
public string $TipoDato;
|
||||
|
||||
//String60LatinType
|
||||
public string|Optional $RiferimentoTesto;
|
||||
|
||||
//Amount8DecimalType
|
||||
public float|Optional $RiferimentoNumero;
|
||||
|
||||
//date
|
||||
#[WithTransformer(DateTimeInterfaceTransformer::class, format: 'Y-m-d')]
|
||||
public \DateTime|Optional $RiferimentoData;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
|
22
app/DataMapper/EDoc/FatturaPA/DatiBeniServizi.php
Normal file
22
app/DataMapper/EDoc/FatturaPA/DatiBeniServizi.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?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 App\DataMapper\EDoc\FatturaPA\DettaglioLinee;
|
||||
|
||||
class DatiBeniServizi extends Data
|
||||
{
|
||||
public DettaglioLinee $DettaglioLinee;
|
||||
|
||||
public DatiRiepilogo $DatiRiepilogo;
|
||||
}
|
23
app/DataMapper/EDoc/FatturaPA/DatiPagamento.php
Normal file
23
app/DataMapper/EDoc/FatturaPA/DatiPagamento.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?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 App\DataMapper\EDoc\FatturaPA\DettaglioPagamento;
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class DatiPagamento extends Data
|
||||
{
|
||||
//string min4 max4 - optionlist
|
||||
public string $CondizioniPagamento;
|
||||
|
||||
public DettaglioPagamento $DettaglioPagamento;
|
||||
}
|
46
app/DataMapper/EDoc/FatturaPA/DatiRiepilogo.php
Normal file
46
app/DataMapper/EDoc/FatturaPA/DatiRiepilogo.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?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\Optional;
|
||||
|
||||
class DatiRiepilogo extends Data
|
||||
{
|
||||
|
||||
//float 0-100.0
|
||||
public float $AliquotaIVA;
|
||||
|
||||
//Amount2DecimalType
|
||||
public float $ImponibileImporto;
|
||||
|
||||
//Amount2DecimalType
|
||||
public float $Imposta;
|
||||
|
||||
//string - options
|
||||
public string|Optional $Natura;
|
||||
|
||||
//Amount2DecimalType
|
||||
public float|Optional $SpeseAccessorie;
|
||||
|
||||
//Amount8DecimalType
|
||||
public float|Optional $Arrotondamento;
|
||||
|
||||
//string options D/I/S
|
||||
public float|Optional $EsigibilitaIVA;
|
||||
|
||||
//String100LatinType
|
||||
public string|Optional $RiferimentoNormativo;
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
|
26
app/DataMapper/EDoc/FatturaPA/DatiVeicoli.php
Normal file
26
app/DataMapper/EDoc/FatturaPA/DatiVeicoli.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?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\Optional;
|
||||
use Spatie\LaravelData\Attributes\WithTransformer;
|
||||
use Spatie\LaravelData\Transformers\DateTimeInterfaceTransformer;
|
||||
|
||||
class DatiVeicoli extends Data
|
||||
{
|
||||
#[WithTransformer(DateTimeInterfaceTransformer::class, format: 'Y-m-d')]
|
||||
public \DateTime|Optional $Data;
|
||||
|
||||
//String15Type
|
||||
public string $TotalePercorso;
|
||||
}
|
77
app/DataMapper/EDoc/FatturaPA/DettaglioLinee.php
Normal file
77
app/DataMapper/EDoc/FatturaPA/DettaglioLinee.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?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\Optional;
|
||||
use Spatie\LaravelData\Attributes\WithTransformer;
|
||||
use App\DataMapper\EDoc\FatturaPA\Generics\CodiceArticolo;
|
||||
use App\DataMapper\EDoc\FatturaPA\Body\ScontoMaggiorazione;
|
||||
use Spatie\LaravelData\Transformers\DateTimeInterfaceTransformer;
|
||||
|
||||
class DettaglioLinee extends Data
|
||||
{
|
||||
|
||||
//1-9999
|
||||
public int $NumeroLinea;
|
||||
|
||||
//String1000LatinType
|
||||
public string $Descrizione;
|
||||
|
||||
//Amount8DecimalType
|
||||
public float $PrezzoUnitario;
|
||||
|
||||
// Amount8DecimalType
|
||||
public float $PrezzoTotale;
|
||||
|
||||
// <xs:restriction base="xs:decimal">
|
||||
// <xs:maxInclusive value="100.00" />
|
||||
// <xs:pattern value="[0-9]{1,3}\.[0-9]{2}" />
|
||||
// 0-100
|
||||
public float $AliquotaIVA;
|
||||
|
||||
//string 2 char options
|
||||
public string|Optional $TipoCessionePrestazione;
|
||||
|
||||
public CodiceArticolo|Optional $CodiceArticolo;
|
||||
|
||||
// <xs:restriction base="xs:decimal">
|
||||
// <xs:pattern value="[0-9]{1,12}\.[0-9]{2,8}" />
|
||||
public float|Optional $Quantita;
|
||||
|
||||
//String10Type
|
||||
public string|Optional $UnitaMisura;
|
||||
|
||||
//date
|
||||
#[WithTransformer(DateTimeInterfaceTransformer::class, format: 'Y-m-d')]
|
||||
public \DateTime|Optional $DataInizioPeriodo;
|
||||
|
||||
//date
|
||||
#[WithTransformer(DateTimeInterfaceTransformer::class, format: 'Y-m-d')]
|
||||
public \DateTime|Optional $DataFinePeriodo;
|
||||
|
||||
public ScontoMaggiorazione|Optional $ScontoMaggiorazione;
|
||||
|
||||
//4 char options
|
||||
public string|Optional $Ritenuta;
|
||||
|
||||
//string options
|
||||
public string|Optional $Natura;
|
||||
|
||||
//string 20 char
|
||||
public string|Optional $RiferimentoAmministrazione;
|
||||
|
||||
public AltriDatiGestionali|Optional $AltriDatiGestionali;
|
||||
|
||||
|
||||
}
|
||||
|
92
app/DataMapper/EDoc/FatturaPA/DettaglioPagamento.php
Normal file
92
app/DataMapper/EDoc/FatturaPA/DettaglioPagamento.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?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\Optional;
|
||||
use App\DataMapper\EDoc\FatturaPA\DatiVeicoli;
|
||||
use Spatie\LaravelData\Attributes\WithTransformer;
|
||||
use App\DataMapper\EDoc\FatturaPA\Body\DatiGenerali;
|
||||
use Spatie\LaravelData\Transformers\DateTimeInterfaceTransformer;
|
||||
|
||||
class DettaglioPagamento extends Data
|
||||
{
|
||||
|
||||
//string length 4 - options
|
||||
public string $ModalitaPagamento;
|
||||
|
||||
// Amount2DecimalType
|
||||
public float $ImportoPagamento;
|
||||
|
||||
//String200LatinType
|
||||
public string|Optional $Beneficiario;
|
||||
|
||||
//date
|
||||
public string|Optional $DataRiferimentoTerminiPagamento;
|
||||
|
||||
// <xs:restriction base="xs:integer">
|
||||
// <xs:minInclusive value="0" />
|
||||
// <xs:maxInclusive value="999" />
|
||||
public int|Optional $GiorniTerminiPagamento;
|
||||
|
||||
//date
|
||||
#[WithTransformer(DateTimeInterfaceTransformer::class, format: 'Y-m-d')]
|
||||
public \Datetime|Optional $DataScadenzaPagamento;
|
||||
|
||||
//String20Type
|
||||
public string|Optional $CodUfficioPostale;
|
||||
|
||||
//String60LatinType
|
||||
public string|Optional $CognomeQuietanzante;
|
||||
|
||||
//String60LatinType
|
||||
public string|Optional $NomeQuietanzante;
|
||||
|
||||
//string [A-Z0-9]{16}
|
||||
public string|Optional $CFQuietanzante;
|
||||
|
||||
//string {IsBasicLatin}{2,10}
|
||||
public string|Optional $TitoloQuietanzante;
|
||||
|
||||
//string String80LatinType
|
||||
public string|Optional $IstitutoFinanziario;
|
||||
|
||||
//[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{11,30}
|
||||
public string|Optional $IBAN;
|
||||
|
||||
// string [0-9][0-9][0-9][0-9][0-9]
|
||||
public string|Optional $ABI;
|
||||
|
||||
//[0-9][0-9][0-9][0-9][0-9]
|
||||
public string|Optional $CAB;
|
||||
|
||||
//[A-Z]{6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3}){0,1}
|
||||
public string|Optional $BIC;
|
||||
|
||||
//Amount2DecimalType
|
||||
public float|Optional $ScontoPagamentoAnticipato;
|
||||
|
||||
//Date
|
||||
#[WithTransformer(DateTimeInterfaceTransformer::class, format: 'Y-m-d')]
|
||||
public string|Optional $DataLimitePagamentoAnticipato;
|
||||
|
||||
//Amount2DecimalType
|
||||
public float|Optional $PenalitaPagamentiRitardati;
|
||||
|
||||
//date
|
||||
#[WithTransformer(DateTimeInterfaceTransformer::class, format: 'Y-m-d')]
|
||||
public \DateTime|Optional $DataDecorrenzaPenale;
|
||||
|
||||
//String60Type
|
||||
public string|Optional $CodicePagamento;
|
||||
|
||||
}
|
@ -13,6 +13,9 @@ namespace App\DataMapper\EDoc\FatturaPA;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
use Spatie\LaravelData\Optional;
|
||||
use App\DataMapper\EDoc\FatturaPA\DatiVeicoli;
|
||||
use App\DataMapper\EDoc\FatturaPA\DatiBeniServizi;
|
||||
use App\DataMapper\EDoc\FatturaPA\Body\DatiGenerali;
|
||||
|
||||
class FatturaElettronicaBody extends Data
|
||||
{
|
||||
|
24
app/DataMapper/EDoc/FatturaPA/Generics/CodiceArticolo.php
Normal file
24
app/DataMapper/EDoc/FatturaPA/Generics/CodiceArticolo.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?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\Generics;
|
||||
|
||||
use Spatie\LaravelData\Data;
|
||||
|
||||
class CodiceArticolo extends Data
|
||||
{
|
||||
//string 35 char
|
||||
public string $CodiceTipo;
|
||||
|
||||
//string 35 char
|
||||
public string $CodiceValore;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ class DatiDDT extends Data
|
||||
public string $NumeroDDT;
|
||||
|
||||
#[WithTransformer(DateTimeInterfaceTransformer::class, format: 'Y-m-d')]
|
||||
public \DateTime $DataDDT = new \DateTime();
|
||||
public \DateTime $DataDDT;
|
||||
|
||||
//int 1-9999
|
||||
public int|Optional $RiferimentoNumeroLinea;
|
||||
|
@ -103,6 +103,7 @@ class CreateUbl implements ShouldQueue
|
||||
|
||||
$ubl_invoice->setLegalMonetaryTotal((new LegalMonetaryTotal())
|
||||
//->setLineExtensionAmount()
|
||||
->setTaxInclusiveAmount($taxtotal->getTaxAmount())
|
||||
->setTaxExclusiveAmount($taxable)
|
||||
->setPayableAmount($invoice->balance));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user