diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php index dbd1ea469da..3f9eb8166ac 100644 --- a/htdocs/admin/propale.php +++ b/htdocs/admin/propale.php @@ -52,6 +52,19 @@ if ($_POST["action"] == 'nbprod') exit; } +if ($_POST["action"] == 'activate_classifiedinvoiced') +{ + dolibarr_set_const($db, "PROPALE_CLASSIFIED_INVOICED_WITH_ORDER", $_POST["value"]); + Header("Location: propale.php"); + exit; +} +else if ($_POST["action"] == 'disable_classifiedinvoiced') +{ + dolibarr_del_const($db, "PROPALE_CLASSIFIED_INVOICED_WITH_ORDER"); + Header("Location: propale.php"); + exit; +} + if ($_GET["action"] == 'set') { $type='propal'; @@ -344,6 +357,45 @@ print ''; print '
'; +/* + * Classé facturée une propale en même temps que la commande + * + */ + +if ($conf->commande->enabled) +{ + print_titre($langs->trans("ClassifiedInvoiced")); + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + print ""; + print ""; + print ""; + print ''; + print ''; + print ""; + print ''; + print '
'.$langs->trans("Name").' '.$langs->trans("Active").'
'.$langs->trans("ClassifiedInvoicedWithOrder").''; + if($conf->global->PROPALE_CLASSIFIED_INVOICED_WITH_ORDER == 1) + { + print img_tick(); + } + print '"; + if($conf->global->PROPALE_CLASSIFIED_INVOICED_WITH_ORDER == 0) + { + print ''.$langs->trans("Activate").''; + } + else if($conf->global->PROPALE_CLASSIFIED_INVOICED_WITH_ORDER == 1) + { + print ''.$langs->trans("Disable").''; + } + print "
'; + print ''; +} + $db->close(); llxFooter('$Date$ - $Revision$'); diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 91cb4e1b560..0895805e1ff 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -1554,7 +1554,7 @@ class Commande $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > 0 ;'; if ($this->db->query($sql) ) { - if ($this->propale_id) + if (($conf->global->PROPALE_CLASSIFIED_INVOICED_WITH_ORDER == 1) && $this->propale_id) { $propal = new Propal($this->db); $propal->fetch($this->propale_id);