mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 10:54:41 -04:00
FatturaPA tests
This commit is contained in:
parent
70c8e67613
commit
e967373f85
@ -132,6 +132,12 @@ class FatturaPANew extends AbstractService
|
|||||||
$anagrafica->Denominazione = $this->invoice->client->present()->name();
|
$anagrafica->Denominazione = $this->invoice->client->present()->name();
|
||||||
$datiAnagrafici->Anagrafica = $anagrafica;
|
$datiAnagrafici->Anagrafica = $anagrafica;
|
||||||
|
|
||||||
|
$idFiscale = new IdFiscaleIVA;
|
||||||
|
$idFiscale->IdCodice= $this->invoice->client->vat_number;
|
||||||
|
$idFiscale->IdPaese = $this->invoice->client->country->iso_3166_2;
|
||||||
|
|
||||||
|
$datiAnagrafici->IdFiscaleIVA = $idFiscale;
|
||||||
|
|
||||||
$sede = new Sede;
|
$sede = new Sede;
|
||||||
$sede->Indirizzo = $this->invoice->client->address1;
|
$sede->Indirizzo = $this->invoice->client->address1;
|
||||||
$sede->CAP = (int)$this->invoice->client->postal_code;
|
$sede->CAP = (int)$this->invoice->client->postal_code;
|
||||||
@ -205,6 +211,8 @@ class FatturaPANew extends AbstractService
|
|||||||
private function setLineItems(): self
|
private function setLineItems(): self
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$calc = $this->invoice->calc();
|
||||||
|
|
||||||
$datiBeniServizi = new DatiBeniServizi();
|
$datiBeniServizi = new DatiBeniServizi();
|
||||||
$tax_rate_level = 0;
|
$tax_rate_level = 0;
|
||||||
//line items
|
//line items
|
||||||
@ -233,7 +241,6 @@ class FatturaPANew extends AbstractService
|
|||||||
$tax_rate_level = sprintf('%0.2f', $this->invoice->tax_rate1);
|
$tax_rate_level = sprintf('%0.2f', $this->invoice->tax_rate1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$calc = $this->invoice->calc();
|
|
||||||
$subtotal = sprintf('%0.2f', $calc->getSubTotal());
|
$subtotal = sprintf('%0.2f', $calc->getSubTotal());
|
||||||
$taxes = sprintf('%0.2f', $calc->getTotalTaxes());
|
$taxes = sprintf('%0.2f', $calc->getTotalTaxes());
|
||||||
|
|
||||||
|
@ -76,7 +76,6 @@ $settings->state = 'PA';
|
|||||||
'name' => 'Italian Client Name',
|
'name' => 'Italian Client Name',
|
||||||
'address1' => 'Via Antonio da Legnago 68',
|
'address1' => 'Via Antonio da Legnago 68',
|
||||||
'city' => 'Monasterace',
|
'city' => 'Monasterace',
|
||||||
|
|
||||||
'state' => 'CR',
|
'state' => 'CR',
|
||||||
// 'state' => 'Reggio Calabria',
|
// 'state' => 'Reggio Calabria',
|
||||||
'postal_code' => '89040',
|
'postal_code' => '89040',
|
||||||
@ -90,6 +89,8 @@ $settings->state = 'PA';
|
|||||||
$item->notes = "Product Description";
|
$item->notes = "Product Description";
|
||||||
$item->cost = 10;
|
$item->cost = 10;
|
||||||
$item->quantity = 10;
|
$item->quantity = 10;
|
||||||
|
$item->tax_rate1 = 22;
|
||||||
|
$item->tax_name1 = 'IVA';
|
||||||
|
|
||||||
$invoice = Invoice::factory()->create([
|
$invoice = Invoice::factory()->create([
|
||||||
'company_id' => $company->id,
|
'company_id' => $company->id,
|
||||||
@ -98,8 +99,12 @@ $settings->state = 'PA';
|
|||||||
'discount' => 0,
|
'discount' => 0,
|
||||||
'uses_inclusive_taxes' => false,
|
'uses_inclusive_taxes' => false,
|
||||||
'status_id' => 1,
|
'status_id' => 1,
|
||||||
'tax_rate1' => 19,
|
'tax_rate1' => 0,
|
||||||
'tax_name1' => 'IVA',
|
'tax_name1' => '',
|
||||||
|
'tax_rate2' => 0,
|
||||||
|
'tax_rate3' => 0,
|
||||||
|
'tax_name2' => '',
|
||||||
|
'tax_name3' => '',
|
||||||
'line_items' => [$item],
|
'line_items' => [$item],
|
||||||
'number' => 'ITA-'.rand(1000,100000)
|
'number' => 'ITA-'.rand(1000,100000)
|
||||||
]);
|
]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user