update
This commit is contained in:
@@ -24,6 +24,8 @@ class InvoiceTransformer
|
||||
$legacyId = (int) $row['id'];
|
||||
|
||||
$dueDate = $this->nullableDate($row['duedate'] ?? null);
|
||||
$status = $this->mapStatus($row['status'], $dueDate);
|
||||
$total = (int) round((float) $row['total']);
|
||||
$whmcsOrderId = $this->extractor->orderIdFor($legacyId);
|
||||
|
||||
$rawItems = $this->extractor->items($legacyId);
|
||||
@@ -46,8 +48,11 @@ class InvoiceTransformer
|
||||
subTotal: (int) round((float) $row['subtotal']),
|
||||
discountAmount: $discountAmount,
|
||||
tax: (int) round((float) $row['tax'] + (float) $row['tax2']),
|
||||
total: (int) round((float) $row['total']),
|
||||
status: $this->mapStatus($row['status'], $dueDate),
|
||||
total: $total,
|
||||
// Không có amount_paid thì mọi hoá đơn WHMCS đã thanh toán sẽ hiện "chưa thu"
|
||||
// và outstanding = total trên toàn bộ dữ liệu import.
|
||||
amountPaid: $status === 2 ? $total : (int) round((float) ($row['credit'] ?? 0)),
|
||||
status: $status,
|
||||
paymentMethod: $row['paymentmethod'] ?: null,
|
||||
dueDate: $dueDate,
|
||||
paidAt: $this->nullableDate($row['datepaid'] ?? null),
|
||||
|
||||
Reference in New Issue
Block a user