mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-11 03:51:25 +01:00
Synchro
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
require("../contact.class.php");
|
require_once("../contact.class.php");
|
||||||
require (DOL_DOCUMENT_ROOT."/lib/vcard/vcard.class.php");
|
require (DOL_DOCUMENT_ROOT."/lib/vcard/vcard.class.php");
|
||||||
|
|
||||||
$langs->load("company");
|
$langs->load("company");
|
||||||
@@ -223,6 +223,9 @@ if ($_GET["action"] == 'create')
|
|||||||
// print '</td></tr>';
|
// print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Note").'</td><td colspan="5"><textarea name="note" cols="60" rows="3"></textarea></td></tr>';
|
print '<tr><td>'.$langs->trans("Note").'</td><td colspan="5"><textarea name="note" cols="60" rows="3"></textarea></td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td>Contact facturation</td><td colspan="5"><select name="facturation"><option value="0">Non<option value="1">Oui</select></td></tr>';
|
||||||
|
|
||||||
print '<tr><td align="center" colspan="6"><input type="submit" value="'.$langs->trans("Add").'"></td></tr>';
|
print '<tr><td align="center" colspan="6"><input type="submit" value="'.$langs->trans("Add").'"></td></tr>';
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print "</form>";
|
print "</form>";
|
||||||
@@ -276,6 +279,9 @@ elseif ($_GET["action"] == 'edit')
|
|||||||
print '<textarea name="note" cols="60" rows="3">';
|
print '<textarea name="note" cols="60" rows="3">';
|
||||||
print nl2br($contact->note);
|
print nl2br($contact->note);
|
||||||
print '</textarea></td></tr>';
|
print '</textarea></td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td>Contact facturation</td><td colspan="5"><select name="facturation"><option value="0">Non<option value="1">Oui</select></td></tr>';
|
||||||
|
|
||||||
print '<tr><td colspan="6" align="center"><input type="submit" value="'.$langs->trans("Save").'"></td></tr>';
|
print '<tr><td colspan="6" align="center"><input type="submit" value="'.$langs->trans("Save").'"></td></tr>';
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
|
|||||||
@@ -23,14 +23,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \file htdocs/includes/modules/facture/neptune/neptune.modules.php
|
/*! \file htdocs/includes/modules/facture/neptune/neptune.modules.php
|
||||||
\ingroup facture
|
\ingroup facture
|
||||||
\brief Fichier contenant la classe du mod<6F>le de num<75>rotation de r<>f<EFBFBD>rence de facture Neptune
|
\brief Fichier contenant la classe du mod<6F>le de num<75>rotation de r<>f<EFBFBD>rence de facture Neptune
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \class mod_facture_neptune
|
/*! \class mod_facture_neptune
|
||||||
\brief Classe du mod<6F>le de num<75>rotation de r<>f<EFBFBD>rence de facture Neptune
|
\brief Classe du mod<6F>le de num<75>rotation de r<>f<EFBFBD>rence de facture Neptune
|
||||||
*/
|
*/
|
||||||
class mod_facture_neptune extends ModeleNumRefFactures
|
class mod_facture_neptune extends ModeleNumRefFactures
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -183,6 +183,7 @@ class CMailFile
|
|||||||
$out = $out . "Reply-To: $addr_from\n";
|
$out = $out . "Reply-To: $addr_from\n";
|
||||||
$out = $out . "X-Mailer: Dolibarr version " . DOL_VERSION ."\n";
|
$out = $out . "X-Mailer: Dolibarr version " . DOL_VERSION ."\n";
|
||||||
$out = $out . "X-Sender: $addr_from\n";
|
$out = $out . "X-Sender: $addr_from\n";
|
||||||
|
$out = $out . "Return-path: $addr_from\n";
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,16 +81,21 @@ class DolibarrMail
|
|||||||
|
|
||||||
function PrepareFile($filename_list,$mimetype_list,$mimefilename_list)
|
function PrepareFile($filename_list,$mimetype_list,$mimefilename_list)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$this->mime_headers="";
|
||||||
|
|
||||||
|
|
||||||
$this->smtp_headers = $this->write_smtpheaders();
|
$this->smtp_headers = $this->write_smtpheaders();
|
||||||
$this->text_body = $this->write_body($this->message, $filename_list);
|
|
||||||
if (count($filename_list))
|
if (count($filename_list))
|
||||||
{
|
{
|
||||||
$this->mime_headers = $this->write_mimeheaders($filename_list, $mimefilename_list);
|
$this->mime_headers = $this->write_mimeheaders($filename_list, $mimefilename_list);
|
||||||
$this->text_encoded = $this->attach_file($filename_list,
|
$this->text_encoded = $this->attach_file($filename_list,
|
||||||
$mimetype_list,
|
$mimetype_list,
|
||||||
$mimefilename_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)
|
function attach_file($filename_list,$mimetype_list,$mimefilename_list)
|
||||||
{
|
{
|
||||||
for ($i = 0; $i < count($filename_list); $i++) {
|
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];
|
$encoded = $this->encode_file($filename_list[$i]);
|
||||||
$out = $out . "--" . $this->mime_boundary . "\n";
|
|
||||||
if (! $mimetype_list[$i]) { $mimetype_list[$i] = "application/octet-stream"; }
|
if ($mimefilename_list[$i])
|
||||||
$out = $out . "Content-type: " . $mimetype_list[$i] . "; name=\"$filename_list[$i]\";\n";
|
{
|
||||||
$out = $out . "Content-Transfer-Encoding: base64\n";
|
$filename_list[$i] = $mimefilename_list[$i];
|
||||||
$out = $out . "Content-disposition: attachment; filename=\"$filename_list[$i]\"\n\n";
|
}
|
||||||
$out = $out . $encoded . "\n";
|
|
||||||
}
|
$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";
|
$out = $out . "--" . $this->mime_boundary . "--" . "\n";
|
||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
// added -- to notify email client attachment is done
|
// added -- to notify email client attachment is done
|
||||||
}
|
}
|
||||||
@@ -143,6 +160,7 @@ class DolibarrMail
|
|||||||
{
|
{
|
||||||
$headers .= $this->smtp_headers . $this->mime_headers;
|
$headers .= $this->smtp_headers . $this->mime_headers;
|
||||||
$message = $this->text_body . $this->text_encoded;
|
$message = $this->text_body . $this->text_encoded;
|
||||||
|
|
||||||
return mail($this->addr_to,$this->subject,stripslashes($message),$headers);
|
return mail($this->addr_to,$this->subject,stripslashes($message),$headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,10 +194,17 @@ class DolibarrMail
|
|||||||
$out = $out . "Content-type: multipart/mixed; ";
|
$out = $out . "Content-type: multipart/mixed; ";
|
||||||
$out = $out . "boundary=\"$this->mime_boundary\"\n";
|
$out = $out . "boundary=\"$this->mime_boundary\"\n";
|
||||||
$out = $out . "Content-transfer-encoding: 7BIT\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];
|
for($i = 0; $i < count($filename_list); $i++)
|
||||||
$out = $out . "X-attachments: $filename_list[$i];\n\n";
|
{
|
||||||
}
|
if ($mimefilename_list[$i])
|
||||||
|
{
|
||||||
|
$filename_list[$i] = $mimefilename_list[$i];
|
||||||
|
}
|
||||||
|
|
||||||
|
$out = $out . "X-attachments: $filename_list[$i];\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,15 +22,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file htdocs/paiement.class.php
|
\file htdocs/paiement.class.php
|
||||||
\ingroup facture
|
\ingroup facture
|
||||||
\brief Fichier de la classe des paiement de factures clients
|
\brief Fichier de la classe des paiement de factures clients
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! \class Paiement
|
/*! \class Paiement
|
||||||
\brief Classe permettant la gestion des paiements des factures clients
|
\brief Classe permettant la gestion des paiements des factures clients
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Paiement
|
class Paiement
|
||||||
@@ -41,8 +41,10 @@ class Paiement
|
|||||||
var $datepaye;
|
var $datepaye;
|
||||||
var $amount;
|
var $amount;
|
||||||
var $author;
|
var $author;
|
||||||
var $paiementid; // Type de paiement. Stock<63> dans fk_paiement de llx_paiement qui est li<6C> aux types de paiement de llx_c_paiement
|
var $paiementid; // Type de paiement. Stock<63> dans fk_paiement
|
||||||
var $num_paiement; // Num<75>ro du CHQ, VIR, etc...
|
// de llx_paiement qui est li<6C> aux types de
|
||||||
|
//paiement de llx_c_paiement
|
||||||
|
var $num_paiement; // Num<75>ro du CHQ, VIR, etc...
|
||||||
var $note;
|
var $note;
|
||||||
// fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...)
|
// 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
|
// fk_paiement dans llx_paiement_facture est le rowid du paiement
|
||||||
@@ -113,6 +115,7 @@ class Paiement
|
|||||||
if ($this->db->begin())
|
if ($this->db->begin())
|
||||||
{
|
{
|
||||||
$total = 0;
|
$total = 0;
|
||||||
|
|
||||||
foreach ($this->amounts as $key => $value)
|
foreach ($this->amounts as $key => $value)
|
||||||
{
|
{
|
||||||
$facid = $key;
|
$facid = $key;
|
||||||
@@ -124,7 +127,8 @@ class Paiement
|
|||||||
$total += $amount;
|
$total += $amount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$total = ereg_replace(",",".",$total);
|
|
||||||
|
$total = ereg_replace(",",".",$total);
|
||||||
|
|
||||||
if ($total > 0)
|
if ($total > 0)
|
||||||
{
|
{
|
||||||
@@ -146,9 +150,11 @@ class Paiement
|
|||||||
{
|
{
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement_facture (fk_facture, fk_paiement, amount)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement_facture (fk_facture, fk_paiement, amount)";
|
||||||
$sql .= " VALUES ('".$facid."','". $this->id."','". $amount."')";
|
$sql .= " VALUES ('".$facid."','". $this->id."','". $amount."')";
|
||||||
|
|
||||||
if (! $this->db->query($sql) )
|
if (! $this->db->query($sql) )
|
||||||
{
|
{
|
||||||
dolibarr_print_error($this->db);
|
dolibarr_print_error($this->db);
|
||||||
|
|
||||||
$sql_err++;
|
$sql_err++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -157,22 +163,22 @@ class Paiement
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($this->db);
|
dolibarr_print_error($this->db);
|
||||||
$sql_err++;
|
$sql_err++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $total > 0 && $sql_err == 0 )
|
if ( $total > 0 && $sql_err == 0 )
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,7 +227,7 @@ class Paiement
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($this->db);
|
dolibarr_print_error($this->db);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -235,13 +241,14 @@ class Paiement
|
|||||||
$sql = "UPDATE llx_paiement set fk_bank = ".$id_bank." where rowid = ".$this->id;
|
$sql = "UPDATE llx_paiement set fk_bank = ".$id_bank." where rowid = ".$this->id;
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
dolibarr_print_error($this->db);
|
{
|
||||||
|
dolibarr_print_error($this->db);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -263,7 +270,7 @@ class Paiement
|
|||||||
|
|
||||||
$this->id = $obj->idp;
|
$this->id = $obj->idp;
|
||||||
|
|
||||||
if ($obj->fk_user_creat) {
|
if ($obj->fk_user_creat) {
|
||||||
$cuser = new User($this->db, $obj->fk_user_creat);
|
$cuser = new User($this->db, $obj->fk_user_creat);
|
||||||
$cuser->fetch();
|
$cuser->fetch();
|
||||||
$this->user_creation = $cuser;
|
$this->user_creation = $cuser;
|
||||||
|
|||||||
Reference in New Issue
Block a user