diff --git a/.gitignore b/.gitignore
index 434764e4f06..a582d0807a3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,6 +52,7 @@ dev/build/node_modules/
node_modules/
vendor/
+php-vendor
tmp/
#yarn
diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php
index 142d82f7ee8..f2c11adb4db 100644
--- a/htdocs/accountancy/bookkeeping/card.php
+++ b/htdocs/accountancy/bookkeeping/card.php
@@ -198,6 +198,11 @@ if (empty($reshook)) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors');
$action = '';
}
+ $subledger_account_str = is_array($subledger_account) ? reset($subledger_account) : (string) $subledger_account;
+ if (!checkGeneralAccountAllowsAuxiliary($db, $accountingaccount_number, $subledger_account_str)) {
+ $error++;
+ setEventMessages($langs->trans("ErrorAccountNotCentralized"). ". " . $langs->trans("RemoveSubsidiaryAccountOrAdjustTheGeneralAccount"), null, 'errors');
+ }
if (!$error) {
if (GETPOSTINT('doc_datemonth') && GETPOSTINT('doc_dateday') && GETPOSTINT('doc_dateyear')) {
@@ -520,6 +525,29 @@ if ($action == 'delete') {
print $formconfirm;
}
+// Update fields properties in realtime
+if (!empty($conf->use_javascript_ajax)) {
+ print "\n" . '' . "\n";
+}
+
if ($action == 'create') {
print load_fiche_titre($title);
@@ -995,7 +1023,7 @@ if ($action == 'create') {
print 'subledger_account).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">';
}
// Add also input for subledger label
- print '
subledger_label).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
+ print '
subledger_label).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
print '';
print '
| ';
- if (!$customprinterallowed) {
+ if (!$customprinterallowed) { // @phpstan-ignore-line
print ''.$langs->trans("NotAvailableForCountryWhenModuleIsOn", $mysoc->country_code, $langs->transnoentitiesnoconv('Module3200Name')).'';
} else {
print $form->selectarray('TAKEPOS_PRINTER_TO_USE'.$terminal, $printers, getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$terminal), 1);
diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index 7997bcbbd14..faf1efec99b 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -3,7 +3,7 @@
* Copyright (C) 2019 Josep Lluís Amador '.$langs->trans("PrintTicket").' ', 'action' => 'TakeposPrinting(placeid);');
}
- } elseif ($customprinterallowed && (isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
+ } elseif ($customprinterallowed && (isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { // @phpstan-ignore-line
// Button Print Receipt on special printer
$menus[$r++] = array('title' => ''.$langs->trans("PrintTicket").' ', 'action' => 'DolibarrTakeposPrinting(placeid);');
} else {
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index 403e7cdcd23..ff79d9a72a0 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -1331,7 +1331,7 @@ if (empty($reshook)) {
} else {
$sectionwithinvoicelink .= ' ';
}
- } elseif ($customprinterallowed && (isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
+ } elseif ($customprinterallowed && (isModEnabled('receiptprinter') && getDolGlobalInt('TAKEPOS_PRINTER_TO_USE'.$term) > 0) || getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") { // @phpstan-ignore-line
// If we set to use a specific receipt printer
$sectionwithinvoicelink .= ' ';
} else {
diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php
index daf4a37da60..0bffff2fcb4 100644
--- a/htdocs/ticket/index.php
+++ b/htdocs/ticket/index.php
@@ -339,9 +339,9 @@ if ($user->hasRight('ticket', 'read')) {
$sql .= " category.code as category_code, category.label as category_label,";
$sql .= " severity.code as severity_code, severity.label as severity_label";
$sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
- $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code=t.type_code";
- $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code=t.category_code";
- $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code=t.severity_code";
+ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code = t.type_code AND type.entity = t.entity";
+ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code = t.category_code AND category.entity = t.entity";
+ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code = t.severity_code AND severity.entity = t.entity";
if (!$user->hasRight('societe', 'client', 'voir')) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php
index 8d8678fe456..0528d43a504 100644
--- a/htdocs/user/class/api_users.class.php
+++ b/htdocs/user/class/api_users.class.php
@@ -763,7 +763,7 @@ class Users extends DolibarrApi
throw new RestException(404, 'Group not found');
}
- return $this->_cleanObjectDatas($group_static);
+ return $this->_cleanUserGroup($group_static);
}
/**
@@ -1148,6 +1148,109 @@ class Users extends DolibarrApi
return $object;
}
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
+ /**
+ * Clean sensible usergroup object datas
+ *
+ * @param Object $object Object to clean
+ * @return Object Object with cleaned properties
+ */
+ private function _cleanUserGroup($object)
+ {
+ // phpcs:enable
+ $object = parent::_cleanObjectDatas($object);
+
+ unset($object->actiontypecode);
+ unset($object->all_permissions_are_loaded);
+ unset($object->array_languages);
+ unset($object->array_options);
+ unset($object->barcode_type_coder);
+ unset($object->barcode_type);
+ unset($object->canvas);
+ unset($object->civility_code);
+ unset($object->civility_id);
+ unset($object->clicktodial_loaded);
+ unset($object->cond_reglement_id);
+ unset($object->cond_reglement_supplier_id);
+ unset($object->contact_id);
+ unset($object->contacts_ids_internal);
+ unset($object->contacts_ids);
+ unset($object->country_code);
+ unset($object->country_id);
+ unset($object->date_cloture);
+ unset($object->date_creation);
+ unset($object->date_modification);
+ unset($object->date_validation);
+ unset($object->default_values);
+ unset($object->demand_reason_id);
+ unset($object->deposit_percent);
+ unset($object->extraparams);
+ unset($object->firstname);
+ unset($object->fk_account);
+ unset($object->fk_delivery_address);
+ unset($object->fk_incoterms);
+ unset($object->fk_multicurrency);
+ unset($object->fk_project);
+ unset($object->fk_user_creat);
+ unset($object->fk_user_modif);
+ unset($object->globalgroup);
+ unset($object->import_key);
+ unset($object->last_main_doc);
+ unset($object->lastname);
+ unset($object->lastsearch_values_tmp);
+ unset($object->lastsearch_values);
+ unset($object->ldap_sid);
+ unset($object->libelle_incoterms);
+ unset($object->lines);
+ unset($object->linkedObjectsIds);
+ unset($object->location_incoterms);
+ unset($object->members);
+ unset($object->mode_reglement_id);
+ unset($object->module);
+ unset($object->multicurrency_code);
+ unset($object->multicurrency_total_ht);
+ unset($object->multicurrency_total_localtax1);
+ unset($object->multicurrency_total_localtax2);
+ unset($object->multicurrency_total_ttc);
+ unset($object->multicurrency_total_tva);
+ unset($object->multicurrency_tx);
+ unset($object->nb_rights);
+ unset($object->nb_users);
+ unset($object->origin_id);
+ unset($object->origin_type);
+ unset($object->product);
+ unset($object->ref_ext);
+ unset($object->ref);
+ unset($object->region_id);
+ unset($object->retained_warranty_fk_cond_reglement);
+ unset($object->rights);
+ unset($object->search_sid);
+ unset($object->shipping_method_id);
+ unset($object->shipping_method);
+ unset($object->specimen);
+ unset($object->state_id);
+ unset($object->status);
+ unset($object->statut);
+ unset($object->total_ht);
+ unset($object->total_localtax1);
+ unset($object->total_localtax2);
+ unset($object->total_ttc);
+ unset($object->total_tva);
+ unset($object->totalpaid_multicurrency);
+ unset($object->totalpaid);
+ unset($object->transport_mode_id);
+ unset($object->TRIGGER_PREFIX);
+ unset($object->user_closing_id);
+ unset($object->user_creation_id);
+ unset($object->user_modification_id);
+ unset($object->user_validation_id);
+ unset($object->user);
+ unset($object->usergroup_entity);
+ unset($object->warehouse_id);
+
+ return $object;
+ }
+
/**
* Clean sensible user group list datas
*
diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php
index 11eced74db7..0c18ad04a42 100644
--- a/htdocs/user/class/usergroup.class.php
+++ b/htdocs/user/class/usergroup.class.php
@@ -178,6 +178,7 @@ class UserGroup extends CommonObject
}
$this->name = $this->nom; // For compatibility with field name
+ $this->note_private = $this->note; // For compatibility with old field note
if ($result) {
if ($load_members) {
diff --git a/htdocs/user/document.php b/htdocs/user/document.php
index 71fed54897c..57e177c9ee8 100644
--- a/htdocs/user/document.php
+++ b/htdocs/user/document.php
@@ -157,7 +157,7 @@ if ($object->id && $upload_dir !== null) {
}
$head = user_prepare_head($object);
- print dol_get_fiche_head($head, 'document', $langs->trans("User"), -1, 'user');
+ print dol_get_fiche_head($head, 'document', $langs->trans("User"), -1, 'user', 0, '', '', 0, '', 1);
$linkback = '';
if ($user->hasRight("user", "user", "read") || $user->admin) {
|