Debug v18

This commit is contained in:
Laurent Destailleur 2023-04-18 14:47:02 +02:00
parent 8e51bf2c55
commit 7cf21e6ee6
4 changed files with 21 additions and 9 deletions

View File

@ -168,7 +168,11 @@ function isModEnabled($module)
global $conf; global $conf;
// Fix special cases // Fix special cases
$arrayconv = array('project' => 'projet'); $arrayconv = array(
'project' => 'projet',
'supplier_order'=>'fournisseur',
'supplier_invoice'=>'fournisseur'
);
if (!empty($arrayconv[$module])) { if (!empty($arrayconv[$module])) {
$module = $arrayconv[$module]; $module = $arrayconv[$module];
} }

View File

@ -1873,6 +1873,7 @@ if ($action == 'create') {
} }
print "</form>\n"; print "</form>\n";
} elseif (!empty($object->id)) { } elseif (!empty($object->id)) {
// view
$result = $object->fetch($id, $ref); $result = $object->fetch($id, $ref);
$object->fetch_thirdparty(); $object->fetch_thirdparty();

View File

@ -1895,6 +1895,8 @@ if ($action == 'create') {
// Qty in other receptions (with reception and warehouse used) // Qty in other receptions (with reception and warehouse used)
if ($origin && $origin_id > 0) { if ($origin && $origin_id > 0) {
print '<td class="center nowrap linecolqtyinotherreceptions">'; print '<td class="center nowrap linecolqtyinotherreceptions">';
$htmltooltip = '';
$qtyalreadyreceived = 0;
if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) { if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) {
foreach ($alreadysent as $key => $val) { foreach ($alreadysent as $key => $val) {
if ($lines[$i]->fk_commandefourndet == $key) { if ($lines[$i]->fk_commandefourndet == $key) {
@ -1906,22 +1908,25 @@ if ($action == 'create') {
$j++; $j++;
if ($j > 1) { if ($j > 1) {
print '<br>'; $htmltooltip .= '<br>';
} }
$reception_static->fetch($receptionline_var['reception_id']); $reception_static->fetch($receptionline_var['reception_id']);
print $reception_static->getNomUrl(1); $htmltooltip .= $reception_static->getNomUrl(1, 0, 0, 0, 1);
print ' - '.$receptionline_var['qty']; $htmltooltip .= ' - '.$receptionline_var['qty'];
$htmltext = $langs->trans("DateValidation").' : '.(empty($receptionline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($receptionline_var['date_valid'], 'dayhour')); $htmltext = $langs->trans("DateValidation").' : '.(empty($receptionline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($receptionline_var['date_valid'], 'dayhour'));
if (isModEnabled('stock') && $receptionline_var['warehouse'] > 0) { if (isModEnabled('stock') && $receptionline_var['warehouse'] > 0) {
$warehousestatic->fetch($receptionline_var['warehouse']); $warehousestatic->fetch($receptionline_var['warehouse']);
$htmltext .= '<br>'.$langs->trans("From").' : '.$warehousestatic->getNomUrl(1, '', 0, 1); $htmltext .= '<br>'.$langs->trans("From").' : '.$warehousestatic->getNomUrl(1, '', 0, 1);
} }
print ' '.$form->textwithpicto('', $htmltext, 1); $htmltooltip .= ' '.$form->textwithpicto('', $htmltext, 1);
$qtyalreadyreceived += $receptionline_var['qty'];
} }
} }
} }
} }
print $form->textwithpicto($qtyalreadyreceived, $htmltooltip, 1, 'info', '', 0, 3, 'tooltip'.$lines[$i]->id);
print '</td>'; print '</td>';
} }

View File

@ -1257,13 +1257,15 @@ class Reception extends CommonObject
$linkstart .= $linkclose.'>'; $linkstart .= $linkclose.'>';
$linkend = '</a>'; $linkend = '</a>';
$result .= $linkstart;
if ($withpicto) { if ($withpicto) {
$result .= ($linkstart.img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? '' : 'class="classfortooltip"'), 0, 0, $notooltip ? 0 : 1).$linkend); $result .= img_object(($notooltip ? '' : $label), $this->picto, '', 0, 0, $notooltip ? 0 : 1);
} }
if ($withpicto && $withpicto != 2) { if ($withpicto != 2) {
$result .= ' '; $result .= $this->ref;
} }
$result .= $linkstart.$this->ref.$linkend;
$result .= $linkend;
global $action; global $action;
$hookmanager->initHooks(array($this->element . 'dao')); $hookmanager->initHooks(array($this->element . 'dao'));