fix
## Deskripsi: - Optimalisasi admin voting ## No issue
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { Investasi_ComponentCardBeranda } from "./main/comp_card_beranda";
|
||||
import { Investasi_ComponentCardDaftarTransaksi } from "./main/comp_card_daftar_transaksi";
|
||||
import { Investasi_ComponentFooterMain } from "./main/comp_footer_main";
|
||||
import { Investasi_ComponentButtonUpdateBeranda } from "./main/comp_update_beranda";
|
||||
|
||||
export { Investasi_ComponentFooterMain };
|
||||
export { Investasi_ComponentCardBeranda };
|
||||
export { Investasi_ComponentButtonUpdateBeranda };
|
||||
export { Investasi_ComponentCardDaftarTransaksi };
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import {
|
||||
Box,
|
||||
Paper,
|
||||
Group,
|
||||
Title,
|
||||
Stack,
|
||||
Center,
|
||||
Badge,
|
||||
Text,
|
||||
Card,
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
import { MODEL_INVOICE_INVESTASI } from "../../_lib/interface";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import ComponentGlobal_CardLoadingOverlay from "@/app_modules/_global/loading_card";
|
||||
|
||||
export function Investasi_ComponentCardDaftarTransaksi({
|
||||
data,
|
||||
}: {
|
||||
data: MODEL_INVOICE_INVESTASI;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [visible, setVisible] = useState(false);
|
||||
async function onClick({
|
||||
invoiceId,
|
||||
statusInvoiceId,
|
||||
}: {
|
||||
invoiceId: string;
|
||||
statusInvoiceId: string;
|
||||
}) {
|
||||
// Proses
|
||||
if (statusInvoiceId === "2") {
|
||||
setVisible(true);
|
||||
return router.push(NEW_RouterInvestasi.proses_transaksi + invoiceId, {
|
||||
scroll: false,
|
||||
});
|
||||
}
|
||||
|
||||
// Menunggu
|
||||
if (statusInvoiceId === "3") {
|
||||
setVisible(true);
|
||||
return router.push(NEW_RouterInvestasi.invoice + invoiceId, {
|
||||
scroll: false,
|
||||
});
|
||||
}
|
||||
|
||||
ComponentGlobal_NotifikasiPeringatan("Status Belum Tersedia");
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
style={{
|
||||
padding: "15px",
|
||||
backgroundColor: AccentColor.darkblue,
|
||||
border: `2px solid ${AccentColor.blue}`,
|
||||
borderRadius: "10px",
|
||||
color: "white",
|
||||
}}
|
||||
mb={"md"}
|
||||
onClick={() =>
|
||||
onClick({
|
||||
invoiceId: data.id,
|
||||
statusInvoiceId: data.statusInvoiceId,
|
||||
})
|
||||
}
|
||||
>
|
||||
<Group position="apart">
|
||||
<Title order={6}>{data.Investasi.title}</Title>
|
||||
<Title order={5}>
|
||||
Rp.
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumFractionDigits: 10,
|
||||
}).format(+data.nominal)}
|
||||
</Title>
|
||||
</Group>
|
||||
<Group position="apart">
|
||||
<Stack spacing={0}>
|
||||
{/* <Text fz={"xs"}>Bank {data.namaBank}</Text> */}
|
||||
<Text fz={"xs"}>{moment(data.createdAt).format("ll")}</Text>
|
||||
</Stack>
|
||||
<Text>{data.lembarTerbeli} Lembar</Text>
|
||||
</Group>
|
||||
<Center mt={"sm"}>
|
||||
<Badge>{data.StatusInvoice.name}</Badge>
|
||||
</Center>
|
||||
{visible && <ComponentGlobal_CardLoadingOverlay />}
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function investasi_funGetTransaksiByUserId({
|
||||
page,
|
||||
}: {
|
||||
page: number;
|
||||
}) {
|
||||
const authorId = await user_getOneUserId();
|
||||
const takeData = 10;
|
||||
const skipData = page * takeData - takeData;
|
||||
|
||||
const data = await prisma.investasi_Invoice.findMany({
|
||||
take: takeData,
|
||||
skip: skipData,
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
where: {
|
||||
authorId: authorId,
|
||||
},
|
||||
include: {
|
||||
Investasi: true,
|
||||
MasterBank: true,
|
||||
StatusInvoice: true,
|
||||
},
|
||||
});
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
import { investasi_funGetProspekById } from "./get/fun_get_file_by_prospek_id";
|
||||
import { investasi_funGetOneInvestasiById } from "./get/fun_get_one_by_id";
|
||||
import { investasi_funGetTransaksiByUserId } from "./get/fun_get_all_transaksi_by_user_id";
|
||||
import { investasi_funUploadBuktiTransferById } from "./upload/fun_upload_bukti_transfer";
|
||||
|
||||
export { investasi_funGetOneInvestasiById };
|
||||
export { investasi_funGetProspekById };
|
||||
export { investasi_funUploadBuktiTransferById };
|
||||
export { investasi_funGetTransaksiByUserId };
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import _ from "lodash";
|
||||
import { v4 } from "uuid";
|
||||
import fs from "fs";
|
||||
|
||||
export async function investasi_funUploadBuktiTransferById({
|
||||
invoiceId,
|
||||
file,
|
||||
}: {
|
||||
invoiceId: string;
|
||||
file: FormData;
|
||||
}) {
|
||||
// console.log(file);
|
||||
const gambar: any = file.get("file");
|
||||
const fileName = gambar.name;
|
||||
const fileExtension = _.lowerCase(gambar.name.split(".").pop());
|
||||
const fileRandomName = v4(fileName) + "." + fileExtension;
|
||||
console.log(gambar);
|
||||
|
||||
const upload = await prisma.images.create({
|
||||
data: {
|
||||
url: fileRandomName,
|
||||
label: "INVESTASI_INVOICE",
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
url: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!upload) return { status: 400, message: "Gagal upload gambar" };
|
||||
const uploadFolder = Buffer.from(await gambar.arrayBuffer());
|
||||
fs.writeFileSync(`./public/investasi/invoice/${upload.url}`, uploadFolder);
|
||||
|
||||
const updateFile = await prisma.investasi_Invoice.update({
|
||||
where: {
|
||||
id: invoiceId,
|
||||
},
|
||||
data: {
|
||||
imagesId: upload.id,
|
||||
statusInvoiceId: "2",
|
||||
},
|
||||
});
|
||||
|
||||
if (!updateFile) return { status: 400, message: "Gagal update gambar" };
|
||||
return {
|
||||
status: 200,
|
||||
message: "Berhasil upload",
|
||||
};
|
||||
}
|
||||
@@ -99,7 +99,7 @@ export interface Model_Dokumen_Investasi {
|
||||
export interface MODEL_MASTER_BANK {
|
||||
id: string;
|
||||
namaBank: string;
|
||||
namaAkun: string
|
||||
namaAkun: string;
|
||||
norek: string;
|
||||
isActive: boolean;
|
||||
createdAt: Date;
|
||||
@@ -114,3 +114,29 @@ export interface Model_Status_Transaksi_Investasi {
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export interface MODEL_INVOICE_INVESTASI {
|
||||
id: string;
|
||||
isActive: boolean;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
nominal: string;
|
||||
lembarTerbeli: string;
|
||||
Investasi: MODEL_INVESTASI;
|
||||
investasiId: string;
|
||||
masterBankId: string;
|
||||
statusInvoiceId: string;
|
||||
authorId: string;
|
||||
imagesId: string;
|
||||
MasterBank: MODEL_MASTER_BANK;
|
||||
StatusInvoice: MODEL_STATUS_INVOICE_INVESTASI;
|
||||
|
||||
}
|
||||
|
||||
export interface MODEL_STATUS_INVOICE_INVESTASI {
|
||||
id: string;
|
||||
name: string;
|
||||
isActive: boolean;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Investasi_UiProsesPembelian } from "./transaksi/ui_proses_pembelian";
|
||||
import { Investasi_UiProsesTransaksi } from "./transaksi/ui_proses_transaksi";
|
||||
import { Investasi_UiBeranda } from "./main/ui_beranda";
|
||||
import { Investasi_UiLayoutMain } from "./main/ui_layout_main";
|
||||
import { Investasi_UiDaftarTransaksi } from "./main/ui_transaksi";
|
||||
|
||||
export { Investasi_UiProsesPembelian };
|
||||
export { Investasi_UiMetodePembayaran };
|
||||
@@ -13,3 +14,4 @@ export { Investasi_UiInvoice };
|
||||
export { Investasi_UiProsesTransaksi };
|
||||
export { Investasi_UiBeranda };
|
||||
export { Investasi_UiLayoutMain };
|
||||
export { Investasi_UiDaftarTransaksi };
|
||||
|
||||
15
src/app_modules/investasi/_ui/main/ui_transaksi.tsx
Normal file
15
src/app_modules/investasi/_ui/main/ui_transaksi.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
"use client";
|
||||
|
||||
import { Investasi_ViewDaftarTransaksi } from "../../_view/main/view_transaksi";
|
||||
|
||||
export function Investasi_UiDaftarTransaksi({
|
||||
dataTransaksi,
|
||||
}: {
|
||||
dataTransaksi: any[];
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Investasi_ViewDaftarTransaksi dataTransaksi={dataTransaksi} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -3,13 +3,42 @@
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { Investasi_ViewInvoice } from "../../_view";
|
||||
import { useAtom } from "jotai";
|
||||
|
||||
import { useState } from "react";
|
||||
import { gs_investas_menu } from "../../g_state";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { ActionIcon, Loader } from "@mantine/core";
|
||||
import { IconX } from "@tabler/icons-react";
|
||||
|
||||
export function Investasi_UiInvoice({ dataInvoice }: { dataInvoice : any}) {
|
||||
const router = useRouter();
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_investas_menu);
|
||||
const [isLoading, setLoading] = useState(false);
|
||||
|
||||
|
||||
export function Investasi_UiInvoice() {
|
||||
return (
|
||||
<UIGlobal_LayoutTamplate
|
||||
header={<UIGlobal_LayoutHeaderTamplate title="Invoice" />}
|
||||
header={
|
||||
<UIGlobal_LayoutHeaderTamplate
|
||||
title="Invoice"
|
||||
customButtonLeft={
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
onClick={() => {
|
||||
setHotMenu(3);
|
||||
setLoading(true);
|
||||
router.push(RouterInvestasi_OLD.main_transaksi);
|
||||
}}
|
||||
>
|
||||
{isLoading ? <Loader color="yellow" /> : <IconX />}
|
||||
</ActionIcon>
|
||||
}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Investasi_ViewInvoice dataInvoice={{}} />
|
||||
<Investasi_ViewInvoice dataInvoice={dataInvoice} />
|
||||
</UIGlobal_LayoutTamplate>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,15 +6,20 @@ import { Investasi_ViewMetodePembayaran } from "../../_view";
|
||||
|
||||
export function Investasi_UiMetodePembayaran({
|
||||
listBank,
|
||||
investasiId,
|
||||
}: {
|
||||
listBank: any[];
|
||||
investasiId: string
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<UIGlobal_LayoutTamplate
|
||||
header={<UIGlobal_LayoutHeaderTamplate title="Metode Pembayaran" />}
|
||||
>
|
||||
<Investasi_ViewMetodePembayaran listBank={listBank} />
|
||||
<Investasi_ViewMetodePembayaran
|
||||
listBank={listBank}
|
||||
investasiId={investasiId}
|
||||
/>
|
||||
</UIGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -4,19 +4,41 @@ import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_ta
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { IconX } from "@tabler/icons-react";
|
||||
import { Investasi_ViewProsesTransaksi } from "../../_view";
|
||||
import { ActionIcon, Loader } from "@mantine/core";
|
||||
import { gs_donasi_hot_menu } from "@/app_modules/donasi/global_state";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_investas_menu } from "../../g_state";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { useState } from "react";
|
||||
|
||||
export function Investasi_UiProsesTransaksi({ nomorAdmin }: { nomorAdmin : any}) {
|
||||
const router = useRouter();
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_investas_menu);
|
||||
const [isLoading, setLoading] = useState(false);
|
||||
|
||||
export function Investasi_UiProsesTransaksi() {
|
||||
return (
|
||||
<>
|
||||
<UIGlobal_LayoutTamplate
|
||||
header={
|
||||
<UIGlobal_LayoutHeaderTamplate
|
||||
title="Proses Transaksi"
|
||||
iconLeft={<IconX />}
|
||||
customButtonLeft={
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
onClick={() => {
|
||||
setHotMenu(3);
|
||||
setLoading(true);
|
||||
router.push(RouterInvestasi_OLD.main_transaksi);
|
||||
}}
|
||||
>
|
||||
{isLoading ? <Loader color="yellow" /> : <IconX />}
|
||||
</ActionIcon>
|
||||
}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Investasi_ViewProsesTransaksi />
|
||||
<Investasi_ViewProsesTransaksi nomorAdmin={nomorAdmin} />
|
||||
</UIGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import { Stack } from "@mantine/core";
|
||||
import { useState } from "react";
|
||||
import { Document, Page, pdfjs } from "react-pdf";
|
||||
import "react-pdf/dist/Page/AnnotationLayer.css";
|
||||
import "react-pdf/dist/Page/TextLayer.css";
|
||||
import styles from "./styles.module.css";
|
||||
import { Stack, Text } from "@mantine/core";
|
||||
// import { useState } from "react";
|
||||
// import { Document, Page, pdfjs } from "react-pdf";
|
||||
// import "react-pdf/dist/Page/AnnotationLayer.css";
|
||||
// import "react-pdf/dist/Page/TextLayer.css";
|
||||
// import styles from "./styles.module.css";
|
||||
// import { GlobalWorkerOptions } from "pdfjs-dist";
|
||||
|
||||
// pdfjs.GlobalWorkerOptions.workerSrc = new URL(
|
||||
// "pdfjs-dist/build/pdf.worker.min.mjs",
|
||||
// import.meta.url
|
||||
// ).toString();
|
||||
// GlobalWorkerOptions.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/4.5.136/pdf.worker.js`;
|
||||
|
||||
export function Investasi_ViewFileViewer({
|
||||
fileId,
|
||||
@@ -17,7 +15,12 @@ export function Investasi_ViewFileViewer({
|
||||
fileId: string;
|
||||
path: string;
|
||||
}) {
|
||||
return <Stack>{/* <MyFile file={path + fileId} /> */}</Stack>;
|
||||
return (
|
||||
<Stack>
|
||||
Maintenance
|
||||
{/* <MyFile file={path + fileId} /> */}
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
// function MyFile({ file }: { file: any }) {
|
||||
@@ -28,15 +31,19 @@ export function Investasi_ViewFileViewer({
|
||||
// setNumPages(numPages);
|
||||
// }
|
||||
|
||||
// return<>
|
||||
// <Text>Maintenance</Text>
|
||||
// </>
|
||||
|
||||
// return (
|
||||
// <div>
|
||||
// <Document
|
||||
// className={styles.file_view}
|
||||
// // className={styles.file_view}
|
||||
// file={file}
|
||||
// onLoadSuccess={onDocumentLoadSuccess}
|
||||
|
||||
// >
|
||||
// <Page className={styles.page} pageNumber={pageNumber} />
|
||||
// <Page pageNumber={pageNumber} />
|
||||
// </Document>
|
||||
// {/* <p>
|
||||
// Page {pageNumber} of {numPages}
|
||||
|
||||
68
src/app_modules/investasi/_view/main/view_transaksi.tsx
Normal file
68
src/app_modules/investasi/_view/main/view_transaksi.tsx
Normal file
@@ -0,0 +1,68 @@
|
||||
import {
|
||||
NEW_RouterInvestasi,
|
||||
RouterInvestasi_OLD,
|
||||
} from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import {
|
||||
Stack,
|
||||
Box,
|
||||
Paper,
|
||||
Group,
|
||||
Title,
|
||||
Text,
|
||||
Center,
|
||||
Badge,
|
||||
Loader,
|
||||
} from "@mantine/core";
|
||||
import moment from "moment";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_INVOICE_INVESTASI } from "../../_lib/interface";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import _ from "lodash";
|
||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||
import { ComponentColab_CardBeranda } from "@/app_modules/colab/component/card_view/card_beranda";
|
||||
import colab_getListAllProyek from "@/app_modules/colab/fun/get/get_list_all_proyek";
|
||||
import { ScrollOnly } from "next-scroll-loader";
|
||||
import { Investasi_ComponentCardDaftarTransaksi } from "../../_component";
|
||||
|
||||
export function Investasi_ViewDaftarTransaksi({
|
||||
dataTransaksi,
|
||||
}: {
|
||||
dataTransaksi: MODEL_INVOICE_INVESTASI[];
|
||||
}) {
|
||||
const [data, setData] = useState(dataTransaksi);
|
||||
const [activePage, setActivePage] = useState(1);
|
||||
|
||||
return (
|
||||
<>
|
||||
{_.isEmpty(data) ? (
|
||||
<ComponentGlobal_IsEmptyData />
|
||||
) : (
|
||||
<Box>
|
||||
<ScrollOnly
|
||||
height="82vh"
|
||||
renderLoading={() => (
|
||||
<Center mt={"lg"}>
|
||||
<Loader color={"yellow"} />
|
||||
</Center>
|
||||
)}
|
||||
data={data}
|
||||
setData={setData}
|
||||
moreData={async () => {
|
||||
const loadData = await colab_getListAllProyek({
|
||||
page: activePage + 1,
|
||||
});
|
||||
|
||||
setActivePage((val) => val + 1);
|
||||
|
||||
return loadData;
|
||||
}}
|
||||
>
|
||||
{(item) => <Investasi_ComponentCardDaftarTransaksi data={item} />}
|
||||
</ScrollOnly>
|
||||
</Box>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -21,17 +21,37 @@ import {
|
||||
import { IconCamera, IconCircleCheck } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_INVOICE_INVESTASI } from "../../_lib/interface";
|
||||
import { investasi_funUploadBuktiTransferById } from "../../_fun";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
|
||||
export function Investasi_ViewInvoice({
|
||||
dataInvoice,
|
||||
}: {
|
||||
dataInvoice: any;
|
||||
dataInvoice: MODEL_INVOICE_INVESTASI;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [invoice, setDataInvoice] = useState(dataInvoice);
|
||||
const [isLoading, setLoading] = useState(false);
|
||||
const [data, setData] = useState(dataInvoice);
|
||||
const [file, setFile] = useState<File | null>(null);
|
||||
const [image, setImage] = useState<any | null>(null);
|
||||
// const [active, setActive] = useAtom(gs_donasi_hot_menu);
|
||||
// const [image, setImage] = useState<any | null>(null);
|
||||
|
||||
async function onUpload() {
|
||||
const gambar = new FormData();
|
||||
gambar.append("file", file as any);
|
||||
|
||||
const res = await investasi_funUploadBuktiTransferById({
|
||||
invoiceId: data.id,
|
||||
file: gambar,
|
||||
});
|
||||
if (res.status !== 200) return ComponentGlobal_NotifikasiGagal(res.message);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
setLoading(true);
|
||||
router.push(NEW_RouterInvestasi.proses_transaksi + data.id, {
|
||||
scroll: false,
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -48,10 +68,6 @@ export function Investasi_ViewInvoice({
|
||||
}}
|
||||
>
|
||||
<Title order={5}>Mohon transfer ke rekening dibawah</Title>
|
||||
<Group spacing={"xs"}>
|
||||
<Text>untuk diteruskan ke </Text>
|
||||
<Text fw={"bold"}>{invoice?.Donasi?.Author.username}</Text>
|
||||
</Group>
|
||||
</Stack>
|
||||
|
||||
<Paper
|
||||
@@ -67,8 +83,8 @@ export function Investasi_ViewInvoice({
|
||||
>
|
||||
<Stack spacing={"md"}>
|
||||
<Stack spacing={0}>
|
||||
<Text>Bank {invoice?.DonasiMaster_Bank?.name}</Text>
|
||||
<Text>PT. Himpunan Pengusaha Badung</Text>
|
||||
<Text>Bank {data?.MasterBank?.namaBank}</Text>
|
||||
<Text>{data?.MasterBank?.namaAkun}</Text>
|
||||
</Stack>
|
||||
<Paper
|
||||
style={{
|
||||
@@ -84,13 +100,13 @@ export function Investasi_ViewInvoice({
|
||||
<Grid.Col span={8}>
|
||||
<Group position="left" align="center" h={"100%"}>
|
||||
<Title order={4} color={MainColor.yellow}>
|
||||
{invoice?.DonasiMaster_Bank?.norek}
|
||||
{data?.MasterBank?.norek}
|
||||
</Title>
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={4}>
|
||||
<Group position="right">
|
||||
<CopyButton value={invoice?.DonasiMaster_Bank?.norek}>
|
||||
<CopyButton value={data?.MasterBank?.norek}>
|
||||
{({ copied, copy }) => (
|
||||
<Button
|
||||
style={{
|
||||
@@ -141,13 +157,13 @@ export function Investasi_ViewInvoice({
|
||||
<Grid.Col span={8}>
|
||||
<Group position="left" align="center" h={"100%"}>
|
||||
<Title order={4} color="white">
|
||||
<TampilanRupiahDonasi nominal={+(+invoice.nominal)} />
|
||||
<TampilanRupiahDonasi nominal={+(+data.nominal)} />
|
||||
</Title>
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={4}>
|
||||
<Group position="right">
|
||||
<CopyButton value={"" + +invoice.nominal}>
|
||||
<CopyButton value={"" + +data.nominal}>
|
||||
{({ copied, copy }) => (
|
||||
<Button
|
||||
style={{
|
||||
@@ -167,9 +183,6 @@ export function Investasi_ViewInvoice({
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Paper>
|
||||
{/* <Text fz={"xs"} c={"gray"}>
|
||||
Sudah termasuk biaya admin Rp. 2.500,-
|
||||
</Text> */}
|
||||
</Stack>
|
||||
</Paper>
|
||||
|
||||
@@ -189,13 +202,8 @@ export function Investasi_ViewInvoice({
|
||||
<FileButton
|
||||
onChange={async (files: any | null) => {
|
||||
try {
|
||||
// const buffer = URL.createObjectURL(
|
||||
// new Blob([new Uint8Array(await files.arrayBuffer())])
|
||||
// );
|
||||
// console.log(buffer, "ini buffer");
|
||||
// console.log(files, " ini file");
|
||||
setFile(files);
|
||||
// onUpload(invoice.id, files);
|
||||
// onUpload({ invoiceId: data.id, file: files });
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
@@ -241,23 +249,16 @@ export function Investasi_ViewInvoice({
|
||||
bg={MainColor.yellow}
|
||||
color="yellow"
|
||||
c={"black"}
|
||||
// onClick={() => onClick(router, invoice.id, setActive)}
|
||||
loaderPosition="center"
|
||||
loading={isLoading}
|
||||
onClick={() => {
|
||||
router.push(NEW_RouterInvestasi.proses_transaksi + "1", {
|
||||
scroll: false,
|
||||
});
|
||||
onUpload();
|
||||
}}
|
||||
>
|
||||
Saya Sudah Transfer
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
disabled
|
||||
radius={"xl"}
|
||||
// bg={"orange"}
|
||||
// color="orange"
|
||||
// onClick={() => onClick(router, invoice.id)}
|
||||
>
|
||||
<Button disabled radius={"xl"}>
|
||||
Menunggu Bukti Transfer
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -7,11 +7,18 @@ import { Button, Paper, Radio, Stack, Text, Title } from "@mantine/core";
|
||||
import { useLocalStorage } from "@mantine/hooks";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_MASTER_BANK } from "../../_lib/interface";
|
||||
import { investasi_funCreateInvoice } from "../../_fun/create/fun_create_invoice";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { data } from "autoprefixer";
|
||||
|
||||
export function Investasi_ViewMetodePembayaran({
|
||||
listBank,
|
||||
investasiId,
|
||||
}: {
|
||||
listBank: any[];
|
||||
listBank: MODEL_MASTER_BANK[];
|
||||
investasiId: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [bank, setBank] = useState(listBank);
|
||||
@@ -21,9 +28,25 @@ export function Investasi_ViewMetodePembayaran({
|
||||
key: "total_investasi",
|
||||
defaultValue: 0,
|
||||
});
|
||||
const [jumlah, setJumlah] = useLocalStorage({
|
||||
key: "jumlah_investasi",
|
||||
defaultValue: 0,
|
||||
});
|
||||
|
||||
async function onProses() {
|
||||
router.push(NEW_RouterInvestasi.invoice + "1", { scroll: false });
|
||||
const res = await investasi_funCreateInvoice({
|
||||
data: {
|
||||
total: total,
|
||||
pilihBank: pilihBank,
|
||||
investasiId: investasiId,
|
||||
jumlah: jumlah,
|
||||
},
|
||||
});
|
||||
|
||||
if (res.status !== 201)
|
||||
return ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
router.push(NEW_RouterInvestasi.invoice + res.data?.id, { scroll: false });
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -57,7 +80,7 @@ export function Investasi_ViewMetodePembayaran({
|
||||
value={e.id}
|
||||
label={
|
||||
<Title order={6} color="white">
|
||||
{e.name}
|
||||
{e.namaBank}
|
||||
</Title>
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
@@ -11,8 +12,10 @@ import {
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { IconBrandWhatsapp } from "@tabler/icons-react";
|
||||
import Link from "next/link";
|
||||
|
||||
export function Investasi_ViewProsesTransaksi() {
|
||||
export function Investasi_ViewProsesTransaksi({ nomorAdmin }: { nomorAdmin : any}) {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
@@ -78,17 +81,17 @@ export function Investasi_ViewProsesTransaksi() {
|
||||
Klik pada logo Whatsapp ini.
|
||||
</Text>
|
||||
</Stack>
|
||||
{/* <Link
|
||||
color="white"
|
||||
style={{
|
||||
color: "black",
|
||||
textDecoration: "none",
|
||||
}}
|
||||
target="_blank"
|
||||
href={`https://wa.me/+${nomorAdmin.nomor}?text=Hallo Admin , Saya ada kendala dalam proses transfer donasi!`}
|
||||
>
|
||||
<IconBrandWhatsapp size={40} color={Warna.hijau_cerah} />
|
||||
</Link> */}
|
||||
<Link
|
||||
color="white"
|
||||
style={{
|
||||
color: "black",
|
||||
textDecoration: "none",
|
||||
}}
|
||||
target="_blank"
|
||||
href={`https://wa.me/+${nomorAdmin.nomor}?text=Hallo Admin , Saya ada kendala dalam proses transfer investasi !`}
|
||||
>
|
||||
<IconBrandWhatsapp size={40} color={Warna.hijau_cerah} />
|
||||
</Link>
|
||||
</Group>
|
||||
</Paper>
|
||||
</Paper>
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import {
|
||||
ComponentGlobal_WarningMaxUpload,
|
||||
maksimalUploadFile,
|
||||
} from "@/app_modules/_global/component/waring_popup";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import { MODEL_DEFAULT_MASTER_OLD } from "@/app_modules/model_global/model_default_master";
|
||||
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
||||
import mqtt_client from "@/util/mqtt_client";
|
||||
import {
|
||||
AspectRatio,
|
||||
Box,
|
||||
@@ -28,17 +35,8 @@ import { useAtom } from "jotai";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import toast from "react-simple-toasts";
|
||||
import { funCreateInvestasi } from "../fun/fun_create_investasi";
|
||||
import { gs_investasi_status, gs_investas_menu } from "../g_state";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import mqtt_client from "@/util/mqtt_client";
|
||||
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
||||
import { gs_investas_menu, gs_investasi_status } from "../g_state";
|
||||
|
||||
export default function InvestasiCreate({
|
||||
id,
|
||||
|
||||
@@ -19,7 +19,6 @@ import { IconCamera, IconUpload } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import toast from "react-simple-toasts";
|
||||
import funCreateBeritaInvestasi from "../fun/fun_create_berita";
|
||||
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
@@ -45,7 +44,7 @@ export default function CreateBeritaInvestasi({
|
||||
async function onCreate() {
|
||||
const body = value;
|
||||
|
||||
if (_.values(body).includes("")) return toast("Lengkapi data");
|
||||
if (_.values(body).includes("")) return ComponentGlobal_NotifikasiPeringatan("Lengkapi data");
|
||||
if (!fl) return ComponentGlobal_NotifikasiPeringatan("File Kosong");
|
||||
|
||||
const fd = new FormData();
|
||||
|
||||
@@ -1,44 +1,18 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import {
|
||||
ActionIcon,
|
||||
AspectRatio,
|
||||
Avatar,
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Flex,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Paper,
|
||||
Slider,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import {
|
||||
IconBookDownload,
|
||||
IconFileDescription,
|
||||
IconSpeakerphone,
|
||||
} from "@tabler/icons-react";
|
||||
import { Button, Stack } from "@mantine/core";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { gs_investasi_status } from "../../g_state";
|
||||
import toast from "react-simple-toasts";
|
||||
import { MODEL_INVESTASI } from "../../_lib/interface";
|
||||
import funGantiStatusInvestasi from "../../fun/fun_ganti_status";
|
||||
import { useState } from "react";
|
||||
import _ from "lodash";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentInvestasi_DetailDataNonPublish } from "../../component/detail/detai_data_non_publish";
|
||||
import { investasi_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
||||
import mqtt_client from "@/util/mqtt_client";
|
||||
import { useState } from "react";
|
||||
import { MODEL_INVESTASI } from "../../_lib/interface";
|
||||
import { ComponentInvestasi_DetailDataNonPublish } from "../../component/detail/detai_data_non_publish";
|
||||
import { investasi_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
|
||||
|
||||
export default function DetailReviewInvestasi({
|
||||
dataInvestasi,
|
||||
|
||||
@@ -3,11 +3,8 @@
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { Box, Center, Loader, Stack, Text, Title } from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { IconCircleCheck } from "@tabler/icons-react";
|
||||
import moment from "moment";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import toast from "react-simple-toasts";
|
||||
import Countdown from "react-countdown";
|
||||
|
||||
export default function CountDownTransaksiInvestasi() {
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import { AppShell, Button, Center, Footer } from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React from "react";
|
||||
import toast from "react-simple-toasts";
|
||||
|
||||
export default function LayoutEditBeritaInvestasi({
|
||||
children,
|
||||
@@ -19,11 +15,6 @@ export default function LayoutEditBeritaInvestasi({
|
||||
<>
|
||||
<AppComponentGlobal_LayoutTamplate
|
||||
header={<ComponentGlobal_HeaderTamplate title="Edit Berita" />}
|
||||
// footer={
|
||||
// <Footer height={70} sx={{ borderStyle: "none" }}>
|
||||
|
||||
// </Footer>
|
||||
// }
|
||||
>
|
||||
{children}
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
|
||||
@@ -1,31 +1,26 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import {
|
||||
AspectRatio,
|
||||
Button,
|
||||
Center,
|
||||
FileButton,
|
||||
FileInput,
|
||||
Group,
|
||||
Image,
|
||||
Stack,
|
||||
Text,
|
||||
TextInput,
|
||||
Textarea,
|
||||
} from "@mantine/core";
|
||||
import { IconCamera, IconUpload } from "@tabler/icons-react";
|
||||
import {
|
||||
MODEL_INVESTASI,
|
||||
Model_Berita_Investasi,
|
||||
} from "../_lib/interface";
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import toast from "react-simple-toasts";
|
||||
import { IconCamera } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { Model_Berita_Investasi } from "../_lib/interface";
|
||||
import funEditBeritaInvestasi from "../fun/fun_edit_berita";
|
||||
import deleteBeritaInvestasi from "../fun/fun_delete_berita";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
|
||||
export default function EditBeritaInvestasi({
|
||||
dataBerita,
|
||||
@@ -39,7 +34,7 @@ export default function EditBeritaInvestasi({
|
||||
|
||||
async function onUpdate() {
|
||||
const body = edit;
|
||||
if (_.values(body).includes("")) return toast("Lengkapi data");
|
||||
if (_.values(body).includes("")) return ComponentGlobal_NotifikasiPeringatan("Lengkapi data");
|
||||
|
||||
const fd = new FormData();
|
||||
fd.append("file", fl as any);
|
||||
@@ -48,12 +43,11 @@ export default function EditBeritaInvestasi({
|
||||
if (res.status === 200) {
|
||||
router.back();
|
||||
} else {
|
||||
toast(res.message)
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import {
|
||||
AspectRatio,
|
||||
Button,
|
||||
@@ -9,7 +8,6 @@ import {
|
||||
FileButton,
|
||||
Group,
|
||||
Image,
|
||||
Modal,
|
||||
NumberInput,
|
||||
Paper,
|
||||
Select,
|
||||
@@ -21,25 +19,25 @@ import { IconUpload } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
|
||||
import {
|
||||
ComponentGlobal_WarningMaxUpload,
|
||||
maksimalUploadFile,
|
||||
} from "@/app_modules/_global/component/waring_popup";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
|
||||
import { MODEL_DEFAULT_MASTER_OLD } from "@/app_modules/model_global/model_default_master";
|
||||
import { useDisclosure, useWindowScroll } from "@mantine/hooks";
|
||||
import _ from "lodash";
|
||||
import { useState } from "react";
|
||||
import toast from "react-simple-toasts";
|
||||
import funEditInvestasi from "../fun/fun_edit_investasi";
|
||||
import { MODEL_INVESTASI } from "../_lib/interface";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import UIGlobal_Modal from "@/app_modules/_global/ui/ui_modal";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
import funEditInvestasi from "../fun/fun_edit_investasi";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
|
||||
export default function EditIntroInvestasi({
|
||||
dataInvestasi,
|
||||
@@ -70,7 +68,8 @@ export default function EditIntroInvestasi({
|
||||
|
||||
async function onUpdate() {
|
||||
const body = edit_inves;
|
||||
if (_.values(edit_inves).includes("")) return toast("Lengkapi data");
|
||||
if (_.values(edit_inves).includes(""))
|
||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi data");
|
||||
|
||||
const fd = new FormData();
|
||||
fd.append("file", fl as any);
|
||||
|
||||
@@ -1,36 +1,31 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
|
||||
import {
|
||||
ActionIcon,
|
||||
AspectRatio,
|
||||
Box,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Menu,
|
||||
Paper,
|
||||
Spoiler,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { IconDots, IconEdit } from "@tabler/icons-react";
|
||||
import { IconEdit } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import moment from "moment";
|
||||
import { useRouter } from "next/navigation";
|
||||
import toast from "react-simple-toasts";
|
||||
import { MODEL_INVESTASI } from "../_lib/interface";
|
||||
import React, { useState } from "react";
|
||||
import _ from "lodash";
|
||||
import getOneInvestasiById from "../fun/get_one_investasi_by_id";
|
||||
import funLoadDataInvestasi from "../fun/fun_load_data";
|
||||
import { MODEL_INVESTASI } from "../_lib/interface";
|
||||
import funDeleteBeritaInvestasi from "../fun/fun_delete_berita";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
|
||||
import funLoadDataInvestasi from "../fun/fun_load_data";
|
||||
|
||||
export default function ListEditBeritaInvestasi({
|
||||
dataInvestasi,
|
||||
@@ -46,10 +41,10 @@ export default function ListEditBeritaInvestasi({
|
||||
await funDeleteBeritaInvestasi(idBerita).then(async (res) => {
|
||||
if (res.status === 200) {
|
||||
const load = await funLoadDataInvestasi(investasi.id);
|
||||
toast(res.message);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
return setInvestasi(load as any);
|
||||
} else {
|
||||
toast(res.message);
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -79,7 +74,9 @@ export default function ListEditBeritaInvestasi({
|
||||
color: "white",
|
||||
marginBottom: "15px",
|
||||
}}
|
||||
onClick={() => router.push(RouterInvestasi_OLD.detail_berita + v.id)}
|
||||
onClick={() =>
|
||||
router.push(RouterInvestasi_OLD.detail_berita + v.id)
|
||||
}
|
||||
>
|
||||
<Stack spacing={"xs"}>
|
||||
<Group position="apart">
|
||||
|
||||
@@ -2,33 +2,25 @@
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
import {
|
||||
Avatar,
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Flex,
|
||||
Group,
|
||||
Paper,
|
||||
Radio,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import toast from "react-simple-toasts";
|
||||
import {
|
||||
MODEL_INVESTASI,
|
||||
MODEL_Transaksi_Investasi,
|
||||
MODEL_MASTER_BANK,
|
||||
} from "../_lib/interface";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_TransferValue } from "../g_state";
|
||||
import getNorekInvestasi from "../fun/get_norek";
|
||||
import _ from "lodash";
|
||||
import { MODEL_INVESTASI, MODEL_MASTER_BANK } from "../_lib/interface";
|
||||
import funCreateTransaksiInvestasi from "../fun/fun_create_transaksi";
|
||||
import { myConsole } from "@/app/fun/my_console";
|
||||
import getNorekInvestasi from "../fun/get_norek";
|
||||
import { gs_TransferValue } from "../g_state";
|
||||
|
||||
export default function MetodeTransferInvestasi({
|
||||
dataInvestasi,
|
||||
@@ -53,10 +45,10 @@ export default function MetodeTransferInvestasi({
|
||||
authorId
|
||||
).then(async (res) => {
|
||||
if (res.status === 201) {
|
||||
toast(res.message);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
router.push(RouterInvestasi_OLD.transfer + `${res.res?.id}`);
|
||||
} else {
|
||||
toast(res.message);
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -70,7 +62,7 @@ export default function MetodeTransferInvestasi({
|
||||
nomorRekening: res.res?.norek as any,
|
||||
});
|
||||
} else {
|
||||
toast(res.message);
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,33 +1,20 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import {
|
||||
ActionIcon,
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
NumberInput,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useCounter, useFocusTrap, useShallowEffect } from "@mantine/hooks";
|
||||
import {
|
||||
IconMinus,
|
||||
IconNumber10Small,
|
||||
IconPlus,
|
||||
IconRefresh,
|
||||
} from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useFocusTrap } from "@mantine/hooks";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import toast from "react-simple-toasts";
|
||||
import { MODEL_INVESTASI } from "../_lib/interface";
|
||||
import { error } from "console";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_TransferValue } from "../g_state";
|
||||
|
||||
export default function ProsesInvestasi({
|
||||
@@ -61,7 +48,6 @@ export default function ProsesInvestasi({
|
||||
const randomId = date.getTime();
|
||||
|
||||
async function onProses() {
|
||||
|
||||
const body = {
|
||||
transaction_details: {
|
||||
order_id: "hipmi_" + `${randomId}`,
|
||||
@@ -69,7 +55,7 @@ export default function ProsesInvestasi({
|
||||
},
|
||||
item_details: [
|
||||
{
|
||||
id: "item_"+ `${randomId}`,
|
||||
id: "item_" + `${randomId}`,
|
||||
name: investasi.title,
|
||||
price: Number(investasi.hargaLembar),
|
||||
quantity: transferValue.lembarTerbeli,
|
||||
|
||||
@@ -1,36 +1,29 @@
|
||||
"use client";
|
||||
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import {
|
||||
Box,
|
||||
Group,
|
||||
NumberInput,
|
||||
Divider,
|
||||
Center,
|
||||
Button,
|
||||
Text,
|
||||
Container,
|
||||
Flex,
|
||||
TextInput,
|
||||
} from "@mantine/core";
|
||||
import { useFocusTrap, useShallowEffect } from "@mantine/hooks";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { MODEL_INVESTASI } from "../_lib/interface";
|
||||
import { MODEL_PROFILE_OLD } from "@/app_modules/home/model/user_profile";
|
||||
import { useEffect, useState } from "react";
|
||||
import getTokenTransaksi from "../fun/get_token_transaksi";
|
||||
import toast from "react-simple-toasts";
|
||||
import funUpdatePaymentInvestasi from "../fun/fun_update_payment";
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_investas_menu, gs_midtrans_snap } from "../g_state";
|
||||
import funUpdateInvestasi from "../fun/fun_update_investasi";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Divider,
|
||||
Group,
|
||||
NumberInput,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import { useFocusTrap, useShallowEffect } from "@mantine/hooks";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useEffect, useState } from "react";
|
||||
import funUpdateInvestasi from "../fun/fun_update_investasi";
|
||||
import funUpdatePaymentInvestasi from "../fun/fun_update_payment";
|
||||
import getTokenTransaksi from "../fun/get_token_transaksi";
|
||||
import { gs_investas_menu } from "../g_state";
|
||||
|
||||
export default function ProsesTransaksiInvestasi({ dataInvestasi, userLogin }) {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -4,19 +4,15 @@ import { Warna } from "@/app/lib/warna";
|
||||
import {
|
||||
AspectRatio,
|
||||
Button,
|
||||
Center,
|
||||
CopyButton,
|
||||
FileButton,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Text,
|
||||
Text
|
||||
} from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { IconCamera } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import toast from "react-simple-toasts";
|
||||
|
||||
export default function UploadBuktiTransferInvestasi() {
|
||||
const router = useRouter();
|
||||
@@ -25,13 +21,12 @@ export default function UploadBuktiTransferInvestasi() {
|
||||
const [total, setTotal] = useState<any | null>(null);
|
||||
const [bank, setBank] = useState<any | null>(null);
|
||||
|
||||
|
||||
useShallowEffect(() => {
|
||||
if (typeof window !== undefined) {
|
||||
const totalHarga = localStorage.getItem("total_harga");
|
||||
const pilihBank = localStorage.getItem("bank")
|
||||
const pilihBank = localStorage.getItem("bank");
|
||||
setTotal(totalHarga);
|
||||
setBank(pilihBank)
|
||||
setBank(pilihBank);
|
||||
}
|
||||
}, []);
|
||||
|
||||
@@ -45,7 +40,6 @@ export default function UploadBuktiTransferInvestasi() {
|
||||
<Grid.Col span={7}>
|
||||
<Text fw={"bold"}>Xendit</Text>
|
||||
</Grid.Col>
|
||||
|
||||
</Grid>
|
||||
|
||||
{/* Nomor rekening */}
|
||||
@@ -53,7 +47,7 @@ export default function UploadBuktiTransferInvestasi() {
|
||||
<Grid.Col span={5}>
|
||||
<Text>Nomor Rekening</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={7} >
|
||||
<Grid.Col span={7}>
|
||||
<Text fw={"bold"}>{bank}</Text>
|
||||
</Grid.Col>
|
||||
{/* <Grid.Col span={"auto"}>
|
||||
@@ -80,7 +74,6 @@ export default function UploadBuktiTransferInvestasi() {
|
||||
<Grid.Col span={7}>
|
||||
<Text fw={"bold"}>Rp. {total}</Text>
|
||||
</Grid.Col>
|
||||
|
||||
</Grid>
|
||||
|
||||
{/* Upload */}
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import {
|
||||
AspectRatio,
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
FileButton,
|
||||
Group,
|
||||
Image,
|
||||
@@ -16,15 +21,7 @@ import {
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import toast from "react-simple-toasts";
|
||||
import funUploadDokumenInvestasi from "../fun/fun_upload_dokumen";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
|
||||
export default function UploadDokumenInvestasi({
|
||||
idInves,
|
||||
@@ -42,7 +39,8 @@ export default function UploadDokumenInvestasi({
|
||||
idInves: idInves,
|
||||
title: title,
|
||||
};
|
||||
if (_.values(body).includes("")) return ComponentGlobal_NotifikasiPeringatan("Lengkapi nama dokumen");
|
||||
if (_.values(body).includes(""))
|
||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi nama dokumen");
|
||||
if (!pdf) return ComponentGlobal_NotifikasiPeringatan("File Kosong");
|
||||
|
||||
const fd = new FormData();
|
||||
@@ -51,7 +49,7 @@ export default function UploadDokumenInvestasi({
|
||||
await funUploadDokumenInvestasi(fd, body).then((res) => {
|
||||
// console.log(res);
|
||||
if (res.status === 201) {
|
||||
setLoading(true)
|
||||
setLoading(true);
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil upload");
|
||||
router.back();
|
||||
} else {
|
||||
|
||||
@@ -1,26 +1,25 @@
|
||||
"use client";
|
||||
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import {
|
||||
Group,
|
||||
FileButton,
|
||||
Button,
|
||||
Box,
|
||||
Paper,
|
||||
AspectRatio,
|
||||
Image,
|
||||
Stack,
|
||||
Center,
|
||||
} from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import toast from "react-simple-toasts";
|
||||
import funUploadProspektusInvestasi from "../fun/fun_upload_prospek";
|
||||
import funLoadDataInvestasi from "../fun/fun_load_data";
|
||||
import {
|
||||
AccentColor,
|
||||
MainColor,
|
||||
} from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||
import {
|
||||
AspectRatio,
|
||||
Box,
|
||||
Button,
|
||||
FileButton,
|
||||
Group,
|
||||
Image,
|
||||
Paper,
|
||||
Stack
|
||||
} from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import funUploadProspektusInvestasi from "../fun/fun_upload_prospek";
|
||||
|
||||
export default function UploadProspektusInvestasi({
|
||||
idInves,
|
||||
@@ -32,17 +31,17 @@ export default function UploadProspektusInvestasi({
|
||||
const [pdf, setPdf] = useState<File | null>(null);
|
||||
|
||||
async function onUpload() {
|
||||
if (!pdf) return toast("File Kosong");
|
||||
if (!pdf) return ComponentGlobal_NotifikasiPeringatan("File Kosong");
|
||||
|
||||
const fd = new FormData();
|
||||
fd.append("file", pdf as any);
|
||||
|
||||
await funUploadProspektusInvestasi(fd, idInves).then((res) => {
|
||||
if (res.status === 201) {
|
||||
toast("Berhasil upload");
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil upload");
|
||||
router.back();
|
||||
} else {
|
||||
toast(res.message);
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user