fix: Admin
Deskripsi: - Penambahan field nama rekening di db bank - Optimalisasi event ## No Issue
This commit is contained in:
@@ -32,6 +32,16 @@ export function Investasi_ComponentCardDaftarTransaksi({
|
||||
invoiceId: string;
|
||||
statusInvoiceId: string;
|
||||
}) {
|
||||
|
||||
// Berhasil
|
||||
if (statusInvoiceId === "1") {
|
||||
setVisible(true);
|
||||
return router.push(NEW_RouterInvestasi.transaksi_berhasil + invoiceId, {
|
||||
scroll: false,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Proses
|
||||
if (statusInvoiceId === "2") {
|
||||
setVisible(true);
|
||||
@@ -48,6 +58,13 @@ export function Investasi_ComponentCardDaftarTransaksi({
|
||||
});
|
||||
}
|
||||
|
||||
if (statusInvoiceId === "4") {
|
||||
setVisible(true);
|
||||
return router.push(NEW_RouterInvestasi.transaksi_gagal + invoiceId, {
|
||||
scroll: false,
|
||||
});
|
||||
}
|
||||
|
||||
ComponentGlobal_NotifikasiPeringatan("Status Belum Tersedia");
|
||||
}
|
||||
return (
|
||||
|
||||
@@ -16,7 +16,7 @@ export async function investasi_funGetTransaksiByUserId({
|
||||
take: takeData,
|
||||
skip: skipData,
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
updatedAt: "desc",
|
||||
},
|
||||
where: {
|
||||
authorId: authorId,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { investasi_funGetProspekById } from "./get/fun_get_file_by_prospek_id";
|
||||
import { investasi_funGetOneInvestasiById } from "./get/fun_get_one_by_id";
|
||||
import { investasi_funGetOneInvestasiById } from "./get/fun_get_one_investasi_by_id";
|
||||
import { investasi_funGetTransaksiByUserId } from "./get/fun_get_all_transaksi_by_user_id";
|
||||
import { investasi_funUploadBuktiTransferById } from "./upload/fun_upload_bukti_transfer";
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ export async function investasi_funUploadBuktiTransferById({
|
||||
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: {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { MODEL_USER } from "@/app_modules/home/model/interface";
|
||||
import { MODEL_PROFILE_OLD } from "@/app_modules/home/model/user_profile";
|
||||
|
||||
export interface MODEL_INVESTASI {
|
||||
@@ -127,6 +128,7 @@ export interface MODEL_INVOICE_INVESTASI {
|
||||
masterBankId: string;
|
||||
statusInvoiceId: string;
|
||||
authorId: string;
|
||||
Author: MODEL_USER
|
||||
imagesId: string;
|
||||
MasterBank: MODEL_MASTER_BANK;
|
||||
StatusInvoice: MODEL_STATUS_INVOICE_INVESTASI;
|
||||
|
||||
@@ -6,6 +6,7 @@ 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";
|
||||
import { Investasi_UiTransaksiBerhasil } from "./status_transaksi/ui_transaksi_berhasil";
|
||||
|
||||
export { Investasi_UiProsesPembelian };
|
||||
export { Investasi_UiMetodePembayaran };
|
||||
@@ -15,3 +16,4 @@ export { Investasi_UiProsesTransaksi };
|
||||
export { Investasi_UiBeranda };
|
||||
export { Investasi_UiLayoutMain };
|
||||
export { Investasi_UiDaftarTransaksi };
|
||||
export { Investasi_UiTransaksiBerhasil };
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { ActionIcon, Loader } from "@mantine/core";
|
||||
import { IconX } from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { Investasi_ViewTransaksiBerhasil } from "../../_view";
|
||||
import { gs_investas_menu } from "../../g_state";
|
||||
|
||||
export function Investasi_UiTransaksiBerhasil({
|
||||
dataTransaksi,
|
||||
}: {
|
||||
dataTransaksi: any;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_investas_menu);
|
||||
const [isLoading, setLoading] = useState(false);
|
||||
|
||||
return (
|
||||
<UIGlobal_LayoutTamplate
|
||||
header={
|
||||
<UIGlobal_LayoutHeaderTamplate
|
||||
title="Transaksi Berhasil"
|
||||
customButtonLeft={
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
onClick={() => {
|
||||
setHotMenu(3);
|
||||
setLoading(true);
|
||||
router.push(RouterInvestasi_OLD.main_transaksi);
|
||||
}}
|
||||
>
|
||||
{isLoading ? <Loader color="yellow" /> : <IconX />}
|
||||
</ActionIcon>
|
||||
}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Investasi_ViewTransaksiBerhasil dataTransaksi={dataTransaksi} />
|
||||
</UIGlobal_LayoutTamplate>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { ActionIcon, Loader } from "@mantine/core";
|
||||
import { IconX } from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { Investasi_ViewTransaksiGagal } from "../../_view";
|
||||
import { gs_investas_menu } from "../../g_state";
|
||||
|
||||
export function Investasi_UiTransaksiGagal({
|
||||
dataTransaksi,
|
||||
nomorAdmin,
|
||||
}: {
|
||||
dataTransaksi: any;
|
||||
nomorAdmin: any
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_investas_menu);
|
||||
const [isLoading, setLoading] = useState(false);
|
||||
|
||||
return (
|
||||
<UIGlobal_LayoutTamplate
|
||||
header={
|
||||
<UIGlobal_LayoutHeaderTamplate
|
||||
title="Transaksi Gagal"
|
||||
customButtonLeft={
|
||||
<ActionIcon
|
||||
variant="transparent"
|
||||
onClick={() => {
|
||||
setHotMenu(3);
|
||||
setLoading(true);
|
||||
router.push(RouterInvestasi_OLD.main_transaksi);
|
||||
}}
|
||||
>
|
||||
{isLoading ? <Loader color="yellow" /> : <IconX />}
|
||||
</ActionIcon>
|
||||
}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Investasi_ViewTransaksiGagal dataTransaksi={dataTransaksi} nomorAdmin={nomorAdmin} />
|
||||
</UIGlobal_LayoutTamplate>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
import { Investasi_ViewFileViewer } from "./file_view/view_file_viewer";
|
||||
import { Investasi_ViewBeranda } from "./main/view_beranda";
|
||||
import { Investasi_ViewTransaksiBerhasil } from "./status_transaksi/view_invoice_berhasil";
|
||||
import { Investasi_ViewTransaksiGagal } from "./status_transaksi/view_transaksi_gagal";
|
||||
import { Investasi_ViewInvoice } from "./transaksi/view_invoice";
|
||||
import { Investasi_ViewMetodePembayaran } from "./transaksi/view_metode_pembayaran";
|
||||
import { Investasi_ViewProsesPembelian } from "./transaksi/view_proses_pembelian";
|
||||
@@ -11,3 +13,5 @@ export { Investasi_ViewInvoice };
|
||||
export { Investasi_ViewProsesTransaksi };
|
||||
export { Investasi_ViewFileViewer };
|
||||
export { Investasi_ViewBeranda };
|
||||
export { Investasi_ViewTransaksiGagal };
|
||||
export { Investasi_ViewTransaksiBerhasil };
|
||||
|
||||
@@ -1,30 +1,11 @@
|
||||
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 { Box, Center, Loader } from "@mantine/core";
|
||||
import _ from "lodash";
|
||||
import { ScrollOnly } from "next-scroll-loader";
|
||||
import { useState } from "react";
|
||||
import { Investasi_ComponentCardDaftarTransaksi } from "../../_component";
|
||||
import { MODEL_INVOICE_INVESTASI } from "../../_lib/interface";
|
||||
|
||||
export function Investasi_ViewDaftarTransaksi({
|
||||
dataTransaksi,
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
"use client";
|
||||
|
||||
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_TampilanRupiah } from "@/app_modules/_global/component";
|
||||
import {
|
||||
ActionIcon,
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Collapse,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Paper,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import {
|
||||
IconBrandWhatsapp,
|
||||
IconMoneybag,
|
||||
IconMoodDollar,
|
||||
IconZoomMoney,
|
||||
} from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_INVOICE_INVESTASI } from "../../_lib/interface";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { IconBrandCashapp } from "@tabler/icons-react";
|
||||
|
||||
export function Investasi_ViewTransaksiBerhasil({
|
||||
dataTransaksi,
|
||||
}: {
|
||||
dataTransaksi: any;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [data, setData] = useState<MODEL_INVOICE_INVESTASI>(dataTransaksi);
|
||||
const [isLoading, setLoading] = useState(false);
|
||||
const [file, setFile] = useState<File | null>(null);
|
||||
const [opened, setOpened] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack spacing={"lg"} py={"md"}>
|
||||
<Stack
|
||||
align="center"
|
||||
spacing={"md"}
|
||||
style={{
|
||||
backgroundColor: AccentColor.blue,
|
||||
border: `2px solid ${AccentColor.darkblue}`,
|
||||
padding: "15px",
|
||||
cursor: "pointer",
|
||||
borderRadius: "10px",
|
||||
color: "white",
|
||||
}}
|
||||
>
|
||||
<IconBrandCashapp size={100} />
|
||||
<Title order={5} align="center">
|
||||
Terimakasih telah percaya pada kami untuk mengelola dana anda! Info
|
||||
mengenai update Investasi ini bisa di lihat di kolom berita.
|
||||
</Title>
|
||||
</Stack>
|
||||
|
||||
<Paper
|
||||
style={{
|
||||
backgroundColor: AccentColor.blue,
|
||||
border: `2px solid ${AccentColor.darkblue}`,
|
||||
padding: "15px",
|
||||
cursor: "pointer",
|
||||
borderRadius: "10px",
|
||||
color: "white",
|
||||
marginBottom: "15px",
|
||||
}}
|
||||
>
|
||||
<Title order={4} align="center" mb={"lg"}>
|
||||
Detail Transaksi
|
||||
</Title>
|
||||
|
||||
<Stack px={"sm"}>
|
||||
<Box>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Text>Bank </Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Text>: {data?.MasterBank.namaBank}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Text>Nama Rekening </Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Text>: {data?.MasterBank.namaAkun}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Text>Nomor Rekening </Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Text>: {data?.MasterBank.norek}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Text>Jumlah Transaksi </Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Group spacing={2}>
|
||||
:
|
||||
<Text inherit span>
|
||||
<ComponentGlobal_TampilanRupiah
|
||||
color="white"
|
||||
nominal={+data?.nominal}
|
||||
/>
|
||||
</Text>
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Text>Lembar Terbeli </Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Text>: {data?.lembarTerbeli}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Text>Bukti Transfer </Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
compact
|
||||
onClick={() => {
|
||||
opened ? setOpened(false) : setOpened(true);
|
||||
}}
|
||||
>
|
||||
{opened ? "Sembunyikan" : "Tampilkan"}
|
||||
</Button>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Box>
|
||||
|
||||
<Collapse
|
||||
mt={"md"}
|
||||
in={opened}
|
||||
transitionDuration={500}
|
||||
transitionTimingFunction="linear"
|
||||
>
|
||||
<Image
|
||||
alt="foto"
|
||||
src={RouterAdminInvestasi.api_bukti_transfer + data?.imagesId}
|
||||
/>
|
||||
</Collapse>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
"use client";
|
||||
|
||||
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { ComponentGlobal_TampilanRupiah } from "@/app_modules/_global/component";
|
||||
import {
|
||||
ActionIcon,
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Collapse,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Paper,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { IconBrandWhatsapp } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_INVOICE_INVESTASI } from "../../_lib/interface";
|
||||
import { Prisma } from "@prisma/client";
|
||||
|
||||
export function Investasi_ViewTransaksiGagal({
|
||||
dataTransaksi,
|
||||
nomorAdmin,
|
||||
}: {
|
||||
dataTransaksi: any;
|
||||
nomorAdmin: Prisma.NomorAdminCreateInput;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [data, setData] = useState<MODEL_INVOICE_INVESTASI>(dataTransaksi);
|
||||
const [isLoading, setLoading] = useState(false);
|
||||
const [file, setFile] = useState<File | null>(null);
|
||||
const [opened, setOpened] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack spacing={"lg"} py={"md"}>
|
||||
<Stack
|
||||
spacing={"md"}
|
||||
style={{
|
||||
backgroundColor: AccentColor.blue,
|
||||
border: `2px solid ${AccentColor.darkblue}`,
|
||||
padding: "15px",
|
||||
cursor: "pointer",
|
||||
borderRadius: "10px",
|
||||
color: "white",
|
||||
}}
|
||||
>
|
||||
<Title order={5} align="center">
|
||||
Transaksi anda gagal karena bukti transfer tidak sesuai dengan data
|
||||
kami. Jika ini masalah khusus silahkan hubungi pada kontak whatsapp
|
||||
kami !
|
||||
</Title>
|
||||
<Center>
|
||||
<ActionIcon radius={"100%"} size={70} variant="light" color="white">
|
||||
<a
|
||||
href={`whatsapp://wa.me/${nomorAdmin.nomor}?text=Hallo admin ! Saya ada kendala pada transaksi Investasi`}
|
||||
>
|
||||
<IconBrandWhatsapp size={50} color="green" />
|
||||
</a>
|
||||
</ActionIcon>
|
||||
</Center>
|
||||
</Stack>
|
||||
|
||||
<Paper
|
||||
style={{
|
||||
backgroundColor: AccentColor.blue,
|
||||
border: `2px solid ${AccentColor.darkblue}`,
|
||||
padding: "15px",
|
||||
cursor: "pointer",
|
||||
borderRadius: "10px",
|
||||
color: "white",
|
||||
marginBottom: "15px",
|
||||
}}
|
||||
>
|
||||
<Title order={4} align="center" mb={"lg"}>
|
||||
Detail Transaksi
|
||||
</Title>
|
||||
|
||||
<Stack px={"sm"}>
|
||||
<Box>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Text>Bank </Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Text>: {data?.MasterBank.namaBank}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Text>Nama Rekening </Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Text>: {data?.MasterBank.namaAkun}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Text>Nomor Rekening </Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Text>: {data?.MasterBank.norek}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Text>Jumlah Transaksi </Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Group spacing={2}>
|
||||
:
|
||||
<Text inherit span>
|
||||
<ComponentGlobal_TampilanRupiah
|
||||
color="white"
|
||||
nominal={+data?.nominal}
|
||||
/>
|
||||
</Text>
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Text>Lembar Terbeli </Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Text>: {data?.lembarTerbeli}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Box>
|
||||
|
||||
<Box>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<Text>Bukti Transfer </Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
compact
|
||||
onClick={() => {
|
||||
opened ? setOpened(false) : setOpened(true);
|
||||
}}
|
||||
>
|
||||
{opened ? "Sembunyikan" : "Tampilkan"}
|
||||
</Button>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Box>
|
||||
|
||||
<Collapse
|
||||
mt={"md"}
|
||||
in={opened}
|
||||
transitionDuration={500}
|
||||
transitionTimingFunction="linear"
|
||||
>
|
||||
<Image
|
||||
alt="foto"
|
||||
src={RouterAdminInvestasi.api_bukti_transfer + data?.imagesId}
|
||||
/>
|
||||
</Collapse>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -35,7 +35,6 @@ export function Investasi_ViewInvoice({
|
||||
const [isLoading, setLoading] = useState(false);
|
||||
const [data, setData] = useState(dataInvoice);
|
||||
const [file, setFile] = useState<File | null>(null);
|
||||
// const [image, setImage] = useState<any | null>(null);
|
||||
|
||||
async function onUpload() {
|
||||
const gambar = new FormData();
|
||||
|
||||
@@ -46,6 +46,7 @@ export function Investasi_ViewMetodePembayaran({
|
||||
if (res.status !== 201)
|
||||
return ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
setLoading(true);
|
||||
router.push(NEW_RouterInvestasi.invoice + res.data?.id, { scroll: false });
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import {
|
||||
NEW_RouterInvestasi,
|
||||
RouterInvestasi_OLD
|
||||
RouterInvestasi_OLD,
|
||||
} from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/_global/author_name_on_header";
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
Progress,
|
||||
Stack,
|
||||
Text,
|
||||
Title
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import {
|
||||
IconBookDownload,
|
||||
@@ -40,6 +40,7 @@ import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_INVESTASI } from "../_lib/interface";
|
||||
import { gs_TransferValue } from "../g_state";
|
||||
import { useLocalStorage } from "@mantine/hooks";
|
||||
|
||||
export default function DetailInvestasi({
|
||||
dataInvestasi,
|
||||
@@ -62,6 +63,15 @@ export default function DetailInvestasi({
|
||||
const [isLoadingBox, setLoadingBox] = useState(false);
|
||||
const [isLoadingButton, setLoadingButton] = useState(false);
|
||||
|
||||
const [total, setTotal] = useLocalStorage({
|
||||
key: "total_investasi",
|
||||
defaultValue: 0,
|
||||
});
|
||||
const [jumlah, setJumlah] = useLocalStorage({
|
||||
key: "jumlah_investasi",
|
||||
defaultValue: 0,
|
||||
});
|
||||
|
||||
const listBox = [
|
||||
{
|
||||
id: 1,
|
||||
@@ -84,20 +94,22 @@ export default function DetailInvestasi({
|
||||
];
|
||||
|
||||
async function onSubmit() {
|
||||
//NEW
|
||||
router.push(NEW_RouterInvestasi.pembelian + data.id, { scroll: false });
|
||||
|
||||
// OLD
|
||||
// router.push(RouterInvestasi_OLD.proses_transaksi + `${data.id}`);
|
||||
// setTransaksiValue({
|
||||
// ...transaksiValue,
|
||||
// lembarTerbeli: "",
|
||||
// namaBank: "",
|
||||
// nomorRekening: "",
|
||||
// totalTransfer: "",
|
||||
// });
|
||||
|
||||
setTransaksiValue({
|
||||
...transaksiValue,
|
||||
lembarTerbeli: "",
|
||||
namaBank: "",
|
||||
nomorRekening: "",
|
||||
totalTransfer: "",
|
||||
});
|
||||
setLoadingButton(true);
|
||||
|
||||
//NEW
|
||||
router.push(NEW_RouterInvestasi.pembelian + data.id, { scroll: false });
|
||||
setTotal(0);
|
||||
setJumlah(0);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user