';
diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php
index 3cd1ced27cf..57db196ae2d 100644
--- a/htdocs/facture.class.php
+++ b/htdocs/facture.class.php
@@ -337,10 +337,10 @@ class Facture extends CommonObject
/**
- \brief Create a new invoice in database from current invoice
- \param user Object user that ask creation
- \param invertdetail Reverse sign of amounts for lines
- \return int <0 si ko, >0 si ok
+ \brief Create a new invoice in database from current invoice
+ \param user Object user that ask creation
+ \param invertdetail Reverse sign of amounts for lines
+ \return int <0 si ko, >0 si ok
*/
function create_clone($user,$invertdetail=0)
{
@@ -388,7 +388,7 @@ class Facture extends CommonObject
/**
* \brief Renvoie nom clicable (avec eventuellement le picto)
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
- * \param option Sur quoi pointe le lien
+ * \param option Sur quoi pointe le lien ('', 'withdraw')
* \return string Chaine avec URL
*/
function getNomUrl($withpicto=0,$option='')
@@ -397,8 +397,16 @@ class Facture extends CommonObject
$result='';
- $lien = '';
- $lienfin='';
+ if ($option == 'withdraw')
+ {
+ $lien = '';
+ $lienfin='';
+ }
+ else
+ {
+ $lien = '';
+ $lienfin='';
+ }
$picto='bill';
if ($this->type == 1) $picto.='r';
@@ -416,16 +424,14 @@ class Facture extends CommonObject
/**
- \brief Recupére l'objet facture et ses lignes de factures
- \param rowid id de la facture a récupérer
- \param societe_id id de societe
- \return int >0 si ok, <0 si ko
- */
- function fetch($rowid, $societe_id=0)
+ * \brief Recupére l'objet facture et ses lignes de factures
+ * \param rowid id de la facture a récupérer
+ * \param ref Ref of invoice
+ * \return int >0 si ok, <0 si ko
+ */
+ function fetch($rowid,$ref='')
{
- dolibarr_syslog("Facture::Fetch rowid=".$rowid.", societe_id=".$societe_id, LOG_DEBUG);
-
- $sql = 'SELECT f.facnumber,f.ref_client,f.type,f.fk_soc,f.amount,f.tva,f.total,f.total_ttc,f.remise_percent,f.remise_absolue,f.remise';
+ $sql = 'SELECT f.rowid,f.facnumber,f.ref_client,f.type,f.fk_soc,f.amount,f.tva,f.total,f.total_ttc,f.remise_percent,f.remise_absolue,f.remise';
$sql.= ','.$this->db->pdate('f.datef').' as df';
$sql.= ','.$this->db->pdate('f.date_lim_reglement').' as dlr';
$sql.= ','.$this->db->pdate('f.datec').' as datec';
@@ -440,20 +446,18 @@ class Facture extends CommonObject
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'cond_reglement as c ON f.fk_cond_reglement = c.rowid';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON f.fk_mode_reglement = p.id';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'co_fa as cf ON cf.fk_facture = f.rowid';
- $sql.= ' WHERE f.rowid='.$rowid;
- if ($societe_id > 0)
- {
- $sql.= ' AND f.fk_soc = '.$societe_id;
- }
- $result = $this->db->query($sql);
+ if ($ref) $sql.= " WHERE f.facnumber='".$ref."'";
+ else $sql.= " WHERE f.rowid=".$rowid;
+ dolibarr_syslog("Facture::Fetch sql=".$sql, LOG_DEBUG);
+ $result = $this->db->query($sql);
if ($result)
{
if ($this->db->num_rows($result))
{
$obj = $this->db->fetch_object($result);
- $this->id = $rowid;
+ $this->id = $obj->rowid;
$this->ref = $obj->facnumber;
$this->ref_client = $obj->ref_client;
$this->type = $obj->type;
@@ -927,7 +931,7 @@ class Facture extends CommonObject
$sql.= ' SET paye=0, fk_statut=1, close_code=null, close_note=null';
$sql.= ' WHERE rowid = '.$this->id;
$resql = $this->db->query($sql);
-
+
dolibarr_syslog("Facture::set_unpayed sql=".$sql);
if ($resql)
{
@@ -1094,7 +1098,7 @@ class Facture extends CommonObject
$sql.= ', date_lim_reglement='.$this->db->idate($datelim);
}
$sql.= ' WHERE rowid = '.$this->id;
-
+
dolibarr_syslog("Facture::set_valid() sql=".$sql, LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
@@ -1171,7 +1175,7 @@ class Facture extends CommonObject
$result=$interface->run_triggers('BILL_VALIDATE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
-
+
$this->db->commit();
return 1;
}
@@ -1180,7 +1184,7 @@ class Facture extends CommonObject
$this->db->rollback();
return -1;
}
-
+
}
else
{
@@ -1303,7 +1307,7 @@ class Facture extends CommonObject
$pu_ht=price2num($pu_ht);
$pu_ttc=price2num($pu_ttc);
$txtva=price2num($txtva);
-
+
if ($price_base_type=='HT')
{
$pu=$pu_ht;
@@ -2229,42 +2233,42 @@ class Facture extends CommonObject
$sql .= ' WHERE fk_facture='.$this->id;
$sql .= ' AND traite = 0';
if ( $this->db->query( $sql) )
- {
- $row = $this->db->fetch_row();
- if ($row[0] == 0)
- {
- $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'prelevement_facture_demande';
- $sql .= ' (fk_facture, amount, date_demande, fk_user_demande, code_banque, code_guichet, number, cle_rib)';
- $sql .= ' VALUES ('.$this->id;
- $sql .= ",'".price2num($this->total_ttc)."'";
- $sql .= ",".$this->db->idate(mktime()).",".$user->id;
- $sql .= ",'".$soc->bank_account->code_banque."'";
- $sql .= ",'".$soc->bank_account->code_guichet."'";
- $sql .= ",'".$soc->bank_account->number."'";
- $sql .= ",'".$soc->bank_account->cle_rib."')";
- if ( $this->db->query( $sql) )
- {
- return 1;
- }
- else
- {
- $this->error=$this->db->error();
- dolibarr_syslog('Facture::DemandePrelevement Erreur');
- return -1;
- }
- }
- else
- {
- $this->error="Une demande existe déjà";
- dolibarr_syslog('Facture::DemandePrelevement Impossible de créer une demande, demande déja en cours');
- }
- }
- else
- {
- $this->error=$this->db->error();
- dolibarr_syslog('Facture::DemandePrelevement Erreur -2');
- return -2;
- }
+ {
+ $row = $this->db->fetch_row();
+ if ($row[0] == 0)
+ {
+ $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'prelevement_facture_demande';
+ $sql .= ' (fk_facture, amount, date_demande, fk_user_demande, code_banque, code_guichet, number, cle_rib)';
+ $sql .= ' VALUES ('.$this->id;
+ $sql .= ",'".price2num($this->total_ttc)."'";
+ $sql .= ",".$this->db->idate(mktime()).",".$user->id;
+ $sql .= ",'".$soc->bank_account->code_banque."'";
+ $sql .= ",'".$soc->bank_account->code_guichet."'";
+ $sql .= ",'".$soc->bank_account->number."'";
+ $sql .= ",'".$soc->bank_account->cle_rib."')";
+ if ( $this->db->query( $sql) )
+ {
+ return 1;
+ }
+ else
+ {
+ $this->error=$this->db->error();
+ dolibarr_syslog('Facture::DemandePrelevement Erreur');
+ return -1;
+ }
+ }
+ else
+ {
+ $this->error="Une demande existe déjà";
+ dolibarr_syslog('Facture::DemandePrelevement Impossible de créer une demande, demande déja en cours');
+ }
+ }
+ else
+ {
+ $this->error=$this->db->error();
+ dolibarr_syslog('Facture::DemandePrelevement Erreur -2');
+ return -2;
+ }
}
else
{
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index 9f63f9db581..29d74cae950 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -2990,12 +2990,13 @@ class Form
* \param object Object to show
* \param paramid Nom du parametre a utiliser pour nommer id dans liens URL
* \param morehtml Code html supplementaire a afficher avant barre nav
- * \param shownav Show Condition
- * \param fieldid Nom du champ id a utiliser pour select next et previous
- * \param fieldref Nom du champ ref a utiliser pour select next et previous
+ * \param shownav Show Condition
+ * \param fieldid Nom du champ en base a utiliser pour select next et previous
+ * \param fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous
+ * \param morehtmlref Code html supplementaire a afficher apres ref
* \return string Portion HTML avec ref + boutons nav
*/
- function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref')
+ function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='')
{
$ret='';
@@ -3009,7 +3010,10 @@ class Form
}
$ret.=$object->$fieldref;
-
+ if ($morehtmlref) {
+ $ret.=' '.$morehtmlref;
+ }
+
if ($morehtml) {
$ret.='
'.$morehtml;
}
diff --git a/htdocs/includes/modules/modNotification.class.php b/htdocs/includes/modules/modNotification.class.php
index 1370724f2e3..9822dd208f9 100644
--- a/htdocs/includes/modules/modNotification.class.php
+++ b/htdocs/includes/modules/modNotification.class.php
@@ -15,13 +15,12 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Id$
*/
/**
\defgroup notification Module notification
\brief Module pour g�rer les notifications (par mail ou autre)
+ \version $Id$
*/
/**
diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang
index 1029f268f0b..cea31119d2e 100644
--- a/htdocs/langs/en_US/banks.lang
+++ b/htdocs/langs/en_US/banks.lang
@@ -43,6 +43,7 @@ IOMonthlyReporting=Monthly reporting
BankAccountDomiciliation=Account address
BankAccountOwner=Account owner name
BankAccountOwnerAddress=Account owner address
+RIBControlError=Control of key says informations for this account number are not complete or wrong.
CreateAccount=Create account
StandingOrderToProcess=To process
StandingOrderProcessed=Processed
diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang
index ef5e38e2563..7b9a2afe7ea 100755
--- a/htdocs/langs/en_US/withdrawals.lang
+++ b/htdocs/langs/en_US/withdrawals.lang
@@ -16,11 +16,18 @@ RequestStandingOrderToTreat=Request for standing orders to treat
RequestStandingOrderTreated=Request for standing orders treated
CustomersStandingOrders=Customer standing orders
CustomerStandingOrder=Customer standing order
-NbOfInvoiceToWithdraw=Nb of invoice to withdraw
+NbOfInvoiceToWithdraw=Nb of invoice with withdraw request
+InvoiceWaitingWithdraw=Invoice waiting for withdraw
AmountToWithdraw=Amount to withdraw
WithdrawsRefused=Withdraws refused
-NoInvoiceToWithdraw=No invoice in payment mode "withdraw" is waiting
+NoInvoiceToWithdraw=No customer invoice in payment mode "withdraw" is waiting. Go on 'Withdraw' tab on invoice card to make a request.
ResponsibleUser=Responsible user
WithdrawalsSetup=Withdrawal setup
WithdrawStatistics=Withdraws' statistics
WithdrawRejectStatistics=Withdraw rejects' statistics
+LastWithdrawalReceipt=Last %s withdrawing receipts
+MakeWithdrawRequest=Make a withdraw request
+ThirdPartyBankCode=Third party bank code
+ThirdPartyDeskCode=Third party desk code
+NoInvoiceCouldBeWithdrawed=No invoice withdrawed with success. Check that invoice are on companies with a valid RIB.
+ClassCredited=Classer crédité
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/banks.lang b/htdocs/langs/fr_FR/banks.lang
index 95083dd5261..926e19fa135 100644
--- a/htdocs/langs/fr_FR/banks.lang
+++ b/htdocs/langs/fr_FR/banks.lang
@@ -43,6 +43,7 @@ IOMonthlyReporting=Rapport mensuel E/S
BankAccountDomiciliation=Domiciliation du compte
BankAccountOwner=Nom du propriétaire du compte
BankAccountOwnerAddress=Adresse du propriétaire du compte
+RIBControlError=Le contrôle de la clé indique que les informations de ce compte bancaire sont incomplètes ou incorrectes.
CreateAccount=Créer compte
StandingOrderToProcess=À traiter
StandingOrderProcessed=Traités
diff --git a/htdocs/langs/fr_FR/withdrawals.lang b/htdocs/langs/fr_FR/withdrawals.lang
index f9a8af6201b..a4b12aea10c 100755
--- a/htdocs/langs/fr_FR/withdrawals.lang
+++ b/htdocs/langs/fr_FR/withdrawals.lang
@@ -16,11 +16,18 @@ RequestStandingOrderToTreat=Demandes de pr
RequestStandingOrderTreated=Demandes de prélèvements traitées
CustomersStandingOrders=Prélèvements clients
CustomerStandingOrder=Prélèvement client
-NbOfInvoiceToWithdraw=Nb de facture à prélever
+NbOfInvoiceToWithdraw=Nb de facture en attente de prélevement
+InvoiceWaitingWithdraw=Factures en attente de prélèvement
AmountToWithdraw=Somme à prélever
WithdrawsRefused=Prélèvements rejetés
-NoInvoiceToWithdraw=Aucune facture en mode de paiement 'Prélevement' n'a de demande de prélèvements en attente
+NoInvoiceToWithdraw=Aucune facture client en mode de paiement 'Prélevement' n'a de demande de prélèvements en attente. Aller sur l'onglet 'Prélèvement' de la fiche facture pour faire une demande.
ResponsibleUser=Utilisateur responsable des prélèvements
WithdrawalsSetup=Configuration des prélèvements
WithdrawStatistics=Statistiques des prélèvements
WithdrawRejectStatistics=Statistiques des rejets de prélèvements
+LastWithdrawalReceipt=Les %s derniers bons de prélèvements
+MakeWithdrawRequest=Faire une demande de prélèvement
+ThirdPartyBankCode=Code banque du tiers
+ThirdPartyDeskCode=Code guichet du tiers
+NoInvoiceCouldBeWithdrawed=Aucune facture prélevable, prélevé avec succès. Vérifiez que les factures sont sur des sociétés dont le RIB est correctement renseigné.
+ClassCredited=Classer crédité
\ No newline at end of file
diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php
index 787901152b2..b0f9aec24fd 100644
--- a/htdocs/societe/rib.php
+++ b/htdocs/societe/rib.php
@@ -101,7 +101,7 @@ if ($_GET["socid"] && $_GET["action"] != 'edit')
{
if (!$account->verif())
{
- print '
Le contrôle de la clé indique que les informations de ce compte bancaire sont incomplètes ou incorrectes.