Small ajust on accountancy setup (#37622)

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Alexandre SPANGARO 2026-03-29 22:44:07 +02:00 committed by GitHub
parent 31d65cf047
commit 6ff4e945e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 6 deletions

View file

@ -66,7 +66,8 @@ $nbletter = GETPOSTINT('ACCOUNTING_LETTERING_NBLETTERS');
$formSetup = new FormSetup($db);
// Main options
$formSetup->newItem('BANK_DISABLE_DIRECT_INPUT')->setAsYesNo();
$item = $formSetup->newItem('BANK_DISABLE_DIRECT_INPUT')->setAsYesNo();
$item->fieldParams['tdOutputFieldClass'] = 'right';
// Auxiliary account select mode
$arrval = array(
@ -79,20 +80,26 @@ $arrval = array(
$item = $formSetup->newItem('ACCOUNTANCY_AUXACCOUNT_USE_SEARCH_TO_SELECT');
$item->setAsSelect($arrval);
$item->helpText = $langs->trans('UseSearchToSelectAuxAccountTooltip');
$item->cssClass = 'minwidth300 maxwidth400';
$item->fieldParams['tdOutputFieldClass'] = 'right';
$item = $formSetup->newItem('ACCOUNTING_MANAGE_ZERO')->setAsYesNo();
$item->helpText = $langs->trans('ACCOUNTING_MANAGE_ZERO2');
$item->fieldParams['helpText'] = 'noclick';
$item->fieldParams['forcereload'] = 1;
$item->fieldParams['tdOutputFieldClass'] = 'right';
if (!getDolGlobalInt('ACCOUNTING_MANAGE_ZERO')) {
$item = $formSetup->newItem('ACCOUNTING_LENGTH_GACCOUNT')->setAsString();
$item->fieldAttr['type'] = 'number';
$item->fieldAttr['class'] = 'maxwidth50 right';
$item->fieldAttr['class'] = 'maxwidth50';
$item->fieldParams['tdOutputFieldClass'] = 'right';
$item = $formSetup->newItem('ACCOUNTING_LENGTH_AACCOUNT')->setAsString();
$item->fieldAttr['type'] = 'number';
$item->fieldAttr['class'] = 'maxwidth50 right';
$item->fieldAttr['class'] = 'maxwidth50';
$item->fieldParams['tdOutputFieldClass'] = 'right';
}
// Parameters ACCOUNTING_* and others

View file

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2021 John BOTELLA <john.botella@atm-consulting.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2021 John BOTELLA <john.botella@atm-consulting.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
*
* 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
@ -337,12 +338,16 @@ class FormSetup
$out = '';
if ($item->enabled == 1) {
$trClass = 'oddeven';
$tdOutputFieldClass = '';
if ($item->getType() == 'title') {
$trClass = 'liste_titre';
}
if (!empty($item->fieldParams['trClass'])) {
$trClass .= ' '.$item->fieldParams['trClass'];
}
if (!empty($item->fieldParams['tdOutputFieldClass'])) {
$tdOutputFieldClass .= ' class="'.$item->fieldParams['tdOutputFieldClass'].'"';
}
$this->setupNotEmpty++;
$out .= '<tr class="'.$trClass.'">';
@ -353,7 +358,7 @@ class FormSetup
$out .= '</span>';
$out .= '</td>';
$out .= '<td>';
$out .= '<td'.$tdOutputFieldClass.'>';
if ($editMode) {
$out .= $item->generateInputField();