diff --git a/htdocs/compta/facture.php3 b/htdocs/compta/facture.php3 index 65dd541041b..f32d13610a4 100644 --- a/htdocs/compta/facture.php3 +++ b/htdocs/compta/facture.php3 @@ -218,7 +218,7 @@ if ($action == 'send') $sendto = htmlentities($sendto); - $sql = "INSERT INTO llx_actioncomm (datea,fk_action,fk_soc,note,fk_facture, fk_contact,fk_user_author, label) VALUES (now(), 9 ,$fac->socidp ,'Envoyée à $sendto',$fac->id, $sendtoid, $user->id, 'Envoi Facture par mail');"; + $sql = "INSERT INTO llx_actioncomm (datea,fk_action,fk_soc,note,fk_facture, fk_contact,fk_user_author, label, percent) VALUES (now(), 9 ,$fac->socidp ,'Envoyée à $sendto',$fac->id, $sendtoid, $user->id, 'Envoi Facture par mail',100);"; if (! $db->query($sql) ) { @@ -872,6 +872,17 @@ else { $sql .= " AND date_format(f.datef, '%m') = $month"; } + + if ($filtre) + { + $filtrearr = split(",", $filtre); + foreach ($filtrearr as $fil) + { + $filt = split(":", $fil); + $sql .= " AND " . $filt[0] . " = " . $filt[1]; + } + } + if ($year > 0) { $sql .= " AND date_format(f.datef, '%Y') = $year"; @@ -907,17 +918,25 @@ else $var=!$var; print ""; - print "facid\">"; if ($objp->paye) { - print $objp->facnumber; + $class = "normal"; } else { - print ''.$objp->facnumber.''; + if ($objp->fk_statut == 0) + { + $class = "normal"; + } + else + { + $class = "impayee"; + } } + + print '' . $objp->facnumber; print "\n"; - print "idp\">$objp->nom\n"; + print ''.$objp->nom.''; if ($objp->df > 0 ) { @@ -926,9 +945,9 @@ else $m = strftime("%m",$objp->df); print strftime("%d",$objp->df)."\n"; - print " "; + print ' '; print strftime("%B",$objp->df)."\n"; - print " "; + print ' '; print strftime("%Y",$objp->df)."\n"; } else @@ -946,7 +965,7 @@ else } else { - print 'impayée'; + print 'impayée'; } } else @@ -964,7 +983,7 @@ else } else { - print $db->error(); + print $db->error() . "
" . $sql; } }