mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
aacecf4569
|
|
@ -10,6 +10,7 @@
|
|||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Nick Fragoulis
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 Éric Seigne <eric.seigne@cap-rel.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -268,11 +269,24 @@ class pdf_strato extends ModelePDFContract
|
|||
$tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 : 10);
|
||||
|
||||
// Display notes
|
||||
if (!empty($object->note_public)) {
|
||||
$notetoshow = empty($object->note_public) ? '' : $object->note_public;
|
||||
|
||||
// Extrafields in note
|
||||
$extranote = $this->getExtrafieldsInHtml($object, $outputlangs);
|
||||
if (!empty($extranote)) {
|
||||
$notetoshow = dol_concatdesc($notetoshow, $extranote);
|
||||
}
|
||||
|
||||
if (!empty($notetoshow)) {
|
||||
$tab_top -= 2;
|
||||
|
||||
$substitutionarray = pdf_getSubstitutionArray($outputlangs, null, $object);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
|
||||
$notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow);
|
||||
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($object->note_public), 0, 1);
|
||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($notetoshow), 0, 1);
|
||||
$nexY = $pdf->GetY();
|
||||
$height_note = $nexY - $tab_top;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2022-2024 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
|
|
@ -249,7 +249,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
|||
$totalHTInvoices = 0;
|
||||
$areAllInvoicesValidated = true;
|
||||
foreach ($orderLinked->linkedObjects['facture'] as $key => $invoice) {
|
||||
if ($invoice->statut == Facture::STATUS_VALIDATED || $object->id == $invoice->id) {
|
||||
if ($invoice->statut == Facture::STATUS_VALIDATED || $invoice->statut == Facture::STATUS_CLOSED || $object->id == $invoice->id) {
|
||||
$totalHTInvoices += (float) $invoice->total_ht;
|
||||
} else {
|
||||
$areAllInvoicesValidated = false;
|
||||
|
|
|
|||
|
|
@ -1599,6 +1599,7 @@ class CommandeFournisseur extends CommonOrder
|
|||
$this->multicurrency_tx = 1;
|
||||
}
|
||||
|
||||
// We set order into draft status
|
||||
$this->statut = self::STATUS_DRAFT; // deprecated
|
||||
$this->status = self::STATUS_DRAFT;
|
||||
|
||||
|
|
@ -3472,6 +3473,7 @@ class CommandeFournisseur extends CommonOrder
|
|||
|
||||
/**
|
||||
* Returns the rights used for this class
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getRights()
|
||||
|
|
|
|||
|
|
@ -114,13 +114,13 @@ class Segment implements IteratorAggregate, Countable
|
|||
// Remove the IF tag
|
||||
$this->xml = str_replace('[!-- IF '.$key.' --]', '', $this->xml);
|
||||
// Remove everything between the ELSE tag (if it exists) and the ENDIF tag
|
||||
$reg = '@(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
$reg = '@(\[!--\sELSE\s' . preg_quote($key, '@') . '\s--\](.*))?\[!--\sENDIF\s' . preg_quote($key, '@') . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
$this->xml = preg_replace($reg, '', $this->xml);
|
||||
}
|
||||
// Else the value is false, then two cases: no ELSE and we're done, or there is at least one place where there is an ELSE clause, then we replace it
|
||||
else {
|
||||
// Find all conditional blocks for this variable: from IF to ELSE and to ENDIF
|
||||
$reg = '@\[!--\sIF\s' . $key . '\s--\](.*)(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
$reg = '@\[!--\sIF\s' . preg_quote($key, '@') . '\s--\](.*)(\[!--\sELSE\s' . preg_quote($key, '@') . '\s--\](.*))?\[!--\sENDIF\s' . preg_quote($key, '@') . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER);
|
||||
foreach ($matches as $match) { // For each match, if there is an ELSE clause, we replace the whole block by the value in the ELSE clause
|
||||
if (!empty($match[3])) $this->xml = str_replace($match[0], $match[3], $this->xml);
|
||||
|
|
|
|||
|
|
@ -562,7 +562,7 @@ IMG;
|
|||
else return;
|
||||
|
||||
// Search all tags found into condition to complete $this->vars, so we will proceed all tests even if not defined
|
||||
$reg='@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU';
|
||||
$reg='@\[!--\sIF\s([\[\]{}a-zA-Z0-9\.\,_]+)\s--\]@smU';
|
||||
$matches = array();
|
||||
preg_match_all($reg, $xml, $matches, PREG_SET_ORDER);
|
||||
|
||||
|
|
@ -584,7 +584,7 @@ IMG;
|
|||
// Remove the IF tag
|
||||
$xml = str_replace('[!-- IF '.$key.' --]', '', $xml);
|
||||
// Remove everything between the ELSE tag (if it exists) and the ENDIF tag
|
||||
$reg = '@(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
$reg = '@(\[!--\sELSE\s' . preg_quote($key, '@') . '\s--\](.*))?\[!--\sENDIF\s' . preg_quote($key, '@') . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
$xml = preg_replace($reg, '', $xml);
|
||||
/*if ($sav != $xml)
|
||||
{
|
||||
|
|
@ -597,7 +597,7 @@ IMG;
|
|||
//dol_syslog("Var ".$key." is not defined, we remove the IF, ELSE and ENDIF ");
|
||||
//$sav=$xml;
|
||||
// Find all conditional blocks for this variable: from IF to ELSE and to ENDIF
|
||||
$reg = '@\[!--\sIF\s' . $key . '\s--\](.*)(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
$reg = '@\[!--\sIF\s' . preg_quote($key, '@') . '\s--\](.*)(\[!--\sELSE\s' . preg_quote($key, '@') . '\s--\](.*))?\[!--\sENDIF\s' . preg_quote($key, '@') . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||
preg_match_all($reg, $xml, $matches, PREG_SET_ORDER);
|
||||
foreach ($matches as $match) { // For each match, if there is an ELSE clause, we replace the whole block by the value in the ELSE clause
|
||||
if (!empty($match[3])) $xml = str_replace($match[0], $match[3], $xml);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user