refactor(FE-311): Remove grand_total and due_date from purchases

This commit is contained in:
rstubryan
2025-12-09 09:58:15 +07:00
parent 512ad5175e
commit a45de4fb13
3 changed files with 9 additions and 34 deletions
@@ -16,7 +16,7 @@ import RowDropdownOptions from '@/components/table/RowDropdownOptions';
import RowCollapseOptions from '@/components/table/RowCollapseOptions'; import RowCollapseOptions from '@/components/table/RowCollapseOptions';
import RowOptionsMenuWrapper from '@/components/table/RowOptionsMenuWrapper'; import RowOptionsMenuWrapper from '@/components/table/RowOptionsMenuWrapper';
import { cn, formatDate, formatCurrency } from '@/lib/helper'; import { cn, formatDate } from '@/lib/helper';
import { isResponseSuccess } from '@/lib/api-helper'; import { isResponseSuccess } from '@/lib/api-helper';
import { useTableFilter } from '@/services/hooks/useTableFilter'; import { useTableFilter } from '@/services/hooks/useTableFilter';
@@ -136,14 +136,6 @@ const PurchaseTable = () => {
? formatDate(props.row.original.po_date, 'DD MMM YYYY') ? formatDate(props.row.original.po_date, 'DD MMM YYYY')
: '-', : '-',
}, },
{
accessorKey: 'due_date',
header: 'Jatuh Tempo',
cell: (props) =>
props.row.original.due_date
? formatDate(props.row.original.due_date, 'DD MMM YYYY')
: '-',
},
{ {
header: 'Aging', header: 'Aging',
cell: (props) => { cell: (props) => {
@@ -156,11 +148,6 @@ const PurchaseTable = () => {
return `${diffDays} hari`; return `${diffDays} hari`;
}, },
}, },
{
accessorKey: 'grand_total',
header: 'Total (Rp.)',
cell: (props) => formatCurrency(props.row.original.grand_total),
},
{ {
header: 'Aksi', header: 'Aksi',
cell: (props) => { cell: (props) => {
@@ -642,7 +642,7 @@ const PurchaseOrderDetail = ({
<div className='space-y-4'> <div className='space-y-4'>
<div className='group'> <div className='group'>
<div className='flex items-start'> <div className='flex items-start'>
<span className='font-medium text-gray-600 min-w-[140px] flex-shrink-0'> <span className='font-medium text-gray-600 min-w-[140px] shrink-0'>
Area Area
</span> </span>
<span className='text-gray-900 ml-3 break-all'> <span className='text-gray-900 ml-3 break-all'>
@@ -652,7 +652,7 @@ const PurchaseOrderDetail = ({
</div> </div>
<div className='group'> <div className='group'>
<div className='flex items-start'> <div className='flex items-start'>
<span className='font-medium text-gray-600 min-w-[140px] flex-shrink-0'> <span className='font-medium text-gray-600 min-w-[140px] shrink-0'>
Lokasi Lokasi
</span> </span>
<span className='text-gray-900 ml-3 break-all'> <span className='text-gray-900 ml-3 break-all'>
@@ -666,7 +666,7 @@ const PurchaseOrderDetail = ({
</div> </div>
<div className='group'> <div className='group'>
<div className='flex items-start'> <div className='flex items-start'>
<span className='font-medium text-gray-600 min-w-[140px] flex-shrink-0'> <span className='font-medium text-gray-600 min-w-[140px] shrink-0'>
Gudang Gudang
</span> </span>
<span className='text-gray-900 ml-3 break-all'> <span className='text-gray-900 ml-3 break-all'>
@@ -680,7 +680,7 @@ const PurchaseOrderDetail = ({
<div className='space-y-4'> <div className='space-y-4'>
<div className='group'> <div className='group'>
<div className='flex items-start'> <div className='flex items-start'>
<span className='font-medium text-gray-600 min-w-[140px] flex-shrink-0'> <span className='font-medium text-gray-600 min-w-[140px] shrink-0'>
Nama Vendor Nama Vendor
</span> </span>
<span className='text-gray-900 font-medium ml-3 break-all'> <span className='text-gray-900 font-medium ml-3 break-all'>
@@ -691,7 +691,7 @@ const PurchaseOrderDetail = ({
</div> </div>
<div className='group'> <div className='group'>
<div className='flex items-start'> <div className='flex items-start'>
<span className='font-medium text-gray-600 min-w-[140px] flex-shrink-0'> <span className='font-medium text-gray-600 min-w-[140px] shrink-0'>
Kategori Vendor Kategori Vendor
</span> </span>
<span className='text-gray-900 ml-3 break-all'> <span className='text-gray-900 ml-3 break-all'>
@@ -701,18 +701,7 @@ const PurchaseOrderDetail = ({
</div> </div>
<div className='group'> <div className='group'>
<div className='flex items-start'> <div className='flex items-start'>
<span className='font-medium text-gray-600 min-w-[140px] flex-shrink-0'> <span className='font-medium text-gray-600 min-w-[140px] shrink-0'>
Tgl. Jatuh Tempo
</span>
<span className='text-gray-900 ml-3 break-all'>
: {formatDate(purchaseData.due_date, 'D MMM YYYY')} (
{purchaseData.credit_term} hari)
</span>
</div>
</div>
<div className='group'>
<div className='flex items-start'>
<span className='font-medium text-gray-600 min-w-[140px] flex-shrink-0'>
Nomor Nomor
</span> </span>
<span className='text-gray-900 ml-3 break-all'> <span className='text-gray-900 ml-3 break-all'>
@@ -722,7 +711,7 @@ const PurchaseOrderDetail = ({
</div> </div>
<div className='group'> <div className='group'>
<div className='flex items-start'> <div className='flex items-start'>
<span className='font-medium text-gray-600 min-w-[140px] flex-shrink-0'> <span className='font-medium text-gray-600 min-w-[140px] shrink-0'>
Nomor PO Nomor PO
</span> </span>
<div className='ml-3'> <div className='ml-3'>
+1 -2
View File
@@ -51,9 +51,8 @@ export type BasePurchase = {
po_document_path?: string | null; po_document_path?: string | null;
po_date: string; po_date: string;
supplier: Supplier; supplier: Supplier;
credit_term: number; credit_term?: number;
due_date: string; due_date: string;
grand_total: number;
notes?: string | null; notes?: string | null;
deleted_at?: string | null; deleted_at?: string | null;
created_by: number; created_by: number;