diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php index 8db71973c55..2ffc21ea93b 100644 --- a/htdocs/compta/bank/rappro.php +++ b/htdocs/compta/bank/rappro.php @@ -262,7 +262,7 @@ if ($resql) print ""; if ($options) { - print "
$options"; print ""; } print ""; diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 01c3219356c..62c7876a358 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -257,9 +257,10 @@ if ( $societe->fetch($socid) ) $max=5; $sql = "SELECT p.rowid,p.libelle,p.facnumber,p.fk_statut,".$db->pdate("p.datef")." as df, total_ttc as amount, paye"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as p WHERE p.fk_soc = $societe->id"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as p"; + $sql.= " WHERE p.fk_soc = ".$societe->id; $sql.= " ORDER BY p.datef DESC"; - $sql.= " ".$db->plimit($conf->liste_limit+1, $offset); + $sql.= " ".$db->plimit($max+1); $resql=$db->query($sql); if ($resql) @@ -274,7 +275,8 @@ if ( $societe->fetch($socid) ) print "
".$langs->trans("LastSuppliersBills",min($num,$max))."id\">".$langs->trans("AllBills")." (".$num.")
"; print ""; } - while ($i < $num && $i < $max) + $facturestatic = new FactureFournisseur($db); + while ($i < min($num,$max)) { $obj = $db->fetch_object($resql); $var=!$var; @@ -283,10 +285,9 @@ if ( $societe->fetch($socid) ) print ''; print ''; print img_object($langs->trans("ShowBill"),"bill")." ".$obj->facnumber.' '.dolibarr_trunc($obj->libelle,14).''; - print "".dolibarr_print_date($obj->df).""; - print ''.$obj->amount.''; - $fac = new FactureFournisseur($db); - print ''.$fac->LibStatut($obj->paye,$obj->fk_statut).''; + print ''.dolibarr_print_date($obj->df).''; + print ''.price($obj->amount).''; + print ''.$facturestatic->LibStatutShort($obj->paye,$obj->fk_statut).''; print ""; $i++; } diff --git a/htdocs/fourn/fournisseur.facture.class.php b/htdocs/fourn/fournisseur.facture.class.php index 80cbc159ddc..47538135923 100644 --- a/htdocs/fourn/fournisseur.facture.class.php +++ b/htdocs/fourn/fournisseur.facture.class.php @@ -454,12 +454,34 @@ class FactureFournisseur return $this->LibStatut($this->paye,$this->statut); } - /** - * \brief Renvoi le libellé long d'un statut donné - * \param paye etat paye - * \param statut id statut - * \return string Libellé long du statut - */ + /** + * \brief Renvoi le libellé court d'un statut donné + * \param paye etat paye + * \param statut id statut + * \return string Libellé long du statut + */ + function LibStatutShort($paye,$statut) + { + global $langs; + $langs->load("bills"); + if (! $paye) + { + if ($statut == 0) return $langs->trans("BillShortStatusDraft"); + if ($statut == 3) return $langs->trans("BillShortStatusCanceled"); + return $langs->trans("BillShortValidated"); + } + else + { + return $langs->trans("BillShortStatusPayed"); + } + } + + /** + * \brief Renvoi le libellé long d'un statut donné + * \param paye etat paye + * \param statut id statut + * \return string Libellé long du statut + */ function LibStatut($paye,$statut) { global $langs; @@ -475,7 +497,7 @@ class FactureFournisseur return $langs->trans("BillStatusPayed"); } } - + /** * \brief Renvoi le libellé court d'un statut donné * \param paye etat paye