From 4493dc005a4e4060c529b72286a6220d7cc7f661 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Apr 2025 19:47:32 +0200 Subject: [PATCH 1/2] Clean code --- htdocs/accountancy/customer/list.php | 19 ++++++++++--------- htdocs/accountancy/supplier/list.php | 15 ++++++++------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 25a8508baf6..2503fb7514b 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -664,7 +664,7 @@ if ($result) { print ''.dol_print_date($facture_static->date, 'day').''; // Ref Product - print ''; + print ''; if ($product_static->id > 0) { print $product_static->getNomUrl(1); } @@ -716,7 +716,7 @@ if ($result) { print ''; // Thirdparty - print ''.$thirdpartystatic->getNomUrl(1, 'customer').''; + print ''.$thirdpartystatic->getNomUrl(1, 'customer').''; // Country $labelcountry = ($objp->country_code && ($langs->trans("Country".$objp->country_code) != "Country".$objp->country_code)) ? $langs->trans("Country".$objp->country_code) : $objp->country_label; @@ -744,10 +744,10 @@ if ($result) { $shelp .= $langs->trans("SaleExport"); } $s .= ($code_sell_l > 0 ? length_accountg($code_sell_l) : ''.$langs->trans("NotDefined").''); - print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1); + $textforrule = $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1); // Now show account for product if ($product_static->id > 0) { - print '
'; + $textforrule .= '
'; $s = '2. '.(($facture_static_det->product_type == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; $shelp = ''; $ttype = 'help'; @@ -762,21 +762,22 @@ if ($result) { $shelp = $langs->trans("SaleExport"); } $s .= (empty($code_sell_p) ? ''.$langs->trans("NotDefined").'' : length_accountg($code_sell_p)); - print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1); + $textforrule .= $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1); } else { - print '
'; + $textforrule .= '
'; $s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; $shelp = ''; $s .= $langs->trans("NotDefined"); - print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); + $textforrule .= $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); } if (getDolGlobalString('ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY')) { - print '
'; + $textforrule .= '
'; $s = '3. '.(($facture_static_det->product_type == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': '; $shelp = ''; $s .= ($code_sell_t > 0 ? length_accountg($code_sell_t) : ''.$langs->trans("NotDefined").''); - print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); + $textforrule .= $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); } + print $textforrule; print ''; // Suggested accounting account diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index e584f7286d2..8f9cd02a033 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -748,9 +748,9 @@ if ($result) { $shelp .= $langs->trans("SaleExport"); } $s .= ($code_buy_l > 0 ? length_accountg($code_buy_l) : ''.$langs->trans("NotDefined").''); - print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1); + $textforrule = $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1); if ($product_static->id > 0) { - print '
'; + $textforrule .= '
'; $s = '2. '.(($facturefourn_static_det->product_type == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; $shelp = ''; $ttype = 'help'; @@ -765,21 +765,22 @@ if ($result) { $shelp = $langs->trans("SaleExport"); } $s .= (empty($code_buy_p) ? ''.$langs->trans("NotDefined").'' : length_accountg($code_buy_p)); - print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1); + $textforrule .= $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1); } else { - print '
'; + $textforrule .= '
'; $s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; $shelp = ''; $s .= $langs->trans("NotDefined"); - print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); + $textforrule .= $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); } if (getDolGlobalString('ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY')) { - print '
'; + $textforrule .= '
'; $s = '3. '.(($facturefourn_static_det->product_type == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': '; $shelp = ''; $s .= ($code_buy_t > 0 ? length_accountg($code_buy_t) : ''.$langs->trans("NotDefined").''); - print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); + $textforrule .= $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); } + print $textforrule; print ''; // Suggested accounting account From 2ccfb2dfb6cc627a2c2ea29d665bee83fded4a62 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 12 Apr 2025 20:11:11 +0200 Subject: [PATCH 2/2] CSS --- htdocs/accountancy/customer/list.php | 2 +- htdocs/accountancy/expensereport/list.php | 2 +- htdocs/accountancy/supplier/list.php | 2 +- htdocs/theme/eldy/global.inc.php | 1 + htdocs/theme/md/style.css.php | 1 + 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 2503fb7514b..be9d14fb15b 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -782,7 +782,7 @@ if ($result) { // Suggested accounting account print ''; - print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? (string) $default_account : (string) $suggestedid, 'codeventil'.$facture_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth150 maxwidthonsmartphone', 'cachewithshowemptyone'); + print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? (string) $default_account : (string) $suggestedid, 'codeventil'.$facture_static_det->id, 1, array(), 0, 0, 'codeventil minwidth125onall maxwidth150', 'cachewithshowemptyone'); print ''; // Column with checkbox diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 9ddf89ea347..6d7dab70464 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -528,7 +528,7 @@ if ($result) { // Suggested accounting account print ''; - print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); + print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil minwidth125onall maxwidth200', 'cachewithshowemptyone'); print ''; print ''; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 8f9cd02a033..352b2126813 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -785,7 +785,7 @@ if ($result) { // Suggested accounting account print ''; - print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? (string) $default_account : (string) $suggestedid, 'codeventil'.$facturefourn_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth150 maxwidthonsmartphone', 'cachewithshowemptyone'); + print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? (string) $default_account : (string) $suggestedid, 'codeventil'.$facturefourn_static_det->id, 1, array(), 0, 0, 'codeventil minwidth125onall maxwidth150', 'cachewithshowemptyone'); print ''; // Column with checkbox diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index bc21fbd4541..709b2deeaa5 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2028,6 +2028,7 @@ maxscreenheightless200 { .maxwidth75imp { max-width: 75px !important; } .minwidth100onall { min-width: 100px !important; } +.minwidth125onall { min-width: 125px !important; } .minwidth200onall { min-width: 200px !important; } .minwidth250onall { min-width: 250px !important; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index d4b9543b1b1..7a8e98ab424 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2168,6 +2168,7 @@ tr.nobottom td { .maxwidth75imp { max-width: 75px !important; } .minwidth100onall { min-width: 100px !important; } +.minwidth125onall { min-width: 125px !important; } .minwidth200onall { min-width: 200px !important; } .minwidth250onall { min-width: 250px !important; }