refactor(FE-208): rename PurchaseRequestForm to PurchaseRequisitionsForm and update related components

This commit is contained in:
rstubryan
2025-11-08 09:53:21 +07:00
parent 53751d566c
commit 10dca5c692
5 changed files with 300 additions and 506 deletions
@@ -149,9 +149,12 @@ const PurchaseTable = () => {
cell: (props) => props.row.original.supplier.name,
},
{
accessorKey: 'created_user',
accessorKey: 'created_by',
header: 'Nama Pengaju',
cell: (props) => props.row.original.created_user.name,
cell: (props) => {
const purchase = props.row.original;
return purchase.created_user?.name || `User ID: ${purchase.created_by}`;
},
},
{
accessorKey: 'po_date',
@@ -172,8 +175,9 @@ const PurchaseTable = () => {
{
header: 'Aging',
cell: (props) => {
if (!props.row.original.po_date) return '-';
const poDate = new Date(props.row.original.po_date);
const purchase = props.row.original;
if (!purchase.po_date) return '-';
const poDate = new Date(purchase.po_date);
const today = new Date();
const diffTime = Math.abs(today.getTime() - poDate.getTime());
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));