From 63e6cf5c81b863761b158521063ae9ae31a62592 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 18 Jul 2013 17:42:09 +0200 Subject: [PATCH 1/6] Add possibility to define dependencies between extra lists --- htdocs/core/class/commonobject.class.php | 29 ++++++++++++++++++++++++ htdocs/core/class/extrafields.class.php | 28 +++++++++++++++-------- 2 files changed, 47 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index fac9bdfd764..c1b75793220 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2271,6 +2271,35 @@ abstract class CommonObject } $out .= "\n"; $out .= ' '; + $out .= ' + '; } return $out; } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index dcff2aedf14..640075a06b1 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -673,8 +673,10 @@ class ExtraFields $out=''; @@ -688,11 +690,16 @@ class ExtraFields // 0 1 : tableName // 1 2 : label field name Nom du champ contenant le libelle // 2 3 : key fields name (if differ of rowid) + // 3 4 : key field parent (for dependent lists) $keyList='rowid'; - if (count($InfoFieldList)==3) + if (count($InfoFieldList)>=3) $keyList=$InfoFieldList[2].' as rowid'; + if (count($InfoFieldList)>=4) { + list($parentName, $parentField) = explode('|', $InfoFieldList[3]); + $keyList.= ', '.$parentField; + } $sql = 'SELECT '.$keyList.', '.$InfoFieldList[1]; $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0]; @@ -717,15 +724,16 @@ class ExtraFields }else { $labeltoshow=dol_trunc($obj->$InfoFieldList[1],18); } + + if(!empty($InfoFieldList[3])) { + $parent = $parentName.':'.$obj->{$parentField}; + } - if ($value==$obj->rowid) - { - $out.=''; - } - else - { - $out.=''; - } + $out.=''; + $i++; } } From 9d2489f022fa77d1699827b38401dd24d6974c78 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 18 Jul 2013 17:49:47 +0200 Subject: [PATCH 2/6] Add help on extrafields lists dependencies --- htdocs/langs/en_US/admin.lang | 4 ++-- htdocs/langs/fr_FR/admin.lang | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 34f04575546..36751e0679a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -364,10 +364,10 @@ ExtrafieldSelectList = Select from table ExtrafieldSeparator=Separator ExtrafieldCheckBox=Checkbox ExtrafieldRadio=Radio button -ExtrafieldParamHelpselect=Parameters list have to be like key,value

for exemple :
1,value1
2,value2
3,value3
... +ExtrafieldParamHelpselect=Parameters list have to be like key,value

for exemple :
1,value1
2,value2
3,value3
...

In order to have the list depending on another :
1,value1|parent_list_code:parent_key
2,value2|parent_list_code:parent_key ExtrafieldParamHelpcheckbox=Parameters list have to be like key,value

for exemple :
1,value1
2,value2
3,value3
... ExtrafieldParamHelpradio=Parameters list have to be like key,value

for exemple :
1,value1
2,value2
3,value3
... -ExtrafieldParamHelpsellist=Parameters list have come from table

for exemple :
c_typent:libelle:id
+ExtrafieldParamHelpsellist=Parameters list have come from table

for exemple :
c_typent:libelle:id

In order to have the list depending on another :
c_typent:libelle:id:parent_list_code|parent_column LibraryToBuildPDF=Library used to build PDF WarningUsingFPDF=Warning: Your conf.php contains directive dolibarr_pdf_force_fpdf=1. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation.
To solve this and have a full support of PDF generation, please download TCPDF library, then comment or remove the line $dolibarr_pdf_force_fpdf=1, and add instead $dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir' LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:
1 : local tax apply on products and services without vat (vat is not applied on local tax)
2 : local tax apply on products and services before vat (vat is calculated on amount + localtax)
3 : local tax apply on products without vat (vat is not applied on local tax)
4 : local tax apply on products before vat (vat is calculated on amount + localtax)
5 : local tax apply on services without vat (vat is not applied on local tax)
6 : local tax apply on services before vat (vat is calculated on amount + localtax) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 1f4be3a3722..69a4fbba426 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -365,10 +365,10 @@ ExtrafieldSelectList = Liste issue d'une table ExtrafieldSeparator=Séparateur de champ ExtrafieldCheckBox=Case à cocher ExtrafieldRadio=Bouton radio -ExtrafieldParamHelpselect=La liste doit être de la forme clef,valeur

par exemple :
1,valeur1
2,valeur2
3,valeur3
… -ExtrafieldParamHelpcheckbox=La liste doit être de la forme clef,valeur

par exemple :
1,valeur1
2,valeur2
3,valeur3
… -ExtrafieldParamHelpradio=La liste doit être de la forme clef,valeur

par exemple :
1,valeur1
2,valeur2
3,valeur3
… -ExtrafieldParamHelpsellist=La liste vient d'une table

par exemple :
c_typent:libelle:id
+ExtrafieldParamHelpselect=La liste doit être de la forme clef,valeur

par exemple :
1,valeur1
2,valeur2
3,valeur3
...

Pour que la liste soit dépendante d'une autre :
1,valeur1|code_liste_parent:clef_parent
2,valeur2|code_liste_parent:clef_parent +ExtrafieldParamHelpcheckbox=La liste doit être de la forme clef,valeur

par exemple :
1,valeur1
2,valeur2
3,valeur3
... +ExtrafieldParamHelpradio=La liste doit être de la forme clef,valeur

par exemple :
1,valeur1
2,valeur2
3,valeur3
... +ExtrafieldParamHelpsellist=La liste vient d'une table

par exemple :
c_typent:libelle:id

Pour que la liste soit dépendante d'une autre :
c_typent:libelle:id:code_liste_parent|colonne_parent LibraryToBuildPDF=Bibliothèque utilisée pour la génération des PDF WarningUsingFPDF=Attention : votre fichier conf.php contient la directive dolibarr_pdf_force_fpdf=1. Cela signifie que vous utilisez la librairie FPDF pour générer vos fichiers PDF. Cette librairie est ancienne et ne couvre pas de nombreuses fonctionnalités (Unicode, transparence des images, langues cyrilliques, arabes ou asiatiques...), aussi vous pouvez rencontrer des problèmes durant la génération des PDF.
Pour résoudre cela et avoir une prise en charge complète de PDF, vous pouvez télécharger la bibliothèque TCPDF puis commenter ou supprimer la ligne $dolibarr_pdf_force_fpdf=1, et ajouter à la place $dolibarr_lib_TCPDF_PATH='chemin_vers_TCPDF' LocalTaxDesc=Certains pays appliquent 2 voire 3 taux sur chaque ligne de facture. Si c'est le cas, choisissez le type du deuxième et troisième taux et sa valeur. Les types possibles sont:
1 : taxe locale sur les produits et services hors tva (la tva n'est pas appliquée sur la taxe locale)
2 : taxe locale sur les produits et services avant tva (la tva est appliquée sur le montant + la taxe locale)
3 : taxe locale uniquement sur les produits hors tva (la tva n'est pas appliquée sur la taxe locale)
4 : taxe locale uniquement sur les produits avant tva (la tva est appliquée sur le montant + la taxe locale)
5 : taxe locale uniquement sur les services hors tva (la tva n'est pas appliquée sur la taxe locale)
6 : taxe locale uniquement sur les service avant tva (la tva est appliquée sur le montant + la taxe locale) From 7abc53698a4915e44f6cfc0d992e208abf94623f Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 19 Jul 2013 08:54:11 +0200 Subject: [PATCH 3/6] Add RefExt field on RemiseCheque --- .../cheque/class/remisecheque.class.php | 41 +++++++++++++++- htdocs/compta/paiement/cheque/fiche.php | 49 +++++++++++++++++++ .../install/mysql/migration/3.4.0-3.5.0.sql | 3 ++ .../mysql/tables/llx_bordereau_cheque.sql | 3 +- htdocs/langs/en_US/compta.lang | 1 + htdocs/langs/fr_FR/compta.lang | 1 + 6 files changed, 96 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 2d5eaebf8e9..2f7db2cc226 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -37,6 +37,7 @@ class RemiseCheque extends CommonObject var $id; var $num; var $intitule; + var $ref_ext; //! Numero d'erreur Plage 1024-1279 var $errno; @@ -63,7 +64,7 @@ class RemiseCheque extends CommonObject { global $conf; - $sql = "SELECT bc.rowid, bc.datec, bc.fk_user_author, bc.fk_bank_account, bc.amount, bc.number, bc.statut, bc.nbcheque"; + $sql = "SELECT bc.rowid, bc.datec, bc.fk_user_author, bc.fk_bank_account, bc.amount, bc.number, bc.statut, bc.nbcheque, bc.ref_ext"; $sql.= ", bc.date_bordereau as date_bordereau"; $sql.= ", ba.label as account_label"; $sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc"; @@ -86,6 +87,7 @@ class RemiseCheque extends CommonObject $this->author_id = $obj->fk_user_author; $this->nbcheque = $obj->nbcheque; $this->statut = $obj->statut; + $this->ref_ext = $obj->ref_ext; if ($this->statut == 0) { @@ -139,6 +141,7 @@ class RemiseCheque extends CommonObject $sql.= ", number"; $sql.= ", entity"; $sql.= ", nbcheque"; + $sql.= ", ref_ext"; $sql.= ") VALUES ("; $sql.= $this->db->idate($now); $sql.= ", ".$this->db->idate($now); @@ -149,6 +152,7 @@ class RemiseCheque extends CommonObject $sql.= ", 0"; $sql.= ", ".$conf->entity; $sql.= ", 0"; + $sql.= ", ''"; $sql.= ")"; dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG); @@ -720,6 +724,41 @@ class RemiseCheque extends CommonObject return -2; } } + + /** + * Set the external ref + * + * @param User $user Object user + * @param timestamp $ref_rext External ref + * @return int <0 if KO, >0 if OK + */ + function set_ref_ext($user, $ref_ext) + { + if ($user->rights->banque->cheque) + { + $sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque"; + $sql.= " SET ref_ext = '".$ref_ext."'"; + $sql.= " WHERE rowid = ".$this->id; + + dol_syslog("RemiseCheque::set_ref_ext sql=$sql",LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $this->ref_ext = $ref_ext; + return 1; + } + else + { + $this->error=$this->db->error(); + dol_syslog("RemiseCheque::set_ref_ext ".$this->error,LOG_ERR); + return -1; + } + } + else + { + return -2; + } + } /** diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index 7cf5d15f3a2..ff20fe04fea 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -89,6 +89,29 @@ if ($action == 'setdate' && $user->rights->banque->cheque) } } +/* + * Actions + */ + +if ($action == 'setrefext' && $user->rights->banque->cheque) +{ + $result = $object->fetch(GETPOST('id','int')); + if ($result > 0) + { + $ref_ext = GETPOST('ref_ext'); + + $result=$object->set_ref_ext($user, $ref_ext); + 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'])) @@ -491,6 +514,32 @@ else print ''; print ''; + + // External ref + print ''; + + print ''; + if ($action != 'editrefext') print ''; + print '
'; + print $langs->trans('RefExt'); + print 'id.'">'.img_edit($langs->trans('SetRefExt'),1).'
'; + print ''; + if ($action == 'editrefext') + { + print '
'; + print ''; + print ''; + print ''; + print ''; + print '
'; + } + else + { + print $object->ref_ext; + } + + print ''; + print ''; print ''.$langs->trans('Account').''; print $accountstatic->getNomUrl(1); diff --git a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql index 62811bdb70c..76137d75b7f 100755 --- a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql +++ b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql @@ -275,3 +275,6 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN22', 1001, '', 0, '', 'Tozeur', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN23', 1001, '', 0, '', 'Tunis', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN24', 1001, '', 0, '', 'Zaghouan', 1); + +# Add ref_ext on bordereau_cheque +ALTER TABLE `llx_bordereau_cheque` ADD `ref_ext` VARCHAR( 255 ) NOT NULL; diff --git a/htdocs/install/mysql/tables/llx_bordereau_cheque.sql b/htdocs/install/mysql/tables/llx_bordereau_cheque.sql index cc93cf188d6..60365665932 100644 --- a/htdocs/install/mysql/tables/llx_bordereau_cheque.sql +++ b/htdocs/install/mysql/tables/llx_bordereau_cheque.sql @@ -33,6 +33,7 @@ create table llx_bordereau_cheque fk_bank_account integer, fk_user_author integer, note text, - statut smallint NOT NULL DEFAULT 0 + statut smallint NOT NULL DEFAULT 0, + ref_ext varchar(255) )ENGINE=innodb; diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index cf95e809e4f..c2a27fe8b7d 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -154,3 +154,4 @@ InvoiceLinesToDispatch=Invoice lines to dispatch InvoiceDispatched=Dispatched invoices AccountancyDashboard=Accountancy summary ByProductsAndServices=By products and services +RefExt=External ref \ No newline at end of file diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index a86676b36b9..0b9cf8b7dda 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -165,3 +165,4 @@ InvoiceLinesToDispatch=Lignes de factures à ventiler InvoiceDispatched=Factures ventilées AccountancyDashboard=Synthèse compta/tréso ByProductsAndServices=Par produits et services +RefExt=Référence externe From 4aa9d92a4948a678f479da1f3e5838430c1168d0 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 19 Jul 2013 09:17:54 +0200 Subject: [PATCH 4/6] Display CheckReceipt on Payment card if exists --- htdocs/compta/paiement/fiche.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php index 50ce36d4e9c..dc68d07d4f4 100644 --- a/htdocs/compta/paiement/fiche.php +++ b/htdocs/compta/paiement/fiche.php @@ -251,6 +251,19 @@ if (! empty($conf->banque->enabled)) print $bankline->getNomUrl(1,0,'showall'); print ''; print ''; + + if($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) { + dol_include_once('/compta/paiement/cheque/class/remisecheque.class.php'); + $bordereau = new RemiseCheque($db); + $bordereau->fetch($bankline->fk_bordereau); + + print ''; + print ''.$langs->trans('CheckReceipt').''; + print ''; + print $bordereau->getNomUrl(1,0,'showall'); + print ''; + print ''; + } } } From 01e4d905fba5c781dd2a9f6d981f59f206eb81c0 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 19 Jul 2013 09:19:20 +0200 Subject: [PATCH 5/6] Start work on bank sharing for multi-company --- htdocs/admin/facture.php | 2 +- htdocs/compta/bank/class/account.class.php | 2 +- htdocs/compta/bank/index.php | 2 +- htdocs/compta/paiement/cheque/index.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 5da3ad27183..38968ab9cd5 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -604,7 +604,7 @@ if (! empty($conf->banque->enabled)) $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " WHERE clos = 0"; $sql.= " AND courant = 1"; - $sql.= " AND entity = ".$conf->entity; + $sql.= " AND entity IN (".getEntity('bank_account', 1).")"; $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 7db4831c294..17796b6b35f 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -613,7 +613,7 @@ class Account extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON ba.fk_pays = p.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON ba.state_id = d.rowid'; - $sql.= " WHERE entity = ".$conf->entity; + $sql.= " WHERE entity IN (".getEntity($this->element, 1).")"; if ($id) $sql.= " AND ba.rowid = ".$id; if ($ref) $sql.= " AND ba.ref = '".$this->db->escape($ref)."'"; diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 51b7a4dc818..7d862ff59c4 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -59,7 +59,7 @@ $accounts = array(); $sql = "SELECT rowid, courant, rappro"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; -$sql.= " WHERE entity = ".$conf->entity; +$sql.= " WHERE entity IN (".getEntity('bank_account', 1).")"; if ($statut != 'all') $sql.= " AND clos = 0"; $sql.= $db->order('label', 'ASC'); diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index 2fd7a970d92..bcfa32582d4 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -55,7 +55,7 @@ $sql = "SELECT count(b.rowid)"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= " WHERE ba.rowid = b.fk_account"; -$sql.= " AND ba.entity = ".$conf->entity; +$sql.= " AND ba.entity IN (".getEntity('bank_account', 1).")"; $sql.= " AND b.fk_type = 'CHQ'"; $sql.= " AND b.fk_bordereau = 0"; $sql.= " AND b.amount > 0"; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c913a06be06..cf645055ab2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2326,7 +2326,7 @@ class Form $sql = "SELECT rowid, label, bank"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " WHERE clos = '".$statut."'"; - $sql.= " AND entity = ".$conf->entity; + $sql.= " AND entity IN (".getEntity('bank_account', 1).")"; if ($filtre) $sql.=" AND ".$filtre; $sql.= " ORDER BY label"; From 196bce7e1123015dc44abe9c9026c3f9aedc9291 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 19 Jul 2013 10:23:08 +0200 Subject: [PATCH 6/6] Add link to RemiseCheque in account lines --- htdocs/compta/bank/account.php | 12 +++++++++--- .../paiement/cheque/class/remisecheque.class.php | 11 +++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 5351a3f5e7b..040905ddf73 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -432,7 +432,7 @@ if ($id > 0 || ! empty($ref)) */ $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,"; - $sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,"; + $sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_bordereau,"; $sql.= " ba.rowid as bankid, ba.ref as bankref, ba.label as banklabel"; if ($mode_search) { @@ -518,15 +518,21 @@ if ($id > 0 || ! empty($ref)) print "\n"; // Payment type - print ""; + print ''; $label=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$objp->fk_type; if ($objp->fk_type == 'SOLD') $label=' '; + if ($objp->fk_type == 'CHQ' && $objp->fk_bordereau > 0) { + dol_include_once('/compta/paiement/cheque/class/remisecheque.class.php'); + $bordereaustatic = new RemiseCheque($db); + $bordereaustatic->id = $objp->fk_bordereau; + $label .= ' '.$bordereaustatic->getNomUrl(2); + } print $label; print "\n"; // Num - print ''.($objp->num_chq?$objp->num_chq:"")."\n"; + print ''.($objp->num_chq?$objp->num_chq:"")."\n"; // Description print ''; diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 2f7db2cc226..7ccb75793aa 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -764,7 +764,7 @@ class RemiseCheque extends CommonObject /** * Renvoie nom clicable (avec eventuellement le picto) * - * @param int $withpicto Inclut le picto dans le lien + * @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 */ @@ -774,14 +774,13 @@ class RemiseCheque extends CommonObject $result=''; - $number=$this->ref; - if ($this->statut == 0) $number='(PROV'.$this->id.')'; - $lien = ''; $lienfin=''; - if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCheckReceipt"),'payment').$lienfin.' '); - $result.=$lien.$number.$lienfin; + if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCheckReceipt"),'payment').$lienfin); + if ($withpicto && $withpicto != 2) $result.=' '; + if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin; + return $result; }