forked from Wavyzz/dolibarr
Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 21.0
This commit is contained in:
@@ -204,6 +204,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 "&"
|
||||
|
||||
@@ -2326,7 +2326,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);
|
||||
}
|
||||
|
||||
@@ -73,6 +73,16 @@ class Mailing extends CommonObject
|
||||
*/
|
||||
public $evenunsubscribe;
|
||||
|
||||
/**
|
||||
* @var string Text content for public notes
|
||||
*/
|
||||
public $note_public;
|
||||
|
||||
/**
|
||||
* @var string Text content for private notes
|
||||
*/
|
||||
public $note_private;
|
||||
|
||||
/**
|
||||
* @var int number of email
|
||||
*/
|
||||
@@ -300,6 +310,8 @@ class Mailing extends CommonObject
|
||||
$sql .= ", bgcolor = '".($this->bgcolor ? $this->db->escape($this->bgcolor) : null)."'";
|
||||
$sql .= ", bgimage = '".($this->bgimage ? $this->db->escape($this->bgimage) : null)."'";
|
||||
$sql .= ", evenunsubscribe = ".((int) $this->evenunsubscribe);
|
||||
$sql .= ", note_public = '".$this->db->escape($this->note_public)."'";
|
||||
$sql .= ", note_private = '".$this->db->escape($this->note_private)."'";
|
||||
$sql .= " WHERE rowid = ".(int) $this->id;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
@@ -344,6 +356,7 @@ class Mailing extends CommonObject
|
||||
public function fetch($rowid, $ref = '')
|
||||
{
|
||||
$sql = "SELECT m.rowid, m.messtype, m.titre as title, m.sujet, m.body, m.bgcolor, m.bgimage, m.evenunsubscribe";
|
||||
$sql .= ", m.note_public, m.note_private";
|
||||
$sql .= ", m.email_from, m.email_replyto, m.email_errorsto";
|
||||
$sql .= ", m.statut as status, m.nbemail";
|
||||
$sql .= ", m.fk_user_creat, m.fk_user_valid";
|
||||
@@ -385,6 +398,8 @@ class Mailing extends CommonObject
|
||||
$this->bgcolor = $obj->bgcolor;
|
||||
$this->bgimage = $obj->bgimage;
|
||||
$this->evenunsubscribe = $obj->evenunsubscribe;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->note_private = $obj->note_private;
|
||||
|
||||
$this->email_from = $obj->email_from;
|
||||
$this->email_replyto = $obj->email_replyto;
|
||||
@@ -452,6 +467,8 @@ class Mailing extends CommonObject
|
||||
$object->bgcolor = '';
|
||||
$object->bgimage = '';
|
||||
$object->evenunsubscribe = 0;
|
||||
$object->note_public = '';
|
||||
$object->note_private = '';
|
||||
|
||||
//$object->email_from = ''; // We do not reset from email because it is a mandatory value
|
||||
$object->email_replyto = '';
|
||||
|
||||
@@ -103,7 +103,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";
|
||||
@@ -163,7 +163,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"',
|
||||
@@ -192,7 +192,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";
|
||||
@@ -249,7 +249,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"',
|
||||
@@ -277,7 +277,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";
|
||||
@@ -334,7 +334,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
|
||||
@@ -358,7 +358,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";
|
||||
@@ -407,7 +407,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"',
|
||||
|
||||
@@ -173,7 +173,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(
|
||||
|
||||
@@ -302,6 +302,7 @@ class modBom extends DolibarrModules
|
||||
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'bom_bom as t';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bom_bom_extrafields as extra on (t.rowid = extra.fk_object)';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bom_bomline as tl ON tl.fk_bom = t.rowid';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bom_bomline_extrafields as extraline ON tl.rowid = extraline.fk_object';
|
||||
$this->export_sql_end[$r] .= ' WHERE 1 = 1';
|
||||
$this->export_sql_end[$r] .= ' AND t.entity IN ('.getEntity('bom').')';
|
||||
$r++;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2025 William Mead <william@m34d.com>
|
||||
*
|
||||
* 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,8 +69,7 @@ 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
|
||||
@@ -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)
|
||||
|
||||
@@ -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));
|
||||
$normalizeHeaders = [];
|
||||
foreach ($headers as $key => $val) {
|
||||
$val = ucfirst(strtolower($key)) . ': ' . $val;
|
||||
$normalizeHeaders[$key] = $val;
|
||||
}
|
||||
);
|
||||
|
||||
return $normalizeHeaders;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.');
|
||||
|
||||
@@ -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.');
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -735,7 +735,7 @@ function activitytrim($product_type)
|
||||
$yearofbegindate = (int) 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').")";
|
||||
@@ -797,19 +797,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++;
|
||||
|
||||
Reference in New Issue
Block a user