Ignoring cancelled orders when counting workorders in Preordercampaign

This commit is contained in:
Frank Schubert
2025-05-06 15:46:57 +02:00
parent c32d811852
commit e261b299ce

View File

@@ -125,7 +125,7 @@ class Preordercampaign extends mfBaseModel {
if($this->$name == null) {
if($name == "workorder_count") {
$wo_count = PreorderModel::count(["rimo_workorder" => true, "preordercampaign_id" => $this->id]);
$wo_count = PreorderModel::countActive(["rimo_workorder" => true, "preordercampaign_id" => $this->id]);
if($wo_count) {
$this->workorder_count = $wo_count;
}