From 0178a1f88d7d34824562e1413be073c0795a47cf Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 16 Dec 2024 17:42:31 +0700 Subject: update code --- src/lib/tempo/components/Tempo.jsx | 134 +++++++++++++++++++------------------ 1 file changed, 70 insertions(+), 64 deletions(-) (limited to 'src/lib/tempo/components') diff --git a/src/lib/tempo/components/Tempo.jsx b/src/lib/tempo/components/Tempo.jsx index 8a7f4f71..97b21454 100644 --- a/src/lib/tempo/components/Tempo.jsx +++ b/src/lib/tempo/components/Tempo.jsx @@ -113,7 +113,9 @@ const Tempo = () => { isLoaded={!isLoading} h='fit' w={32} - className='badge-solid-green px-1 text-sm flex items-center justify-center font-thin' + className={`${ + tempo.paymentTerm ? 'badge-solid-green' : 'badge-yellow' + } px-1 text-sm flex items-center justify-center font-thin`} > {tempo.paymentTerm ? tempo.paymentTerm : 'Review'} @@ -175,7 +177,7 @@ const Tempo = () => { {getLabel()} - {auth?.tempoProgres == 'review' && !tempo.paymentTerm ? ( + {auth && auth?.tempoProgres == 'review' && !tempo.paymentTerm ? (
{ isLoaded={!isLoading} h='fit' w={24} - className='badge-solid-green px-1 text-xs flex items-center justify-center font-thin' + className={`${ + tempo.paymentTerm ? 'badge-solid-green' : 'badge-yellow' + } px-1 text-xs flex items-center justify-center font-thin`} > {tempo.paymentTerm ? tempo.paymentTerm : 'Review'} @@ -377,7 +381,7 @@ const Tempo = () => {
- {!invoices.isLoading && invoices.data?.invoices?.length != 0 && ( + {auth && !auth?.tempoProgres == 'review' && tempo.paymentTerm && (
{
)} - {!invoices.isLoading && invoices.data?.invoices?.length === 0 && ( + {auth && auth?.tempoProgres == 'review' && !tempo.paymentTerm ? ( // // Tidak ada invoice // @@ -408,72 +412,73 @@ const Tempo = () => { width={isMobile ? 300 : 600} height={isMobile ? 300 : 550} /> - )} - - {invoices.data?.invoices?.map((invoice, index) => ( -
-
- - - No. Transaksi - -

- {invoice.salesOrder} -

- -
- {invoice.amountResidual > 0 ? ( - new Date() > getDueDate(invoice.invoiceDateDue) ? ( -
- Jatuh Tempo -
+ ) : ( + invoices.data?.invoices?.map((invoice, index) => ( +
+
+ + + No. Transaksi + +

+ {invoice.salesOrder} +

+ +
+ {invoice.amountResidual > 0 ? ( + new Date() > getDueDate(invoice.invoiceDateDue) ? ( +
+ Jatuh Tempo +
+ ) : ( +
+ Belum Lunas +
+ ) ) : ( -
- Belum Lunas +
+ Lunas
- ) - ) : ( -
Lunas
- )} - {/* setToOthers(invoice)} /> */} +
-
- -
-

- {formatTanggal(invoice.invoiceDate)} -

-

- Jatuh Tempo: {formatTanggal(invoice.invoiceDateDue)} -

-
-
-
-
- - No. Invoice - -

- {invoice.name || '-'} + +

+

+ {formatTanggal(invoice.invoiceDate)}

-
-
- - Total Belanja - -

- {currencyFormat(invoice.amountTotal)} +

+ Jatuh Tempo: {formatTanggal(invoice.invoiceDateDue)}

-
- - {/* {invoice.efaktur ? ( +
+
+
+ + No. Invoice + +

+ {invoice.name || '-'} +

+
+
+ + Total Belanja + +

+ {currencyFormat(invoice.amountTotal)} +

+
+
+ + {/* {invoice.efaktur ? (
Faktur Pajak @@ -484,8 +489,9 @@ const Tempo = () => { Faktur Pajak
)} */} -
- ))} +
+ )) + )}