Skip to content

Commit

Permalink
Debug v20
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 23, 2024
1 parent 4857c6e commit 06bbdf2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 26 deletions.
66 changes: 41 additions & 25 deletions htdocs/accountancy/bookkeeping/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@
);
}

$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").'...', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 420, 600);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").'...', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 390, 700);
}

// Print form confirm
Expand Down Expand Up @@ -924,12 +924,15 @@
}

$moreforfilter = '';
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('AccountingCategory').': ';
$moreforfilter .= '<div class="nowrap inline-block">';
$moreforfilter .= $formaccounting->select_accounting_category($search_account_category, 'search_account_category', 1, 0, 0, 0);
$moreforfilter .= '</div>';
$moreforfilter .= '</div>';

if (!empty($search_account_category)) {
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('AccountingCategory').': ';
$moreforfilter .= '<div class="nowrap inline-block">';
$moreforfilter .= $formaccounting->select_accounting_category($search_account_category, 'search_account_category', 1, 0, 0, 0);
$moreforfilter .= '</div>';
$moreforfilter .= '</div>';
}

$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
Expand All @@ -939,9 +942,11 @@
$moreforfilter = $hookmanager->resPrint;
}

print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
print '</div>';
if ($moreforfilter) {
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
print '</div>';
}

print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">';
Expand Down Expand Up @@ -1257,6 +1262,7 @@

// Document ref
if (!empty($arrayfields['t.doc_ref']['checked'])) {
$documentlink = '';
if ($line->doc_type == 'customer_invoice') {
$langs->loadLangs(array('bills'));

Expand All @@ -1265,10 +1271,12 @@
$objectstatic->fetch($line->fk_doc);
//$modulepart = 'facture';

$filename = dol_sanitizeFileName($line->doc_ref);
$filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
if ($objectstatic->id > 0) {
$filename = dol_sanitizeFileName($line->doc_ref);
$filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
}
} elseif ($line->doc_type == 'supplier_invoice') {
$langs->loadLangs(array('bills'));

Expand All @@ -1277,10 +1285,12 @@
$objectstatic->fetch($line->fk_doc);
//$modulepart = 'invoice_supplier';

$filename = dol_sanitizeFileName($line->doc_ref);
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
$subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir);
if ($objectstatic->id > 0) {
$filename = dol_sanitizeFileName($line->doc_ref);
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
$subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir);
}
} elseif ($line->doc_type == 'expense_report') {
$langs->loadLangs(array('trips'));

Expand All @@ -1289,10 +1299,12 @@
$objectstatic->fetch($line->fk_doc);
//$modulepart = 'expensereport';

$filename = dol_sanitizeFileName($line->doc_ref);
$filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
if ($objectstatic->id > 0) {
$filename = dol_sanitizeFileName($line->doc_ref);
$filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
}
} elseif ($line->doc_type == 'bank') {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$objectstatic = new AccountLine($db);
Expand All @@ -1304,9 +1316,13 @@
$labeltoshow = '';
$labeltoshowalt = '';
if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report') {
$labeltoshow .= $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
$labeltoshow .= $documentlink;
$labeltoshowalt .= $objectstatic->ref;
if ($objectstatic->id > 0) {
$labeltoshow .= $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
$labeltoshow .= $documentlink;
$labeltoshowalt .= $objectstatic->ref;
} else {
$labeltoshow = '<span class="opacitymedium">'.$langs->trans("Deleted").'</span>';
}
} elseif ($line->doc_type == 'bank') {
$labeltoshow .= $objectstatic->getNomUrl(1);
$labeltoshowalt .= $objectstatic->ref;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/ajax/ajaxtooltip.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
if ($object->id > 0 || !empty($object->ref)) {
/** @var CommonObject $object */
$html = $object->getTooltipContent($params);
} elseif ($res == 0) {
} elseif ($id > 0) {
$html = $langs->trans('Deleted');
}
unset($object);
Expand Down

0 comments on commit 06bbdf2

Please sign in to comment.