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

This commit is contained in:
Laurent Destailleur 2020-10-06 13:18:58 +02:00
commit 254d9edbb9
8 changed files with 21 additions and 20 deletions

View File

@ -9,7 +9,7 @@
* Copyright (C) 2014-2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -1192,7 +1192,7 @@ if ($action == 'create')
// Other attributes
if (empty($reshook)) {
print $object->showOptionals($extrafields, 'edit', $parameters);
print $object->showOptionals($extrafields, 'create', $parameters);
}
print "</table>\n";

View File

@ -105,7 +105,7 @@ class box_commandes extends ModeleBoxes
$sql .= ", ".MAIN_DB_PREFIX."commande as c";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE c.fk_soc = s.rowid";
$sql .= " AND c.entity = ".$conf->entity;
$sql .= " AND c.entity IN (".getEntity('commande').")";
if (!empty($conf->global->ORDER_BOX_LAST_ORDERS_VALIDATED_ONLY)) $sql .= " AND c.fk_statut = 1";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;

View File

@ -91,7 +91,7 @@ class box_propales extends ModeleBoxes
$sql .= ", ".MAIN_DB_PREFIX."propal as p";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE p.fk_soc = s.rowid";
$sql .= " AND p.entity = ".$conf->entity;
$sql .= " AND p.entity IN (".getEntity('propal').")";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql .= " ORDER BY p.datep DESC, p.ref DESC ";

View File

@ -104,7 +104,7 @@ class box_shipments extends ModeleBoxes
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid AND el.sourcetype IN ('commande') AND el.targettype = 'shipping'";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc";
$sql .= " WHERE e.entity = ".$conf->entity;
$sql .= " WHERE e.entity IN (".getEntity('expedition').")";
if (!empty($conf->global->ORDER_BOX_LAST_SHIPMENTS_VALIDATED_ONLY)) $sql .= " AND e.fk_statut = 1";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND sc.fk_user = ".$user->id;
else $sql .= " ORDER BY e.date_delivery, e.ref DESC ";

View File

@ -95,7 +95,7 @@ class box_supplier_orders extends ModeleBoxes
$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as c";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE c.fk_soc = s.rowid";
$sql .= " AND c.entity = ".$conf->entity;
$sql .= " AND c.entity IN (".getEntity('supplier_order').")";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql .= " ORDER BY c.date_commande DESC, c.ref DESC ";

View File

@ -95,8 +95,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as c";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE c.fk_soc = s.rowid";
$sql .= " AND c.entity = ".$conf->entity;
$sql .= " AND c.entity IN (".getEntity('supplier_order').")";
$sql .= " AND c.fk_statut = ".CommandeFournisseur::STATUS_ORDERSENT;
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;

View File

@ -157,7 +157,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
*/
function show_array_actions_to_do($max = 5)
{
global $langs, $conf, $user, $db, $bc, $socid;
global $langs, $conf, $user, $db, $socid;
$now = dol_now();
@ -171,7 +171,7 @@ function show_array_actions_to_do($max = 5)
$sql .= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE a.entity = ".$conf->entity;
$sql .= " WHERE a.entity IN (".getEntity('agenda').")";
$sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($socid) $sql .= " AND s.rowid = ".$socid;
@ -256,7 +256,7 @@ function show_array_actions_to_do($max = 5)
*/
function show_array_last_actions_done($max = 5)
{
global $langs, $conf, $user, $db, $bc, $socid;
global $langs, $conf, $user, $db, $socid;
$now = dol_now();
@ -267,7 +267,7 @@ function show_array_last_actions_done($max = 5)
$sql .= " ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action ";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE a.entity = ".$conf->entity;
$sql .= " WHERE a.entity IN (".getEntity('agenda').")";
$sql .= " AND (a.percent >= 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($socid) $sql .= " AND s.rowid = ".$socid;

View File

@ -312,20 +312,22 @@ if (! empty($usemargins) && $user->rights->margins->creer)
?>
/* Some js test when we click on button "Add" */
jQuery(document).ready(function() {
<?php
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { ?>
<?php
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) {
?>
$("input[name='np_marginRate']:first").blur(function(e) {
return checkFreeLine(e, "np_marginRate");
});
<?php
}
if (! empty($conf->global->DISPLAY_MARK_RATES)) { ?>
<?php
}
if (! empty($conf->global->DISPLAY_MARK_RATES)) {
?>
$("input[name='np_markRate']:first").blur(function(e) {
return checkFreeLine(e, "np_markRate");
});
<?php
}
?>
<?php
}
?>
});
/* TODO This does not work for number with thousand separator that is , */