Skip to content

Commit 08655d6

Browse files
authored
fix: Paid invoice changes status to Paid (#399)
1 parent 23109d0 commit 08655d6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

inc/order.class.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,14 +2146,18 @@ public static function updateBillState($ID)
21462146

21472147
$order = new self();
21482148
$order->getFromDB($ID);
2149+
$conf = PluginOrderConfig::getConfig();
21492150
if ($all_paid) {
2150-
$state = PluginOrderBillState::PAID;
2151+
$bill_state = PluginOrderBillState::PAID;
2152+
$order_status = $conf->fields['order_status_paid'];
21512153
} else {
2152-
$state = PluginOrderBillState::NOTPAID;
2154+
$bill_state = PluginOrderBillState::NOTPAID;
2155+
$order_status = $order->fields['plugin_order_orderstates_id'];
21532156
}
21542157
$order->update([
21552158
'id' => $ID,
2156-
'plugin_order_billstates_id' => $state
2159+
'plugin_order_billstates_id' => $bill_state,
2160+
'plugin_order_orderstates_id' => $order_status
21572161
]);
21582162
}
21592163

0 commit comments

Comments
 (0)