PreorderBilling

This commit is contained in:
Frank Schubert
2025-03-31 13:50:49 +02:00
parent 21655c5ff4
commit 17405c8c5d
17 changed files with 704 additions and 43 deletions
@@ -52,7 +52,7 @@ class PreorderHistoryModel {
} else {
$sql .= " ORDER BY `create` DESC LIMIT 1";
}
//mfLoghandler::singleton()->debug($sql);
mfLoghandler::singleton()->debug($sql);
$res = FronkDB::singleton()->query($sql);
if(FronkDB::singleton()->num_rows($res)) {
$data = FronkDB::singleton()->fetch_object($res);
@@ -72,7 +72,7 @@ class PreorderHistoryModel {
foreach(PreorderstatusModel::getAll() as $status) {
if($status->code < $status_code) continue;
$change = self::getStatusChange("first", $preorder_id, $status_code);
$change = self::getStatusChange("first", $preorder_id, $status->code);
if($change) return $change;
}
@@ -80,10 +80,11 @@ class PreorderHistoryModel {
}
public static function getLastStatusChangeToOrHigher($preorder_id, $status_code) {
foreach(PreorderstatusModel::getAll() as $status) {
$codes = PreorderstatusModel::getAll();
foreach($codes as $status) {
if($status->code < $status_code) continue;
$change = self::getStatusChange("last", $preorder_id, $status_code);
$change = self::getStatusChange("last", $preorder_id, $status->code);
if($change) return $change;
}