changed stats calculation

This commit is contained in:
Luca Haid
2025-09-18 08:34:48 +00:00
parent a4b65759e2
commit 952dddef7e

View File

@@ -1190,7 +1190,7 @@ class PreorderModel
public static function countActivePreorder($preorderCampaignId = null) {
$db = FronkDB::singleton();
$where = " AND h.rimo_op_state != 'Not2Connect' AND h.rimo_ex_state != 'Gross planning'";
$where = " AND !(h.rimo_op_state = 'Not2Connect' AND h.rimo_ex_state = 'Gross planning')";
if ($preorderCampaignId) {
$where .= " AND p.preordercampaign_id = $preorderCampaignId";
}
@@ -1230,7 +1230,7 @@ class PreorderModel
public static function countTotalUnits($preorderCampaignId = null) {
$db = FronkDB::singleton();
$where = " h.rimo_type != 'greenfield' AND h.rimo_op_state != 'Not2Connect' AND h.rimo_ex_state != 'Gross planning'";
$where = " h.rimo_type != 'greenfield' AND !(h.rimo_op_state = 'Not2Connect' AND h.rimo_ex_state = 'Gross planning')";
if ($preorderCampaignId) {
$where .= " AND pc.id = $preorderCampaignId";
}