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 '| '.$langs->trans("Label").' | ';
print ' |
';
- print '| '.$langs->trans("AmountHT").' | ';
- print ''.price($fac->total_ht).' |
';
-
- print '| '.$langs->trans("AmountTTC").' | ';
- print ''.price($fac->total_ttc).' |
';
+ print '| '.$langs->trans("AmountHT").' / '.$langs->trans("AmountTTC").' | ';
+ print ''.price($fac->total_ht).' / '.price($fac->total_ttc).' |
';
print '| '.$langs->trans("Date").' | ';
$html->select_date($fac->datep);
print " |
";
+ print '| '.$langs->trans("Date").' | ';
+ $html->select_date($fac->date_echeance,'ech');
+ print " |
";
+
$authorfullname=" ";
if ($fac->author)
{
@@ -521,8 +529,8 @@ else
* Paiements
*/
- 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 '| '.$langs->trans("Payments").' : | ';
+ print '';
+ print '| '.$langs->trans("Payments").' : | ';
+ print ''.$langs->trans("DateEcheance")." : ";
+ print dolibarr_print_date($fac->date_echeance,"%A %e %B %Y")." | \n";
print "";
print '| '.$langs->trans("Date").' | ';
print ''.$langs->trans("Type").' | ';
-
+
if ($fac->statut == 1 && $fac->paye == 0 && $user->societe_id == 0)
{
$tdsup=' colspan="2"';
| |