Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW #24031 add option MAIN_GRANDTOTAL_LIST_SHOW to always show grand total to lists #27247

Merged
merged 8 commits into from
Feb 12, 2024

Conversation

vmaury
Copy link
Contributor

@vmaury vmaury commented Dec 29, 2023

#Fix #24031 add - if option selected - grand total to lists

The grand total displays :

  • if option selected in admin -> ihm -> other
  • if total number of lines > number of lines displayed in the screen

Translations done in english and french

@eldy eldy changed the title Fix #24031 add - if option selected - grand total to lists NEW #24031 add - if option selected - grand total to lists Jan 2, 2024
@eldy
Copy link
Member

eldy commented Jan 2, 2024

Can you provide a screenshot of result ?

@vmaury
Copy link
Contributor Author

vmaury commented Jan 2, 2024

Grand Total in a list : TotGen

NB : I added a new css class
<tr class="liste_grandtotal">
to customize the grand total row if necessary

Grand Total display conf :
TotGenConf

(I let it not displayed by default because you said in summer DevCamp that it could disturb some users ...

$sumsarray = false;
$tbsumfields = [];
foreach ($totalarray['pos'] as $field) {
$tbsumfields[] = "sum($field) as `$field`";
Copy link
Member

@eldy eldy Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use of backtick ` is forbidden in SQL as it is not a SQL standard.
May be you can do:

$fieldforsum = preg_replace('/[^a-z0-9]/', '', $field);
$tbsumfields[] = "sum($field) as $fieldforsum";

@eldy eldy added the PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do) label Jan 12, 2024
@eldy eldy changed the title NEW #24031 add - if option selected - grand total to lists NEW #24031 add option MAIN_GRANDTOTAL_LIST_SHOW to always show grand total to lists Feb 12, 2024
@eldy eldy merged commit e89f930 into Dolibarr:develop Feb 12, 2024
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add grand total to lists
2 participants