Add unit tests for self-serve invoice billing logic, refactor minute-based billing calculations, and improve error handling for billable minutes adjustments.
This commit is contained in:
@@ -161,7 +161,7 @@ class order_items_o extends db
|
||||
}
|
||||
}
|
||||
|
||||
public function addItemToOrder(int $order_id, int $product_id, int $cashier_id, int $quantity, $related_item_id = null, $notes = null, $forcePrice = null): void
|
||||
public function addItemToOrder(int $order_id, int $product_id, int $cashier_id, int $quantity, $related_item_id = null, $notes = null, $forcePrice = null): order_items_o
|
||||
{
|
||||
global $db, $response;
|
||||
try {
|
||||
@@ -199,6 +199,7 @@ class order_items_o extends db
|
||||
}
|
||||
// Invalidate the order cache
|
||||
$order->objectChanged();
|
||||
return (new order_items_o())->select($this->id);
|
||||
|
||||
} catch (Exception $e) {
|
||||
$response->error($e->getMessage());
|
||||
|
||||
Reference in New Issue
Block a user