update email template
This commit is contained in:
@@ -139,14 +139,16 @@ class OrderService
|
||||
|
||||
[$productItems, $relIdData, $total] = $this->buildProductItems($data);
|
||||
|
||||
$orderTotal = (int) ($total + ($total * (10 / 100)));
|
||||
// Giá niêm yết đã bao gồm thuế (khớp với client-facing OrderService::create()) —
|
||||
// không cộng thêm thuế lên trên ở đây.
|
||||
$orderTotal = (int) $total;
|
||||
|
||||
$invoiceData = [
|
||||
'invoice_number' => Helper::generateUniqueCode(),
|
||||
'due_date' => Carbon::today()->addDays(7)->toDateString(),
|
||||
'paid_at' => $effectiveInvoiceStatus === InvoiceStatus::PAID->value ? Carbon::now() : null,
|
||||
'sub_total' => $total,
|
||||
'tax' => $total * (10 / 100),
|
||||
'tax' => 0,
|
||||
'total' => $orderTotal,
|
||||
'payment_method' => $paymentRecord?->id,
|
||||
'customer_id' => $data['customer_id'],
|
||||
@@ -163,6 +165,9 @@ class OrderService
|
||||
'payment_proof' => $data['payment_proof'] ?? null,
|
||||
'user_id' => Auth::guard('admin')->id(),
|
||||
'status' => $effectiveOrderStatus,
|
||||
// Order.paid_at mirrors invoice.paid_at — set together, same rule as
|
||||
// InvoicePaymentService::activateOrder()/activateRenewal().
|
||||
'paid_at' => $invoiceData['paid_at'],
|
||||
'client_ip' => request()->getClientIp(),
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user