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

This commit is contained in:
Laurent Destailleur 2023-05-03 02:40:32 +02:00
commit a1d6e55189
3 changed files with 19 additions and 5 deletions

View File

@ -222,6 +222,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position'); $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position');
$error = 0;
/* /*
@ -513,6 +514,7 @@ if (empty($reshook)) {
} else { } else {
$lineid = 0; $lineid = 0;
$error++; $error++;
$errors[] = $objecttmp->error;
break; break;
} }
// Defined the new fk_parent_line // Defined the new fk_parent_line

View File

@ -752,7 +752,7 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto
$arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'\.pdf$'; $arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'\.pdf$';
} }
foreach ($listofobjectref as $tmppdf) { foreach ($listofobjectref as $tmppdf) {
$arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9\-\_\']+\.pdf$'; // To include PDF generated from ODX files $arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9\-\_\'\&\.]+\.pdf$'; // To include PDF generated from ODX files
} }
$listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, true); $listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, true);

View File

@ -2612,10 +2612,22 @@ if ($action == 'create') {
,async:false ,async:false
,dataType:"json" ,dataType:"json"
,success:function(response) { ,success:function(response) {
if (response.response_status == "success"){ if (response.response_status == "success"){';
jQuery("#value_unit_ht").val(response.data);
jQuery("#value_unit_ht").trigger("change"); if (!empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY)) {
jQuery("#value_unit").val(""); print '
jQuery("#value_unit").val(parseFloat(response.data) * (100 + parseFloat(tva)) / 100);
jQuery("#value_unit").trigger("change");
';
} else {
print '
jQuery("#value_unit_ht").val(response.data);
jQuery("#value_unit_ht").trigger("change");
jQuery("#value_unit").val("");
';
}
print '
} else if(response.response_status == "error" && response.errorMessage != undefined && response.errorMessage.length > 0 ){ } else if(response.response_status == "error" && response.errorMessage != undefined && response.errorMessage.length > 0 ){
$.jnotify(response.errorMessage, "error", {timeout: 0, type: "error"},{ remove: function (){} } ); $.jnotify(response.errorMessage, "error", {timeout: 0, type: "error"},{ remove: function (){} } );
} }