/** * \brief Classe la commande comme facturee * \return int <0 si ko, >0 si ok */ function classer_facturee() { global $conf; $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'commande SET facture = 1'; $sql .= ' WHERE rowid = ' . $this->id . ' AND fk_statut > 0 ;'; if ($this->db->query($sql)) { if ($conf->global->PROPALE_CLASSIFIED_INVOICED_WITH_ORDER == 1 && $this->propale_id) { $propal = new Propal($this->db); $propal->fetch($this->propale_id); $propal->classer_facturee(); } return 1; } else { dol_print_error($this->db); return -1; } }