-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Defining common invoice tags, simplified invoice validation moved up
- Loading branch information
Showing
20 changed files
with
136 additions
and
145 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
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,69 @@ | ||
package common | ||
|
||
import ( | ||
"github.com/invopop/gobl/i18n" | ||
"github.com/invopop/gobl/tax" | ||
) | ||
|
||
var invoiceTags = []*tax.KeyDefinition{ | ||
// Simplified invoices are issued when the complete fiscal details of | ||
// a customer are not available. | ||
{ | ||
Key: TagSimplified, | ||
Name: i18n.String{ | ||
i18n.EN: "Simplified Invoice", | ||
i18n.ES: "Factura Simplificada", | ||
i18n.IT: "Fattura Semplificata", | ||
}, | ||
Desc: i18n.String{ | ||
i18n.EN: "Used for B2C transactions when the client details are not available, check with local authorities for limits.", | ||
i18n.ES: "Usado para transacciones B2C cuando los detalles del cliente no están disponibles, consulte con las autoridades locales para los límites.", | ||
i18n.IT: "Utilizzato per le transazioni B2C quando i dettagli del cliente non sono disponibili, controllare con le autorità locali per i limiti.", | ||
}, | ||
}, | ||
|
||
// Reverse Charge mechanism is used when the supplier is not | ||
// required to charge VAT on the invoice and the customer is | ||
// responsible for paying the VAT to the tax authorities. | ||
{ | ||
Key: TagReverseCharge, | ||
Name: i18n.String{ | ||
i18n.EN: "Reverse Charge", | ||
i18n.ES: "Inversión del Sujeto Pasivo", | ||
i18n.IT: "Inversione del soggetto passivo", | ||
}, | ||
}, | ||
|
||
// Self-billed invoices are issued by the customer instead of the | ||
// supplier. This is usually done when the customer is a large | ||
// company and the supplier is a small company. | ||
{ | ||
Key: TagSelfBilled, | ||
Name: i18n.String{ | ||
i18n.EN: "Self-billed", | ||
i18n.ES: "Facturación por el destinatario", | ||
i18n.IT: "Autofattura", | ||
}, | ||
}, | ||
|
||
// Customer rates (mainly for digital goods inside EU) | ||
{ | ||
Key: TagCustomerRates, | ||
Name: i18n.String{ | ||
i18n.EN: "Customer rates", | ||
i18n.ES: "Tarifas aplicables al destinatario", | ||
}, | ||
}, | ||
} | ||
|
||
// InvoiceTags returns a list of common invoice tag key | ||
// definitions. | ||
func InvoiceTags() []*tax.KeyDefinition { | ||
return invoiceTags | ||
} | ||
|
||
// InvoiceTagsWith appends the list of provided key definitions | ||
// to the base list of tags and returns a new array. | ||
func InvoiceTagsWith(tags []*tax.KeyDefinition) []*tax.KeyDefinition { | ||
return append(InvoiceTags(), tags...) | ||
} |
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
Oops, something went wrong.