diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 42675cda7b4..52932b749a0 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -660,6 +660,7 @@ class PaymentVarious extends CommonObject // phpcs:enable global $langs; + /* if (empty($status)) { $status = 0; } @@ -676,6 +677,8 @@ class PaymentVarious extends CommonObject $statusType = 'status'.$status; return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); + */ + return ''; } diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 218222753cd..1a92bec6a16 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -615,7 +615,7 @@ class CMailFile if (!empty($this->atleastonefile)) { foreach ($filename_list as $i => $val) { $content = file_get_contents($filename_list[$i]); - $smtps->setAttachment($content, $mimefilename_list[$i], $mimetype_list[$i], $cid_list[$i]); + $smtps->setAttachment($content, $mimefilename_list[$i], $mimetype_list[$i], (empty($cid_list[$i]) ? '' : $cid_list[$i])); } } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2b86a378e0b..1343620f5d3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4992,25 +4992,19 @@ abstract class CommonObject $totalWeight = 0; $totalVolume = 0; // defined for shipment only - $totalOrdered = ''; + $totalOrdered = 0; // defined for shipment only - $totalToShip = ''; + $totalToShip = 0; if (empty($this->lines)) { - return array(); + return array('weight' => $totalWeight, 'volume' => $totalVolume, 'ordered' => $totalOrdered, 'toship' => $totalToShip); } foreach ($this->lines as $line) { if (isset($line->qty_asked)) { - if (empty($totalOrdered)) { - $totalOrdered = 0; // Avoid warning because $totalOrdered is '' - } $totalOrdered += $line->qty_asked; // defined for shipment only } if (isset($line->qty_shipped)) { - if (empty($totalToShip)) { - $totalToShip = 0; // Avoid warning because $totalToShip is '' - } $totalToShip += $line->qty_shipped; // defined for shipment only } elseif ($line->element == 'commandefournisseurdispatch' && isset($line->qty)) { if (empty($totalToShip)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 54f9d66289c..2a5a51f62d5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6710,11 +6710,11 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ $nbdecimal = dol_strlen($decpart); } // Si on depasse max - $max_nbdecimal = getDolGlobalString('MAIN_MAX_DECIMALS_SHOWN'); - if ($trunc && $nbdecimal > (int) $max_nbdecimal) { + $max_nbdecimal = (int) str_replace('...', '', getDolGlobalString('MAIN_MAX_DECIMALS_SHOWN')); + if ($trunc && $nbdecimal > $max_nbdecimal) { $nbdecimal = $max_nbdecimal; - if (preg_match('/\.\.\./i', $nbdecimal)) { - // Si un affichage est tronque, on montre des ... + if (preg_match('/\.\.\./i', getDolGlobalString('MAIN_MAX_DECIMALS_SHOWN'))) { + // If output is truncated, we show ... $end = '...'; } } @@ -6722,9 +6722,9 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ // If force rounding if ((string) $forcerounding != '-1') { if ($forcerounding === 'MU') { - $nbdecimal = getDolGlobalString('MAIN_MAX_DECIMALS_UNIT'); + $nbdecimal = getDolGlobalInt('MAIN_MAX_DECIMALS_UNIT'); } elseif ($forcerounding === 'MT') { - $nbdecimal = getDolGlobalString('MAIN_MAX_DECIMALS_TOT'); + $nbdecimal = getDolGlobalInt('MAIN_MAX_DECIMALS_TOT'); } elseif ($forcerounding >= 0) { $nbdecimal = $forcerounding; } @@ -11958,7 +11958,7 @@ function dol_mimetype($file, $default = 'application/octet-stream', $mode = 0) $mime = 'video'; $imgmime = 'video.png'; $famime = 'file-video'; - } elseif (preg_match('/\.(zip|rar|gz|tgz|z|cab|bz2|7z|tar|lzh|zst)$/i', $tmpfile)) { // Archive + } elseif (preg_match('/\.(zip|rar|gz|tgz|xz|z|cab|bz2|7z|tar|lzh|zst)$/i', $tmpfile)) { // Archive // application/xxx where zzz is zip, ... $mime = 'archive'; $imgmime = 'archive.png'; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index d0b5c98e64b..1a6541a18c1 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -270,6 +270,8 @@ if (empty($reshook)) { $num = count($objectsrc->lines); $totalqty = 0; + $product_batch_used = array(); + for ($i = 0; $i < $num; $i++) { $idl = "idl".$i; @@ -307,11 +309,17 @@ if (empty($reshook)) { //var_dump($sub_qty[$j]['id_batch']); //var_dump($qty);var_dump($batch);var_dump($sub_qty[$j]['q']);var_dump($sub_qty[$j]['id_batch']); - if ($is_batch_or_serial == 2 && $sub_qty[$j]['q'] > 1) { + if ($is_batch_or_serial == 2 && ($sub_qty[$j]['q'] > 1 || ($sub_qty[$j]['q'] > 0 && in_array($sub_qty[$j]['id_batch'], $product_batch_used)))) { setEventMessages($langs->trans("TooManyQtyForSerialNumber", $product->ref, ''), null, 'errors'); $totalqty = 0; break 2; } + + if ($is_batch_or_serial == 2 && $sub_qty[$j]['q'] > 0) { + // we stock the batch id to test later if the same serial is shipped on another line for the same product + $product_batch_used[$j] = $sub_qty[$j]['id_batch']; + } + $j++; $batch = "batchl".$i."_".$j; $qty = "qtyl".$i.'_'.$j; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 8dd6cd6fe21..461b4abc2a2 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1734,7 +1734,9 @@ if ($action == 'create') { } // Delete + print '
'; print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete); + print '
'; } } } diff --git a/htdocs/langs/en_US/stripe.lang b/htdocs/langs/en_US/stripe.lang index 29b5c893eb7..1ed54885735 100644 --- a/htdocs/langs/en_US/stripe.lang +++ b/htdocs/langs/en_US/stripe.lang @@ -22,7 +22,7 @@ ToOfferALinkForOnlinePaymentOnContractLine=URL to offer a %s online payment page ToOfferALinkForOnlinePaymentOnFreeAmount=URL to offer a %s online payment page of any amount with no existing object ToOfferALinkForOnlinePaymentOnMemberSubscription=URL to offer a %s online payment page for a member subscription ToOfferALinkForOnlinePaymentOnDonation=URL to offer a %s online payment page for payment of a donation -YouCanAddTagOnUrl=You can also add url parameter &tag=value to any of those URL (mandatory only for payment not linked to an object) to add your own payment comment tag.
For the URL of payments with no existing object, you may also add the parameter &noidempotency=1 so the same link with same tag can be used several times (some payment mode may limit the payment to 1 for each different link without this parameter) +YouCanAddTagOnUrl=You can also add url parameter &tag=value to any of those URL (mandatory only for payment not linked to an object) to add your own payment comment tag.
For the URL of payments with no existing object, you may also add the parameter &noidempotency=1 so the same link with same tag can be used several times (some payment mode may limit the payment to 1 for each different link without this parameter) YouCanEmbedOnWebsite=If you want to integrate the payment page into a Dolibarr website, you can include the parameter: &ws=website_ref.
Additionally, two pages named paymentok and paymentko must be created in the website to receive the redirect after a successful of failed online payment. SetupStripeToHavePaymentCreatedAutomatically=Setup your Stripe with url %s to have payment created automatically when validated by Stripe. AccountParameter=Account parameters diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index ffb64293935..8e1efb1c773 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -661,7 +661,7 @@ if ($action == 'confirm_generateinvoice') { // Update lineid into line of timespent $sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id); - $sql .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $toselect)).') AND fk_user = '.((int) $userid); + $sql .= ' WHERE rowid = '.((int) $timespent_id).' AND fk_user = '.((int) $userid); $result = $db->query($sql); if (!$result) { $error++; diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index 4bca4aa3d5a..ec865d4c331 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -57,6 +57,10 @@ div.tabsAction > div.divButAction > a.butActionRefused { margin-bottom: 1.4em !important; margin-right: 0px !important; } +.divButAction { + padding: 0 !important; + margin: 0 !important; +} div.tabsActionNoBottom > a.butAction, div.tabsActionNoBottom > a.butActionRefused { margin-bottom: 0 !important; } @@ -78,7 +82,9 @@ span.butAction, span.butActionDelete { :not(.center) > .butActionRefused:last-child, :not(.center) > .butAction:last-child, :not(.center) > .butActionDelete:last-child { margin-: 0px !important; } -.butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active { +.butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, +.divButAction + { text-decoration: none; text-transform: uppercase; font-weight: bold;