@atomsolution/sdk-merchant 1.5.2 → 1.5.3

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.
Files changed (28) hide show
  1. package/dist/assets/locales/en/download-sample.json.d.ts +9 -2
  2. package/dist/assets/locales/en/file.json.d.ts +2 -1
  3. package/dist/assets/locales/vi/download-sample.json.d.ts +9 -2
  4. package/dist/assets/locales/vi/file.json.d.ts +2 -1
  5. package/dist/batch-product-creation/components/merchant-batch-create-form/field-mapping-popup.d.ts +2 -1
  6. package/dist/batch-product-creation.cjs +47 -24
  7. package/dist/batch-product-creation.cjs.map +1 -1
  8. package/dist/batch-product-creation.esm.js +47 -24
  9. package/dist/batch-product-creation.esm.js.map +1 -1
  10. package/dist/batch-product-creation.js +47 -24
  11. package/dist/batch-product-creation.js.map +1 -1
  12. package/dist/digistore.cjs +1 -1
  13. package/dist/digistore.esm.js +1 -1
  14. package/dist/digistore.js +1 -1
  15. package/dist/{dropdownMenuAbsolute-89gAGgGd.cjs → dropdownMenuAbsolute-77lk7HqZ.cjs} +2 -2
  16. package/dist/{dropdownMenuAbsolute-89gAGgGd.cjs.map → dropdownMenuAbsolute-77lk7HqZ.cjs.map} +1 -1
  17. package/dist/{dropdownMenuAbsolute-Dw7Pk9Ke.js → dropdownMenuAbsolute-x0WsXrLZ.js} +2 -2
  18. package/dist/{dropdownMenuAbsolute-Dw7Pk9Ke.js.map → dropdownMenuAbsolute-x0WsXrLZ.js.map} +1 -1
  19. package/dist/merchant-profile.cjs +2 -2
  20. package/dist/merchant-profile.esm.js +2 -2
  21. package/dist/merchant-profile.js +2 -2
  22. package/dist/style.css +4 -0
  23. package/dist/{use-translation-DoUEE54r.js → use-translation-CEr2fmqT.js} +25 -7
  24. package/dist/{use-translation-DoUEE54r.js.map → use-translation-CEr2fmqT.js.map} +1 -1
  25. package/dist/{use-translation-T0TNDEqs.cjs → use-translation-CN8MTMJN.cjs} +25 -7
  26. package/dist/{use-translation-T0TNDEqs.cjs.map → use-translation-CN8MTMJN.cjs.map} +1 -1
  27. package/dist/utils/translations.d.ts +18 -2
  28. package/package.json +1 -1
@@ -24,8 +24,15 @@ declare const _default: {
24
24
  "requirementClass": "text-red-500",
25
25
  "example": "BEEF BELLY IN SAUCE (KOREA)"
26
26
  },
27
- "price": {
28
- "title": "Price",
27
+ "taxVAT": {
28
+ "title": "Tax VAT",
29
+ "format": "- It is one of four values: 0, 5, 8, 10",
30
+ "requirement": "Required",
31
+ "requirementClass": "text-red-500",
32
+ "example": "Valid: 0, 5, 8, 10 <br/>Invalid: Letters, decimal numbers, special characters,..."
33
+ },
34
+ "priceAfterTax": {
35
+ "title": "Price After Tax",
29
36
  "format": "- Integer <b>&gt;= 1,000 VND</b>. No negative values, no decimals.",
30
37
  "requirement": "Required",
31
38
  "requirementClass": "text-red-500",
@@ -43,7 +43,8 @@ declare const _default: {
43
43
  "close": "Close",
44
44
  "stopUpload": "Stop upload",
45
45
  "mergeDataTitle": "Merge Fields & Validate Data",
46
- "mergeDescription": "Each upload is limited to 1 file and up to 100 rows of information (products).\n If the list contains more rows than allowed, the system will take rows 1 through 100 in order (excluding the header).\n\nPreview data from the .xlsx file. Map each column in the file to a system field to continue creating products."
46
+ "mergeDescription": "Each upload is limited to 1 file and up to 100 rows of information (products).\n If the list contains more rows than allowed, the system will take rows 1 through 100 in order (excluding the header).\n\nPreview data from the .xlsx file. Map each column in the file to a system field to continue creating products.",
47
+ "directTaxNote": "The system has automatically applied the tax method to all products using the <span class='font-bold'>Direct tax setting method.</span>"
47
48
  }
48
49
  ;
49
50
 
@@ -24,8 +24,15 @@ declare const _default: {
24
24
  "requirementClass": "text-red-500",
25
25
  "example": "BA CHỈ BÒ NƯỚC SỐT THỊT (HÀN QUỐC)"
26
26
  },
27
- "price": {
28
- "title": "Giá",
27
+ "taxVAT": {
28
+ "title": "Thuế VAT",
29
+ "format": "- Là một trong 04 giá trị: 0, 5, 8, 10",
30
+ "requirement": "Bắt buộc",
31
+ "requirementClass": "text-red-500",
32
+ "example": "Hợp lệ: 0, 5, 8, 10 <br/>Không hợp lệ: Chữ cái, số thập phân, ký tự đặc biệt,..."
33
+ },
34
+ "priceAfterTax": {
35
+ "title": "Giá bán sau thuế",
29
36
  "format": "- Số nguyên <b>&gt;= 1.000 VND</b>. Không âm, không thập phân.",
30
37
  "requirement": "Bắt buộc",
31
38
  "requirementClass": "text-red-500",
@@ -43,7 +43,8 @@ declare const _default: {
43
43
  "close": "Đóng",
44
44
  "stopUpload": "Ngưng tải lên",
45
45
  "mergeDataTitle": "Ghép trường & Kiểm tra dữ liệu",
46
- "mergeDescription": "Mỗi lượt tải lên danh sách chỉ được tối đa 01 tệp và tối đa 100 dòng thông tin (sản phẩm). \n Trường hợp danh sách có nhiều hơn số dòng thông tin quy định, hệ thống sẽ lấy theo thứ tự dòng thông tin số 1 đến dòng thông tin số 100 (không bao gồm tiêu đề).\n \nXem trước dữ liệu từ file .xlsx. Ghép từng cột trong file với trường của hệ thống để tiếp tục tạo sản phẩm."
46
+ "mergeDescription": "Mỗi lượt tải lên danh sách chỉ được tối đa 01 tệp và tối đa 100 dòng thông tin (sản phẩm). \n Trường hợp danh sách có nhiều hơn số dòng thông tin quy định, hệ thống sẽ lấy theo thứ tự dòng thông tin số 1 đến dòng thông tin số 100 (không bao gồm tiêu đề).\n \nXem trước dữ liệu từ file .xlsx. Ghép từng cột trong file với trường của hệ thống để tiếp tục tạo sản phẩm.",
47
+ "directTaxNote": "Hệ thống đã tự động áp dụng cho toàn bộ sản phẩm theo phương pháp thiết lập thuế <span class='font-bold'>Trực tiếp.</span>"
47
48
  }
48
49
  ;
49
50
 
@@ -3,6 +3,7 @@ interface FieldMappingPopoverProps {
3
3
  mappings: Record<string, string>;
4
4
  defaultMappings: Record<string, string>;
5
5
  onChange?: (mappings: Record<string, string>) => void;
6
+ taxDeductionMethod: "direct" | "credit";
6
7
  }
7
- export default function FieldMappingPopup({ sheetHeaders, mappings, defaultMappings, onChange, }: FieldMappingPopoverProps): import("react/jsx-runtime").JSX.Element;
8
+ export default function FieldMappingPopup({ sheetHeaders, mappings, defaultMappings, onChange, taxDeductionMethod, }: FieldMappingPopoverProps): import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -70,12 +70,12 @@ 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-T0TNDEqs.cjs");
73
+ const useTranslation = require("./use-translation-CN8MTMJN.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 dropdownMenuAbsolute = require("./dropdownMenuAbsolute-89gAGgGd.cjs");
78
+ const dropdownMenuAbsolute = require("./dropdownMenuAbsolute-77lk7HqZ.cjs");
79
79
  const ReactDOM = require("react-dom");
80
80
  const index = require("./index-Ozgk-K52.cjs");
81
81
  const axios = require("axios");
@@ -128,10 +128,10 @@ function DownloadSampleFile() {
128
128
  const fieldOrder = [
129
129
  "productCode",
130
130
  "productName",
131
- "price",
131
+ "taxVAT",
132
+ "priceAfterTax",
132
133
  "unit",
133
134
  "category"
134
- // "image",
135
135
  ];
136
136
  const downloadFile = language === "en" ? sampleFileEn : sampleFileVi;
137
137
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-6 w-full", children: [
@@ -164,7 +164,14 @@ function DownloadSampleFile() {
164
164
  )
165
165
  }
166
166
  ),
167
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("a", { href: downloadFile, download: language == "en" ? "digistore_bulkupload.xlsx" : "digistore_mautaosanpham.xlsx", children: translate("downloadButton") })
167
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
168
+ "a",
169
+ {
170
+ href: downloadFile,
171
+ download: language == "en" ? "digistore_bulkupload.xlsx" : "digistore_mautaosanpham.xlsx",
172
+ children: translate("downloadButton")
173
+ }
174
+ )
168
175
  ]
169
176
  }
170
177
  ),
@@ -26658,25 +26665,30 @@ function FileUploadButton({
26658
26665
  }
26659
26666
  ) });
26660
26667
  }
26661
- const HIDDEN_SYSTEM_FIELDS = ["Giá bán trước thuế", "Price before tax"];
26662
- const HIDDEN_MAPPING_FIELDS$1 = [
26663
- "Giá bán trước thuế",
26664
- "Price before tax",
26665
- "Thuế VAT",
26666
- "Tax"
26667
- ];
26668
+ const NON_MAPPABLE_FIELDS = ["Giá bán trước thuế", "Price before tax"];
26669
+ const getMappableSystemFields = (fields, method) => {
26670
+ return fields.filter((field) => {
26671
+ if (NON_MAPPABLE_FIELDS.includes(field)) return false;
26672
+ if (method === "direct") {
26673
+ return field !== "Thuế VAT" && field !== "Tax";
26674
+ }
26675
+ return true;
26676
+ });
26677
+ };
26668
26678
  function FieldMappingPopup({
26669
26679
  sheetHeaders,
26670
26680
  mappings,
26671
26681
  defaultMappings,
26672
- onChange
26682
+ onChange,
26683
+ taxDeductionMethod
26673
26684
  }) {
26674
26685
  const [open, setOpen] = React.useState(false);
26675
26686
  const popoverRef = React.useRef(null);
26676
26687
  const { translate } = useTranslation.useTranslation("file");
26677
26688
  const systemFields = translate("systemFields");
26678
- const visibleSystemFields = systemFields.filter(
26679
- (field) => !HIDDEN_SYSTEM_FIELDS.includes(field) && !HIDDEN_MAPPING_FIELDS$1.includes(field)
26689
+ const visibleSystemFields = getMappableSystemFields(
26690
+ systemFields,
26691
+ taxDeductionMethod
26680
26692
  );
26681
26693
  const handleSelect = (field, value) => {
26682
26694
  const newMappings = __spreadValues({}, mappings);
@@ -26781,12 +26793,12 @@ function FieldMappingPopup({
26781
26793
  ] });
26782
26794
  }
26783
26795
  const EXCLUDED_SYSTEM_FIELDS = ["Giá bán trước thuế", "Price before tax"];
26784
- const HIDDEN_MAPPING_FIELDS = [
26785
- "Giá bán trước thuế",
26786
- "Price before tax",
26787
- "Thuế VAT",
26788
- "Tax"
26789
- ];
26796
+ const getHiddenFieldsByTaxMethod = (method) => {
26797
+ if (method === "credit") {
26798
+ return [];
26799
+ }
26800
+ return ["Giá bán trước thuế", "Price before tax", "Thuế VAT", "Tax"];
26801
+ };
26790
26802
  function MergeAndCheckData({ taxDeductionMethod }) {
26791
26803
  const [useHeader, setUseHeader] = React.useState(true);
26792
26804
  const [showCancelPopup, setShowCancelPopup] = React.useState(false);
@@ -26895,7 +26907,7 @@ function MergeAndCheckData({ taxDeductionMethod }) {
26895
26907
  }
26896
26908
  });
26897
26909
  const visibleSystemFields = systemFields.filter(
26898
- (field) => !HIDDEN_MAPPING_FIELDS.includes(field)
26910
+ (field) => !getHiddenFieldsByTaxMethod(taxDeductionMethod).includes(field)
26899
26911
  );
26900
26912
  const filteredRows = sheetMappingData.filter((row) => {
26901
26913
  return row.code || row.name || row.priceAfterTax || row.unit || row.category;
@@ -26904,7 +26916,17 @@ function MergeAndCheckData({ taxDeductionMethod }) {
26904
26916
  return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-8", children: [
26905
26917
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { children: [
26906
26918
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("h2", { className: "text-[20px] leading-[30px] font-bold text-[#0E121B] mb-2", children: translate("mergeDataTitle") }),
26907
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("p", { className: "text-[16px] leading-[20px] font-normal text-[#0E121B] whitespace-pre-line", children: translate("mergeDescription") })
26919
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("p", { className: "text-[16px] leading-[20px] font-normal text-[#0E121B] whitespace-pre-line", children: translate("mergeDescription") }),
26920
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx("br", {}),
26921
+ taxDeductionMethod == "direct" && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
26922
+ "p",
26923
+ {
26924
+ className: "text-[14px] w-fit leading-[18px] font-normal text-[#0E121B] bg-blue-200",
26925
+ dangerouslySetInnerHTML: {
26926
+ __html: translate("directTaxNote")
26927
+ }
26928
+ }
26929
+ )
26908
26930
  ] }),
26909
26931
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "flex gap-4 items-center justify-start", children: [
26910
26932
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
@@ -26913,7 +26935,8 @@ function MergeAndCheckData({ taxDeductionMethod }) {
26913
26935
  sheetHeaders,
26914
26936
  mappings,
26915
26937
  defaultMappings,
26916
- onChange: (m) => setMappings(m)
26938
+ onChange: (m) => setMappings(m),
26939
+ taxDeductionMethod
26917
26940
  }
26918
26941
  ),
26919
26942
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs("div", { className: "flex gap-2 items-center", children: [