diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php
index d68f4e79f5e..92d493b8b29 100644
--- a/htdocs/accountancy/class/accountancycategory.class.php
+++ b/htdocs/accountancy/class/accountancycategory.class.php
@@ -839,20 +839,29 @@ class AccountancyCategory // extends CommonObject
exit();
}
+ $pcgverid = $conf->global->CHARTOFACCOUNTS;
+ $pcgvercode = dol_getIdFromCode($this->db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version');
+ if (empty($pcgvercode)) {
+ $pcgvercode = $pcgverid;
+ }
+
if (!empty($cat_id)) {
$sql = "SELECT t.rowid, t.account_number, t.label as account_label";
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as t";
$sql .= " WHERE t.fk_accounting_category = ".((int) $cat_id);
$sql .= " AND t.entity = ".$conf->entity;
+ $sql .= " AND t.active = 1";
+ $sql .= " AND t.fk_pcg_version = '".$this->db->escape($pcgvercode)."'";
$sql .= " ORDER BY t.account_number";
} else {
$sql = "SELECT t.rowid, t.account_number, t.label as account_label";
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as t";
$sql .= " WHERE ".$predefinedgroupwhere;
$sql .= " AND t.entity = ".$conf->entity;
+ $sql .= ' AND t.active = 1';
+ $sql .= " AND t.fk_pcg_version = '".$this->db->escape($pcgvercode)."'";
$sql .= " ORDER BY t.account_number";
}
- //echo $sql;
$resql = $this->db->query($sql);
if ($resql) {
diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php
index 0c44bfd5b28..a7197d7c9ae 100644
--- a/htdocs/core/class/commoninvoice.class.php
+++ b/htdocs/core/class/commoninvoice.class.php
@@ -667,7 +667,7 @@ abstract class CommonInvoice extends CommonObject
* conditions and billing date.
*
* @param integer $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition.
- * @return integer Date limite de reglement si ok, <0 si ko
+ * @return integer Date limit of payment if OK, <0 if KO
*/
public function calculate_date_lim_reglement($cond_reglement = 0)
{
@@ -678,6 +678,9 @@ abstract class CommonInvoice extends CommonObject
if (!$cond_reglement) {
$cond_reglement = $this->cond_reglement_id;
}
+ if (!$cond_reglement) {
+ return $this->date;
+ }
$cdr_nbjour = 0;
$cdr_type = 0;
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index d32f1c6e58b..26c5beb0b73 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -8359,7 +8359,7 @@ abstract class CommonObject
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER) && ($action == 'view' || $action == 'valid' || $action == 'editline' || $action == 'confirm_valid' || $action == 'confirm_cancel')) {
$out .= '
';
}
- $out .= '';
$out .= ' array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"),
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>'1', 'position'=>15, 'notnull'=>1, 'visible'=>-2, 'default'=>'1', 'index'=>1,),
- 'fk_type' => array('type'=>'integer:PartnershipType:partnership/class/partnership_type.class.php:0:active=1', 'label'=>'Type', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>1,),
+ 'fk_type' => array('type'=>'integer:PartnershipType:partnership/class/partnership_type.class.php:0:active=1', 'label'=>'Type', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>1, 'csslist'=>'tdoverflowmax100'),
+ 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax125',),
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,),
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
@@ -121,7 +122,6 @@ class Partnership extends CommonObject
'count_last_url_check_error' => array('type'=>'integer', 'label'=>'CountLastUrlCheckError', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>-2, 'default'=>'0',),
'last_check_backlink' => array('type'=>'datetime', 'label'=>'LastCheckBacklink', 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>-2,),
'reason_decline_or_cancel' => array('type'=>'text', 'label'=>'ReasonDeclineOrCancel', 'enabled'=>'1', 'position'=>73, 'notnull'=>0, 'visible'=>-2,),
- 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150',),
'ip' => array('type'=>'varchar(250)', 'label'=>'Ip', 'enabled'=>'1', 'position'=>74, 'notnull'=>0, 'visible'=>-2,),
);
public $rowid;
diff --git a/htdocs/product/stock/tpl/extrafields_add.tpl.php b/htdocs/product/stock/tpl/extrafields_add.tpl.php
index 144c638a1cf..951704a4352 100644
--- a/htdocs/product/stock/tpl/extrafields_add.tpl.php
+++ b/htdocs/product/stock/tpl/extrafields_add.tpl.php
@@ -42,8 +42,14 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object,
print $hookmanager->resPrint;
if (empty($reshook)) {
$params = array();
- if (isset($tpl_context)) $params['tpl_context'] = $tpl_context;
- $params['cols'] = $parameters['colspanvalue'];
+ $params['cols'] = key_exists('colspanvalue', $parameters) ? $parameters['colspanvalue'] : '';
+ if (!empty($parameters['tdclass'])) {
+ $params['tdclass'] = $parameters['tdclass'];
+ }
+ if (!empty($parameters['tpl_context'])) {
+ $params['tpl_context'] = $parameters['tpl_context'];
+ }
+
print $object->showOptionals($extrafields, 'create', $params);
}
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index 56bf2d3bd8d..953040d73af 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -506,7 +506,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // fetch optio
llxHeaderVierge($langs->trans("NewSubscription"));
-
+print '
';
print load_fiche_titre($langs->trans("NewSubscription"), '', '', 0, 0, 'center');
@@ -686,7 +686,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW
print '
'.$langs->trans("Public").' '."\n";
// Other attributes
- $tpl_context = 'public'; // define template context to public
+ $parameters['tpl_context']='public'; // define template context to public
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
// Comments
diff --git a/htdocs/public/partnership/new.php b/htdocs/public/partnership/new.php
index 49e7d986eb2..4fa4d25e543 100644
--- a/htdocs/public/partnership/new.php
+++ b/htdocs/public/partnership/new.php
@@ -535,7 +535,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // fetch optio
llxHeaderVierge($langs->trans("NewPartnershipRequest"));
-
+print '
';
print load_fiche_titre($langs->trans("NewPartnershipRequest"), '', '', 0, 0, 'center');
@@ -577,44 +577,25 @@ jQuery(document).ready(function () {
';
-print '
'."\n";
-
// Type
-/*
-if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE)) {
- $listoftype = $partnershipt->liste_array();
- $tmp = array_keys($listoftype);
- $defaulttype = '';
- $isempty = 1;
- if (count($listoftype) == 1) {
- $defaulttype = $tmp[0];
- $isempty = 0;
- }
- print ''.$langs->trans("Type").' * ';
- print $form->selectarray("typeid", $partnershipt->liste_array(1), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty);
- print ' '."\n";
-} else {
- $partnershipt->fetch($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE);
- print ' ';
-}
-*/
-
$partnershiptype = new PartnershipType($db);
-$listofpartnershipobj = $partnershiptype->fetchAll('', '', 1000);
+$listofpartnershipobj = $partnershiptype->fetchAll('', '', 1000, 0, array('active'=>1));
$listofpartnership = array();
foreach ($listofpartnershipobj as $partnershipobj) {
$listofpartnership[$partnershipobj->id] = $partnershipobj->label;
}
-if (empty($conf->global->PARTNERSHIP_NEWFORM_FORCETYPE)) {
- print ''.$langs->trans('PartnershipType').' * '."\n";
- print $form->selectarray("partnershiptype", $listofpartnership, GETPOSTISSET('partnershiptype') ? GETPOST('partnershiptype', 'int') : 'ifone', 1);
- print ' '."\n";
-} else {
+if (getDolGlobalString('PARTNERSHIP_NEWFORM_FORCETYPE')) {
print $listofpartnership[$conf->global->PARTNERSHIP_NEWFORM_FORCETYPE];
print ' ';
}
+print ''."\n";
+if (!getDolGlobalString('PARTNERSHIP_NEWFORM_FORCETYPE')) {
+ print ''.$langs->trans('PartnershipType').' * '."\n";
+ print $form->selectarray("partnershiptype", $listofpartnership, GETPOSTISSET('partnershiptype') ? GETPOST('partnershiptype', 'int') : 'ifone', 1);
+ print ' '."\n";
+}
// Company
print ''.$langs->trans("Company").' * ';
print img_picto('', 'company', 'class="pictofixedwidth"');
@@ -668,7 +649,8 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
// Logo
//print ' '.$langs->trans("URLPhoto").' '."\n";
// Other attributes
-$tpl_context = 'public'; // define template context to public
+$parameters['tdclass']='titlefieldauto';
+$parameters['tpl_context']='public'; // define template context to public
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
// Comments
print '';
diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php
index a70667ccb31..5644123392b 100644
--- a/htdocs/public/project/new.php
+++ b/htdocs/public/project/new.php
@@ -534,7 +534,7 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
}
// Other attributes
-$tpl_context = 'public'; // define template context to public
+$parameters['tpl_context']='public'; // define template context to public
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
// Comments
print ' ';
'; print load_fiche_titre($langs->trans("NewSubscription"), '', '', 0, 0, 'center'); @@ -686,7 +686,7 @@ if (!empty($conf->global->MEMBER_SKIP_TABLE) || !empty($conf->global->MEMBER_NEW print '
'; print load_fiche_titre($langs->trans("NewPartnershipRequest"), '', '', 0, 0, 'center'); @@ -577,44 +577,25 @@ jQuery(document).ready(function () { '; -print '