diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php index 3cfdbc2a2ea..9d758c9cfbd 100644 --- a/htdocs/compta/paiement/fiche.php +++ b/htdocs/compta/paiement/fiche.php @@ -30,6 +30,7 @@ require("./pre.inc.php"); require("../../paiement.class.php"); +require("../../facture.class.php"); $user->getrights('facture'); @@ -98,17 +99,15 @@ $html = new Form($db); } +print '
'; print ''; print ''; @@ -121,7 +120,7 @@ print nl2br($paiement->note); * */ $allow_delete = 1 ; -$sql = "SELECT f.facnumber, f.total_ttc, pf.amount, f.rowid as facid, f.paye, s.nom, s.idp"; +$sql = "SELECT f.facnumber, f.total_ttc, pf.amount, f.rowid as facid, f.paye, f.fk_statut, s.nom, s.idp"; $sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf,".MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE pf.fk_facture = f.rowid AND f.fk_soc = s.idp"; $sql .= " AND pf.fk_paiement = ".$paiement->id; @@ -135,7 +134,7 @@ if ($db->query($sql)) print '
'; -print $langs->trans("Numero").' : '.$paiement->numero."
"; - -print $langs->trans("Date").' : '.strftime("%d %B %Y",$paiement->date)."
"; - +print $langs->trans("Date").' : '.dolibarr_print_date($paiement->date)."
"; print $langs->trans("Type").' : '.$paiement->type_libelle."
"; - +if ($paiement->numero) { print $langs->trans("Numero").' : '.$paiement->numero."
"; } print $langs->trans("Amount").' : '.$paiement->montant." ".$conf->monnaie."
"; print '
'; print ''; print ''; - print ''; + print ''; print "\n"; if ($num > 0) @@ -152,7 +151,9 @@ if ($db->query($sql)) print ' ' . $objp->facnumber; print "\n"; print ''; - print ''; + print ''; + $fac=new Facture($db); + print ''; print "\n"; if ($objp->paye == 1) { @@ -165,13 +166,16 @@ if ($db->query($sql)) $var=!$var; print ""; print ''; - print ''; + print ''; print ''; print "\n"; print "
'.$langs->trans("Bill").''.$langs->trans("Company").''.$langs->trans("AmountTTC").' '.$langs->trans("AmountTTC").''.$langs->trans("Status").'
' . $objp->nom.''.price($objp->amount).''.$objp->paye.''.price($objp->amount).''.$fac->LibStatut($objp->paye,$objp->fk_statut).'
 Total'.$langs->trans("Total").''.price($total).' 
\n"; $db->free(); } +else { + dolibarr_print_error($db); +} /* @@ -183,7 +187,7 @@ print '
'; if ($user->societe_id == 0 && $paiement->statut == 0 && $_GET["action"] == '') { - print ''.$langs->trans("Valider").''; + print ''.$langs->trans("Valid").''; }