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

Added more required fields to e-invoice

This commit is contained in:
Lars Kusch 2024-05-15 15:56:05 +02:00
parent 5b19bf9bca
commit ab45e86b47
2 changed files with 11 additions and 1 deletions

View File

@ -113,6 +113,10 @@ class ZugferdEDokument extends AbstractService
$this->xdocument->addDocumentSellerTaxRegistration("FC", $company->getSetting('vat_number'));
} else {
$this->xdocument->addDocumentSellerTaxRegistration("VA", $company->getSetting('vat_number'));
}
if (!empty($client->vat_number)){
$this->xdocument->addDocumentBuyerTaxRegistration("VA", $client->vat_number);
}
$invoicing_data = $this->document->calc();
@ -149,7 +153,7 @@ class ZugferdEDokument extends AbstractService
$linenetamount -= $linenetamount * ($item->discount / 100);
}
}
$this->xdocument->setDocumentPositionLineSummation($linenetamount);
$this->xdocument->setDocumentPositionLineSummation($linenetamount, $item->line_total-$linenetamount);
// According to european law, each line item can only have one tax rate
if (!(empty($item->tax_name1) && empty($item->tax_name2) && empty($item->tax_name3))) {
$taxtype = $this->getTaxType($item->tax_id);
@ -190,7 +194,12 @@ class ZugferdEDokument extends AbstractService
$this->xdocument->setDocumentSummation($this->document->amount, $this->document->balance, $invoicing_data->getSubTotal(), $invoicing_data->getTotalSurcharges(), $invoicing_data->getTotalDiscount(), $invoicing_data->getSubTotal(), $invoicing_data->getItemTotalTaxes(), 0.0, $this->document->amount - $this->document->balance);
foreach ($this->tax_map as $item) {
if ($item["tax_type"] == ZugferdDutyTaxFeeCategories::VAT_EXEMPT_FOR_EEA_INTRACOMMUNITY_SUPPLY_OF_GOODS_AND_SERVICES){
$this->xdocument->addDocumentTax($item["tax_type"], "VAT", $item["net_amount"], $item["tax_rate"] * $item["net_amount"], $item["tax_rate"] * 100, ctrans('texts.intracommunity_suply'));
} else {
$this->xdocument->addDocumentTax($item["tax_type"], "VAT", $item["net_amount"], $item["tax_rate"] * $item["net_amount"], $item["tax_rate"] * 100);
}
}
// The validity can be checked using https://portal3.gefeg.com/invoice/validation or https://e-rechnung.bayern.de/app/#/upload

View File

@ -5104,6 +5104,7 @@ $lang = array(
'triangular_tax_info' => 'Intra-community triangular transaction',
'intracommunity_tax_info' => 'Tax-free intra-community delivery',
'reverse_tax_info' => 'Please note that this supply is subject to reverse charge',
'intracommunity_suply'=>'Intra-community supply',
'currency_nicaraguan_cordoba' => 'Nicaraguan Córdoba',
'public' => 'Public',
'private' => 'Private',