mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
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:
@@ -1013,21 +1013,6 @@ const RecordingTable = () => {
|
||||
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 (
|
||||
<Badge
|
||||
variant='soft'
|
||||
@@ -1038,7 +1023,7 @@ const RecordingTable = () => {
|
||||
}}
|
||||
onClick={openApprovalHistory}
|
||||
>
|
||||
{getStatusText(approval.action)}
|
||||
{approval.step_name || approval.action}
|
||||
</Badge>
|
||||
);
|
||||
},
|
||||
|
||||
@@ -540,31 +540,6 @@ const PurchaseOrderDetail = ({
|
||||
accessorKey: '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',
|
||||
accessorKey: 'vehicle_number',
|
||||
@@ -588,7 +563,10 @@ const PurchaseOrderDetail = ({
|
||||
{
|
||||
header: 'Transport /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 className='text-gray-900 ml-3 break-all'>
|
||||
:{' '}
|
||||
{purchaseData.items?.[0]?.warehouse?.type === 'LOKASI' &&
|
||||
purchaseData.items?.[0]?.warehouse?.location?.name
|
||||
{purchaseData.items?.[0]?.warehouse &&
|
||||
'location' in purchaseData.items[0].warehouse
|
||||
? purchaseData.items[0].warehouse.location.name
|
||||
: '-'}
|
||||
</span>
|
||||
@@ -905,11 +883,29 @@ const PurchaseOrderDetail = ({
|
||||
Informasi Penerimaan Barang
|
||||
</h3>
|
||||
{canShowPenerimaanBarang && (
|
||||
<RowDropdownOptions isLast2Rows>
|
||||
<PenerimaanBarangDropdown
|
||||
onEdit={penerimaanBarangModal.openModal}
|
||||
/>
|
||||
</RowDropdownOptions>
|
||||
<div className='flex items-center gap-2'>
|
||||
{goodsReceiptItems[0]?.travel_document_path && (
|
||||
<Button
|
||||
color='primary'
|
||||
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 className='overflow-x-auto'>
|
||||
|
||||
@@ -324,12 +324,14 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => {
|
||||
PT LUMBUNG TELUR INDONESIA
|
||||
</Text>
|
||||
<Text>
|
||||
{purchaseData?.items?.[0]?.warehouse.type === 'LOKASI'
|
||||
{purchaseData?.items?.[0]?.warehouse &&
|
||||
'location' in purchaseData.items[0].warehouse
|
||||
? purchaseData.items[0].warehouse.location.name
|
||||
: '-'}
|
||||
</Text>
|
||||
<Text>
|
||||
{purchaseData?.items?.[0]?.warehouse.type === 'LOKASI'
|
||||
{purchaseData?.items?.[0]?.warehouse &&
|
||||
'location' in purchaseData.items[0].warehouse
|
||||
? purchaseData.items[0].warehouse.location.address
|
||||
: '-'}
|
||||
</Text>
|
||||
@@ -434,7 +436,7 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => {
|
||||
</View>
|
||||
<View style={pdfStyles.tableCell}>
|
||||
<Text>
|
||||
{item.warehouse?.type === 'LOKASI'
|
||||
{item.warehouse && 'location' in item.warehouse
|
||||
? item.warehouse.location.address
|
||||
: '-'}
|
||||
</Text>
|
||||
|
||||
Reference in New Issue
Block a user