0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; } if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; } if (!$res && file_exists("../main.inc.php")) { $res = @include "../main.inc.php"; } if (!$res && file_exists("../../main.inc.php")) { $res = @include "../../main.inc.php"; } if (!$res && file_exists("../../../main.inc.php")) { $res = @include "../../../main.inc.php"; } if (!$res) { die("Include of main fails"); } require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; dol_include_once('/importzugferd/class/zugferdimport.class.php'); dol_include_once('/importzugferd/lib/importzugferd.lib.php'); // Load translation files $langs->loadLangs(array("importzugferd@importzugferd", "bills", "companies")); // Get parameters $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); // Initialize object $object = new ZugferdImport($db); // Load object if ($id > 0 || !empty($ref)) { $result = $object->fetch($id, $ref); if ($result <= 0) { setEventMessages($langs->trans('RecordNotFound'), null, 'errors'); header('Location: '.dol_buildpath('/importzugferd/list.php', 1)); exit; } } // Security check if (!$user->hasRight('importzugferd', 'import', 'read')) { accessforbidden(); } $permissiontodelete = $user->hasRight('importzugferd', 'import', 'delete'); /* * Actions */ // Delete confirmation if ($action == 'delete' && $confirm == 'yes' && $permissiontodelete) { $result = $object->delete($user); if ($result > 0) { setEventMessages($langs->trans('RecordDeleted'), null, 'mesgs'); header('Location: '.dol_buildpath('/importzugferd/list.php', 1)); exit; } else { setEventMessages($object->error, $object->errors, 'errors'); } } /* * View */ $form = new Form($db); $title = $langs->trans('ImportRecord').' - '.$object->ref; llxHeader('', $title, '', '', 0, 0, '', '', '', 'mod-importzugferd page-card'); // Confirmation dialog for delete if ($action == 'delete') { print $form->formconfirm( $_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteImportRecord'), $langs->trans('ConfirmDeleteImportRecord', $object->ref), 'delete', '', 0, 1 ); } // Header print '
'; print '
'; print ''; // Ref print ''; print ''; print ''; print ''; // Invoice number print ''; print ''; print ''; print ''; // Invoice date print ''; print ''; print ''; print ''; // Seller print ''; print ''; print ''; print ''; // VAT ID print ''; print ''; print ''; print ''; // Buyer reference print ''; print ''; print ''; print ''; // Total HT print ''; print ''; print ''; print ''; // Total TTC print ''; print ''; print ''; print ''; // Supplier invoice print ''; print ''; print ''; print ''; // Status print ''; print ''; print ''; print ''; // Error message if ($object->status == ZugferdImport::STATUS_ERROR && !empty($object->error_message)) { print ''; print ''; print ''; print ''; } // PDF filename print ''; print ''; print ''; print ''; // Date creation print ''; print ''; print ''; print ''; print '
'.$langs->trans('Ref').''.$object->ref.'
'.$langs->trans('InvoiceNumber').''.dol_escape_htmltag($object->invoice_number).'
'.$langs->trans('InvoiceDate').''.dol_print_date($object->invoice_date, 'day').'
'.$langs->trans('Supplier').''; if ($object->fk_soc > 0) { $supplier = new Societe($db); $supplier->fetch($object->fk_soc); print $supplier->getNomUrl(1); print ' ('.dol_escape_htmltag($object->seller_name).')'; } else { print dol_escape_htmltag($object->seller_name); } print '
'.$langs->trans('VATIntra').''.dol_escape_htmltag($object->seller_vat).'
'.$langs->trans('BuyerReference').''.dol_escape_htmltag($object->buyer_reference).'
'.$langs->trans('TotalHT').''.price($object->total_ht).' '.$object->currency.'
'.$langs->trans('TotalTTC').''.price($object->total_ttc).' '.$object->currency.'
'.$langs->trans('SupplierInvoice').''; if ($object->fk_facture_fourn > 0) { $invoice = new FactureFournisseur($db); $invoice->fetch($object->fk_facture_fourn); print $invoice->getNomUrl(1); } else { print '-'; } print '
'.$langs->trans('Status').''.$object->getLibStatut(1).'
'.$langs->trans('ErrorMessage').''.dol_escape_htmltag($object->error_message).'
'.$langs->trans('File').''.dol_escape_htmltag($object->pdf_filename).'
'.$langs->trans('DateCreation').''.dol_print_date($object->date_creation, 'dayhour').'
'; print '
'; // Action buttons print '
'; // Reimport button - link to import page print ''.$langs->trans('ImportAnother').''; // Delete button if ($permissiontodelete) { print ''.$langs->trans('Delete').''; } print '
'; // Show XML content (collapsed) if (!empty($object->xml_content)) { // Format XML for better readability using class method $formattedXml = ZugferdImport::formatXmlForDisplay($object->xml_content); print '
'; print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '
'.$langs->trans('XMLContent').'
'; print ''.$langs->trans('ClickToExpand').''; print ''; print '
'; print '
'; } llxFooter(); $db->close();