This commit is contained in:
Viet An
2026-06-18 09:10:36 +07:00
parent b7c82e944d
commit 87397be8bf
18 changed files with 78 additions and 90 deletions

View File

@@ -221,8 +221,8 @@ const {
$stripHtml,
$snackbar,
$dayjs,
$formatNumber,
$numtoString,
$parseNum,
$formatNum,
$empty,
$unique,
$multiSort,
@@ -523,9 +523,9 @@ const formatCellValue = (value, field) => {
if (value === undefined || value === null || value === "") return "-";
if (field.format === "number") {
const num = $formatNumber(value);
const num = $parseNum(value);
if (num === undefined) return "-";
return $numtoString(num, "vi-VN", field.decimal || 0, field.decimal || 0);
return $formatNum(num, "vi-VN", field.decimal || 0, field.decimal || 0);
}
if (field.format === "date") {
@@ -596,8 +596,8 @@ const getDataCellStyle = (row, leaf) => {
if (cell && leaf.field) {
if (leaf.field === "paid_amount") {
const amount = $formatNumber(cell.amount) || 0;
const paid = $formatNumber(cell.paid_amount) || 0;
const amount = $parseNum(cell.amount) || 0;
const paid = $parseNum(cell.paid_amount) || 0;
if (paid >= amount) {
style += " background-color: #d4edda;";
} else if (paid > 0) {
@@ -608,8 +608,8 @@ const getDataCellStyle = (row, leaf) => {
}
if (leaf.field === "to_date") {
const dueDate = cell.to_date;
const paid = $formatNumber(cell.paid_amount) || 0;
const amount = $formatNumber(cell.amount) || 0;
const paid = $parseNum(cell.paid_amount) || 0;
const amount = $parseNum(cell.amount) || 0;
if (dueDate && paid < amount) {
const today = new Date();
const due = new Date(dueDate);