@atomsolution/sdk-merchant 1.5.4 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/locales/en/merchant-batch-create-form.json.d.ts +4 -1
- package/dist/assets/locales/vi/merchant-batch-create-form.json.d.ts +4 -1
- package/dist/batch-product-creation/components/merchant-batch-create-form/modals/create-product-success-modal.d.ts +2 -1
- package/dist/batch-product-creation/store/use-upload-store.d.ts +3 -3
- package/dist/batch-product-creation.cjs +102 -59
- package/dist/batch-product-creation.cjs.map +1 -1
- package/dist/batch-product-creation.esm.js +102 -59
- package/dist/batch-product-creation.esm.js.map +1 -1
- package/dist/batch-product-creation.js +102 -59
- package/dist/batch-product-creation.js.map +1 -1
- package/dist/digistore.cjs +1 -1
- package/dist/digistore.esm.js +1 -1
- package/dist/digistore.js +1 -1
- package/dist/{dropdownMenuAbsolute-x0WsXrLZ.js → dropdownMenuAbsolute-3Ul3CXE4.js} +2 -2
- package/dist/{dropdownMenuAbsolute-x0WsXrLZ.js.map → dropdownMenuAbsolute-3Ul3CXE4.js.map} +1 -1
- package/dist/{dropdownMenuAbsolute-77lk7HqZ.cjs → dropdownMenuAbsolute-D_UcfPXt.cjs} +2 -2
- package/dist/{dropdownMenuAbsolute-77lk7HqZ.cjs.map → dropdownMenuAbsolute-D_UcfPXt.cjs.map} +1 -1
- package/dist/merchant-profile.cjs +2 -2
- package/dist/merchant-profile.esm.js +2 -2
- package/dist/merchant-profile.js +2 -2
- package/dist/{use-translation-CEr2fmqT.js → use-translation-BK1SrjzU.js} +15 -3
- package/dist/{use-translation-CEr2fmqT.js.map → use-translation-BK1SrjzU.js.map} +1 -1
- package/dist/{use-translation-CN8MTMJN.cjs → use-translation-bkoNjVct.cjs} +15 -3
- package/dist/{use-translation-CN8MTMJN.cjs.map → use-translation-bkoNjVct.cjs.map} +1 -1
- package/dist/utils/translations.d.ts +6 -0
- package/package.json +1 -1
|
@@ -63,6 +63,8 @@ declare const _default: {
|
|
|
63
63
|
"export_col_name": "Product name",
|
|
64
64
|
"export_col_unit": "Unit",
|
|
65
65
|
"export_col_price": "Price",
|
|
66
|
+
"export_col_taxVAT": "Tax VAT",
|
|
67
|
+
"export_col_priceAfterTax": "Price after tax",
|
|
66
68
|
"export_col_category": "Category",
|
|
67
69
|
"export_col_status": "Status",
|
|
68
70
|
"export_status_success": "Success",
|
|
@@ -79,9 +81,10 @@ declare const _default: {
|
|
|
79
81
|
"unit_required": "Product unit is not allowed to be empty",
|
|
80
82
|
"unit_invalid": "Product unit is invalid",
|
|
81
83
|
"code_must_be_string": "Product code must be a string",
|
|
84
|
+
"tax_invalid": "Invalid tax",
|
|
82
85
|
"code_required": "Product code is not allowed to be empty",
|
|
83
86
|
"code_invalid": "Product code is invalid",
|
|
84
|
-
"price_required": "
|
|
87
|
+
"price_required": "Price after tax is not allowed to be empty",
|
|
85
88
|
"price_invalid": "Product price is invalid",
|
|
86
89
|
"category_must_be_string": "Product category must be a string",
|
|
87
90
|
"category_invalid": "Product category is invalid",
|
|
@@ -61,6 +61,8 @@ declare const _default: {
|
|
|
61
61
|
"export_col_name": "Tên sản phẩm",
|
|
62
62
|
"export_col_unit": "Đơn vị tính",
|
|
63
63
|
"export_col_price": "Giá",
|
|
64
|
+
"export_col_taxVAT": "Thuế VAT",
|
|
65
|
+
"export_col_priceAfterTax": "Giá bán sau thuế",
|
|
64
66
|
"export_col_category": "Danh mục sản phẩm",
|
|
65
67
|
"export_col_status": "Trạng thái",
|
|
66
68
|
"export_status_success": "Thành công",
|
|
@@ -76,12 +78,13 @@ declare const _default: {
|
|
|
76
78
|
"unit_must_be_string": "Đơn vị tính phải là chuỗi",
|
|
77
79
|
"unit_invalid": "Đơn vị tính không hợp lệ",
|
|
78
80
|
"code_must_be_string": "Mã sản phẩm phải là chuỗi",
|
|
81
|
+
"tax_invalid": "Thuế không hợp lệ",
|
|
79
82
|
"code_required": "Mã sản phẩm không được bỏ trống",
|
|
80
83
|
"code_invalid": "Mã sản phẩm không hợp lệ",
|
|
81
84
|
"code_min": "Mã sản phẩm phải có ít nhất 2 ký tự",
|
|
82
85
|
"code_max": "Mã sản phẩm không được vượt quá 20 ký tự",
|
|
83
86
|
"code_invalid_chars": "Mã sản phẩm chỉ được chứa chữ, số, dấu gạch ngang (-), gạch dưới (_), không chứa khoảng trắng",
|
|
84
|
-
"price_required": "Giá
|
|
87
|
+
"price_required": "Giá sau thuế không được bỏ trống",
|
|
85
88
|
"price_invalid": "Giá sản phẩm không hợp lệ",
|
|
86
89
|
"category_must_be_string": "Danh mục sản phẩm phải là chuỗi",
|
|
87
90
|
"category_invalid": "Danh mục sản phẩm không hợp lệ",
|
|
@@ -7,6 +7,7 @@ type Props = {
|
|
|
7
7
|
confirmText?: string;
|
|
8
8
|
open: boolean;
|
|
9
9
|
onClose: () => void;
|
|
10
|
+
taxDeductionMethod?: "direct" | "credit";
|
|
10
11
|
};
|
|
11
|
-
declare const CreateProductSuccessModal: ({ createdProductsResult, checkedProducts, disable, open, onClose: handleClose, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const CreateProductSuccessModal: ({ createdProductsResult, checkedProducts, disable, open, onClose: handleClose, taxDeductionMethod, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export default CreateProductSuccessModal;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export interface ProductPreview {
|
|
2
2
|
name: string;
|
|
3
3
|
code: string;
|
|
4
|
-
priceBeforeTax: number;
|
|
5
|
-
tax: number;
|
|
6
|
-
priceAfterTax: number | null;
|
|
4
|
+
priceBeforeTax: number | string;
|
|
5
|
+
tax: number | string;
|
|
6
|
+
priceAfterTax: number | null | string;
|
|
7
7
|
category: string;
|
|
8
8
|
unit: string;
|
|
9
9
|
note: string;
|
|
@@ -70,16 +70,16 @@ var __asyncGenerator = (__this, __arguments, generator) => {
|
|
|
70
70
|
var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it);
|
|
71
71
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
72
72
|
const jsxRuntime = require("./jsx-runtime-DV8UmLi4.cjs");
|
|
73
|
-
const useTranslation = require("./use-translation-
|
|
73
|
+
const useTranslation = require("./use-translation-bkoNjVct.cjs");
|
|
74
74
|
const reactToastify = require("react-toastify");
|
|
75
75
|
const useWesapApiConfig_store = require("./use-wesap-api-config.store-BaseWS--.cjs");
|
|
76
76
|
const React = require("react");
|
|
77
77
|
const create = require("zustand");
|
|
78
|
-
const
|
|
78
|
+
const useExternalConfig_store = require("./use-external-config.store-WVwivWvK.cjs");
|
|
79
|
+
const dropdownMenuAbsolute = require("./dropdownMenuAbsolute-D_UcfPXt.cjs");
|
|
79
80
|
const ReactDOM = require("react-dom");
|
|
80
81
|
const index = require("./index-Ozgk-K52.cjs");
|
|
81
82
|
const axios = require("axios");
|
|
82
|
-
const useExternalConfig_store = require("./use-external-config.store-WVwivWvK.cjs");
|
|
83
83
|
const index_esm = require("./index.esm-B0J-MTn-.cjs");
|
|
84
84
|
require("./use-portal-api-config.store-C8a2gebE.cjs");
|
|
85
85
|
function _interopNamespaceDefault(e) {
|
|
@@ -26792,6 +26792,12 @@ function FieldMappingPopup({
|
|
|
26792
26792
|
)
|
|
26793
26793
|
] });
|
|
26794
26794
|
}
|
|
26795
|
+
function formatVND(price) {
|
|
26796
|
+
if (useExternalConfig_store.useExternalConfigStore.getState().language === "en") {
|
|
26797
|
+
return new Intl.NumberFormat("en-US").format(price);
|
|
26798
|
+
}
|
|
26799
|
+
return new Intl.NumberFormat("vi-VN").format(price) + " VND";
|
|
26800
|
+
}
|
|
26795
26801
|
const EXCLUDED_SYSTEM_FIELDS = ["Giá bán trước thuế", "Price before tax"];
|
|
26796
26802
|
const getHiddenFieldsByTaxMethod = (method) => {
|
|
26797
26803
|
if (method === "credit") {
|
|
@@ -26842,31 +26848,37 @@ function MergeAndCheckData({ taxDeductionMethod }) {
|
|
|
26842
26848
|
setDefaultMappings(def);
|
|
26843
26849
|
}
|
|
26844
26850
|
}, [sheetHeaders, systemFields, defaultMappings]);
|
|
26851
|
+
const parseNumber = (val) => {
|
|
26852
|
+
if (val === void 0 || val === null || val === "") return null;
|
|
26853
|
+
const n2 = Number(val);
|
|
26854
|
+
return Number.isFinite(n2) ? n2 : null;
|
|
26855
|
+
};
|
|
26845
26856
|
React.useEffect(() => {
|
|
26846
26857
|
if (sheetHeaders.length === 0) return;
|
|
26847
26858
|
let bodyRows = useHeader ? sheetData.slice(1) : sheetData;
|
|
26848
26859
|
const mapped = bodyRows.map((row) => {
|
|
26849
26860
|
var _a, _b, _c, _d;
|
|
26850
|
-
const
|
|
26851
|
-
|
|
26852
|
-
|
|
26853
|
-
|
|
26854
|
-
const
|
|
26855
|
-
|
|
26856
|
-
|
|
26857
|
-
|
|
26858
|
-
|
|
26859
|
-
|
|
26860
|
-
|
|
26861
|
-
|
|
26862
|
-
|
|
26861
|
+
const rawTax = row[sheetHeaders.indexOf(mappings[systemFields[3]])];
|
|
26862
|
+
console.log(rawTax);
|
|
26863
|
+
const rawPriceAfterTax = row[sheetHeaders.indexOf(mappings[systemFields[4]])];
|
|
26864
|
+
const taxNumber = parseNumber(rawTax);
|
|
26865
|
+
const priceAfterTaxNumber = parseNumber(rawPriceAfterTax);
|
|
26866
|
+
let priceBeforeTax = "";
|
|
26867
|
+
if (priceAfterTaxNumber !== null && taxNumber !== null) {
|
|
26868
|
+
if (taxNumber === 0) {
|
|
26869
|
+
priceBeforeTax = Math.round(priceAfterTaxNumber);
|
|
26870
|
+
} else {
|
|
26871
|
+
priceBeforeTax = Math.round(
|
|
26872
|
+
priceAfterTaxNumber / (1 + taxNumber / 100)
|
|
26873
|
+
);
|
|
26874
|
+
}
|
|
26863
26875
|
}
|
|
26864
26876
|
return {
|
|
26865
26877
|
code: (_a = row[sheetHeaders.indexOf(mappings[systemFields[0]])]) != null ? _a : "",
|
|
26866
26878
|
name: (_b = row[sheetHeaders.indexOf(mappings[systemFields[1]])]) != null ? _b : "",
|
|
26867
|
-
tax:
|
|
26868
|
-
priceAfterTax:
|
|
26869
|
-
priceBeforeTax
|
|
26879
|
+
tax: rawTax != null ? rawTax : "",
|
|
26880
|
+
priceAfterTax: rawPriceAfterTax != null ? rawPriceAfterTax : "",
|
|
26881
|
+
priceBeforeTax,
|
|
26870
26882
|
unit: (_c = row[sheetHeaders.indexOf(mappings[systemFields[5]])]) != null ? _c : "",
|
|
26871
26883
|
category: (_d = row[sheetHeaders.indexOf(mappings[systemFields[6]])]) != null ? _d : "",
|
|
26872
26884
|
note: ""
|
|
@@ -27053,15 +27065,18 @@ function MergeAndCheckData({ taxDeductionMethod }) {
|
|
|
27053
27065
|
translate("noCompatibleData")
|
|
27054
27066
|
]
|
|
27055
27067
|
}
|
|
27056
|
-
) }) : filteredRows.map((row, idx) =>
|
|
27057
|
-
|
|
27058
|
-
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.
|
|
27059
|
-
|
|
27060
|
-
|
|
27061
|
-
|
|
27062
|
-
|
|
27063
|
-
|
|
27064
|
-
|
|
27068
|
+
) }) : filteredRows.map((row, idx) => {
|
|
27069
|
+
var _a;
|
|
27070
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("tr", { children: [
|
|
27071
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("td", { className: "px-2 py-3 text-[#2C2C2C] text-[14px] border-b", children: row.code }),
|
|
27072
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("td", { className: "px-2 py-3 text-[#2C2C2C] text-[14px] border-b", children: row.name }),
|
|
27073
|
+
taxDeductionMethod == "credit" && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("td", { className: "px-2 py-3 text-[#2C2C2C] text-[14px] border-b", children: typeof row.priceBeforeTax == "number" ? formatVND(row.priceBeforeTax) : "" }),
|
|
27074
|
+
taxDeductionMethod == "credit" && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("td", { className: "px-2 py-3 text-[#2C2C2C] text-[14px] border-b", children: typeof row.tax == "number" ? row.tax + "%" : row.tax }),
|
|
27075
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("td", { className: "px-2 py-3 text-[#2C2C2C] text-[14px] border-b", children: typeof row.priceAfterTax == "number" ? formatVND((_a = row.priceAfterTax) != null ? _a : 0) : row.priceAfterTax }),
|
|
27076
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("td", { className: "px-2 py-3 text-[#2C2C2C] text-[14px] border-b", children: row.unit }),
|
|
27077
|
+
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("td", { className: "px-2 py-3 text-[#2C2C2C] text-[14px] border-b", children: row.category })
|
|
27078
|
+
] }, idx);
|
|
27079
|
+
});
|
|
27065
27080
|
})() })
|
|
27066
27081
|
] }) }) }),
|
|
27067
27082
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
@@ -29258,17 +29273,20 @@ const CreateProductConfirmModal = ({
|
|
|
29258
29273
|
const { translate } = useTranslation.useTranslation("batch-create-product");
|
|
29259
29274
|
const handleCreateProducts = () => __async(exports, null, function* () {
|
|
29260
29275
|
setLoading(true);
|
|
29261
|
-
const formattedProducts = checkedProducts.map((product) =>
|
|
29262
|
-
|
|
29263
|
-
|
|
29264
|
-
|
|
29265
|
-
|
|
29266
|
-
|
|
29267
|
-
|
|
29268
|
-
|
|
29269
|
-
|
|
29270
|
-
|
|
29271
|
-
|
|
29276
|
+
const formattedProducts = checkedProducts.map((product) => {
|
|
29277
|
+
var _a;
|
|
29278
|
+
return {
|
|
29279
|
+
code: product.code,
|
|
29280
|
+
name: product.name,
|
|
29281
|
+
price: (_a = product.priceBeforeTax) != null ? _a : 0,
|
|
29282
|
+
img: product.img || "",
|
|
29283
|
+
unit: product.unit,
|
|
29284
|
+
cost: 0,
|
|
29285
|
+
tax: taxDeductionMethod == "direct" ? 0 : product.tax,
|
|
29286
|
+
status: 0,
|
|
29287
|
+
category_names: product.category
|
|
29288
|
+
};
|
|
29289
|
+
});
|
|
29272
29290
|
try {
|
|
29273
29291
|
const response = yield createProductsService.createProducts(
|
|
29274
29292
|
formattedProducts
|
|
@@ -52586,7 +52604,8 @@ const CreateProductSuccessModal = ({
|
|
|
52586
52604
|
checkedProducts,
|
|
52587
52605
|
disable,
|
|
52588
52606
|
open,
|
|
52589
|
-
onClose: handleClose
|
|
52607
|
+
onClose: handleClose,
|
|
52608
|
+
taxDeductionMethod = "direct"
|
|
52590
52609
|
}) => {
|
|
52591
52610
|
const setIsDirty = useWesapApiConfig_store.useUnsavedChangesStore((state) => state.setIsDirty);
|
|
52592
52611
|
const { translate } = useTranslation.useTranslation("batch-create-product");
|
|
@@ -52610,12 +52629,14 @@ const CreateProductSuccessModal = ({
|
|
|
52610
52629
|
const isFailedProduct = createdProductsResult.products_err.some(
|
|
52611
52630
|
(failed) => failed === product.code
|
|
52612
52631
|
);
|
|
52632
|
+
console.log(taxDeductionMethod);
|
|
52613
52633
|
if (isFailedProduct) {
|
|
52614
52634
|
return [
|
|
52615
52635
|
// [translate('export_col_img')]: product.img,
|
|
52616
52636
|
product.code,
|
|
52617
52637
|
product.name,
|
|
52618
|
-
product.
|
|
52638
|
+
...taxDeductionMethod === "credit" ? [product.tax] : [],
|
|
52639
|
+
product.priceAfterTax,
|
|
52619
52640
|
product.unit,
|
|
52620
52641
|
product.category.join(", "),
|
|
52621
52642
|
translate("export_status_failed")
|
|
@@ -52625,7 +52646,8 @@ const CreateProductSuccessModal = ({
|
|
|
52625
52646
|
// [translate('export_col_img')]: product.img,
|
|
52626
52647
|
product.code,
|
|
52627
52648
|
product.name,
|
|
52628
|
-
product.
|
|
52649
|
+
...taxDeductionMethod === "credit" ? [product.tax + "%"] : [],
|
|
52650
|
+
product.priceAfterTax,
|
|
52629
52651
|
product.unit,
|
|
52630
52652
|
product.category.join(", "),
|
|
52631
52653
|
translate("export_status_success")
|
|
@@ -52639,6 +52661,7 @@ const CreateProductSuccessModal = ({
|
|
|
52639
52661
|
)}_${day}${month}${year}`;
|
|
52640
52662
|
};
|
|
52641
52663
|
const exportCreationResultToExcel = (dataRows2, name) => __async(exports, null, function* () {
|
|
52664
|
+
console.log(dataRows2);
|
|
52642
52665
|
const { minutes, hours, day, month, year } = getDateTimeMetrics();
|
|
52643
52666
|
const now = `${hours}:${minutes} ${day}/${month}/${year}`;
|
|
52644
52667
|
const workbook = new ExcelJS.Workbook();
|
|
@@ -52647,7 +52670,8 @@ const CreateProductSuccessModal = ({
|
|
|
52647
52670
|
const columns = [
|
|
52648
52671
|
translate("export_col_code"),
|
|
52649
52672
|
translate("export_col_name"),
|
|
52650
|
-
translate("
|
|
52673
|
+
...taxDeductionMethod === "credit" ? [translate("export_col_taxVAT")] : [],
|
|
52674
|
+
translate("export_col_priceAfterTax"),
|
|
52651
52675
|
translate("export_col_unit"),
|
|
52652
52676
|
translate("export_col_category"),
|
|
52653
52677
|
translate("export_col_status")
|
|
@@ -56095,7 +56119,7 @@ const ProductPreviewSchema = object({
|
|
|
56095
56119
|
/^[A-Za-z0-9\-_.]+$/,
|
|
56096
56120
|
useTranslation.translate("batch-create-product:code_invalid")
|
|
56097
56121
|
),
|
|
56098
|
-
priceBeforeTax: number().optional(),
|
|
56122
|
+
priceBeforeTax: number({ error: () => "" }).optional(),
|
|
56099
56123
|
tax: number({
|
|
56100
56124
|
error: () => useTranslation.translate("batch-create-product:tax_invalid")
|
|
56101
56125
|
}).refine((v) => TAX_VALUES.includes(v), {
|
|
@@ -56432,12 +56456,6 @@ const UploadImageCell = ({
|
|
|
56432
56456
|
}
|
|
56433
56457
|
);
|
|
56434
56458
|
};
|
|
56435
|
-
function formatVND(price) {
|
|
56436
|
-
if (useExternalConfig_store.useExternalConfigStore.getState().language === "en") {
|
|
56437
|
-
return new Intl.NumberFormat("en-US").format(price);
|
|
56438
|
-
}
|
|
56439
|
-
return new Intl.NumberFormat("vi-VN").format(price) + " VND";
|
|
56440
|
-
}
|
|
56441
56459
|
const CategoryCell = ({ color, children }) => {
|
|
56442
56460
|
const styleColor = {
|
|
56443
56461
|
yellow: {
|
|
@@ -57546,7 +57564,7 @@ const UpdateProductModal = ({
|
|
|
57546
57564
|
}
|
|
57547
57565
|
)
|
|
57548
57566
|
] }),
|
|
57549
|
-
taxDeductionMethod && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(Label, { labelText: translate("tax"), required: true, children: [
|
|
57567
|
+
taxDeductionMethod == "credit" && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(Label, { labelText: translate("tax"), required: true, children: [
|
|
57550
57568
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(ErrorMessage, { name: "tax", errors }),
|
|
57551
57569
|
/* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
|
|
57552
57570
|
"select",
|
|
@@ -57724,10 +57742,20 @@ const ProductPreviewTable = ({
|
|
|
57724
57742
|
minWidth: "200px",
|
|
57725
57743
|
render: (data) => {
|
|
57726
57744
|
const { priceAfterTax, tax } = data;
|
|
57727
|
-
if (
|
|
57728
|
-
return "
|
|
57745
|
+
if (tax === "" || tax === null || tax === void 0) {
|
|
57746
|
+
return "";
|
|
57729
57747
|
}
|
|
57730
|
-
|
|
57748
|
+
if (priceAfterTax === "" || priceAfterTax === null || priceAfterTax === void 0) {
|
|
57749
|
+
return "";
|
|
57750
|
+
}
|
|
57751
|
+
const priceAfterTaxNumber = Number(priceAfterTax);
|
|
57752
|
+
const taxNumber = Number(tax);
|
|
57753
|
+
if (!Number.isFinite(priceAfterTaxNumber) || !Number.isFinite(taxNumber)) {
|
|
57754
|
+
return "";
|
|
57755
|
+
}
|
|
57756
|
+
const priceBeforeTax = Math.round(
|
|
57757
|
+
priceAfterTaxNumber / (1 + taxNumber / 100)
|
|
57758
|
+
);
|
|
57731
57759
|
return formatVND(priceBeforeTax);
|
|
57732
57760
|
}
|
|
57733
57761
|
},
|
|
@@ -57736,8 +57764,15 @@ const ProductPreviewTable = ({
|
|
|
57736
57764
|
label: translate("tax"),
|
|
57737
57765
|
width: "200px",
|
|
57738
57766
|
minWidth: "200px",
|
|
57739
|
-
render: (
|
|
57740
|
-
|
|
57767
|
+
render: ({ tax }) => {
|
|
57768
|
+
if (tax == "" || tax === null || tax === void 0) {
|
|
57769
|
+
return "";
|
|
57770
|
+
}
|
|
57771
|
+
const taxNumber = Number(tax);
|
|
57772
|
+
if (!Number.isFinite(taxNumber)) {
|
|
57773
|
+
return "";
|
|
57774
|
+
}
|
|
57775
|
+
return `${taxNumber}%`;
|
|
57741
57776
|
}
|
|
57742
57777
|
}
|
|
57743
57778
|
];
|
|
@@ -57747,8 +57782,15 @@ const ProductPreviewTable = ({
|
|
|
57747
57782
|
label: translate("price_vat"),
|
|
57748
57783
|
width: "200px",
|
|
57749
57784
|
minWidth: "200px",
|
|
57750
|
-
render: (
|
|
57751
|
-
|
|
57785
|
+
render: ({ priceAfterTax }) => {
|
|
57786
|
+
if (priceAfterTax === "" || priceAfterTax === null || priceAfterTax === void 0) {
|
|
57787
|
+
return "";
|
|
57788
|
+
}
|
|
57789
|
+
const n2 = Number(priceAfterTax);
|
|
57790
|
+
if (!Number.isFinite(n2)) {
|
|
57791
|
+
return "";
|
|
57792
|
+
}
|
|
57793
|
+
return formatVND(n2);
|
|
57752
57794
|
}
|
|
57753
57795
|
},
|
|
57754
57796
|
{
|
|
@@ -57993,7 +58035,8 @@ const ProductInfoPreview = ({ taxDeductionMethod }) => {
|
|
|
57993
58035
|
open: showCreateSuccessModal,
|
|
57994
58036
|
onClose: () => setShowSuccessModal(false),
|
|
57995
58037
|
checkedProducts,
|
|
57996
|
-
createdProductsResult
|
|
58038
|
+
createdProductsResult,
|
|
58039
|
+
taxDeductionMethod
|
|
57997
58040
|
}
|
|
57998
58041
|
)
|
|
57999
58042
|
] });
|