From 243fca9a1a956eceacdf9569979f9ee6c9c4de10 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 27 Aug 2019 16:12:07 +0200 Subject: [PATCH 01/20] fix event list with description --- htdocs/comm/action/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index bd57005b7bf..2ef4c74f765 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -452,6 +452,7 @@ if ($resql) if (! empty($arrayfields['owner']['checked'])) print ''; if (! empty($arrayfields['c.libelle']['checked'])) print ''; if (! empty($arrayfields['a.label']['checked'])) print ''; + if (! empty($arrayfields['a.note']['checked'])) print ''; if (! empty($arrayfields['a.datep']['checked'])) { print ''; print $form->selectDate($datestart, 'datestart', 0, 0, 1, '', 1, 0); From 1c28086d4be79090366592539aa2ae8f5ccaa967 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 28 Aug 2019 13:22:54 +0200 Subject: [PATCH 02/20] FIX logout redirect to takepos.php usefull for terminal locked with POS and use standard dolibarr login with addon as U2F --- htdocs/takepos/takepos.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index b7061c0e135..287689c809c 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -47,6 +47,8 @@ if ($setterminal>0) $_SESSION["takeposterminal"]=$setterminal; } +$_SESSION["urlfrom"]='/takepos/takepos.php'; + $langs->loadLangs(array("bills","orders","commercial","cashdesk","receiptprinter")); $categorie = new Categorie($db); From 4cf2c835c6e2d974f3376576073c8f35c4959784 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 28 Aug 2019 19:48:45 +0200 Subject: [PATCH 03/20] Update logout.php --- htdocs/user/logout.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php index ae3fbfcbf8f..7c1a81b594c 100644 --- a/htdocs/user/logout.php +++ b/htdocs/user/logout.php @@ -80,6 +80,7 @@ if (session_status() === PHP_SESSION_ACTIVE) // Not sure this is required unset($_SESSION['dol_login']); unset($_SESSION['dol_entity']); +unset($_SESSION['urlfrom']); if (GETPOST('noredirect')) return; header("Location: ".$url); // Default behaviour is redirect to index.php page From 26e7fad0fff517fe4762f6230318950215bf7b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traulle=CC=81?= Date: Fri, 30 Aug 2019 23:42:34 +0200 Subject: [PATCH 04/20] Adding SticklerCI to 10.0 branch --- .stickler.yml | 10 ++++++++++ .travis.yml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .stickler.yml diff --git a/.stickler.yml b/.stickler.yml new file mode 100644 index 00000000000..d7594b39c4f --- /dev/null +++ b/.stickler.yml @@ -0,0 +1,10 @@ +--- +linters: + phpcs: + standard: 'dev/setup/codesniffer/ruleset.xml' + extensions: 'php' + tab_width: 4 + fixer: true + +fixers: + enable: true \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 63e48a051f0..5bbfaabbdd2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -304,7 +304,7 @@ script: set -e # Exclusions are defined in the ruleset.xml file #phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 . - phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true . + if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi set +e echo From 8ba5387864bf9fb6ff335beb197b1743cdb7d170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traulle=CC=81?= Date: Fri, 30 Aug 2019 23:45:33 +0200 Subject: [PATCH 05/20] Replace tabs by spaces --- .stickler.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.stickler.yml b/.stickler.yml index d7594b39c4f..b68804448b2 100644 --- a/.stickler.yml +++ b/.stickler.yml @@ -1,10 +1,10 @@ --- linters: - phpcs: - standard: 'dev/setup/codesniffer/ruleset.xml' - extensions: 'php' - tab_width: 4 - fixer: true + phpcs: + standard: 'dev/setup/codesniffer/ruleset.xml' + extensions: 'php' + tab_width: 4 + fixer: true fixers: - enable: true \ No newline at end of file + enable: true From 8f1fba6775bdf421a7c37f5c5c69ce9eaae459ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traulle=CC=81?= Date: Fri, 30 Aug 2019 23:56:52 +0200 Subject: [PATCH 06/20] Fix #11682 Missing origin object ref and thirdparty ref in future bank entries --- htdocs/compta/bank/treso.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 5a4374f47dd..10b366f0b9c 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -267,9 +267,9 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $parameters = array('obj' => $obj); $reshook = $hookmanager->executeHooks('moreFamily', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if(empty($reshook)){ - $ref = isset($hookmanager->resArray['ref']) ? $hookmanager->resArray['ref'] : ''; - $refcomp = isset($hookmanager->resArray['refcomp']) ? $hookmanager->resArray['refcomp'] : ''; - $paiement = isset($hookmanager->resArray['paiement']) ? $hookmanager->resArray['paiement'] : 0; + $ref = isset($hookmanager->resArray['ref']) ? $hookmanager->resArray['ref'] : $ref; + $refcomp = isset($hookmanager->resArray['refcomp']) ? $hookmanager->resArray['refcomp'] : $refcomp; + $paiement = isset($hookmanager->resArray['paiement']) ? $hookmanager->resArray['paiement'] : $paiement; } $total_ttc = $obj->total_ttc; From 237c29d4283eb9bcbe0417a9f89527b6b96ffd00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traulle=CC=81?= Date: Sat, 31 Aug 2019 00:07:14 +0200 Subject: [PATCH 07/20] FIX #11427 require product class Fixes POST /supplierinvoices REST API endpoint --- htdocs/fourn/class/fournisseur.facture.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index f8e9dbcdbd1..86fe84f5c4a 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -36,6 +36,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php'; require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; /** * Class to manage suppliers invoices From c84f1baf175ad13c0e33600fe07a3c02385a6a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traulle=CC=81?= Date: Sat, 31 Aug 2019 00:18:53 +0200 Subject: [PATCH 08/20] Fix #11683 Correct links to create a new product or service from search results --- htdocs/product/list.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 7677e82e1b4..43188c5fe7c 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -450,6 +450,10 @@ if ($resql) if($type == Product::TYPE_SERVICE) $rightskey='service'; if($user->rights->{$rightskey}->creer) { + if ($type === "") { + $newcardbutton.= dolGetButtonTitle($langs->trans('NewProduct'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=0'); + $type = Product::TYPE_SERVICE; + } $label='NewProduct'; if($type == Product::TYPE_SERVICE) $label='NewService'; $newcardbutton.= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type='.$type); From 7dc36846620efcb3fb8066faa5e2e05e4c0a27ba Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 2 Sep 2019 09:41:30 +0200 Subject: [PATCH 09/20] fix bad substitution for extrafields type checkbox --- htdocs/core/class/commondocgenerator.class.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index fadd0c02fde..c296411e35d 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -766,10 +766,20 @@ abstract class CommonDocGenerator //Add value to store price with currency $array_to_fill=array_merge($array_to_fill, array($array_key.'_options_'.$key.'_currency' => $object->array_options['options_'.$key.'_currency'])); } - elseif($extrafields->attribute_type[$key] == 'select' || $extrafields->attribute_type[$key] == 'checkbox') + elseif($extrafields->attribute_type[$key] == 'select') { $object->array_options['options_'.$key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_'.$key]]; } + elseif($extrafields->attribute_type[$key] == 'checkbox') { + $valArray=explode(',', $object->array_options['options_'.$key]); + $output=array(); + foreach($extrafields->attribute_param[$key]['options'] as $keyopt=>$valopt) { + if (in_array($keyopt, $valArray)) { + $output[]=$valopt; + } + } + $object->array_options['options_'.$key] = implode(', ', $output); + } elseif($extrafields->attribute_type[$key] == 'date') { if (strlen($object->array_options['options_'.$key])>0) From c8bfc7441e34cf2ae7ab0cbf2f70a2c99baaa75b Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 2 Sep 2019 09:44:59 +0200 Subject: [PATCH 10/20] fix avoid error message Divided By 0 --- htdocs/core/class/commondocgenerator.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index fadd0c02fde..c9865cffe59 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -497,8 +497,16 @@ abstract class CommonDocGenerator $resarray['object_total_up'] = $totalUp; $resarray['object_total_up_locale'] = price($resarray['object_total_up'], 0, $outputlangs); if (method_exists($object, 'getTotalDiscount')) { - $resarray['object_total_discount'] = round(100 / $totalUp * $object->getTotalDiscount(), 2); + $totalDiscount=$object->getTotalDiscount(); + } else { + $totalDiscount=0; + } + if (!empty($totalUp) && !empty($totalDiscount)) { + $resarray['object_total_discount'] = round(100 / $totalUp * $totalDiscount, 2); $resarray['object_total_discount_locale'] = price($resarray['object_total_discount'], 0, $outputlangs); + } else { + $resarray['object_total_discount']=''; + $resarray['object_total_discount_locale']=''; } } From b45d3ea1a0f8f4033e9c02bca784695c8d3aeef3 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 2 Sep 2019 17:38:59 +0200 Subject: [PATCH 11/20] FIX #11804 --- htdocs/ticket/list.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 2a4195cb07b..26b9756006c 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -2,6 +2,7 @@ /* Copyright (C) 2013-2018 Jean-François FERRY * Copyright (C) 2016 Christophe Battarel * Copyright (C) 2018 Regis Houssin + * Copyright (C) 2019 Juanjo Menent * * 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 @@ -210,6 +211,11 @@ $sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)"; $sql.= " WHERE t.entity IN (".getEntity($object->element).")"; +if ($socid > 0) +{ + $sql.= " AND t.fk_soc = ".$socid; +} + foreach($search as $key => $val) { if ($key == 'fk_statut') From f9df175efc0cc5e82c27de3e98507b1eda95de75 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 2 Sep 2019 21:26:44 +0200 Subject: [PATCH 12/20] FIX takepos layout clear or focus search fix focus for compatibility with barcode scanner --- htdocs/takepos/takepos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index b7061c0e135..70add232ed6 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -149,7 +149,7 @@ if(localStorage.hasKeyboard) { function ClearSearch() { console.log("ClearSearch"); $("#search").val(''); - browser->layer == 'classic') { ?> + browser->layout == 'classic') { ?> setFocusOnSearchField(); } From 0c5859d2bfffdf47219729ee138718a646edd334 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 3 Sep 2019 11:37:25 +0200 Subject: [PATCH 13/20] Update takepos.php --- htdocs/takepos/takepos.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index 70add232ed6..bfe15aadd32 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -349,6 +349,7 @@ function deleteline() { $("#poslines").load("invoice.php?action=deleteline&place="+place+"&idline="+selectedline, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); + ClearSearch(); } function Customer() { From 6996e83390a34384a5e19a2ed033a39a2fa21113 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 3 Sep 2019 11:40:19 +0200 Subject: [PATCH 14/20] Update takepos.php --- htdocs/takepos/takepos.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index bfe15aadd32..fccaa222fcd 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -399,6 +399,7 @@ function New() { $("#poslines").load("invoice.php?action=delete&place="+place, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); + ClearSearch(); } } From 80624c67f4a7085be83103144c8202dc587b4ae1 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 3 Sep 2019 14:48:46 +0200 Subject: [PATCH 15/20] Fix lang in invoice / takepos --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 1729e22427c..6ae5429d062 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; -$langs->loadLangs(array("companies","commercial","bills", "cashdesk")); +$langs->loadLangs(array("companies", "commercial", "bills", "cashdesk", "stocks")); $id = GETPOST('id', 'int'); $action = GETPOST('action', 'alpha'); From a95e02e3f6caacac8766fdf1b9efbf39bfee8255 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 14:52:03 +0200 Subject: [PATCH 16/20] FIX #11789 FIX #11790 --- htdocs/comm/propal/card.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 7331d7a86e9..5b37242c8ac 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2535,10 +2535,13 @@ $formquestion = array_merge($formquestion, array( print ''; } - $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); - if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED)) + if ($usercanclose) { - print ''; + $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); + if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED)) + { + print ''; + } } } From 17ccb8fa101988c443be52aa28b35967f213c451 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 14:56:13 +0200 Subject: [PATCH 17/20] Fix missing tooltip --- htdocs/comm/propal/card.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 5b37242c8ac..9bf00cb6a9c 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2500,7 +2500,7 @@ $formquestion = array_merge($formquestion, array( if ($usercansend) { print ''; } else - print ''; + print ''; } // Create an order @@ -2543,6 +2543,10 @@ $formquestion = array_merge($formquestion, array( print ''; } } + else + { + print ''; + } } // Set accepted/refused From 52a543953c1bf22f2a4c47af8a5ead06c79fca57 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 14:58:54 +0200 Subject: [PATCH 18/20] Fix position of tests --- htdocs/comm/propal/card.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 9bf00cb6a9c..180f95e2d4e 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2535,17 +2535,17 @@ $formquestion = array_merge($formquestion, array( print ''; } - if ($usercanclose) + $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); + if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED)) { - $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); - if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED)) + if ($usercanclose) { print ''; } - } - else - { - print ''; + else + { + print ''; + } } } From 65fee73b225ca47daa3667369171fff61403790d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 17:31:20 +0200 Subject: [PATCH 19/20] Update treso.php --- htdocs/compta/bank/treso.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 10b366f0b9c..8ce3370587f 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -264,12 +264,12 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $paiement = -1*$socialcontribstatic->getSommePaiement(); // Payment already done } - $parameters = array('obj' => $obj); + $parameters = array('obj' => $obj, 'ref' => $ref, 'refcomp' => $refcomp, 'payment' => $paiement); $reshook = $hookmanager->executeHooks('moreFamily', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if(empty($reshook)){ $ref = isset($hookmanager->resArray['ref']) ? $hookmanager->resArray['ref'] : $ref; $refcomp = isset($hookmanager->resArray['refcomp']) ? $hookmanager->resArray['refcomp'] : $refcomp; - $paiement = isset($hookmanager->resArray['paiement']) ? $hookmanager->resArray['paiement'] : $paiement; + $paiement = isset($hookmanager->resArray['payment']) ? $hookmanager->resArray['payment'] : $paiement; } $total_ttc = $obj->total_ttc; From 7c07e64adcf1b121d410644eda4471c3c87c1224 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Sep 2019 17:32:18 +0200 Subject: [PATCH 20/20] Update treso.php --- htdocs/compta/bank/treso.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 8ce3370587f..5b39e8fd79b 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -269,7 +269,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) if(empty($reshook)){ $ref = isset($hookmanager->resArray['ref']) ? $hookmanager->resArray['ref'] : $ref; $refcomp = isset($hookmanager->resArray['refcomp']) ? $hookmanager->resArray['refcomp'] : $refcomp; - $paiement = isset($hookmanager->resArray['payment']) ? $hookmanager->resArray['payment'] : $paiement; + $paiement = isset($hookmanager->resArray['paiement']) ? $hookmanager->resArray['paiement'] : $paiement; } $total_ttc = $obj->total_ttc;