2
0
forked from Wavyzz/dolibarr

Merge remote-tracking branch 'origin/18.0' into 19.0

This commit is contained in:
Laurent Destailleur
2025-06-09 17:25:03 +02:00
12 changed files with 27 additions and 27 deletions

View File

@@ -1013,7 +1013,7 @@ class BookKeeping extends CommonObject
$line->multicurrency_amount = $obj->multicurrency_amount;
$line->multicurrency_code = $obj->multicurrency_code;
$line->lettering_code = $obj->lettering_code;
$line->date_lettering = $obj->date_lettering;
$line->date_lettering = $this->db->jdate($obj->date_lettering);
$line->fk_user_author = $obj->fk_user_author;
$line->import_key = $obj->import_key;
$line->code_journal = $obj->code_journal;
@@ -1165,7 +1165,7 @@ class BookKeeping extends CommonObject
$line->amount = $obj->amount;
$line->sens = $obj->sens;
$line->lettering_code = $obj->lettering_code;
$line->date_lettering = $obj->date_lettering;
$line->date_lettering = $this->db->jdate($obj->date_lettering);
$line->fk_user_author = $obj->fk_user_author;
$line->import_key = $obj->import_key;
$line->code_journal = $obj->code_journal;

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2023 Romain Neil <contact@romain-neil.fr>
* Copyright (C) 2025 William Mead <william@m34d.com>
*
* This program is free software you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -497,7 +498,7 @@ class Documents extends DolibarrApi
} elseif ($modulepart == 'expensereport') {
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
if (!DolibarrApiAccess::$user->rights->expensereport->read && !DolibarrApiAccess::$user->rights->expensereport->read) {
if (!DolibarrApiAccess::$user->rights->expensereport->lire) {
throw new RestException(401);
}

View File

@@ -3169,7 +3169,7 @@ if ($action == 'create') {
if ($object->statut != Propal::STATUS_DRAFT && $useonlinesignature) {
print '<br><!-- Link to sign -->';
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
print showOnlineSignatureUrl('proposal', $object->ref).'<br>';
print showOnlineSignatureUrl('proposal', $object->ref, $object).'<br>';
}
print '</div><div class="fichehalfright">';

View File

@@ -253,7 +253,7 @@ if ($resql) {
// Date ope
print '<td class="nowrap left">';
print '<span id="dateoperation_'.$objp->rowid.'">'.dol_print_date($db->jdate($objp->do), "day")."</span>";
print '<span id="dateoperation_'.$objp->facid.'">'.dol_print_date($db->jdate($objp->do), "day")."</span>";
print "</td>\n";
if (!$i) {
$totalarray['nbfield']++;

View File

@@ -96,7 +96,7 @@ $origin = GETPOST('origin', 'alpha');
$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility
$fac_rec = GETPOST('fac_rec', 'int');
$facid = GETPOST('facid', 'int');
$ref_client = GETPOST('ref_client', 'int');
$ref_client = GETPOST('ref_client', 'alpha');
$rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1;
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : 0);
$selectedLines = GETPOST('toselect', 'array');
@@ -643,7 +643,7 @@ if (empty($reshook)) {
$object->setValueFrom('ref', GETPOST('ref'), '', null, '', '', $user, 'BILL_MODIFY');
} elseif ($action == 'setref_client' && $usercancreate) {
$object->fetch($id);
$object->set_ref_client(GETPOST('ref_client'));
$object->set_ref_client(GETPOST('ref_client', 'alpha'));
} elseif ($action == 'confirm_valid' && $confirm == 'yes' && $usercanvalidate) {
// Classify to validated
$idwarehouse = GETPOST('idwarehouse', 'int');

View File

@@ -2282,7 +2282,7 @@ if ($action == 'create') {
print '<br><!-- Link to sign -->';
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
print showOnlineSignatureUrl('contract', $object->ref).'<br>';
print showOnlineSignatureUrl('contract', $object->ref, $object).'<br>';
}
print '</div><div class="fichehalfright">';

View File

@@ -8613,7 +8613,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
if (is_object($object) && $object->element == 'propal') {
$substitutionarray['__URL_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/comm/propal/card.php?id=".$object->id;
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
$substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'proposal', $object->ref);
$substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'proposal', $object->ref, 1, $object);
}
if (is_object($object) && $object->element == 'commande') {
$substitutionarray['__URL_ORDER__'] = DOL_MAIN_URL_ROOT."/commande/card.php?id=".$object->id;
@@ -8624,12 +8624,12 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
if (is_object($object) && $object->element == 'contrat') {
$substitutionarray['__URL_CONTRACT__'] = DOL_MAIN_URL_ROOT."/contrat/card.php?id=".$object->id;
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
$substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'contract', $object->ref);
$substitutionarray['__ONLINE_SIGN_URL__'] = getOnlineSignatureUrl(0, 'contract', $object->ref, 1, $object);
}
if (is_object($object) && $object->element == 'fichinter') {
$substitutionarray['__URL_FICHINTER__'] = DOL_MAIN_URL_ROOT."/fichinter/card.php?id=".$object->id;
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
$substitutionarray['__ONLINE_SIGN_FICHINTER_URL__'] = getOnlineSignatureUrl(0, 'fichinter', $object->ref);
$substitutionarray['__ONLINE_SIGN_FICHINTER_URL__'] = getOnlineSignatureUrl(0, 'fichinter', $object->ref, 1, $object);
}
if (is_object($object) && $object->element == 'supplier_proposal') {
$substitutionarray['__URL_SUPPLIER_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/supplier_proposal/card.php?id=".$object->id;

View File

@@ -1984,7 +1984,7 @@ function pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails = 0)
$tmpresult .= vatrate($object->lines[$i]->tva_tx, 0, $object->lines[$i]->info_bits, -1);
if (!getDolGlobalString('MAIN_PDF_MAIN_HIDE_SECOND_TAX')) {
if ($object->lines[$i]->total_localtax1 != 0) {
if (price2num($object->lines[$i]->localtax1_tx)) {
if (preg_replace('/[\s0%]/', '', $tmpresult)) {
$tmpresult .= '/';
} else {
@@ -1994,7 +1994,7 @@ function pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails = 0)
}
}
if (!getDolGlobalString('MAIN_PDF_MAIN_HIDE_THIRD_TAX')) {
if ($object->lines[$i]->total_localtax2 != 0) {
if (price2num($object->lines[$i]->localtax2_tx)) {
if (preg_replace('/[\s0%]/', '', $tmpresult)) {
$tmpresult .= '/';
} else {

View File

@@ -1766,7 +1766,7 @@ if ($action == 'create') {
print '<br><!-- Link to sign -->';
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
print showOnlineSignatureUrl('fichinter', $object->ref).'<br>';
print showOnlineSignatureUrl('fichinter', $object->ref, $object).'<br>';
}
print '</div><div class="fichehalfright">';

View File

@@ -764,8 +764,8 @@ class FactureFournisseurRec extends CommonInvoice
$line->total_localtax2 = $objp->total_localtax2;
$line->total_ttc = $objp->total_ttc;
$line->product_type = $objp->product_type;
$line->date_start = $objp->date_start;
$line->date_end = $objp->date_end;
$line->date_start = $this->db->jdate($objp->date_start);
$line->date_end = $this->db->jdate($objp->date_end);
$line->info_bits = $objp->info_bits ;
$line->special_code = $objp->special_code;
$line->rang = $objp->rang;
@@ -2127,8 +2127,8 @@ class FactureFournisseurLigneRec extends CommonObjectLine
$this->total_localtax2 = $objp->total_localtax2;
$this->total_ttc = $objp->total_ttc;
$this->product_type = $objp->product_type;
$this->date_start = $objp->date_start;
$this->date_end = $objp->date_end;
$this->date_start = $this->db->jdate($objp->date_start);
$this->date_end = $this->db->jdate($objp->date_end);
$this->info_bits = $objp->info_bits;
$this->special_code = $objp->special_code;
$this->rang = $objp->rang;

View File

@@ -238,7 +238,6 @@ class FactureFournisseur extends CommonInvoice
/**
* Invoice lines
* @var SupplierInvoiceLine[]
*/
public $lines = array();
@@ -1051,8 +1050,9 @@ class FactureFournisseur extends CommonInvoice
$line->id = $obj->rowid;
$line->rowid = $obj->rowid;
$line->description = $obj->description;
$line->date_start = $obj->date_start;
$line->date_end = $obj->date_end;
$line->date_start = $this->db->jdate($obj->date_start);
$line->date_end = $this->db->jdate($obj->date_end);
$line->product_ref = $obj->product_ref;
$line->ref = $obj->product_ref;
$line->ref_supplier = $obj->ref_supplier;
@@ -3674,8 +3674,8 @@ class SupplierInvoiceLine extends CommonObjectLine
$this->rowid = $obj->rowid;
$this->fk_facture_fourn = $obj->fk_facture_fourn;
$this->description = $obj->description;
$this->date_start = $obj->date_start;
$this->date_end = $obj->date_end;
$this->date_start = $this->db->jdate($obj->date_start);
$this->date_end = $this->db->jdate($obj->date_end);
$this->product_ref = $obj->product_ref;
$this->ref_supplier = $obj->ref_supplier;
$this->product_desc = $obj->product_desc;

View File

@@ -4041,10 +4041,9 @@ class User extends CommonObject
if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql .= " WHERE t.entity IS NOT NULL"; // Show all users
} else {
$sql .= ",".$this->db->prefix()."usergroup_user as ug";
$sql .= " WHERE ((ug.fk_user = t.rowid";
$sql .= " AND ug.entity IN (".getEntity('usergroup')."))";
$sql .= " OR t.entity = 0)"; // Show always superadmin
$sql .= " WHERE t.entity = 0 OR EXISTS (";
$sql .= " SELECT ug.rowid FROM " . $this->db->prefix() . "usergroup_user as ug";
$sql .= " WHERE ug.fk_user = t.rowid AND ug.entity IN (" . getEntity('usergroup') . "))";
}
} else {
$sql .= " WHERE t.entity IN (".getEntity('user').")";