added units used to Preorder
This commit is contained in:
@@ -80,6 +80,25 @@ class Building extends mfBaseModel {
|
||||
return $code;
|
||||
}
|
||||
|
||||
public function getUsedTerminationCount($includePreorders = false) {
|
||||
if(!$this->id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$count = 0;
|
||||
|
||||
$orders = OrderModel::search(['building_id' => $this->id]);
|
||||
$count += count($orders);
|
||||
|
||||
if($includePreorders) {
|
||||
$preorders = PreorderModel::search(['building_id' => $this->id]);
|
||||
$count += count($preorders);
|
||||
}
|
||||
|
||||
return $count;
|
||||
|
||||
}
|
||||
|
||||
public function loadWorkflowItems() {
|
||||
$item_ids = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user