diff --git a/src/pages/Product/ProductDetail.js b/src/pages/Product/ProductDetail.js
index 17fceea..907eccb 100644
--- a/src/pages/Product/ProductDetail.js
+++ b/src/pages/Product/ProductDetail.js
@@ -57,39 +57,39 @@ export const ProductDetail = observer(() => {
dataIndex: "mark_up_price",
key: "mark_up_price",
render: (text) =>
- new Intl.NumberFormat("id-ID", {
- style: "currency",
- currency: "IDR",
- }).format(text),
+ new Intl.NumberFormat("id-ID", {
+ style: "currency",
+ currency: "IDR",
+ }).format(text),
},
{
title: "Price",
dataIndex: "price",
key: "price",
render: (text) =>
- new Intl.NumberFormat("id-ID", {
- style: "currency",
- currency: "IDR",
- }).format(text),
+ new Intl.NumberFormat("id-ID", {
+ style: "currency",
+ currency: "IDR",
+ }).format(text),
},
{
title: "Biaya Admin",
dataIndex: "admin_price",
key: "admin_price",
render: (text) =>
- new Intl.NumberFormat("id-ID", {
- style: "currency",
- currency: "IDR",
- }).format(text),
+ new Intl.NumberFormat("id-ID", {
+ style: "currency",
+ currency: "IDR",
+ }).format(text),
}, {
title: "Partner fee",
dataIndex: "partner_fee",
key: "partner_fee",
render: (text) =>
- new Intl.NumberFormat("id-ID", {
- style: "currency",
- currency: "IDR",
- }).format(text),
+ new Intl.NumberFormat("id-ID", {
+ style: "currency",
+ currency: "IDR",
+ }).format(text),
},
{
title: "Tanggal Berlaku",
@@ -97,7 +97,7 @@ export const ProductDetail = observer(() => {
key: "startDate",
render: (text) => {
return (
- {text ? format(parseISO(text), "dd MMMM yyyy") : "-"}
+ {text ? format(parseISO(text), "dd MMMM yyyy") : "-"}
);
},
},
@@ -107,174 +107,178 @@ export const ProductDetail = observer(() => {
key: "endDate",
render: (text) => {
return (
-
- {text ? format(parseISO(text), "dd MMMM yyyy") : "Sampai Sekarang"}
-
+
+ {text ? format(parseISO(text), "dd MMMM yyyy") : "Sampai Sekarang"}
+
);
},
},
];
+ if (store.authentication.userData.role === "Admin Partner") delete columns[0];
+ if (store.authentication.userData.role === "Admin Partner") delete columns[3];
+
const styleSaldoTitle = store.ui.mediaQuery.isDesktop
- ? {
- display: "flex",
- justifyContent: "center",
- }
- : { fontSize: "0.75rem" };
+ ? {
+ display: "flex",
+ justifyContent: "center",
+ }
+ : { fontSize: "0.75rem" };
const styleSaldoContent = store.ui.mediaQuery.isDesktop
- ? {
- fontSize: "1.25rem",
- display: "flex",
- justifyContent: "center",
- }
- : null;
+ ? {
+ fontSize: "1.25rem",
+ display: "flex",
+ justifyContent: "center",
+ }
+ : null;
return (
-
-
-
- Product Detail
-
-
-
-
- Kode
-
-
- {store.product?.dataDetailProduct?.code}
-
-
- Nama Produk
-
-
- {store.product?.dataDetailProduct?.name}
-
-
- Supplier
-
-
- {store.product?.dataDetailProduct?.supplier?.name}
-
-
- Status
-
-
- {store.product?.dataDetailProduct?.status}
-
-
-
-
-
-
-
-
- Product Price History
-
- {store.ui.mediaQuery.isDesktop && (
-
{
- let pageNumber = page.current;
- store.product.pageSizePriceHistory = page.pageSize;
- store.product.pagePriceHistory = pageNumber - 1;
- modalLoader.setLoading(true);
- await store.product.getPriceHistoryByProduct(id);
- modalLoader.setLoading(false);
- }}
- />
- )}
- {store.ui.mediaQuery.isMobile && (
- {
- store.product.pageSizePriceHistory = pageSize;
- store.product.pagePriceHistory = page - 1;
- modalLoader.setLoading(true);
- await store.product.getPriceHistoryByProduct(id);
- modalLoader.setLoading(false);
- },
- pageSize: store.product.pageSizePriceHistory,
- total: store.product.totalDataPriceHistory,
- current: store.product.pagePriceHistory + 1,
- style: { marginBottom: "1rem", marginRight: "1rem" },
- }}
- dataSource={store.product.dataPriceHistory}
- style={{ padding: 0 }}
- renderItem={(item) => {
- return (
-
-
-
-
-
+
+
+
+ Product Detail
+
+
+
+
+ Kode
+
+
+ {store.product?.dataDetailProduct?.code}
+
+
+ Nama Produk
+
+
+ {store.product?.dataDetailProduct?.name}
+
+
+ Supplier
+
+
+ {store.product?.dataDetailProduct?.supplier?.name}
+
+
+ Status
+
+
+ {store.product?.dataDetailProduct?.status}
+
+
+
+
+
+
+
+
+ Product Price History
+
+ {store.ui.mediaQuery.isDesktop && (
+
{
+ let pageNumber = page.current;
+ store.product.pageSizePriceHistory = page.pageSize;
+ store.product.pagePriceHistory = pageNumber - 1;
+ modalLoader.setLoading(true);
+ await store.product.getPriceHistoryByProduct(id);
+ modalLoader.setLoading(false);
+ }}
+ />
+ )}
+ {store.ui.mediaQuery.isMobile && (
+ {
+ store.product.pageSizePriceHistory = pageSize;
+ store.product.pagePriceHistory = page - 1;
+ modalLoader.setLoading(true);
+ await store.product.getPriceHistoryByProduct(id);
+ modalLoader.setLoading(false);
+ },
+ pageSize: store.product.pageSizePriceHistory,
+ total: store.product.totalDataPriceHistory,
+ current: store.product.pagePriceHistory + 1,
+ style: { marginBottom: "1rem", marginRight: "1rem" },
+ }}
+ dataSource={store.product.dataPriceHistory}
+ style={{ padding: 0 }}
+ renderItem={(item) => {
+ return (
+
+
+
+
+ {store.authentication.userData.role === "Admin" ?
+ `
Markup Price :{" "}
{new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
}).format(item.mark_up_price)}
- {" "}
-
-
- Price:{" "}
- {new Intl.NumberFormat("id-ID", {
- style: "currency",
- currency: "IDR",
- }).format(item.price)}
- {" "}
-
-
- {" "}
- Tanggal Berlaku :
- {item.startDate
- ? format(
- parseISO(item.startDate),
- "dd MMMM yyyy"
- )
- : "-"}
- {" "}
-
-
- Tanggal Berakhir :{" "}
- {item.endDate
- ? format(
- parseISO(item.endDate),
- "dd MMMM yyyy"
- )
- : "Sampai Sekarang"}
- {" "}
-
-
-
-
- }
- />
- {/*
+ {" "}` : ''}
+
+
+ Price:{" "}
+ {new Intl.NumberFormat("id-ID", {
+ style: "currency",
+ currency: "IDR",
+ }).format(item.price)}
+ {" "}
+
+
+ {" "}
+ Tanggal Berlaku :
+ {item.startDate
+ ? format(
+ parseISO(item.startDate),
+ "dd MMMM yyyy"
+ )
+ : "-"}
+ {" "}
+
+
+ Tanggal Berakhir :{" "}
+ {item.endDate
+ ? format(
+ parseISO(item.endDate),
+ "dd MMMM yyyy"
+ )
+ : "Sampai Sekarang"}
+ {" "}
+
+
+
+
+ }
+ />
+ {/* */}
-
-
-
- );
- }}
- />
- )}
-
-
-
-
-
-
+
+
+
+ );
+ }}
+ />
+ )}
+
+
+
+
+
+
);
});