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 add company type on filter #30267

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions htdocs/compta/stats/casoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Copyright (C) 2015 Raphaël Doursenaud <[email protected]>
* Copyright (C) 2018 Frédéric France <[email protected]>
* Copyright (C) 2022 Alexandre Spangaro <[email protected]>
* Copyright (C) 2024 Charlene Benke <[email protected]>
*
* 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
Expand Down Expand Up @@ -35,6 +36,7 @@
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';

// Load translation files required by the page
Expand Down Expand Up @@ -94,6 +96,7 @@
$date_endyear = GETPOSTINT("date_endyear");
$date_endmonth = GETPOSTINT("date_endmonth");
$date_endday = GETPOSTINT("date_endday");
$typent_id = GETPOST('typent_id', 'int');
if (empty($year)) {
$year_current = dol_print_date(dol_now(), '%Y');
$month_current = dol_print_date(dol_now(), '%m');
Expand Down Expand Up @@ -191,6 +194,9 @@
$tableparams['search_town'] = $search_town;
$tableparams['search_country'] = $search_country;
$tableparams['subcat'] = ($subcat === true) ? 'yes' : '';
if (!empty($typent_id)) {
$tableparams['typent_id'] = $typent_id;
}

// Adding common parameters
$allparams = array_merge($commonparams, $headerparams, $tableparams);
Expand Down Expand Up @@ -345,6 +351,9 @@
if ($search_country > 0) {
$sql .= ' AND s.fk_pays = '.((int) $search_country);
}
if ($typent_id >0) {
$sql .= " AND s.fk_typent = ".((int) $typent_id);
}
$sql .= " AND f.entity IN (".getEntity('invoice').")";
if ($socid) {
$sql .= " AND f.fk_soc = ".((int) $socid);
Expand Down Expand Up @@ -449,7 +458,7 @@

// Category filter
print '<tr class="liste_titre">';
print '<td class="nowraponall">';
print '<td class="nowraponall" colspan=4>';
print img_picto('', 'category', 'class="paddingrightonly"');
print $formother->select_categories(Categorie::TYPE_CUSTOMER, $selected_cat, 'search_categ', 0, $langs->trans("Category"));
print ' ';
Expand All @@ -458,8 +467,19 @@
if ($subcat) {
print ' checked';
}
print'></td>';
print '<td colspan="7" class="right">';

print'>';
// type filter (produit/service)
print ' ';
print '&nbsp;&nbsp;';
print $langs->trans("Type").': ';
Copy link
Member

Choose a reason for hiding this comment

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

In look and feel of recent version, labels of filters must be included as the placeholder of the combobox (to move into the param$shwo_empty of selectarray

$formcompany = new FormCompany($db);
// NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label.
$sortparam = getDolGlobalString("SOCIETE_SORT_ON_TYPEENT", 'ASC');

Check failure on line 478 in htdocs/compta/stats/casoc.php

View workflow job for this annotation

GitHub Actions / pre-commit / pre-commit

Whitespace found at end of line

Check warning on line 478 in htdocs/compta/stats/casoc.php

View workflow job for this annotation

GitHub Actions / phan / Run phan

casoc.php: PhanPluginWhitespaceTrailing: The first occurrence of trailing whitespace was seen here.
print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 1, 0, 0, '', 0, 0, 0, $sortparam, '', 1);

print '</td>';
print '<td colspan="3" class="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"), 'search.png', '', '', 1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '</td>';
print '</tr>';
Expand Down
Loading