diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt
index 3db28d1f98e..98a6d2176aa 100644
--- a/dev/dolibarr_changes.txt
+++ b/dev/dolibarr_changes.txt
@@ -299,7 +299,7 @@ SELECT2
Edit CSS to restore line removed between 4.0.5 and 4.0.6. It generates this bug: https://github.com/select2/select2/issues/5832
.select2-hidden-accessible {
- margin: -1px !important; /* line to restore */
+ margin: -10000px !important; /* line to restore */
}
diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php
index 72e116ab3a7..c7bae90b373 100644
--- a/htdocs/admin/prelevement.php
+++ b/htdocs/admin/prelevement.php
@@ -39,6 +39,8 @@ if (!$user->admin) accessforbidden();
$action = GETPOST('action', 'aZ09');
$type = 'paymentorder';
+$error = 0;
+
/*
* Actions
@@ -73,30 +75,25 @@ if ($action == "set")
} else $error++;
$res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity);
- if (!$res > 0) $error++;
+ if (! ($res > 0)) $error++;
- if (GETPOST("PRELEVEMENT_USER") > 0)
- {
- $res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
- if (!$res > 0) $error++;
- }
- if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END") == "")
- {
- $res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
- if (!$res > 0) $error++;
- }
- if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD") == "")
- {
- $res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
- if (!$res > 0) $error++;
- }
+ if (GETPOST("PRELEVEMENT_USER") > 0) {
+ $res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
+ if (! ($res > 0)) $error++;
+ }
+ if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END") == "") {
+ $res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
+ if (! ($res > 0)) $error++;
+ }
+ if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD") == "") {
+ $res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
+ if (! ($res > 0)) $error++;
+ }
- if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS") == "")
- {
- $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
- if (!$res > 0) $error++;
- } elseif (!$error)
- {
+ $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
+ if (! ($res > 0)) $error++;
+
+ if (! $error) {
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
@@ -193,9 +190,10 @@ print '';
//ADDDAYS
print '
| '.$langs->trans("ADDDAYS").' | ';
print '';
-if (!$conf->global->PRELEVEMENT_ADDDAYS) $conf->global->PRELEVEMENT_ADDDAYS = 0;
+if (empty($conf->global->PRELEVEMENT_ADDDAYS)) $conf->global->PRELEVEMENT_ADDDAYS = 0;
print ' | ';
print '
';
+
print '';
print '
';
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 4451f13bd77..733325f901b 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -2433,22 +2433,22 @@ if (empty($reshook))
{
$object->fetch($id, '', '', '', true);
- if ($object->statut == Facture::STATUS_VALIDATED
- && $object->type == Facture::TYPE_SITUATION
- && $usercancreate
- && !$objectidnext
- && $object->is_last_in_cycle()
- && $usercanunvalidate
- )
- {
- $outingError = 0;
- $newCycle = $object->newCycle(); // we need to keep the "situation behavior" so we place it on a new situation cycle
- if ($newCycle > 1)
- {
- // Search credit notes
- $lastCycle = $object->situation_cycle_ref;
- $lastSituationCounter = $object->situation_counter;
- $linkedCreditNotesList = array();
+ if (in_array($object->statut, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED))
+ && $object->type == Facture::TYPE_SITUATION
+ && $usercancreate
+ && !$objectidnext
+ && $object->is_last_in_cycle()
+ && $usercanunvalidate
+ )
+ {
+ $outingError = 0;
+ $newCycle = $object->newCycle(); // we need to keep the "situation behavior" so we place it on a new situation cycle
+ if ($newCycle > 1)
+ {
+ // Search credit notes
+ $lastCycle = $object->situation_cycle_ref;
+ $lastSituationCounter = $object->situation_counter;
+ $linkedCreditNotesList = array();
if (count($object->tab_next_situation_invoice) > 0) {
foreach ($object->tab_next_situation_invoice as $next_invoice) {
@@ -3764,18 +3764,18 @@ if ($action == 'create')
// Confirmation to remove invoice from cycle
if ($action == 'situationout') {
- $text = $langs->trans('ConfirmRemoveSituationFromCycle', $object->ref);
- $label = $langs->trans("ConfirmOuting");
- $formquestion = array();
- // remove situation from cycle
- if ($object->statut == Facture::STATUS_VALIDATED
- && $usercancreate
- && !$objectidnext
- && $object->is_last_in_cycle()
- && $usercanunvalidate
- )
- {
- $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id, $label, $text, 'confirm_situationout', $formquestion, "yes", 1);
+ $text = $langs->trans('ConfirmRemoveSituationFromCycle', $object->ref);
+ $label = $langs->trans("ConfirmOuting");
+ $formquestion = array();
+ // remove situation from cycle
+ if (in_array($object->statut, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED))
+ && $usercancreate
+ && !$objectidnext
+ && $object->is_last_in_cycle()
+ && $usercanunvalidate
+ )
+ {
+ $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id, $label, $text, 'confirm_situationout', $formquestion, "yes", 1);
}
}
@@ -5278,12 +5278,12 @@ if ($action == 'create')
}
// Remove situation from cycle
- if ($object->statut > Facture::STATUS_DRAFT
- && $object->type == Facture::TYPE_SITUATION
- && $usercancreate
- && !$objectidnext
- && $object->situation_counter > 1
- && $object->is_last_in_cycle()
+ if (in_array($object->statut, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED))
+ && $object->type == Facture::TYPE_SITUATION
+ && $usercancreate
+ && !$objectidnext
+ && $object->situation_counter > 1
+ && $object->is_last_in_cycle()
&& $usercanunvalidate
)
{
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 57e48242ce3..84eb96c27ab 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -6259,12 +6259,6 @@ class Form
$resql = $this->db->query($sql);
if ($resql)
{
- if (!$forcecombo)
- {
- include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
- $out .= ajax_combobox($htmlname, null, $conf->global->$confkeyforautocompletemode);
- }
-
// Construct $out and $outarray
$out .= ''."\n";
+
+ if (!$forcecombo) {
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
+ $out .= ajax_combobox($htmlname, null, $conf->global->$confkeyforautocompletemode);
+ }
} else {
dol_print_error($this->db);
}
diff --git a/htdocs/includes/jquery/plugins/select2/dist/css/select2.css b/htdocs/includes/jquery/plugins/select2/dist/css/select2.css
index c4c42ea3cc6..eb341de9d83 100644
--- a/htdocs/includes/jquery/plugins/select2/dist/css/select2.css
+++ b/htdocs/includes/jquery/plugins/select2/dist/css/select2.css
@@ -121,7 +121,7 @@
-webkit-clip-path: inset(50%) !important;
clip-path: inset(50%) !important;
height: 1px !important;
- margin: -1px !important;
+ margin: -10000px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index a4c5de4c47d..16d9fedd078 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -1438,14 +1438,14 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
{
$db->free($result);
- // Il doit au moins y avoir la ligne de prix initial.
- // On l'ajoute donc pour remettre a niveau (pb vieilles versions)
- //$object->updatePrice($object->price, $object->price_base_type, $user, $object->tva_tx, $object->price_min);
- if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
- $object->updatePrice($object->multiprices[1], $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), $object->multiprices_min[1], 1);
- } else {
- $object->updatePrice($object->price, $object->price_base_type, $user, $object->tva_tx, $object->price_min);
- }
+ // Il doit au moins y avoir la ligne de prix initial.
+ // On l'ajoute donc pour remettre a niveau (pb vieilles versions)
+ // We emulate the change of the price from interface with the same value than the one into table llx_product
+ if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
+ $object->updatePrice(($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_ttc[1] : $object->multiprices[1]), $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), ($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_min_ttc[1] : $object->multiprices_min[1]), 1);
+ } else {
+ $object->updatePrice(($object->price_base_type == 'TTC' ? $object->price_ttc : $object->price), $object->price_base_type, $user, $object->tva_tx, ($object->price_base_type == 'TTC' ? $object->price_min_ttc : $object->price_min));
+ }
$result = $db->query($sql);
$num = $db->num_rows($result);
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index cfab5312073..2b29bbfd229 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -6762,6 +6762,24 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before
}
}
+@media only screen and (max-width: 320px)
+{
+ .dropdown dd ul {
+ max-width: 270px; /* must always be 50 slower than width */
+ }
+}
+@media only screen and (max-width: 300px)
+{
+ .dropdown dd ul {
+ max-width: 250px;
+ }
+}
+@media only screen and (max-width: 280px)
+{
+ .dropdown dd ul {
+ max-width: 230px;
+ }
+}