From 88fb094a78e42f721e1494e5cbe098910b58a87a Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Fri, 8 Nov 2019 22:02:30 +0100 Subject: [PATCH 1/3] Fix problem of display photo in the model Fix a problem with photo in the model : Before : Check in the current entity the product's repertory to find a photo Now : Check all entities product's repertories to find a photo --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 14f4dfe8f9f..7fb456fc4d6 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -8,6 +8,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2017-2018 Ferran Marcet * Copyright (C) 2018 Frédéric France + * Copyright (C) 2019 Pierre Ardoin * * 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 @@ -257,7 +258,13 @@ class pdf_azur extends ModelePDFPropales { if (! $arephoto) { - $dir = $conf->product->dir_output.'/'.$midir; + if ($conf->product->entity != $objphoto->entity) { + + $dir = $conf->product->multidir_output[$objphoto->entity].'/'.$midir; //Check repertories of current entities + }else{ + + $dir = $conf->product->dir_output.'/'.$midir; //Check repertory of the current product + } foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) { From 558e0cb5f6a4bb71d01b2ea17f43e397ea32cd59 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Dec 2019 22:34:49 +0100 Subject: [PATCH 2/3] Fix regression --- htdocs/core/lib/pdf.lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index ac407bd42a1..bb689d52519 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1263,8 +1263,10 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, if (! empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && ($textwasmodified || $translatealsoifmodified)) $note=$prodser->multilangs[$outputlangs->defaultlang]["note"]; } } - elseif ($object->type == Facture::TYPE_DEPOSIT && $object->element == 'facture') { - $desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc); + elseif ($object->element == 'facture' || $object->element == 'facturefourn') { + if ($object->type == $object::TYPE_DEPOSIT) { + $desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc); + } } // Description short of product line From 6227d14cf3e501f4784e30b6e5ac23cf220465db Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Fri, 6 Dec 2019 13:48:24 +0100 Subject: [PATCH 3/3] NEW 10.0: link to template of origin in bill cards for bills created from a template --- htdocs/compta/facture/card.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 9cb76a2f292..d320105ae2a 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3817,9 +3817,14 @@ elseif ($id > 0 || ! empty($ref)) if ($object->fk_fac_rec_source > 0) { - $tmptemplate = new FactureRec($db); - $result = $tmptemplate->fetch($object->fk_fac_rec_source); - if ($result > 0) print '. '.$langs->trans("GeneratedFromTemplate", $tmptemplate->ref); + $tmptemplate = new FactureRec($db); + $result = $tmptemplate->fetch($object->fk_fac_rec_source); + if ($result > 0) { + print '. '.$langs->trans( + "GeneratedFromTemplate", + ''.$tmptemplate->ref.'' + ); + } } print '';