From 4b3643d964d03db7d6c44ae010e02a4d5ec2b5f8 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 20 Jul 2005 10:05:36 +0000 Subject: [PATCH] Ajout gestion de la date d'echeance --- htdocs/fourn/facture/fiche.php | 56 ++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 86e0423764f..3fa8216d26a 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -23,10 +23,10 @@ */ /** - \file htdocs/fourn/facture/fiche.php - \ingroup facture - \brief Page des la fiche facture fournisseur - \version $Revision$ + \file htdocs/fourn/facture/fiche.php + \ingroup facture + \brief Page des la fiche facture fournisseur + \version $Revision$ */ require("./pre.inc.php"); @@ -94,12 +94,14 @@ if ($_POST["action"] == 'modif_libelle') if ($_POST["action"] == 'update') { $datefacture = $db->idate(mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"])); + $date_echeance = $db->idate(mktime(12,0,0,$_POST["echmonth"],$_POST["echday"],$_POST["echyear"])); $sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn set "; $sql .= " facnumber='".trim($_POST["facnumber"])."'"; $sql .= ", libelle='".trim($_POST["libelle"])."'"; $sql .= ", note='".$_POST["note"]."'"; $sql .= ", datef = '$datefacture'"; + $sql .= ", date_lim_reglement = '$date_echeance'"; $sql .= " WHERE rowid = ".$_GET['facid']." ;"; $result = $db->query( $sql); } @@ -111,9 +113,10 @@ if ($_POST["action"] == 'add' && $user->rights->fournisseur->facture->creer) if ($_POST["facnumber"]) { $datefacture = mktime(12,0,0, - $_POST["remonth"], - $_POST["reday"], - $_POST["reyear"]); + $_POST["remonth"], + $_POST["reday"], + $_POST["reyear"]); + $tva = 0; $tva = ($_POST["tva_taux"] * $_POST["amount"]) / 100 ; $remise = 0; @@ -124,11 +127,12 @@ if ($_POST["action"] == 'add' && $user->rights->fournisseur->facture->creer) // Creation facture $facfou = new FactureFournisseur($db); - $facfou->number = $_POST["facnumber"]; - $facfou->socid = $_POST["socidp"]; - $facfou->libelle = $_POST["libelle"]; - $facfou->date = $datefacture; - $facfou->note = $_POST["note"]; + $facfou->number = $_POST["facnumber"]; + $facfou->socid = $_POST["socidp"]; + $facfou->libelle = $_POST["libelle"]; + $facfou->date = $datefacture; + $facfou->date_echeance = mktime(12,0,0,$_POST["echmonth"],$_POST["echday"],$_POST["echyear"]); + $facfou->note = $_POST["note"]; $facid = $facfou->create($user); @@ -286,7 +290,10 @@ if ($_GET["action"] == 'create' or $_GET["action"] == 'copy') $html->select_date(); print ''; - print ''.$langs->trans("Author").''.$user->fullname.''; + print ''.$langs->trans("DateEcheance").''; + $html->select_date('','ech'); + print ''; + print "
"; print ''; @@ -373,16 +380,17 @@ else print ''; - print ''; - print ''; - - print ''; - print ''; + print ''; + print ''; print '"; + print '"; + $authorfullname=" "; if ($fac->author) { @@ -521,8 +529,8 @@ else * Paiements */ - print '
'.$langs->trans("Label").''; print '
'.$langs->trans("AmountHT").''.price($fac->total_ht).'
'.$langs->trans("AmountTTC").''.price($fac->total_ttc).'
'.$langs->trans("AmountHT").' / '.$langs->trans("AmountTTC").''.price($fac->total_ht).' / '.price($fac->total_ttc).'
'.$langs->trans("Date").''; $html->select_date($fac->datep); print "
'.$langs->trans("Date").''; + $html->select_date($fac->date_echeance,'ech'); + print "
'; - print '
'; + print ''; + print '
'; $sql = "SELECT ".$db->pdate("datep")." as dp, p.amount, c.libelle as paiement_type, p.num_paiement, p.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn as p, ".MAIN_DB_PREFIX."c_paiement as c "; @@ -534,12 +542,14 @@ else $num = $db->num_rows($result); $i = 0; $total = 0; - print ''; - print ''; + print '
'.$langs->trans("Payments").' :
'; + print ''; + print '\n"; print ""; print ''; print ''; - + if ($fac->statut == 1 && $fac->paye == 0 && $user->societe_id == 0) { $tdsup=' colspan="2"';
'.$langs->trans("Payments").' :'.$langs->trans("DateEcheance")." : "; + print dolibarr_print_date($fac->date_echeance,"%A %e %B %Y")."
'.$langs->trans("Date").''.$langs->trans("Type").'