diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 80e81be745a..bb9155f66b2 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -1,10 +1,11 @@ - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2014 Marcos García - * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018-2025 Frédéric France +/* Copyright (C) 2010-2012 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2014 Marcos García + * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2024 MDW + * Copyright (C) 2025 Alexandre Spangaro * * 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 @@ -344,6 +345,19 @@ class doc_generic_invoice_odt extends ModelePDFFactures $nbProduct = 0; $nbService = 0; foreach ($object->lines as $line) { + // Do not take into account lines of the type “deposit.” + $is_deposit = false; + if (preg_match('/^\((.*)\)$/', $line->desc, $reg)) { + if ($reg[1] == 'DEPOSIT') { + $is_deposit = true; + } + } + + // If DEPOSIT, this line is completely ignored for calculations. + if ($is_deposit) { + continue; + } + // determine category of operation if ($categoryOfOperation < 2) { $lineProductType = $line->product_type; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index b548cb510bf..29b1eadf415 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -13,7 +13,7 @@ * Copyright (C) 2022 Charlene Benke * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Nick Fragoulis - * Copyright (C) 2024 Alexandre Spangaro + * Copyright (C) 2024-2025 Alexandre Spangaro * * 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 @@ -388,6 +388,19 @@ class pdf_crabe extends ModelePDFFactures $this->atleastonediscount++; } + // Do not take into account lines of the type “deposit.” + $is_deposit = false; + if (preg_match('/^\((.*)\)$/', $object->lines[$i]->desc, $reg)) { + if ($reg[1] == 'DEPOSIT') { + $is_deposit = true; + } + } + + // If DEPOSIT, this line is completely ignored for calculations. + if ($is_deposit) { + continue; + } + // determine category of operation if ($categoryOfOperation < 2) { $lineProductType = $object->lines[$i]->product_type; diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index f7090067beb..3a2339b6b07 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -1,17 +1,17 @@ - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2008 Raphael Bertrand - * Copyright (C) 2010-2014 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2012 Cédric Salvador - * Copyright (C) 2012-2014 Raphaël Doursenaud - * Copyright (C) 2015 Marcos Garcia - * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018-2025 Frédéric France - * Copyright (C) 2022 Anthony Berton - * Copyright (C) 2022-2025 Alexandre Spangaro - * Copyright (C) 2022-2024 Eric Seigne +/* Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand + * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012 Cédric Salvador + * Copyright (C) 2012-2014 Raphaël Doursenaud + * Copyright (C) 2015 Marcos Garcia + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2018-2025 Frédéric France + * Copyright (C) 2022 Anthony Berton + * Copyright (C) 2022-2025 Alexandre Spangaro + * Copyright (C) 2022-2024 Eric Seigne * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Nick Fragoulis * @@ -488,6 +488,19 @@ class pdf_octopus extends ModelePDFFactures $this->atleastonediscount++; } + // Do not take into account lines of the type “deposit.” + $is_deposit = false; + if (preg_match('/^\((.*)\)$/', $object->lines[$i]->desc, $reg)) { + if ($reg[1] == 'DEPOSIT') { + $is_deposit = true; + } + } + + // If DEPOSIT, this line is completely ignored for calculations. + if ($is_deposit) { + continue; + } + // determine category of operation if ($categoryOfOperation < 2) { $lineProductType = $object->lines[$i]->product_type; diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index ea7488c96a0..209ead0c0b6 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1,17 +1,17 @@ - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2008 Raphael Bertrand - * Copyright (C) 2010-2014 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2012 Cédric Salvador - * Copyright (C) 2012-2014 Raphaël Doursenaud - * Copyright (C) 2015 Marcos García - * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018-2025 Frédéric France +/* Copyright (C) 2004-2024 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand + * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012 Cédric Salvador + * Copyright (C) 2012-2014 Raphaël Doursenaud + * Copyright (C) 2015 Marcos García + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2018-2024 Anthony Berton - * Copyright (C) 2022-2024 Alexandre Spangaro - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2022-2025 Alexandre Spangaro + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Nick Fragoulis * Copyright (C) 2024 Franck Moreau * @@ -419,6 +419,19 @@ class pdf_sponge extends ModelePDFFactures $this->atleastonediscount++; } + // Do not take into account lines of the type “deposit.” + $is_deposit = false; + if (preg_match('/^\((.*)\)$/', $object->lines[$i]->desc, $reg)) { + if ($reg[1] == 'DEPOSIT') { + $is_deposit = true; + } + } + + // If DEPOSIT, this line is completely ignored for calculations. + if ($is_deposit) { + continue; + } + // determine category of operation if ($categoryOfOperation < 2) { $lineProductType = $object->lines[$i]->product_type;