@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
@@ -68,13 +68,13 @@ var __asyncGenerator = (__this, __arguments, generator) => {
68
68
  };
69
69
  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);
70
70
  import { j as jsxRuntimeExports } from "./jsx-runtime-ClP9nxnW.js";
71
- import { u as useTranslation, t as translate } from "./use-translation-DoUEE54r.js";
71
+ import { u as useTranslation, t as translate } from "./use-translation-CEr2fmqT.js";
72
72
  import { ToastContainer } from "react-toastify";
73
73
  import { a as useUnsavedChangesStore, u as useWesapApiConfig } from "./use-wesap-api-config.store-CIaEkA7m.js";
74
74
  import * as React from "react";
75
75
  import React__default, { useState, useRef, useEffect, useMemo, forwardRef, useCallback } from "react";
76
76
  import create from "zustand";
77
- import { t as twMerge, B as Button, c as commonjsRequire, b as commonjsGlobal, g as getDefaultExportFromCjs, u as useMediaQuery, T as TableSkeleton, R as ReusableTable, a as DropdownMenuAbsolute } from "./dropdownMenuAbsolute-Dw7Pk9Ke.js";
77
+ import { t as twMerge, B as Button, c as commonjsRequire, b as commonjsGlobal, g as getDefaultExportFromCjs, u as useMediaQuery, T as TableSkeleton, R as ReusableTable, a as DropdownMenuAbsolute } from "./dropdownMenuAbsolute-x0WsXrLZ.js";
78
78
  import * as ReactDOM from "react-dom";
79
79
  import ReactDOM__default from "react-dom";
80
80
  import { C as CustomToast } from "./index-ChOpfqCh.js";
@@ -110,10 +110,10 @@ function DownloadSampleFile() {
110
110
  const fieldOrder = [
111
111
  "productCode",
112
112
  "productName",
113
- "price",
113
+ "taxVAT",
114
+ "priceAfterTax",
114
115
  "unit",
115
116
  "category"
116
- // "image",
117
117
  ];
118
118
  const downloadFile = language === "en" ? sampleFileEn : sampleFileVi;
119
119
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-6 w-full", children: [
@@ -146,7 +146,14 @@ function DownloadSampleFile() {
146
146
  )
147
147
  }
148
148
  ),
149
- /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: downloadFile, download: language == "en" ? "digistore_bulkupload.xlsx" : "digistore_mautaosanpham.xlsx", children: translate2("downloadButton") })
149
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
150
+ "a",
151
+ {
152
+ href: downloadFile,
153
+ download: language == "en" ? "digistore_bulkupload.xlsx" : "digistore_mautaosanpham.xlsx",
154
+ children: translate2("downloadButton")
155
+ }
156
+ )
150
157
  ]
151
158
  }
152
159
  ),
@@ -26640,25 +26647,30 @@ function FileUploadButton({
26640
26647
  }
26641
26648
  ) });
26642
26649
  }
26643
- const HIDDEN_SYSTEM_FIELDS = ["Giá bán trước thuế", "Price before tax"];
26644
- const HIDDEN_MAPPING_FIELDS$1 = [
26645
- "Giá bán trước thuế",
26646
- "Price before tax",
26647
- "Thuế VAT",
26648
- "Tax"
26649
- ];
26650
+ const NON_MAPPABLE_FIELDS = ["Giá bán trước thuế", "Price before tax"];
26651
+ const getMappableSystemFields = (fields, method) => {
26652
+ return fields.filter((field) => {
26653
+ if (NON_MAPPABLE_FIELDS.includes(field)) return false;
26654
+ if (method === "direct") {
26655
+ return field !== "Thuế VAT" && field !== "Tax";
26656
+ }
26657
+ return true;
26658
+ });
26659
+ };
26650
26660
  function FieldMappingPopup({
26651
26661
  sheetHeaders,
26652
26662
  mappings,
26653
26663
  defaultMappings,
26654
- onChange
26664
+ onChange,
26665
+ taxDeductionMethod
26655
26666
  }) {
26656
26667
  const [open, setOpen] = useState(false);
26657
26668
  const popoverRef = useRef(null);
26658
26669
  const { translate: translate2 } = useTranslation("file");
26659
26670
  const systemFields = translate2("systemFields");
26660
- const visibleSystemFields = systemFields.filter(
26661
- (field) => !HIDDEN_SYSTEM_FIELDS.includes(field) && !HIDDEN_MAPPING_FIELDS$1.includes(field)
26671
+ const visibleSystemFields = getMappableSystemFields(
26672
+ systemFields,
26673
+ taxDeductionMethod
26662
26674
  );
26663
26675
  const handleSelect = (field, value) => {
26664
26676
  const newMappings = __spreadValues({}, mappings);
@@ -26763,12 +26775,12 @@ function FieldMappingPopup({
26763
26775
  ] });
26764
26776
  }
26765
26777
  const EXCLUDED_SYSTEM_FIELDS = ["Giá bán trước thuế", "Price before tax"];
26766
- const HIDDEN_MAPPING_FIELDS = [
26767
- "Giá bán trước thuế",
26768
- "Price before tax",
26769
- "Thuế VAT",
26770
- "Tax"
26771
- ];
26778
+ const getHiddenFieldsByTaxMethod = (method) => {
26779
+ if (method === "credit") {
26780
+ return [];
26781
+ }
26782
+ return ["Giá bán trước thuế", "Price before tax", "Thuế VAT", "Tax"];
26783
+ };
26772
26784
  function MergeAndCheckData({ taxDeductionMethod }) {
26773
26785
  const [useHeader, setUseHeader] = useState(true);
26774
26786
  const [showCancelPopup, setShowCancelPopup] = useState(false);
@@ -26877,7 +26889,7 @@ function MergeAndCheckData({ taxDeductionMethod }) {
26877
26889
  }
26878
26890
  });
26879
26891
  const visibleSystemFields = systemFields.filter(
26880
- (field) => !HIDDEN_MAPPING_FIELDS.includes(field)
26892
+ (field) => !getHiddenFieldsByTaxMethod(taxDeductionMethod).includes(field)
26881
26893
  );
26882
26894
  const filteredRows = sheetMappingData.filter((row) => {
26883
26895
  return row.code || row.name || row.priceAfterTax || row.unit || row.category;
@@ -26886,7 +26898,17 @@ function MergeAndCheckData({ taxDeductionMethod }) {
26886
26898
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-8", children: [
26887
26899
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
26888
26900
  /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-[20px] leading-[30px] font-bold text-[#0E121B] mb-2", children: translate2("mergeDataTitle") }),
26889
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[16px] leading-[20px] font-normal text-[#0E121B] whitespace-pre-line", children: translate2("mergeDescription") })
26901
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[16px] leading-[20px] font-normal text-[#0E121B] whitespace-pre-line", children: translate2("mergeDescription") }),
26902
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
26903
+ taxDeductionMethod == "direct" && /* @__PURE__ */ jsxRuntimeExports.jsx(
26904
+ "p",
26905
+ {
26906
+ className: "text-[14px] w-fit leading-[18px] font-normal text-[#0E121B] bg-blue-200",
26907
+ dangerouslySetInnerHTML: {
26908
+ __html: translate2("directTaxNote")
26909
+ }
26910
+ }
26911
+ )
26890
26912
  ] }),
26891
26913
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-4 items-center justify-start", children: [
26892
26914
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -26895,7 +26917,8 @@ function MergeAndCheckData({ taxDeductionMethod }) {
26895
26917
  sheetHeaders,
26896
26918
  mappings,
26897
26919
  defaultMappings,
26898
- onChange: (m) => setMappings(m)
26920
+ onChange: (m) => setMappings(m),
26921
+ taxDeductionMethod
26899
26922
  }
26900
26923
  ),
26901
26924
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 items-center", children: [