diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 6c2fb9683ad..fda41a24b18 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -44,25 +44,24 @@ if ($action == 'payed') $result = $db->query( $sql); } +if ($HTTP_POST_VARS["action"] == 'modif_libelle') +{ + $sql = "UPDATE llx_facture_fourn set libelle = '$form_libelle' WHERE rowid = $facid ;"; + $result = $db->query( $sql); +} + + if ($action == 'update') { - - $tva = ($HTTP_POST_VARS["tauxtva"] * $HTTP_POST_VARS["amount"]) / 100 ; - $remise = 0; - $total = $tva + $amount ; - $datefacture = $db->idate(mktime(12, 0 , 0, $HTTP_POST_VARS["remonth"], $HTTP_POST_VARS["reday"], $HTTP_POST_VARS["reyear"])); $sql = "UPDATE llx_facture_fourn set "; - $sql .= " libelle='".$HTTP_POST_VARS["libelle"]."'"; + $sql .= " facnumber='".trim($HTTP_POST_VARS["facnumber"])."'"; + $sql .= ", libelle='".trim($HTTP_POST_VARS["libelle"])."'"; $sql .= ", note='".$HTTP_POST_VARS["note"]."'"; $sql .= ", datef = '$datefacture'"; - $sql .= ", amount=".$HTTP_POST_VARS["amount"]; - $sql .= ", total = $total"; - $sql .= ", tva = $tva"; $sql .= " WHERE rowid = $facid ;"; $result = $db->query( $sql); - } if ($action == 'add') @@ -137,10 +136,15 @@ llxHeader(); * */ -if ($action == 'create') +if ($action == 'create' or $action == 'copy') { + if ($action == 'copy') + { + $fac_ori = new FactureFourn($db); + $fac_ori->fetch($facid); + } print_titre("Saisir une facture"); - + print '