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

This commit is contained in:
Laurent Destailleur 2023-01-06 16:55:41 +01:00
commit ba08457171
9 changed files with 37 additions and 18 deletions

View File

@ -306,7 +306,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
$parameters = array('socid'=>$socid);
$parameters = array('socid'=>$socid, 'arrayfields'=>&$arrayfields);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');

View File

@ -236,7 +236,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
$parameters = array('socid'=>$socid);
$parameters = array('socid'=>$socid, 'arrayfields'=>&$arrayfields);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');

View File

@ -299,7 +299,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
$parameters = array('socid'=>$socid);
$parameters = array('socid'=>$socid, 'arrayfields'=>&$arrayfields);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');

View File

@ -280,9 +280,6 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<div class="div-table-responsive-no-min">'."\n";
print '<table class="tagtable nobottomiftotal liste">';
//print '<tr class="liste_titre_filter">';
//print '</tr>';
print '<tr class="liste_titre">';
print_liste_field_titre($arrayfields['thirdparty']['label'], $_SERVER["PHP_SELF"], "thirdparty_name", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($arrayfields['contact']['label'], $_SERVER["PHP_SELF"], "contact_name", "", $param, "", $sortfield, $sortorder);
@ -316,7 +313,17 @@ foreach ($list as $entry) {
print "</tr>";
}
if (empty($list)) {
$colspan = 5 + ($permission ? 1 : 0);
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">';
if (is_object($object) && !empty($object->thirdparty)) {
print $form->textwithpicto($langs->trans("NoSpecificContactAddress"), $langs->trans("NoSpecificContactAddressBis"));
} else {
print $langs->trans("NoSpecificContactAddress");
}
print '</span>';
print '</td></tr>';
}
print "</table>";
print '</div>';

View File

@ -292,7 +292,8 @@ if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
}
}
$tooltiponprice .= '<br>'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->total_ttc);
$tooltiponprice .= '<span class="classfortooltip" title="'.dol_escape_htmltag($tooltiponprice).'">';
$tooltiponprice = '<span class="classfortooltip" title="'.dol_escape_htmltag($tooltiponprice).'">';
$tooltiponpriceend = '</span>';
}

View File

@ -68,7 +68,7 @@ $hookmanager->initHooks(array('ordersupplierdispatch'));
// Recuperation de l'id de projet
$projectid = 0;
if ($_GET["projectid"]) {
if (GETPOSTISSET("projectid")) {
$projectid = GETPOST("projectid", 'int');
}
@ -782,7 +782,8 @@ if ($id > 0 || !empty($ref)) {
if (!$objp->fk_product > 0) {
$nbfreeproduct++;
} else {
$remaintodispatch = price2num($objp->qty - ((float) $products_dispatched[$objp->rowid]), 5); // Calculation of dispatched
$alreadydispatched = isset($products_dispatched[$objp->rowid])?$products_dispatched[$objp->rowid]:0;
$remaintodispatch = price2num($objp->qty - ((float) $alreadydispatched), 5); // Calculation of dispatched
if ($remaintodispatch < 0 && empty($conf->global->SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN)) {
$remaintodispatch = 0;
}
@ -799,7 +800,7 @@ if ($id > 0 || !empty($ref)) {
print '<!-- Line to dispatch '.$suffix.' -->'."\n";
// hidden fields for js function
print '<input id="qty_ordered'.$suffix.'" type="hidden" value="'.$objp->qty.'">';
print '<input id="qty_dispatched'.$suffix.'" type="hidden" value="'.(float) $products_dispatched[$objp->rowid].'">';
print '<input id="qty_dispatched'.$suffix.'" type="hidden" value="'.(float) $alreadydispatched.'">';
print '<tr class="oddeven">';
if (empty($conf->cache['product'][$objp->fk_product])) {
@ -860,7 +861,7 @@ if ($id > 0 || !empty($ref)) {
print '<td class="right">'.$objp->qty.'</td>';
// Already dispatched
print '<td class="right">'.$products_dispatched[$objp->rowid].'</td>';
print '<td class="right">'.$alreadydispatched.'</td>';
if (isModEnabled('productbatch') && $objp->tobatch > 0) {
$type = 'batch';

View File

@ -1211,3 +1211,6 @@ CreatedByPublicPortal=Created from Public portal
UserAgent=User Agent
InternalUser=Internal user
ExternalUser=External user
NoSpecificContactAddress=No specific contact or address
NoSpecificContactAddressBis=This tab is dedicated to force specific contacts or addresses for the current object. Use it only if you want to define one or several specific contacts or addresses for the object when the information on the thirdparty is not enough or not accurate.

View File

@ -7,7 +7,7 @@ has to offer for module development.
If you don't need to develop your own module/application, you just don't need this.
After enabling this module, you should find features to generate or edit modules/application from menu *Home - Admin tools - Module builder*
After enabling this module, you should find features to generate or edit modules/application from menu *Home - Tools - Module builder*
Documentation
-------------

View File

@ -658,18 +658,25 @@ if ($action == 'create' && $permissiontoadd) {
print '<script>';
print '$( document ).ready(function() {';
print '$("#updateAmountWithLastSalary").on("click", function updateAmountWithLastSalary() {
console.log("We click on link to autofill salary amount");
var fk_user = $("#fk_user").val()
var url = "'.DOL_URL_ROOT.'/salaries/ajax/ajaxsalaries.php?fk_user="+fk_user;
console.log("We click on link to autofill salary amount url="+url);
if (fk_user != -1) {
$.get(
url,
function( data ) {
if(data!=null) {
console.log("Data returned: "+data);
item = JSON.parse(data);
if(item[0].key == "Amount") {
console.log("Data returned: "+data);
if (data != null) {
if (typeof data == "object") {
console.log("data is already type object, no need to parse it");
item = data;
} else {
console.log("data is type "+(typeof data));
item = JSON.parse(data);
}
if (item[0].key == "Amount") {
value = item[0].value;
console.log("amount returned = "+value);
if (value != null) {
$("#amount").val(item[0].value);
} else {