Withdrawals: Notifications enhancements

This commit is contained in:
Juanjo Menent 2011-01-07 22:02:22 +00:00
parent 7af2b0fb01
commit c746bba310
6 changed files with 69 additions and 17 deletions

View File

@ -391,7 +391,7 @@ class BonPrelevement extends CommonObject
*/
function set_infocredit($user, $date)
{
global $conf;
global $conf,$langs;
$error == 0;
@ -411,11 +411,14 @@ class BonPrelevement extends CommonObject
if ($this->db->query($sql))
{
$subject = "Credit prelevement ".$this->ref." a la banque";
$message = "Le bon de prelevement ".$this->ref;
//$subject = "Credit prelevement ".$this->ref." a la banque";
/*$message = "Le bon de prelevement ".$this->ref;
$message.= " a ete credite par la banque.\n";
$message.= "Date credit : ".dol_print_date($date,'dayhour');
$message.= "Date credit : ".dol_print_date($date,'dayhour');*/
$langs->load('withdrawals');
$subject = $langs->trans("InfoCreditSubject", $this->ref);
$message = $langs->trans("InfoCreditMessage", $this->ref, dol_print_date($date,'dayhour'));
$this->Notify($user, "cr", $subject, $message);
// Update prelevement line
@ -480,7 +483,7 @@ class BonPrelevement extends CommonObject
*/
function set_infotrans($user, $date, $method)
{
global $conf;
global $conf,$langs;
$error == 0;
dol_syslog("bon-prelevement::set_infotrans Start",LOG_INFO);
@ -498,14 +501,18 @@ class BonPrelevement extends CommonObject
if ($this->db->query($sql))
{
$this->method_trans = $method;
$subject = "Transmission du prelevement ".$this->ref." a la banque";
/*$subject = "Transmission du prelevement ".$this->ref." a la banque";
$message = "Le bon de prelevement ".$this->ref;
$message .= " a ete transmis a la banque par ".$user->prenom. " ".$user->nom;
$message .= "\n\n";
$message .= "\nMontant : ".price($this->amount);
$message .= "\nMethode : ".$this->methodes_trans[$this->method_trans];
$message .= "\nDate : ".dol_print_date($date,'day');
$message .= "\nDate : ".dol_print_date($date,'day');*/
$langs->load('withdrawals');
$subject = $langs->trans("InfoTransSubject", $this->ref);
$message = $langs->trans("InfoTransMessage", $this->ref, $user->prenom, $user->nom);
$message .=$langs->trans("InfoTransData", price($this->amount), $this->methodes_trans[$this->method_trans], dol_print_date($date,'day'));
$this->Notify($user,"tr", $subject, $message, 1);
}
@ -553,10 +560,10 @@ class BonPrelevement extends CommonObject
*/
function Notify($user, $action, $subject, $message, $joinfile=0)
{
global $conf;
global $conf,$langs;
$message .= "\n\n--\n";
$message .= "Ceci est un message automatique envoye par Dolibarr";
$message .= $langs->trans("InfoFoot"); //"Ceci est un message automatique envoye par Dolibarr";
$sql = "SELECT u.name, u.firstname, u.email";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
@ -871,7 +878,7 @@ class BonPrelevement extends CommonObject
}
else
{
print "Option for real mode was not set, we stop after this simulation\n";
print $langs->trans("ModeWarning"); //"Option for real mode was not set, we stop after this simulation\n";
}
}

View File

@ -77,4 +77,13 @@ WithBankUsingBANBIC=Per als comptes bancaris que utilitzen el codi BAN/BIC/SWIFT
BankToReceiveWithdraw=Informació del seu compte bancari receptor de les domiciliacions
CreditDate=Abonada el
WithdrawalFileNotCapable=No es possible generar fitxer bancari de domiciliacio per al seu pais
ShowWithdraw=Veure domiciliació
ShowWithdraw=Veure domiciliació
### Notifications
InfoCreditSubject=Abonament de domiciliació %s pel banc
InfoCreditMessage=L'ordre de domiciliació %s ha estat abonada pel banc <br> Data d'abonament: %s
InfoTransSubject=Enviament de domiciliació %s al banc
InfoTransMessage=L'ordre de domiciliació %s ha estat enviada al banc per %s %s.<br><br>
InfoTransData=Import: %s<br>Mètode: %s<br>Data: %s
InfoFoot=Aquest és un missatge automàtic enviat per Dolibarr
ModeWarning=No s'ha establert l'opció de treball en real, ens aturarem després d'aquesta simulació

View File

@ -77,4 +77,13 @@ WithBankUsingBANBIC=For bank accounts using IBAN/BIC/SWIFT
BankToReceiveWithdraw=Information about you bank account to receive withdraws
CreditDate=Credit on
WithdrawalFileNotCapable=Unable to generate withdrawal receipt file for your country
ShowWithdraw=Show Withdraw
ShowWithdraw=Show Withdraw
### Notifications
InfoCreditSubject=Payment of standing order %s by the bank
InfoCreditMessage=The standing order %s has been paid by the bank<br>Data of payment: %s
InfoTransSubject=Transmission of standing order %s to bank
InfoTransMessage=The standing order %s has been transmited to bank by %s %s.<br><br>
InfoTransData=Amount: %s<br>Metode: %s<br>Date: %s
InfoFoot=This is an automated message sent by Dolibarr
ModeWarning=Option for real mode was not set, we stop after this simulation

View File

@ -77,4 +77,13 @@ WithBankUsingBANBIC=Para las cuentas bancarias que utilizan el código BAN/BIC/S
BankToReceiveWithdraw=Información de su cuenta bancaria receptora de las domiciliaciones
CreditDate=Abonada el
WithdrawalFileNotCapable=No es posible generar fichero bancario de domiciliacion para su pais
ShowWithdraw=Ver domiciliación
ShowWithdraw=Ver domiciliación
### Notifications
InfoCreditSubject=Abono de domiciliación %s por el banco
InfoCreditMessage=La orden de domiciliación %s ha sido abonada por el banco<br>Fecha de abono: %s
InfoTransSubject=Envío de domiciliación %s al banco
InfoTransMessage=La orden de domiciliación %s ha sido enviada al banco por %s %s.<br><br>
InfoTransData=Importe: %s<br>Método: %s<br>Fecha: %s
InfoFoot=Este es un mensaje automático enviado por Dolibarr
ModeWarning=No se ha establecido la opción de modo real, nos detendremos después de esta simulación

View File

@ -77,4 +77,13 @@ WithBankUsingBANBIC=Para las cuentas bancarias que utilizan el código BAN/BIC/S
BankToReceiveWithdraw=Información de su cuenta bancaria receptora de las domiciliaciones
CreditDate=Abonada el
WithdrawalFileNotCapable=No es posible generar fichero bancario de domiciliacion para su pais
ShowWithdraw=Ver domiciliación
ShowWithdraw=Ver domiciliación
### Notifications
InfoCreditSubject=Abono de domiciliación %s por el banco
InfoCreditMessage=La orden de domiciliación %s ha sido abonada por el banco<br>Fecha de abono: %s
InfoTransSubject=Envío de domiciliación %s al banco
InfoTransMessage=La orden de domiciliación %s ha sido enviada al banco por %s %s.<br><br>
InfoTransData=Importe: %s<br>Método: %s<br>Fecha: %s
InfoFoot=Este es un mensaje automático enviado por Dolibarr
ModeWarning=No se ha establecido la opción de modo real, nos detendremos después de esta simulación

View File

@ -77,4 +77,13 @@ WithBankUsingBANBIC=Pour les comptes bancaires utilisant le code BAN/BIC/SWIFT
BankToReceiveWithdraw=Informations de votre compte bancaire recevant les prélèvements
CreditDate=Crédité le
WithdrawalFileNotCapable=Impossible de generer fichier de bon de prelevements pour votre pays
ShowWithdraw=Voir prélèvement
ShowWithdraw=Voir prélèvement
### Notifications
InfoCreditSubject=Credit prélèvement %s a la banque
InfoCreditMessage=Le bon de prélèvement %s a eté credité par la banque.<br>Date credit : %s
InfoTransSubject=Transmission du prélèvement %s a la banque
InfoTransMessage=Le bon de prélèvement %s a eté transmis a la banque par %s %s.<br><br>
InfoTransData=Montant: %s<br>Methode: %s<br>Date: %s
InfoFoot=Ceci est un message automatique envoye par Dolibarr
ModeWarning=Option mode réel non établi, nous allons arrêter après cette simulation