Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2024-01-12 21:41:20 +01:00
commit e2c91e67a0
5 changed files with 22 additions and 14 deletions

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2013-2021 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
@ -166,8 +166,6 @@ class AccountingAccount extends CommonObject
*/
public function __construct($db)
{
global $conf;
$this->db = $db;
$this->next_prev_filter = "fk_pcg_version IN (SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS')).")"; // Used to add a filter in Form::showrefnav method
}
@ -866,10 +864,14 @@ class AccountingAccount extends CommonObject
// Level 3 (define $code_t): Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
if (getDolGlobalString('ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY')) {
if (!empty($buyer->code_compta_product)) {
if ($type == 'customer' && !empty($buyer->code_compta_product)) {
$code_t = $buyer->code_compta_product;
$suggestedid = $accountingAccount['thirdparty'];
$suggestedaccountingaccountfor = 'thirdparty';
} elseif ($type == 'supplier' && !empty($seller->code_compta_product)) {
$code_t = $seller->code_compta_product;
$suggestedid = $accountingAccount['thirdparty'];
$suggestedaccountingaccountfor = 'thirdparty';
}
}

View file

@ -799,10 +799,14 @@ if (empty($reshook)) {
if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED || $object->statut == Propal::STATUS_CANCELED) {
$db->begin();
$result = $object->reopen($user, !getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE'));
$newstatus = (getDolGlobalInt('PROPAL_SKIP_ACCEPT_REFUSE') ? Propal::STATUS_DRAFT : Propal::STATUS_VALIDATED);
$result = $object->reopen($user, $newstatus);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
} else {
$object->statut = $newstatus;
$object->status = $newstatus;
}
if (!$error) {

View file

@ -1351,14 +1351,16 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
}
}
// Show page nb only on iso languages (so default Helvetica font)
// if (strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica') {
$pdf->SetXY($dims['wk'] - $dims['rm'] - 18 - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_X', 0), -$posy - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_Y', 0));
// $pdf->MultiCell(18, 2, $pdf->getPageNumGroupAlias().' / '.$pdf->getPageGroupAlias(), 0, 'R', 0);
// $pdf->MultiCell(18, 2, $pdf->PageNo().' / '.$pdf->getAliasNbPages(), 0, 'R', 0); // doesn't works with all fonts
// $pagination = $pdf->getAliasNumPage().' / '.$pdf->getAliasNbPages(); // works with $pdf->Cell
$pagination = $pdf->PageNo().' / '.$pdf->getNumPages();
if (getDolGlobalString('PDF_USE_GETALIASNBPAGE_FOR_TOTAL')) {
// $pagination = $pdf->getAliasNumPage().' / '.$pdf->getAliasNbPages(); // works with $pdf->Cell
$pagination = $pdf->PageNo().' / '.$pdf->getAliasNbPages(); // seems to not works with all fonts like ru_UK
} else {
$pagination = $pdf->PageNo().' / '.$pdf->getNumPages(); // seems to always work even with $pdf->Cell. But some users has reported wrong nb (no way to reproduce)
}
$pdf->MultiCell(18, 2, $pagination, 0, 'R', 0);
// }
// Show Draft Watermark
if (!empty($watermark)) {

View file

@ -738,8 +738,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu = $menu;
$mainmenu = ($forcemainmenu ? $forcemainmenu : $_SESSION["mainmenu"]);
$leftmenu = ($forceleftmenu ? '' : (empty($_SESSION["leftmenu"]) ? 'none' : $_SESSION["leftmenu"]));
$mainmenu = ($forcemainmenu ? $forcemainmenu : $_SESSION["mainmenu"]??'');
$leftmenu = ($forceleftmenu ? '' : (empty($_SESSION["leftmenu"]) ? 'none' : $_SESSION["leftmenu"]??''));
if (is_null($mainmenu)) {
$mainmenu = 'home';

View file

@ -67,7 +67,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
if (!getDolGlobalString('BLOCKEDLOG_ADD_ACTIONS_SUPPORTED') || !in_array($action, explode(',', getDolGlobalString('BLOCKEDLOG_ADD_ACTIONS_SUPPORTED')))) {
// If custom actions are not set or if action not into custom actions, we can exclude action if object->elementis not valid
$listofqualifiedelement = array('facture', 'don', 'payment', 'payment_donation', 'subscription', 'payment_various', 'cashcontrol');
if (!in_array($object->element, $listofqualifiedelement)) {
if (!is_object($object) || !property_exists($object, 'element') || !in_array($object->element, $listofqualifiedelement)) {
return 1;
}
}