From 3697d7f2aa1f25a06a4758dc8e7cd2927d0edf8f Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Mon, 7 Oct 2024 15:55:13 +0200 Subject: [PATCH 1/3] Fix: Grand total correction --- htdocs/core/tpl/list_print_total.tpl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php index 8900665eaeb95..8990ce129845b 100644 --- a/htdocs/core/tpl/list_print_total.tpl.php +++ b/htdocs/core/tpl/list_print_total.tpl.php @@ -64,7 +64,8 @@ while ($i < $totalarray['nbfield']) { $i++; if (!empty($totalarray['pos'][$i])) { - printTotalValCell($totalarray['type'][$i], $sumsarray[$totalarray['pos'][$i]]); + $fieldname = preg_replace('/[^a-z0-9]/', '', $totalarray['pos'][$i]); + printTotalValCell($totalarray['type'][$i], $sumsarray[$fieldname]); } else { if ($i == 1) { print ''; From 786905a6c8b341e9d52ec356fce9aab0bec35b63 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 10 Oct 2024 09:16:32 +0200 Subject: [PATCH 2/3] Fix: Does not filter correctly by project contacts --- htdocs/core/lib/company.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 411fe6d0663ab..9a1ea12d88fd0 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -10,7 +10,7 @@ * Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2017 Rui Strecht - * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018-2024 Ferran Marcet * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -1026,7 +1026,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_contact as tc on ec.fk_c_type_contact = tc.rowid"; $sql .= " WHERE sc.fk_soc = ".((int) $object->id); $sql .= " AND p.entity IN (".getEntity('project').")"; - $sql .= " AND tc.element = 'project'"; + $sql .= " AND tc.element = 'project' AND tc.source = 'external'"; $sql .= " ORDER BY p.dateo DESC"; $result = $db->query($sql); From 4354165955958eb031f06bf5ba19bd70f704d941 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 13 Nov 2024 10:31:47 +0100 Subject: [PATCH 3/3] Fix: Closed invoices are not considered as issued --- .../interface_20_modWorkflow_WorkflowManager.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index a816a83a42826..5f291b9e5bd8f 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2010 Regis Houssin * Copyright (C) 2011-2017 Laurent Destailleur * Copyright (C) 2014 Marcos García - * Copyright (C) 2022 Ferran Marcet + * Copyright (C) 2022-2024 Ferran Marcet * Copyright (C) 2023 Alexandre Janniaux * Copyright (C) 2024 MDW * @@ -248,7 +248,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf $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;