Merge branch 'develop' into fix_v20_pdf_space_lost_with_images_sponge

This commit is contained in:
John BOTELLA 2024-10-25 10:29:31 +02:00 committed by GitHub
commit bf73accf8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 847 additions and 448 deletions

View file

@ -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 *****

View file

@ -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 '<div class="div-table-responsive-no-min">';
print '<table id="tablelineoffilters" class="noborder nobordertop noshadow">';
print '<table id="tablelineoffilters" class="noborder noshadow">';
print '<tr class="liste_titre nodrag nodrop">';
print '<td>'.img_picto('', 'filter', 'class="pictofixedwidth opacitymedium"').$form->textwithpicto($langs->trans("Filters"), $langs->trans("EmailCollectorFilterDesc")).'</td><td></td><td></td>';
print '</tr>';

View file

@ -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 = "";
}
});

View file

@ -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 {

View file

@ -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 {

View file

@ -121,7 +121,7 @@ print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? img_pict
print "<strong>PHP short_open_tag</strong> = ".((empty(ini_get('short_open_tag')) || ini_get('short_open_tag') == 'Off') ? img_picto('', 'tick').' '.yn(0) : img_warning().' '.yn(1)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).')</span>'."<br>\n";
print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No"))." but may be required by some external modules)</span><br>\n";
print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).", except if Yes is required by some external modules)</span><br>\n";
print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : img_picto('', 'tick').' '.yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
//print "<strong>PHP safe_mode</strong> = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).' &nbsp; <span class="opacitymedium">'.$langs->trans("Deprecated")." (removed in PHP 5.4)</span><br>\n";
@ -662,8 +662,24 @@ print '<br>';
print '<strong>MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE</strong> = '.getDolGlobalString('MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>').' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 1)</span><br>';
print '<br>';
print '<strong>MAIN_SECURITY_ANTI_SSRF_SERVER_IP</strong> = '.getDolGlobalString('MAIN_SECURITY_ANTI_SSRF_SERVER_IP', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span> &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': List of static IPs of server separated with coma - '.$langs->trans("Note").': common loopback ip like 127.*.*.*, [::1] are already added)</span>')."<br>";
print '<br>';
print '<strong>MAIN_SECURITY_CSRF_WITH_TOKEN</strong> = '.getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>').' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 2)</span>'."<br>";
print '</div>';
print '<br>';
print '<br>';
print load_fiche_titre($langs->trans("DatabaseEncryption"), '', 'folder');
print '<div class="divsection wordbreak">';
//print '<strong>'.$langs->trans("PasswordEncryption").'</strong>: ';
print '<strong>MAIN_SECURITY_HASH_ALGO</strong> = '.getDolGlobalString('MAIN_SECURITY_HASH_ALGO', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>')." &nbsp; ";
print '<strong>'.$langs->trans("AlgorithmFor", $langs->transnoentitiesnoconv("Passwords")).' (non reversible encryption, defined into MAIN_SECURITY_HASH_ALGO)</strong> = '.getDolGlobalString('MAIN_SECURITY_HASH_ALGO', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>')." &nbsp; ";
if (!getDolGlobalString('MAIN_SECURITY_HASH_ALGO')) {
print '<span class="opacitymedium"> &nbsp; &nbsp; (If unset: \'md5\')</span>';
}
@ -683,10 +699,22 @@ if (getDolGlobalString('MAIN_SECURITY_HASH_ALGO') != 'password_hash') {
}
print '<br>';
print '<strong>MAIN_SECURITY_ANTI_SSRF_SERVER_IP</strong> = '.getDolGlobalString('MAIN_SECURITY_ANTI_SSRF_SERVER_IP', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span> &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': List of static IPs of server separated with coma - '.$langs->trans("Note").': common loopback ip like 127.*.*.*, [::1] are already added)</span>')."<br>";
print '<br>';
$action = GETPOST('action');
$exampletodecrypt = GETPOST('exampletodecrypt', 'password');
print '<strong>MAIN_SECURITY_CSRF_WITH_TOKEN</strong> = '.getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>').' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 2)</span>'."<br>";
print '<strong>'.$langs->trans("AlgorithmFor", $langs->transnoentitiesnoconv("SensitiveData")).' (reversible encryption done with dolEncrypt/dolDecrypt)</strong> = '.constant('MAIN_SECURITY_REVERSIBLE_ALGO').' with key defined into conf.php file in $dolibarr_main_instance_unique_id<br>';
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="action" value="doldecrypt">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="page_y" value="">';
print $langs->trans("ToolToDecryptAString").': ';
print '<input type="text" name="exampletodecrypt" placeholder="dolcrypt:ALGOXXXX:ABCDFEF1234" value="'.$exampletodecrypt.'">';
print '<input type="submit" class="reposition button small smallpaddingimp" name="submit" value="'.$langs->transnoentitiesnoconv("Decrypt").'">';
if ($action == 'doldecrypt' && $user->admin && $exampletodecrypt) {
usleep(200);
print ' => <textarea rows="'.ROWS_1.'" class="valignmiddle">'.dolPrintHTMLForTextArea(dolDecrypt($exampletodecrypt)).'</textarea>';
}
print '</form>';
print '</div>';

View file

@ -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) {

View file

@ -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) {

View file

@ -3,7 +3,7 @@
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2014-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
@ -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 '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>';
print '<td><input type="text" class="flat maxwidth200" name="ref" value="'.dol_escape_htmltag(GETPOSTISSET('ref') ? GETPOST('ref', 'alpha') : $object->ref).'"></td></tr>';
print '<td><input type="text" class="flat maxwidth200" name="ref" value="'.dol_escape_htmltag(GETPOSTISSET('ref') ? GETPOST('ref', 'alpha') : $object->ref).'" maxlength="12" autofocus></td></tr>';
// Label
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';

View file

@ -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';

View file

@ -1398,35 +1398,6 @@ if ($action == 'create') {
}
print '</td></tr>';
// 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 = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
foreach ($substitutionarray as $key => $val) {
$htmltext .= $key.' = '.$langs->trans($val).'<br>';
}
$htmltext .= '</i>';
// Bank Account
print '<tr><td class="nowrap">';
@ -1450,21 +1421,7 @@ if ($action == 'create') {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
// Note public
print '<tr><td>';
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 '</td><td class="wordbreak">';
print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $user->hasRight('facture', 'creer'), 'textarea:'.ROWS_4.':90%', '', null, null, '', 1);
print '</td>';
print '</tr>';
// Note private
print '<tr><td>';
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 '</td><td class="wordbreak">';
print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $user->hasRight('facture', 'creer'), 'textarea:'.ROWS_4.':90%', '', null, null, '', 1);
print '</td>';
print '</tr>';
// Model pdf
print '<tr><td class="nowrap">';

View file

@ -0,0 +1,208 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* 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 <https://www.gnu.org/licenses/>.
*/
/**
* \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 '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
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 = '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$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 .= '<div class="refidno">';
// Thirdparty
$morehtmlref .= $object->thirdparty->getNomUrl(1);
// Project
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>';
if (0) {
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
if ($action != 'classify') {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$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 .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
}
}
}
}
$morehtmlref .= '</div>';
$morehtmlstatus = '';
dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlstatus);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
$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 = '<i>' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':<br>';
foreach ($substitutionarray as $key => $val) {
$htmltext .= $key . ' = ' . $langs->trans($val) . '<br>';
}
$htmltext .= '</i>';
$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();

View file

@ -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

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* 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

View file

@ -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);

View file

@ -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

View file

@ -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

View file

@ -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".'<!-- Start form attach new file --><div class="formattachnewfile">'."\n";
// Section to generate the form to upload a new file
$out = "\n".'<!-- Start form attach new file --><div class="formattachnewfile">'."\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 .= '<form name="'.$htmlname.'" id="'.$htmlname.'" action="'.$url.'" enctype="multipart/form-data" method="POST">'."\n";
}
if (empty($usewithoutform) || $usewithoutform == 2) {
$out .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
$out .= '<input type="hidden" id="'.$htmlname.'_section_dir" name="section_dir" value="'.$sectiondir.'">'."\n";
$out .= '<input type="hidden" id="'.$htmlname.'_section_id" name="section_id" value="'.$sectionid.'">'."\n";
$out .= '<input type="hidden" name="sortfield" value="'.GETPOST('sortfield', 'aZ09comma').'">'."\n";
$out .= '<input type="hidden" name="sortorder" value="'.GETPOST('sortorder', 'aZ09comma').'">'."\n";
$out .= '<input type="hidden" name="page_y" value="">'."\n";
$out .= '<form name="'.$htmlname.'" id="'.$htmlname.'" action="'.$url.'" enctype="multipart/form-data" method="POST">'."\n";
}
if (empty($usewithoutform) || $usewithoutform == 2) {
$out .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
$out .= '<input type="hidden" id="'.$htmlname.'_section_dir" name="section_dir" value="'.$sectiondir.'">'."\n";
$out .= '<input type="hidden" id="'.$htmlname.'_section_id" name="section_id" value="'.$sectionid.'">'."\n";
$out .= '<input type="hidden" name="sortfield" value="'.GETPOST('sortfield', 'aZ09comma').'">'."\n";
$out .= '<input type="hidden" name="sortorder" value="'.GETPOST('sortorder', 'aZ09comma').'">'."\n";
$out .= '<input type="hidden" name="page_y" value="">'."\n";
}
$out .= '<table class="nobordernopadding centpercent">';
$out .= '<tr>';
if (!empty($options)) {
$out .= '<td>'.$options.'</td>';
}
$out .= '<td class="valignmiddle nowrap">';
$maxfilesizearray = getMaxFileSizeArray();
$max = $maxfilesizearray['max'];
$maxmin = $maxfilesizearray['maxmin'];
$maxphptoshow = $maxfilesizearray['maxphptoshow'];
$maxphptoshowparam = $maxfilesizearray['maxphptoshowparam'];
if ($maxmin > 0) {
$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
}
$out .= '<input class="flat minwidth400 maxwidth200onsmartphone" type="file"';
$out .= ((getDolGlobalString('MAIN_DISABLE_MULTIPLE_FILEUPLOAD') || $disablemulti) ? ' name="userfile"' : ' name="userfile[]" multiple');
$out .= (!getDolGlobalString('MAIN_UPLOAD_DOC') || empty($perm) ? ' disabled' : '');
$out .= (!empty($accept) ? ' accept="'.$accept.'"' : ' accept=""');
$out .= (!empty($capture) ? ' capture="capture"' : '');
$out .= '>';
$out .= ' ';
if ($sectionid) { // Show overwrite if exists for ECM module only
$langs->load('link');
$out .= '<span class="nowraponsmartphone"><input style="margin-right: 2px;" type="checkbox" id="overwritefile" name="overwritefile" value="1">';
$out .= '<label for="overwritefile" class="opacitylow paddingright">'.$langs->trans("OverwriteIfExists").'</label>';
$out .= '</span>';
}
$out .= '<input type="submit" class="button small reposition" name="sendit" value="'.$langs->trans("Upload").'"';
$out .= (!getDolGlobalString('MAIN_UPLOAD_DOC') || empty($perm) ? ' disabled' : '');
$out .= '>';
if ($addcancel) {
$out .= ' &nbsp; ';
$out .= '<input type="submit" class="button small button-cancel" name="cancel" value="'.$langs->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 .= "</td></tr>";
if ($savingdocmask) {
//add a global variable for disable the auto renaming on upload
$rename = (!getDolGlobalString('MAIN_DOC_UPLOAD_NOT_RENAME_BY_DEFAULT') ? 'checked' : '');
$out .= '<table class="nobordernopadding centpercent">';
$out .= '<tr>';
if (!empty($options)) {
$out .= '<td>'.$options.'</td>';
}
$out .= '<td valign="middle" class="nowrap">';
$out .= '<input type="checkbox" '.$rename.' class="savingdocmask" name="savingdocmask" id="savingdocmask" value="'.dol_escape_js($savingdocmask).'"> ';
$out .= '<label class="opacitymedium small" for="savingdocmask">';
$out .= $langs->trans("SaveUploadedFileWithMask", preg_replace('/__file__/', $langs->transnoentitiesnoconv("OriginFileName"), $savingdocmask), $langs->transnoentitiesnoconv("OriginFileName"));
$out .= '</label>';
$out .= '</td>';
$out .= '</tr>';
}
$out .= '<td class="valignmiddle nowrap">';
$out .= "</table>";
$maxfilesizearray = getMaxFileSizeArray();
$max = $maxfilesizearray['max'];
$maxmin = $maxfilesizearray['maxmin'];
$maxphptoshow = $maxfilesizearray['maxphptoshow'];
$maxphptoshowparam = $maxfilesizearray['maxphptoshowparam'];
if ($maxmin > 0) {
$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
if (empty($usewithoutform)) {
$out .= '</form>';
if (empty($sectionid)) {
$out .= '<br>';
}
$out .= '<input class="flat minwidth400 maxwidth200onsmartphone" type="file"';
$out .= ((getDolGlobalString('MAIN_DISABLE_MULTIPLE_FILEUPLOAD') || $disablemulti) ? ' name="userfile"' : ' name="userfile[]" multiple');
$out .= (!getDolGlobalString('MAIN_UPLOAD_DOC') || empty($perm) ? ' disabled' : '');
$out .= (!empty($accept) ? ' accept="'.$accept.'"' : ' accept=""');
$out .= (!empty($capture) ? ' capture="capture"' : '');
$out .= '>';
$out .= ' ';
if ($sectionid) { // Show overwrite if exists for ECM module only
$langs->load('link');
$out .= '<span class="nowraponsmartphone"><input style="margin-right: 2px;" type="checkbox" id="overwritefile" name="overwritefile" value="1">';
$out .= '<label for="overwritefile" class="opacitylow paddingright">'.$langs->trans("OverwriteIfExists").'</label>';
$out .= '</span>';
}
$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 = '<div class="'.($usewithoutform ? 'inline-block valignmiddle' : (($nooutput == 2 ? '' : 'attacharea ').'attacharea'.$htmlname)).'">'.$out.'</div>';
}
$out .= $hookmanager->resPrint;
$out .= "\n</div><!-- End form class=formattachnewfile -->\n";
$out2 = "";
// Section to generate the form to upload a new file
if ($linkfiles) {
$out2 .= "\n".'<!-- Start form link new url --><div class="formlinknewurl">'."\n";
$langs->load('link');
if ($nooutput != 2) {
$title = $langs->trans("LinkANewFile");
$out2 .= load_fiche_titre($title, '', '');
}
$out .= '<input type="submit" class="button small reposition" name="sendit" value="'.$langs->trans("Upload").'"';
$out .= (!getDolGlobalString('MAIN_UPLOAD_DOC') || empty($perm) ? ' disabled' : '');
$out .= '>';
if ($addcancel) {
$out .= ' &nbsp; ';
$out .= '<input type="submit" class="button small button-cancel" name="cancel" value="'.$langs->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 .= "</td></tr>";
if ($savingdocmask) {
//add a global variable for disable the auto renaming on upload
$rename = (!getDolGlobalString('MAIN_DOC_UPLOAD_NOT_RENAME_BY_DEFAULT') ? 'checked' : '');
$out .= '<tr>';
if (!empty($options)) {
$out .= '<td>'.$options.'</td>';
}
$out .= '<td valign="middle" class="nowrap">';
$out .= '<input type="checkbox" '.$rename.' class="savingdocmask" name="savingdocmask" id="savingdocmask" value="'.dol_escape_js($savingdocmask).'"> ';
$out .= '<label class="opacitymedium small" for="savingdocmask">';
$out .= $langs->trans("SaveUploadedFileWithMask", preg_replace('/__file__/', $langs->transnoentitiesnoconv("OriginFileName"), $savingdocmask), $langs->transnoentitiesnoconv("OriginFileName"));
$out .= '</label>';
$out .= '</td>';
$out .= '</tr>';
}
$out .= "</table>";
if (empty($usewithoutform)) {
$out .= '</form>';
if (empty($sectionid)) {
$out .= '<br>';
}
$out2 .= '<form name="'.$htmlname.'_link" id="'.$htmlname.'_link" action="'.$url.'" method="POST">'."\n";
$out2 .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
$out2 .= '<input type="hidden" id="'.$htmlname.'_link_section_dir" name="link_section_dir" value="">'."\n";
$out2 .= '<input type="hidden" id="'.$htmlname.'_link_section_id" name="link_section_id" value="'.$sectionid.'">'."\n";
$out2 .= '<input type="hidden" name="page_y" value="">'."\n";
}
$out .= "\n</div><!-- End form attach new file -->\n";
if ($linkfiles) {
$out .= "\n".'<!-- Start form link new url --><div class="formlinknewurl">'."\n";
$langs->load('link');
$title = $langs->trans("LinkANewFile");
$out .= load_fiche_titre($title, '', '');
if (empty($usewithoutform)) {
$out .= '<form name="'.$htmlname.'_link" id="'.$htmlname.'_link" action="'.$url.'" method="POST">'."\n";
$out .= '<input type="hidden" name="token" value="'.newToken().'">'."\n";
$out .= '<input type="hidden" id="'.$htmlname.'_link_section_dir" name="link_section_dir" value="">'."\n";
$out .= '<input type="hidden" id="'.$htmlname.'_link_section_id" name="link_section_id" value="'.$sectionid.'">'."\n";
$out .= '<input type="hidden" name="page_y" value="">'."\n";
}
$out .= '<div class="valignmiddle">';
$out .= '<div class="inline-block" style="padding-right: 10px;">';
if (getDolGlobalString('OPTIMIZEFORTEXTBROWSER')) {
$out .= '<label for="link">'.$langs->trans("URLToLink").':</label> ';
}
$out .= '<input type="text" name="link" class="flat minwidth400imp" id="link" placeholder="'.dol_escape_htmltag($langs->trans("URLToLink")).'">';
$out .= '</div>';
$out .= '<div class="inline-block" style="padding-right: 10px;">';
if (getDolGlobalString('OPTIMIZEFORTEXTBROWSER')) {
$out .= '<label for="label">'.$langs->trans("Label").':</label> ';
}
$out .= '<input type="text" class="flat" name="label" id="label" placeholder="'.dol_escape_htmltag($langs->trans("Label")).'">';
$out .= '<input type="hidden" name="objecttype" value="'.$object->element.'">';
$out .= '<input type="hidden" name="objectid" value="'.$object->id.'">';
$out .= '</div>';
$out .= '<div class="inline-block" style="padding-right: 10px;">';
$out .= '<input type="submit" class="button small reposition" name="linkit" value="'.$langs->trans("ToLink").'"';
$out .= (!getDolGlobalString('MAIN_UPLOAD_DOC') || empty($perm) ? ' disabled' : '');
$out .= '>';
$out .= '</div>';
$out .= '</div>';
if (empty($usewithoutform)) {
$out .= '<div class="clearboth"></div>';
$out .= '</form><br>';
}
$out .= "\n</div><!-- End form link new url -->\n";
$out2 .= '<div class="valignmiddle">';
$out2 .= '<div class="inline-block" style="padding-right: 10px;">';
if (getDolGlobalString('OPTIMIZEFORTEXTBROWSER')) {
$out2 .= '<label for="link">'.$langs->trans("URLToLink").':</label> ';
}
$out2 .= '<input type="text" name="link" class="flat minwidth400imp" id="link" placeholder="'.dol_escape_htmltag($langs->trans("URLToLink")).'">';
$out2 .= '</div>';
$out2 .= '<div class="inline-block" style="padding-right: 10px;">';
if (getDolGlobalString('OPTIMIZEFORTEXTBROWSER')) {
$out2 .= '<label for="label">'.$langs->trans("Label").':</label> ';
}
$out2 .= '<input type="text" class="flat" name="label" id="label" placeholder="'.dol_escape_htmltag($langs->trans("Label")).'">';
$out2 .= '<input type="hidden" name="objecttype" value="'.$object->element.'">';
$out2 .= '<input type="hidden" name="objectid" value="'.$object->id.'">';
$out2 .= '</div>';
$out2 .= '<div class="inline-block" style="padding-right: 10px;">';
$out2 .= '<input type="submit" class="button small reposition" name="linkit" value="'.$langs->trans("ToLink").'"';
$out2 .= (!getDolGlobalString('MAIN_UPLOAD_DOC') || empty($perm) ? ' disabled' : '');
$out2 .= '>';
$out2 .= '</div>';
$out2 .= '</div>';
if (empty($usewithoutform)) {
$out2 .= '<div class="clearboth"></div>';
$out2 .= '</form><br>';
}
$parameters = array('socid' => (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 = '<div class="'.($usewithoutform ? 'inline-block valignmiddle' : 'attacharea attacharea'.$htmlname).'">'.$out.'</div>';
$out2 = '<div class="'.($usewithoutform ? 'inline-block valignmiddle' : (($nooutput == 2 ? '' : 'attacharea ').$htmlname)).'">'.$out2.'</div>';
}
$out .= $hookmanager->resPrint;
$out2 .= $hookmanager->resPrint;
if ($nooutput) {
return $out;
} else {
print $out;
return 1;
}
$out2 .= "\n</div><!-- End form class=formlinknewurl -->\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 '<div class="divattachnewfile'.((!empty($moreoptions['showhideaddbutton']) && $conf->use_javascript_ajax) ? ' hidden' : '').'">'.$moreoptions['afteruploadtitle'].'</div>';
}
// Show the table
print '<!-- html.formfile::list_of_documents -->'."\n";
if (GETPOST('action', 'aZ09') == 'editfile' && $permtoeditline) {
print '<form action="'.$_SERVER["PHP_SELF"].'?'.$param.'" method="POST">';
@ -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 '<!-- listOfLinks -->'."\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 '<form action="'.$_SERVER['PHP_SELF'].($param ? '?'.$param : '').'" method="POST">';
// 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 '<div class="divlinkfile'.((!empty($moreoptions['showhideaddbutton']) && $conf->use_javascript_ajax) ? ' hidden' : '').'">'.$moreoptions['afterlinktitle'].'</div>';
}
print '<form action="'.$_SERVER['PHP_SELF'].($param ? '?'.$param : '').'" id="'.$htmlname.'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<table class="liste noborder nobottom centpercent">';
@ -2175,11 +2209,10 @@ class FormFile
if ($nboflinks > 0) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
}
foreach ($links as $link) {
print '<tr class="oddeven">';
//edit mode
if ($action == 'update' && $selected === $link->id) {
if ($action == 'update' && $selected === (int) $link->id && $permissiontoedit) {
print '<td>';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="linkid" value="'.$link->id.'">';

View file

@ -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

View file

@ -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;

View file

@ -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 '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
print '<input type="hidden" name="token" value="'.newToken().'">';

View file

@ -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)
{

View file

@ -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] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
}
$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

View file

@ -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<Commande|CommandeFournisseur> $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);

View file

@ -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;

View file

@ -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

View file

@ -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')) {

View file

@ -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').')';
}

View file

@ -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);
}
}

View file

@ -14,14 +14,16 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* 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
*
*/

View file

@ -211,8 +211,9 @@ foreach ($object->fields as $key => $val) {
print '<div class="fichehalfright">';
print '<div class="underbanner clearboth"></div>';
if (empty($nounderbanner)) {
print '<div class="underbanner clearboth"></div>';
}
print '<table class="border centpercent tableforfield">';
print $rightpart;

View file

@ -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 "<br><br>";
//List of links
$formfile->listOfLinks(
$object,
$permission,
$action,
GETPOSTINT('linkid'),
$param,
'formaddlink',
array('afterlinktitle' => $formToAddALink, 'showhideaddbutton' => 1)
);
print "<br>";
//List of links
$formfile->listOfLinks($object, $permission, $action, GETPOSTINT('linkid'), $param);
print "<br>";

View file

@ -117,7 +117,7 @@ print '<div class="tagtable border table-border tableforfield centpercent">'."\n
print '<div class="tagtr table-border-row">'."\n";
$editmode = (GETPOST('action', 'aZ09') == 'edit'.$note_public);
print '<div class="tagtd tagtdnote tdtop'.($editmode ? '' : ' sensiblehtmlcontent').' table-key-border-col'.(empty($cssclass) ? '' : ' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\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 '</div>'."\n";
print '<div class="tagtd wordbreak table-val-border-col'.($editmode ? '' : ' sensiblehtmlcontent').'">'."\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 '<div class="tagtr table-border-row">'."\n";
$editmode = (GETPOST('action', 'aZ09') == 'edit'.$note_private);
print '<div class="tagtd tagtdnote tdtop'.($editmode ? '' : ' sensiblehtmlcontent').' table-key-border-col'.(empty($cssclass) ? '' : ' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\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 '</div>'."\n";
print '<div class="tagtd wordbreak table-val-border-col'.($editmode ? '' : ' sensiblehtmlcontent').'">'."\n";
print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdatapriv, '', null, null, $moreparam, 1);

View file

@ -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 '</td></tr>';
// Bank Account

View file

@ -6,7 +6,7 @@
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.fr>
* Copyright (C) 2017-2024 Frédéric France <frederic.france@free.fr>
* 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 '</td></tr>';
// Third party
print '<tr><td class="titlefieldcreate">' . $langs->trans("Customer") . '</td><td>' . $object->thirdparty->getNomUrl(1, 'customer') . '</td>';
print '<tr><td class="titlefieldcreate">' . $langs->trans("Supplier") . '</td><td>' . $object->thirdparty->getNomUrl(1, 'supplier') . '</td>';
print '</tr>';
// 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') . ')';

View file

@ -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;

View file

@ -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;

View file

@ -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),

View file

@ -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 <b>Remote blacklist</b>
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

View file

@ -142,6 +142,7 @@ ErrorFieldCantBeNegativeOnInvoice=Field <strong>%s</strong> 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 <b>%s</b>%%).
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 <b>%s</b> used to execute web server has no permission for that
ErrorNoActivatedBarcode=No barcode type activated
ErrUnzipFails=Failed to unzip %s with ZipArchive

View file

@ -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

View file

@ -287,75 +287,75 @@ if ($id > 0 || !empty($ref)) {
// Fields title search
// --------------------------------------------------------------------
print '<tr class="liste_titre_filter">';
print '<tr class="liste_titre liste_titre_filter">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre center maxwidthsearch">';
print '<th class="liste_titre center maxwidthsearch">';
$searchpicto = $form->showFilterButtons('left');
print $searchpicto;
print '</td>';
print '</th>';
}
// invoice ref
print '<td class="liste_titre">';
print '</td>';
print '<th class="liste_titre">';
print '</th>';
// company name
print '<td class="liste_titre">';
print '</td>';
print '<th class="liste_titre">';
print '</th>';
// customer code
print '<td class="liste_titre">';
print '</td>';
print '<th class="liste_titre">';
print '</th>';
// invoice date
print '<td class="liste_titre center">';
print '<th class="liste_titre center">';
print '<div class="nowrapfordate">';
print $form->selectDate($search_invoice_date_start ?: -1, 'search_invoice_date_start_', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print '</div>';
print '<div class="nowrapfordate">';
print $form->selectDate($search_invoice_date_end ?: -1, 'search_invoice_date_end_', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
print '</div>';
print '</td>';
print '</th>';
// selling price
print '<td class="liste_titre">';
print '</td>';
print '<th class="liste_titre">';
print '</th>';
// buying price
print '<td class="liste_titre">';
print '</td>';
print '<th class="liste_titre">';
print '</th>';
// qty
print '<td class="liste_titre">';
print '</td>';
print '<th class="liste_titre">';
print '</th>';
// margin
print '<td class="liste_titre">';
print '</td>';
print '<th class="liste_titre">';
print '</th>';
// margin rate
if (getDolGlobalString('DISPLAY_MARGIN_RATES')) {
print '<td class="liste_titre">';
print '</td>';
print '<th class="liste_titre">';
print '</th>';
}
// mark rate
if (getDolGlobalString('DISPLAY_MARK_RATES')) {
print '<td class="liste_titre">';
print '</td>';
print '<th class="liste_titre">';
print '</th>';
}
// status
print '<td class="liste_titre">';
print '</td>';
print '<th class="liste_titre">';
print '</th>';
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre center maxwidthsearch">';
print '<th class="liste_titre center maxwidthsearch">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</th>';
}
print '</tr>'."\n";

View file

@ -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) {

View file

@ -330,11 +330,11 @@ if ($id > 0 || !empty($ref)) {
print load_fiche_titre($langs->trans("ProductParentList"), '', '');
print '<table class="liste">';
print '<table class="liste noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans('ParentProducts').'</td>';
print '<td>'.$langs->trans('Label').'</td>';
print '<td class="right">'.$langs->trans('Qty').'</td>';
print '<th>'.$langs->trans('ParentProducts').'</th>';
print '<th>'.$langs->trans('Label').'</th>';
print '<th class="right">'.$langs->trans('Qty').'</th>';
print '</td>';
if (count($prodsfather) > 0) {
foreach ($prodsfather as $value) {
@ -374,33 +374,33 @@ if ($id > 0 || !empty($ref)) {
print '<input type="hidden" name="action" value="save_composed_product" />';
print '<input type="hidden" name="id" value="'.$id.'" />';
print '<table id="tablelines" class="ui-sortable liste nobottom">';
print '<table id="tablelines" class="ui-sortable liste noborder nobottom">';
print '<tr class="liste_titre nodrag nodrop">';
// Rank
print '<td>'.$langs->trans('Position').'</td>';
print '<th>'.$langs->trans('Position').'</th>';
// Product ref
print '<td>'.$langs->trans('ComposedProduct').'</td>';
print '<th>'.$langs->trans('ComposedProduct').'</th>';
// Product label
print '<td>'.$langs->trans('Label').'</td>';
print '<th>'.$langs->trans('Label').'</th>';
// Min supplier price
print '<td class="right" colspan="2">'.$langs->trans('MinSupplierPrice').'</td>';
print '<th class="right" colspan="2">'.$langs->trans('MinSupplierPrice').'</th>';
// Min customer price
print '<td class="right" colspan="2">'.$langs->trans('MinCustomerPrice').'</td>';
print '<th class="right" colspan="2">'.$langs->trans('MinCustomerPrice').'</th>';
// Stock
if (isModEnabled('stock')) {
print '<td class="right">'.$langs->trans('Stock').'</td>';
print '<th class="right">'.$langs->trans('Stock').'</th>';
}
// 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 '<td class="right">'.$langs->trans('Qty').'</td>';
print '<th class="right">'.$langs->trans('Qty').'</th>';
// Stoc inc/dev
print '<td class="center">'.$langs->trans('ComposedProductIncDecStock').'</td>';
print '<th class="center">'.$langs->trans('ComposedProductIncDecStock').'</th>';
// Move
print '<td class="linecolmove" style="width: 10px"></td>';
print '<th class="linecolmove" style="width: 10px"></th>';
print '</tr>'."\n";
$totalsell = 0;

View file

@ -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 '<input type="submit" class="button" name="refresh" value="'.$langs->trans('Refresh').'">';
print '<input type="submit" class="button smallpaddingimp" name="refresh" value="'.$langs->trans('Refresh').'">';
}
print '</td></tr>';
}
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'];

View file

@ -7,6 +7,7 @@
* Copyright (C) 2019 Pierre Ardoin <mapiolca@me.com>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -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);

View file

@ -1986,7 +1986,7 @@ while ($i < $imaxinloop) {
foreach ($arraypricelevel as $key => $value) {
if (!empty($arrayfields['p.sellprice'.$key]['checked'])) {
print '<td class="right nowraponall">';
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 '<span class="amount">'.price($productpricescache[$obj->rowid][$key]['price_ttc']).' '.$langs->trans("TTC").'</span>';
} else {

View file

@ -2779,36 +2779,36 @@ if ((!getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || $action == 'showlog_defau
print '<!-- List of log prices -->'."\n";
print '<div class="div-table-responsive">'."\n";
print '<table class="liste centpercent">'."\n";
print '<table class="liste centpercent noborder">'."\n";
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("AppliedPricesFrom").'</td>';
print '<th>'.$langs->trans("AppliedPricesFrom").'</tg>';
if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
print '<td class="center">'.$langs->trans("PriceLevel").'</td>';
print '<th class="center">'.$langs->trans("PriceLevel").'</th>';
}
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
print '<td class="center">'.$langs->trans("Type").'</td>';
print '<th class="center">'.$langs->trans("Type").'</th>';
}
print '<td class="center">'.$langs->trans("PriceBase").'</td>';
print '<th class="center">'.$langs->trans("PriceBase").'</th>';
if (!getDolGlobalString('PRODUIT_MULTIPRICES') && !getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) {
print '<td class="right">'.$langs->trans("DefaultTaxRate").'</td>';
print '<th class="right">'.$langs->trans("DefaultTaxRate").'</th>';
}
print '<td class="right">'.$langs->trans("HT").'</td>';
print '<td class="right">'.$langs->trans("TTC").'</td>';
print '<th class="right">'.$langs->trans("HT").'</th>';
print '<th class="right">'.$langs->trans("TTC").'</th>';
if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") {
print '<td class="right">'.$langs->trans("INCT").'</td>';
print '<th class="right">'.$langs->trans("INCT").'</th>';
}
if (isModEnabled('dynamicprices')) {
print '<td class="right">'.$langs->trans("PriceExpressionSelected").'</td>';
print '<th class="right">'.$langs->trans("PriceExpressionSelected").'</th>';
}
print '<td class="right">'.$langs->trans("MinPrice").' '.$langs->trans("HT").'</td>';
print '<td class="right">'.$langs->trans("MinPrice").' '.$langs->trans("TTC").'</td>';
print '<td class="right">'.$langs->trans("Label").'</td>';
print '<td>'.$langs->trans("ChangedBy").'</td>';
print '<th class="right">'.$langs->trans("MinPrice").' '.$langs->trans("HT").'</th>';
print '<th class="right">'.$langs->trans("MinPrice").' '.$langs->trans("TTC").'</th>';
print '<th class="right">'.$langs->trans("Label").'</th>';
print '<th>'.$langs->trans("ChangedBy").'</th>';
if ($user->hasRight('produit', 'supprimer')) {
print '<td class="right">&nbsp;</td>';
print '<th class="right">&nbsp;</th>';
}
print '</tr>';

View file

@ -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 '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
// Suppliers list title
print '<!-- List of supplier prices -->'."\n";
print '<div class="div-table-responsive">';
print '<table class="liste centpercent">';
print '<table class="liste centpercent noborder">';
$param = "&id=".$object->id;

View file

@ -266,9 +266,9 @@ if ($result || !($id > 0)) {
}
if ($mode != 'byunit') {
print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="'.$_SERVER["PHP_SELF"].'?mode=byunit'.$param.'">';
print '<a class="a-mesure-disabled marginrightonly reposition" href="'.$_SERVER["PHP_SELF"].'?mode=byunit'.$param.'">';
} else {
print '<span class="a-mesure marginleftonly marginrightonly">';
print '<span class="a-mesure marginrightonly">';
}
if ($type == '0') {
print $langs->trans("StatsByNumberOfUnitsProducts");

View file

@ -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;

View file

@ -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

View file

@ -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++;

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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();

View file

@ -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 '</td>';
// Information (Owner, ...)
print '<td class="minwidth100">';
if ($companypaymentmodetemp->proprio) {
print '<span class="opacitymedium">'.$companypaymentmodetemp->proprio.'</span><br>';
if ($companypaymentmodetemp->owner_name) {
print '<span class="opacitymedium">'.$companypaymentmodetemp->owner_name.'</span><br>';
}
if ($companypaymentmodetemp->last_four) {
print '....'.$companypaymentmodetemp->last_four;
@ -1824,28 +1825,28 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
print '<td>';
print'</td>';
// Account number
print '<td valign="middle">';
print '<td>';
print '</td>';
// IBAN
print '<td valign="middle">';
print '<td>';
//var_dump($src);
print '</td>';
// BIC
print '<td valign="middle">';
print '<td>';
//var_dump($src);
print '</td>';
if (isModEnabled('prelevement')) {
// RUM
print '<td valign="middle">';
print '<td>';
//var_dump($src);
print '</td>';
// Date
print '<td valign="middle">';
print '<td>';
//var_dump($src);
print '</td>';
// Mode mandate
print '<td valign="middle">';
print '<td>';
//var_dump($src);
print '</td>';
}
@ -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 '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoBANRecord").'</span></td></tr>';
}
@ -2120,7 +2124,7 @@ if ($socid && $action == 'editcard' && $permissiontoaddupdatepaymentinformation)
print '<td><input class="minwidth300" type="text" id="label" name="label" value="'.$companypaymentmode->label.'"></td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("NameOnCard").'</td>';
print '<td><input class="minwidth200" type="text" name="proprio" value="'.$companypaymentmode->proprio.'"></td></tr>';
print '<td><input class="minwidth200" type="text" name="proprio" value="'.$companypaymentmode->owner_name.'"></td></tr>';
print '<tr><td>'.$langs->trans("CardNumber").'</td>';
print '<td><input class="minwidth200" type="text" name="cardnumber" value="'.$companypaymentmode->number.'"></td></tr>';
@ -2163,10 +2167,10 @@ if ($socid && $action == 'create' && $permissiontoaddupdatepaymentinformation) {
print '<table class="border centpercent">';
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td>';
print '<td><input class="minwidth200" type="text" id="label" name="label" value="'.(GETPOSTISSET('label') ? GETPOST('label') : $object->name).'"></td></tr>';
print '<td><input class="minwidth250" type="text" id="label" name="label" value="'.(GETPOSTISSET('label') ? GETPOST('label') : $langs->trans("Bank").' '.$object->name).'"></td></tr>';
print '<tr><td>'.$langs->trans("Bank").'</td>';
print '<td><input class="minwidth200" type="text" id="bank" name="bank" value="'.GETPOST('bank').'"></td></tr>';
print '<td><input class="minwidth250" type="text" id="bank" name="bank" value="'.GETPOST('bank').'"></td></tr>';
// Show fields of bank account
foreach ($companybankaccount->getFieldsToShow(1) as $val) {

View file

@ -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)) {

View file

@ -1709,7 +1709,7 @@ if ($action == 'create') {
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DeliveryDate');
print '</td>';
if ($action != 'editdate_livraison' && $object->statut == SupplierProposal::STATUS_VALIDATED) {
if ($action != 'editdate_livraison' && $object->statut != SupplierProposal::STATUS_NOTSIGNED) {
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate_livraison&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryDate'), 1).'</a></td>';
}
print '</tr></table>';

View file

@ -4256,7 +4256,7 @@ table.nointerlines tr:not(:last-child) td {
}
/* Experimental code to manage rounding */
/* Management of border radius */
<?php $borderradius = getDolGlobalString('THEME_ELDY_USEBORDERONTABLE') ? getDolGlobalInt('THEME_ELDY_BORDER_RADIUS', 6) : 0; ?>
table.noborder:not(.cal_month, .paymenttable) {
border-radius: <?php echo $borderradius; ?>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;
}

View file

@ -4363,6 +4363,66 @@ table.nointerlines tr:not(:last-child) td {
border-top: unset !important;
}
/* Management of border radius */
<?php $borderradius = getDolGlobalString('THEME_ELDY_USEBORDERONTABLE') ? getDolGlobalInt('THEME_ELDY_BORDER_RADIUS', 6) : 0; ?>
table.noborder:not(.cal_month, .paymenttable) {
border-radius: <?php echo $borderradius; ?>px;
}
table.noborder.cal_month {
border-bottom-left-radius: <?php echo $borderradius; ?>px;
border-bottom-right-radius: <?php echo $borderradius; ?>px;
}
table.liste:not(.listwithfilterbefore) {
border-top-left-radius: <?php echo $borderradius; ?>px;
border-top-right-radius: <?php echo $borderradius; ?>px;
}
table.liste {
border-bottom-left-radius: <?php echo $borderradius; ?>px;
border-bottom-right-radius: <?php echo $borderradius; ?>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: <?php echo $borderradius; ?>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: <?php echo $borderradius; ?>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: <?php echo $borderradius; ?>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: <?php echo $borderradius; ?>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: <?php echo $borderradius; ?>px;
}
div.liste_titre_bydiv {
border-top-left-radius: <?php echo $borderradius; ?>px;
border-top-right-radius: <?php echo $borderradius; ?>px;
}
table.liste tr:last-child td:first-child,
table.liste tr:last-child th:first-child {
border-bottom-left-radius: <?php echo $borderradius; ?>px;
}
table.liste tr:last-child td:last-child,
table.liste tr:last-child th:last-child {
border-bottom-right-radius: <?php echo $borderradius; ?>px;
}
table#tablelines tr:last-of-type td:first-child, table#tablelines tr#trlinefordates, table#tablelines tr#trlinefordates td {
border-bottom-left-radius: <?php echo $borderradius; ?>px;
}
table#tablelines tr:last-of-type td:last-child, table#tablelines tr#trlinefordates, table#tablelines tr#trlinefordates td {
border-bottom-right-radius: <?php echo $borderradius; ?>px;
}
.liste_titre_filter {
background: var(--colorbacktitle1) !important;
}

View file

@ -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 "</textarea></td></tr>";
print '<tr><td>'.$langs->trans("BankAccountOwner").'</td>';
print '<td colspan="4"><input size="30" type="text" name="proprio" value="'.$account->proprio.'"></td></tr>';
print '<td colspan="4"><input size="30" type="text" name="proprio" value="'.$account->owner_name.'"></td></tr>';
print "</td></tr>\n";
print '<tr><td class="tdtop">'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="4">';

View file

@ -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);

View file

@ -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, string>,) 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:

View file

@ -6,6 +6,7 @@
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -396,7 +397,7 @@ if ($resql) {
}
if (getDolGlobalInt('MAILING_DELAY')) {
usleep((float) getDolGlobalInt('MAILING_DELAY') * 1000000);
usleep((int) ((float) getDolGlobalInt('MAILING_DELAY') * 1000000));
}
}
} else {