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

FIX - Filter status orders in list no invoiced if validated + in progress + delivered #24411

Merged
merged 2 commits into from
Apr 4, 2023
Merged
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
10 changes: 5 additions & 5 deletions htdocs/commande/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -888,19 +888,19 @@
if ($search_status == 1 && empty($conf->expedition->enabled)) {
$sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status 'sending in process' into 'validated'
} else {
$sql .= ' AND c.fk_statut = '.((int) $search_status); // brouillon, validee, en cours, annulee
$sql .= ' AND c.fk_statut = '.((int) $search_status); // draft, validated, in process or canceled
}
}
if ($search_status == -2) { // To process
if ($search_status == -2) { // "validated + in process"
//$sql.= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0';
$sql .= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected
}
if ($search_status == -3) { // To bill
if ($search_status == -3) { // "validated + in process + delivered"
//$sql.= ' AND c.fk_statut in (1,2,3)';
//$sql.= ' AND c.facture = 0'; // invoice not created
$sql .= ' AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))'; // validated, in process or closed but not billed
$sql .= ' AND (c.fk_statut IN (1,2,3))'; // validated, in process or closed
}
if ($search_status == -4) { // "validate and in progress"
if ($search_status == -4) { // "validate + in progress"
$sql .= ' AND (c.fk_statut IN (1,2))'; // validated, in process
}
}
Expand Down