diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 243b29097b3..34222ccf976 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -308,17 +308,17 @@ if ($action == 'send') $subject = "Facture $fac->ref"; $message = "Veuillez trouver ci-joint la facture $fac->ref\n\nCordialement\n\n"; $filename = "$fac->ref.pdf"; - + $replyto = $HTTP_POST_VARS["replytoname"] . " <".$HTTP_POST_VARS["replytomail"] .">"; - + $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$file, "application/pdf", $filename); - + if ( $mailfile->sendfile() ) { $sendto = htmlentities($sendto); - $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);"; + $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) ) { @@ -405,11 +405,11 @@ if ($_GET["action"] == 'create') $obj = $db->fetch_object(0); $soc = new Societe($db); - $soc->fetch($societe_id); + $soc->fetch($obj->idp); print '