From 54af96b21bc4e565fa824d4e693f55765551b2d0 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Thu, 24 Mar 2016 11:38:05 +0100 Subject: [PATCH 1/4] Add : BILL_NEVER_BE_CANCELED In some case we don't want to allow cancel bill, forced to made an avoir --- htdocs/compta/facture.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b6469da3168..a1d22005d01 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3953,6 +3953,7 @@ else if ($id > 0 || ! empty($ref)) } // Classify 'closed not completely paid' (possible si validee et pas encore classee payee) + if ($object->statut == 1 && $object->paye == 0 && $resteapayer > 0 && $user->rights->facture->paiement) { if ($totalpaye > 0 || $totalcreditnotes > 0) @@ -3962,10 +3963,16 @@ else if ($id > 0 || ! empty($ref)) } else { - if ($objectidnext) { - print '
' . $langs->trans('ClassifyCanceled') . '
'; - } else { - print '
' . $langs->trans('ClassifyCanceled') . '
'; + if ( empty($conf->global->BILL_NEVER_BE_CANCELED)) + { + if ($objectidnext) + { + print '
' . $langs->trans('ClassifyCanceled') . '
'; + } + else + { + print '
' . $langs->trans('ClassifyCanceled') . '
'; + } } } } From 6443170c4de73646ed0e7b285a4443d053a03c41 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Fri, 25 Mar 2016 17:19:45 +0100 Subject: [PATCH 2/4] FIX : Qual and some little fix --- .../adherents/class/adherent_type.class.php | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index af98d7162da..71f41d84e00 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2002 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2009 Regis Houssin + * Copyright (C) 2016 Charlie Benke * * 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 @@ -35,10 +36,14 @@ class AdherentType extends CommonObject public $table_element = 'adherent_type'; public $element = 'adherent_type'; + var $id; + var $ref; var $libelle; - var $cotisation; // Soumis a la cotisation - var $vote; // droit de vote - var $mail_valid; //mail envoye lors de la validation + var $cotisation; // Soumis a la cotisation + var $note; + var $vote; // droit de vote + var $mail_valid; //mail envoye lors de la validation + var $statut; /** @@ -110,7 +115,7 @@ class AdherentType extends CommonObject $sql.= "note = '".$this->db->escape($this->note)."',"; $sql.= "vote = '".$this->vote."',"; $sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'"; - $sql .= " WHERE rowid = $this->id"; + $sql .= " WHERE rowid =".$this->id; $result = $this->db->query($sql); if ($result) @@ -164,7 +169,7 @@ class AdherentType extends CommonObject return 1; } else - { + { return 0; } } @@ -223,7 +228,7 @@ class AdherentType extends CommonObject { global $conf,$langs; - $projets = array(); + $adherenttypes = array(); $sql = "SELECT rowid, libelle"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type"; @@ -241,7 +246,7 @@ class AdherentType extends CommonObject { $obj = $this->db->fetch_object($resql); - $projets[$obj->rowid] = $langs->trans($obj->libelle); + $adherenttypes[$obj->rowid] = $langs->trans($obj->libelle); $i++; } } @@ -250,8 +255,7 @@ class AdherentType extends CommonObject { print $this->db->error(); } - - return $projets; + return $adherenttypes; } @@ -308,7 +312,7 @@ class AdherentType extends CommonObject function getMailOnSubscription() { global $conf; - + // mail_subscription not defined so never used if (! empty($this->mail_subscription) && trim(dol_htmlentitiesbr_decode($this->mail_subscription))) // Property not yet defined { return $this->mail_subscription; @@ -327,7 +331,7 @@ class AdherentType extends CommonObject function getMailOnResiliate() { global $conf; - + // NOTE mail_resiliate not defined so never used if (! empty($this->mail_resiliate) && trim(dol_htmlentitiesbr_decode($this->mail_resiliate))) // Property not yet defined { return $this->mail_resiliate; From 767ce063df661009fc152d7ea466a36222e00bf2 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Fri, 25 Mar 2016 18:16:05 +0100 Subject: [PATCH 3/4] Change done --- htdocs/compta/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index a1d22005d01..f05f638e060 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3963,7 +3963,7 @@ else if ($id > 0 || ! empty($ref)) } else { - if ( empty($conf->global->BILL_NEVER_BE_CANCELED)) + if ( empty($conf->global->INVOICE_CAN_NEVER_BE_CANCELED)) { if ($objectidnext) { From 51b82eba43bfb67ed28ed709805eda420cd26c26 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Fri, 25 Mar 2016 18:19:51 +0100 Subject: [PATCH 4/4] if we not allowed to edit we don't edit --- htdocs/adherents/type.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index f46b6d0268c..bae064bef34 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -200,7 +200,10 @@ if (! $rowid && $action != 'create' && $action != 'edit') print ''.dol_escape_htmltag($objp->libelle).''; print ''.yn($objp->cotisation).''; print ''.yn($objp->vote).''; - print 'rowid.'">'.img_edit().''; + if ($user->rights->adherent->configurer) + print 'rowid.'">'.img_edit().''; + else + print ' '; print ""; $i++; }