diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index f7f53f34140..61c152f0d01 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -199,6 +199,9 @@ if (empty($reshook)) { $filter['t.reconciled_option'] = $search_not_reconciled; $param .= '&search_not_reconciled='.urlencode($search_not_reconciled); } + if (!empty($show_subgroup)) { + $param .= '&show_subgroup='.urlencode($show_subgroup); + } // param with type of list $url_param = substr($param, 1); // remove first "&" diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index f8a90cb0381..c101a68115a 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -2322,7 +2322,7 @@ class BookKeeping extends CommonObject dol_syslog(get_class($this)."::select_account", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { - $obj = ''; + $obj = (object) array('label' => ''); if ($this->db->num_rows($resql)) { $obj = $this->db->fetch_object($resql); } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 70a7656fa0b..3d8a670b693 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3233,7 +3233,7 @@ class Commande extends CommonOrder $this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]; $this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]; $this->line->remise_percent = $remise_percent; - $this->line->subprice = $pu_ht; + $this->line->subprice = (float) $pu_ht; $this->line->info_bits = $info_bits; $this->line->special_code = $special_code; $this->line->total_ht = $total_ht; diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 3c8d2ce6a83..d6dec3060a7 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -102,7 +102,7 @@ class box_activity extends ModeleBoxes $data = array(); - $sql = "SELECT p.fk_statut, SUM(p.total_ttc) as Mnttot, COUNT(*) as nb"; + $sql = "SELECT p.fk_statut, SUM(p.total_ttc) as mnttot, COUNT(*) as nb"; $sql .= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; if (empty($user->socid) && !$user->hasRight('societe', 'client', 'voir')) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -162,7 +162,7 @@ class box_activity extends ModeleBoxes $this->info_box_contents[$line][3] = array( 'td' => 'class="nowraponall right amount"', - 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency), + 'text' => price($data[$j]->mnttot, 1, $langs, 0, 0, -1, $conf->currency), ); $this->info_box_contents[$line][4] = array( 'td' => 'class="right" width="18"', @@ -191,7 +191,7 @@ class box_activity extends ModeleBoxes $data = array(); - $sql = "SELECT c.fk_statut, sum(c.total_ttc) as Mnttot, count(*) as nb"; + $sql = "SELECT c.fk_statut, sum(c.total_ttc) as mnttot, count(*) as nb"; $sql .= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; if (empty($user->socid) && !$user->hasRight('societe', 'client', 'voir')) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -248,7 +248,7 @@ class box_activity extends ModeleBoxes $this->info_box_contents[$line][3] = array( 'td' => 'class="nowraponall right amount"', - 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency), + 'text' => price($data[$j]->mnttot, 1, $langs, 0, 0, -1, $conf->currency), ); $this->info_box_contents[$line][4] = array( 'td' => 'class="right" width="18"', @@ -276,7 +276,7 @@ class box_activity extends ModeleBoxes // part 1 $data = array(); - $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; + $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as mnttot, COUNT(*) as nb"; $sql .= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; if (empty($user->socid) && !$user->hasRight('societe', 'client', 'voir')) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -333,7 +333,7 @@ class box_activity extends ModeleBoxes $this->info_box_contents[$line][3] = array( 'td' => 'class="nowraponall right amount"', - 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency) + 'text' => price($data[$j]->mnttot, 1, $langs, 0, 0, -1, $conf->currency) ); // We add only for the current year @@ -357,7 +357,7 @@ class box_activity extends ModeleBoxes // part 2 $data = array(); - $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; + $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as mnttot, COUNT(*) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; $sql .= " WHERE f.entity IN (".getEntity('invoice').')'; $sql .= " AND f.fk_soc = s.rowid"; @@ -406,7 +406,7 @@ class box_activity extends ModeleBoxes $totalnb += $data[$j]->nb; $this->info_box_contents[$line][3] = array( 'td' => 'class="nowraponall right amount"', - 'text' => price($data[$j]->Mnttot, 1, $langs, 0, 0, -1, $conf->currency), + 'text' => price($data[$j]->mnttot, 1, $langs, 0, 0, -1, $conf->currency), ); $this->info_box_contents[$line][4] = array( 'td' => 'class="right" width="18"', diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index 8732e7d49f0..d7440a0e6b7 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -169,7 +169,7 @@ class box_validated_projects extends ModeleBoxes $this->info_box_contents[$i][] = array( 'td' => 'class="center"', - 'text' => $objp->startDate, + 'text' => $objp->startdate, ); $this->info_box_contents[$i][] = array( diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index 08697cc34c2..768d824da4a 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -1,6 +1,7 @@ +/* Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2025 William Mead * * 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 @@ -68,13 +69,12 @@ class Interventions extends DolibarrApi } /** - * Get properties of a Expense Report object - * Return an array with Expense Report information + * Get properties of an intervention object * * @param int $id ID of Expense Report * @return Object Object with cleaned properties * - * @throws RestException + * @throws RestException */ public function get($id) { @@ -298,9 +298,9 @@ class Interventions extends DolibarrApi } /** - * Delete order + * Delete intervention * - * @param int $id Order ID + * @param int $id Intervention ID * @return array */ public function delete($id) diff --git a/htdocs/includes/OAuth/Common/Http/Client/AbstractClient.php b/htdocs/includes/OAuth/Common/Http/Client/AbstractClient.php index 94000b18ce6..3fac83ed7da 100644 --- a/htdocs/includes/OAuth/Common/Http/Client/AbstractClient.php +++ b/htdocs/includes/OAuth/Common/Http/Client/AbstractClient.php @@ -59,15 +59,14 @@ abstract class AbstractClient implements ClientInterface /** * @param array $headers */ - public function normalizeHeaders(&$headers) + public function normalizeHeaders($headers) { - // Normalize headers - array_walk( - $headers, - function (&$val, &$key) { - $key = ucfirst(strtolower($key)); - $val = ucfirst(strtolower($key)) . ': ' . $val; - } - ); + $normalizeHeaders = []; + foreach ($headers as $key => $val) { + $val = ucfirst(strtolower($key)) . ': ' . $val; + $normalizeHeaders[$key] = $val; + } + + return $normalizeHeaders; } } diff --git a/htdocs/includes/OAuth/Common/Http/Client/CurlClient.php b/htdocs/includes/OAuth/Common/Http/Client/CurlClient.php index eae1be3ed05..39650396fc1 100644 --- a/htdocs/includes/OAuth/Common/Http/Client/CurlClient.php +++ b/htdocs/includes/OAuth/Common/Http/Client/CurlClient.php @@ -70,7 +70,7 @@ class CurlClient extends AbstractClient // Normalize method name $method = strtoupper($method); - $this->normalizeHeaders($extraHeaders); + $extraHeaders = $this->normalizeHeaders($extraHeaders); if ($method === 'GET' && !empty($requestBody)) { throw new \InvalidArgumentException('No body expected for "GET" request.'); diff --git a/htdocs/includes/OAuth/Common/Http/Client/StreamClient.php b/htdocs/includes/OAuth/Common/Http/Client/StreamClient.php index 9849afd4a32..204835dd380 100644 --- a/htdocs/includes/OAuth/Common/Http/Client/StreamClient.php +++ b/htdocs/includes/OAuth/Common/Http/Client/StreamClient.php @@ -33,7 +33,7 @@ class StreamClient extends AbstractClient // Normalize method name $method = strtoupper($method); - $this->normalizeHeaders($extraHeaders); + $extraHeaders = $this->normalizeHeaders($extraHeaders); if ($method === 'GET' && !empty($requestBody)) { throw new \InvalidArgumentException('No body expected for "GET" request.'); diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index 95fa45588a6..85de82ca750 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -41,12 +41,12 @@ -- VMYSQL4.3 ALTER TABLE llx_c_payment_term ADD PRIMARY KEY(rowid); -- VMYSQL4.3 ALTER TABLE llx_c_payment_term CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; --- VPGSQL8.2 CREATE SEQUENCE __DATABASE__.llx_c_civility_rowid_seq OWNED BY llx_c_civility.rowid; +-- VPGSQL8.2 CREATE SEQUENCE llx_c_civility_rowid_seq OWNED BY llx_c_civility.rowid; -- VPGSQL8.2 ALTER TABLE llx_c_civility ADD PRIMARY KEY (rowid); -- VPGSQL8.2 ALTER TABLE llx_c_civility ALTER COLUMN rowid SET DEFAULT nextval('llx_c_civility_rowid_seq'); -- VPGSQL8.2 SELECT setval('llx_c_civility_rowid_seq', MAX(rowid)) FROM llx_c_civility; --- VPGSQL8.2 CREATE SEQUENCE __DATABASE__.llx_c_payment_term_rowid_seq OWNED BY llx_c_payment_term.rowid; +-- VPGSQL8.2 CREATE SEQUENCE llx_c_payment_term_rowid_seq OWNED BY llx_c_payment_term.rowid; -- VPGSQL8.2 ALTER TABLE llx_c_payment_term ADD PRIMARY KEY (rowid); -- VPGSQL8.2 ALTER TABLE llx_c_payment_term ALTER COLUMN rowid SET DEFAULT nextval('llx_c_payment_term_rowid_seq'); -- VPGSQL8.2 SELECT setval('llx_c_payment_term_rowid_seq', MAX(rowid)) FROM llx_c_payment_term; @@ -146,7 +146,7 @@ ALTER TABLE llx_societe_contacts DROP FOREIGN KEY fk_societe_contacts_fk_c_type_ -- VMYSQL4.3 ALTER TABLE llx_c_type_contact ADD PRIMARY KEY(rowid); -- VMYSQL4.3 ALTER TABLE llx_c_type_contact CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; --- VPGSQL8.2 CREATE SEQUENCE __DATABASE__.llx_c_type_contact_rowid_seq OWNED BY llx_c_type_contact.rowid; +-- VPGSQL8.2 CREATE SEQUENCE llx_c_type_contact_rowid_seq OWNED BY llx_c_type_contact.rowid; -- VPGSQL8.2 ALTER TABLE llx_c_type_contact ADD PRIMARY KEY (rowid); -- VPGSQL8.2 ALTER TABLE llx_c_type_contact ALTER COLUMN rowid SET DEFAULT nextval('llx_c_type_contact_rowid_seq'); -- VPGSQL8.2 SELECT setval('llx_c_type_contact_rowid_seq', MAX(rowid)) FROM llx_c_type_contact; diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index afea0fe18ab..b4dd2d6e0d2 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -180,7 +180,7 @@ ALTER TABLE llx_c_paiement DROP INDEX uk_c_paiement; ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement_code(entity, code); -- VMYSQL4.3 ALTER TABLE llx_c_paiement CHANGE COLUMN id id INTEGER AUTO_INCREMENT PRIMARY KEY; --- VPGSQL8.2 CREATE SEQUENCE __DATABASE__.llx_c_paiement_id_seq OWNED BY llx_c_paiement.id; +-- VPGSQL8.2 CREATE SEQUENCE llx_c_paiement_id_seq OWNED BY llx_c_paiement.id; -- VPGSQL8.2 ALTER TABLE llx_c_paiement ADD PRIMARY KEY (id); -- VPGSQL8.2 ALTER TABLE llx_c_paiement ALTER COLUMN id SET DEFAULT nextval('llx_c_paiement_id_seq'); -- VPGSQL8.2 SELECT setval('llx_c_paiement_id_seq', MAX(id)) FROM llx_c_paiement; @@ -190,7 +190,7 @@ ALTER TABLE llx_c_payment_term DROP INDEX uk_c_payment_term; ALTER TABLE llx_c_payment_term ADD UNIQUE INDEX uk_c_payment_term_code(entity, code); -- VMYSQL4.3 ALTER TABLE llx_c_payment_term CHANGE COLUMN rowid rowid INTEGER AUTO_INCREMENT PRIMARY KEY; --- VPGSQL8.2 CREATE SEQUENCE __DATABASE__.llx_c_payment_term_rowid_seq OWNED BY llx_c_payment_term.rowid; +-- VPGSQL8.2 CREATE SEQUENCE llx_c_payment_term_rowid_seq OWNED BY llx_c_payment_term.rowid; -- VPGSQL8.2 ALTER TABLE llx_c_payment_term ADD PRIMARY KEY (rowid); -- VPGSQL8.2 ALTER TABLE llx_c_payment_term ALTER COLUMN rowid SET DEFAULT nextval('llx_c_payment_term_rowid_seq'); -- VPGSQL8.2 SELECT setval('llx_c_payment_term_rowid_seq', MAX(rowid)) FROM llx_c_payment_term; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 7d77567519f..62e42a4ca03 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -726,7 +726,7 @@ function activitytrim($product_type) $yearofbegindate = date('Y', dol_time_plus_duree(time(), -3, "y")); $out = ''; // breakdown by quarter - $sql = "SELECT DATE_FORMAT(p.datep,'%Y') as annee, DATE_FORMAT(p.datep,'%m') as mois, SUM(fd.total_ht) as Mnttot"; + $sql = "SELECT DATE_FORMAT(p.datep,'%Y') as annee, DATE_FORMAT(p.datep,'%m') as mois, SUM(fd.total_ht) as mnttot"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd"; $sql .= " , ".MAIN_DB_PREFIX."paiement as p,".MAIN_DB_PREFIX."paiement_facture as pf"; $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; @@ -788,19 +788,19 @@ function activitytrim($product_type) } if ($objp->mois == "01" || $objp->mois == "02" || $objp->mois == "03") { - $trim1 += $objp->Mnttot; + $trim1 += $objp->mnttot; } if ($objp->mois == "04" || $objp->mois == "05" || $objp->mois == "06") { - $trim2 += $objp->Mnttot; + $trim2 += $objp->mnttot; } if ($objp->mois == "07" || $objp->mois == "08" || $objp->mois == "09") { - $trim3 += $objp->Mnttot; + $trim3 += $objp->mnttot; } if ($objp->mois == "10" || $objp->mois == "11" || $objp->mois == "12") { - $trim4 += $objp->Mnttot; + $trim4 += $objp->mnttot; } $i++;