Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop
This commit is contained in:
ldestailleur
2025-09-03 19:24:39 +02:00
7 changed files with 40 additions and 14 deletions

View File

@@ -335,6 +335,7 @@ foreach ($dirmodels as $reldir) {
$classname = "mod_facture_".$file;
}
// Check if there is a filter on country
$reg = array();
preg_match('/\-(.*)_(.*)$/', $classname, $reg);
if (!empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) {
continue;

View File

@@ -3030,19 +3030,22 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
$popuptab = 1;
$outmore .= '<div class="popuptabset wordwrap">'; // The css used to hide/show popup
}
$outmore .= '<div class="popuptab wordwrap" style="display:inherit;">';
$outmore_content = '';
if (isset($links[$i][2]) && $links[$i][2] == 'image') {
if (!empty($links[$i][0])) {
$outmore .= '<a class="tabimage' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">' . $links[$i][1] . '</a>' . "\n";
$outmore_content .= '<a class="tabimage'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">'.$links[$i][1].'</a>'."\n";
} else {
$outmore .= '<span class="tabspan">' . $links[$i][1] . '</span>' . "\n";
$outmore_content .= '<span class="tabspan">'.$links[$i][1].'</span>'."\n";
}
} elseif (!empty($links[$i][1])) {
$outmore .= '<a' . (!empty($links[$i][2]) ? ' id="' . $links[$i][2] . '"' : '') . ' class="wordwrap inline-block' . ($morecss ? ' ' . $morecss : '') . '" href="' . $links[$i][0] . '">';
$outmore .= preg_replace('/([a-z])\|([a-z])/i', '\\1 | \\2', $links[$i][1]); // Replace x|y with x | y to allow wrap on long composed texts.
$outmore .= '</a>' . "\n";
$outmore_content .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="wordwrap inline-block'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'">';
$outmore_content .= preg_replace('/([a-z])\|([a-z])/i', '\\1 | \\2', $links[$i][1]); // Replace x|y with x | y to allow wrap on long composed texts.
$outmore_content .= '</a>'."\n";
}
if ($outmore_content !== '') {
$outmore .= '<div class="popuptab wordwrap" style="display:inherit;">' . $outmore_content . '</div>';
}
$outmore .= '</div>';
$nbintab++;
}

View File

@@ -53,4 +53,5 @@ RestoreWithCurrentQtySaved=Fill quantities with latest saved values
ReceptionsRecorded=Receptions recorded
ReceptionUpdated=Reception successfully updated
ReceptionDistribution=Reception distribution
ReceptionMustBeInTheSameCurrencyThanOther=Reception have to be int the same currency than the other
AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation=Automatic validation is not possible when stock is decreased on invoice validation

View File

@@ -53,4 +53,5 @@ RestoreWithCurrentQtySaved=Remplir les quantités avec les dernières valeurs en
ReceptionsRecorded=Réceptions enregistrées
ReceptionUpdated=Réception mise à jour avec succès
ReceptionDistribution=Distribution de réception
ReceptionMustBeInTheSameCurrencyThanOther=Cette Reception n'est pas dans la même devise que les autres
AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation=La validation automatique n'est pas possible lorsque le stock est réduit sur facture validation

View File

@@ -382,7 +382,7 @@ if ($action == "correct_stock" && $permissiontoadd) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors');
$action = 'correction';
}
if (!is_numeric(GETPOST("nbpiece"))) {
if (!GETPOSTFLOAT("nbpiece")) {
$error++;
setEventMessages($langs->trans("ErrorFieldMustBeANumeric", $langs->transnoentitiesnoconv("NumberOfUnit")), null, 'errors');
$action = 'correction';
@@ -572,7 +572,7 @@ if ($action == "transfert_stock" && $permissiontoadd && !$cancel) {
$id,
GETPOSTFLOAT("nbpiece"),
1,
GETPOST("label", 'san_alpha'),
GETPOST("label", 'alphanohtml'),
(float) $pricesrc,
GETPOST('inventorycode', 'alphanohtml'),
'',
@@ -587,7 +587,7 @@ if ($action == "transfert_stock" && $permissiontoadd && !$cancel) {
GETPOSTINT("id_entrepot_destination"),
GETPOSTFLOAT("nbpiece"),
0,
GETPOST("label", 'san_alpha'),
GETPOST("label", 'alphanohtml'),
(float) $pricedest,
GETPOST('inventorycode', 'alphanohtml'),
'',

View File

@@ -1340,12 +1340,12 @@ foreach ($listofreferent as $key => $value) {
if (!empty($element->close_code) && $element->close_code == 'replaced') {
$qualifiedfortotal = false; // Replacement invoice, do not include into total
}
} elseif ($key == 'order_supplier' && $element->status == 7) {
} elseif ($key == 'order_supplier' && ($element->status == 6 || $element->status == 7)) {
$qualifiedfortotal = false; // It makes no sense to include canceled orders in the total
}
if ($key == "order_supplier" && $element->status == 7) {
print '<tr class="oddeven tr_canceled" style=display:none>';
if ($key == "order_supplier" && ($element->status == 6 || $element->status == 7)) {
print '<tr class="oddeven tr_canceled">';
} else {
print '<tr class="oddeven" >';
}

View File

@@ -276,6 +276,8 @@ if (empty($reshook)) {
$mode_reglement_id = 0;
$fk_account = 0;
$transport_mode_id = 0;
$multicurrency_code = null;
if (!empty($rcp->cond_reglement_id)) {
$cond_reglement_id = $rcp->cond_reglement_id;
}
@@ -288,11 +290,15 @@ if (empty($reshook)) {
if (!empty($rcp->transport_mode_id)) {
$transport_mode_id = $rcp->transport_mode_id;
}
if (!empty($rcp->multicurrency_code)) {
$multicurrency_code = $rcp->multicurrency_code;
}
if (empty($cond_reglement_id)
|| empty($mode_reglement_id)
|| empty($fk_account)
|| empty($transport_mode_id)
|| empty($multicurrency_code)
) {
if (!isset($rcp->supplier_order)) {
$rcp->fetch_origin();
@@ -313,6 +319,9 @@ if (empty($reshook)) {
if (empty($transport_mode_id) && !empty($supplierOrder->transport_mode_id)) {
$transport_mode_id = $supplierOrder->transport_mode_id;
}
if (empty($multicurrency_code) && !empty($supplierOrder->multicurrency_code)) {
$multicurrency_code = $supplierOrder->multicurrency_code;
}
}
// try get from third party of reception
@@ -330,6 +339,9 @@ if (empty($reshook)) {
if (empty($transport_mode_id) && !empty($soc->transport_mode_id)) {
$transport_mode_id = $soc->transport_mode_id;
}
if (empty($multicurrency_code) && !empty($soc->multicurrency_code)) {
$multicurrency_code = $soc->multicurrency_code;
}
}
}
@@ -340,6 +352,7 @@ if (empty($reshook)) {
$objecttmp->mode_reglement_id = $mode_reglement_id;
$objecttmp->fk_account = $fk_account;
$objecttmp->transport_mode_id = $transport_mode_id;
$objecttmp->multicurrency_code = $multicurrency_code;
// if the VAT reverse-charge is activated by default in supplier card to resume the information
if (is_object($soc)) {
@@ -397,6 +410,13 @@ if (empty($reshook)) {
}
if ($objecttmp->id > 0) {
if (!isset($rcp->origin_object)) {
$rcp->fetch_origin();
}
if ($rcp->origin_object->multicurrency_code != $objecttmp->multicurrency_code) {
$errors[] = $rcp->ref." : ".$langs->trans("ReceptionMustBeInTheSameCurrencyThanOther");
}
$res = $objecttmp->add_object_linked($objecttmp->origin, $id_reception);
if ($res == 0) {
@@ -506,7 +526,7 @@ if (empty($reshook)) {
array(),
null,
$lines[$i]->rowid,
0,
$lines[$i]->multicurrency_subprice,
$lines[$i]->ref_supplier
);