Debug v16

This commit is contained in:
Laurent Destailleur 2022-06-26 21:00:46 +02:00
parent 7262a097e3
commit 0b138167f6

View File

@ -218,7 +218,7 @@ $form = new Form($db);
$sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut, c.ref_customer, c.ref_supplier,";
$sql .= " s.rowid as socid, s.nom as name, s.email, s.client, s.fournisseur,";
$sql .= " cd.rowid, cd.description, cd.statut,";
$sql .= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype, p.entity as pentity,";
$sql .= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype, p.tobuy, p.tosell, p.barcode, p.entity as pentity,";
if (empty($user->rights->societe->client->voir) && !$socid) {
$sql .= " sc.fk_soc, sc.fk_user,";
}
@ -707,6 +707,16 @@ while ($i < min($num, $limit)) {
$companystatic->client = $obj->client;
$companystatic->fournisseur = $obj->fournisseur;
$productstatic->id = $obj->pid;
$productstatic->type = $obj->ptype;
$productstatic->ref = $obj->pref;
$productstatic->entity = $obj->pentity;
$productstatic->status = $obj->tosell;
$productstatic->status_buy = $obj->tobuy;
$productstatic->label = $obj->label;
$productstatic->description = $obj->description;
$productstatic->barcode = $obj->barcode;
print '<tr class="oddeven">';
// Ref
@ -720,16 +730,12 @@ while ($i < min($num, $limit)) {
}
// Service
if (!empty($arrayfields['p.description']['checked'])) {
print '<td>';
print '<td class="tdoverflowmax300">';
if ($obj->pid > 0) {
$productstatic->id = $obj->pid;
$productstatic->type = $obj->ptype;
$productstatic->ref = $obj->pref;
$productstatic->entity = $obj->pentity;
print $productstatic->getNomUrl(1, '', 24);
print $obj->label ? ' - '.dol_trunc($obj->label, 16) : '';
if (!empty($obj->description) && !empty($conf->global->PRODUCT_DESC_IN_LIST)) {
print '<br>'.dol_nl2br($obj->description);
print '<br><span class="small">'.dol_nl2br($obj->description).'</span>';
}
} else {
if ($obj->type == 0) {
@ -746,7 +752,7 @@ while ($i < min($num, $limit)) {
}
if (!empty($arrayfields['cd.tva_tx']['checked'])) {
print '<td class="right">';
print '<td class="right nowraponall">';
print price2num($obj->tva_tx).'%';
print '</td>';
if (!$i) {
@ -754,7 +760,7 @@ while ($i < min($num, $limit)) {
}
}
if (!empty($arrayfields['cd.subprice']['checked'])) {
print '<td class="right">';
print '<td class="right nowraponall">';
print price($obj->subprice);
print '</td>';
if (!$i) {
@ -762,7 +768,7 @@ while ($i < min($num, $limit)) {
}
}
if (!empty($arrayfields['cd.qty']['checked'])) {
print '<td class="right">';
print '<td class="right nowraponall">';
print $obj->qty;
print '</td>';
if (!$i) {
@ -770,7 +776,7 @@ while ($i < min($num, $limit)) {
}
}
if (!empty($arrayfields['cd.total_ht']['checked'])) {
print '<td class="right">';
print '<td class="right nowraponall">';
print '<span class="amount">'.price($obj->total_ht).'</span>';
print '</td>';
if (!$i) {
@ -782,7 +788,7 @@ while ($i < min($num, $limit)) {
$totalarray['val']['cd.total_ht'] += $obj->total_ht;
}
if (!empty($arrayfields['cd.total_tva']['checked'])) {
print '<td class="right">';
print '<td class="right nowraponall">';
print '<span class="amount">'.price($obj->total_tva).'</span>';
print '</td>';
if (!$i) {
@ -806,7 +812,7 @@ while ($i < min($num, $limit)) {
// Start date
if (!empty($arrayfields['cd.date_ouverture_prevue']['checked'])) {
print '<td class="center">';
print '<td class="center nowraponall">';
print ($obj->date_ouverture_prevue ?dol_print_date($db->jdate($obj->date_ouverture_prevue), 'dayhour') : '&nbsp;');
if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay)) && $obj->statut == 0) {
print ' '.img_picto($langs->trans("Late"), "warning");
@ -819,14 +825,14 @@ while ($i < min($num, $limit)) {
}
}
if (!empty($arrayfields['cd.date_ouverture']['checked'])) {
print '<td class="center">'.($obj->date_ouverture ?dol_print_date($db->jdate($obj->date_ouverture), 'dayhour') : '&nbsp;').'</td>';
print '<td class="center nowraponall">'.($obj->date_ouverture ?dol_print_date($db->jdate($obj->date_ouverture), 'dayhour') : '&nbsp;').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// End date
if (!empty($arrayfields['cd.date_fin_validite']['checked'])) {
print '<td class="center">'.($obj->date_fin_validite ?dol_print_date($db->jdate($obj->date_fin_validite), 'dayhour') : '&nbsp;');
print '<td class="center nowraponall">'.($obj->date_fin_validite ?dol_print_date($db->jdate($obj->date_fin_validite), 'dayhour') : '&nbsp;');
if ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5) {
$warning_delay = $conf->contrat->services->expires->warning_delay / 3600 / 24;
$textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days");
@ -841,7 +847,7 @@ while ($i < min($num, $limit)) {
}
// Close date (real end date)
if (!empty($arrayfields['cd.date_cloture']['checked'])) {
print '<td class="center">'.dol_print_date($db->jdate($obj->date_cloture), 'dayhour').'</td>';
print '<td class="center nowraponall">'.dol_print_date($db->jdate($obj->date_cloture), 'dayhour').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
@ -864,7 +870,7 @@ while ($i < min($num, $limit)) {
}
// Date modification
if (!empty($arrayfields['cd.tms']['checked'])) {
print '<td class="center">';
print '<td class="center nowraponall">';
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
print '</td>';
if (!$i) {