diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index fa5f67811ac..0d89e223ff8 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -22,7 +22,7 @@ * */ require("./pre.inc.php"); -require("../contact.class.php"); +require_once("../contact.class.php"); require (DOL_DOCUMENT_ROOT."/lib/vcard/vcard.class.php"); $langs->load("company"); @@ -223,6 +223,9 @@ if ($_GET["action"] == 'create') // print ''; print ''.$langs->trans("Note").''; + + print 'Contact facturation'; + print ''; print ""; print ""; @@ -276,6 +279,9 @@ elseif ($_GET["action"] == 'edit') print ''; + + print 'Contact facturation'; + print ''; print ""; diff --git a/htdocs/includes/modules/facture/neptune/neptune.modules.php b/htdocs/includes/modules/facture/neptune/neptune.modules.php index e8ffeafbed2..e7f01b39f06 100644 --- a/htdocs/includes/modules/facture/neptune/neptune.modules.php +++ b/htdocs/includes/modules/facture/neptune/neptune.modules.php @@ -23,14 +23,14 @@ */ /*! \file htdocs/includes/modules/facture/neptune/neptune.modules.php - \ingroup facture - \brief Fichier contenant la classe du modèle de numérotation de référence de facture Neptune - \version $Revision$ + \ingroup facture + \brief Fichier contenant la classe du modèle de numérotation de référence de facture Neptune + \version $Revision$ */ /*! \class mod_facture_neptune - \brief Classe du modèle de numérotation de référence de facture Neptune + \brief Classe du modèle de numérotation de référence de facture Neptune */ class mod_facture_neptune extends ModeleNumRefFactures { diff --git a/htdocs/lib/CMailFile.class.php b/htdocs/lib/CMailFile.class.php index 44b189e4ac8..3106a76e045 100644 --- a/htdocs/lib/CMailFile.class.php +++ b/htdocs/lib/CMailFile.class.php @@ -183,6 +183,7 @@ class CMailFile $out = $out . "Reply-To: $addr_from\n"; $out = $out . "X-Mailer: Dolibarr version " . DOL_VERSION ."\n"; $out = $out . "X-Sender: $addr_from\n"; + $out = $out . "Return-path: $addr_from\n"; return $out; } } diff --git a/htdocs/lib/dolibarrmail.class.php b/htdocs/lib/dolibarrmail.class.php index 6d74b053914..1204fe8e73b 100644 --- a/htdocs/lib/dolibarrmail.class.php +++ b/htdocs/lib/dolibarrmail.class.php @@ -81,16 +81,21 @@ class DolibarrMail function PrepareFile($filename_list,$mimetype_list,$mimefilename_list) { + + $this->mime_headers=""; + $this->smtp_headers = $this->write_smtpheaders(); - $this->text_body = $this->write_body($this->message, $filename_list); + if (count($filename_list)) { $this->mime_headers = $this->write_mimeheaders($filename_list, $mimefilename_list); $this->text_encoded = $this->attach_file($filename_list, - $mimetype_list, - $mimefilename_list); + $mimetype_list, + $mimefilename_list); } + $this->text_body = $this->write_body($this->message, $filename_list); + } /*! @@ -102,17 +107,29 @@ class DolibarrMail function attach_file($filename_list,$mimetype_list,$mimefilename_list) { - for ($i = 0; $i < count($filename_list); $i++) { - $encoded = $this->encode_file($filename_list[$i]); - if ($mimefilename_list[$i]) $filename_list[$i] = $mimefilename_list[$i]; - $out = $out . "--" . $this->mime_boundary . "\n"; - if (! $mimetype_list[$i]) { $mimetype_list[$i] = "application/octet-stream"; } - $out = $out . "Content-type: " . $mimetype_list[$i] . "; name=\"$filename_list[$i]\";\n"; - $out = $out . "Content-Transfer-Encoding: base64\n"; - $out = $out . "Content-disposition: attachment; filename=\"$filename_list[$i]\"\n\n"; - $out = $out . $encoded . "\n"; - } + for ($i = 0; $i < count($filename_list); $i++) + { + $encoded = $this->encode_file($filename_list[$i]); + + if ($mimefilename_list[$i]) + { + $filename_list[$i] = $mimefilename_list[$i]; + } + + $out = $out . "--" . $this->mime_boundary . "\n"; + + if (! $mimetype_list[$i]) + { + $mimetype_list[$i] = "application/octet-stream"; + } + + $out = $out . "Content-type: " . $mimetype_list[$i] . "; name=\"".$filename_list[$i]."\";\n"; + $out = $out . "Content-Transfer-Encoding: base64\n"; + $out = $out . "Content-disposition: attachment; filename=\"".$filename_list[$i]."\"\n\n"; + $out = $out . $encoded . "\n"; + } $out = $out . "--" . $this->mime_boundary . "--" . "\n"; + return $out; // added -- to notify email client attachment is done } @@ -143,6 +160,7 @@ class DolibarrMail { $headers .= $this->smtp_headers . $this->mime_headers; $message = $this->text_body . $this->text_encoded; + return mail($this->addr_to,$this->subject,stripslashes($message),$headers); } @@ -176,10 +194,17 @@ class DolibarrMail $out = $out . "Content-type: multipart/mixed; "; $out = $out . "boundary=\"$this->mime_boundary\"\n"; $out = $out . "Content-transfer-encoding: 7BIT\n"; - for($i = 0; $i < count($filename_list); $i++) { - if ($mimefilename_list[$i]) $filename_list[$i] = $mimefilename_list[$i]; - $out = $out . "X-attachments: $filename_list[$i];\n\n"; - } + + for($i = 0; $i < count($filename_list); $i++) + { + if ($mimefilename_list[$i]) + { + $filename_list[$i] = $mimefilename_list[$i]; + } + + $out = $out . "X-attachments: $filename_list[$i];\n\n"; + } + return $out; } diff --git a/htdocs/paiement.class.php b/htdocs/paiement.class.php index 7011209de3a..26107fdb4e4 100644 --- a/htdocs/paiement.class.php +++ b/htdocs/paiement.class.php @@ -22,15 +22,15 @@ */ /*! - \file htdocs/paiement.class.php - \ingroup facture - \brief Fichier de la classe des paiement de factures clients - \version $Revision$ + \file htdocs/paiement.class.php + \ingroup facture + \brief Fichier de la classe des paiement de factures clients + \version $Revision$ */ /*! \class Paiement - \brief Classe permettant la gestion des paiements des factures clients + \brief Classe permettant la gestion des paiements des factures clients */ class Paiement @@ -41,8 +41,10 @@ class Paiement var $datepaye; var $amount; var $author; - var $paiementid; // Type de paiement. Stocké dans fk_paiement de llx_paiement qui est lié aux types de paiement de llx_c_paiement - var $num_paiement; // Numéro du CHQ, VIR, etc... + var $paiementid; // Type de paiement. Stocké dans fk_paiement + // de llx_paiement qui est lié aux types de + //paiement de llx_c_paiement + var $num_paiement; // Numéro du CHQ, VIR, etc... var $note; // fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...) // fk_paiement dans llx_paiement_facture est le rowid du paiement @@ -113,6 +115,7 @@ class Paiement if ($this->db->begin()) { $total = 0; + foreach ($this->amounts as $key => $value) { $facid = $key; @@ -124,7 +127,8 @@ class Paiement $total += $amount; } } - $total = ereg_replace(",",".",$total); + + $total = ereg_replace(",",".",$total); if ($total > 0) { @@ -146,9 +150,11 @@ class Paiement { $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement_facture (fk_facture, fk_paiement, amount)"; $sql .= " VALUES ('".$facid."','". $this->id."','". $amount."')"; + if (! $this->db->query($sql) ) { - dolibarr_print_error($this->db); + dolibarr_print_error($this->db); + $sql_err++; } } @@ -157,22 +163,22 @@ class Paiement } else { - dolibarr_print_error($this->db); + dolibarr_print_error($this->db); $sql_err++; } } - if ( $total > 0 && $sql_err == 0 ) - { - $this->db->commit(); - return $this->id; - } - else - { - $this->db->rollback(); - return -1; - } - + if ( $total > 0 && $sql_err == 0 ) + { + $this->db->commit(); + return $this->id; + } + else + { + $this->db->rollback(); + return -1; + } + } } @@ -221,7 +227,7 @@ class Paiement } else { - dolibarr_print_error($this->db); + dolibarr_print_error($this->db); return 0; } } @@ -235,13 +241,14 @@ class Paiement $sql = "UPDATE llx_paiement set fk_bank = ".$id_bank." where rowid = ".$this->id; $result = $this->db->query($sql); if ($result) - { - return 1; - } - else { - dolibarr_print_error($this->db); + { + return 1; + } + else + { + dolibarr_print_error($this->db); return 0; - } + } } /* @@ -263,7 +270,7 @@ class Paiement $this->id = $obj->idp; - if ($obj->fk_user_creat) { + if ($obj->fk_user_creat) { $cuser = new User($this->db, $obj->fk_user_creat); $cuser->fetch(); $this->user_creation = $cuser;