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

This commit is contained in:
Laurent Destailleur 2024-03-03 20:59:45 +01:00
commit 8930bf83a9
7 changed files with 22 additions and 14 deletions

View file

@ -5,7 +5,7 @@
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.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
@ -75,7 +75,7 @@ class ActionComm extends CommonObject
public $id;
/**
* @var int Id of the event. Use $id as possible
* @var string Id of the event. Use $id as possible
*/
public $ref;
@ -614,7 +614,8 @@ class ActionComm extends CommonObject
dol_syslog(get_class($this)."::add", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$this->ref = $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."actioncomm", "id");
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."actioncomm", "id");
$this->ref = (string) $this->id;
$sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm SET ref='".$this->db->escape($this->ref)."' WHERE id=".$this->id;
$resql = $this->db->query($sql);
if (!$resql) {

View file

@ -7,7 +7,7 @@
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2020 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>

View file

@ -3,6 +3,7 @@
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2023 Nick Fragoulis
* Copyright (C) 2024 Frédéric France <frederic.france@free.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

View file

@ -5720,7 +5720,7 @@ function print_liste_field_titre($name, $file = "", $field = "", $begin = "", $m
* @param string $sortfield Current field used to sort (Ex: 'd.datep,d.id')
* @param string $sortorder Current sort order (Ex: 'asc,desc')
* @param string $prefix Prefix for css. Use space after prefix to add your own CSS tag, for example 'mycss '.
* @param string $disablesortlink 1=Disable sort link
* @param int $disablesortlink 1=Disable sort link
* @param string $tooltip Tooltip
* @param int $forcenowrapcolumntitle No need for use 'wrapcolumntitle' css style
* @return string
@ -6546,7 +6546,7 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round
* @return mixed 0 if not found, localtax rate if found
* @see get_default_tva()
*/
function get_localtax($vatrate, $local, $thirdparty_buyer = "", $thirdparty_seller = "", $vatnpr = 0)
function get_localtax($vatrate, $local, $thirdparty_buyer = null, $thirdparty_seller = null, $vatnpr = 0)
{
global $db, $conf, $mysoc;

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.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
@ -306,7 +307,7 @@ class DataPolicy
if ($resultmail) {
$resultmasssend .= $langs->trans("MailSent").': '.$sendto."<br>";
$societe->array_options['options_datapolicy_send'] = date('Y-m-d', time());
$societe->update($societe->id);
$societe->update($societe->id, $user);
} else {
dol_print_error($db);
}

View file

@ -4,7 +4,7 @@
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
*
@ -315,7 +315,10 @@ if (empty($reshook) && $action == 'add') {
$company->name_alias = dolGetFirstLastname(GETPOST('firstname'), GETPOST('lastname'));
}
$company->update(0);
$res = $company->update(0, $user);
if ($res < 0) {
setEventMessages($company->error, $company->errors, 'errors');
}
}
// Fill array 'array_options' with data from add form

View file

@ -1347,7 +1347,7 @@ class Societe extends CommonObject
* @param int $nosyncmember Do not synchronize info of linked member
* @return int Return integer <0 if KO, >=0 if OK
*/
public function update($id, $user = '', $call_trigger = 1, $allowmodcodeclient = 0, $allowmodcodefournisseur = 0, $action = 'update', $nosyncmember = 1)
public function update($id, User $user, $call_trigger = 1, $allowmodcodeclient = 0, $allowmodcodefournisseur = 0, $action = 'update', $nosyncmember = 1)
{
global $langs, $conf, $hookmanager;
@ -2490,9 +2490,9 @@ class Societe extends CommonObject
* @param string $filter Other filter
* @param integer $maxvalue Filter on max value for discount
* @param int $discount_type 0 => customer discount, 1 => supplier discount
* @return int Return integer <0 if KO, Credit note amount otherwise
* @return int Return integer <0 if KO, Credit note amount otherwise
*/
public function getAvailableDiscounts($user = '', $filter = '', $maxvalue = 0, $discount_type = 0)
public function getAvailableDiscounts($user = null, $filter = '', $maxvalue = 0, $discount_type = 0)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
@ -3391,7 +3391,7 @@ class Societe extends CommonObject
* @param int $type Should be 0 to say customer
* @return void
*/
public function get_codeclient($objsoc = 0, $type = 0)
public function get_codeclient($objsoc = null, $type = 0)
{
// phpcs:enable
global $conf;
@ -3405,6 +3405,7 @@ class Societe extends CommonObject
break;
}
}
/** @var ModeleThirdPartyCode $mod */
$mod = new $module($this->db);
$this->code_client = $mod->getNextValue($objsoc, $type);
@ -3423,7 +3424,7 @@ class Societe extends CommonObject
* @param int $type Should be 1 to say supplier
* @return void
*/
public function get_codefournisseur($objsoc = 0, $type = 1)
public function get_codefournisseur($objsoc = null, $type = 1)
{
// phpcs:enable
global $conf;
@ -3437,6 +3438,7 @@ class Societe extends CommonObject
break;
}
}
/** @var ModeleThirdPartyCode $mod */
$mod = new $module($this->db);
$this->code_fournisseur = $mod->getNextValue($objsoc, $type);