From ce247432eec3324ae2eb72cc07bdd4f0bcc0150f Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 22 Feb 2015 08:05:23 +0100 Subject: [PATCH 1/5] FIXED: Remove condition to show accountancy field on user. --- htdocs/user/card.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 429bcc91130..67407bd6d39 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1319,12 +1319,9 @@ else print "\n"; // Accountancy code - if (! empty($conf->global->USER_ENABLE_ACCOUNTANCY_CODE)) // For the moment field is not used so must not appeared. - { - $rowspan++; - print ''.$langs->trans("AccountancyCode").''; - print ''.$object->accountancy_code.''; - } + $rowspan++; + print ''.$langs->trans("AccountancyCode").''; + print ''.$object->accountancy_code.''; // Color user if (! empty($conf->agenda->enabled)) From 4bb524d55d75af966bf7462e9132c223722d8326 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 22 Feb 2015 08:12:40 +0100 Subject: [PATCH 2/5] Also for edit user. --- htdocs/user/card.php | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 67407bd6d39..fde96bcc21c 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2018,23 +2018,20 @@ else print "\n"; // Accountancy code - if (! empty($conf->global->USER_ENABLE_ACCOUNTANCY_CODE)) // For the moment field is not used so must not appeared. - { - print ""; - print ''.$langs->trans("AccountancyCode").''; - print ''; - if ($caneditfield) - { - print ''; - } - else - { - print ''; - print $object->accountancy_code; - } - print ''; - print ""; - } + print ""; + print ''.$langs->trans("AccountancyCode").''; + print ''; + if ($caneditfield) + { + print ''; + } + else + { + print ''; + print $object->accountancy_code; + } + print ''; + print ""; // User color if (! empty($conf->agenda->enabled)) From 067af47955e92d257dc3fda13d2a5278d41c6557 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 22 Feb 2015 08:35:25 +0100 Subject: [PATCH 3/5] Add accountancy field on creation mode and correct rowspan. --- htdocs/user/card.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index fde96bcc21c..b8e70dcd12f 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -8,7 +8,7 @@ * Copyright (C) 2011 Herve Prot * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2015 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 @@ -980,6 +980,12 @@ if (($action == 'create') || ($action == 'adduserldap')) print ''; print ''; print "\n"; + + // Accountancy code + print ''.$langs->trans("AccountancyCode").''; + print ''; + print ''; + print ''; // User color if (! empty($conf->agenda->enabled)) @@ -1123,7 +1129,7 @@ else */ if ($action != 'edit') { - $rowspan=17; + $rowspan=19; print ''; @@ -1319,7 +1325,6 @@ else print "\n"; // Accountancy code - $rowspan++; print ''; print ''; @@ -1651,7 +1656,7 @@ else */ if ($action == 'edit' && ($canedituser || $caneditfield || $caneditpassword || ($user->id == $object->id))) { - $rowspan=15; + $rowspan=16; if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->adherent->enabled)) $rowspan++; From 47c41f6a85b4e43cbf208ebef74a51e42b5a0ff8 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 26 Feb 2015 20:47:06 +0100 Subject: [PATCH 4/5] Add a test to enable field only when module salary is used --- htdocs/user/card.php | 51 ++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index b8e70dcd12f..cf10d93fe4e 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -982,10 +982,13 @@ if (($action == 'create') || ($action == 'adduserldap')) print "\n"; // Accountancy code - print ''; - print ''; + if ($conf->salaries->enabled) + { + print ''; + print ''; + } // User color if (! empty($conf->agenda->enabled)) @@ -1325,9 +1328,12 @@ else print "\n"; // Accountancy code - print ''; - print ''; - + if ($conf->salaries->enabled) + { + print ''; + print ''; + } + // Color user if (! empty($conf->agenda->enabled)) { @@ -2023,20 +2029,23 @@ else print "\n"; // Accountancy code - print ""; - print ''; - print ''; - print ""; + if ($conf->salaries->enabled) + { + print ""; + print ''; + print ''; + print ""; + } // User color if (! empty($conf->agenda->enabled)) From 1a02f6aa806b811129edb58f2e5d10cad0f5590b Mon Sep 17 00:00:00 2001 From: fmarcet Date: Wed, 4 Mar 2015 18:18:55 +0100 Subject: [PATCH 5/5] Fix: Masks works with thirdparty type --- htdocs/contrat/card.php | 2 +- htdocs/core/modules/commande/mod_commande_saphir.php | 2 +- htdocs/core/modules/contract/mod_contract_magre.php | 2 +- htdocs/core/modules/fichinter/mod_arctic.php | 2 +- htdocs/core/modules/livraison/mod_livraison_saphir.php | 2 +- htdocs/core/modules/propale/mod_propale_saphir.php | 2 +- .../modules/supplier_invoice/mod_facture_fournisseur_tulip.php | 2 +- .../supplier_order/mod_commande_fournisseur_orchidee.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 6d10442caf7..edb20d91d35 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1097,7 +1097,7 @@ else $ref = substr($object->ref, 1, 4); if ($ref == 'PROV' && !empty($modCodeContract->code_auto)) { - $numref = $object->getNextNumRef($soc); + $numref = $object->getNextNumRef($object->thirdparty); } else { diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php index 87ba0d57c98..1996717e506 100644 --- a/htdocs/core/modules/commande/mod_commande_saphir.php +++ b/htdocs/core/modules/commande/mod_commande_saphir.php @@ -121,7 +121,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes return 0; } - $numFinal=get_next_value($db,$mask,'commande','ref','',$objsoc->code_client,$object->date); + $numFinal=get_next_value($db,$mask,'commande','ref','',$objsoc,$object->date); return $numFinal; } diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php index 289b474de5e..54da8fc55c4 100644 --- a/htdocs/core/modules/contract/mod_contract_magre.php +++ b/htdocs/core/modules/contract/mod_contract_magre.php @@ -112,7 +112,7 @@ class mod_contract_magre extends ModelNumRefContracts return 0; } - $numFinal=get_next_value($db,$mask,'contrat','ref','',$objsoc->code_client,$contract->date_contrat); + $numFinal=get_next_value($db,$mask,'contrat','ref','',$objsoc,$contract->date_contrat); return $numFinal; } diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index ab06d1417e6..278e20ae7de 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -120,7 +120,7 @@ class mod_arctic extends ModeleNumRefFicheinter return 0; } - $numFinal=get_next_value($db,$mask,'fichinter','ref','',$objsoc->code_client,$object->datec); + $numFinal=get_next_value($db,$mask,'fichinter','ref','',$objsoc,$object->datec); return $numFinal; } diff --git a/htdocs/core/modules/livraison/mod_livraison_saphir.php b/htdocs/core/modules/livraison/mod_livraison_saphir.php index 5f8a6b93686..1192656bf8d 100644 --- a/htdocs/core/modules/livraison/mod_livraison_saphir.php +++ b/htdocs/core/modules/livraison/mod_livraison_saphir.php @@ -120,7 +120,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder return 0; } - $numFinal=get_next_value($db,$mask,'livraison','ref','',$objsoc->code_client,$object->date_livraison); + $numFinal=get_next_value($db,$mask,'livraison','ref','',$objsoc,$object->date_livraison); return $numFinal; } diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php index 503d8754684..25ccecb253c 100644 --- a/htdocs/core/modules/propale/mod_propale_saphir.php +++ b/htdocs/core/modules/propale/mod_propale_saphir.php @@ -123,7 +123,7 @@ class mod_propale_saphir extends ModeleNumRefPropales $date=$propal->datep; $customercode=$objsoc->code_client; - $numFinal=get_next_value($db,$mask,'propal','ref','',$customercode,$date); + $numFinal=get_next_value($db,$mask,'propal','ref','',$objsoc,$date); return $numFinal; } diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index 15bef66bf8f..ba31d979864 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -126,7 +126,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices } //Supplier invoices take invoice date instead of creation date for the mask - $numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc->code_fournisseur,$object->date); + $numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc,$object->date); return $numFinal; } diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php index 7f74ce095c0..37b8adab22e 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php @@ -121,7 +121,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders return 0; } - $numFinal=get_next_value($db,$mask,'commande_fournisseur','ref','',$objsoc->code_fournisseur,$object->date_commande); + $numFinal=get_next_value($db,$mask,'commande_fournisseur','ref','',$objsoc,$object->date_commande); return $numFinal; }
'.$langs->trans("AccountancyCode").''.$object->accountancy_code.'
'.$langs->trans("AccountancyCode").''; - print ''; - print '
'.$langs->trans("AccountancyCode").''; + print ''; + print '
'.$langs->trans("AccountancyCode").''.$object->accountancy_code.'
'.$langs->trans("AccountancyCode").''.$object->accountancy_code.'
'.$langs->trans("AccountancyCode").''; - if ($caneditfield) - { - print ''; - } - else - { - print ''; - print $object->accountancy_code; - } - print '
'.$langs->trans("AccountancyCode").''; + if ($caneditfield) + { + print ''; + } + else + { + print ''; + print $object->accountancy_code; + } + print '