diff --git a/htdocs/compta/facture.php3 b/htdocs/compta/facture.php3
index f32d13610a4..a6e7399e3d5 100644
--- a/htdocs/compta/facture.php3
+++ b/htdocs/compta/facture.php3
@@ -186,7 +186,6 @@ if ($action == 'add')
/*
*
*/
-
if ($action == 'send')
{
$fac = new Facture($db,"",$facid);
@@ -237,7 +236,23 @@ if ($action == 'send')
}
}
}
+/*
+ *
+ */
+if ($HTTP_POST_VARS["action"] == 'relance')
+{
+ $fac = new Facture($db,"",$facid);
+ $fac->fetch($facid);
+ $fac->send_relance($HTTP_POST_VARS["destinataire"],
+ $HTTP_POST_VARS["replytoname"],
+ $HTTP_POST_VARS["replytomail"],
+ $user);
+}
+
+/*
+ *
+ */
if ($action == 'pdf')
{
/*
@@ -641,6 +656,10 @@ else
{
print "
[Classer 'Payée'] | ";
}
+ elseif ($obj->statut == 1 && $resteapayer > 0)
+ {
+ print "[Envoyer une relance] | ";
+ }
else
{
print "- | ";
@@ -705,7 +724,7 @@ else
*
*/
$sql = "SELECT ".$db->pdate("a.datea")." as da, a.note";
- $sql .= " FROM llx_actioncomm as a WHERE a.fk_soc = $obj->socidp AND a.fk_action = 9 AND a.fk_facture = $facid";
+ $sql .= " FROM llx_actioncomm as a WHERE a.fk_soc = $obj->socidp AND a.fk_action in (9,10) AND a.fk_facture = $facid";
$result = $db->query($sql);
if ($result)
@@ -759,26 +778,50 @@ else
$from_mail = $replytomail;
print "";
+ print "";
+ }
+
+ if ($action == 'prerelance')
+ {
+ $replytoname = $user->fullname;
+ $from_name = $replytoname;
+
+ $replytomail = $user->email;
+ $from_mail = $replytomail;
+
+ print "";
}
/*