diff --git a/htdocs/compta/facture.php3 b/htdocs/compta/facture.php3 index 6cf4a9ac926..e496b01b605 100644 --- a/htdocs/compta/facture.php3 +++ b/htdocs/compta/facture.php3 @@ -105,7 +105,7 @@ if ($action == 'payed') $result = $fac->set_payed($facid); } -if ($action == 'addligne') +if ($action == 'addligne' && $user->rights->facture->creer) { $fac = new Facture($db); $fac->fetch($facid); @@ -116,7 +116,7 @@ if ($action == 'addligne') $HTTP_POST_VARS["tva_tx"]); } -if ($action == 'updateligne') +if ($action == 'updateligne' && $user->rights->facture->creer) { $fac = new Facture($db,"",$facid); $fac->fetch($facid); @@ -126,7 +126,7 @@ if ($action == 'updateligne') $HTTP_POST_VARS["qty"]); } -if ($action == 'deleteline') +if ($action == 'deleteline' && $user->rights->facture->creer) { $fac = new Facture($db,"",$facid); $fac->fetch($facid); @@ -146,13 +146,13 @@ if ($action == 'add') $facture = new Facture($db, $socid); - $facture->number = $HTTP_POST_VARS["facnumber"]; - $facture->date = $datefacture; - $facture->note = $HTTP_POST_VARS["note"]; - $facture->projetid = $HTTP_POST_VARS["projetid"]; + $facture->number = $HTTP_POST_VARS["facnumber"]; + $facture->date = $datefacture; + $facture->note = $HTTP_POST_VARS["note"]; + $facture->projetid = $HTTP_POST_VARS["projetid"]; $facture->cond_reglement = $HTTP_POST_VARS["condid"]; - if (! $propalid) + if (!$HTTP_POST_VARS["propalid"]) { $facture->amount = $HTTP_POST_VARS["amount"]; $facture->remise = $HTTP_POST_VARS["remise"]; @@ -163,14 +163,14 @@ if ($action == 'add') { $facture->amount = $HTTP_POST_VARS["amount"]; $facture->remise = $remise; - $facture->propalid = $propalid; + $facture->propalid = $HTTP_POST_VARS["propalid"]; $facid = $facture->create($user->id); //TODO - if ($facid ) + if ($facid) { $prop = New Propal($db); - $prop->fetch($propalid); + $prop->fetch($HTTP_POST_VARS["propalid"]); for ($i = 0 ; $i < sizeof($prop->lignes) ; $i++) { @@ -285,7 +285,7 @@ if ($action == 'create') print_titre("Emettre une facture"); - if ($propalid) + 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 llx_societe as s, llx_propal as p, c_propalst as c"; @@ -302,131 +302,130 @@ if ($action == 'create') if ( $db->query($sql) ) { $num = $db->num_rows(); - if ($num) { - $obj = $db->fetch_object(0); + if ($num) + { + $obj = $db->fetch_object(0); - $numfa = facture_get_num(); // définit dans includes/modules/facture + $numfa = facture_get_num(); // définit dans includes/modules/facture - print "