fix checkFunctionArgumentTypes (#30234)
* fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * add ignore * add ignore add ignore add ignore add ignore add ignore * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes * fix checkFunctionArgumentTypes
This commit is contained in:
parent
6dd25996c5
commit
2f5647e4e3
44 changed files with 290 additions and 178 deletions
|
|
@ -7,6 +7,7 @@
|
|||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
|
||||
* 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
|
||||
|
|
@ -92,7 +93,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|
|||
activateModulesRequiredByCountry($mysoc->country_code);
|
||||
}
|
||||
|
||||
$tmparray = getState(GETPOSTINT('state_id'), 'all', $db, $langs, 0);
|
||||
$tmparray = getState(GETPOSTINT('state_id'), 'all', $db, 0, $langs, 0);
|
||||
if (!empty($tmparray['id'])) {
|
||||
$mysoc->state_id = $tmparray['id'];
|
||||
$mysoc->state_code = $tmparray['code'];
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2023 Eric Seigne <eric.seigne@cap-rel.fr>
|
||||
* 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
|
||||
|
|
@ -57,7 +58,7 @@ $rawData = file_get_contents('php://input');
|
|||
$jsonData = json_decode($rawData, true);
|
||||
|
||||
if (is_null($jsonData)) {
|
||||
dol_print_error('data with format JSON valide.');
|
||||
dol_print_error($db, 'data with format JSON valide.');
|
||||
}
|
||||
$ai = new Ai($db);
|
||||
|
||||
|
|
|
|||
|
|
@ -1136,7 +1136,7 @@ class Commande extends CommonOrder
|
|||
$this->add_contact($objcontact->fk_socpeople, $objcontact->code, $objcontact->source); // May failed because of duplicate key or because code of contact type does not exists for new object
|
||||
}
|
||||
} else {
|
||||
dol_print_error($resqlcontact);
|
||||
dol_print_error($this->db, $resqlcontact);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
* Copyright (C) 2017 Patrick Delcroix <pmpdelcroix@gmail.com>
|
||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* 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
|
||||
|
|
@ -312,7 +313,7 @@ if (empty($numref)) {
|
|||
|
||||
// If not cash account and can be reconciliate
|
||||
if ($user->hasRight('banque', 'consolidate')) {
|
||||
$buttonreconcile = '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?action=reconcile&sortfield=b.datev,b.dateo,b.rowid&sortorder=asc,asc,asc&search_conciliated=0&search_account='.$id.$param.'">'.$titletoconciliatemanual.'</a>';
|
||||
$buttonreconcile = '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?action=reconcile&token='.newToken().'&sortfield=b.datev,b.dateo,b.rowid&sortorder=asc,asc,asc&search_conciliated=0&search_account='.$id.$param.'">'.$titletoconciliatemanual.'</a>';
|
||||
} else {
|
||||
$buttonreconcile = '<a class="butActionRefused classfortooltip" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$titletoconciliatemanual.'</a>';
|
||||
}
|
||||
|
|
@ -323,7 +324,7 @@ if (empty($numref)) {
|
|||
if ($user->hasRight('banque', 'consolidate')) {
|
||||
$newparam = $param;
|
||||
$newparam = preg_replace('/search_conciliated=\d+/i', '', $newparam);
|
||||
$buttonreconcile .= ' <a class="butAction" style="margin-bottom: 5px !important; margin-top: 5px !important" href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?action=reconcile&sortfield=b.datev,b.dateo,b.rowid&sortorder=asc,asc,asc&search_conciliated=0'.$newparam.'">'.$titletoconciliateauto.'</a>';
|
||||
$buttonreconcile .= ' <a class="butAction" style="margin-bottom: 5px !important; margin-top: 5px !important" href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?action=reconcile&token='.newToken().'&sortfield=b.datev,b.dateo,b.rowid&sortorder=asc,asc,asc&search_conciliated=0'.$newparam.'">'.$titletoconciliateauto.'</a>';
|
||||
} else {
|
||||
$buttonreconcile .= ' <a class="butActionRefused" style="margin-bottom: 5px !important; margin-top: 5px !important" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$titletoconciliateauto.'</a>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -776,7 +776,7 @@ class Facture extends CommonInvoice
|
|||
$this->add_contact($objcontact->fk_socpeople, $objcontact->code, $objcontact->source); // May failed because of duplicate key or because code of contact type does not exists for new object
|
||||
}
|
||||
} else {
|
||||
dol_print_error($resqlcontact);
|
||||
dol_print_error($this->db, $resqlcontact);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1135,7 +1135,7 @@ class Contrat extends CommonObject
|
|||
$this->add_contact($objcontact->fk_socpeople, $objcontact->code, $objcontact->source); // May failed because of duplicate key or because code of contact type does not exists for new object
|
||||
}
|
||||
} else {
|
||||
dol_print_error($resqlcontact);
|
||||
dol_print_error($this->db, $resqlcontact);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1731,7 +1731,7 @@ class Contrat extends CommonObject
|
|||
$localtaxes_type = getLocalTaxesFromRate($tvatx, 0, $this->societe, $mysoc);
|
||||
$tvatx = preg_replace('/\s*\(.*\)/', '', $tvatx); // Remove code into vatrate.
|
||||
|
||||
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtax1tx, $localtax2tx, 0, $price_base_type, $info_bits, 1, $mysoc, $localtaxes_type);
|
||||
$tabprice = calcul_price_total($qty, $pu, $remise_percent, (float) price2num($tvatx), $localtax1tx, $localtax2tx, 0, $price_base_type, $info_bits, 1, $mysoc, $localtaxes_type);
|
||||
$total_ht = $tabprice[0];
|
||||
$total_tva = $tabprice[1];
|
||||
$total_ttc = $tabprice[2];
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ abstract class CommonDocGenerator
|
|||
$mysoc->country = $outputlangs->transnoentitiesnoconv("Country".$mysoc->country_code);
|
||||
}
|
||||
if (empty($mysoc->state) && !empty($mysoc->state_code)) {
|
||||
$mysoc->state = getState($mysoc->state_code, 0);
|
||||
$mysoc->state = getState($mysoc->state_code, '0');
|
||||
}
|
||||
|
||||
$logotouse = $conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small;
|
||||
|
|
@ -365,7 +365,7 @@ abstract class CommonDocGenerator
|
|||
$object->country = $outputlangs->transnoentitiesnoconv("Country".$object->country_code);
|
||||
}
|
||||
if (empty($object->state) && !empty($object->state_code)) {
|
||||
$object->state = getState($object->state_code, 0);
|
||||
$object->state = getState($object->state_code, '0');
|
||||
}
|
||||
|
||||
$array_thirdparty = array(
|
||||
|
|
@ -431,7 +431,7 @@ abstract class CommonDocGenerator
|
|||
$object->country = $outputlangs->transnoentitiesnoconv("Country".$object->country_code);
|
||||
}
|
||||
if (empty($object->state) && !empty($object->state_code)) {
|
||||
$object->state = getState($object->state_code, 0);
|
||||
$object->state = getState($object->state_code, '0');
|
||||
}
|
||||
|
||||
$array_contact = array(
|
||||
|
|
|
|||
|
|
@ -877,7 +877,7 @@ class FormProjets extends Form
|
|||
}
|
||||
$out .= '</select>';
|
||||
} else {
|
||||
dol_print_error($this->db->lasterror);
|
||||
dol_print_error($this->db, $this->db->lasterror);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
|
@ -929,7 +929,7 @@ class FormProjets extends Form
|
|||
$out .= '</select>';
|
||||
}
|
||||
} else {
|
||||
dol_print_error($this->db->lasterror);
|
||||
dol_print_error($this->db, $this->db->lasterror);
|
||||
return '';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2011-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.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
|
||||
|
|
@ -290,9 +291,9 @@ class RssParser
|
|||
|
||||
xml_set_object($xmlparser, $this);
|
||||
// @phan-suppress-next-line PhanUndeclaredFunctionInCallable
|
||||
xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element');
|
||||
xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element'); // @phpstan-ignore-line
|
||||
// @phan-suppress-next-line PhanUndeclaredFunctionInCallable
|
||||
xml_set_character_data_handler($xmlparser, 'feed_cdata');
|
||||
xml_set_character_data_handler($xmlparser, 'feed_cdata'); // @phpstan-ignore-line
|
||||
|
||||
$status = xml_parse($xmlparser, $str, false);
|
||||
|
||||
|
|
|
|||
|
|
@ -2659,7 +2659,7 @@ function dol_get_fiche_end($notab = 0)
|
|||
* @param CommonObject $object Object to show
|
||||
* @param string $paramid Name of parameter to use to name the id into the URL next/previous link
|
||||
* @param string $morehtml More html content to output just before the nav bar
|
||||
* @param int $shownav Show Condition (navigation is shown if value is 1)
|
||||
* @param int|bool $shownav Show Condition (navigation is shown if value is 1 or true)
|
||||
* @param string $fieldid Name of the field in DB to use to select next et previous (we make the select max and min on this field). Use 'none' for no prev/next search.
|
||||
* @param string $fieldref Name of the field (object->ref) to use to select next et previous
|
||||
* @param string $morehtmlref More html to show after the ref (see $morehtmlleft for before)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
<?php
|
||||
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2017 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2017 ATM-CONSULTING <contact@atm-consulting.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2017 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2017 ATM-CONSULTING <contact@atm-consulting.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.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
|
||||
|
|
@ -246,7 +247,7 @@ function invoice_admin_prepare_head()
|
|||
/**
|
||||
* Return array head with list of tabs to view object information.
|
||||
*
|
||||
* @param Facture $object Invoice object
|
||||
* @param FactureRec $object Invoice model object
|
||||
* @return array head array with tabs
|
||||
*/
|
||||
function invoice_rec_prepare_head($object)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* 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
|
||||
|
|
@ -244,4 +245,4 @@ function dolSessionGC($max_lifetime)
|
|||
}
|
||||
|
||||
// Call to register user call back functions.
|
||||
session_set_save_handler("dolSessionOpen", "dolSessionClose", "dolSessionRead", "dolSessionWrite", "dolSessionDestroy", "dolSessionGC");
|
||||
session_set_save_handler("dolSessionOpen", "dolSessionClose", "dolSessionRead", "dolSessionWrite", "dolSessionDestroy", "dolSessionGC"); // @phpstan-ignore-line
|
||||
|
|
|
|||
|
|
@ -99,19 +99,22 @@ class mod_commande_saphir extends ModeleNumRefCommandes
|
|||
*/
|
||||
public function getExample()
|
||||
{
|
||||
global $conf, $langs, $mysoc;
|
||||
global $db, $langs;
|
||||
|
||||
$old_code_client = $mysoc->code_client;
|
||||
$old_code_type = $mysoc->typent_code;
|
||||
$mysoc->code_client = 'CCCCCCCCCC';
|
||||
$mysoc->typent_code = 'TTTTTTTTTT';
|
||||
$numExample = $this->getNextValue($mysoc, null);
|
||||
$mysoc->code_client = $old_code_client;
|
||||
$mysoc->typent_code = $old_code_type;
|
||||
require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
|
||||
$order = new Commande($db);
|
||||
$order->initAsSpecimen();
|
||||
$thirdparty = new Societe($db);
|
||||
$thirdparty->initAsSpecimen();
|
||||
|
||||
$numExample = $this->getNextValue($thirdparty, $order);
|
||||
|
||||
if (!$numExample) {
|
||||
$numExample = $langs->trans('NotConfigured');
|
||||
}
|
||||
|
||||
return $numExample;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -104,16 +104,22 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder
|
|||
*/
|
||||
public function getExample()
|
||||
{
|
||||
global $conf, $langs, $mysoc;
|
||||
global $db, $langs;
|
||||
|
||||
$old_code_client = $mysoc->code_client;
|
||||
$mysoc->code_client = 'CCCCCCCCCC';
|
||||
$numExample = $this->getNextValue($mysoc, '');
|
||||
$mysoc->code_client = $old_code_client;
|
||||
require_once DOL_DOCUMENT_ROOT . '/delivery/class/delivery.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
|
||||
$delivery = new Delivery($db);
|
||||
$delivery->initAsSpecimen();
|
||||
$thirdparty = new Societe($db);
|
||||
$thirdparty->initAsSpecimen();
|
||||
|
||||
$numExample = $this->getNextValue($thirdparty, $delivery);
|
||||
|
||||
if (!$numExample) {
|
||||
$numExample = $langs->trans('NotConfigured');
|
||||
}
|
||||
|
||||
return $numExample;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -404,6 +404,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
|||
}
|
||||
// Make substitutions into odt of thirdparty
|
||||
if ($socobject->element == 'contact') {
|
||||
/** @var Contact $socobject */
|
||||
$tmparray = $this->get_substitutionarray_contact($socobject, $outputlangs);
|
||||
} else {
|
||||
$tmparray = $this->get_substitutionarray_thirdparty($socobject, $outputlangs);
|
||||
|
|
|
|||
|
|
@ -97,19 +97,22 @@ class mod_expedition_ribera extends ModelNumRefExpedition
|
|||
*/
|
||||
public function getExample()
|
||||
{
|
||||
global $conf, $langs, $mysoc;
|
||||
global $db, $langs;
|
||||
|
||||
$old_code_client = $mysoc->code_client;
|
||||
$old_code_type = $mysoc->typent_code;
|
||||
$mysoc->code_client = 'CCCCCCCCCC';
|
||||
$mysoc->typent_code = 'TTTTTTTTTT';
|
||||
$numExample = $this->getNextValue($mysoc, '');
|
||||
$mysoc->code_client = $old_code_client;
|
||||
$mysoc->typent_code = $old_code_type;
|
||||
require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
|
||||
$shipment = new Expedition($db);
|
||||
$shipment->initAsSpecimen();
|
||||
$thirdparty = new Societe($db);
|
||||
$thirdparty->initAsSpecimen();
|
||||
|
||||
$numExample = $this->getNextValue($thirdparty, $shipment);
|
||||
|
||||
if (!$numExample) {
|
||||
$numExample = $langs->trans('NotConfigured');
|
||||
}
|
||||
|
||||
return $numExample;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
|
|||
$sqlbis = 'UPDATE '.MAIN_DB_PREFIX.'expensereport SET ref_number_int = '.((int) $ref_number_int).' WHERE rowid = '.((int) $object->id);
|
||||
$resqlbis = $db->query($sqlbis);
|
||||
if (!$resqlbis) {
|
||||
dol_print_error($resqlbis);
|
||||
dol_print_error($db, $resqlbis);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
|
||||
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.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
|
||||
|
|
@ -211,7 +211,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies"));
|
||||
|
||||
// Show Draft Watermark
|
||||
if ($object->statut == $object::STATUS_DRAFT && (getDolGlobalString('FACTURE_DRAFT_WATERMARK'))) {
|
||||
if ($object->status == $object::STATUS_DRAFT && (getDolGlobalString('FACTURE_DRAFT_WATERMARK'))) {
|
||||
$this->watermark = getDolGlobalString('FACTURE_DRAFT_WATERMARK');
|
||||
}
|
||||
|
||||
|
|
@ -1254,13 +1254,13 @@ class pdf_crabe extends ModelePDFFactures
|
|||
$useonlinepayment = count($validpaymentmethod);
|
||||
}
|
||||
|
||||
if ($object->statut != Facture::STATUS_DRAFT && $useonlinepayment) {
|
||||
if ($object->status != Facture::STATUS_DRAFT && $useonlinepayment) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
global $langs;
|
||||
|
||||
$langs->loadLangs(array('payment', 'paybox', 'stripe'));
|
||||
$servicename = $langs->transnoentities('Online');
|
||||
$paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, '', '', '');
|
||||
$paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, 0, '', '');
|
||||
$linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' <a href="'.$paiement_url.'">'.$outputlangs->transnoentities("ClickHere").'</a>';
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
|
|
@ -1902,7 +1902,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||
}
|
||||
}
|
||||
$title .= ' '.$outputlangs->convToOutputCharset($object->ref);
|
||||
if ($object->statut == $object::STATUS_DRAFT) {
|
||||
if ($object->status == $object::STATUS_DRAFT) {
|
||||
$pdf->SetTextColor(128, 0, 0);
|
||||
$title .= ' - '.$outputlangs->transnoentities("NotValidated");
|
||||
}
|
||||
|
|
@ -1916,7 +1916,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||
$pdf->SetXY($posx, $posy);
|
||||
$pdf->SetTextColor(0, 0, 60);
|
||||
$textref = $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset($object->ref);
|
||||
if ($object->statut == $object::STATUS_DRAFT) {
|
||||
if ($object->status == $object::STATUS_DRAFT) {
|
||||
$pdf->SetTextColor(128, 0, 0);
|
||||
$textref .= ' - '.$outputlangs->transnoentities("NotValidated");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1455,13 +1455,13 @@ class pdf_octopus extends ModelePDFFactures
|
|||
}
|
||||
|
||||
|
||||
if ($object->statut != Facture::STATUS_DRAFT && $useonlinepayment) {
|
||||
if ($object->status != Facture::STATUS_DRAFT && $useonlinepayment) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
global $langs;
|
||||
|
||||
$langs->loadLangs(array('payment', 'paybox', 'stripe'));
|
||||
$servicename = $langs->transnoentities('Online');
|
||||
$paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, '', '', '');
|
||||
$paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, 0, '', '');
|
||||
$linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' <a href="'.$paiement_url.'">'.$outputlangs->transnoentities("ClickHere").'</a>';
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
|
|
|
|||
|
|
@ -1362,7 +1362,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||
|
||||
$langs->loadLangs(array('payment', 'paybox', 'stripe'));
|
||||
$servicename = $langs->transnoentities('Online');
|
||||
$paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, '', '', '');
|
||||
$paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, 0, '', '');
|
||||
$linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' <a href="'.$paiement_url.'">'.$outputlangs->transnoentities("ClickHere").'</a>';
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
||||
* Copyright (C) 2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.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
|
||||
|
|
@ -99,7 +100,7 @@ class modAgenda extends DolibarrModules
|
|||
$this->const[] = array('MAIN_AGENDA_ACTIONAUTO_'.$obj->code, "chaine", "1", '', 0, 'current');
|
||||
}
|
||||
} else {
|
||||
dol_print_error($this->db->lasterror());
|
||||
dol_print_error($this->db, $this->db->lasterror());
|
||||
}
|
||||
|
||||
// New pages on tabs
|
||||
|
|
|
|||
|
|
@ -66,12 +66,12 @@ class mod_mo_advanced extends ModeleNumRefMos
|
|||
|
||||
$form = new Form($db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
$texte .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$texte .= '<input type="hidden" name="action" value="updateMask">';
|
||||
$texte .= '<input type="hidden" name="maskconstMo" value="MRP_MO_ADVANCED_MASK">';
|
||||
$texte .= '<table class="nobordernopadding" width="100%">';
|
||||
$text = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$text .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
$text .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$text .= '<input type="hidden" name="action" value="updateMask">';
|
||||
$text .= '<input type="hidden" name="maskconstMo" value="MRP_MO_ADVANCED_MASK">';
|
||||
$text .= '<table class="nobordernopadding" width="100%">';
|
||||
|
||||
$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Mo"), $langs->transnoentities("Mo"));
|
||||
$tooltip .= $langs->trans("GenericMaskCodes2");
|
||||
|
|
@ -80,17 +80,17 @@ class mod_mo_advanced extends ModeleNumRefMos
|
|||
$tooltip .= $langs->trans("GenericMaskCodes5");
|
||||
|
||||
// Parametrage du prefix
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskMo" value="'.getDolGlobalString('MRP_MO_ADVANCED_MASK').'">', $tooltip, 1, 1).'</td>';
|
||||
$text .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$text .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskMo" value="'.getDolGlobalString('MRP_MO_ADVANCED_MASK').'">', $tooltip, 1, 1).'</td>';
|
||||
|
||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit reposition smallpaddingimp" name="Button"value="'.$langs->trans("Modify").'"></td>';
|
||||
$text .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit reposition smallpaddingimp" name="Button"value="'.$langs->trans("Modify").'"></td>';
|
||||
|
||||
$texte .= '</tr>';
|
||||
$text .= '</tr>';
|
||||
|
||||
$texte .= '</table>';
|
||||
$texte .= '</form>';
|
||||
$text .= '</table>';
|
||||
$text .= '</form>';
|
||||
|
||||
return $texte;
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -100,19 +100,23 @@ class mod_mo_advanced extends ModeleNumRefMos
|
|||
*/
|
||||
public function getExample()
|
||||
{
|
||||
global $conf, $langs, $mysoc;
|
||||
global $db, $langs;
|
||||
|
||||
$old_code_client = $mysoc->code_client;
|
||||
$old_code_type = $mysoc->typent_code;
|
||||
$mysoc->code_client = 'CCCCCCCCCC';
|
||||
$mysoc->typent_code = 'TTTTTTTTTT';
|
||||
$numExample = $this->getNextValue($mysoc, '');
|
||||
$mysoc->code_client = $old_code_client;
|
||||
$mysoc->typent_code = $old_code_type;
|
||||
require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
|
||||
$mo = new Mo($db);
|
||||
$mo->initAsSpecimen();
|
||||
$product = new Product($db);
|
||||
$product->initAsSpecimen();
|
||||
|
||||
|
||||
$numExample = $this->getNextValue($product, $mo);
|
||||
|
||||
if (!$numExample) {
|
||||
$numExample = $langs->trans('NotConfigured');
|
||||
}
|
||||
|
||||
return $numExample;
|
||||
}
|
||||
|
||||
|
|
@ -125,7 +129,7 @@ class mod_mo_advanced extends ModeleNumRefMos
|
|||
*/
|
||||
public function getNextValue($objprod, $object)
|
||||
{
|
||||
global $db, $conf;
|
||||
global $db;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -109,16 +109,22 @@ class mod_project_universal extends ModeleNumRefProjects
|
|||
*/
|
||||
public function getExample()
|
||||
{
|
||||
global $conf, $langs, $mysoc;
|
||||
global $db, $langs;
|
||||
|
||||
$old_code_client = $mysoc->code_client;
|
||||
$mysoc->code_client = 'CCCCCCCCCC';
|
||||
$numExample = $this->getNextValue($mysoc, '');
|
||||
$mysoc->code_client = $old_code_client;
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
|
||||
$project = new Project($db);
|
||||
$project->initAsSpecimen();
|
||||
$thirdparty = new Societe($db);
|
||||
$thirdparty->initAsSpecimen();
|
||||
|
||||
$numExample = $this->getNextValue($thirdparty, $project);
|
||||
|
||||
if (!$numExample) {
|
||||
$numExample = $langs->trans('NotConfigured');
|
||||
}
|
||||
|
||||
return $numExample;
|
||||
}
|
||||
|
||||
|
|
@ -131,7 +137,7 @@ class mod_project_universal extends ModeleNumRefProjects
|
|||
*/
|
||||
public function getNextValue($objsoc, $project)
|
||||
{
|
||||
global $db, $conf;
|
||||
global $db, $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
|
|
@ -139,7 +145,7 @@ class mod_project_universal extends ModeleNumRefProjects
|
|||
$mask = getDolGlobalString('PROJECT_UNIVERSAL_MASK');
|
||||
|
||||
if (!$mask) {
|
||||
$this->error = 'NotConfigured';
|
||||
$this->error = $langs->trans('NotConfigured');
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* 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
|
||||
|
|
@ -106,19 +107,21 @@ class mod_propale_saphir extends ModeleNumRefPropales
|
|||
*/
|
||||
public function getExample()
|
||||
{
|
||||
global $conf, $langs, $mysoc;
|
||||
global $db, $langs;
|
||||
|
||||
$old_code_client = $mysoc->code_client;
|
||||
$old_code_type = $mysoc->typent_code;
|
||||
$mysoc->code_client = 'CCCCCCCCCC';
|
||||
$mysoc->typent_code = 'TTTTTTTTTT';
|
||||
$numExample = $this->getNextValue($mysoc, '');
|
||||
$mysoc->code_client = $old_code_client;
|
||||
$mysoc->typent_code = $old_code_type;
|
||||
require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
|
||||
$propal = new Propal($db);
|
||||
$propal->initAsSpecimen();
|
||||
$thirdparty = new Societe($db);
|
||||
$thirdparty->initAsSpecimen();
|
||||
$numExample = $this->getNextValue($thirdparty, $propal);
|
||||
|
||||
if (!$numExample) {
|
||||
$numExample = 'NotConfigured';
|
||||
$numExample = $langs->trans('NotConfigured');
|
||||
}
|
||||
|
||||
return $numExample;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2023 William Mead <william.mead@manchenumerique.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2023 William Mead <william.mead@manchenumerique.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.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
|
||||
|
|
@ -911,7 +911,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
* Show total to pay
|
||||
*
|
||||
* @param TCPDF $pdf Object PDF
|
||||
* @param Facture $object Object invoice
|
||||
* @param CommandeFournisseur $object Object invoice
|
||||
* @param int $deja_regle Montant deja regle
|
||||
* @param int $posy Position depart
|
||||
* @param Translate $outputlangs Object langs
|
||||
|
|
@ -1465,7 +1465,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
/**
|
||||
* Define Array Column Field
|
||||
*
|
||||
* @param object $object common object
|
||||
* @param CommandeFournisseur $object common object
|
||||
* @param Translate $outputlangs langs
|
||||
* @param int $hidedetails Do not show line details
|
||||
* @param int $hidedesc Do not show desc
|
||||
|
|
|
|||
|
|
@ -107,12 +107,17 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
|
|||
*/
|
||||
public function getExample()
|
||||
{
|
||||
global $conf, $langs, $mysoc;
|
||||
global $db, $langs;
|
||||
|
||||
$old_code_client = $mysoc->code_client;
|
||||
$mysoc->code_client = 'CCCCCCCCCC';
|
||||
$numExample = $this->getNextValue($mysoc, '');
|
||||
$mysoc->code_client = $old_code_client;
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
|
||||
$supplierorder = new CommandeFournisseur($db);
|
||||
$supplierorder->initAsSpecimen();
|
||||
$thirdparty = new Societe($db);
|
||||
$thirdparty->initAsSpecimen();
|
||||
|
||||
$numExample = $this->getNextValue($thirdparty, $supplierorder);
|
||||
|
||||
if (!$numExample) {
|
||||
$numExample = $langs->trans('NotConfigured');
|
||||
|
|
@ -129,7 +134,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
|
|||
*/
|
||||
public function getNextValue($objsoc, $object)
|
||||
{
|
||||
global $db, $conf;
|
||||
global $db, $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
|
|
@ -137,7 +142,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
|
|||
$mask = getDolGlobalString("COMMANDE_FOURNISSEUR_ORCHIDEE_MASK");
|
||||
|
||||
if (!$mask) {
|
||||
$this->error = 'NotConfigured';
|
||||
$this->error = $langs->trans('NotConfigured');
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -907,8 +907,8 @@ class pdf_zenith extends ModelePDFSupplierProposal
|
|||
/**
|
||||
* Show total to pay
|
||||
*
|
||||
* @param TCPDF $pdf Object PDF
|
||||
* @param Facture $object Object invoice
|
||||
* @param TCPDF $pdf Object PDF
|
||||
* @param SupplierProposal $object Object supplier proposal
|
||||
* @param int $deja_regle Montant deja regle
|
||||
* @param int $posy Position depart
|
||||
* @param Translate $outputlangs Object langs
|
||||
|
|
@ -1167,7 +1167,7 @@ class pdf_zenith extends ModelePDFSupplierProposal
|
|||
* Show top header of page.
|
||||
*
|
||||
* @param TCPDF $pdf Object PDF
|
||||
* @param CommandeFournisseur $object Object to show
|
||||
* @param SupplierProposal $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return float|int Return topshift value
|
||||
|
|
@ -1435,7 +1435,7 @@ class pdf_zenith extends ModelePDFSupplierProposal
|
|||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param TCPDF $pdf PDF
|
||||
* @param CommandeFournisseur $object Object to show
|
||||
* @param SupplierProposal $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return int Return height of bottom margin including footer text
|
||||
|
|
@ -1451,7 +1451,7 @@ class pdf_zenith extends ModelePDFSupplierProposal
|
|||
/**
|
||||
* Define Array Column Field
|
||||
*
|
||||
* @param Object $object common object
|
||||
* @param SupplierProposal $object common object
|
||||
* @param Translate $outputlangs langs
|
||||
* @param int $hidedetails Do not show line details
|
||||
* @param int $hidedesc Do not show desc
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.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
|
||||
|
|
@ -67,12 +68,12 @@ class mod_ticket_universal extends ModeleNumRefTicket
|
|||
|
||||
$form = new Form($db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
$texte .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$texte .= '<input type="hidden" name="action" value="updateMask">';
|
||||
$texte .= '<input type="hidden" name="maskconstticket" value="TICKET_UNIVERSAL_MASK">';
|
||||
$texte .= '<table class="nobordernopadding" width="100%">';
|
||||
$text = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$text .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
$text .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$text .= '<input type="hidden" name="action" value="updateMask">';
|
||||
$text .= '<input type="hidden" name="maskconstticket" value="TICKET_UNIVERSAL_MASK">';
|
||||
$text .= '<table class="nobordernopadding" width="100%">';
|
||||
|
||||
$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Ticket"), $langs->transnoentities("Ticket"));
|
||||
$tooltip .= $langs->trans("GenericMaskCodes2");
|
||||
|
|
@ -81,17 +82,17 @@ class mod_ticket_universal extends ModeleNumRefTicket
|
|||
$tooltip .= $langs->trans("GenericMaskCodes5");
|
||||
|
||||
// Prefix settings
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskticket" value="'.getDolGlobalString("TICKET_UNIVERSAL_MASK").'">', $tooltip, 1, 1).'</td>';
|
||||
$text .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$text .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskticket" value="'.getDolGlobalString("TICKET_UNIVERSAL_MASK").'">', $tooltip, 1, 1).'</td>';
|
||||
|
||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit reposition smallpaddingimp" name="Button"value="'.$langs->trans("Modify").'"></td>';
|
||||
$text .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit reposition smallpaddingimp" name="Button"value="'.$langs->trans("Modify").'"></td>';
|
||||
|
||||
$texte .= '</tr>';
|
||||
$text .= '</tr>';
|
||||
|
||||
$texte .= '</table>';
|
||||
$texte .= '</form>';
|
||||
$text .= '</table>';
|
||||
$text .= '</form>';
|
||||
|
||||
return $texte;
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -101,16 +102,22 @@ class mod_ticket_universal extends ModeleNumRefTicket
|
|||
*/
|
||||
public function getExample()
|
||||
{
|
||||
global $conf, $langs, $mysoc;
|
||||
global $db, $langs;
|
||||
|
||||
$old_code_client = $mysoc->code_client;
|
||||
$mysoc->code_client = 'CCCCCCCCCC';
|
||||
$numExample = $this->getNextValue($mysoc, '');
|
||||
$mysoc->code_client = $old_code_client;
|
||||
require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
|
||||
$ticket = new Ticket($db);
|
||||
$ticket->initAsSpecimen();
|
||||
$thirdparty = new Societe($db);
|
||||
$thirdparty->initAsSpecimen();
|
||||
|
||||
$numExample = $this->getNextValue($thirdparty, $ticket);
|
||||
|
||||
if (!$numExample) {
|
||||
$numExample = $langs->trans('NotConfigured');
|
||||
}
|
||||
|
||||
return $numExample;
|
||||
}
|
||||
|
||||
|
|
@ -123,7 +130,7 @@ class mod_ticket_universal extends ModeleNumRefTicket
|
|||
*/
|
||||
public function getNextValue($objsoc, $ticket)
|
||||
{
|
||||
global $db, $conf;
|
||||
global $db, $langs;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
|
|
@ -131,7 +138,7 @@ class mod_ticket_universal extends ModeleNumRefTicket
|
|||
$mask = getDolGlobalString("TICKET_UNIVERSAL_MASK");
|
||||
|
||||
if (!$mask) {
|
||||
$this->error = 'NotConfigured';
|
||||
$this->error = $langs->trans('NotConfigured');
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1972,7 +1972,7 @@ class ExpenseReport extends CommonObject
|
|||
}
|
||||
$vatrate = preg_replace('/\*/', '', $vatrate);
|
||||
|
||||
$tmp = calcul_price_total($qty, $up, 0, $vatrate, -1, -1, 0, 'TTC', 0, $type, $seller, $localtaxes_type);
|
||||
$tmp = calcul_price_total($qty, $up, 0, (float) price2num($vatrate), -1, -1, 0, 'TTC', 0, $type, $seller, $localtaxes_type);
|
||||
|
||||
$this->line->value_unit = $up;
|
||||
|
||||
|
|
@ -2238,10 +2238,9 @@ class ExpenseReport extends CommonObject
|
|||
}
|
||||
$vatrate = preg_replace('/\*/', '', $vatrate);
|
||||
|
||||
$tmp = calcul_price_total($qty, $value_unit, 0, $vatrate, -1, -1, 0, 'TTC', 0, $type, $seller, $localtaxes_type);
|
||||
//var_dump($vatrate);var_dump($localtaxes_type);var_dump($tmp);exit;
|
||||
$tmp = calcul_price_total($qty, $value_unit, 0, (float) price2num($vatrate), -1, -1, 0, 'TTC', 0, $type, $seller, $localtaxes_type);
|
||||
// calcul total of line
|
||||
//$total_ttc = price2num($qty*$value_unit, 'MT');
|
||||
// $total_ttc = price2num($qty*$value_unit, 'MT');
|
||||
|
||||
$tx_tva = 1 + (float) $vatrate / 100;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
* Copyright (C) 2016-2022 Charlene Benke <charlene@patas-monkey.com>
|
||||
* Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.fr>
|
||||
* Copyright (C) 2017 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
* Copyright (C) 2019-2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2019-2020 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||
* Copyright (C) 2022 Vincent de Grandpré <vincent@de-grandpre.quebec>
|
||||
|
|
@ -2844,7 +2844,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
|
|||
// Origin country code
|
||||
print '<tr><td>'.$langs->trans("Origin").'</td><td>'.getCountry($object->country_id, 0, $db);
|
||||
if (!empty($object->state_id)) {
|
||||
print ' - '.getState($object->state_id, 0, $db);
|
||||
print ' - '.getState($object->state_id, '0', $db);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
* Copyright (C) 2020-2023 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Benjamin Falière <benjamin.faliere@altairis.fr>
|
||||
* 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
|
||||
|
|
@ -2155,7 +2156,7 @@ while ($i < $imaxinloop) {
|
|||
if (!empty($arrayfields['p.fk_state']['checked'])) {
|
||||
print '<td>';
|
||||
if (!empty($obj->fk_state)) {
|
||||
print getState($obj->fk_state, 0, $db);
|
||||
print getState($obj->fk_state, '0', $db);
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* 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
|
||||
|
|
@ -219,8 +220,8 @@ if ($id > 0 || !empty($ref)) {
|
|||
print $langs->trans('Month').':<input class="flat" type="text" size="4" name="search_month" value="'.($search_month > 0 ? $search_month : '').'"> ';
|
||||
print $langs->trans('Year').':'.$formother->selectyear($search_year ? $search_year : - 1, 'search_year', 1, 20, 5);
|
||||
print '<div style="vertical-align: middle; display: inline-block">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"), 'search.png', '', '', 1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"), 'search.png', '', 0, 1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"), 'searchclear.png', '', 0, 1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -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-2019 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>
|
||||
* Copyright (C) 2022 Udo Tamm <dev@dolibit.de>
|
||||
|
|
@ -453,7 +453,7 @@ if (empty($reshook) && $action == 'add') {
|
|||
// It is not so important because a test is done on return of payment validation.
|
||||
}
|
||||
|
||||
$urlback = getOnlinePaymentUrl(0, 'member', $adh->ref, price2num(GETPOST('amount', 'alpha'), 'MT'), '', 0);
|
||||
$urlback = getOnlinePaymentUrl(0, 'member', $adh->ref, (float) price2num(GETPOST('amount', 'alpha'), 'MT'), '', 0);
|
||||
|
||||
if (GETPOST('email')) {
|
||||
$urlback .= '&email='.urlencode(GETPOST('email'));
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
* Copyright (C) 2022 ButterflyOfFire <butterflyoffire+dolibarr@protonmail.com>
|
||||
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
|
||||
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.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
|
||||
|
|
@ -4390,8 +4390,8 @@ class Societe extends CommonObject
|
|||
} else { // For backward compatibility
|
||||
dol_syslog("Your setup of State has an old syntax (entity=".$conf->entity."). Go in Home - Setup - Organization then Save should remove this error.", LOG_ERR);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
$state_code = getState($state_id, 2, $this->db); // This need a SQL request, but it's the old feature that should not be used anymore
|
||||
$state_label = getState($state_id, 0, $this->db); // This need a SQL request, but it's the old feature that should not be used anymore
|
||||
$state_code = getState($state_id, '2', $this->db); // This need a SQL request, but it's the old feature that should not be used anymore
|
||||
$state_label = getState($state_id, '0', $this->db); // This need a SQL request, but it's the old feature that should not be used anymore
|
||||
}
|
||||
}
|
||||
$this->state_id = $state_id;
|
||||
|
|
@ -4502,6 +4502,7 @@ class Societe extends CommonObject
|
|||
|
||||
$this->code_client = 'CC-'.dol_print_date($now, 'dayhourlog');
|
||||
$this->code_fournisseur = 'SC-'.dol_print_date($now, 'dayhourlog');
|
||||
$this->typent_code = 'TE_OTHER';
|
||||
$this->capital = 10000;
|
||||
$this->client = 1;
|
||||
$this->prospect = 1;
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ print dol_get_fiche_head($head, 'contact', $langs->trans("ThirdParty"), 0, 'comp
|
|||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom');
|
||||
dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 1);
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2017 Saasprov <saasprov@gmail.com>
|
||||
* Copyright (C) 2018-2022 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -94,15 +94,15 @@ if ($action == 'setvalue' && $user->admin) {
|
|||
if (!($result > 0)) {
|
||||
$error++;
|
||||
}
|
||||
$result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_PAYMENTS", GETPOSTINT('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'), 'chaine', 0, '', $conf->entity);
|
||||
$result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_PAYMENTS", (string) GETPOSTINT('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS'), 'chaine', 0, '', $conf->entity);
|
||||
if (!($result > 0)) {
|
||||
$error++;
|
||||
}
|
||||
$result = dolibarr_set_const($db, "STRIPE_USER_ACCOUNT_FOR_ACTIONS", GETPOSTINT('STRIPE_USER_ACCOUNT_FOR_ACTIONS'), 'chaine', 0, '', $conf->entity);
|
||||
$result = dolibarr_set_const($db, "STRIPE_USER_ACCOUNT_FOR_ACTIONS", (string) GETPOSTINT('STRIPE_USER_ACCOUNT_FOR_ACTIONS'), 'chaine', 0, '', $conf->entity);
|
||||
if (!($result > 0)) {
|
||||
$error++;
|
||||
}
|
||||
$result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS", GETPOSTINT('STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS'), 'chaine', 0, '', $conf->entity);
|
||||
$result = dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS", (string) GETPOSTINT('STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS'), 'chaine', 0, '', $conf->entity);
|
||||
if (!($result > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -160,7 +160,7 @@ if ($action == 'setvalue' && $user->admin) {
|
|||
|
||||
if ($action == "setlive") {
|
||||
$liveenable = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "STRIPE_LIVE", $liveenable, 'yesno', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "STRIPE_LIVE", (string) $liveenable, 'yesno', 0, '', $conf->entity);
|
||||
if ($res > 0) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
|
|
@ -239,7 +239,7 @@ if (empty($conf->stripeconnect->enabled)) {
|
|||
//global $dolibarr_main_instance_unique_id;
|
||||
//$url .= '&securitykey='.dol_hash('stripeipn-'.$dolibarr_main_instance_unique_id.'-'.$conf->global->STRIPE_TEST_PUBLISHABLE_KEY, 'md5');
|
||||
$out .= '<input type="text" id="onlinetestwebhookurl" class="minwidth500" value="'.$url.'" disabled>';
|
||||
$out .= ajax_autoselect("onlinetestwebhookurl", 0);
|
||||
$out .= ajax_autoselect("onlinetestwebhookurl");
|
||||
print '<br>'.$out;
|
||||
print '</td><td>';
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2021-2024 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -249,7 +249,7 @@ $stringtoshow .= '<input type="hidden" name="token" value="'.newToken().'">';
|
|||
$stringtoshow .= '<input type="hidden" name="action" value="refresh">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_ticket_by_status:year,shownb,showtot">';
|
||||
$stringtoshow .= $langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">';
|
||||
$stringtoshow .= '<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"), 'refresh.png', '', '', 1).'">';
|
||||
$stringtoshow .= '<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"), 'refresh.png', '', 0, 1).'">';
|
||||
$stringtoshow .= '</form>';
|
||||
$stringtoshow .= '</div>';
|
||||
|
||||
|
|
|
|||
|
|
@ -3830,7 +3830,7 @@ class User extends CommonObject
|
|||
}
|
||||
|
||||
dol_syslog(get_class($this)."::get_full_tree dol_sort_array", LOG_DEBUG);
|
||||
$this->users = dol_sort_array($this->users, 'fullname', 'asc', true, false, 1);
|
||||
$this->users = dol_sort_array($this->users, 'fullname', 'asc', 1, 0, 1);
|
||||
|
||||
//var_dump($this->users);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2022 Open-Dsi <support@open-dsi.fr>
|
||||
/* Copyright (C) 2022 Open-Dsi <support@open-dsi.fr>
|
||||
* 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
|
||||
|
|
@ -25,8 +26,8 @@
|
|||
/**
|
||||
* Prepare array with list of tabs
|
||||
*
|
||||
* @param Product $object Object related to tabs
|
||||
* @return array Array of tabs to show
|
||||
* @param ProductAttribute $object Object related to tabs
|
||||
* @return array Array of tabs to show
|
||||
*/
|
||||
function productAttributePrepareHead($object)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -546,7 +546,7 @@ class Context
|
|||
dol_syslog(__METHOD__ . ' Try to add a message in stack, but value to add is empty message', LOG_WARNING);
|
||||
} else {
|
||||
if (!in_array((string) $style, array('mesgs', 'warnings', 'errors'))) {
|
||||
dol_print_error('', 'Bad parameter style=' . $style . ' for setEventMessages');
|
||||
dol_print_error(null, 'Bad parameter style=' . $style . ' for setEventMessages');
|
||||
}
|
||||
if (empty($mesgs)) {
|
||||
$this->setEventMessage($mesg, $style);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ parameters:
|
|||
checkAlwaysTrueInstanceof: false
|
||||
checkAlwaysTrueStrictComparison: false
|
||||
checkClassCaseSensitivity: true
|
||||
checkFunctionArgumentTypes: false
|
||||
checkFunctionArgumentTypes: true
|
||||
checkFunctionNameCase: true
|
||||
checkArgumentsPassedByReference: false
|
||||
checkMaybeUndefinedVariables: false
|
||||
|
|
@ -60,6 +60,64 @@ parameters:
|
|||
- '#Constructor of class .* has an unused parameter #'
|
||||
- '#Dead catch - Exception is never thrown in the try block#'
|
||||
- '#.*phan-var#'
|
||||
- '#\$httpStatusCode of class Luracast\\Restler\\RestException constructor expects string, int given.#'
|
||||
- '#expects \(callable#'
|
||||
- '#expects bool#'
|
||||
- '#expects bool, int given.#'
|
||||
- '#expects bool, string given.#'
|
||||
- '#expects int#'
|
||||
- '#expects int<-2, 2>, bool given.#'
|
||||
- '#expects int<0, 1>, false given.#'
|
||||
- '#expects int, string given.#'
|
||||
- '#expects int, float given.#'
|
||||
- '#expects int, bool given.#'
|
||||
- '#expects int, false given.#'
|
||||
- '#expects int, true given.#'
|
||||
- '#expects int, array\|string given.#'
|
||||
- '#expects int<0, 1>, '''' given.#'
|
||||
- '#expects float\|string#'
|
||||
- '#expects float\|null#'
|
||||
- '#expects float, string given.#'
|
||||
- '#expects string#'
|
||||
- '#expects string, int given.#'
|
||||
- '#expects string, \(float\|int\) given.#'
|
||||
- '#expects string, array given.#'
|
||||
- '#expects string, float given.#'
|
||||
- '#expects string, true given.#'
|
||||
- '#expects string, null given.#'
|
||||
- '#expects string, int<0, 10> given.#'
|
||||
- '#expects string, DateTime given.#'
|
||||
- '#expects array#'
|
||||
- '#expects array, string given.#'
|
||||
- '#expects array, null given.#'
|
||||
- '#expects array<string>, null given.#'
|
||||
- '#expects array<string>, string given.#'
|
||||
- '#expects resource#'
|
||||
- '#expects resource, object given.#'
|
||||
- '#expects object#'
|
||||
- '#expects Adherent#'
|
||||
- '#expects BOM#'
|
||||
- '#expects Contrat#'
|
||||
- '#expects FTP\\Connection#'
|
||||
- '#expects Holiday#'
|
||||
- '#expects LDAP\\Connection#'
|
||||
- '#expects MultiCurrency#'
|
||||
- '#expects Productlot#'
|
||||
- '#expects Facture#'
|
||||
- '#expects FactureFournisseur#'
|
||||
- '#expects Paiement#'
|
||||
- '#expects PgSql\\Result#'
|
||||
- '#expects RecruitmentJobPosition#'
|
||||
- '#expects RemiseCheque#'
|
||||
- '#expects Societe#'
|
||||
- '#expects SupplierProposal#'
|
||||
- '#expects Translate#'
|
||||
- '#expects User#'
|
||||
- '#expects CommonObjectLine#'
|
||||
- '#dol_eval expects#'
|
||||
- '#check_authentication expects#'
|
||||
- '#colorHexToHsl expects#'
|
||||
- '#dolGetButtonTitle expects#'
|
||||
internalErrorsCountLimit: 50
|
||||
cache:
|
||||
nodesByFileCountMax: 512
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* 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
|
||||
|
|
@ -79,18 +80,19 @@ if ($mode != 'confirm') {
|
|||
$conf->global->MAIN_DISABLE_ALL_MAILS = 1;
|
||||
}
|
||||
|
||||
/** @var DoliDB $db */
|
||||
|
||||
$sql = "SELECT DISTINCT c.ref, c.fk_soc, cd.date_fin_validite, cd.total_ttc, cd.description as description, p.label as plabel, s.rowid, s.nom as name, s.email, s.default_lang,";
|
||||
$sql .= " u.rowid as uid, u.lastname, u.firstname, u.email, u.lang";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe AS s, ".MAIN_DB_PREFIX."contrat AS c, ".MAIN_DB_PREFIX."contratdet AS cd";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product AS p ON p.rowid = cd.fk_product, ".MAIN_DB_PREFIX."societe_commerciaux AS sc, ".MAIN_DB_PREFIX."user AS u";
|
||||
$sql .= " WHERE s.rowid = c.fk_soc AND c.rowid = cd.fk_contrat AND c.statut > 0 AND cd.statut<5";
|
||||
if (is_numeric($duration_value)) {
|
||||
$sql .= " AND cd.date_fin_validite < '".$db->idate(dol_time_plus_duree($now, $duration_value, "d"))."'";
|
||||
$sql .= " AND cd.date_fin_validite < '".$db->idate(dol_time_plus_duree($now, (int) $duration_value, "d"))."'";
|
||||
}
|
||||
$sql .= " AND sc.fk_soc = s.rowid AND sc.fk_user = u.rowid";
|
||||
$sql .= " ORDER BY u.email ASC, s.rowid ASC, c.ref ASC"; // Order by email to allow one message per email
|
||||
|
||||
// print $sql;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
|
@ -112,7 +114,7 @@ if ($resql) {
|
|||
if (($obj->email != $oldemail || $obj->uid != $olduid) || $oldemail == 'none') {
|
||||
// Break onto sales representative (new email or uid)
|
||||
if (dol_strlen($oldemail) && $oldemail != 'none') {
|
||||
sendEmailTo($mode, $oldemail, $message, $total, $oldlang, $oldsalerepresentative, $duration_value);
|
||||
sendEmailTo($mode, $oldemail, $message, price2num($total), $oldlang, $oldsalerepresentative, (int) $duration_value);
|
||||
} else {
|
||||
if ($oldemail != 'none') {
|
||||
print "- No email sent for ".$oldsalerepresentative.", total: ".$total."\n";
|
||||
|
|
@ -160,7 +162,7 @@ if ($resql) {
|
|||
// Si il reste des envois en buffer
|
||||
if ($foundtoprocess) {
|
||||
if (dol_strlen($oldemail) && $oldemail != 'none') { // Break onto email (new email)
|
||||
sendEmailTo($mode, $oldemail, $message, $total, $oldlang, $oldsalerepresentative, $duration_value);
|
||||
sendEmailTo($mode, $oldemail, $message, price2num($total), $oldlang, $oldsalerepresentative, (int) $duration_value);
|
||||
} else {
|
||||
if ($oldemail != 'none') {
|
||||
print "- No email sent for ".$oldsalerepresentative.", total: ".$total."\n";
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2019 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
|
||||
|
|
@ -106,7 +107,7 @@ $user = new User($db);
|
|||
if (!empty($login)) {
|
||||
$user->fetch('', $login);
|
||||
}
|
||||
|
||||
/** @var DoliDB $db */
|
||||
// We get list of emailing id to process
|
||||
$sql = "SELECT m.rowid, m.statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing as m";
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* 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
|
||||
|
|
@ -88,6 +89,8 @@ if (!empty($dolibarr_main_db_readonly)) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
/** @var DoliDB $db */
|
||||
|
||||
$sql = "SELECT f.ref, f.total_ttc, f.date_lim_reglement as due_date,";
|
||||
$sql .= " s.rowid as sid, s.nom as name, s.email, s.default_lang";
|
||||
if ($targettype == 'contacts') {
|
||||
|
|
@ -100,10 +103,10 @@ if ($targettype == 'contacts') {
|
|||
$sql .= " WHERE f.fk_statut = 1 AND f.paye = 0";
|
||||
$sql .= " AND f.fk_soc = s.rowid";
|
||||
if (is_numeric($duration_value2)) {
|
||||
$sql .= " AND f.date_lim_reglement >= '".$db->idate(dol_time_plus_duree($now, $duration_value2, "d"))."'";
|
||||
$sql .= " AND f.date_lim_reglement >= '".$db->idate(dol_time_plus_duree($now, (int) $duration_value2, "d"))."'";
|
||||
}
|
||||
if (is_numeric($duration_value)) {
|
||||
$sql .= " AND f.date_lim_reglement < '".$db->idate(dol_time_plus_duree($now, $duration_value, "d"))."'";
|
||||
$sql .= " AND f.date_lim_reglement < '".$db->idate(dol_time_plus_duree($now, (int) $duration_value, "d"))."'";
|
||||
}
|
||||
if ($targettype == 'contacts') {
|
||||
$sql .= " AND s.rowid = sp.fk_soc";
|
||||
|
|
@ -155,7 +158,7 @@ if ($resql) {
|
|||
if ($startbreak) {
|
||||
// Break onto sales representative (new email or cid)
|
||||
if (dol_strlen($oldemail) && $oldemail != 'none' && empty($trackthirdpartiessent[$oldsid.'|'.$oldemail])) {
|
||||
envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldtarget);
|
||||
envoi_mail($mode, $oldemail, $message, price2num($total), $oldlang, $oldtarget);
|
||||
$trackthirdpartiessent[$oldsid.'|'.$oldemail] = 'contact id '.$oldcid;
|
||||
} else {
|
||||
if ($oldemail != 'none') {
|
||||
|
|
@ -209,7 +212,7 @@ if ($resql) {
|
|||
// Si il reste des envois en buffer
|
||||
if ($foundtoprocess) {
|
||||
if (dol_strlen($oldemail) && $oldemail != 'none' && empty($trackthirdpartiessent[$oldsid.'|'.$oldemail])) { // Break onto email (new email)
|
||||
envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldtarget);
|
||||
envoi_mail($mode, $oldemail, $message, price2num($total), $oldlang, $oldtarget);
|
||||
$trackthirdpartiessent[$oldsid.'|'.$oldemail] = 'contact id '.$oldcid;
|
||||
} else {
|
||||
if ($oldemail != 'none') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue