';
print '';
print '| ' . $langs->trans('ZugferdXMLValues') . ' | ';
print '
';
// Document Info
print '';
print '| ' . $langs->trans('DocumentInfo') . ' | ';
print '
';
print '';
print '| ' . $langs->trans('InvoiceNumber') . ' | ';
print '' . htmlspecialchars($invoice->ref) . ' | ';
print '
';
$typeCode = '380'; // Standard invoice
if ($invoice->type == Facture::TYPE_CREDIT_NOTE) {
$typeCode = '381';
} elseif ($invoice->type == Facture::TYPE_DEPOSIT) {
$typeCode = '386';
}
print '';
print '| ' . $langs->trans('TypeCode') . ' | ';
print '' . $typeCode . ' (' . ($typeCode == '380' ? 'Commercial Invoice' : ($typeCode == '381' ? 'Credit Note' : 'Deposit')) . ') | ';
print '
';
print '';
print '| ' . $langs->trans('IssueDate') . ' | ';
print '' . dol_print_date($invoice->date, '%Y%m%d') . ' | ';
print '
';
if (!empty($invoice->date_lim_reglement)) {
print '';
print '| ' . $langs->trans('DueDate') . ' | ';
print '' . dol_print_date($invoice->date_lim_reglement, '%Y%m%d') . ' | ';
print '
';
}
// Seller Info
print '';
print '| ' . $langs->trans('Seller') . ' (SellerTradeParty) | ';
print '
';
global $mysoc;
print '';
print '| ' . $langs->trans('Name') . ' | ';
print '' . htmlspecialchars($mysoc->name) . ' | ';
print '
';
print '';
print '| ' . $langs->trans('Address') . ' | ';
print '' . htmlspecialchars($mysoc->address) . ' | ';
print '
';
print '';
print '| ' . $langs->trans('Zip') . ' / ' . $langs->trans('Town') . ' | ';
print '' . htmlspecialchars($mysoc->zip) . ' / ' . htmlspecialchars($mysoc->town) . ' | ';
print '
';
print '';
print '| ' . $langs->trans('Country') . ' | ';
print '' . htmlspecialchars($mysoc->country_code) . ' | ';
print '
';
if (!empty($mysoc->tva_intra)) {
print '';
print '| ' . $langs->trans('VATIntra') . ' | ';
print '' . htmlspecialchars($mysoc->tva_intra) . ' | ';
print '
';
}
// Buyer Info
print '';
print '| ' . $langs->trans('Customer') . ' (BuyerTradeParty) | ';
print '
';
$buyer = $invoice->thirdparty;
print '';
print '| ' . $langs->trans('Name') . ' | ';
print '' . htmlspecialchars($buyer->name) . ' | ';
print '
';
print '';
print '| ' . $langs->trans('Address') . ' | ';
print '' . htmlspecialchars($buyer->address) . ' | ';
print '
';
print '';
print '| ' . $langs->trans('Zip') . ' / ' . $langs->trans('Town') . ' | ';
print '' . htmlspecialchars($buyer->zip) . ' / ' . htmlspecialchars($buyer->town) . ' | ';
print '
';
print '';
print '| ' . $langs->trans('Country') . ' | ';
print '' . htmlspecialchars($buyer->country_code) . ' | ';
print '
';
if (!empty($buyer->tva_intra)) {
print '';
print '| ' . $langs->trans('VATIntra') . ' | ';
print '' . htmlspecialchars($buyer->tva_intra) . ' | ';
print '
';
}
// Leitweg-ID (for XRechnung)
if (!empty($buyer->array_options['options_leitweg_id'])) {
print '';
print '| ' . $langs->trans('LeitwegID') . ' (BuyerReference) | ';
print '' . htmlspecialchars($buyer->array_options['options_leitweg_id']) . ' | ';
print '
';
}
// Payment Info
print '';
print '| ' . $langs->trans('Payment') . ' | ';
print '
';
// Bank Account Info
if (!empty($invoice->fk_account)) {
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
$bankAccount = new Account($db);
if ($bankAccount->fetch($invoice->fk_account) > 0) {
if (!empty($bankAccount->iban)) {
print '';
print '| IBAN | ';
print '' . htmlspecialchars($bankAccount->iban) . ' | ';
print '
';
}
if (!empty($bankAccount->bic)) {
print '';
print '| BIC | ';
print '' . htmlspecialchars($bankAccount->bic) . ' | ';
print '
';
}
}
}
// Line Items
print '';
print '| ' . $langs->trans('Lines') . ' (IncludedSupplyChainTradeLineItem) | ';
print '
';
$lineNo = 0;
foreach ($invoice->lines as $line) {
// Skip title/subtotal lines
if (!empty($line->special_code) && in_array($line->special_code, array(104777, 104778, 104779))) {
continue;
}
if ($line->qty == 0 && $line->total_ht == 0 && empty($line->fk_product)) {
continue;
}
$lineNo++;
print '';
print '| ' . $langs->trans('Line') . ' ' . $lineNo . ' | ';
print '
';
print '';
print '| LineID | ';
print '' . $lineNo . ' | ';
print '
';
if (!empty($line->fk_product)) {
$product = new Product($db);
$product->fetch($line->fk_product);
print '';
print '| SellerAssignedID | ';
print '' . htmlspecialchars($product->ref) . ' | ';
print '
';
}
print '';
print '| Name | ';
print '' . htmlspecialchars($line->product_label ?: $line->desc) . ' | ';
print '
';
print '';
print '| BilledQuantity | ';
print '' . number_format($line->qty, 4, '.', '') . ' | ';
print '
';
print '';
print '| NetPriceAmount (ChargeAmount) | ';
print '' . number_format($line->subprice, 2, '.', '') . ' | ';
print '
';
print '';
print '| LineTotalAmount | ';
print '' . number_format($line->total_ht, 2, '.', '') . ' | ';
print '
';
$vatRate = $line->tva_tx;
$categoryCode = ($vatRate > 0) ? 'S' : 'Z';
print '';
print '| VAT (CategoryCode / Rate) | ';
print '' . $categoryCode . ' / ' . number_format($vatRate, 2, '.', '') . '% | ';
print '
';
}
// Totals
print '';
print '| ' . $langs->trans('Totals') . ' (SpecifiedTradeSettlementHeaderMonetarySummation) | ';
print '
';
print '';
print '| LineTotalAmount | ';
print '' . number_format($invoice->total_ht, 2, '.', '') . ' | ';
print '
';
print '';
print '| TaxBasisTotalAmount | ';
print '' . number_format($invoice->total_ht, 2, '.', '') . ' | ';
print '
';
print '';
print '| TaxTotalAmount | ';
print '' . number_format($invoice->total_tva, 2, '.', '') . ' (currencyID="' . $conf->currency . '") | ';
print '
';
print '';
print '| GrandTotalAmount | ';
print '' . number_format($invoice->total_ttc, 2, '.', '') . ' | ';
print '
';
print '';
print '| DuePayableAmount | ';
print '' . number_format($invoice->total_ttc - $invoice->getSommePaiement(), 2, '.', '') . ' | ';
print '
';
print '