-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from josemmo/develop
v1.7.6
- Loading branch information
Showing
11 changed files
with
201 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: Terceros | ||
parent: Entidades | ||
nav_order: 4 | ||
permalink: /entidades/terceros.html | ||
--- | ||
|
||
# Terceros | ||
Un tercero o *Third-Party* es la entidad que genera y firma una factura cuando esta no coincide con el emisor. | ||
Por ejemplo, en el caso de una gestoría que trabaja con varios clientes y emite las facturas en su nombre. | ||
|
||
En el caso de Facturae-PHP, pueden especificarse los datos de un tercero de la siguiente forma: | ||
```php | ||
$fac->setThirdParty(new FacturaeParty([ | ||
"taxNumber" => "B99999999", | ||
"name" => "Gestoría de Ejemplo, S.L.", | ||
"address" => "C/ de la Gestoría, 24", | ||
"postCode" => "23456", | ||
"town" => "Madrid", | ||
"province" => "Madrid", | ||
"phone" => "915555555", | ||
"email" => "[email protected]" | ||
])); | ||
``` | ||
|
||
El tipo de emisor de una factura cambiará automáticamente a `Facturae::ISSUER_THIRD_PARTY` al establecer los datos de un tercero. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,6 +116,15 @@ public function testCreateInvoice($schemaVersion, $isPfx) { | |
// Y ahora, una línea con IVA al 0% | ||
$fac->addItem("Algo exento de IVA", 100, 1, Facturae::TAX_IVA, 0); | ||
|
||
// Otra línea con IVA 0% y código de fiscalidad especial | ||
$fac->addItem(new FacturaeItem([ | ||
"name" => "Otro algo exento de IVA", | ||
"unitPrice" => 50, | ||
"taxes" => [Facturae::TAX_IVA => 0], | ||
"specialTaxableEventCode" => FacturaeItem::SPECIAL_TAXABLE_EVENT_EXEMPT, | ||
"specialTaxableEventReason" => "El motivo detallado de la exención de impuestos" | ||
])); | ||
|
||
// Vamos a añadir un producto utilizando la API avanzada | ||
// que tenga IVA al 10%, IRPF al 15%, descuento del 10% y recargo del 5% | ||
$fac->addItem(new FacturaeItem([ | ||
|
@@ -208,8 +217,19 @@ public function testCreateInvoice($schemaVersion, $isPfx) { | |
"amount" => 99.9991172 | ||
])); | ||
|
||
// Establecemos un un cesionario (solo en algunos casos) | ||
// Establecemos un tercero y un cesionario (solo en algunos casos) | ||
if ($isPfx) { | ||
$fac->setThirdParty(new FacturaeParty([ | ||
"taxNumber" => "B99999999", | ||
"name" => "Gestoría de Ejemplo, S.L.", | ||
"address" => "C/ de la Gestoría, 24", | ||
"postCode" => "23456", | ||
"town" => "Madrid", | ||
"province" => "Madrid", | ||
"phone" => "915555555", | ||
"email" => "[email protected]" | ||
])); | ||
$this->assertEquals(Facturae::ISSUER_THIRD_PARTY, $fac->getIssuerType()); | ||
$fac->setAssignee(new FacturaeParty([ | ||
"taxNumber" => "B00000000", | ||
"name" => "Cesionario S.L.", | ||
|