diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index e751cf1899f..fd6be317ae3 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -195,7 +195,7 @@ class BookKeeping extends CommonObject // First check if line not yet already in bookkeeping. // Note that we must include doc_type - fk_doc - numero_compte - label to be sure to have unicity of line (we may have several lines - // with same doc_type, fk_odc, numero_compte for 1 invoice line when using localtaxes with same account) + // with same doc_type, fk_doc, numero_compte for 1 invoice line when using localtaxes with same account) // WARNING: This is not reliable, label may have been modified. This is just a small protection. // The page to make journalization make the test on couple doc_type - fk_doc only. $sql = "SELECT count(*) as nb"; @@ -1617,11 +1617,11 @@ class BookKeeping extends CommonObject $error++; } $sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element.'(doc_date, doc_type,'; - $sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,'; + $sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,'; $sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num)'; $sql .= 'SELECT doc_date, doc_type,'; - $sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,'; + $sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,'; $sql .= ' numero_compte, label_compte, label_operation, debit, credit,'; $sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, '.$next_piecenum.''; $sql .= ' FROM '.MAIN_DB_PREFIX . $this->table_element.'_tmp WHERE piece_num = '.$piece_num; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 9d61ea07afa..ac3e6890cf4 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -219,7 +219,9 @@ class Adherent extends CommonObject // Substitutions $substitutionarray=array( - '__CIVILITY__'=>$this->getCivilityLabel(), + '__ID__'=>$this->id, + '__MEMBER_ID__'=>$this->id, + '__CIVILITY__'=>$this->getCivilityLabel(), '__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname, '__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname, '__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs), @@ -576,7 +578,7 @@ class Adherent extends CommonObject $lthirdparty=new Societe($this->db); $result=$lthirdparty->fetch($this->fk_soc); - if ($result >= 0) + if ($result > 0) { $lthirdparty->address=$this->address; $lthirdparty->zip=$this->zip; @@ -598,7 +600,7 @@ class Adherent extends CommonObject $error++; } } - else + elseif ($result < 0) { $this->error=$lthirdparty->error; $error++; @@ -687,7 +689,6 @@ class Adherent extends CommonObject $this->db->rollback(); return -1; } - } /** diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 53d1ff60836..a41438c4097 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -347,7 +347,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! if (! $error) { // Send confirmation Email - if ($object->email && $sendalsoemail) + if ($object->email && $sendalsoemail) // $object is 'Adherent' { $subject = ''; $msg= ''; @@ -859,8 +859,16 @@ if ($rowid > 0) { $tmpcompany = new Societe($db); $tmpcompany->name=$companyname; - $customercode = $tmpcompany->get_codeclient($tmpcompany,0); - $formquestion[]=array('label' => $langs->trans("CustomerCode"), 'type' => 'text', 'name' => 'customercode', 'value' => $customercode, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'); + $tmpcompany->get_codeclient($tmpcompany, 0); + $customercode = $tmpcompany->code_client; + $formquestion[]=array( + 'label' => $langs->trans("CustomerCode"), + 'type' => 'text', + 'name' => 'customercode', + 'value' => $customercode, + 'morecss' => 'minwidth300', + 'moreattr' => 'maxlength="128"', + ); } // @TODO Add other extrafields mandatory for thirdparty creation diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index e78a8e089ed..49a4df25b2a 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -191,7 +191,7 @@ print ''."\n"; // AGENDA REMINDER EMAIL -if ($conf->global->MAIN_FEATURES_LEVEL > 0) +if ($conf->global->MAIN_FEATURES_LEVEL == 2) { print '
'.$langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts').'