diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 89ca2513ab2..46636f93812 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -212,7 +212,6 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { print ''; print "\n"; } - } addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal"); @@ -303,7 +302,6 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa print ''; print "\n"; } - } addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal"); @@ -395,7 +393,6 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { print ''; print "\n"; } - } addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal"); @@ -487,7 +484,6 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU print ''; print "\n"; } - } addSummaryTableLine(3, $num, $nbofloop, $total, "NoProposal"); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 1d2f12132e5..a4177a72f86 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -610,7 +610,7 @@ if (empty($reshook)) $result = $object->set_remise($user, price2num(GETPOST('remise_percent'), 2)); } elseif ($action == 'setremiseabsolue' && $usercancreate) { $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU')); - } elseif ($action == 'addline' && GETPOST('submitforalllines', 'aZ09') && GETPOST('vatforalllines', 'alpha')) { + } elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('vatforalllines', 'alpha')) { // Define vat_rate $vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0); $vat_rate = str_replace('*', '', $vat_rate); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index bbd189239c9..3d359ca6563 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1821,6 +1821,8 @@ class Commande extends CommonOrder $this->project = null; // Clear if another value was already set by fetch_projet $this->statut = $obj->fk_statut; + $this->status = $obj->fk_statut; + $this->user_author_id = $obj->fk_user_author; $this->user_valid = $obj->fk_user_valid; $this->total_ht = $obj->total_ht; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index f036145161d..1ce1ea84f93 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1594,6 +1594,8 @@ class Facture extends CommonInvoice $this->project = null; // Clear if another value was already set by fetch_projet $this->statut = $obj->fk_statut; + $this->status = $obj->fk_statut; + $this->date_lim_reglement = $this->db->jdate($obj->dlr); $this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_code = $obj->mode_reglement_code; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 684f5d65948..159898f7256 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -222,6 +222,12 @@ abstract class CommonObject */ public $statut; + /** + * @var int The object's status + * @see setStatut() + */ + public $status; + /** * @var string * @see getFullAddress() diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php index bfced08e5c8..8a7c38f8ada 100644 --- a/htdocs/core/tpl/objectline_title.tpl.php +++ b/htdocs/core/tpl/objectline_title.tpl.php @@ -65,6 +65,7 @@ if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || !empty($conf->global->FA } else { print $langs->trans('VAT'); } + if (in_array($object->element, array('propal', 'commande', 'facture')) && $object->status == $object::STATUS_DRAFT) { global $mysoc; diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php index a3386c7aef5..4051deb125b 100644 --- a/test/phpunit/ExportTest.php +++ b/test/phpunit/ExportTest.php @@ -279,15 +279,14 @@ class ExportTest extends PHPUnit\Framework\TestCase $expectedresult=1; $this->assertEquals($expectedresult, $result, 'Error in TSV export'); - $model='excel2007new'; + $model='excel2007'; // Build export file /* ko on php 7.4 on travis (zip not available) */ print "Process build_file for model = ".$model."\n"; $result=$objexport->build_file($user, $model, $datatoexport, $array_selected, array(), $sql); $expectedresult=1; - $this->assertEquals($expectedresult, $result, 'Error in Excel2007new export'); - + $this->assertEquals($expectedresult, $result, 'Error in Excel2007 export'); return true; }