Debug v20

This commit is contained in:
Laurent Destailleur 2024-05-03 18:00:17 +02:00
parent b1703cdeeb
commit 390ea76702
4 changed files with 31 additions and 33 deletions

View File

@ -5987,7 +5987,7 @@ function print_fiche_titre($title, $mesg = '', $picto = 'generic', $pictoisfullp
/**
* Load a title with picto
*
* @param string $titre Title to show
* @param string $title Title to show
* @param string $morehtmlright Added message to show on right
* @param string $picto Icon to use before title (should be a 32x32 transparent png file)
* @param int $pictoisfullpath 1=Icon name is a full absolute url of image
@ -5997,7 +5997,7 @@ function print_fiche_titre($title, $mesg = '', $picto = 'generic', $pictoisfullp
* @return string
* @see print_barre_liste()
*/
function load_fiche_titre($titre, $morehtmlright = '', $picto = 'generic', $pictoisfullpath = 0, $id = '', $morecssontable = '', $morehtmlcenter = '')
function load_fiche_titre($title, $morehtmlright = '', $picto = 'generic', $pictoisfullpath = 0, $id = '', $morecssontable = '', $morehtmlcenter = '')
{
$return = '';
@ -6012,7 +6012,7 @@ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'generic', $pict
$return .= '<td class="nobordernopadding widthpictotitle valignmiddle col-picto">'.img_picto('', $picto, 'class="valignmiddle widthpictotitle pictotitle"', $pictoisfullpath).'</td>';
}
$return .= '<td class="nobordernopadding valignmiddle col-title">';
$return .= '<div class="titre inline-block">'.$titre.'</div>';
$return .= '<div class="titre inline-block">'.dol_escape_htmltag($title).'</div>';
$return .= '</td>';
if (dol_strlen($morehtmlcenter)) {
$return .= '<td class="nobordernopadding center valignmiddle col-center">'.$morehtmlcenter.'</td>';
@ -6028,7 +6028,7 @@ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'generic', $pict
/**
* Print a title with navigation controls for pagination
*
* @param string $titre Title to show (required)
* @param string $title Title to show (required)
* @param int|null $page Numero of page to show in navigation links (required)
* @param string $file Url of page (required)
* @param string $options More parameters for links ('' by default, does not include sortfield neither sortorder). Value must be 'urlencoded' before calling function.
@ -6048,7 +6048,7 @@ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'generic', $pict
* @param string $morehtmlrightbeforearrow More html to show (before arrows)
* @return void
*/
function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', $sortorder = '', $morehtmlcenter = '', $num = -1, $totalnboflines = '', $picto = 'generic', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '', $limit = -1, $hideselectlimit = 0, $hidenavigation = 0, $pagenavastextinput = 0, $morehtmlrightbeforearrow = '')
function print_barre_liste($title, $page, $file, $options = '', $sortfield = '', $sortorder = '', $morehtmlcenter = '', $num = -1, $totalnboflines = '', $picto = 'generic', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '', $limit = -1, $hideselectlimit = 0, $hidenavigation = 0, $pagenavastextinput = 0, $morehtmlrightbeforearrow = '')
{
global $conf;
@ -6083,13 +6083,13 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
// Left
if ($picto && $titre) {
if ($picto && $title) {
print '<td class="nobordernopadding widthpictotitle valignmiddle col-picto">'.img_picto('', $picto, 'class="valignmiddle pictotitle widthpictotitle"', $pictoisfullpath).'</td>';
}
print '<td class="nobordernopadding valignmiddle col-title">';
print '<div class="titre inline-block">'.$titre;
if (!empty($titre) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '') {
print '<div class="titre inline-block">'.dol_escape_htmltag($title);
if (!empty($title) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '') {
print '<span class="opacitymedium colorblack paddingleft">('.$totalnboflines.')</span>';
}
print '</div></td>';

View File

@ -1655,15 +1655,12 @@ if ($ok && GETPOST('repair_supplier_order_duplicate_ref')) {
if ($ok && GETPOST('recalculateinvoicetotal') == 'confirmed') {
$err = 0;
$db->begin();
$sql = "
SELECT
f.rowid,
SUM(fd.total_ht) as total_ht
FROM ".MAIN_DB_PREFIX."facture f
LEFT JOIN ".MAIN_DB_PREFIX."facturedet fd
ON fd.fk_facture = f.rowid
WHERE f.total_ht = 0
GROUP BY fd.fk_facture HAVING SUM(fd.total_ht) != 0";
$sql = "SELECT f.rowid, SUM(fd.total_ht) as total_ht";
$sql .= " FROM ".MAIN_DB_PREFIX."facture f";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facturedet fd ON fd.fk_facture = f.rowid";
$sql .= " WHERE f.total_ht = 0";
$sql .= " GROUP BY fd.fk_facture HAVING SUM(fd.total_ht) <> 0";
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
@ -1675,27 +1672,27 @@ if ($ok && GETPOST('recalculateinvoicetotal') == 'confirmed') {
while ($i < $num) {
$obj = $db->fetch_object($resql);
$sql_calculs = "
SELECT
SUM(fd.total_ht) as 'total_ht',
SELECT
SUM(fd.total_ht) as 'total_ht',
SUM(fd.total_tva) as 'total_tva',
SUM(fd.total_localtax1) as 'localtax1',
SUM(fd.total_localtax2) as 'localtax2',
SUM(fd.total_ttc) as 'total_ttc'
FROM
".MAIN_DB_PREFIX."facturedet fd
WHERE
WHERE
fd.fk_facture = $obj->rowid";
$ressql_calculs = $db->query($sql_calculs);
while ($obj_calcul = $db->fetch_object($ressql_calculs)) {
$sql_maj = "
UPDATE ".MAIN_DB_PREFIX."facture
SET
total_ht = ".($obj_calcul->total_ht ? price2num($obj_calcul->total_ht, 'MT') : 0).",
total_tva = ".($obj_calcul->total_tva ? price2num($obj_calcul->total_tva, 'MT') : 0).",
localtax1 = ".($obj_calcul->localtax1 ? price2num($obj_calcul->localtax1, 'MT') : 0).",
localtax2 = ".($obj_calcul->localtax2 ? price2num($obj_calcul->localtax2, 'MT') : 0).",
total_ttc = ".($obj_calcul->total_ttc ? price2num($obj_calcul->total_ttc, 'MT') : 0)."
WHERE
UPDATE ".MAIN_DB_PREFIX."facture
SET
total_ht = ".($obj_calcul->total_ht ? price2num($obj_calcul->total_ht, 'MT') : 0).",
total_tva = ".($obj_calcul->total_tva ? price2num($obj_calcul->total_tva, 'MT') : 0).",
localtax1 = ".($obj_calcul->localtax1 ? price2num($obj_calcul->localtax1, 'MT') : 0).",
localtax2 = ".($obj_calcul->localtax2 ? price2num($obj_calcul->localtax2, 'MT') : 0).",
total_ttc = ".($obj_calcul->total_ttc ? price2num($obj_calcul->total_ttc, 'MT') : 0)."
WHERE
rowid = $obj->rowid";
$db->query($sql_maj);
}

View File

@ -216,11 +216,11 @@ $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'f
if (isModEnabled('agenda')) {
$permok = $user->hasRight('agenda', 'myactions', 'create');
if ((!empty($objproduct->id) || !empty($objcon->id)) && $permok) {
if (get_class($objproduct) == 'Product') {
$out .= '&amp;prodid='.$objproduct->id.'&origin=product&originid='.$id;
if (!empty($object->id) && $permok) {
if (get_class($object) == 'Product') {
$out .= '&amp;prodid='.$object->id.'&origin=product&originid='.$id;
}
$out .= (!empty($objcon->id) ? '&amp;contactid='.$objcon->id : '').'&amp;backtopage='.$_SERVER["PHP_SELF"].'?id='.$object->id;
$out .= '&amp;backtopage='.$_SERVER["PHP_SELF"].'?id='.$object->id;
}
$linktocreatetimeBtnStatus = $user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create');

View File

@ -170,7 +170,8 @@ if ($result) {
$i = 0;
$param = "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield";
print_barre_liste($langs->trans("ListOfValidatedPublicMembers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '');
$title = $langs->trans("ListOfValidatedPublicMembers");
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '');
print '<table class="public_border centpercent">';
print '<tr class="public_liste_titre">';