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

Add filter by customer sellers #31049

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Changes from 2 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
9 changes: 8 additions & 1 deletion htdocs/compta/stats/cabyprodserv.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
$selected_cat = GETPOST('search_categ', 'intcomma');
$selected_catsoc = GETPOST('search_categ_soc', 'intcomma');
$selected_soc = GETPOST('search_soc', 'intcomma');
$selected_commercial = GETPOST('search_commercial', 'int');
$typent_id = GETPOST('typent_id', 'int');
$subcat = false;
if (GETPOST('subcat', 'alpha') === 'yes') {
Expand Down Expand Up @@ -406,7 +407,10 @@
if ($typent_id > 0) {
$sql .= " AND soc.fk_typent = ".((int) $typent_id);
}

if ($selected_commercial > 0) {
$sql.= " AND EXISTS (SELECT sc.rowid FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE f.fk_soc = sc.fk_soc";
$sql.= " AND sc.fk_user = ".$selected_commercial.")";
defrance marked this conversation as resolved.
Show resolved Hide resolved
}
$sql .= " AND f.entity IN (".getEntity('invoice').")";

$parameters = array();
Expand Down Expand Up @@ -486,6 +490,9 @@
print '<br>';
print img_picto('', 'company', 'class="pictofixedwidth"');
print $form->select_company($selected_soc, 'search_soc', '', $langs->trans("ThirdParty"));
print '&nbsp; &nbsp;';
print $langs->trans("Commercial").': ';
print $form->select_dolusers($selected_commercial, 'search_commercial', 1);
defrance marked this conversation as resolved.
Show resolved Hide resolved
print '</td>';

print '<td colspan="5" class="right">';
Expand Down
Loading