fix: decimal number
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 4s

This commit is contained in:
HAM 2025-09-16 09:50:23 +07:00
parent 892d76583f
commit 6776188f7b

View file

@ -372,7 +372,7 @@ const flowAccount = {
items: product.map((v) => ({
type: ProductAndServiceType.ProductNonInv,
name: v.product.name,
pricePerUnit: v.pricePerUnit,
pricePerUnit: Math.round(v.pricePerUnit * 100) / 100,
quantity: v.amount,
discountAmount: v.discount,
total: (v.pricePerUnit - (v.discount || 0)) * v.amount + v.vat,
@ -443,8 +443,7 @@ const flowAccount = {
sellDescription: body.detail,
sellVatType: 3,
unitName: "Unit",
categoryName: "Car",
}; // helper function สำหรับสร้าง product
};
const createProduct = async (price: any, vatIncluded: boolean) => {
try {
@ -463,7 +462,7 @@ const flowAccount = {
if (!res.ok) {
throw new Error(`Request failed with status ${res.status}`);
} // ป้องกัน response ที่ไม่ใช่ JSON หรือว่าง
}
let json: any = null;
try {
@ -506,7 +505,7 @@ const flowAccount = {
sellVatType: 3,
unitName: "Unit",
categoryName: "Car",
}; // helper function สำหรับสร้าง product
};
const editProduct = async (id: String, price: any, vatIncluded: boolean) => {
try {
@ -525,7 +524,7 @@ const flowAccount = {
if (!res.ok) {
throw new Error(`Request failed with status ${res.status}`);
} // ป้องกัน response ที่ไม่ใช่ JSON หรือว่าง
}
let json: any = null;
try {