From d20adeb6a5f6e153e2d1cfc8c8c77f4cceb743e8 Mon Sep 17 00:00:00 2001
From: trisusilo48 <tri.susilo@altama.co.id>
Date: Tue, 31 Dec 2024 09:53:27 +0700
Subject: ppn 12%

---
 src/lib/invoice/components/Invoice.jsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src/lib/invoice/components/Invoice.jsx')

diff --git a/src/lib/invoice/components/Invoice.jsx b/src/lib/invoice/components/Invoice.jsx
index 81202b1c..15bfa746 100644
--- a/src/lib/invoice/components/Invoice.jsx
+++ b/src/lib/invoice/components/Invoice.jsx
@@ -13,6 +13,7 @@ import { createSlug } from '@/core/utils/slug'
 import { useEffect, useState } from 'react'
 
 const Invoice = ({ id }) => {
+  const PPN = process.env.NEXT_PUBLIC_PPN
   const { invoice } = useInvoice({ id })
 
   const [totalAmount, setTotalAmount] = useState(0)
@@ -255,8 +256,8 @@ const Invoice = ({ id }) => {
                     {currencyFormat(invoice.data?.amountTotal)}
                   </div>
 
-                  <div className='text-right'>PPN 11% (Incl.)</div>
-                  <div className='text-right font-medium'>{currencyFormat(totalAmount * 0.11)}</div>
+                  <div className='text-right'>PPN {((PPN - 1) * 100).toFixed(0)}% (Incl.)</div>
+                  <div className='text-right font-medium'>{currencyFormat(invoice.data?.amountTotal - totalAmount)}</div>
                 </div>
               </div>
             </div>
-- 
cgit v1.2.3

