From 52df4b1112317859d8b453260830056adc021629 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 12 Aug 2003 23:05:01 +0000 Subject: [PATCH] =?UTF-8?q?Gestion=20de=20lignes=20de=20facture=20lors=20d?= =?UTF-8?q?e=20la=20cr=E9ation=20d'une=20facture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/facture.php3 | 48 +++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/htdocs/compta/facture.php3 b/htdocs/compta/facture.php3 index b166350dd39..45382056b97 100644 --- a/htdocs/compta/facture.php3 +++ b/htdocs/compta/facture.php3 @@ -140,7 +140,7 @@ if ($action == 'delete' && $user->rights->facture->supprimer) $facid = 0 ; } -if ($action == 'add') +if ($HTTP_POST_VARS["action"] == 'add') { $datefacture = mktime(12, 0 , 0, $remonth, $reday, $reyear); @@ -157,7 +157,12 @@ if ($action == 'add') $facture->amount = $HTTP_POST_VARS["amount"]; $facture->remise = $HTTP_POST_VARS["remise"]; - $facid = $facture->create($user->id, $statut, $note); + $facture->add_product($HTTP_POST_VARS["idprod1"],$HTTP_POST_VARS["qty1"]); + $facture->add_product($HTTP_POST_VARS["idprod2"],$HTTP_POST_VARS["qty2"]); + $facture->add_product($HTTP_POST_VARS["idprod3"],$HTTP_POST_VARS["qty3"]); + $facture->add_product($HTTP_POST_VARS["idprod4"],$HTTP_POST_VARS["qty4"]); + + $facid = $facture->create($user); } else { @@ -165,7 +170,7 @@ if ($action == 'add') $facture->remise = $remise; $facture->propalid = $HTTP_POST_VARS["propalid"]; - $facid = $facture->create($user->id); + $facid = $facture->create($user); //TODO if ($facid) { @@ -282,7 +287,6 @@ $html = new Form($db); */ if ($action == 'create') { - print_titre("Emettre une facture"); if ($propalid) @@ -320,7 +324,7 @@ if ($action == 'create') print ""; print "Auteur :".$user->fullname.""; - print ''; + print ''; print ''; print "Date :"; @@ -368,15 +372,11 @@ if ($action == 'create') print 'Montant HT'.price($amount).''; print 'TVA'.price($obj->tva).""; print 'Total TTC'.price($obj->total).""; - } - - - print ''; - print "\n"; - print "\n"; - - if (!$propalid) + } + else { + print 'Services/Produits'; + print ''; /* * * Liste des elements @@ -404,22 +404,26 @@ if ($action == 'create') { print $db->error(); } - - print_titre("Services/Produits"); - - print ''; + + print '
'; for ($i = 1 ; $i < 5 ; $i++) { print ''; print ''; } - - print "\n"; - - print "
Remise :
"; - + + print ''; + print ''; } + + + + + print ''; + print "\n"; + print "\n"; + } } else