From 9f14ee8846552ba30e0307eaa0a92bcd623ff055 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 21 Jul 2013 10:08:58 +0200 Subject: [PATCH 01/25] Update remisecheque.class.php add change number of remisecheque feature with the real number of the bank --- .../cheque/class/remisecheque.class.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 2d5eaebf8e9..02f1d89167a 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -721,6 +721,40 @@ class RemiseCheque extends CommonObject } } + /** + * Set the number of bordereau + * + * @param User $user Object user + * @param timestamp $number number of bordereau + * @return int <0 if KO, >0 if OK + */ + function set_number($user, $number) + { + if ($user->rights->banque->cheque) + { + $sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque"; + $sql.= " SET number = '".$number."'" ; + $sql.= " WHERE rowid = ".$this->id; + + dol_syslog("RemiseCheque::set_number sql=$sql",LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $this->date_bordereau = $date; + return 1; + } + else + { + $this->error=$this->db->error(); + dol_syslog("RemiseCheque::set_number ".$this->error,LOG_ERR); + return -1; + } + } + else + { + return -2; + } + } /** * Renvoie nom clicable (avec eventuellement le picto) From 0a1f483fd116b947aabffc0c8a65114bb6578e92 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 21 Jul 2013 10:10:49 +0200 Subject: [PATCH 02/25] Update fiche.php Add feature to change refnumber of bank bordereau --- htdocs/compta/paiement/cheque/fiche.php | 45 ++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index 7cf5d15f3a2..fa3386449a2 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -89,6 +89,25 @@ if ($action == 'setdate' && $user->rights->banque->cheque) } } +if ($action == 'setref' && $user->rights->banque->cheque) +{ + $result = $object->fetch(GETPOST('id','int')); + if ($result > 0) + { + $number=GETPOST('number'); + + $result=$object->set_number($user,$number); + if ($result < 0) + { + $mesg='
'.$object->error.'
'; + } + } + else + { + $mesg='
'.$object->error.'
'; + } +} + if ($action == 'create' && $_POST["accountid"] > 0 && $user->rights->banque->cheque) { if (is_array($_POST['toRemise'])) @@ -460,12 +479,30 @@ else $accountstatic->label=$object->account_label; print ''; - print '"; - print "\n"; + print ''; + print ''; print '\n"; // Payment type - print "'; + print ''; print ''; } else @@ -936,7 +936,7 @@ else if (! empty($conf->mailing->enabled)) { $langs->load("mails"); - print ''; + print ''; print ''; } else diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 78d59e4c93d..2fd9c09c534 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -119,6 +119,7 @@ TargetsReset=Clear list ToClearAllRecipientsClickHere=Click here to clear the recipient list for this emailing ToAddRecipientsChooseHere=Add recipients by choosing from the lists NbOfEMailingsReceived=Mass emailings received +NbOfEMailingsSend=Mass emailings sent IdRecord=ID record DeliveryReceipt=Delivery Receipt YouCanUseCommaSeparatorForSeveralRecipients=You can use the comma separator to specify several recipients. diff --git a/htdocs/langs/fr_FR/mails.lang b/htdocs/langs/fr_FR/mails.lang index 80f159ffa26..2fad3fb790e 100644 --- a/htdocs/langs/fr_FR/mails.lang +++ b/htdocs/langs/fr_FR/mails.lang @@ -121,6 +121,7 @@ TargetsReset=Vider liste ToClearAllRecipientsClickHere=Pour vider la liste des destinataires de cet emailing, cliquez sur le bouton ToAddRecipientsChooseHere=Pour ajouter des destinataires, choisir dans les listes ci-dessous NbOfEMailingsReceived=Emailings de masse reçus +NbOfEMailingsSend=Emailings de masse envoyé(s) IdRecord=ID enregistrement DeliveryReceipt=Accusé de réception YouCanUseCommaSeparatorForSeveralRecipients=Vous pouvez utiliser le caractère de séparation virgule pour spécifier plusieurs destinataires. From b283ed73d1c7bede87e88e13b4c5dc8ae11bb210 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Tue, 29 Apr 2014 11:53:04 +0200 Subject: [PATCH 10/25] Update modFacture.class.php add export extrafields feature --- htdocs/core/modules/modFacture.class.php | 76 ++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 6b243b4d22e..1b252d08d32 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -179,12 +179,46 @@ class modFacture extends DolibarrModules $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them - + // Add extra fields + $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture'"; + $resql=$this->db->query($sql); + if ($resql) // This can fail when class is used on old database (during migration for example) + { + while ($obj=$this->db->fetch_object($resql)) + { + $fieldname='extra.'.$obj->name; + $fieldlabel=ucfirst($obj->label); + $typeFilter="Text"; + switch($obj->type) + { + case 'int': + case 'double': + case 'price': + $typeFilter="Numeric"; + break; + case 'date': + case 'datetime': + $typeFilter="Date"; + break; + case 'boolean': + $typeFilter="Boolean"; + break; + case 'sellist': + $typeFilter="List:".$obj->param; + break; + } + $this->export_fields_array[$r][$fieldname]=$fieldlabel; + $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; + $this->export_entities_array[$r][$fieldname]='facture'; + } + } + // End add axtra fields $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c on s.fk_pays = c.rowid,'; - $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f,'; - $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facturedet as fd'; + $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_extrafields as extra ON f.rowid = extra.fk_object'; + $this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'facturedet as fd'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture'; $this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; @@ -199,11 +233,45 @@ class modFacture extends DolibarrModules $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment'); $this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them - + // Add extra fields + $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture'"; + $resql=$this->db->query($sql); + if ($resql) // This can fail when class is used on old database (during migration for example) + { + while ($obj=$this->db->fetch_object($resql)) + { + $fieldname='extra.'.$obj->name; + $fieldlabel=ucfirst($obj->label); + $typeFilter="Text"; + switch($obj->type) + { + case 'int': + case 'double': + case 'price': + $typeFilter="Numeric"; + break; + case 'date': + case 'datetime': + $typeFilter="Date"; + break; + case 'boolean': + $typeFilter="Boolean"; + break; + case 'sellist': + $typeFilter="List:".$obj->param; + break; + } + $this->export_fields_array[$r][$fieldname]=$fieldlabel; + $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; + $this->export_entities_array[$r][$fieldname]='facture'; + } + } + // End add axtra fields $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_extrafields as extra ON f.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement as p ON pf.fk_paiement = p.rowid'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid'; From 468f6fd5fbbfa799283f67ed02578dd60678a082 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Tue, 29 Apr 2014 11:57:51 +0200 Subject: [PATCH 11/25] Update modFournisseur.class.php Add extrafields export feature on bill --- htdocs/core/modules/modFournisseur.class.php | 75 +++++++++++++++++++- 1 file changed, 72 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 71f4ebfd542..f645def48ab 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -261,11 +261,46 @@ class modFournisseur extends DolibarrModules $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Text",'fd.qty'=>"Number",'fd.total_ht'=>"Number",'fd.total_ttc'=>"Number",'fd.tva'=>"Number",'fd.product_type'=>'Boolean','fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.remise_percent'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them - + // Add extra fields + $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn'"; + $resql=$this->db->query($sql); + if ($resql) // This can fail when class is used on old database (during migration for example) + { + while ($obj=$this->db->fetch_object($resql)) + { + $fieldname='extra.'.$obj->name; + $fieldlabel=ucfirst($obj->label); + $typeFilter="Text"; + switch($obj->type) + { + case 'int': + case 'double': + case 'price': + $typeFilter="Numeric"; + break; + case 'date': + case 'datetime': + $typeFilter="Date"; + break; + case 'boolean': + $typeFilter="Boolean"; + break; + case 'sellist': + $typeFilter="List:".$obj->param; + break; + } + $this->export_fields_array[$r][$fieldname]=$fieldlabel; + $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; + $this->export_entities_array[$r][$fieldname]='facture_fourn'; + } + } + // End add axtra fields $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c ON s.fk_pays = c.rowid,'; - $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f, '.MAIN_DB_PREFIX.'facture_fourn_det as fd'; + $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_extrafields as extra ON f.rowid = extra.fk_object'; + $this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'facture_fourn_det as fd'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture_fourn'; $this->export_sql_end[$r] .=' AND f.entity = '.$conf->entity; @@ -280,11 +315,45 @@ class modFournisseur extends DolibarrModules $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment'); $this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them - + // Add extra fields + $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn'"; + $resql=$this->db->query($sql); + if ($resql) // This can fail when class is used on old database (during migration for example) + { + while ($obj=$this->db->fetch_object($resql)) + { + $fieldname='extra.'.$obj->name; + $fieldlabel=ucfirst($obj->label); + $typeFilter="Text"; + switch($obj->type) + { + case 'int': + case 'double': + case 'price': + $typeFilter="Numeric"; + break; + case 'date': + case 'datetime': + $typeFilter="Date"; + break; + case 'boolean': + $typeFilter="Boolean"; + break; + case 'sellist': + $typeFilter="List:".$obj->param; + break; + } + $this->export_fields_array[$r][$fieldname]=$fieldlabel; + $this->export_TypeFields_array[$r][$fieldname]=$typeFilter; + $this->export_entities_array[$r][$fieldname]='facture_fourn'; + } + } + // End add axtra fields $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c ON s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_extrafields as extra ON f.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn as p ON pf.fk_paiementfourn = p.rowid'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid'; From eb926103e02e168a0d4a85ae164947bd8fafd189 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Wed, 30 Apr 2014 06:37:47 +0200 Subject: [PATCH 12/25] TVA : Add type_payment & num_payment who are missing --- htdocs/compta/tva/class/tva.class.php | 48 +++++++++++++----- htdocs/compta/tva/fiche.php | 72 ++++++++++++++++++--------- htdocs/compta/tva/reglement.php | 21 +++++--- 3 files changed, 98 insertions(+), 43 deletions(-) diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index ef75e8746d1..711ccc62f1f 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2011-2014 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,6 +42,8 @@ class Tva extends CommonObject var $datep; var $datev; var $amount; + var $type_payment; + var $num_payment; var $label; var $note; var $fk_bank; @@ -215,6 +218,8 @@ class Tva extends CommonObject $sql.= " t.datep,"; $sql.= " t.datev,"; $sql.= " t.amount,"; + $sql.= " t.fk_typepayment,"; + $sql.= " t.num_payment,"; $sql.= " t.label,"; $sql.= " t.note,"; $sql.= " t.fk_bank,"; @@ -242,6 +247,8 @@ class Tva extends CommonObject $this->datep = $this->db->jdate($obj->datep); $this->datev = $this->db->jdate($obj->datev); $this->amount = $obj->amount; + $this->type_payment = $obj->fk_typepayment; + $this->num_payment = $obj->num_payment; $this->label = $obj->label; $this->note = $obj->note; $this->fk_bank = $obj->fk_bank; @@ -479,7 +486,12 @@ class Tva extends CommonObject // Clean parameters $this->amount=price2num(trim($this->amount)); - + $this->label=trim($this->label); + $this->note=trim($this->note); + $this->fk_bank=trim($this->fk_bank); + $this->fk_user_creat=trim($this->fk_user_creat); + $this->fk_user_modif=trim($this->fk_user_modif); + // Check parameters if (! $this->label) { @@ -496,23 +508,35 @@ class Tva extends CommonObject $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Account")); return -5; } - if (! empty($conf->banque->enabled) && (empty($this->paymenttype) || $this->paymenttype <= 0)) + if (! empty($conf->banque->enabled) && (empty($this->type_payment) || $this->type_payment <= 0)) { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); return -5; } - // Insertion dans table des paiement tva - $sql = "INSERT INTO ".MAIN_DB_PREFIX."tva (datep, datev, amount"; - if ($this->note) $sql.=", note"; - if ($this->label) $sql.=", label"; - $sql.= ", fk_user_creat, fk_bank, entity"; + // Insertion dans la table d'un paiement tva + $sql = "INSERT INTO ".MAIN_DB_PREFIX."tva (datep"; + $sql.= ", datev"; + $sql.= ", amount"; + $sql.= ", fk_typepayment"; + $sql.= ", num_payment"; + if ($this->note) $sql.= ", note"; + if ($this->label) $sql.= ", label"; + $sql.= ", fk_user_creat"; + $sql.= ", fk_bank"; + $sql.= ", entity"; $sql.= ") "; - $sql.= " VALUES ('".$this->db->idate($this->datep)."',"; - $sql.= "'".$this->db->idate($this->datev)."'," . $this->amount; - if ($this->note) $sql.=", '".$this->db->escape($this->note)."'"; + $sql.= " VALUES ("; + $sql.= "'".$this->db->idate($this->datep)."'"; + $sql.= ", '".$this->db->idate($this->datev)."'"; + $sql.= ", ".$this->amount; + $sql.= ", '".$this->type_payment."'"; + $sql.= ", '".$this->num_payment."'"; + if ($this->note) $sql.=", '".$this->db->escape($this->note)."'"; if ($this->label) $sql.=", '".$this->db->escape($this->label)."'"; - $sql.=", '".$user->id."', NULL, ".$conf->entity; + $sql.= ", '".$user->id."'"; + $sql.= ", NULL"; + $sql.= ", ".$conf->entity; $sql.= ")"; dol_syslog(get_class($this)."::addPayment sql=".$sql); @@ -540,7 +564,7 @@ class Tva extends CommonObject $result=$acc->fetch($this->accountid); if ($result <= 0) dol_print_error($this->db); - $bank_line_id = $acc->addline($this->datep, $this->paymenttype, $this->label, -abs($this->amount), '', '', $user); + $bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, -abs($this->amount), '', '', $user); // Update fk_bank into llx_tva. So we know vat line used to generate bank transaction if ($bank_line_id > 0) diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index a0d181e8f81..d4accc5134d 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -58,31 +58,51 @@ if ($_POST["cancel"] == $langs->trans("Cancel")) if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) { - $db->begin(); + $error=0; - $datev=dol_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]); + $datev=dol_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]); $datep=dol_mktime(12,0,0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]); - $tva->accountid=$_POST["accountid"]; - $tva->paymenttype=$_POST["paiementtype"]; + $tva->accountid=GETPOST("accountid"); + $tva->type_payment=GETPOST("type_payment"); + $tva->num_payment=GETPOST("num_payment"); $tva->datev=$datev; $tva->datep=$datep; - $tva->amount=$_POST["amount"]; - $tva->label=$_POST["label"]; + $tva->amount=GETPOST("amount"); + $tva->label=GETPOST("label"); + $tva->note=GETPOST("note"); + + if (empty($tva->type_payment) || $tva->type_payment < 0) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentMode")),'errors'); + $error++; + } + if (empty($tva->amount)) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount")),'errors'); + $error++; + } - $ret=$tva->addPayment($user); - if ($ret > 0) - { - $db->commit(); - header("Location: reglement.php"); - exit; - } - else - { - $db->rollback(); - setEventMessage($tva->error, 'errors'); - $action="create"; - } + if (! $error) + { + $db->begin(); + + $ret=$tva->addPayment($user); + if ($ret > 0) + { + $db->commit(); + header("Location: reglement.php"); + exit; + } + else + { + $db->rollback(); + setEventMessage($tva->error, 'errors'); + $action="create"; + } + } + + $action='create'; } if ($action == 'delete') @@ -180,10 +200,16 @@ if ($action == 'create') $form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant print ''; - print '\n"; - print ""; + // Type payment + print '\n"; + print ""; + + // Number + print ''."\n"; } // Other attributes diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index ea9f7ea445d..a35c03076cb 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2003 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2011-2014 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,7 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; $langs->load("compta"); -$langs->load("compta"); +$langs->load("bills"); // Security check $socid = isset($_GET["socid"])?$_GET["socid"]:''; @@ -46,9 +47,10 @@ $tva_static = new Tva($db); print_fiche_titre($langs->trans("VATPayments")); -$sql = "SELECT rowid, amount, label, f.datev as dm"; -$sql.= " FROM ".MAIN_DB_PREFIX."tva as f "; -$sql.= " WHERE f.entity = ".$conf->entity; +$sql = "SELECT t.rowid, t.amount, t.label, t.datev as dm, t.num_payment, pst.code as payment_code"; +$sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON t.fk_typepayment = pst.id"; +$sql.= " WHERE t.entity = ".$conf->entity; $sql.= " ORDER BY dm DESC"; $result = $db->query($sql); @@ -63,7 +65,8 @@ if ($result) print ''; print ""; print ''; - print ""; + print ''; + print ""; print "\n"; $var=1; while ($i < $num) @@ -77,14 +80,16 @@ if ($result) print "\n"; print "\n"; print '\n"; + // Type + print ''; + // Amount $total = $total + $obj->amount; - - print ""; + print ""; print "\n"; $i++; } - print ''; + print ''; print ""; print "
'.$langs->trans('Ref').''; + print '
'; - print $form->showrefnav($object,'ref',$linkback, 1, 'number'); + print ''; + if ($action != 'editref') print ''; + print '
'; + print $langs->trans('Ref'); + print 'id.'">'.img_edit($langs->trans('SetRef'),1).'
'; + print '
'; + if ($action == 'editref') + { + print '
'; + print ''; + print ''; + print ''; + print ''; + print '
'; + } + else + { + print $form->showrefnav($object,'ref',$linkback, 1, 'number'); + } - print "
'; From 9ff3dc61896fd289bf1fab43266ba6d49d0b0516 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Mon, 28 Apr 2014 04:43:17 +0200 Subject: [PATCH 03/25] Fix :: MySql Problem when create a salary payment --- .../salaries/class/paymentsalary.class.php | 31 +++++++++++-------- htdocs/compta/salaries/fiche.php | 3 +- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 87e23e02deb..50e12bf4f72 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -277,18 +277,23 @@ class PaymentSalary extends CommonObject $this->fk_user_modif=''; } - /** - * Ajoute un paiement de salaire - * - * @param User $user Object user that insert - * @return int <0 if KO, rowid in tva table if OK - */ + /** + * Create in database + * + * @param User $user User that create + * @return int <0 if KO, >0 if OK + */ function create($user) { global $conf,$langs; // Clean parameters $this->amount=price2num(trim($this->amount)); + $this->label=trim($this->label); + $this->note=trim($this->note); + $this->fk_bank=trim($this->fk_bank); + $this->fk_user_creat=trim($this->fk_user_creat); + $this->fk_user_modif=trim($this->fk_user_modif); // Check parameters if (! $this->label) @@ -314,20 +319,20 @@ class PaymentSalary extends CommonObject if (! empty($conf->banque->enabled) && (empty($this->type_payment) || $this->type_payment <= 0)) { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); - return -6; + return -7; } $this->db->begin(); - // Insertion dans table des paiement salaires + // Insertion dans la table d'un paiement salaire $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_salary (fk_user"; $sql.= ", datep"; $sql.= ", datev"; $sql.= ", amount"; $sql.= ", fk_typepayment"; $sql.= ", num_payment"; - $sql.=", note"; - $sql.=", label"; + $sql.= ", note"; + $sql.= ", label"; $sql.= ", datesp"; $sql.= ", dateep"; $sql.= ", fk_user_creat"; @@ -338,9 +343,9 @@ class PaymentSalary extends CommonObject $sql.= "'".$this->fk_user."'"; $sql.= ", '".$this->db->idate($this->datep)."'"; $sql.= ", '".$this->db->idate($this->datev)."'"; - $sql.= ", ".$this->amount; - $sql.= ", ".$this->type_payment; - $sql.= ", ".$this->num_payment; + $sql.= ", '".$this->amount."'"; + $sql.= ", '".$this->type_payment."'"; + $sql.= ", '".$this->num_payment."'"; $sql.= ", '".$this->db->escape($this->note)."'"; $sql.= ", '".$this->db->escape($this->label)."'"; $sql.= ", '".$this->db->idate($this->datesp)."'"; diff --git a/htdocs/compta/salaries/fiche.php b/htdocs/compta/salaries/fiche.php index 5febffa2b7b..d6ffab1012b 100644 --- a/htdocs/compta/salaries/fiche.php +++ b/htdocs/compta/salaries/fiche.php @@ -75,8 +75,9 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) $sal->label=GETPOST("label"); $sal->datesp=$datesp; $sal->dateep=$dateep; + $sal->note=GETPOST("note"); $sal->type_payment=GETPOST("paymenttype"); - $sal->num_payment=GETPOST('num_payment'); + $sal->num_payment=GETPOST("num_payment"); if (empty($sal->fk_user) || $sal->fk_user < 0) { From 73eec6b872321715cab4f0b718169c876f0cfe4a Mon Sep 17 00:00:00 2001 From: aspangaro Date: Mon, 28 Apr 2014 04:53:39 +0200 Subject: [PATCH 04/25] Fix :: Key language "Thirdparty" not traduced when module thirdparty is deactivated --- htdocs/compta/bank/account.php | 1 + htdocs/compta/bank/search.php | 1 + htdocs/compta/bank/treso.php | 1 + 3 files changed, 3 insertions(+) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index eb11498a505..048ed73075b 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -43,6 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("banks"); $langs->load("categories"); $langs->load("bills"); +$langs->load("companies"); $id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int')); $ref = GETPOST('ref','alpha'); diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index 20b5247ffd7..615c3ac868a 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; $langs->load("banks"); $langs->load("categories"); +$langs->load("companies"); // Security check if ($user->societe_id) $socid=$user->societe_id; diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index ffbf6be1ce9..58876f81ab6 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("banks"); $langs->load("categories"); $langs->load("bills"); +$langs->load("companies"); // Security check if (isset($_GET["account"]) || isset($_GET["ref"])) From bab54f82649e8755556f2c7e9e48088d3726d061 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Mon, 28 Apr 2014 06:41:27 +0200 Subject: [PATCH 05/25] Type bank & tva --- htdocs/compta/bank/account.php | 13 +++++++------ htdocs/compta/bank/search.php | 2 +- htdocs/compta/tva/class/tva.class.php | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 048ed73075b..5c2d6812302 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -465,10 +465,11 @@ if ($id > 0 || ! empty($ref)) if ($mode_search && ! empty($conf->tax->enabled)) { // VAT - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu2 ON bu2.fk_bank = b.rowid AND bu2.type='payment_vat'"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu2 ON bu2.fk_bank = b.rowid AND bu2.type='payment_vat'"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."tva as t ON bu2.url_id = t.rowid"; - // Salary payment - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='payment_salary'"; + + // Salary payment + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='payment_salary'"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."payment_salary as sal ON bu3.url_id = sal.rowid"; } if ($mode_search && ! empty($conf->adherent->enabled)) @@ -587,7 +588,7 @@ if ($id > 0 || ! empty($ref)) $paymentvatstatic->ref=$links[$key]['url_id']; print ' '.$paymentvatstatic->getNomUrl(2); } - elseif ($links[$key]['type']=='payment_salary') + elseif ($links[$key]['type']=='payment_salary') { $paymentsalstatic->id=$links[$key]['url_id']; $paymentsalstatic->ref=$links[$key]['url_id']; @@ -628,7 +629,7 @@ if ($id > 0 || ! empty($ref)) { } - elseif ($links[$key]['type']=='user') + elseif ($links[$key]['type']=='user') { } @@ -670,7 +671,7 @@ if ($id > 0 || ! empty($ref)) $societestatic->nom=$links[$key]['label']; print $societestatic->getNomUrl(1,'',16); } - else if ($links[$key]['type']=='user') + else if ($links[$key]['type']=='user') { $userstatic->id=$links[$key]['url_id']; $userstatic->lastname=$links[$key]['label']; diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index 615c3ac868a..735a78319ab 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -252,7 +252,7 @@ if ($resql) print ''.dol_print_date($db->jdate($objp->dv),"day").""; + print ''; $labeltype=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$langs->getLabelFromKey($db,$objp->fk_type,'c_paiement','code','libelle'); if ($labeltype == 'SOLD') print ' '; //$langs->trans("InitialBankBalance"); else print $labeltype; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index d9ba93188bd..ef75e8746d1 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -323,7 +323,7 @@ class Tva extends CommonObject /** - * Hum la fonction s'appelle 'Solde' elle doit a mon avis calcluer le solde de TVA, non ? + * Hum la fonction s'appelle 'Solde' elle doit a mon avis calculer le solde de TVA, non ? * * @param int $year Year * @return double Amount @@ -589,7 +589,7 @@ class Tva extends CommonObject } /** - * Mise a jour du lien entre le paiement tva et la ligne g�n�r�e dans llx_bank + * Mise a jour du lien entre le paiement tva et la ligne generee dans llx_bank * * @param int $id_bank Id compte bancaire * @return int <0 if KO, >0 if OK From dddbc37d35ecae2f2fcb63082d2c4e254aa4714d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 28 Apr 2014 17:18:11 +0200 Subject: [PATCH 06/25] Enable option clone target emailing --- ChangeLog | 1 + htdocs/comm/mailing/class/mailing.class.php | 51 ++++++++++++++++++- htdocs/comm/mailing/fiche.php | 2 +- .../modules/mailings/modules_mailings.php | 2 +- 4 files changed, 52 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2aa466a76dd..ad210c55c0f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -46,6 +46,7 @@ For users: - Fix: Project Task numbering customs rule works. - Fix: Add actions events not implemented. - New: Add filter date in bank writing list page +- New: Enable option "clone target emailing" TODO - New: Predefined product and free product use same form. diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index a0094c2f3f6..a6db4738bb5 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -305,8 +305,55 @@ class Mailing extends CommonObject if (! $error) { - - + //Clone target + if (!empty($option2)) { + + require_once DOL_DOCUMENT_ROOT .'/core/modules/mailings/modules_mailings.php'; + + $mailing_target = new MailingTargets($this->db); + + $target_array=array(); + + $sql = "SELECT fk_contact, "; + $sql.=" lastname, "; + $sql.=" firstname,"; + $sql.=" email,"; + $sql.=" other,"; + $sql.=" source_url,"; + $sql.=" source_id ,"; + $sql.=" source_type "; + $sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles "; + $sql.= " WHERE fk_mailing = ".$fromid; + + dol_syslog(get_class($this)."::createFromClone sql=".$sql); + $result=$this->db->query($sql); + if ($result) + { + if ($this->db->num_rows($result)) + { + while ($obj = $this->db->fetch_object($result)) { + + $target_array[]=array('fk_contact'=>$obj->fk_contact, + 'lastname'=>$obj->lastname, + 'firstname'=>$obj->firstname, + 'email'=>$obj->email, + 'other'=>$obj->other, + 'source_url'=>$obj->source_url, + 'source_id'=>$obj->source_id, + 'source_type'=>$obj->source_type); + } + + } + } + else + { + $this->error=$this->db->lasterror(); + dol_syslog("Mailing::createFromClone ".$this->error, LOG_ERR); + return -1; + } + + $mailing_target->add_to_target($object->id, $target_array); + } } diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 03caf79d9d5..9d6a31cdfac 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -822,7 +822,7 @@ else $formquestion=array( 'text' => $langs->trans("ConfirmClone"), array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContent"), 'value' => 1), - array('type' => 'checkbox', 'name' => 'clone_receivers', 'label' => $langs->trans("CloneReceivers").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true) + array('type' => 'checkbox', 'name' => 'clone_receivers', 'label' => $langs->trans("CloneReceivers"), 'value' => 0) ); // Paiement incomplet. On demande si motif = escompte ou autre print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneEMailing'),$langs->trans('ConfirmCloneEMailing',$object->ref),'confirm_clone',$formquestion,'yes',2,240); diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index 4f0599bfb3b..6f4a573ccfc 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -168,7 +168,7 @@ class MailingTargets // This can't be abstract as it is used for some method $sql.= "'".$this->db->escape($targetarray['other'])."',"; $sql.= "'".$this->db->escape($targetarray['source_url'])."',"; $sql.= (empty($targetarray['source_id']) ? 'null' : "'".$this->db->escape($targetarray['source_id'])."'").","; - $sql .= "'".$this->db->escape(dol_hash($targetarray['email'].';'.$targetarray['name'].';'.$mailing_id.';'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY))."',"; + $sql .= "'".$this->db->escape(dol_hash($targetarray['email'].';'.$targetarray['lastname'].';'.$mailing_id.';'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY))."',"; $sql .= "'".$this->db->escape($targetarray['source_type'])."')"; $result=$this->db->query($sql); if ($result) From 79fabb05b56361e84642fec82175087b84e00621 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 28 Apr 2014 17:23:13 +0200 Subject: [PATCH 07/25] changelog --- ChangeLog | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 892acc629a4..065e8c8127d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -58,7 +58,6 @@ TODO - New: Predefined product and free product use same form. - New: [ task #926 ] Add extrafield feature on order lines. - New: [ task #927 ] Add extrafield feature on Proposal lines. -- New: [ task #928 ] Add extrafield feature on invoice lines. For translators: - Update language files. @@ -76,6 +75,9 @@ For developers: - New: Normalize code for barcode generation to match other modules. - New: Uniformize code for contacts forms. - New: Add some hooks for financial reports. +- New: A module can add its own ECM view. +- New: A module can disable a standard ECM view. +- New: Add multilang support into product webservice. WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: @@ -94,6 +96,10 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. +Fix: [ bug #1351 ] VIES verification link broken. +Fix: [ bug #1352 ] Removing a shipping does not remove the delivery. +Fix: Option MAIN_INVERT_SENDER_RECIPIENT broken with typhon template. + ***** ChangeLog for 3.5.2 compared to 3.5.1 ***** Fix: Can't add user for a task. From 91505fdebe72083254ecb497f9e1d59e0e3b17fc Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 28 Apr 2014 17:24:14 +0200 Subject: [PATCH 08/25] changelog --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 065e8c8127d..030a0f68c4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -58,6 +58,7 @@ TODO - New: Predefined product and free product use same form. - New: [ task #926 ] Add extrafield feature on order lines. - New: [ task #927 ] Add extrafield feature on Proposal lines. +- New: [ task #928 ] Add extrafield feature on invoice lines. For translators: - Update language files. From 596be3ae44924b8fe1936795d1644b6d71fb2873 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 29 Apr 2014 09:43:16 +0200 Subject: [PATCH 09/25] Trad contact card --- htdocs/contact/fiche.php | 4 ++-- htdocs/langs/en_US/mails.lang | 1 + htdocs/langs/fr_FR/mails.lang | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 98874ba4804..08f3bb2c062 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -711,7 +711,7 @@ else if (! empty($conf->mailing->enabled)) { $langs->load("mails"); - print ''.$langs->trans("NbOfEMailingsReceived").''.$langs->trans("NbOfEMailingsSend").''.$object->getNbOfEMailings().''.$langs->trans("NbOfEMailingsReceived").''.$langs->trans("NbOfEMailingsSend").''.$object->getNbOfEMailings().'
'.$langs->trans("PaymentMode").''; - $form->select_types_paiements($_POST["paiementtype"], "paiementtype"); - print "
'.$langs->trans("PaymentMode").''; + $form->select_types_paiements(GETPOST("type_payment"), "type_payment"); + print "
'.$langs->trans('Numero'); + print ' ('.$langs->trans("ChequeOrTransferNumber").')'; + print '
'.$langs->trans("Ref").'".$langs->trans("Label")."'.$langs->trans("DatePayment").'".$langs->trans("PayedByThisPayment")."'.$langs->trans("Type").'".$langs->trans("PayedByThisPayment")."
".$tva_static->getNomUrl(1)."".dol_trunc($obj->label,40)."'.dol_print_date($db->jdate($obj->dm),'day')."'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'".price($obj->amount)."".price($obj->amount)."
'.$langs->trans("Total").'
'.$langs->trans("Total").'".price($total)."
"; From 4caedaf3e5e6299348bbf3f64f06d5e5b441c3b2 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Wed, 30 Apr 2014 06:38:36 +0200 Subject: [PATCH 13/25] Salaries : typo & presentation --- .../salaries/class/paymentsalary.class.php | 4 +-- htdocs/compta/salaries/fiche.php | 25 +++++++++---------- htdocs/compta/salaries/index.php | 2 +- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 50e12bf4f72..54edd9ec45c 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -331,7 +331,7 @@ class PaymentSalary extends CommonObject $sql.= ", amount"; $sql.= ", fk_typepayment"; $sql.= ", num_payment"; - $sql.= ", note"; + if ($this->note) $sql.= ", note"; $sql.= ", label"; $sql.= ", datesp"; $sql.= ", dateep"; @@ -346,7 +346,7 @@ class PaymentSalary extends CommonObject $sql.= ", '".$this->amount."'"; $sql.= ", '".$this->type_payment."'"; $sql.= ", '".$this->num_payment."'"; - $sql.= ", '".$this->db->escape($this->note)."'"; + if ($this->note) $sql.= ", '".$this->db->escape($this->note)."'"; $sql.= ", '".$this->db->escape($this->label)."'"; $sql.= ", '".$this->db->idate($this->datesp)."'"; $sql.= ", '".$this->db->idate($this->dateep)."'"; diff --git a/htdocs/compta/salaries/fiche.php b/htdocs/compta/salaries/fiche.php index d6ffab1012b..1615c297214 100644 --- a/htdocs/compta/salaries/fiche.php +++ b/htdocs/compta/salaries/fiche.php @@ -244,20 +244,19 @@ if ($action == 'create') print ''.$langs->trans("Account").''; $form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant print ''; - + + // Type payment + print ''.$langs->trans("PaymentMode").''; + $form->select_types_paiements(GETPOST("paymenttype"), "paymenttype"); + print "\n"; + print ""; + + // Number + print ''.$langs->trans('Numero'); + print ' ('.$langs->trans("ChequeOrTransferNumber").')'; + print ''."\n"; } - - // TYpe payment - print ''.$langs->trans("PaymentMode").''; - $form->select_types_paiements(GETPOST("paymenttype"), "paymenttype"); - print "\n"; - print ""; - - // Number - print ''.$langs->trans('Numero'); - print ' ('.$langs->trans("ChequeOrTransferNumber").')'; - print ''."\n"; - + // Other attributes $parameters=array('colspan' => ' colspan="1"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index f32c1bad951..e6fcfab763c 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -69,7 +69,7 @@ if ($result) print "".$langs->trans("Person").""; print "".$langs->trans("Label").""; print ''.$langs->trans("DatePayment").''; - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle","",$paramlist,"",$sortfield,$sortorder); + print ''.$langs->trans("Type").''; print "".$langs->trans("PayedByThisPayment").""; print "\n"; $var=1; From d1392f7a5ffb9a1219ae03d1abd36884c1fa6ee1 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Wed, 30 Apr 2014 06:58:14 +0200 Subject: [PATCH 14/25] Changelog --- ChangeLog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c81af41cfa2..6d1017614d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -51,7 +51,9 @@ For users: - Fix: Add actions events not implemented. - Fix: Price min of composition is not supplier price min by quantity - Fix: [ bug #1356 ] Bank accountancy number is limited to 8 numbers -- New: Add categories translation +- New: Add categories translation +- New: Improved tax module: + Add specific page for salaries payment TODO - New: Predefined product and free product use same form. From 00cd616f4c970566e62c6f94d8bcd137eda6fdaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Ferry?= Date: Wed, 30 Apr 2014 10:36:23 +0200 Subject: [PATCH 15/25] Add informations about contacts of thirdparty into ODT --- .../core/class/commondocgenerator.class.php | 85 +++++++++++++++++-- .../societe/doc/doc_generic_odt.modules.php | 69 +++++++++++++++ 2 files changed, 148 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 1b290222a11..691ae054646 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -195,12 +195,85 @@ abstract class CommonDocGenerator { $object->array_options['options_'.$key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_'.$key]]; } - $array_thirdparty=array_merge($array_thirdparty,array('company_options_'.$key => $object->array_options['options_'.$key])); - } - } - return $array_thirdparty; - } - + $array_thirdparty = array_merge ( $array_thirdparty, array ( + 'company_options_' . $key => $object->array_options ['options_' . $key] + ) ); + } + } + return $array_thirdparty; + } + + /** + * Define array with couple subtitution key => subtitution value + * + * @param Object $object contact + * @param Translate $outputlangs object for output + * @param array_key $array_key Name of the key for return array + * @return array of substitution key->code + */ + function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object') { + global $conf; + + if(empty($object->country) && ! empty($object->country_code)) + { + $object->country = $outputlangs->transnoentitiesnoconv("Country" . $object->country_code); + } + if(empty($object->state) && ! empty($object->state_code)) + { + $object->state = getState($object->state_code, 0); + } + + $array_contact = array ( + $array_key . '_lastname' => $object->lastname, + $array_key . '_firstname' => $object->firstname, + $array_key . '_address' => $object->address, + $array_key . '_zip' => $object->zip, + $array_key . '_town' => $object->town, + $array_key . '_state_id' => $object->state_id, + $array_key . '_state_code' => $object->state_code, + $array_key . '_state' => $object->state, + $array_key . '_country_id' => $object->country_id, + $array_key . '_country_code' => $object->country_code, + $array_key . '_country' => $object->country, + $array_key . '_poste' => $object->poste, + $array_key . '_socid' => $object->socid, + $array_key . '_statut' => $object->statut, + $array_key . '_code' => $object->code, + $array_key . '_email' => $object->email, + $array_key . '_jabberid' => $object->jabberid, + $array_key . '_phone_pro' => $object->phone_pro, + $array_key . '_phone_perso' => $object->phone_perso, + $array_key . '_phone_mobile' => $object->phone_mobile, + $array_key . '_fax' => $object->fax, + $array_key . '_birthday' => $object->birthday, + $array_key . '_default_lang' => $object->default_lang, + $array_key . '_note_public' => $object->note_public, + $array_key . '_note_private' => $object->note_private + ); + + // Retrieve extrafields + if (is_array($object->array_options) && count($object->array_options)) { + require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; + $extrafields = new ExtraFields($this->db); + $extralabels = $extrafields->fetch_name_optionals_label('contact', true); + $object->fetch_optionals($object->id, $extralabels); + + foreach($extrafields->attribute_label as $key => $label) + { + if ($extrafields->attribute_type[$key] == 'price') + { + $object->array_options['options_' . $key] = price($object->array_options ['options_' . $key], 0, $outputlangs, 0, 0, - 1, $conf->currency); + } + elseif($extrafields->attribute_type[$key] == 'select') + { + $object->array_options['options_' . $key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_' . $key]]; + } + $array_contact = array_merge($array_contact, array('contact_options_' . $key => $object->array_options['options_'. $key])); + } + } + return $array_contact; + } + /** * Define array with couple subtitution key => subtitution value diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 563444a51a3..d83ca92d702 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -296,6 +296,75 @@ class doc_generic_odt extends ModeleThirdPartyDoc // Make substitutions into odt of thirdparty + external modules $tmparray=$this->get_substitutionarray_thirdparty($object,$outputlangs); complete_substitutions_array($tmparray, $outputlangs, $object); + + + // Replace tags of lines for contacts + + $contact_arrray=array(); + + $sql = "SELECT p.rowid"; + $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; + $sql .= " WHERE p.fk_soc = ".$object->id; + + + dol_syslog('doc_generic_odt :: sql='.$sql,LOG_DEBUG); + $result = $this->db->query($sql); + $num = $this->db->num_rows($result); + + $var=true; + if ($num) + { + $i=0; + + $contactstatic = new Contact($this->db); + + while ($i < $num) + { + $obj = $this->db->fetch_object($result); + + $contact_arrray[$i] = $obj->rowid; + //$contactstatic; + + + $i++; + } + } + if ((is_array($contact_arrray) && count($contact_arrray) > 0)) + { + try + { + $listlines = $odfHandler->setSegment('companycontacts'); + + foreach ($contact_arrray as $array_key => $contact_id) + { + $res_contact = $contactstatic->fetch($contact_id); + //$contact['fullname']=$objectdetail->getFullName($outputlangs,1); + $tmparray=$this->get_substitutionarray_contact($contactstatic,$outputlangs,'contact'); + foreach($tmparray as $key => $val) + { + try + { + $listlines->setVars($key, $val, true, 'UTF-8'); + } + catch(OdfException $e) + { + } + catch(SegmentException $e) + { + } + } + $listlines->merge(); + } + $odfHandler->mergeSegment($listlines); + } + catch(OdfException $e) + { + $this->error=$e->getMessage(); + dol_syslog($this->error, LOG_WARNING); + //return -1; + } + } + // Call the ODTSubstitution hook $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray); $reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks From fd45bb16bdc50879f1efd72844877751806916ed Mon Sep 17 00:00:00 2001 From: jfefe Date: Wed, 30 Apr 2014 19:18:51 +0200 Subject: [PATCH 16/25] Fix : make ODT substitution for company after contacts --- .../core/class/commondocgenerator.class.php | 51 ++++++++++--------- .../societe/doc/doc_generic_odt.modules.php | 22 ++++---- 2 files changed, 35 insertions(+), 38 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 691ae054646..702c2d93014 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -224,31 +224,32 @@ abstract class CommonDocGenerator } $array_contact = array ( - $array_key . '_lastname' => $object->lastname, - $array_key . '_firstname' => $object->firstname, - $array_key . '_address' => $object->address, - $array_key . '_zip' => $object->zip, - $array_key . '_town' => $object->town, - $array_key . '_state_id' => $object->state_id, - $array_key . '_state_code' => $object->state_code, - $array_key . '_state' => $object->state, - $array_key . '_country_id' => $object->country_id, - $array_key . '_country_code' => $object->country_code, - $array_key . '_country' => $object->country, - $array_key . '_poste' => $object->poste, - $array_key . '_socid' => $object->socid, - $array_key . '_statut' => $object->statut, - $array_key . '_code' => $object->code, - $array_key . '_email' => $object->email, - $array_key . '_jabberid' => $object->jabberid, - $array_key . '_phone_pro' => $object->phone_pro, - $array_key . '_phone_perso' => $object->phone_perso, - $array_key . '_phone_mobile' => $object->phone_mobile, - $array_key . '_fax' => $object->fax, - $array_key . '_birthday' => $object->birthday, - $array_key . '_default_lang' => $object->default_lang, - $array_key . '_note_public' => $object->note_public, - $array_key . '_note_private' => $object->note_private + $array_key . '_fullname' => $object->getFullName($outputlangs, 1), + $array_key . '_lastname' => $object->lastname, + $array_key . '_firstname' => $object->firstname, + $array_key . '_address' => $object->address, + $array_key . '_zip' => $object->zip, + $array_key . '_town' => $object->town, + $array_key . '_state_id' => $object->state_id, + $array_key . '_state_code' => $object->state_code, + $array_key . '_state' => $object->state, + $array_key . '_country_id' => $object->country_id, + $array_key . '_country_code' => $object->country_code, + $array_key . '_country' => $object->country, + $array_key . '_poste' => $object->poste, + $array_key . '_socid' => $object->socid, + $array_key . '_statut' => $object->statut, + $array_key . '_code' => $object->code, + $array_key . '_email' => $object->email, + $array_key . '_jabberid' => $object->jabberid, + $array_key . '_phone_pro' => $object->phone_pro, + $array_key . '_phone_perso' => $object->phone_perso, + $array_key . '_phone_mobile' => $object->phone_mobile, + $array_key . '_fax' => $object->fax, + $array_key . '_birthday' => $object->birthday, + $array_key . '_default_lang' => $object->default_lang, + $array_key . '_note_public' => $object->note_public, + $array_key . '_note_private' => $object->note_private ); // Retrieve extrafields diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index d83ca92d702..75b54ba285e 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -293,20 +293,15 @@ class doc_generic_odt extends ModeleThirdPartyDoc // setVars failed, probably because key not found } } - // Make substitutions into odt of thirdparty + external modules - $tmparray=$this->get_substitutionarray_thirdparty($object,$outputlangs); - complete_substitutions_array($tmparray, $outputlangs, $object); // Replace tags of lines for contacts - $contact_arrray=array(); $sql = "SELECT p.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; $sql .= " WHERE p.fk_soc = ".$object->id; - dol_syslog('doc_generic_odt :: sql='.$sql,LOG_DEBUG); $result = $this->db->query($sql); $num = $this->db->num_rows($result); @@ -315,27 +310,23 @@ class doc_generic_odt extends ModeleThirdPartyDoc if ($num) { $i=0; - $contactstatic = new Contact($this->db); - while ($i < $num) + while($i < $num) { $obj = $this->db->fetch_object($result); $contact_arrray[$i] = $obj->rowid; - //$contactstatic; - - $i++; } } - if ((is_array($contact_arrray) && count($contact_arrray) > 0)) + if((is_array($contact_arrray) && count($contact_arrray) > 0)) { try { $listlines = $odfHandler->setSegment('companycontacts'); - foreach ($contact_arrray as $array_key => $contact_id) + foreach($contact_arrray as $array_key => $contact_id) { $res_contact = $contactstatic->fetch($contact_id); //$contact['fullname']=$objectdetail->getFullName($outputlangs,1); @@ -399,8 +390,13 @@ class doc_generic_odt extends ModeleThirdPartyDoc { } } + + + // Make substitutions into odt of thirdparty + external modules + $tmparray=$this->get_substitutionarray_thirdparty($object,$outputlangs); + complete_substitutions_array($tmparray, $outputlangs, $object); - // Call the beforeODTSave hook + // Call the beforeODTSave hook $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); $reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks From 501b7209de7cf4483845164cde29947072aefdb5 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 1 May 2014 04:57:49 +0200 Subject: [PATCH 17/25] Move module trips into family "hr" --- htdocs/core/modules/modDeplacement.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modDeplacement.class.php b/htdocs/core/modules/modDeplacement.class.php index a1e9a655c6e..47000d87f02 100644 --- a/htdocs/core/modules/modDeplacement.class.php +++ b/htdocs/core/modules/modDeplacement.class.php @@ -44,7 +44,7 @@ class modDeplacement extends DolibarrModules $this->db = $db; $this->numero = 75 ; - $this->family = "financial"; + $this->family = "hr"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Gestion des notes de frais et deplacements"; // Si traduction Module75Desc non trouvee From c6e2afb11e5a07b962eeb7a8f6ade05336e9e772 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 1 May 2014 05:57:27 +0200 Subject: [PATCH 18/25] Social contrib. :: Replace index.php by $_SERVER["PHP_SELF"] --- htdocs/compta/sociales/index.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 89e2f84d7fb..48d23769cf6 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -147,13 +147,13 @@ if ($resql) print ""; print ""; - print_liste_field_titre($langs->trans("Ref"),"index.php","id","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),"index.php","cs.libelle","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Type"),"index.php","type","",$param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PeriodEndDate"),"index.php","periode","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Amount"),"index.php","cs.amount","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateDue"),"index.php","cs.date_ech","",$param,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),"index.php","cs.paye","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"id","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"cs.libelle","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"periode","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"cs.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cs.paye","",$param,'align="right"',$sortfield,$sortorder); print "\n"; print ''; From 3b265c8d5350d00e0e1a4148a6d17aa458fb6d5e Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 1 May 2014 07:44:10 +0200 Subject: [PATCH 19/25] TVA :: Add sortfield & search --- htdocs/compta/tva/reglement.php | 104 +++++++++++++++++++++++++++----- 1 file changed, 90 insertions(+), 14 deletions(-) diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index a35c03076cb..6183207e115 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -35,7 +35,33 @@ $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if ($page == -1) { $page = 0; } +$offset = $conf->liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +$limit = $conf->liste_limit; +if (! $sortfield) $sortfield="t.datev"; +if (! $sortorder) $sortorder="DESC"; +$filtre=$_GET["filtre"]; + +if (empty($_REQUEST['typeid'])) +{ + $newfiltre=str_replace('filtre=','',$filtre); + $filterarray=explode('-',$newfiltre); + foreach($filterarray as $val) + { + $part=explode(':',$val); + if ($part[0] == 't.fk_typepayment') $typeid=$part[1]; + } +} +else +{ + $typeid=$_REQUEST['typeid']; +} /* * View @@ -43,15 +69,25 @@ $result = restrictedArea($user, 'tax', '', '', 'charges'); llxHeader(); +$form = new Form($db); $tva_static = new Tva($db); -print_fiche_titre($langs->trans("VATPayments")); - -$sql = "SELECT t.rowid, t.amount, t.label, t.datev as dm, t.num_payment, pst.code as payment_code"; +$sql = "SELECT t.rowid, t.amount, t.label, t.datev as dm, t.fk_typepayment as type, t.num_payment, pst.code as payment_code"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON t.fk_typepayment = pst.id"; $sql.= " WHERE t.entity = ".$conf->entity; -$sql.= " ORDER BY dm DESC"; +if (GETPOST("search_label")) $sql.=" AND t.label LIKE '%".$db->escape(GETPOST("search_label"))."%'"; +if (GETPOST("search_amount")) $sql.=" AND t.amount = ".price2num(GETPOST("search_amount")); +if ($filtre) { + $filtre=str_replace(":","=",$filtre); + $sql .= " AND ".$filtre; +} +if ($typeid) { + $sql .= " AND t.fk_typepayment=".$typeid; +} +$sql.= " GROUP BY t.rowid, t.fk_typepayment, t.amount, t.datev, t.label"; +$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->plimit($limit+1,$offset); $result = $db->query($sql); if ($result) @@ -59,20 +95,55 @@ if ($result) $num = $db->num_rows($result); $i = 0; $total = 0 ; + $var=true; + + $param=''; + if ($typeid) $param.='&typeid='.$typeid; + + print_barre_liste($langs->trans("VATPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$totalnboflines); + + dol_htmloutput_mesg($mesg); + + print '
'; print '
'; print ''; - print ''; - print ""; - print ''; - print ''; - print ""; - print "\n"; - $var=1; - while ($i < $num) + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"t.rowid","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"t.label","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dm","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre(""); + print "\n"; + + print ''; + print ''; + print ''; + print ''; + // Type + print ''; + print ''; + print ''; + print "\n"; + + while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); $var=!$var; + + if ($obj->payment_code <> '') + { + $type = ''; + } + else + { + $type = ''; + } + print ""; $tva_static->id=$obj->rowid; @@ -81,18 +152,23 @@ if ($result) print "\n"; print '\n"; // Type - print ''; + print $type; // Amount $total = $total + $obj->amount; print ""; + print ""; print "\n"; $i++; } print ''; - print ""; + print ""; + print ""; print "
'.$langs->trans("Ref").'".$langs->trans("Label")."'.$langs->trans("DatePayment").''.$langs->trans("Type").'".$langs->trans("PayedByThisPayment")."
  '; + $form->select_types_paiements($typeid,'typeid','',0,0,1,16); + print ''; + print ''; + print '
'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.' 
".dol_trunc($obj->label,40)."'.dol_print_date($db->jdate($obj->dm),'day')."'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'".price($obj->amount)." 
'.$langs->trans("Total").'".price($total)."
".price($total)." 
"; + + print ''; + $db->free($result); } else From ca0b6c26df295b8ea5095da9fa8722deb91b6a85 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 1 May 2014 08:19:55 +0200 Subject: [PATCH 20/25] Translation --- .../salaries/class/paymentsalary.class.php | 34 +++++++-------- htdocs/compta/tva/class/tva.class.php | 43 +++++++++---------- 2 files changed, 38 insertions(+), 39 deletions(-) diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 54edd9ec45c..f94861c31a6 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -125,14 +125,14 @@ class PaymentSalary extends CommonObject if (! $notrigger) { - // Appel des triggers + // Start triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('PAYMENT_SALARY_MODIFY',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // End triggers } return 1; @@ -239,14 +239,14 @@ class PaymentSalary extends CommonObject return -1; } - // Appel des triggers + // Start triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('PAYMENT_SALARY_DELETE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // End triggers return 1; } @@ -324,7 +324,7 @@ class PaymentSalary extends CommonObject $this->db->begin(); - // Insertion dans la table d'un paiement salaire + // Insert into llx_payment_salary $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_salary (fk_user"; $sql.= ", datep"; $sql.= ", datev"; @@ -359,23 +359,23 @@ class PaymentSalary extends CommonObject $result = $this->db->query($sql); if ($result) { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_salary"); // TODO devrait s'appeler payment_salary + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_salary"); // TODO should be called payment_salary - // Appel des triggers + // Start triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('PAYMENT_SALARY_CREATE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // End triggers if ($this->id > 0) { $ok=1; if (! empty($conf->banque->enabled) && ! empty($this->amount)) { - // Insertion dans llx_bank + // Insert into llx_bank require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); @@ -394,8 +394,8 @@ class PaymentSalary extends CommonObject $user ); - // Mise a jour fk_bank dans llx_paiement. - // On connait ainsi le paiement qui a genere l'ecriture bancaire + // Update fk_bank into llx_paiement. + // So we know the payment which has generate the banking ecriture if ($bank_line_id > 0) { $this->update_fk_bank($bank_line_id); @@ -469,9 +469,9 @@ class PaymentSalary extends CommonObject } /** - * Mise a jour du lien entre le paiement salaire et la ligne générée dans llx_bank + * Update link between payment salary and line generate into llx_bank * - * @param int $id_bank Id compte bancaire + * @param int $id_bank Id bank account * @return int <0 if KO, >0 if OK */ function update_fk_bank($id_bank) @@ -492,11 +492,11 @@ class PaymentSalary extends CommonObject /** - * Renvoie nom clicable (avec eventuellement le picto) + * Send name clicable (with possibly the picto) * - * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul - * @param string $option Sur quoi pointe le lien - * @return string Chaine avec URL + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param string $option link option + * @return string Chaine with URL */ function getNomUrl($withpicto=0,$option='') { diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 711ccc62f1f..94c1f3d3cee 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -121,12 +121,12 @@ class Tva extends CommonObject { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva"); - // Appel des triggers + // Start triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('TVA_CREATE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // End triggers return $this->id; } @@ -189,12 +189,12 @@ class Tva extends CommonObject if (! $notrigger) { - // Appel des triggers + // Start triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('TVA_MODIFY',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // End triggers } return 1; @@ -295,12 +295,12 @@ class Tva extends CommonObject return -1; } - // Appel des triggers + // Start triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('TVA_DELETE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // End triggers return 1; } @@ -330,7 +330,7 @@ class Tva extends CommonObject /** - * Hum la fonction s'appelle 'Solde' elle doit a mon avis calculer le solde de TVA, non ? + * Balance of VAT * * @param int $year Year * @return double Amount @@ -349,7 +349,7 @@ class Tva extends CommonObject } /** - * Total de la TVA des factures emises par la societe. + * Total of the VAT from invoices emitted by the society. * * @param int $year Year * @return double Amount @@ -431,7 +431,7 @@ class Tva extends CommonObject /** - * Total de la TVA reglee aupres de qui de droit + * Total of the VAT payed * * @param int $year Year * @return double Amount @@ -473,7 +473,7 @@ class Tva extends CommonObject /** - * Ajoute un paiement de TVA + * Create in database * * @param User $user Object user that insert * @return int <0 if KO, rowid in tva table if OK @@ -514,7 +514,7 @@ class Tva extends CommonObject return -5; } - // Insertion dans la table d'un paiement tva + // Insert into llx_tva $sql = "INSERT INTO ".MAIN_DB_PREFIX."tva (datep"; $sql.= ", datev"; $sql.= ", amount"; @@ -543,21 +543,21 @@ class Tva extends CommonObject $result = $this->db->query($sql); if ($result) { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva"); // TODO devrait s'appeler paiementtva + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva"); // TODO should be called paiementtva - // Appel des triggers + // Start triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('TVA_ADDPAYMENT',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // End triggers if ($this->id > 0) { $ok=1; if (! empty($conf->banque->enabled) && ! empty($this->amount)) { - // Insertion dans llx_bank + // Insert into llx_bank require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); @@ -613,9 +613,9 @@ class Tva extends CommonObject } /** - * Mise a jour du lien entre le paiement tva et la ligne generee dans llx_bank + * Update link between payment tva and line generate into llx_bank * - * @param int $id_bank Id compte bancaire + * @param int $id_bank Id bank account * @return int <0 if KO, >0 if OK */ function update_fk_bank($id_bank) @@ -634,13 +634,12 @@ class Tva extends CommonObject } } - /** - * Renvoie nom clicable (avec eventuellement le picto) + * Send name clicable (with possibly the picto) * - * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul - * @param string $option Sur quoi pointe le lien - * @return string Chaine avec URL + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param string $option link option + * @return string Chaine with URL */ function getNomUrl($withpicto=0,$option='') { From 270e58637fe27c0d4b5106c16b7ab8fc6b067e49 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 1 May 2014 08:58:19 +0200 Subject: [PATCH 21/25] Salaries payments :: Add sortfield & search --- htdocs/compta/salaries/index.php | 96 +++++++++++++++++++++++++++----- 1 file changed, 81 insertions(+), 15 deletions(-) diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index e6fcfab763c..1d0358f17cd 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -33,7 +33,33 @@ $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if ($page == -1) { $page = 0; } +$offset = $conf->liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +$limit = $conf->liste_limit; +if (! $sortfield) $sortfield="s.datev"; +if (! $sortorder) $sortorder="DESC"; +$filtre=$_GET["filtre"]; + +if (empty($_REQUEST['typeid'])) +{ + $newfiltre=str_replace('filtre=','',$filtre); + $filterarray=explode('-',$newfiltre); + foreach($filterarray as $val) + { + $part=explode(':',$val); + if ($part[0] == 's.fk_typepayment') $typeid=$part[1]; + } +} +else +{ + $typeid=$_REQUEST['typeid']; +} /* * View @@ -41,20 +67,29 @@ $result = restrictedArea($user, 'tax', '', '', 'charges'); llxHeader(); +$form = new Form($db); $salstatic = new PaymentSalary($db); $userstatic = new User($db); - -print_fiche_titre($langs->trans("SalariesPayments")); - -$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, s.rowid, s.fk_user, s.amount, s.label, s.datev as dm, s.num_payment,"; -$sql.= " pst.code as payment_code"; +$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, s.rowid, s.fk_user, s.amount, s.label, s.datev as dm, s.fk_typepayment as type,"; +$sql.= " s.num_payment, pst.code as payment_code"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst.id,"; $sql.= " ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE u.rowid = s.fk_user"; $sql.= " AND s.entity = ".$conf->entity; -$sql.= " ORDER BY dm DESC"; +if (GETPOST("search_label")) $sql.=" AND s.label LIKE '%".$db->escape(GETPOST("search_label"))."%'"; +if (GETPOST("search_amount")) $sql.=" AND s.amount = ".price2num(GETPOST("search_amount")); +if ($filtre) { + $filtre=str_replace(":","=",$filtre); + $sql .= " AND ".$filtre; +} +if ($typeid) { + $sql .= " AND s.fk_typepayment=".$typeid; +} +$sql.= " GROUP BY s.rowid, s.fk_typepayment, s.amount, s.datev, s.label"; +$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->plimit($limit+1,$offset); $result = $db->query($sql); if ($result) @@ -62,18 +97,44 @@ if ($result) $num = $db->num_rows($result); $i = 0; $total = 0 ; + $var=true; + + $param=''; + if ($typeid) $param.='&typeid='.$typeid; + + print_barre_liste($langs->trans("SalariesPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$totalnboflines); + + dol_htmloutput_mesg($mesg); + + print '
'; print ''; print ''; - print ''; - print ""; - print ""; - print ''; - print ''; - print ""; + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.rowid","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datev","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre(""); print "\n"; - $var=1; - while ($i < $num) + + print ''; + print ''; + print ''; + print ''; + print ''; + // Type + print ''; + print ''; + print ''; + print "\n"; + + while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); $var=!$var; @@ -92,6 +153,7 @@ if ($result) print ''; // Amount print ""; + print ""; print "\n"; $total = $total + $obj->amount; @@ -99,9 +161,13 @@ if ($result) $i++; } print ''; - print '"; + print '"; + print ""; print "
'.$langs->trans("Ref").'".$langs->trans("Person")."".$langs->trans("Label")."'.$langs->trans("DatePayment").''.$langs->trans("Type").'".$langs->trans("PayedByThisPayment")."
   '; + $form->select_types_paiements($typeid,'typeid','',0,0,1,16); + print ''; + print ''; + print '
'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'".price($obj->amount,0,$outputlangs,1,-1,-1,$conf->currency)." 
'.$langs->trans("Total").''.price($total,0,$outputlangs,1,-1,-1,$conf->currency)."
'.price($total,0,$outputlangs,1,-1,-1,$conf->currency)." 
"; + + print '
'; + $db->free($result); } else From cdf5155d875c1caf09a30c6603f069dade10fe3f Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 1 May 2014 09:22:31 +0200 Subject: [PATCH 22/25] Trad: Update es_ES from transifex --- htdocs/langs/es_ES/admin.lang | 8 ++++---- htdocs/langs/es_ES/companies.lang | 2 ++ htdocs/langs/es_ES/compta.lang | 2 +- htdocs/langs/es_ES/errors.lang | 2 +- htdocs/langs/es_ES/languages.lang | 2 +- htdocs/langs/es_ES/main.lang | 2 +- htdocs/langs/es_ES/members.lang | 3 ++- htdocs/langs/es_ES/other.lang | 10 +++++----- htdocs/langs/es_ES/paypal.lang | 4 ++-- htdocs/langs/es_ES/projects.lang | 3 +++ 10 files changed, 22 insertions(+), 16 deletions(-) diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 78fb7e0da12..04f19c20803 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -49,7 +49,7 @@ ErrorReservedTypeSystemSystemAuto=El uso del tipo 'system' y 'systemauto' está ErrorCodeCantContainZero=El código no puede contener el valor 0 DisableJavascript=Desactivar las funciones Javascript y AJAX ConfirmAjax=Utilizar los diálogos de confirmación Ajax -UseSearchToSelectCompany=Utilizar un formulário de búsqueda para seleccionar terceros (en vez de una lista desplegable).

Tenga en cuenta que si tiene un gran número de contactos (>100 000), puede mejorar el rendimiento mediante la constante COMPANY_DONOTSEARCH_ANYWHERE a 1 en Configuración->Varios. La búsqueda se limitará entonces al inicio de la cadena. +UseSearchToSelectCompany=Utilizar un formulario de búsqueda para seleccionar terceros (en vez de una lista desplegable).

Tenga en cuenta que si tiene un gran número de contactos (>100 000), puede mejorar el rendimiento mediante la constante COMPANY_DONOTSEARCH_ANYWHERE a 1 en Configuración->Varios. La búsqueda se limitará entonces al inicio de la cadena. ActivityStateToSelectCompany= Agregar un filtro en la búsqueda para mostrar/ocultar los terceros en activo o que hayan dejado de ejercer UseSearchToSelectContact=Utilizar un formulario de búsqueda para seleccionar contactos (en vez de una lista desplegable).

Tenga en cuenta que si tiene un gran número de contactos (>100 000), puede mejorar el rendimiento mediante la constante CONTACT_DONOTSEARCH_ANYWHERE a 1 en Configuración->Varios. La búsqueda se limitará entonces al inicio de la cadena. SearchFilter=Opciones filtros de búsqueda @@ -360,7 +360,7 @@ ExtrafieldPhone = Teléfono ExtrafieldPrice = Precio ExtrafieldMail = Correo ExtrafieldSelect = Lista de selección -ExtrafieldSelectList = Llista de selección de table +ExtrafieldSelectList = Lista desde una tabla ExtrafieldSeparator=Separador ExtrafieldCheckBox=Casilla de verificación ExtrafieldRadio=Botón de selección excluyente @@ -467,7 +467,7 @@ Module410Desc=Interfaz con el calendario Webcalendar Module500Name=Gastos especiales (impuestos, gastos sociales, dividendos) Module500Desc=Gestión de los gastos especiales como impuestos, gastos sociales, dividendos y salarios Module510Name=Salarios -Module510Desc=Manejo de salarios de empleados y sus pagos +Module510Desc=Gestión de salarios de empleados y sus pagos Module600Name=Notificaciones Module600Desc=Envío de notificaciones (por correo electrónico) sobre los eventos de trabajo Dolibarr Module700Name=Donaciones @@ -1438,7 +1438,7 @@ AccountancyCodeBuy=Código contable compras AgendaSetup=Módulo configuración de acciones y agenda PasswordTogetVCalExport=Clave de autorización vcal export link PastDelayVCalExport=No exportar los eventos de más de -AGENDA_USE_EVENT_TYPE=Use events types (managed into menu Setup -> Dictionnary -> Type of agenda events) +AGENDA_USE_EVENT_TYPE=Usar los tipos de eventos (administrables desde Configuración->Diccionarios->Eventos de tipo de agenda) ##### ClickToDial ##### ClickToDialDesc=Este módulo permite agregar un icono después del número de teléfono de contactos Dolibarr. Un clic en este icono, Llama a un servidor con una URL que se indica a continuación. Esto puede ser usado para llamar al sistema call center de Dolibarr que puede llamar al número de teléfono en un sistema SIP, por ejemplo. ##### Point Of Sales (CashDesk) ##### diff --git a/htdocs/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang index 59b9a3ff557..89517bd8578 100644 --- a/htdocs/langs/es_ES/companies.lang +++ b/htdocs/langs/es_ES/companies.lang @@ -18,6 +18,7 @@ NewCompany=Nueva empresa (cliente potencial, cliente, proveedor) NewThirdParty=Nuevo tercero (cliente potencial, cliente, proveedor) NewSocGroup=Nueva agrupación de empresas NewPrivateIndividual=Nuevo particular (cliente potencial, cliente, proveedor) +CreateDolibarrThirdPartySupplier=Crear un tercero (proveedor) ProspectionArea=Área de prospección SocGroup=Agrupamiento de empresas IdThirdParty=ID tercero @@ -313,6 +314,7 @@ EditDeliveryAddress=Modificar dirección de envío ThisUserIsNot=Este usuario no es ni un cliente potencial, ni un cliente, ni un proveedor VATIntraCheck=Verificar VATIntraCheckDesc=El link %s permite consultar al servicio europeo de control de números de IVA intracomunitario. Se requiere acceso a internet para que el servicio funcione +VATIntraCheckURL=http://ec.europa.eu/taxation_customs/vies/vieshome.do VATIntraCheckableOnEUSite=Verificar en la web de la Comisión Europea VATIntraManualCheck=Puede también realizar una verificación manual en la web europea %s ErrorVATCheckMS_UNAVAILABLE=Comprobación imposible. El servicio de comprobación no es prestado por el país país miembro (%s). diff --git a/htdocs/langs/es_ES/compta.lang b/htdocs/langs/es_ES/compta.lang index d4ef8b56cf9..6ff91fa3282 100644 --- a/htdocs/langs/es_ES/compta.lang +++ b/htdocs/langs/es_ES/compta.lang @@ -48,7 +48,7 @@ LT2SupplierES=IRPF compras VATCollected=IVA recuperado ToPay=A pagar ToGet=A devolver -SpecialExpensesArea=Área de pagos especiales +SpecialExpensesArea=Area para todos los pagos especiales TaxAndDividendsArea=Área impuestos, cargas sociales y dividendos SocialContribution=Carga social SocialContributions=Cargas sociales diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang index c98370b278e..f70f5ad379f 100644 --- a/htdocs/langs/es_ES/errors.lang +++ b/htdocs/langs/es_ES/errors.lang @@ -134,7 +134,7 @@ ErrorOpenIDSetupNotComplete=Ha configurado Dolibarr para aceptar la autentificac ErrorWarehouseMustDiffers=El almacén de origen y destino deben de ser diferentes ErrorBadFormat=¡El formato es erróneo! ErrorPaymentDateLowerThanInvoiceDate=La fecha de pago (%s) no puede ser anterior a la fecha (%s) de la factura %s. -ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst=Error, this member is not yet linked to any thirdparty. Link member to an existing third party or create a new thirdparty before creating subscription with invoice. +ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst=Error, este miembro aún no está enlazado un tercero. Enlace el miembro a un tercero existente o cree un tercero nuevo antes de crear la suscripción con la factura. # Warnings WarningMandatorySetupNotComplete=Los parámetros obligatorios de configuración no están todavía definidos WarningSafeModeOnCheckExecDir=Atención, está activada la opción PHP safe_mode, el comando deberá estar dentro de un directorio declarado dentro del parámetro php safe_mode_exec_dir. diff --git a/htdocs/langs/es_ES/languages.lang b/htdocs/langs/es_ES/languages.lang index 8a285e1d219..f32453299a3 100644 --- a/htdocs/langs/es_ES/languages.lang +++ b/htdocs/langs/es_ES/languages.lang @@ -58,7 +58,7 @@ Language_tr_TR=Turco Language_sl_SI=Esloveno Language_sv_SV=Sueco Language_sv_SE=Sueco -Language_sq_AL=Albanian +Language_sq_AL=Albanés Language_sk_SK=Eslovaco Language_th_TH=Tailandés Language_uk_UA=Ucranio diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index 720652b1bc7..eb624c89b0f 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -94,7 +94,7 @@ InformationLastAccessInError=Información sobre el último acceso a la base de d DolibarrHasDetectedError=Dolibarr ha detectado un error técnico InformationToHelpDiagnose=He aquí la información que podrá ayudar al diagnóstico MoreInformation=Más información -TechnicalInformation=Technical information +TechnicalInformation=Información técnica NotePublic=Nota (pública) NotePrivate=Nota (privada) PrecisionUnitIsLimitedToXDecimals=Dolibarr está configurado para limitar la precisión de los precios unitarios a %s decimales. diff --git a/htdocs/langs/es_ES/members.lang b/htdocs/langs/es_ES/members.lang index 30fb3b432ab..ebccec6be14 100644 --- a/htdocs/langs/es_ES/members.lang +++ b/htdocs/langs/es_ES/members.lang @@ -86,7 +86,6 @@ SubscriptionNotReceivedShort=No recibida ListOfSubscriptions=Listado de afiliaciones SendCardByMail=Enviar ficha por e-mail AddMember=Añadir miembro -MemberType=Tipo de miembro NoTypeDefinedGoToSetup=Ningún tipo de miembro definido. Vaya a Configuración -> Tipos de miembros NewMemberType=Nuevo tipo de miembro WelcomeEMail=E-mail @@ -171,6 +170,8 @@ LastSubscriptionAmount=Importe de la última cotización MembersStatisticsByCountries=Estadísticas de miembros por país MembersStatisticsByState=Estadísticas de miembros por departamento/provincia/región MembersStatisticsByTown=Estadísticas de miembros por población +MembersStatisticsByRegion=Estadísticas de miembros por región +MemberByRegion=Miembros por región NbOfMembers=Número de miembros NoValidatedMemberYet=Ningún miembro validado encontrado MembersByCountryDesc=Esta pantalla presenta una estadística del número de miembros por países. Sin embargo, el gráfico utiliza el servicio en línea de gráficos de Google y sólo es operativo cuando se encuentra disponible una conexión a Internet. diff --git a/htdocs/langs/es_ES/other.lang b/htdocs/langs/es_ES/other.lang index a12c6856816..7d45a9a79b9 100644 --- a/htdocs/langs/es_ES/other.lang +++ b/htdocs/langs/es_ES/other.lang @@ -17,14 +17,14 @@ Notify_ORDER_SUPPLIER_APPROVE=Aprobación pedido a proveedor Notify_ORDER_SUPPLIER_REFUSE=Rechazo pedido a proveedor Notify_ORDER_VALIDATE=Validación pedido cliente Notify_PROPAL_VALIDATE=Validación presupuesto cliente -Notify_PROPAL_CLOSE_SIGNED=Customer propal closed signed -Notify_PROPAL_CLOSE_REFUSED=Customer propal closed refused +Notify_PROPAL_CLOSE_SIGNED=Presupuesto cerrado como firmado +Notify_PROPAL_CLOSE_REFUSED=Presupuesto cerrado como rechazado Notify_WITHDRAW_TRANSMIT=Transmisión domiciliación Notify_WITHDRAW_CREDIT=Abono domiciliación Notify_WITHDRAW_EMIT=Emisión domiciliación Notify_ORDER_SENTBYMAIL=Envío pedido de cliente por e-mail Notify_COMPANY_CREATE=Creación tercero -Notify_COMPANY_SENTBYMAIL=Mails sent from third party card +Notify_COMPANY_SENTBYMAIL=Correos enviados desde la ficha del tercero Notify_PROPAL_SENTBYMAIL=Envío presupuesto por e-mail Notify_BILL_PAYED=Cobro factura a cliente Notify_BILL_CANCEL=Cancelación factura a cliente @@ -34,13 +34,13 @@ Notify_ORDER_SUPPLIER_SENTBYMAIL=Envío pedido a proveedor por e-mail Notify_BILL_SUPPLIER_VALIDATE=Validación factura de proveedor Notify_BILL_SUPPLIER_PAYED=Pago factura de proveedor Notify_BILL_SUPPLIER_SENTBYMAIL=Envío factura de proveedor por e-mail -Notify_BILL_SUPPLIER_CANCELED=Supplier invoice cancelled +Notify_BILL_SUPPLIER_CANCELED=Factura del proveedor cancelada Notify_CONTRACT_VALIDATE=Validación contrato Notify_FICHEINTER_VALIDATE=Validación intervención Notify_SHIPPING_VALIDATE=Validación envío Notify_SHIPPING_SENTBYMAIL=Envío expedición por e-mail Notify_MEMBER_VALIDATE=Validación miembro -Notify_MEMBER_MODIFY=Member modified +Notify_MEMBER_MODIFY=Miembro modificado Notify_MEMBER_SUBSCRIPTION=Afiliación miembro Notify_MEMBER_RESILIATE=Baja miembro Notify_MEMBER_DELETE=Eliminación miembro diff --git a/htdocs/langs/es_ES/paypal.lang b/htdocs/langs/es_ES/paypal.lang index c96a58e1203..4d04c941167 100644 --- a/htdocs/langs/es_ES/paypal.lang +++ b/htdocs/langs/es_ES/paypal.lang @@ -20,6 +20,6 @@ YouAreCurrentlyInSandboxMode=Actualmente se encuentra en modo "sandbox" NewPaypalPaymentReceived=Nuevo pago Paypal recibido NewPaypalPaymentFailed=Nuevo intento de pago Paypal sin éxito PAYPAL_PAYONLINE_SENDEMAIL=E-Mail a avisar en caso de pago (con éxito o no) -ReturnURLAfterPayment=Return URL after payment +ReturnURLAfterPayment=URL de retorno después del pago ValidationOfPaypalPaymentFailed=La validación del pago Paypal ha fallado -PaypalConfirmPaymentPageWasCalledButFailed=Payment confirmation page for Paypal was called by Paypal but confirmation failed +PaypalConfirmPaymentPageWasCalledButFailed=La página de confirmación de pago para Paypal fue llamada por Paypal pero la confirmación falló diff --git a/htdocs/langs/es_ES/projects.lang b/htdocs/langs/es_ES/projects.lang index 32b46166f7c..c47c7da264e 100644 --- a/htdocs/langs/es_ES/projects.lang +++ b/htdocs/langs/es_ES/projects.lang @@ -106,6 +106,9 @@ ProjectReportDate=Cambiar las fechas de las tareas en función de la fecha de in ErrorShiftTaskDate=Se ha producido un error en el cambio de las fechas de las tareas ProjectsAndTasksLines=Proyectos y tareas ProjectCreatedInDolibarr=Proyecto %s creado +TaskCreatedInDolibarr=La tarea %s fué creada +TaskModifiedInDolibarr=La tarea %s fué modificada +TaskDeletedInDolibarr=La tarea %s fué eliminada ##### Types de contacts ##### TypeContact_project_internal_PROJECTLEADER=Jefe de proyecto TypeContact_project_external_PROJECTLEADER=Jefe de proyecto From 3b97e1ae1c2c4326546f6b52126574a2f6c87f59 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 1 May 2014 09:42:38 +0200 Subject: [PATCH 23/25] Trad: Update es_ES from transifex --- htdocs/langs/es_ES/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 04f19c20803..3deda28d9ba 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -1438,7 +1438,7 @@ AccountancyCodeBuy=Código contable compras AgendaSetup=Módulo configuración de acciones y agenda PasswordTogetVCalExport=Clave de autorización vcal export link PastDelayVCalExport=No exportar los eventos de más de -AGENDA_USE_EVENT_TYPE=Usar los tipos de eventos (administrables desde Configuración->Diccionarios->Eventos de tipo de agenda) +AGENDA_USE_EVENT_TYPE=Usar tipos de eventos (configurables desde Configuración->Diccionarios->Tipos de eventos de la agenda) ##### ClickToDial ##### ClickToDialDesc=Este módulo permite agregar un icono después del número de teléfono de contactos Dolibarr. Un clic en este icono, Llama a un servidor con una URL que se indica a continuación. Esto puede ser usado para llamar al sistema call center de Dolibarr que puede llamar al número de teléfono en un sistema SIP, por ejemplo. ##### Point Of Sales (CashDesk) ##### From 9dd605bd8a2d54fe435fe4b0df070cbe1c7e5a0c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 May 2014 11:54:48 +0200 Subject: [PATCH 24/25] Simplify and comment code --- htdocs/product/admin/product.php | 49 ++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 4d5cc811e85..5aa65d69b5a 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -44,11 +44,12 @@ $value = GETPOST('value','alpha'); // Pricing Rules $select_pricing_rules=array( -'PRODUCT_PRICE_UNIQ'=>$langs->trans('PriceCatalogue'), -'PRODUIT_MULTIPRICES'=>$langs->trans('MultiPricesAbility'), -'PRODUIT_CUSTOMER_PRICES'=>$langs->trans('PriceByCustomer') +'PRODUCT_PRICE_UNIQ'=>$langs->trans('PriceCatalogue'), // Unique price +'PRODUIT_MULTIPRICES'=>$langs->trans('MultiPricesAbility'), // Several prices according to a customer level +'PRODUIT_CUSTOMER_PRICES'=>$langs->trans('PriceByCustomer') // Different price for each customer ); -if ($conf->global->MAIN_FEATURES_LEVEL==2) { +if ($conf->global->MAIN_FEATURES_LEVEL==2) +{ $select_pricing_rules['PRODUIT_CUSTOMER_PRICES_BY_QTY'] = $langs->trans('PriceByQuantity'); $select_pricing_rules['PRODUIT_CUSTOMER_PRICES_BY_QTY&PRODUIT_MULTIPRICES'] = $langs->trans('MultiPricesAbility') . '+' . $langs->trans('PriceByQuantity'); } @@ -103,33 +104,37 @@ if ($action == 'nbprod') { $res = dolibarr_set_const($db, "PRODUIT_LIMIT_SIZE", $value,'chaine',0,'',$conf->entity); } -else if ($action == 'multiprix_num') +else if ($action == 'PRODUIT_MULTIPRICES_LIMIT') { $res = dolibarr_set_const($db, "PRODUIT_MULTIPRICES_LIMIT", $value,'chaine',0,'',$conf->entity); } if ($action == 'pricingrule') { $princingrules = GETPOST('princingrule','alpha'); - foreach ($select_pricing_rules as $rule=>$label) { - - if ($rule==$princingrules) { - if ( $princingrules =='PRODUCT_PRICE_UNIQ') { - $res = dolibarr_set_const($db, 'PRODUIT_MULTIPRICES', 0,'chaine',0,'',$conf->entity); - $res = dolibarr_set_const($db, 'PRODUIT_CUSTOMER_PRICES_BY_QTY', 0,'chaine',0,'',$conf->entity); - $res = dolibarr_set_const($db, 'PRODUIT_CUSTOMER_PRICES', 0,'chaine',0,'',$conf->entity); - } else { + foreach ($select_pricing_rules as $rule=>$label) // Loop on each possible mode + { + if ($rule == $princingrules) // We are on selected rule, we enable it + { + if ($princingrules == 'PRODUCT_PRICE_UNIQ') // For this case, we disable entries manually + { + $res = dolibarr_set_const($db, 'PRODUIT_MULTIPRICES', 0, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'PRODUIT_CUSTOMER_PRICES_BY_QTY', 0, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'PRODUIT_CUSTOMER_PRICES', 0, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'PRODUCT_PRICE_UNIQ', 1, 'chaine', 0, '', $conf->entity); + } + else + { $multirule=explode('&',$princingrules); - if (is_array($multirule) && count($multirule)>0) { - foreach($multirule as $rulesselected) { - $res = dolibarr_set_const($db, $rulesselected, 1,'chaine',0,'',$conf->entity); - } - } else { - $res = dolibarr_set_const($db, $rule, 1,'chaine',0,'',$conf->entity); + foreach($multirule as $rulesselected) + { + $res = dolibarr_set_const($db, $rulesselected, 1, 'chaine', 0, '', $conf->entity); } } - } else { + } + else // We clear this mode + { if (strpos($rule,'&')===false) { - $res = dolibarr_set_const($db, $rule, 0,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, $rule, 0, 'chaine', 0, '', $conf->entity); } } @@ -337,7 +342,7 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) $var=!$var; print '
'; print ''; - print ''; + print ''; print ''; print ''.$langs->trans("MultiPricesNumPrices").''; print ''; From fc9c491d158b74f6f61a9b370543259ef0ad9e34 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 May 2014 12:19:24 +0200 Subject: [PATCH 25/25] New: Add constant to set label for level prices. --- htdocs/comm/fiche.php | 14 ++++++-------- htdocs/product/price.php | 30 +++++++++++++++++++++--------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 3fd907b29f9..f33ae4adc83 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2005-2012 Regis Houssin @@ -187,9 +187,6 @@ if ($id > 0) dol_print_error($db,$object->error); } - /* - * Affichage onglets - */ $head = societe_prepare_head($object); @@ -397,7 +394,6 @@ if ($id > 0) print ''; } - // Multiprice level if (! empty($conf->global->PRODUIT_MULTIPRICES)) { @@ -410,7 +406,11 @@ if ($id > 0) print ''.img_edit($langs->trans("Modify")).''; } print ''; - print ''.$object->price_level.""; + print ''; + print $object->price_level; + $keyforlabel='PRODUIT_MULTIPRICES_LABEL'.$object->price_level; + if (! empty($conf->global->$keyforlabel)) print ' - '.$langs->trans($conf->global->$keyforlabel); + print ""; print ''; } @@ -887,11 +887,9 @@ if ($id > 0) } print ''; - print "
\n"; if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB)) { - print '
'; // List of contacts show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id); } diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 3970047a59f..19c18be82b4 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2006 Andre Cianfarani @@ -59,14 +59,17 @@ if ($action == 'update_price' && ! $_POST ["cancel"] && ($user->rights->produit- $result = $object->fetch($id); // MultiPrix - if (! empty($conf->global->PRODUIT_MULTIPRICES)) { + if (! empty($conf->global->PRODUIT_MULTIPRICES)) + { $newprice = ''; $newprice_min = ''; $newpricebase = ''; $newvat = ''; - for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) { - if (isset($_POST ["price_" . $i])) { + for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) + { + if (isset($_POST ["price_" . $i])) + { $level = $i; $newprice = price2num($_POST ["price_" . $i], 'MU'); $newprice_min = price2num($_POST ["price_min_" . $i], 'MU'); @@ -129,8 +132,8 @@ if ($action == 'update_price_by_qty') { // Ajout / Mise à jour d'un prix par qu // $newminprice=price2num(GETPOST("price_min"),'MU'); // TODO : Add min price management $quantity = GETPOST('quantity'); $remise_percent = price2num(GETPOST('remise_percent')); - $remise = 0; // TODO : allow dicsount by amount when available on documents - + $remise = 0; // TODO : allow discount by amount when available on documents + if (empty($quantity)) { $error ++; $mesg = '
' . $langs->trans("ErrorFieldRequired", $langs->transnoentities("Qty")) . '
'; @@ -327,15 +330,24 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) { // TVA print '' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx ["$soc->price_level"], true) . ''; - } else { - for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) { + } + else + { + for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) + { // TVA if ($i == 1) // We show only price for level 1 { print '' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx [1], true) . ''; } - print '' . $langs->trans("SellingPrice") . ' ' . $i . ''; + print ''; + + // Label of price + print '' . $langs->trans("SellingPrice") . ' ' . $i; + $keyforlabel='PRODUIT_MULTIPRICES_LABEL'.$i; + if (! empty($conf->global->$keyforlabel)) print ' - '.$langs->trans($conf->global->$keyforlabel); + print ''; if ($object->multiprices_base_type ["$i"] == 'TTC') { print '' . price($object->multiprices_ttc ["$i"]);