From 150b49b0fbe8e77895cda069126e21977f1a51ed Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 24 Jul 2003 11:05:57 +0000 Subject: [PATCH] Ajoute la gestion des relances --- htdocs/compta/facture.php3 | 67 +++++++++++++++++++++++++++++++------- 1 file changed, 55 insertions(+), 12 deletions(-) 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 "
\n"; - print "\n"; - print "\n"; + print ''; + print ''; print "

Envoyer la facture par mail"; print ""; print ''; - print ""; + print ""; print ""; print ""; - print ""; + print "
Destinataire'; - $form = new Form($db); - + $form = new Form($db); $form->select_array("destinataire",$soc->contact_email_array()); - print 'email\">
email\">
Expéditeur$from_name$from_mail
Reply-to$replytoname$replytomail
$replytomail
"; - print ""; - print ""; - print "

"; + print ""; + } + + if ($action == 'prerelance') + { + $replytoname = $user->fullname; + $from_name = $replytoname; + + $replytomail = $user->email; + $from_mail = $replytomail; + + print "
\n"; + print ''; + print ''; + print ''; + + print_titre("Envoyer une relance"); + print ""; + print '"; + print ""; + print ""; + print "
Destinataire'; + + $form = new Form($db); + $form->select_array("destinataire",$soc->contact_email_array()); + + print "email\">
Expéditeur$from_name$from_mail
Reply-to$replytoname$replytomail
"; + + print "
"; } /*