diff --git a/ChangeLog b/ChangeLog index 4fc1a613681..e205c90cda5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,7 @@ The following changes may create regressions for some external modules, but were be set (not allowed by PHP 8.2). A module can already return an array with key 'no_button_delete', 'no_button_edit', 'no_button_copy' for same purpose. * The old function dol_bc($var, $moreclass = '') has been removed. If you called it, just stop to call it. * The trigger code CATEGORY_LINK and CATEGORY_UNLINK has been replaced with code CATEGORY_MODIFY. You can read ->context['linkto'] or ->context['unlinkoff' to detect we want to make a link or unlink. +* The property ->domiciliation and ->propio on bank accounts has been deprecated and replaced with property ->address and ->owner_name ***** ChangeLog for 20.0.1 compared to 20.0.0 ***** diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 2a5253869d0..aac8fbc9e47 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -623,6 +623,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Common attributes //$keyforbreak='fieldkeytoswithonsecondcolumn'; + $nounderbanner = 1; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; // Other attributes @@ -639,7 +640,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Filters print '
'; - print ''; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index ab75e208e08..496f1921c2c 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -1441,7 +1441,7 @@ if ($mode == 'deploy') { $(document).ready(function() { jQuery("#fileinstall").on("change", function() { if(this.files[0].size > '.($maxmin * 1024).') { - alert("'.dol_escape_js($langs->trans("ErrorFileSizeTooLarge")).'"); + alert("'.dol_escape_js($langs->transnoentitiesnoconv("ErrorFileSizeTooLarge")).'"); this.value = ""; } }); diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 9e397724dcb..01b51753042 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -71,7 +71,7 @@ if ($action == "set") { if (! $res > 0) $error++; $res = dolibarr_set_const($db, "PRELEVEMENT_BIC", $account->bic,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; - $res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->proprio,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->owner_address,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; */ } else { diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 9435eacd0c9..9553528474d 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -72,7 +72,7 @@ if ($action == "set") { if (! $res > 0) $error++; $res = dolibarr_set_const($db, "PRELEVEMENT_BIC", $account->bic,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; - $res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->proprio,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->owner_address,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; */ } else { diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 9671d5a6828..67b69d3149d 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -121,7 +121,7 @@ print "PHP open_basedir = ".(ini_get('open_basedir') ? img_pict print "PHP short_open_tag = ".((empty(ini_get('short_open_tag')) || ini_get('short_open_tag') == 'Off') ? img_picto('', 'tick').' '.yn(0) : img_warning().' '.yn(1)).'   ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).')'."
\n"; -print "PHP allow_url_fopen = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).'   ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No"))." but may be required by some external modules)
\n"; +print "PHP allow_url_fopen = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).'   ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).", except if Yes is required by some external modules)
\n"; print "PHP allow_url_include = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : img_picto('', 'tick').' '.yn(0)).'   ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")
\n"; //print "PHP safe_mode = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).'   '.$langs->trans("Deprecated")." (removed in PHP 5.4)
\n"; @@ -662,8 +662,24 @@ print '
'; print 'MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE = '.getDolGlobalString('MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Recommended").': 1)
'; print '
'; +print 'MAIN_SECURITY_ANTI_SSRF_SERVER_IP = '.getDolGlobalString('MAIN_SECURITY_ANTI_SSRF_SERVER_IP', ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': List of static IPs of server separated with coma - '.$langs->trans("Note").': common loopback ip like 127.*.*.*, [::1] are already added)')."
"; +print '
'; + +print 'MAIN_SECURITY_CSRF_WITH_TOKEN = '.getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 2)'."
"; + +print ''; + + +print '
'; +print '
'; + + +print load_fiche_titre($langs->trans("DatabaseEncryption"), '', 'folder'); + +print '
'; + //print ''.$langs->trans("PasswordEncryption").': '; -print 'MAIN_SECURITY_HASH_ALGO = '.getDolGlobalString('MAIN_SECURITY_HASH_ALGO', ''.$langs->trans("Undefined").'')."   "; +print ''.$langs->trans("AlgorithmFor", $langs->transnoentitiesnoconv("Passwords")).' (non reversible encryption, defined into MAIN_SECURITY_HASH_ALGO) = '.getDolGlobalString('MAIN_SECURITY_HASH_ALGO', ''.$langs->trans("Undefined").'')."   "; if (!getDolGlobalString('MAIN_SECURITY_HASH_ALGO')) { print '     (If unset: \'md5\')'; } @@ -683,10 +699,22 @@ if (getDolGlobalString('MAIN_SECURITY_HASH_ALGO') != 'password_hash') { } print '
'; -print 'MAIN_SECURITY_ANTI_SSRF_SERVER_IP = '.getDolGlobalString('MAIN_SECURITY_ANTI_SSRF_SERVER_IP', ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': List of static IPs of server separated with coma - '.$langs->trans("Note").': common loopback ip like 127.*.*.*, [::1] are already added)')."
"; -print '
'; +$action = GETPOST('action'); +$exampletodecrypt = GETPOST('exampletodecrypt', 'password'); -print 'MAIN_SECURITY_CSRF_WITH_TOKEN = '.getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 2)'."
"; +print ''.$langs->trans("AlgorithmFor", $langs->transnoentitiesnoconv("SensitiveData")).' (reversible encryption done with dolEncrypt/dolDecrypt) = '.constant('MAIN_SECURITY_REVERSIBLE_ALGO').' with key defined into conf.php file in $dolibarr_main_instance_unique_id
'; +print '
'; +print ''; +print ''; +print ''; +print $langs->trans("ToolToDecryptAString").': '; +print ''; +print ''; +if ($action == 'doldecrypt' && $user->admin && $exampletodecrypt) { + usleep(200); + print ' => '; +} +print ''; print '
'; diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index b3595c3b43f..ac615c78751 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1489,7 +1489,7 @@ class BOM extends CommonObject $reg = array(); $qtyhourservice = 0; if (preg_match('/^(\d+)([a-z]+)$/', $defaultdurationofservice, $reg)) { - $qtyhourservice = convertDurationtoHour((int) $reg[1], $reg[2]); + $qtyhourservice = convertDurationtoHour((float) $reg[1], $reg[2]); } if ($qtyhourservice) { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index c70f8e846b9..62e630914bd 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -156,7 +156,6 @@ $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - if (empty($reshook)) { $backurlforlist = DOL_URL_ROOT.'/comm/propal/list.php'; @@ -1721,7 +1720,20 @@ if (empty($reshook)) { $result = $object->set_demand_reason($user, GETPOSTINT('demand_reason_id')); } elseif ($action == 'setconditions' && $usercancreate) { // Terms of payment - $result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id'), GETPOSTINT('cond_reglement_id_deposit_percent')); + $sql = "SELECT code "; + $sql .= "FROM " . $db->prefix() . "c_payment_term"; + $sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int')); + $result = $db->query($sql); + if ($result) { + $obj = $db->fetch_object($result); + if ($obj->code == 'DEP30PCTDEL') { + $result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id'), GETPOSTFLOAT('cond_reglement_id_deposit_percent')); + } else { + $object->deposit_percent = 0; + $object->update($user); + $result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id'), $object->deposit_percent); + } + } //} elseif ($action == 'setremisepercent' && $usercancreate) { // $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2)); //} elseif ($action == 'setremiseabsolue' && $usercancreate) { diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index d4de338baaa..85f91c5760c 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2014-2017 Alexandre Spangaro + * Copyright (C) 2014-2024 Alexandre Spangaro * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Marcos García * Copyright (C) 2018-2024 Frédéric France @@ -145,9 +145,7 @@ if (empty($reshook)) { $object->pti_in_ctti = empty(GETPOST("pti_in_ctti")) ? 0 : 1; $object->address = trim(GETPOST("account_address", "alphanohtml")); - $object->domiciliation = $object->address; // deprecated - $object->proprio = trim(GETPOST("proprio", 'alphanohtml')); $object->owner_name = trim(GETPOST("proprio", 'alphanohtml')); $object->owner_address = trim(GETPOST("owner_address", 'alphanohtml')); $object->owner_zip = trim(GETPOST("owner_zip", 'alphanohtml')); @@ -263,7 +261,6 @@ if (empty($reshook)) { $object->iban = trim(GETPOST("iban")); $object->pti_in_ctti = empty(GETPOST("pti_in_ctti")) ? 0 : 1; - $object->proprio = trim(GETPOST("proprio", 'alphanohtml')); $object->owner_name = trim(GETPOST("proprio", 'alphanohtml')); $object->owner_address = trim(GETPOST("owner_address", 'alphanohtml')); $object->owner_zip = trim(GETPOST("owner_zip", 'alphanohtml')); @@ -951,7 +948,7 @@ if ($action == 'create') { // Ref print ''; - print ''; + print ''; // Label print ''; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index ef4d39c06f7..91f1a0644cd 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -737,20 +737,11 @@ class Account extends CommonObject if (empty($balance)) { $balance = 0; } - if (empty($this->address && !empty($this->domiciliation))) { - dol_syslog(get_class($this)."::create domiciliation is deprecated use address", LOG_NOTICE); - $this->address = $this->domiciliation; - } if (empty($this->status && !empty($this->clos))) { dol_syslog(get_class($this)."::create clos is deprecated use status", LOG_NOTICE); $this->status = $this->clos; } - if (empty($this->address && !empty($this->domiciliation))) { - dol_syslog(get_class($this)."::create domiciliation is deprecated use address", LOG_NOTICE); - $this->address = $this->domiciliation; - } - // Load the library to validate/check a BAN account require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; @@ -804,7 +795,7 @@ class Account extends CommonObject $sql .= ", '".$this->db->escape($this->iban)."'"; $sql .= ", '".$this->db->escape($this->address)."'"; $sql .= ", ".((int) $this->pti_in_ctti); - $sql .= ", '".$this->db->escape($this->owner_name ? $this->owner_name : $this->proprio)."'"; + $sql .= ", '".$this->db->escape($this->owner_name)."'"; $sql .= ", '".$this->db->escape($this->owner_address)."'"; $sql .= ", '".$this->db->escape($this->owner_zip)."'"; $sql .= ", '".$this->db->escape($this->owner_town)."'"; @@ -928,7 +919,7 @@ class Account extends CommonObject $sql .= ",iban_prefix = '".$this->db->escape($this->iban)."'"; $sql .= ",domiciliation='".$this->db->escape($this->address)."'"; $sql .= ",pti_in_ctti=".((int) $this->pti_in_ctti); - $sql .= ",proprio = '".$this->db->escape($this->owner_name ? $this->owner_name : $this->proprio)."'"; + $sql .= ",proprio = '".$this->db->escape($this->owner_name)."'"; $sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'"; $sql .= ",owner_zip = '".$this->db->escape($this->owner_zip)."'"; $sql .= ",owner_town = '".$this->db->escape($this->owner_town)."'"; @@ -1035,8 +1026,8 @@ class Account extends CommonObject $sql .= ",cle_rib='".$this->db->escape($this->cle_rib)."'"; $sql .= ",bic='".$this->db->escape($this->bic)."'"; $sql .= ",iban_prefix = '".$this->db->escape($this->iban)."'"; - $sql .= ",domiciliation='".$this->db->escape($this->address ? $this->address : $this->domiciliation)."'"; - $sql .= ",proprio = '".$this->db->escape($this->owner_name ? $this->owner_name : $this->proprio)."'"; + $sql .= ",domiciliation='".$this->db->escape($this->address)."'"; + $sql .= ",proprio = '".$this->db->escape($this->owner_name)."'"; $sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'"; $sql .= ",owner_zip = '".$this->db->escape($this->owner_zip)."'"; $sql .= ",owner_town = '".$this->db->escape($this->owner_town)."'"; @@ -1108,7 +1099,7 @@ class Account extends CommonObject $this->courant = $obj->type; $this->bank = $obj->bank; $this->clos = $obj->status; - $this->status = $obj->status; + $this->status = $obj->status; $this->rappro = $obj->rappro; $this->url = $obj->url; @@ -1118,16 +1109,17 @@ class Account extends CommonObject $this->cle_rib = $obj->cle_rib; $this->bic = $obj->bic; $this->iban = $obj->iban; - $this->domiciliation = $obj->address; $this->address = $obj->address; - $this->pti_in_ctti = $obj->pti_in_ctti; - $this->proprio = $obj->owner_name; + $this->owner_name = $obj->owner_name; + $this->proprio = $this->owner_name; $this->owner_address = $obj->owner_address; $this->owner_zip = $obj->owner_zip; $this->owner_town = $obj->owner_town; $this->owner_country_id = $obj->owner_country_id; + $this->pti_in_ctti = $obj->pti_in_ctti; + $this->state_id = $obj->state_id; $this->state_code = $obj->state_code; $this->state = $obj->state; @@ -1961,7 +1953,6 @@ class Account extends CommonObject $this->bank = 'MyBank'; $this->address = 'Rue de Paris'; - $this->proprio = 'Owner'; $this->owner_name = 'Owner'; $this->owner_address = 'Owner address'; $this->owner_zip = 'Owner zip'; diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 0e86ea1d235..54acfef3968 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1398,35 +1398,6 @@ if ($action == 'create') { } print ''; - // Help of substitution key - $dateexample = dol_now(); - if (!empty($object->frequency) && !empty($object->date_when)) { - $dateexample = $object->date_when; - } - - // Help of substitution key - $substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object); - - $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%m').')'; - $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%m').')'; - $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%m').')'; - $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%B').')'; - $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%B').')'; - $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B').')'; - $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'), '%Y').')'; - $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%Y').')'; - $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'), '%Y').')'; - // Only on template invoices - $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date(($object->date_when ? $object->date_when : dol_now()), 'dayhour').')'; - $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree(($object->date_when ? $object->date_when : dol_now()), $object->frequency, $object->unit_frequency), 'dayhour').')'; - $substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $object->nb_gen_done; - $substitutionarray['__INVOICE_COUNTER_MAX__'] = $object->nb_gen_max; - - $htmltext = ''.$langs->trans("FollowingConstantsWillBeSubstituted").':
'; - foreach ($substitutionarray as $key => $val) { - $htmltext .= $key.' = '.$langs->trans($val).'
'; - } - $htmltext .= '
'; // Bank Account print ''; - print ''; - // Note private - print ''; - print ''; // Model pdf print '"; - - if ($savingdocmask) { - //add a global variable for disable the auto renaming on upload - $rename = (!getDolGlobalString('MAIN_DOC_UPLOAD_NOT_RENAME_BY_DEFAULT') ? 'checked' : ''); - - $out .= ''; - if (!empty($options)) { - $out .= ''; - } - $out .= ''; - $out .= ''; - } - - $out .= "
'.img_picto('', 'filter', 'class="pictofixedwidth opacitymedium"').$form->textwithpicto($langs->trans("Filters"), $langs->trans("EmailCollectorFilterDesc")).'
'.$langs->trans("Ref").'
'.$langs->trans("Label").'
'; @@ -1450,21 +1421,7 @@ if ($action == 'create') { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; - // Note public - print '
'; - print $form->editfieldkey($form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic'), 'note_public', $object->note_public, $object, $user->hasRight('facture', 'creer')); - print ''; - print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $user->hasRight('facture', 'creer'), 'textarea:'.ROWS_4.':90%', '', null, null, '', 1); - print '
'; - print $form->editfieldkey($form->textwithpicto($langs->trans("NotePrivate"), $htmltext, 1, 'help', '', 0, 2, 'noteprivate'), 'note_private', $object->note_private, $object, $user->hasRight('facture', 'creer')); - print ''; - print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $user->hasRight('facture', 'creer'), 'textarea:'.ROWS_4.':90%', '', null, null, '', 1); - print '
'; diff --git a/htdocs/compta/facture/note-rec.php b/htdocs/compta/facture/note-rec.php new file mode 100644 index 00000000000..03ad7f844b3 --- /dev/null +++ b/htdocs/compta/facture/note-rec.php @@ -0,0 +1,208 @@ + + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2017 Ferran Marcet + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/compta/facture/note-rec.php + * \ingroup invoice + * \brief Fiche de notes sur une facture recurrent + */ + +// Load Dolibarr environment +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; + +if (isModEnabled('project')) { + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +} +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + + +// Load translation files required by the page +$langs->loadLangs(array('companies', 'bills')); + +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility +$ref = GETPOST('ref', 'alpha'); +$socid = GETPOSTINT('socid'); +$action = GETPOST('action', 'aZ09'); + +$objecttype = 'facture_rec'; +if ($action == "create" || $action == "add") { + $objecttype = ''; +} + +$object = new FactureRec($db); +// Load object +if ($id > 0 || !empty($ref)) { + $object->fetch($id, $ref); +} + +$permissionnote = $user->hasRight('facture', 'creer'); // Used by the include of actions_setnotes.inc.php + +// Security check +$socid = 0; +if ($user->socid) { + $socid = $user->socid; +} +$hookmanager->initHooks(array('invoicenote')); + +$result = restrictedArea($user, 'facture', $object->id, $objecttype); + +$usercancreate = $user->hasRight("facture", "creer"); + + +/* + * Actions + */ + +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once' +} + + + +/* + * View + */ + +$form = new Form($db); + +if (empty($object->id)) { + $title = $object->ref." - ".$langs->trans('Notes'); +} else { + $title = $langs->trans('Notes'); +} +$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; + +llxHeader('', $title, $helpurl); + +if (empty($object->id)) { + $langs->load('errors'); + echo '
'.$langs->trans("ErrorRecordNotFound").'
'; + llxFooter(); + exit; +} + + +if ($id > 0 ) { + $object = new FactureRec($db); + $object->fetch($id); + + $object->fetch_thirdparty(); + + $head = invoice_rec_prepare_head($object); + + $totalpaid = $object->getSommePaiement(); + + print dol_get_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill'); + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = ''; + if ($action != 'editref') { + $morehtmlref .= $form->editfieldkey($object->ref, 'ref', $object->ref, $object, 0, '', '', 0, 2); + } else { + $morehtmlref .= $form->editfieldval('', 'ref', $object->ref, $object, 0, 'string'); + } + + $morehtmlref .= '
'; + // Thirdparty + $morehtmlref .= $object->thirdparty->getNomUrl(1); + // Project + if (isModEnabled('project')) { + $langs->load("projects"); + $morehtmlref .= '
'; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify') { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); + } else { + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= $proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } + } + } + } + $morehtmlref .= '
'; + + $morehtmlstatus = ''; + + dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlstatus); + + print '
'; + print '
'; + + + $cssclass = "titlefield"; + + // Help of substitution key + $dateexample = dol_now(); + if (!empty($object->frequency) && !empty($object->date_when)) { + $dateexample = $object->date_when; + } + + $substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object); + + $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%m') . ')'; + $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%m') . ')'; + $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%m') . ')'; + $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%B') . ')'; + $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%B') . ')'; + $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B') . ')'; + $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'), '%Y') . ')'; + $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%Y') . ')'; + $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'), '%Y') . ')'; + // Only on template invoices + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(($object->date_when ? $object->date_when : dol_now()), 'dayhour') . ')'; + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree(($object->date_when ? $object->date_when : dol_now()), $object->frequency, $object->unit_frequency), 'dayhour') . ')'; + $substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $object->nb_gen_done; + $substitutionarray['__INVOICE_COUNTER_MAX__'] = $object->nb_gen_max; + + $htmltext = '' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':
'; + foreach ($substitutionarray as $key => $val) { + $htmltext .= $key . ' = ' . $langs->trans($val) . '
'; + } + $htmltext .= '
'; + + $textNotePub = $form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic', 2); + $textNotePrive = $form->textwithpicto($langs->trans("NotePrivate"), $htmltext, 1, 'help', '', 0, 2, 'noteprivate'); + include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; + + print dol_get_fiche_end(); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 89919a8b1d5..5a4faa32e62 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1458,7 +1458,7 @@ class BonPrelevement extends CommonObject $this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics); // Example "FR78ZZZ123456" - $this->raison_sociale = $account->proprio; + $this->raison_sociale = $account->owner_name; } $this->factures = $factures_prev_id; $this->context['factures_prev'] = $factures_prev; @@ -2533,7 +2533,7 @@ class BonPrelevement extends CommonObject $this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics); // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456"; - $this->raison_sociale = $account->proprio; + $this->raison_sociale = $account->owner_name; } // Get pending payments diff --git a/htdocs/core/ajax/box.php b/htdocs/core/ajax/box.php index 1324096d3d5..5771e4edbe9 100644 --- a/htdocs/core/ajax/box.php +++ b/htdocs/core/ajax/box.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007-2012 Laurent Destailleur * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -44,7 +45,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; $boxid = GETPOSTINT('boxid'); $boxorder = GETPOST('boxorder'); -$zone = GETPOST('zone'); // Can be '0' or '1' or 'pagename'... +$zone = GETPOST('zone'); // Can be key for zone +if ($zone !== '') { + $zone = (int) $zone; +} $userid = GETPOSTINT('userid'); // Security check diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index b6abf518289..8438a8d2e43 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -765,7 +765,7 @@ abstract class CommonDocGenerator $resarray[$array_key.'_bank_bic'] = (empty($bank_account) ? '' : $bank_account->bic); $resarray[$array_key.'_bank_label'] = (empty($bank_account) ? '' : $bank_account->label); $resarray[$array_key.'_bank_number'] = (empty($bank_account) ? '' : $bank_account->number); - $resarray[$array_key.'_bank_proprio'] = (empty($bank_account) ? '' : $bank_account->proprio); + $resarray[$array_key.'_bank_proprio'] = (empty($bank_account) ? '' : $bank_account->owner_name); $resarray[$array_key.'_bank_address'] = (empty($bank_account) ? '' : $bank_account->address); $resarray[$array_key.'_bank_state'] = (empty($bank_account) ? '' : $bank_account->state); $resarray[$array_key.'_bank_country'] = (empty($bank_account) ? '' : $bank_account->country); diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 64d2223ec1e..52de45fcc92 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -1884,7 +1884,7 @@ abstract class CommonInvoice extends CommonObject // If a bank account is provided and we ask to use it as creditor, we use the bank address // TODO In a future, we may always use this address, and if name/address/zip/town/country differs from $mysoc, we can use the address of $mysoc into the final seller field ? $s .= "S\n"; - $s .= dol_trunc($bankaccount->proprio, 70, 'right', 'UTF-8', 1)."\n"; + $s .= dol_trunc($bankaccount->owner_name, 70, 'right', 'UTF-8', 1)."\n"; $addresslinearray = explode("\n", $bankaccount->owner_address); $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php index ab048d5ab6a..bb7330e6ecc 100644 --- a/htdocs/core/class/commonstickergenerator.class.php +++ b/htdocs/core/class/commonstickergenerator.class.php @@ -253,7 +253,7 @@ abstract class CommonStickerGenerator extends CommonDocGenerator * Convert units (in to mm, mm to in) * $src and $dest must be 'in' or 'mm' * - * @param int $value value + * @param float $value value * @param string $src from ('in' or 'mm') * @param string $dest to ('in' or 'mm') * @return float value value after conversion diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 59001843f2d..d58b41eb02b 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -91,7 +91,7 @@ class FormFile * @param int<0,1> $capture 1=Add tag capture="capture" to force use of micro or video recording to generate file. When setting this to 1, you must also provide a value for $accept. * @param int<0,1> $disablemulti 0=Default, 1=Disable multiple file upload * @param int<0,1> $nooutput 0=Output result with print, 1=Return result - * @return int|string Return integer <0 if KO, >0 if OK, or string if $noouput=1 + * @return int|string|array Return integer <0 if KO, >0 if OK, or string if $noouput=1 or array if $nooutput=2 */ public function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = null, $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '', $usewithoutform = 0, $capture = 0, $disablemulti = 0, $nooutput = 0) { @@ -108,183 +108,193 @@ class FormFile $useajax = 0; } - if ((getDolGlobalString('MAIN_USE_JQUERY_FILEUPLOAD') && $useajax) || ($useajax == 2)) { - // TODO: Check this works with 2 forms on same page - // TODO: Check this works with GED module, otherwise, force useajax to 0 - // TODO: This does not support option savingdocmask - // TODO: This break feature to upload links too - // TODO: Thisdoes not work when param nooutput=1 - //return $this->_formAjaxFileUpload($object); - return 'Feature too bugged so removed'; - } else { - //If there is no permission and the option to hide unauthorized actions is enabled, then nothing is printed - if (!$perm && getDolGlobalString('MAIN_BUTTON_HIDE_UNAUTHORIZED')) { - if ($nooutput) { - return ''; - } else { - return 1; - } + //If there is no permission and the option to hide unauthorized actions is enabled, then nothing is printed + if (!$perm && getDolGlobalString('MAIN_BUTTON_HIDE_UNAUTHORIZED')) { + if ($nooutput) { + return ''; + } else { + return 1; } + } - $out = "\n\n".'
'."\n"; + // Section to generate the form to upload a new file + $out = "\n".'
'."\n"; + if ($nooutput != 2) { if (empty($title)) { $title = $langs->trans("AttachANewFile"); } if ($title != 'none') { $out .= load_fiche_titre($title, '', ''); } + } - if (empty($usewithoutform)) { // Try to avoid this and set instead the form by the caller. - // Add a param as GET parameter to detect when POST were cleaned by PHP because a file larger than post_max_size - $url .= (strpos($url, '?') === false ? '?' : '&').'uploadform=1'; + if (empty($usewithoutform)) { // Try to avoid this and set instead the form by the caller. + // Add a param as GET parameter to detect when POST were cleaned by PHP because a file larger than post_max_size + $url .= (strpos($url, '?') === false ? '?' : '&').'uploadform=1'; - $out .= '
'."\n"; - } - if (empty($usewithoutform) || $usewithoutform == 2) { - $out .= ''."\n"; - $out .= ''."\n"; - $out .= ''."\n"; - $out .= ''."\n"; - $out .= ''."\n"; - $out .= ''."\n"; + $out .= ''."\n"; + } + if (empty($usewithoutform) || $usewithoutform == 2) { + $out .= ''."\n"; + $out .= ''."\n"; + $out .= ''."\n"; + $out .= ''."\n"; + $out .= ''."\n"; + $out .= ''."\n"; + } + + $out .= ''; + $out .= ''; + + if (!empty($options)) { + $out .= ''; + } + + $out .= '"; + + if ($savingdocmask) { + //add a global variable for disable the auto renaming on upload + $rename = (!getDolGlobalString('MAIN_DOC_UPLOAD_NOT_RENAME_BY_DEFAULT') ? 'checked' : ''); - $out .= '
'.$options.''; + + $maxfilesizearray = getMaxFileSizeArray(); + $max = $maxfilesizearray['max']; + $maxmin = $maxfilesizearray['maxmin']; + $maxphptoshow = $maxfilesizearray['maxphptoshow']; + $maxphptoshowparam = $maxfilesizearray['maxphptoshowparam']; + if ($maxmin > 0) { + $out .= ''; // MAX_FILE_SIZE must precede the field type=file + } + $out .= 'load('link'); + $out .= ''; + $out .= ''; + $out .= ''; + } + $out .= 'trans("Cancel").'">'; + } + + if (getDolGlobalString('MAIN_UPLOAD_DOC')) { + if ($perm) { + $menudolibarrsetupmax = $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Security"); + $langs->load('other'); + $out .= ' '; + $out .= info_admin($langs->trans("ThisLimitIsDefinedInSetupAt", $menudolibarrsetupmax, $max, $maxphptoshowparam, $maxphptoshow), 1, 0, '1', 'classfortooltip'); } + } else { + $out .= ' ('.$langs->trans("UploadDisabled").')'; + } + $out .= "
'; $out .= ''; - if (!empty($options)) { $out .= ''; } + $out .= ''; + $out .= ''; + } - $out .= '
'.$options.''; + $out .= ' '; + $out .= ''; + $out .= '
'; + $out .= "
"; - $maxfilesizearray = getMaxFileSizeArray(); - $max = $maxfilesizearray['max']; - $maxmin = $maxfilesizearray['maxmin']; - $maxphptoshow = $maxfilesizearray['maxphptoshow']; - $maxphptoshowparam = $maxfilesizearray['maxphptoshowparam']; - if ($maxmin > 0) { - $out .= ''; // MAX_FILE_SIZE must precede the field type=file + if (empty($usewithoutform)) { + $out .= '
'; + if (empty($sectionid)) { + $out .= '
'; } - $out .= 'load('link'); - $out .= ''; - $out .= ''; - $out .= ''; + } + + $parameters = array('socid' => (isset($GLOBALS['socid']) ? $GLOBALS['socid'] : ''), 'id' => (isset($GLOBALS['id']) ? $GLOBALS['id'] : ''), 'url' => $url, 'perm' => $perm, 'options' => $options); + $res = $hookmanager->executeHooks('formattachOptionsUpload', $parameters, $object); + if (empty($res)) { + $out = '
'.$out.'
'; + } + $out .= $hookmanager->resPrint; + + $out .= "\n
\n"; + + + $out2 = ""; + + // Section to generate the form to upload a new file + if ($linkfiles) { + $out2 .= "\n".'
'."\n"; + $langs->load('link'); + + if ($nooutput != 2) { + $title = $langs->trans("LinkANewFile"); + $out2 .= load_fiche_titre($title, '', ''); } - $out .= 'trans("Cancel").'">'; - } - - if (getDolGlobalString('MAIN_UPLOAD_DOC')) { - if ($perm) { - $menudolibarrsetupmax = $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Security"); - $langs->load('other'); - $out .= ' '; - $out .= info_admin($langs->trans("ThisLimitIsDefinedInSetupAt", $menudolibarrsetupmax, $max, $maxphptoshowparam, $maxphptoshow), 1, 0, '1', 'classfortooltip'); - } - } else { - $out .= ' ('.$langs->trans("UploadDisabled").')'; - } - $out .= "
'.$options.''; - $out .= ' '; - $out .= ''; - $out .= '
"; if (empty($usewithoutform)) { - $out .= ''; - if (empty($sectionid)) { - $out .= '
'; - } + $out2 .= '
\n"; - - if ($linkfiles) { - $out .= "\n".'
'."\n"; - $langs->load('link'); - $title = $langs->trans("LinkANewFile"); - $out .= load_fiche_titre($title, '', ''); - - if (empty($usewithoutform)) { - $out .= ''."\n"; - $out .= ''."\n"; - $out .= ''."\n"; - $out .= ''."\n"; - $out .= ''."\n"; - } - - $out .= '
'; - $out .= '
'; - if (getDolGlobalString('OPTIMIZEFORTEXTBROWSER')) { - $out .= ' '; - } - $out .= ''; - $out .= '
'; - $out .= '
'; - if (getDolGlobalString('OPTIMIZEFORTEXTBROWSER')) { - $out .= ' '; - } - $out .= ''; - $out .= ''; - $out .= ''; - $out .= '
'; - $out .= '
'; - $out .= 'trans("URLToLink").': '; + } + $out2 .= ''; + $out2 .= '
'; + $out2 .= '
'; + if (getDolGlobalString('OPTIMIZEFORTEXTBROWSER')) { + $out2 .= ' '; + } + $out2 .= ''; + $out2 .= ''; + $out2 .= ''; + $out2 .= '
'; + $out2 .= '
'; + $out2 .= ' (isset($GLOBALS['socid']) ? $GLOBALS['socid'] : ''), 'id' => (isset($GLOBALS['id']) ? $GLOBALS['id'] : ''), 'url' => $url, 'perm' => $perm, 'options' => $options); $res = $hookmanager->executeHooks('formattachOptions', $parameters, $object); if (empty($res)) { - $out = '
'.$out.'
'; + $out2 = '
'.$out2.'
'; } - $out .= $hookmanager->resPrint; + $out2 .= $hookmanager->resPrint; - if ($nooutput) { - return $out; - } else { - print $out; - return 1; - } + $out2 .= "\n
\n"; + } + + + if ($nooutput == 2) { + return array('formToUploadAFile' => $out, 'formToAddALink' => $out2); + } elseif ($nooutput) { + return $out.$out2; + } else { + print $out.$out2; + return 1; } } @@ -1204,14 +1214,15 @@ class FormFile * @param int $addfilterfields Add the line with filters * @param int $disablecrop Disable crop feature on images (-1 = auto, prefer to set it explicitly to 0 or 1) * @param string $moreattrondiv More attributes on the div for responsive. Example 'style="height:280px; overflow: auto;"' + * @param array $moreoptions Add more options like array('afteruploadtitle', ...) * @return int Return integer <0 if KO, nb of files shown if OK * @see list_of_autoecmfiles() */ - public function list_of_documents($filearray, $object, $modulepart, $param = '', $forcedownload = 0, $relativepath = '', $permonobject = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $title = '', $url = '', $showrelpart = 0, $permtoeditline = -1, $upload_dir = '', $sortfield = '', $sortorder = 'ASC', $disablemove = 1, $addfilterfields = 0, $disablecrop = -1, $moreattrondiv = '') + public function list_of_documents($filearray, $object, $modulepart, $param = '', $forcedownload = 0, $relativepath = '', $permonobject = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $title = '', $url = '', $showrelpart = 0, $permtoeditline = -1, $upload_dir = '', $sortfield = '', $sortorder = 'ASC', $disablemove = 1, $addfilterfields = 0, $disablecrop = -1, $moreattrondiv = '', $moreoptions = array()) { // phpcs:enable global $user, $conf, $langs, $hookmanager, $form; - global $sortfield, $sortorder, $maxheightmini; + global $sortfield, $sortorder; global $dolibarr_main_url_root; if ($disablecrop == -1) { @@ -1295,15 +1306,25 @@ class FormFile $permtoeditline = 0; $permonobject = 0; } - - // Show list of existing files - if ((empty($useinecm) || $useinecm == 3 || $useinecm == 6) && $title != 'none') { - print load_fiche_titre($title ? $title : $langs->trans("AttachedFiles"), '', 'file-upload', 0, '', 'table-list-of-attached-files'); - } if (empty($url)) { $url = $_SERVER["PHP_SELF"]; } + + // Show title of list of existing files + $morehtmlright = ''; + if (!empty($moreoptions['showhideaddbutton']) && $conf->use_javascript_ajax) { + $morehtmlright .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', 'javascript:console.log("open add file form");jQuery(".divattachnewfile").toggle(); if (!jQuery(".divattachnewfile").is(":hidden")) { jQuery("input[type=\'file\']").click(); }', '', $permtoeditline); + } + + if ((empty($useinecm) || $useinecm == 3 || $useinecm == 6) && $title != 'none') { + print load_fiche_titre($title ? $title : $langs->trans("AttachedFiles"), $morehtmlright, 'file-upload', 0, '', 'table-list-of-attached-files'); + } + if (!empty($moreoptions) && $moreoptions['afteruploadtitle']) { + print '
'.$moreoptions['afteruploadtitle'].'
'; + } + + // Show the table print ''."\n"; if (GETPOST('action', 'aZ09') == 'editfile' && $permtoeditline) { print ''; @@ -1674,7 +1695,7 @@ class FormFile if ($nboflines > 1 && is_object($object)) { if (!empty($conf->use_javascript_ajax) && $permtoeditline) { - $table_element_line = 'ecm_files'; + $table_element_line = 'ecm_files'; // used by ajaxrow.tpl.php include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } } @@ -2093,11 +2114,13 @@ class FormFile * @param string $action Action * @param string $selected ??? * @param string $param More param to add into URL + * @param string $htmlname Html name of component + * @param array $moreoptions Add more options like array('afterlinktitle', ...) * @return int Number of links */ - public function listOfLinks($object, $permissiontodelete = 1, $action = null, $selected = null, $param = '') + public function listOfLinks($object, $permissiontodelete = 1, $action = null, $selected = null, $param = '', $htmlname = 'formaddlink', $moreoptions = array()) { - global $user, $conf, $langs, $user; + global $conf, $langs; global $sortfield, $sortorder; $langs->load("link"); @@ -2115,12 +2138,23 @@ class FormFile $res = $link->fetchAll($links, $object->element, $object->id, $sortfield, $sortorder); $param .= (isset($object->id) ? '&id='.$object->id : ''); + $permissiontoedit = $permissiontodelete; + print ''."\n"; - // Show list of associated links - print load_fiche_titre($langs->trans("LinkedFiles"), '', 'link', 0, '', 'table-list-of-links'); + $morehtmlright = ''; + if (!empty($moreoptions['showhideaddbutton']) && $conf->use_javascript_ajax) { + $morehtmlright .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', 'javascript:console.log("open addlink form"); jQuery(".divlinkfile").toggle();', '', $permissiontoedit); + } - print ''; + // Show list of associated links + print load_fiche_titre($langs->trans("LinkedFiles"), $morehtmlright, 'link', 0, '', 'table-list-of-links'); + + if (!empty($moreoptions) && $moreoptions['afterlinktitle']) { + print '
'.$moreoptions['afterlinktitle'].'
'; + } + + print ''; print ''; print ''; @@ -2175,11 +2209,10 @@ class FormFile if ($nboflinks > 0) { include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; } - foreach ($links as $link) { print ''; //edit mode - if ($action == 'update' && $selected === $link->id) { + if ($action == 'update' && $selected === (int) $link->id && $permissiontoedit) { print '
'; print ''; print ''; diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index f52675fa219..e7579678d18 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -218,7 +218,7 @@ class InfoBox * Save order of boxes for area and user * * @param DoliDB $dbs Database handler - * @param int $zone Name of area (0 for Homepage, ...) + * @param int $zone Key of area (0 for Homepage, ...) * @param string $boxorder List of boxes with correct order 'A:123,456,...-B:789,321...' * @param int $userid Id of user * @return int Return integer <0 if KO, 0=Nothing done, > 0 if OK diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 34f05db4c11..8ea08e7d52a 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -254,7 +254,7 @@ class Link extends CommonObject if ($num > 0) { while ($obj = $this->db->fetch_object($resql)) { $link = new Link($this->db); - $link->id = $obj->rowid; + $link->id = (int) $obj->rowid; $link->entity = $obj->entity; $link->datea = $this->db->jdate($obj->datea); $link->url = $obj->url; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 629dedc623d..774a92c47f0 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1283,7 +1283,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl print "\n"; $title = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("ContactsForCompany") : $langs->trans("ContactsAddressesForCompany")); - print load_fiche_titre($title, $newcardbutton, ''); + print load_fiche_titre($title, $newcardbutton, 'contact'); print ''; print ''; diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 541cd56bd41..df027a28200 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -116,7 +116,7 @@ function getServerTimeZoneInt($refgmtdate = 'now') * Add a delay to a date * * @param int $time Date timestamp (or string with format YYYY-MM-DD) - * @param int $duration_value Value of delay to add + * @param float $duration_value Value of delay to add * @param string $duration_unit Unit of added delay (d, m, y, w, h, i) * @param int $ruleforendofmonth Change the behavior of PHP over data-interval, 0 or 1 * @return int New timestamp @@ -128,16 +128,16 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforend return $time; } if ($duration_unit == 's') { - return $time + ($duration_value); + return $time + (int) ($duration_value); } if ($duration_unit == 'i') { - return $time + (60 * $duration_value); + return $time + (int) (60 * $duration_value); } if ($duration_unit == 'h') { - return $time + (3600 * $duration_value); + return $time + (int) (3600 * $duration_value); } if ($duration_unit == 'w') { - return $time + (3600 * 24 * 7 * $duration_value); + return $time + (int) (3600 * 24 * 7 * $duration_value); } $deltastring = 'P'; @@ -327,9 +327,9 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l /** Convert duration to hour * - * @param int $duration_value Duration value + * @param float $duration_value Duration value * @param string $duration_unit Duration unit - * @return int $result + * @return float $result */ function convertDurationtoHour($duration_value, $duration_unit) { diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index ef3ef705cb4..4c221d9f7fc 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -301,6 +301,23 @@ function invoice_rec_prepare_head($object) $head[$h][2] = 'agenda'; $h++; + if (!getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) { + $nbNote = 0; + if (!empty($object->note_private)) { + $nbNote++; + } + if (!empty($object->note_public)) { + $nbNote++; + } + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/note-rec.php?id='.$object->id; + $head[$h][1] = $langs->trans('Notes'); + if ($nbNote > 0) { + $head[$h][1] .= ''.$nbNote.''; + } + $head[$h][2] = 'note'; + $h++; + } + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 1a8bd763a3d..307c2e22dd8 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -813,18 +813,25 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text) $watermark_x = $w / 2; $watermark_y = $h / 3; $pdf->SetFont('', 'B', 40); - $pdf->SetTextColor(255, 192, 203); + $pdf->SetTextColor(255, 0, 0); //rotate $pdf->_out(sprintf('q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm', cos($watermark_angle), sin($watermark_angle), -sin($watermark_angle), cos($watermark_angle), $watermark_x * $k, ($h - $watermark_y) * $k, -$watermark_x * $k, -($h - $watermark_y) * $k)); //print watermark $pdf->SetAlpha(0.5); $pdf->SetXY($watermark_x_pos, $watermark_y_pos); + + // set alpha to semi-transparency + $pdf->SetAlpha(0.3); $pdf->Cell($w - 20, 25, $outputlangs->convToOutputCharset($text), "", 2, "C", 0); + //antirotate $pdf->_out('Q'); $pdf->SetXY($savx, $savy); + + // Restore alpha + $pdf->SetAlpha(1); } @@ -949,9 +956,9 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, $pdf->SetFont('', '', $default_font_size - $diffsizecontent); - if (empty($onlynumber) && (!empty($account->domiciliation) || !empty($account->address))) { + if (empty($onlynumber) && !empty($account->address)) { $pdf->SetXY($curx, $cury); - $val = $outputlangs->transnoentities("Residence").': '.$outputlangs->convToOutputCharset(empty($account->address) ? $account->domiciliation : $account->address); + $val = $outputlangs->transnoentities("Residence").': '.$outputlangs->convToOutputCharset($account->address); $pdf->MultiCell(100, 3, $val, 0, 'L', 0); //$nboflines=dol_nboflines_bis($val,120); //$cury+=($nboflines*3)+2; @@ -1009,7 +1016,7 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, * @param ?Societe $fromcompany Object company * @param int $marge_basse Margin bottom we use for the autobreak * @param int $marge_gauche Margin left (no more used) - * @param int $page_hauteur Page height + * @param float $page_hauteur Page height * @param CommonObject $object Object shown in PDF * @param int<0,3> $showdetails Show company address details into footer (0=Nothing, 1=Show address, 2=Show managers, 3=Both) * @param int $hidefreetext 1=Hide free text, 0=Show free text @@ -1424,8 +1431,8 @@ function pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w, * @param Translate $outputlangs Object lang for output * @param int $w Width * @param int $h Height - * @param int $posx Pos x - * @param int $posy Pos y + * @param float $posx Pos x + * @param float $posy Pos y * @param int<0,1> $hideref Hide reference * @param int<0,1> $hidedesc Hide description * @param int<0,1> $issupplierline Is it a line for a supplier object ? @@ -2508,7 +2515,15 @@ function pdf_getLinkedObjects(&$object, $outputlangs) '@phan-var-force array $objects'; $outputlangs->load('orders'); - if (count($objects) == 1) { + if (count($objects) > 1 && count($objects) <= (getDolGlobalInt("MAXREFONDOC") ? getDolGlobalInt("MAXREFONDOC") : 10)) { + if (empty($object->context['DolPublicNoteAppendedGetLinkedObjects'])) { // Check if already appended before add to avoid repeat data + $object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities("RefOrder").' :'); + foreach ($objects as $elementobject) { + $object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities($elementobject->ref).(empty($elementobject->ref_client) ? '' : ' ('.$elementobject->ref_client.')').(empty($elementobject->ref_supplier) ? '' : ' ('.$elementobject->ref_supplier.')').' '); + $object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities("OrderDate").' : '.dol_print_date($elementobject->date, 'day', '', $outputlangs)); + } + } + } elseif (count($objects) == 1) { $elementobject = array_shift($objects); $linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder"); $linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref).(!empty($elementobject->ref_client) ? ' ('.$elementobject->ref_client.')' : '').(!empty($elementobject->ref_supplier) ? ' ('.$elementobject->ref_supplier.')' : ''); @@ -2542,9 +2557,9 @@ function pdf_getLinkedObjects(&$object, $outputlangs) $refListsTxt = ''; if (empty($object->linkedObjects['commande']) && $object->element != 'commande') { - $refListsTxt.= $outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' :'; + $refListsTxt .= $outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' :'; } else { - $refListsTxt.=$outputlangs->transnoentities("RefSending").' :'; + $refListsTxt .= $outputlangs->transnoentities("RefSending").' :'; } // We concat this record info into fields xxx_value. title is overwrote. foreach ($objects as $elementobject) { @@ -2559,16 +2574,18 @@ function pdf_getLinkedObjects(&$object, $outputlangs) } } } - $refListsTxt.= (!empty($refListsTxt)?' ':''); + $refListsTxt .= (!empty($refListsTxt) ? ' ' : ''); if (! is_object($order)) { - $refListsTxt.= $outputlangs->transnoentities($elementobject->ref); + $refListsTxt .= $outputlangs->transnoentities($elementobject->ref); } else { - $refListsTxt.= $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); - $refListsTxt.= ' / '.$outputlangs->transnoentities($elementobject->ref); + $refListsTxt .= $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''); + $refListsTxt .= ' / '.$outputlangs->transnoentities($elementobject->ref); } } - $object->note_public = dol_concatdesc($object->note_public, $refListsTxt); + if (empty($object->context['DolPublicNoteAppendedGetLinkedObjects'])) { // Check if already appended before add to avoid repeat data + $object->note_public = dol_concatdesc($object->note_public, $refListsTxt); + } } elseif (count($objects) == 1) { $elementobject = array_shift($objects); $order = null; @@ -2606,6 +2623,8 @@ function pdf_getLinkedObjects(&$object, $outputlangs) } } + $object->context['DolPublicNoteAppendedGetLinkedObjects'] = 1; + // For add external linked objects if (is_object($hookmanager)) { $parameters = array('linkedobjects' => $linkedobjects, 'outputlangs' => $outputlangs); diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 58b96ef6057..1f1cb081421 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -34,7 +34,7 @@ * @param string $chain string to encode * @param string $key rule to use for delta ('0', '1' or 'myownkey') * @return string encoded string - * @see dol_decode() + * @see dol_decode(), dolEncrypt() */ function dol_encode($chain, $key = '1') { @@ -65,7 +65,7 @@ function dol_encode($chain, $key = '1') * @param string $chain string to decode * @param string $key rule to use for delta ('0', '1' or 'myownkey') * @return string decoded string - * @see dol_encode() + * @see dol_encode(), dolDecrypt */ function dol_decode($chain, $key = '1') { @@ -107,10 +107,13 @@ function dolGetRandomBytes($length) return bin2hex(openssl_random_pseudo_bytes((int) floor($length / 2))); // the bin2hex will double the number of bytes so we take length / 2. May be very slow on Windows. } + +define('MAIN_SECURITY_REVERSIBLE_ALGO', 'AES-256-CTR'); + /** * Encode a string with a symmetric encryption. Used to encrypt sensitive data into database. * Note: If a backup is restored onto another instance with a different $conf->file->instance_unique_id, then decoded value will differ. - * This function is called for example by dol_set_const() when saving a sensible data into database configuration table llx_const. + * This function is called for example by dol_set_const() when saving a sensible data into database, like into configuration table llx_const, or societe_rib, ... * * @param string $chain String to encode * @param string $key If '', we use $conf->file->instance_unique_id (so $dolibarr_main_instance_unique_id in conf.php) @@ -120,7 +123,7 @@ function dolGetRandomBytes($length) * @since v17 * @see dolDecrypt(), dol_hash() */ -function dolEncrypt($chain, $key = '', $ciphering = 'AES-256-CTR', $forceseed = '') +function dolEncrypt($chain, $key = '', $ciphering = '', $forceseed = '') { global $conf; global $dolibarr_disable_dolcrypt_for_debug; @@ -139,7 +142,7 @@ function dolEncrypt($chain, $key = '', $ciphering = 'AES-256-CTR', $forceseed = $key = $conf->file->instance_unique_id; } if (empty($ciphering)) { - $ciphering = 'AES-256-CTR'; + $ciphering = constant('MAIN_SECURITY_REVERSIBLE_ALGO'); } $newchain = $chain; diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index bfa428bb13b..f8a99d51d40 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -244,6 +244,7 @@ class doc_generic_bom_odt extends ModelePDFBom $object->fetch_thirdparty(); $object->fetch_product(); + $object->calculateCosts(); $dir = $conf->bom->multidir_output[isset($object->entity) ? $object->entity : 1]; $objectref = dol_sanitizeFileName($object->ref); @@ -260,13 +261,13 @@ class doc_generic_bom_odt extends ModelePDFBom } if (file_exists($dir)) { - //print "srctemplatepath=".$srctemplatepath; // Src filename + // print "srctemplatepath=".$srctemplatepath; // Src filename $newfile = basename($srctemplatepath); $newfiletmp = preg_replace('/\.od[ts]/i', '', $newfile); $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); $newfiletmp = $objectref . '_' . $newfiletmp; - //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; + // $file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { @@ -279,10 +280,6 @@ class doc_generic_bom_odt extends ModelePDFBom $filename = $newfiletmp . '.' . $newfileformat; } $file = $dir . '/' . $filename; - //print "newdir=".$dir; - //print "newfile=".$newfile; - //print "file=".$file; - //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->bom->dir_temp); if (!is_writable($conf->bom->dir_temp)) { @@ -454,7 +451,6 @@ class doc_generic_bom_odt extends ModelePDFBom } // Call the beforeODTSave hook - $parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray); $reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index de620ae12d3..b688c5f2232 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -1491,7 +1491,7 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); - $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->proprio), 0, 'L', 0); + $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', 0); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index f2c1cba7aad..48d5c82111f 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -158,7 +158,8 @@ class modSalaries extends DolibarrModules $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'user as u'; - $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'payment_salary as p ON p.fk_user = u.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'salary as s ON s.fk_user = u.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'payment_salary as p ON p.fk_salary = s.rowid'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as cp ON p.fk_typepayment = cp.id'; $this->export_sql_end[$r] .= ' AND u.entity IN ('.getEntity('user').')'; } diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php index cdbf0b9f13f..27b79ba5c41 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php @@ -800,7 +800,7 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments if ($resql) { $obj = $this->db->fetch_object($resql); if ($obj) { - $iban = $obj->iban; + $iban = dolDecrypt($obj->iban); } } diff --git a/htdocs/core/tpl/ajaxrow.tpl.php b/htdocs/core/tpl/ajaxrow.tpl.php index d907eeddd81..d663e8380a5 100644 --- a/htdocs/core/tpl/ajaxrow.tpl.php +++ b/htdocs/core/tpl/ajaxrow.tpl.php @@ -14,14 +14,16 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * Javascript code to activate drag and drop on lines - * You can use this if you want to be able to drag and drop rows of a table. + */ + +/** + * Javascript code to activate the drag and drop on lines + * You can use this if you want to be able to drag and drop rows of a HTML table. * You must add id="tablelines" on table level tag - * and $object and $object->id is defined - * and $object->fk_element or $fk_element is defined - * and have ($nboflines or count($object->lines) or count($taskarray) > 0) - * and have $table_element_line = 'tablename' or $object->table_element_line with line to move + * $object and $object->id must be defined + * $object->fk_element or $fk_element must be defined + * you must have ($nboflines or count($object->lines) or count($taskarray) > 0) + * you must have $table_element_line = 'tablename' or $object->table_element_line with line to move * */ diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index edd28d97d57..2ad340e463c 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -211,8 +211,9 @@ foreach ($object->fields as $key => $val) { print '
'; -print '
'; - +if (empty($nounderbanner)) { + print '
'; +} print ''; print $rightpart; diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index ecfac1f560c..638871704db 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -124,8 +124,8 @@ if (empty($formfile) || !is_object($formfile)) { $formfile = new FormFile($db); } -// Show upload form (document and links) -$formfile->form_attach_new_file( +// Get the form to add files (upload and links) +$tmparray = $formfile->form_attach_new_file( $_SERVER["PHP_SELF"].'?id='.$object->id.(empty($withproject) ? '' : '&withproject=1').(empty($moreparam) ? '' : $moreparam), '', 0, @@ -135,10 +135,20 @@ $formfile->form_attach_new_file( $object, '', 1, - $savingdocmask + $savingdocmask, + 1, + 'formuserfile', + '', + '', + 0, + 0, + 0, + 2 ); -//var_dump($modulepart);var_dump($upload_dir); +$formToUploadAFile = $tmparray['formToUploadAFile']; +$formToAddALink = $tmparray['formToAddALink']; + // List of document $formfile->list_of_documents( @@ -159,11 +169,26 @@ $formfile->list_of_documents( $upload_dir, $sortfield, $sortorder, - $disablemove + $disablemove, + 0, + -1, + '', + array('afteruploadtitle' => $formToUploadAFile, 'showhideaddbutton' => 1) +); + + +print "

"; + + +//List of links +$formfile->listOfLinks( + $object, + $permission, + $action, + GETPOSTINT('linkid'), + $param, + 'formaddlink', + array('afterlinktitle' => $formToAddALink, 'showhideaddbutton' => 1) ); print "
"; - -//List of links -$formfile->listOfLinks($object, $permission, $action, GETPOSTINT('linkid'), $param); -print "
"; diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 4f56f9c6435..8f48e41e1e0 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -117,7 +117,7 @@ print '
'."\n print '
'."\n"; $editmode = (GETPOST('action', 'aZ09') == 'edit'.$note_public); print '
'."\n"; -print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdatapub, $moreparam, '', 0); +print $form->editfieldkey((empty($textNotePub) ? "NotePublic" : $textNotePub), $note_public, $value_public, $object, $permission, $typeofdatapub, $moreparam, '', 0); print '
'."\n"; print '
'."\n"; print $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdatapub, '', null, null, $moreparam, 1)."\n"; @@ -128,7 +128,7 @@ if (empty($user->socid)) { print '
'."\n"; $editmode = (GETPOST('action', 'aZ09') == 'edit'.$note_private); print '
'."\n"; - print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdatapriv, $moreparam, '', 0); + print $form->editfieldkey((empty($textNotePrive) ? "NotePrivate" : $textNotePrive), $note_private, $value_private, $object, $permission, $typeofdatapriv, $moreparam, '', 0); print '
'."\n"; print '
'."\n"; print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdatapriv, '', null, null, $moreparam, 1); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 994e8fb7ca0..30d1daa1c49 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1589,7 +1589,7 @@ if ($action == 'create') { if ($origin == "commande") { $cond_reglement_id = 0; $mode_reglement_id = 0; - $delivery_date = ''; + $datelivraison = ''; $objectsrc->note_private = ''; $objectsrc->note_public = ''; if ($societe = $object->thirdparty) { @@ -1613,9 +1613,9 @@ if ($action == 'create') { $demand_reason_id = (!empty($objectsrc->demand_reason_id) ? $objectsrc->demand_reason_id : (!empty($soc->demand_reason_id) ? $soc->demand_reason_id : 0)); //$remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_supplier_percent) ? $soc->remise_supplier_percent : 0)); //$remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); - $dateinvoice = !getDolGlobalString('MAIN_AUTOFILL_DATE') ? -1 : ''; + $dateinvoice = getDolGlobalString('MAIN_AUTOFILL_DATE') ? '' : -1; - $datedelivery = (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : ''); + $datelivraison = (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : ''); if (isModEnabled("multicurrency")) { if (!empty($objectsrc->multicurrency_code)) { @@ -1748,7 +1748,9 @@ if ($action == 'create') { $usehourmin = 1; } print img_picto('', 'action', 'class="pictofixedwidth"'); + print $form->selectDate($datelivraison ? $datelivraison : -1, 'liv_', $usehourmin, $usehourmin, 0, "set"); + print ''; // Bank Account diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index ee7e72f277c..a24dbe91e71 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -6,7 +6,7 @@ * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2012 Cedric Salvador - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015-2024 Alexandre Spangaro * Copyright (C) 2016 Meziane Sof * Copyright (C) 2017-2024 Frédéric France * Copyright (C) 2023-2024 Nick Fragoulis @@ -28,7 +28,7 @@ /** * \file htdocs/fourn/facture/card-rec.php - * \ingroup invoice fournisseurs + * \ingroup supplier invoice * \brief Page to show predefined invoice */ @@ -480,7 +480,7 @@ if (empty($reshook)) { } if ($qty < 0) { $langs->load("errors"); - setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors'); + setEventMessages($langs->trans('ErrorQtyForSupplierInvoiceCantBeNegative'), null, 'errors'); $error++; } @@ -821,7 +821,7 @@ if (empty($reshook)) { } if ($qty < 0) { $langs->load("errors"); - setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors'); + setEventMessages($langs->trans('ErrorQtyForSupplierInvoiceCantBeNegative'), null, 'errors'); $error++; } @@ -933,7 +933,7 @@ if ($action == 'create') { print ''; // Third party - print '
'; + print ''; print ''; // Invoice subtype @@ -946,7 +946,7 @@ if ($action == 'create') { $note_public = GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : $object->note_public; $note_private = GETPOSTISSET('note_private') ? GETPOST('note_private', 'restricthtml') : $object->note_private; - // Help of substitution key + // Help for substitution key $substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object); $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m') . ')'; diff --git a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql index 04f14b80010..e158fed274f 100644 --- a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql +++ b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql @@ -53,6 +53,8 @@ ALTER TABLE llx_hrm_evaluation MODIFY COLUMN modelpdf varchar(255) DEFAULT NULL; DROP TABLE llx_contratdet_log; +ALTER TABLE llx_societe_rib MODIFY COLUMN iban_prefix varchar(60); + -- add billable attribute to project task ALTER TABLE llx_projet_task ADD COLUMN billable smallint DEFAULT 1; diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 43fdfc814f3..2fd897df015 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -313,7 +313,7 @@ drop table tmp_societe_double; -- Sequence to removed duplicated values of llx_accounting_account. Run several times if you still have duplicate. drop table tmp_accounting_account_double; --select account_number, fk_pcg_version, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_accounting_account where label is not null group by account_number, fk_pcg_version having count(rowid) >= 2; -create table tmp_accounting_account_double as (select account_number, fk_pcg_version, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_accounting_account where label is not null group by account_number, fk_pcg_version having count(rowid) >= 2); +create table tmp_accounting_account_double as (select account_number, fk_pcg_version, entity, max(rowid) as max_rowid, count(rowid) as count_rowid from llx_accounting_account where label is not null group by account_number, fk_pcg_version, entity having count(rowid) >= 2); --select * from tmp_accounting_account_double; delete from llx_accounting_account where (rowid) in (select max_rowid from tmp_accounting_account_double); --update to avoid duplicate, delete to delete drop table tmp_accounting_account_double; diff --git a/htdocs/install/mysql/tables/llx_societe_rib.sql b/htdocs/install/mysql/tables/llx_societe_rib.sql index f9657e79762..064cc203131 100644 --- a/htdocs/install/mysql/tables/llx_societe_rib.sql +++ b/htdocs/install/mysql/tables/llx_societe_rib.sql @@ -39,7 +39,7 @@ create table llx_societe_rib bic varchar(20), -- 11 according to ISO 9362 (we keep 20 for backward compatibility) bic_intermediate varchar(11), -- 11 according to ISO 9362. Same as bic but for intermediate bank - iban_prefix varchar(34), -- full iban. 34 according to ISO 13616 + iban_prefix varchar(60), -- full iban. 34 according to ISO 13616 ut we set 60 to allow to store it with encryption information domiciliation varchar(255), proprio varchar(60), diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index bcfebcbc286..feb598ef0c9 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2576,3 +2576,8 @@ YouHaveALargeAmountOfRecordOnLists=You have a default max size for lists set to RoundBorders=Round borders CheckIfModuleIsNotBlackListed=Block install for modules found into the Remote blacklist CheckIfModuleIsNotBlackListedHelp=Some modules may be provided by some companies that do not respect the project's rules of goodwill (non-compliance with GDPR, violation of the rules tof use the Dolibarr brand name, etc.). By checking this box, a request will be made to the project server to see if a report was received about this module, and will protect you by blocking the deployment of flagged modules +DatabaseEncryption=Encryption in database +AlgorithmFor=Algorithm for: %s +SensitiveData=Sensitive data +ToolToDecryptAString=Tool to decrypt a string +Decrypt=Decrypt diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index ecc1019ff89..3d43e231d68 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -142,6 +142,7 @@ ErrorFieldCantBeNegativeOnInvoice=Field %s cannot be negative o ErrorLinesCantBeNegativeForOneVATRate=Total of lines (net of tax) can't be negative for a given not null VAT rate (Found a negative total for VAT rate %s%%). ErrorLinesCantBeNegativeOnDeposits=Lines can't be negative in a deposit. You will face problems when you will need to consume the deposit in final invoice if you do so. ErrorQtyForCustomerInvoiceCantBeNegative=Quantity for line into customer invoices can't be negative +ErrorQtyForSupplierInvoiceCantBeNegative=Quantity for line into supplier invoices can't be negative ErrorWebServerUserHasNotPermission=User account %s used to execute web server has no permission for that ErrorNoActivatedBarcode=No barcode type activated ErrUnzipFails=Failed to unzip %s with ZipArchive diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 5ea5e979b71..25080796a91 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -312,7 +312,7 @@ GlobalVariableUpdaterHelpFormat1=Format for request is {"URL": "http://example.c UpdateInterval=Update interval (minutes) LastUpdated=Latest update CorrectlyUpdated=Correctly updated -PropalMergePdfProductActualFile=Files use to add into PDF Azur are/is +PropalMergePdfProductActualFile=PDF file to include into the PDF proposals if the product is part of the proposal... PropalMergePdfProductChooseFile=Select PDF files IncludingProductWithTag=Including products/services with the tag DefaultPriceRealPriceMayDependOnCustomer=Default price, real price may depend on customer diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index ad2e76bdcf7..3f7159c11c5 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -287,75 +287,75 @@ if ($id > 0 || !empty($ref)) { // Fields title search // -------------------------------------------------------------------- - print ''; + print ''; // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; } // invoice ref - print ''; + print ''; // company name - print ''; + print ''; // customer code - print ''; + print ''; // invoice date - print ''; // selling price - print ''; + print ''; // buying price - print ''; + print ''; // qty - print ''; + print ''; // margin - print ''; + print ''; // margin rate if (getDolGlobalString('DISPLAY_MARGIN_RATES')) { - print ''; + print ''; } // mark rate if (getDolGlobalString('DISPLAY_MARK_RATES')) { - print ''; + print ''; } // status - print ''; + print ''; // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; } print ''."\n"; diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 95b670ec030..e6aaf448e6e 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -1003,7 +1003,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $reg = []; $qtyhourservice = 0; if (preg_match('/^(\d+)([a-z]+)$/', $tmpproduct->duration, $reg)) { - $qtyhourservice = convertDurationtoHour((int) $reg[1], (string) $reg[2]); + $qtyhourservice = convertDurationtoHour((float) $reg[1], (string) $reg[2]); } $qtyhourforline = 0; if ($line->fk_unit) { diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index ca919daa86e..a1b8307f909 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -330,11 +330,11 @@ if ($id > 0 || !empty($ref)) { print load_fiche_titre($langs->trans("ProductParentList"), '', ''); - print '
' . $langs->trans("Customer") . '' . $object->thirdparty->getNomUrl(1, 'customer') . '
' . $langs->trans("Supplier") . '' . $object->thirdparty->getNomUrl(1, 'supplier') . '
'; + print ''; $searchpicto = $form->showFilterButtons('left'); print $searchpicto; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; + print ''; print '
'; print $form->selectDate($search_invoice_date_start ?: -1, 'search_invoice_date_start_', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); print '
'; print '
'; print $form->selectDate($search_invoice_date_end ?: -1, 'search_invoice_date_end_', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); print '
'; - print ''; + print '
'; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; + print ''; $searchpicto = $form->showFilterButtons(); print $searchpicto; - print ''; + print '
'; + print '
'; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; if (count($prodsfather) > 0) { foreach ($prodsfather as $value) { @@ -374,33 +374,33 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; - print '
'.$langs->trans('ParentProducts').''.$langs->trans('Label').''.$langs->trans('Qty').''.$langs->trans('ParentProducts').''.$langs->trans('Label').''.$langs->trans('Qty').'
'; + print '
'; print ''; // Rank - print ''; + print ''; // Product ref - print ''; + print ''; // Product label - print ''; + print ''; // Min supplier price - print ''; + print ''; // Min customer price - print ''; + print ''; // Stock if (isModEnabled('stock')) { - print ''; + print ''; } // Hook fields $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Qty in kit - print ''; + print ''; // Stoc inc/dev - print ''; + print ''; // Move - print ''; + print ''; print ''."\n"; $totalsell = 0; diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 3caedef6f8f..1810189307d 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -25,7 +25,7 @@ /** * \file htdocs/product/document.php * \ingroup product - * \brief Page des documents joints sur les produits + * \brief Page of documents attached to products/services */ @@ -211,7 +211,7 @@ if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) { llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'mod-product page-card_document'); -if ($object->id) { +if ($object->id > 0) { $head = product_prepare_head($object); $titre = $langs->trans("CardProduct".$object->type); $picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product'); @@ -317,14 +317,15 @@ if ($object->id) { print Form::selectarray('lang_id', $langs_available, $default_lang, 0, 0, 0, '', 0, 0, 0, 'ASC'); if (getDolGlobalInt('MAIN_MULTILANGS')) { - print ''; + print ''; } print ''; } foreach ($filearray as $filetoadd) { - if ($ext = pathinfo($filetoadd['name'], PATHINFO_EXTENSION) == 'pdf') { + $ext = pathinfo($filetoadd['name'], PATHINFO_EXTENSION); + if ($ext == 'pdf') { $checked = ''; $filename = $filetoadd['name']; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 50b78c18ae6..6a98d84eedc 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -7,6 +7,7 @@ * Copyright (C) 2019 Pierre Ardoin * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2024 MDW * * 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 @@ -332,7 +333,7 @@ if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight("pr $sql .= $db->plimit($max, 0); //print $sql; - $lastmodified=""; + $lastmodified = ""; $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index d8a18e9c67f..a7d0a4351ac 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1986,7 +1986,7 @@ while ($i < $imaxinloop) { foreach ($arraypricelevel as $key => $value) { if (!empty($arrayfields['p.sellprice'.$key]['checked'])) { print '"; print ''; - print ''; + print ''; print "\n"; print '
'.$langs->trans('Position').''.$langs->trans('Position').''.$langs->trans('ComposedProduct').''.$langs->trans('ComposedProduct').''.$langs->trans('Label').''.$langs->trans('Label').''.$langs->trans('MinSupplierPrice').''.$langs->trans('MinSupplierPrice').''.$langs->trans('MinCustomerPrice').''.$langs->trans('MinCustomerPrice').''.$langs->trans('Stock').''.$langs->trans('Stock').''.$langs->trans('Qty').''.$langs->trans('Qty').''.$langs->trans('ComposedProductIncDecStock').''.$langs->trans('ComposedProductIncDecStock').'
'; - if (!empty($productpricescache[$obj->rowid])) { + if (!empty($productpricescache[$obj->rowid]) && isset($productpricescache[$obj->rowid][$key]['price_base_type'])) { if ($productpricescache[$obj->rowid][$key]['price_base_type'] == 'TTC') { print ''.price($productpricescache[$obj->rowid][$key]['price_ttc']).' '.$langs->trans("TTC").''; } else { diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 6317d870845..a31ed63e283 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -2779,36 +2779,36 @@ if ((!getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || $action == 'showlog_defau print ''."\n"; print '
'."\n"; - print ''."\n"; + print '
'."\n"; print ''; - print ''; + print ''; + print ''; } if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { - print ''; + print ''; } - print ''; + print ''; if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { - print ''; + print ''; } - print ''; - print ''; + print ''; + print ''; if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") { - print ''; + print ''; } if (isModEnabled('dynamicprices')) { - print ''; + print ''; } - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; if ($user->hasRight('produit', 'supprimer')) { - print ''; + print ''; } print ''; diff --git a/htdocs/product/price_suppliers.php b/htdocs/product/price_suppliers.php index eb84ed75547..c51b8ffc7f2 100644 --- a/htdocs/product/price_suppliers.php +++ b/htdocs/product/price_suppliers.php @@ -507,7 +507,7 @@ if ($id > 0 || $ref) { $events = array(); $events[] = array('method' => 'getVatRates', 'url' => dol_buildpath('/core/ajax/vatrates.php', 1), 'htmlname' => 'tva_tx', 'params' => array()); $filter = '(fournisseur:=:1) AND (status:=:1)'; - print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company(GETPOST("id_fourn", 'alpha'), 'id_fourn', $filter, 'SelectThirdParty', 0, 0, $events); + print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company(GETPOST("id_fourn", 'alpha'), 'id_fourn', $filter, $langs->transnoentitiesnoconv('SelectThirdParty'), 0, 0, $events); $parameters = array('filter'=>$filter, 'html_name'=>'id_fourn', 'selected'=>GETPOST("id_fourn"), 'showempty'=>1, 'prod_id'=>$object->id); $reshook = $hookmanager->executeHooks('formCreateThirdpartyOptions', $parameters, $object, $action); @@ -997,8 +997,9 @@ if ($id > 0 || $ref) { print ''; // Suppliers list title + print ''."\n"; print '
'; - print '
'.$langs->trans("AppliedPricesFrom").''.$langs->trans("AppliedPricesFrom").''; if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { - print ''.$langs->trans("PriceLevel").''.$langs->trans("PriceLevel").''.$langs->trans("Type").''.$langs->trans("Type").''.$langs->trans("PriceBase").''.$langs->trans("PriceBase").''.$langs->trans("DefaultTaxRate").''.$langs->trans("DefaultTaxRate").''.$langs->trans("HT").''.$langs->trans("TTC").''.$langs->trans("HT").''.$langs->trans("TTC").''.$langs->trans("INCT").''.$langs->trans("INCT").''.$langs->trans("PriceExpressionSelected").''.$langs->trans("PriceExpressionSelected").''.$langs->trans("MinPrice").' '.$langs->trans("HT").''.$langs->trans("MinPrice").' '.$langs->trans("TTC").''.$langs->trans("Label").''.$langs->trans("ChangedBy").''.$langs->trans("MinPrice").' '.$langs->trans("HT").''.$langs->trans("MinPrice").' '.$langs->trans("TTC").''.$langs->trans("Label").''.$langs->trans("ChangedBy").'  
'; + print '
'; $param = "&id=".$object->id; diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index f46feb5b2cc..4d95ca988e6 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -266,9 +266,9 @@ if ($result || !($id > 0)) { } if ($mode != 'byunit') { - print ''; + print ''; } else { - print ''; + print ''; } if ($type == '0') { print $langs->trans("StatsByNumberOfUnitsProducts"); diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index dd89d8023d5..6613ada99f3 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -83,12 +83,12 @@ class Task extends CommonObjectLine public $description; /** - * @var float|'' total of time spent on this task + * @var int|'' total of time spent on this task (in seconds) */ public $duration_effective; /** - * @var float|'' planned workload + * @var int|'' planned workload (in seconds) */ public $planned_workload; diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 4672753c82a..709a817c7f9 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -708,21 +708,24 @@ if ($event->type == 'payout.created') { if ($idthirdparty > 0) { // If the payment mode attached is to a stripe account owned by an external customer in societe_account (so a thirdparty that has a Stripe account), // we can create the payment mode - $companypaymentmode->stripe_card_ref = $db->escape($event->data->object->id); + $companypaymentmode->stripe_card_ref = $event->data->object->id; $companypaymentmode->fk_soc = $idthirdparty; $companypaymentmode->bank = null; $companypaymentmode->label = ''; - $companypaymentmode->number = $db->escape($event->data->object->id); - $companypaymentmode->last_four = $db->escape($event->data->object->card->last4); - $companypaymentmode->card_type = $db->escape($event->data->object->card->branding); - $companypaymentmode->proprio = $db->escape($event->data->object->billing_details->name); + $companypaymentmode->number = $event->data->object->id; + $companypaymentmode->last_four = $event->data->object->card->last4; + $companypaymentmode->card_type = $event->data->object->card->branding; + + $companypaymentmode->owner_name = $event->data->object->billing_details->name; + $companypaymentmode->proprio = $companypaymentmode->owner_name; // We may still need this formodulebuilder because name of field is "proprio" + $companypaymentmode->exp_date_month = (int) $event->data->object->card->exp_month; $companypaymentmode->exp_date_year = (int) $event->data->object->card->exp_year; $companypaymentmode->cvn = null; - $companypaymentmode->datec = $db->escape($event->data->object->created); + $companypaymentmode->datec = $event->data->object->created; $companypaymentmode->default_rib = 0; - $companypaymentmode->type = $db->escape($event->data->object->type); - $companypaymentmode->country_code = $db->escape($event->data->object->card->country); + $companypaymentmode->type = $event->data->object->type; + $companypaymentmode->country_code = $event->data->object->card->country; $companypaymentmode->status = $servicestatus; // TODO Check that a payment mode $companypaymentmode->stripe_card_ref does not exists yet to avoid to create duplicates diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index a4fa06b44ac..3cb4dfafc5e 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1144,6 +1144,11 @@ class Reception extends CommonObject $mouvS->origin = null; $result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ReceptionDeletedInDolibarr", $this->ref), '', $obj->eatby, $obj->sellby, $obj->batch); // Price is set to 0, because we don't want to see WAP changed + if ($result < 0) { + $error++; + $this->error = $mouvS->error; + $this->errors = $mouvS->errors; + } } } else { $error++; diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 2362599a432..91195e6010e 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1429,7 +1429,11 @@ class Thirdparties extends DolibarrApi $object = array(); foreach ($account as $key => $value) { if (in_array($key, $fields)) { - $object[$key] = $value; + if ($key == 'iban') { + $object[$key] = dolDecrypt($value); + } else { + $object[$key] = $value; + } } } $returnAccounts[] = $object; diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index acca367fb61..a27f7c3504a 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -362,7 +362,7 @@ class CompanyBankAccount extends Account /** * Create bank information record. * - * @param ?User $user User + * @param ?User $user User * @param int<0,1> $notrigger 1=Disable triggers * @return int Return integer <0 if KO, > 0 if OK (ID of newly created company bank account information) */ @@ -385,7 +385,8 @@ class CompanyBankAccount extends Account // Correct ->default_rib to not set the new account as default, if there is already 1. We want to be sure to have always 1 default for type = 'ban'. // If we really want the new bank account to be the default, we must set it by calling setDefault() after creation. - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib where fk_soc = ".((int) $this->socid)." AND default_rib = 1 AND type = 'ban'"; + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib"; + $sql .= " WHERE fk_soc = ".((int) $this->socid)." AND default_rib = 1 AND type = 'ban'"; $result = $this->db->query($sql); if ($result) { $numrows = $this->db->num_rows($result); @@ -450,9 +451,6 @@ class CompanyBankAccount extends Account return -1; } - if (!empty($this->domiciliation) && dol_strlen($this->domiciliation) > 255) { - $this->domiciliation = dol_trunc($this->domiciliation, 254, 'right', 'UTF-8', 1); - } if (!empty($this->address) && dol_strlen($this->address) > 255) { $this->address = dol_trunc($this->address, 254, 'right', 'UTF-8', 1); } @@ -473,9 +471,9 @@ class CompanyBankAccount extends Account $sql .= ",number='".$this->db->escape($this->number)."'"; $sql .= ",cle_rib='".$this->db->escape($this->cle_rib)."'"; $sql .= ",bic='".$this->db->escape($this->bic)."'"; - $sql .= ",iban_prefix = '".$this->db->escape($this->iban)."'"; - $sql .= ",domiciliation = '".$this->db->escape($this->address ? $this->address : $this->domiciliation)."'"; - $sql .= ",proprio = '".$this->db->escape($this->proprio)."'"; + $sql .= ",iban_prefix = '".$this->db->escape(dolEncrypt($this->iban))."'"; + $sql .= ",domiciliation = '".$this->db->escape($this->address)."'"; + $sql .= ",proprio = '".$this->db->escape($this->owner_name)."'"; $sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'"; $sql .= ",default_rib = ".((int) $this->default_rib); if (isModEnabled('prelevement')) { @@ -575,13 +573,12 @@ class CompanyBankAccount extends Account $this->number = $obj->number; $this->cle_rib = $obj->cle_rib; $this->bic = $obj->bic; - $this->iban = $obj->iban; + $this->iban = dolDecrypt($obj->iban); - $this->domiciliation = $obj->address; $this->address = $obj->address; + $this->owner_name = $obj->owner_name; $this->proprio = $obj->owner_name; - $this->owner_name = $obj->owner_name; $this->owner_address = $obj->owner_address; $this->label = $obj->label; $this->default_rib = $obj->default_rib; @@ -679,7 +676,7 @@ class CompanyBankAccount extends Account public function setAsDefault($rib = 0, $resetolddefaultfor = 'ban') { $sql1 = "SELECT rowid as id, fk_soc as socid FROM ".MAIN_DB_PREFIX."societe_rib"; - $sql1 .= " WHERE rowid = ".($rib ? $rib : $this->id); + $sql1 .= " WHERE rowid = ".((int) ($rib ? $rib : $this->id)); dol_syslog(get_class($this).'::setAsDefault', LOG_DEBUG); $result1 = $this->db->query($sql1); @@ -743,8 +740,7 @@ class CompanyBankAccount extends Account $this->address = 'Rue de Paris'; $this->country_id = 1; - $this->proprio = 'Owner'; - $this->owner_name = 'Owner'; + $this->owner_name = 'Owner'; $this->owner_address = 'Owner address'; $this->owner_country_id = 1; diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index 86d39b2d4a9..6c3a910f1e5 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -158,7 +158,7 @@ class CompanyPaymentMode extends CommonObject /** * @var string iban - * @deprecated Use $iban_prefix + * @deprecated Use $iban_prefix, or wait the field in database is renamed into iban. * @see $iban_prefix */ public $iban; @@ -167,18 +167,34 @@ class CompanyPaymentMode extends CommonObject * @var string IBAN prefix */ public $iban_prefix; + /** * @var string + * @deprecated Use address */ public $domiciliation; + /** * @var string */ + public $address; + + /** + * @var string + * @deprecated Use owner_name + */ public $proprio; + + /** + * @var string + */ + public $owner_name; + /** * @var string */ public $owner_address; + /** * @var int */ @@ -516,7 +532,7 @@ class CompanyPaymentMode extends CommonObject public function setAsDefault($id = 0, $alltypes = 0) { $sql1 = "SELECT rowid as id, fk_soc, type FROM ".MAIN_DB_PREFIX."societe_rib"; - $sql1 .= " WHERE rowid = ".($id ? $id : $this->id); + $sql1 .= " WHERE rowid = ".((int) ($id ? $id : $this->id)); dol_syslog(get_class($this).'::setAsDefault', LOG_DEBUG); $result1 = $this->db->query($sql1); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 8bfd1a6f372..af72f0f539a 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2165,7 +2165,7 @@ class Societe extends CommonObject $this->model_pdf = $obj->model_pdf; $this->last_main_doc = $obj->last_main_doc; - $result = 1; + $result = $this->id; // fetch optionals attributes and labels $this->fetch_optionals(); @@ -3498,7 +3498,7 @@ class Societe extends CommonObject { // phpcs:enable require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib WHERE type='ban' AND fk_soc = ".((int) $this->id); + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib WHERE type = 'ban' AND fk_soc = ".((int) $this->id); $result = $this->db->query($sql); if (!$result) { $this->error = $this->db->lasterror(); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index dfecc621994..41d5b95f205 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -187,7 +187,6 @@ if (empty($reshook)) { $companybankaccount->iban = GETPOST('iban', 'alpha'); $companybankaccount->address = GETPOST('address', 'alpha'); - $companybankaccount->domiciliation = $companybankaccount->address; $companybankaccount->owner_name = GETPOST('proprio', 'alpha'); $companybankaccount->proprio = $companybankaccount->owner_name; @@ -258,7 +257,8 @@ if (empty($reshook)) { $companypaymentmode->label = GETPOST('label', 'alpha'); $companypaymentmode->number = GETPOST('cardnumber', 'alpha'); $companypaymentmode->last_four = substr(GETPOST('cardnumber', 'alpha'), -4); - $companypaymentmode->proprio = GETPOST('proprio', 'alpha'); + $companypaymentmode->owner_name = GETPOST('proprio', 'alpha'); + $companypaymentmode->proprio = $companypaymentmode->owner_name; $companypaymentmode->exp_date_month = GETPOSTINT('exp_date_month'); $companypaymentmode->exp_date_year = GETPOSTINT('exp_date_year'); $companypaymentmode->cvn = GETPOST('cvn', 'alpha'); @@ -319,10 +319,10 @@ if (empty($reshook)) { $companybankaccount->bic = GETPOST('bic', 'alpha'); $companybankaccount->iban = GETPOST('iban', 'alpha'); - $companybankaccount->domiciliation = GETPOST('address', 'alpha'); $companybankaccount->address = GETPOST('address', 'alpha'); - $companybankaccount->proprio = GETPOST('proprio', 'alpha'); + $companybankaccount->owner_name = GETPOST('proprio', 'alpha'); + $companybankaccount->proprio = $companybankaccount->owner_name; $companybankaccount->owner_address = GETPOST('owner_address', 'alpha'); $companybankaccount->frstrecur = GETPOST('frstrecur', 'alpha'); $companybankaccount->rum = GETPOST('rum', 'alpha'); @@ -820,6 +820,7 @@ if (empty($reshook)) { $sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib as sr "; $sql .= " SET stripe_card_ref = null"; $sql .= " WHERE sr.stripe_card_ref = '".$db->escape($source)."'"; + $resql = $db->query($sql); } else { $card->delete($user); @@ -1281,8 +1282,8 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ''; // Information (Owner, ...) print ''; // Account number - print ''; // IBAN - print ''; // BIC - print ''; if (isModEnabled('prelevement')) { // RUM - print ''; // Date - print ''; // Mode mandate - print ''; } @@ -1894,6 +1895,9 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if (isModEnabled('prelevement')) { $colspan += 3; } + if (!getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT') && getDolGlobalInt("SOCIETE_RIB_ALLOW_ONLINESIGN")) { + $colspan++; + } print ''; } @@ -2120,7 +2124,7 @@ if ($socid && $action == 'editcard' && $permissiontoaddupdatepaymentinformation) print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -2163,10 +2167,10 @@ if ($socid && $action == 'create' && $permissiontoaddupdatepaymentinformation) { print '
'; - if ($companypaymentmodetemp->proprio) { - print ''.$companypaymentmodetemp->proprio.'
'; + if ($companypaymentmodetemp->owner_name) { + print ''.$companypaymentmodetemp->owner_name.'
'; } if ($companypaymentmodetemp->last_four) { print '....'.$companypaymentmodetemp->last_four; @@ -1824,28 +1825,28 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print '
'; print''; + print ''; print ''; + print ''; //var_dump($src); print ''; + print ''; //var_dump($src); print ''; + print ''; //var_dump($src); print ''; + print ''; //var_dump($src); print ''; + print ''; //var_dump($src); print '
'.$langs->trans("NoBANRecord").'
'.$langs->trans("NameOnCard").'
'.$langs->trans("CardNumber").'
'; print ''; - print ''; + print ''; print ''; - print ''; + print ''; // Show fields of bank account foreach ($companybankaccount->getFieldsToShow(1) as $val) { diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index c828c929bc7..8ccb9a4d40f 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -845,7 +845,7 @@ class Stripe extends CommonObject $card = null; - $sql = "SELECT sa.stripe_card_ref, sa.proprio, sa.exp_date_month, sa.exp_date_year, sa.number, sa.cvn"; // stripe_card_ref is card_.... + $sql = "SELECT sa.stripe_card_ref, sa.proprio as owner_name, sa.exp_date_month, sa.exp_date_year, sa.number, sa.cvn"; // stripe_card_ref is card_.... $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as sa"; $sql .= " WHERE sa.rowid = ".((int) $object->id); // We get record from ID, no need for filter on entity $sql .= " AND sa.type = 'card'"; @@ -885,7 +885,7 @@ class Stripe extends CommonObject $exp_date_year = $obj->exp_date_year; $number = $obj->number; $cvc = $obj->cvn; // cvn in database, cvc for stripe - $cardholdername = $obj->proprio; + $cardholdername = $obj->owner_name; $ipaddress = getUserRemoteIP(); @@ -1034,7 +1034,7 @@ class Stripe extends CommonObject dol_syslog($this->error, LOG_WARNING); } } elseif ($createifnotlinkedtostripe) { - $iban = $obj->iban; + $iban = dolDecrypt($obj->iban); $ipaddress = getUserRemoteIP(); $metadata = array('dol_version' => DOL_VERSION, 'dol_entity' => $conf->entity, 'ipaddress' => $ipaddress); if (is_object($object)) { diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index aa7f2274c78..80f0a3393d9 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1709,7 +1709,7 @@ if ($action == 'create') { print '
'.$langs->trans("Label").'
name).'">
'.$langs->trans("Bank").'
'; - if ($action != 'editdate_livraison' && $object->statut == SupplierProposal::STATUS_VALIDATED) { + if ($action != 'editdate_livraison' && $object->statut != SupplierProposal::STATUS_NOTSIGNED) { print ''; } print '
'; print $langs->trans('DeliveryDate'); print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryDate'), 1).'
'; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index bf291bc538e..2c471081070 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -4256,7 +4256,7 @@ table.nointerlines tr:not(:last-child) td { } -/* Experimental code to manage rounding */ +/* Management of border radius */ table.noborder:not(.cal_month, .paymenttable) { border-radius: px; @@ -5445,6 +5445,9 @@ table.table-fiche-title .col-title div.titre > span:not(.print-barre-liste) { table.table-fiche-title, div.fiche>table.table-fiche-title { margin-bottom: 18px; } +.table-list-of-attached-files, .table-list-of-links { + margin-bottom: 0 !important; +} .fichehalfleft table.table-fiche-title, .fichehalfright table.table-fiche-title { margin-bottom: 8px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 0aed59e9ea4..f01b343ac84 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4363,6 +4363,66 @@ table.nointerlines tr:not(:last-child) td { border-top: unset !important; } +/* Management of border radius */ + +table.noborder:not(.cal_month, .paymenttable) { + border-radius: px; +} +table.noborder.cal_month { + border-bottom-left-radius: px; + border-bottom-right-radius: px; +} +table.liste:not(.listwithfilterbefore) { + border-top-left-radius: px; + border-top-right-radius: px; +} +table.liste { + border-bottom-left-radius: px; + border-bottom-right-radius: px; +} +table.noborder:not(.paymenttable, .margintable) tr.liste_titre:first-child td:first-child, +table.noborder:not(.paymenttable, .margintable) tr.liste_titre:first-child th:first-child { + border-top-left-radius: px; +} +table.noborder:not(.paymenttable, .margintable) tr.liste_titre:first-child td:last-child, +table.noborder:not(.paymenttable, .margintable) tr.liste_titre:first-child th:last-child { + border-top-right-radius: px; +} +table.noborder:not(.paymenttable, .margintable) tr:last-child td:first-child, +table.noborder:not(.paymenttable, .margintable) tr:last-child th:first-child { + border-bottom-left-radius: px; +} +table.noborder:not(.paymenttable, .margintable) tr:last-child td:last-child, +table.noborder:not(.paymenttable, .margintable) tr:last-child th:last-child { + border-bottom-right-radius: px; +} + +table.liste tr.liste_titre_filter:first-child td:first-child, +table.liste tr.liste_titre_filter:first-child th:first-child { + border-top-left-radius: px; +} +div.liste_titre_bydiv { + border-top-left-radius: px; + border-top-right-radius: px; +} +table.liste tr:last-child td:first-child, +table.liste tr:last-child th:first-child { + border-bottom-left-radius: px; +} +table.liste tr:last-child td:last-child, +table.liste tr:last-child th:last-child { + border-bottom-right-radius: px; +} + +table#tablelines tr:last-of-type td:first-child, table#tablelines tr#trlinefordates, table#tablelines tr#trlinefordates td { + border-bottom-left-radius: px; +} +table#tablelines tr:last-of-type td:last-child, table#tablelines tr#trlinefordates, table#tablelines tr#trlinefordates td { + border-bottom-right-radius: px; +} + + + .liste_titre_filter { background: var(--colorbacktitle1) !important; } diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 884874982cd..ea453dbe9ab 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -130,10 +130,10 @@ if ($action == 'add' && !$cancel && $permissiontoaddbankaccount) { $account->cle_rib = GETPOST('cle_rib', 'alpha'); $account->bic = GETPOST('bic', 'alpha'); $account->iban = GETPOST('iban', 'alpha'); - $account->domiciliation = GETPOST('address', 'alpha'); $account->address = GETPOST('address', 'alpha'); - $account->owner_name = GETPOST('proprio', 'alpha'); - $account->proprio = $account->owner_name; + + $account->owner_name = GETPOST('proprio', 'alpha'); + $account->proprio = $account->owner_name; $account->owner_address = GETPOST('owner_address', 'alpha'); $account->currency_code = trim(GETPOST("account_currency_code")); @@ -163,9 +163,9 @@ if ($action == 'update' && !$cancel && $permissiontoaddbankaccount) { $account->cle_rib = GETPOST('cle_rib', 'alpha'); $account->bic = GETPOST('bic', 'alpha'); $account->iban = GETPOST('iban', 'alpha'); - $account->domiciliation = GETPOST('address', 'alpha'); $account->address = GETPOST('address', 'alpha'); - $account->proprio = GETPOST('proprio', 'alpha'); + $account->owner_name = GETPOST('proprio', 'alpha'); + $account->proprio = $account->owner_name; $account->owner_address = GETPOST('owner_address', 'alpha'); $account->currency_code = trim(GETPOST("account_currency_code")); @@ -1018,7 +1018,7 @@ if ($id && ($action == 'edit' || $action == 'create') && $permissiontoaddbankacc print "
'.$langs->trans("BankAccountOwner").'
'.$langs->trans("BankAccountOwnerAddress").''; diff --git a/htdocs/user/class/userbankaccount.class.php b/htdocs/user/class/userbankaccount.class.php index d9a65fb5212..b97e8bb0c4c 100644 --- a/htdocs/user/class/userbankaccount.class.php +++ b/htdocs/user/class/userbankaccount.class.php @@ -137,8 +137,8 @@ class UserBankAccount extends Account $sql .= ",cle_rib='".$this->db->escape($this->cle_rib)."'"; $sql .= ",bic='".$this->db->escape($this->bic)."'"; $sql .= ",iban_prefix = '".$this->db->escape($this->iban)."'"; - $sql .= ",domiciliation='".$this->db->escape($this->address ? $this->address : $this->domiciliation)."'"; - $sql .= ",proprio = '".$this->db->escape($this->proprio)."'"; + $sql .= ",domiciliation='".$this->db->escape($this->address)."'"; + $sql .= ",proprio = '".$this->db->escape($this->owner_name)."'"; $sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'"; $sql .= ",currency_code = '".$this->db->escape($this->currency_code)."'"; $sql .= ",state_id = ".($this->state_id > 0 ? ((int) $this->state_id) : "null"); @@ -227,12 +227,12 @@ class UserBankAccount extends Account $this->courant = self::TYPE_CURRENT; $this->type = self::TYPE_CURRENT; - $this->domiciliation = $obj->address; $this->address = $obj->address; - $this->proprio = $obj->owner_name; $this->owner_name = $obj->owner_name; + $this->proprio = $obj->owner_name; $this->owner_address = $obj->owner_address; + $this->label = $obj->label; $this->datec = $this->db->jdate($obj->datec); $this->datem = $this->db->jdate($obj->datem); diff --git a/phpstan.neon.dist b/phpstan.neon.dist index ed685c31da3..7adab19fb1a 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -82,11 +82,9 @@ parameters: - '#EvalMath::trigger\(\) expects string, int given#' - '# Diff::generatePartialDiff\(\) expects array#' - '# EmailCollector::getpart\(\) expects string#' - - '#(?:convertSecondToTime) expects int, float\|string given#' - - '#(?:Comm(?:(?:ande::updateline|on(?:Invoice::getLibStatut|StickerGenerator::(?:Set_Char_Size|_Croix|convertMetric)))\(\))|Facture(?:(?:::update|FournisseurRec::add)line\(\))|(?:Holiday::addLogCP|Loan::getLibStatut|SupplierProposal::updateline)\(\)|c(?:alcul_price_total|onvert(?:DurationtoHour|SecondToTime))|dol_time_plus_duree|pdf_(?:azur::_tableau_(?:(?:info|tot)\(\))|ban(?:::_tableau\(\)|k)|c(?:anelle::_tableau_(?:(?:tot|versements)\(\))|ornas::_tableau_(?:(?:info|tot)\(\))|rabe::_tableau_(?:(?:info|tot|versements)\(\))|yan::draw(?:(?:Info|Total)Table\(\)))|e(?:agle(?:(?:::_tableau_tot|_proforma::drawTotalTable)\(\))|instein::_tableau_(?:(?:info|tot)\(\))|ratosthene::draw(?:(?:Info|Total)Table\(\))|spadon::_tableau_tot\(\))|muscadet::_tableau_(?:(?:info|tot)\(\))|octopus::(?:_table(?:(?:FirstPage|au)\(\))|draw(?:(?:Info|Total)Table\(\)))|page(?:foot|head)|(?:rouget::_tableau_tot|s(?:epamandate::_tableau(?:_info)?|ponge::draw(?:(?:Info|Total)Table)|quille::_tableau_tot|t(?:andard_(?:e(?:(?:valuation|xpensereport)::_tableau|xpensereport::tablePayments)|(?:myobjec|supplierpaymen)t::_tableau|supplierpayment::_tableau_cheque)|orm::_tableau_info|rato::tabSignature))|t(?:cpdflabel::writeBarcode|yphon::_tableau_info)|vinci::_tableau_info)\(\)|w(?:atermark|rite(?:LinkedObjects|linedesc))|zenith::_tableau_tot\(\))|usleep) expects int, float given\.#' - + - '#(?:(?:CommonStickerGenerator::_Croix|pdf_(?:azur::_tableau_(?:info|tot)|ban::_tableau))\(\)|pdf_(?:bank|c(?:anelle::_tableau_(?:(?:tot|versements)\(\))|ornas::_tableau_(?:(?:info|tot)\(\))|rabe::_tableau_(?:(?:info|tot|versements)\(\))|yan::draw(?:(?:Info|Total)Table\(\)))|e(?:agle(?:(?:::_tableau_tot|_proforma::drawTotalTable)\(\))|instein::_tableau_(?:(?:info|tot)\(\))|ratosthene::draw(?:(?:Info|Total)Table\(\))|spadon::_tableau_tot\(\))|muscadet::_tableau_(?:(?:info|tot)\(\))|octopus::(?:_table(?:(?:FirstPage|au)\(\))|draw(?:(?:Info|Total)Table\(\)))|page(?:foot|head)|(?:rouget::_tableau_tot|s(?:epamandate::_tableau(?:_info)?|ponge::draw(?:(?:Info|Total)Table)|quille::_tableau_tot|t(?:andard_(?:e(?:(?:valuation|xpensereport)::_tableau|xpensereport::tablePayments)|(?:myobjec|supplierpaymen)t::_tableau|supplierpayment::_tableau_cheque)|orm::_tableau_info|rato::tabSignature))|t(?:cpdflabel::writeBarcode|yphon::_tableau_info)|vinci::_tableau_info)\(\)|w(?:atermark|rite(?:LinkedObjects|linedesc))|zenith::_tableau_tot\(\))) expects int, float given\.#' + - '#(?:Comm(?:(?:ande::updateline|on(?:Invoice::getLibStatut|StickerGenerator::Set_Char_Size))\(\))|Facture(?:(?:::update|FournisseurRec::add)line\(\))|(?:Holiday::addLogCP|Loan::getLibStatut|SupplierProposal::updateline)\(\)|calcul_price_total) expects int, float given\.#' - '#(?:dol_(?:mktime|remove_file_process)|fetchObjectByElement|print_actions_filter) expects int, array\|string given\.#' - - '# (CSMSFile) constructor expects int, array\|string given.#' - '#(?:ProductFournisseur::logPrice\(\)) expects float\|null#' - '#(?:(?:Asset::addDepreciationL|Facture(?:(?:(?:Fournisseur)?::add|Fournisseur::update)l))ine\(\)|calcul_price_total|dol_convertToWord|(?:loanCalcMonthlyPaymen|print_paypal_redirec)t) expects float, string given.#' @@ -118,7 +116,7 @@ parameters: - '#Call to function array_key_exists.. with .error. .* will always evaluate to false.#' - '#function dolGetButtonAction expects array\{confirm\?: array.*confirm: true} given.#' - '#(?:make_substitutions expects array,) string given\.#' - - '# (Workstation|WorkstationResource|WorkstationUserGroup|Zapier)::.* has no value type specified in iterable type array\.#' + - '# (DolibarrApiAccess|Documents|Login|Setup|Workstation|WorkstationResource|WorkstationUserGroup|Zapier)::.* has no value type specified in iterable type array\.#' internalErrorsCountLimit: 50 cache: diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 6e32dd68085..85b097ed3d9 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -6,6 +6,7 @@ * Copyright (C) 2005-2016 Regis Houssin * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -396,7 +397,7 @@ if ($resql) { } if (getDolGlobalInt('MAILING_DELAY')) { - usleep((float) getDolGlobalInt('MAILING_DELAY') * 1000000); + usleep((int) ((float) getDolGlobalInt('MAILING_DELAY') * 1000000)); } } } else {