diff --git a/htdocs/compta/facture.php3 b/htdocs/compta/facture.php3 index bd59056b70b..44cb8a18044 100644 --- a/htdocs/compta/facture.php3 +++ b/htdocs/compta/facture.php3 @@ -99,25 +99,7 @@ if ($action == 'add') $facture->remise = $remise; $facture->propalid = $propalid; - if ($facture->create($user->id) ) - { - - /* - * - * Génération du PDF - * - */ - - // print "
Génération du PDF

"; - - // $command = "export DBI_DSN=\"".$GLOBALS["DBI"]."\" "; - // $command .= " ; ../../scripts/facture-tex.pl --facture=$facid --pdf --ps" ; - - // $output = system($command); - // print "

command : $command
"; - - } - else + if (! $facture->create($user->id) ) { print "

Erreur : la facture n'a pas été créée, vérifier le numéro !"; print "

Retour à la propal"; @@ -197,17 +179,16 @@ if ($action == 'create') if ($propalid) { - $sql = "SELECT s.nom, s.prefix_comm, s.idp, p.price, p.remise, p.tva, p.total, p.ref, ".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst"; $sql .= " FROM societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id"; $sql .= " AND p.rowid = $propalid"; - } else { - + } + else + { $sql = "SELECT s.nom, s.prefix_comm, s.idp "; $sql .= "FROM societe as s "; - $sql .= "WHERE s.idp = $socidp"; - + $sql .= "WHERE s.idp = $socidp"; } if ( $db->query($sql) ) @@ -216,7 +197,7 @@ if ($action == 'create') if ($num) { $obj = $db->fetch_object(0); - $numfa = "F-" . $obj->prefix_comm . "-" . strftime("%y%m%d", time()); + $numfa = facture_get_num(); // définit dans includes/modules/facture print "

"; print ""; @@ -224,7 +205,7 @@ if ($action == 'create') print ''; - print ""; + print ""; print ''; @@ -263,15 +244,10 @@ if ($action == 'create') print ""; print ""; - - - print '
Société :$obj->nom
Client :$obj->nom'; print '
Numéro :
Désignation