diff --git a/doc/user/dolibarr-user.pdf b/doc/user/dolibarr-user.pdf index cd0ff511e8c..0205c17a974 100644 Binary files a/doc/user/dolibarr-user.pdf and b/doc/user/dolibarr-user.pdf differ diff --git a/doc/user/dolibarr-user.txt b/doc/user/dolibarr-user.txt index 0400775b5b4..025796b251b 100644 --- a/doc/user/dolibarr-user.txt +++ b/doc/user/dolibarr-user.txt @@ -23,6 +23,7 @@ Table des mati 2. Facturation 2.1. Facture 2.2. Paiements + 2.3. Factures récurrentes 3. Produits 3.1. Aspect général @@ -149,6 +150,24 @@ Table des mati supprimer le paiement puis en créer un nouveau. +2.3. Factures récurrentes +------------------------- + + Cette fonctionnalité est apparue dans la version 1.1.0 + +2.3.1. Créer une facture récurrente +----------------------------------- + + La création d'une facture récurrente s'effectue depuis une facture + validée qui sert de modèle. + + Dans le formulaire de création si le _N.P._ contient une valeur cela + signifie que le prix du produit a changé depuis la création de la + facture qui sert de modèle. Il faut alors indiquer si on souhaite + garder le prix de référence on si on crée la facture récurrente avec + le nouveau prix du produit. + + ------------------------------------------------------------------------------- diff --git a/htdocs/charge.class.php b/htdocs/charge.class.php deleted file mode 100644 index c38b10bd95c..00000000000 --- a/htdocs/charge.class.php +++ /dev/null @@ -1,176 +0,0 @@ - - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - * - */ - -class Charge { - var $db; - - var $id; - var $libelle; - var $price; - var $tms; - var $debut; - var $fin; - - var $debut_epoch; - var $fin_epoch; - - Function Service($DB, $id=0) { - $this->db = $DB; - $this->id = $id; - - return 1; - } - /* - * - * - * - */ - Function create($user) { - - $sql = "INSERT INTO llx_charges (datec, fk_user_author) VALUES (now(), ".$user->id.")"; - - if ($this->db->query($sql) ) { - $id = $this->db->last_insert_id(); - - if ( $this->update($id, $user) ) { - return $id; - } - } else { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - * - */ - Function update($id, $user) { - - $sql = "UPDATE llx_service "; - $sql .= " SET label = '" . trim($this->libelle) ."'"; - $sql .= ",ref = '" . trim($this->ref) ."'"; - $sql .= ",price = " . $this->price ; - $sql .= ",description = '" . trim($this->description) ."'"; - $sql .= ",fk_user_modif = " . $user->id ; - - $sql .= " WHERE rowid = " . $id; - - if ( $this->db->query($sql) ) { - return 1; - } else { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - * - */ - Function start_comm($id, $user, $datedeb=0) { - - $sql = "UPDATE llx_service "; - if ($datedeb) { - $sql .= " SET debut_comm = '$datedeb'"; - } else { - $sql .= " SET debut_comm = now()"; - } - $sql .= ",fk_user_modif = " . $user->id ; - - $sql .= " WHERE rowid = " . $id; - - if ( $this->db->query($sql) ) { - return 1; - } else { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - * - */ - Function stop_comm($id, $user, $datefin=0) { - - $sql = "UPDATE llx_service "; - if ($datefin) { - $sql .= " SET fin_comm = '$datefin'"; - } else { - $sql .= " SET fin_comm = now()"; - } - $sql .= ",fk_user_modif = " . $user->id ; - - $sql .= " WHERE rowid = " . $id; - - if ( $this->db->query($sql) ) { - return 1; - } else { - print $this->db->error() . ' in ' . $sql; - } - } - /* - * - * - * - */ - Function fetch($id) { - - $sql = "SELECT s.ref,s.label,s.price,s.tms,s.debut_comm,s.fin_comm,s.description,"; - $sql .= $this->db->pdate("s.debut_comm") . ' as debut_epoch,'; - $sql .= $this->db->pdate("s.fin_comm") . ' as fin_epoch'; - $sql .= " FROM llx_service as s"; - $sql .= " WHERE s.rowid = $id"; - - $result = $this->db->query($sql); - - if ($result) { - if ($this->db->num_rows()) { - $obj = $this->db->fetch_object($result , 0); - - $this->id = $obj->rowid; - $this->ref = $obj->ref; - $this->libelle = $obj->label; - $this->price = $obj->price; - $this->description = $obj->description; - - $this->tms = $obj->tms; - - $this->debut = $obj->debut_comm; - $this->fin = $obj->fin_comm; - - $this->debut_epoch = $obj->debut_epoch; - $this->fin_epoch = $obj->fin_epoch; - - } - $this->db->free(); - - } else { - print $this->db->error(); - } - } - - -} -/* - * $Id$ - * $Source$ - */ -?> diff --git a/htdocs/service/fiche.php b/htdocs/service/fiche.php deleted file mode 100644 index 60fb4bab1a9..00000000000 --- a/htdocs/service/fiche.php +++ /dev/null @@ -1,216 +0,0 @@ - - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - * - */ - -require("./pre.inc.php"); -require("../service.class.php"); - -llxHeader(); - -if ($action == 'add') { - $service = new Service($db); - - $service->ref = $ref; - $service->libelle = $label; - $service->price = $price; - $service->description = $desc; - - $id = $service->create($user); - - if ($comm_now && $id) { - $service->start_comm($id, $user); - } - -} - -if ($action == 'set_datedeb') { - $service = new Service($db); - $service->start_comm($id, $user->id, $datedeb); -} -if ($action == 'set_datefin') { - $service = new Service($db); - $service->stop_comm($id, $user->id, $datefin); -} - -if ($action == 'update') { - $service = new Service($db); - - $service->ref = $ref; - $service->libelle = $label; - $service->price = $price; - $service->description = $desc; - - $service->update($id, $user); -} - - -if ($action == 'create') { - - print_titre("Nouveau service"); - print '
Affectation de la date de fin de commercialisation
'; - print '