diff --git a/src/components/pages/purchase/order/PurchaseOrderDetail.tsx b/src/components/pages/purchase/order/PurchaseOrderDetail.tsx index 5e2813aa..0c4337b1 100644 --- a/src/components/pages/purchase/order/PurchaseOrderDetail.tsx +++ b/src/components/pages/purchase/order/PurchaseOrderDetail.tsx @@ -499,7 +499,7 @@ const PurchaseOrderDetail = ({ :{' '} - {purchaseData.items?.[0]?.warehouse?.type !== 'AREA' && + {purchaseData.items?.[0]?.warehouse?.type === 'LOKASI' && purchaseData.items?.[0]?.warehouse?.location?.name ? purchaseData.items[0].warehouse.location.name : '-'} diff --git a/src/components/pages/purchase/order/PurchaseOrderInvoice.tsx b/src/components/pages/purchase/order/PurchaseOrderInvoice.tsx index 0d5e5d5d..c9485f96 100644 --- a/src/components/pages/purchase/order/PurchaseOrderInvoice.tsx +++ b/src/components/pages/purchase/order/PurchaseOrderInvoice.tsx @@ -267,7 +267,9 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => { style={pdfStyles.logo} id={'mbu-logo'} /> - PT MITRA BERLIAN UNGGAS + + PT LUMBUNG TELUR INDONESIA + SOHO Building Lt.3 (Paris Van Java), Jalan Karang Tinggal, Kel. Cipedes, Kec. Sukajadi, Kota Bandung 40162 @@ -283,8 +285,8 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => { Date:{' '} {purchaseData?.po_date - ? formatDate(purchaseData.po_date, 'DD-MMM-YYYY') - : formatDate(new Date(), 'DD-MMM-YYYY')} + ? formatDate(purchaseData.po_date, 'DD MMM YYYY') + : formatDate(new Date(), 'DD MMM YYYY')} @@ -302,20 +304,34 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => { - {purchaseData?.supplier?.name || '-'} + {purchaseData?.supplier?.name || '-'} ( + {purchaseData?.supplier?.alias || ''}) - {purchaseData?.supplier?.pic || '-'} + {purchaseData?.supplier?.category || '-'} - {purchaseData?.supplier?.phone || '-'} /{' '} - {purchaseData?.supplier?.email || '-'} + Credit Term: {purchaseData?.credit_term || 0} hari + + + Due Date:{' '} + {purchaseData?.due_date + ? formatDate(purchaseData.due_date, 'DD MMM YYYY') + : '-'} - {purchaseData?.supplier?.address || '-'} - PT MITRA BERLIAN UNGGAS + PT LUMBUNG TELUR INDONESIA + + + {purchaseData?.items?.[0]?.warehouse.type === 'LOKASI' + ? purchaseData.items[0].warehouse.location.name + : '-'} + + + {purchaseData?.items?.[0]?.warehouse.type === 'LOKASI' + ? purchaseData.items[0].warehouse.location.address + : '-'} - {purchaseData?.location?.name || '-'} @@ -331,7 +347,7 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => { Unit Price - Total Quantity + Quantity Total Amount @@ -355,7 +371,7 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => { Rp{formatNumber(item.price || 0)} - {formatNumber(item.total_qty || 0)} + {formatNumber(item.sub_qty || 0)} Rp{formatNumber(item.total_price || 0)} @@ -398,57 +414,58 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => { Warehouse Name - PIC + Area - Address Detail + Location Address Product Allocation - - - {purchaseData?.warehouse?.name || '-'} - - - {purchaseData?.created_user?.name || '-'} - - {purchaseData?.created_user?.email || '-'} - - - - {purchaseData?.location?.name || '-'} - - - {/* Inner table for product allocation */} - - {/* Header for inner table */} - - Item - - Quantity - - - {/* Data rows */} - {purchaseData?.items?.map((item, index) => ( - + {purchaseData?.items?.map((item, itemIndex) => ( + + + {item.warehouse?.name || '-'} + + + {item.warehouse?.area?.name || '-'} + + + + {item.warehouse?.type === 'LOKASI' + ? item.warehouse.location.address + : '-'} + + + + {/* Inner table for product allocation */} + + {/* Header for inner table */} + + Item + + Quantity + + + {/* Data row */} + {item.product?.name || '-'} - {formatNumber(item.total_qty || 0)} + {formatNumber(item.sub_qty || 0)} - )) || []} + - + )) || []} @@ -467,7 +484,7 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => { - PT MITRA BERLIAN UNGGAS + PT LUMBUNG TELUR INDONESIA