Merge branch 'dev/hotfix/restu' into 'development'

[FIX/FE] Adjustment Recording and Purchase Order

See merge request mbugroup/lti-web-client!212
This commit is contained in:
Rivaldi A N S
2026-01-20 03:35:40 +00:00
3 changed files with 35 additions and 52 deletions
@@ -1013,21 +1013,6 @@ const RecordingTable = () => {
approvalHistoryModal.openModal(); approvalHistoryModal.openModal();
}; };
const getStatusText = (action: string) => {
switch (action) {
case 'APPROVED':
return 'Disetujui';
case 'REJECTED':
return 'Ditolak';
case 'CREATED':
return 'Dibuat';
case 'UPDATED':
return 'Diperbarui';
default:
return action;
}
};
return ( return (
<Badge <Badge
variant='soft' variant='soft'
@@ -1038,7 +1023,7 @@ const RecordingTable = () => {
}} }}
onClick={openApprovalHistory} onClick={openApprovalHistory}
> >
{getStatusText(approval.action)} {approval.step_name || approval.action}
</Badge> </Badge>
); );
}, },
@@ -540,31 +540,6 @@ const PurchaseOrderDetail = ({
accessorKey: 'travel_number', accessorKey: 'travel_number',
cell: (props) => props.row.original.travel_number || '-', cell: (props) => props.row.original.travel_number || '-',
}, },
{
header: 'Dokumen Surat Jalan',
accessorKey: 'travel_document_path',
cell: (props) => {
const documentPath = props.row.original.travel_document_path;
return documentPath ? (
<Button
color='primary'
className='w-fit min-w-32 flex items-center justify-start gap-1 px-2 py-1 text-sm'
href={documentPath}
target='_blank'
rel='noopener noreferrer'
>
<Icon
icon='material-symbols:file-open-outline'
width={16}
height={16}
/>
Lihat Dokumen
</Button>
) : (
'-'
);
},
},
{ {
header: 'No. Armada Pengangkut', header: 'No. Armada Pengangkut',
accessorKey: 'vehicle_number', accessorKey: 'vehicle_number',
@@ -588,7 +563,10 @@ const PurchaseOrderDetail = ({
{ {
header: 'Transport /Item', header: 'Transport /Item',
accessorKey: 'transport_per_item', accessorKey: 'transport_per_item',
cell: (props) => formatCurrency(props.getValue() as number), cell: (props) => {
const value = props.row.original.transport_per_item;
return value ? formatCurrency(value) : formatCurrency(0);
},
}, },
]; ];
@@ -723,8 +701,8 @@ const PurchaseOrderDetail = ({
</span> </span>
<span className='text-gray-900 ml-3 break-all'> <span className='text-gray-900 ml-3 break-all'>
:{' '} :{' '}
{purchaseData.items?.[0]?.warehouse?.type === 'LOKASI' && {purchaseData.items?.[0]?.warehouse &&
purchaseData.items?.[0]?.warehouse?.location?.name 'location' in purchaseData.items[0].warehouse
? purchaseData.items[0].warehouse.location.name ? purchaseData.items[0].warehouse.location.name
: '-'} : '-'}
</span> </span>
@@ -905,11 +883,29 @@ const PurchaseOrderDetail = ({
Informasi Penerimaan Barang Informasi Penerimaan Barang
</h3> </h3>
{canShowPenerimaanBarang && ( {canShowPenerimaanBarang && (
<RowDropdownOptions isLast2Rows> <div className='flex items-center gap-2'>
<PenerimaanBarangDropdown {goodsReceiptItems[0]?.travel_document_path && (
onEdit={penerimaanBarangModal.openModal} <Button
/> color='primary'
</RowDropdownOptions> className='w-fit min-w-32 flex items-center justify-start gap-1 p-1.5 text-sm'
href={goodsReceiptItems[0].travel_document_path}
target='_blank'
rel='noopener noreferrer'
>
<Icon
icon='material-symbols:file-open-outline'
width={16}
height={16}
/>
Lihat Dokumen
</Button>
)}
<RowDropdownOptions isLast2Rows>
<PenerimaanBarangDropdown
onEdit={penerimaanBarangModal.openModal}
/>
</RowDropdownOptions>
</div>
)} )}
</div> </div>
<div className='overflow-x-auto'> <div className='overflow-x-auto'>
@@ -324,12 +324,14 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => {
PT LUMBUNG TELUR INDONESIA PT LUMBUNG TELUR INDONESIA
</Text> </Text>
<Text> <Text>
{purchaseData?.items?.[0]?.warehouse.type === 'LOKASI' {purchaseData?.items?.[0]?.warehouse &&
'location' in purchaseData.items[0].warehouse
? purchaseData.items[0].warehouse.location.name ? purchaseData.items[0].warehouse.location.name
: '-'} : '-'}
</Text> </Text>
<Text> <Text>
{purchaseData?.items?.[0]?.warehouse.type === 'LOKASI' {purchaseData?.items?.[0]?.warehouse &&
'location' in purchaseData.items[0].warehouse
? purchaseData.items[0].warehouse.location.address ? purchaseData.items[0].warehouse.location.address
: '-'} : '-'}
</Text> </Text>
@@ -434,7 +436,7 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => {
</View> </View>
<View style={pdfStyles.tableCell}> <View style={pdfStyles.tableCell}>
<Text> <Text>
{item.warehouse?.type === 'LOKASI' {item.warehouse && 'location' in item.warehouse
? item.warehouse.location.address ? item.warehouse.location.address
: '-'} : '-'}
</Text> </Text>