From 46b5f80db9ba3c8f7582b87d460cec67538e16a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Oct 2022 13:30:51 +0200 Subject: [PATCH] Clean code --- htdocs/core/class/commonobject.class.php | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 85fc7569505..a198d74f808 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3757,25 +3757,7 @@ abstract class CommonObject $fieldlocaltax2 = 'localtax2'; $fieldttc = 'total_ttc'; // Specific code for backward compatibility with old field names - if ($this->element == 'facture' || $this->element == 'facturerec') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier' || $this->element == 'invoice_supplier_rec') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'propal') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'expensereport') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'supplier_proposal') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'commande') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'order_supplier') { + if (in_array($this->element, array('propal', 'commande', 'facture', 'facturerec', 'supplier_proposal', 'order_supplier', 'facture_fourn', 'invoice_supplier', 'invoice_supplier_rec', 'expensereport'))) { $fieldtva = 'total_tva'; }