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

[HOTFIX/FE] Fix Constant Value of Adjustment Stock (Recording Depletion In)

See merge request mbugroup/lti-web-client!339
This commit is contained in:
Rivaldi A N S
2026-03-03 02:50:52 +00:00
3 changed files with 19 additions and 11 deletions
@@ -14,6 +14,7 @@ import { useTableFilter } from '@/services/hooks/useTableFilter';
import { InventoryAdjustment } from '@/types/api/inventory/adjustment';
import StatusBadge from '@/components/helper/StatusBadge';
import InventoryAdjustmentTableSkeleton from '@/components/pages/inventory/adjustment/skeleton/InventoryAdjustmentTableSkeleton';
import { TRANSACTION_SUBTYPE_OPTIONS } from '@/config/constant';
const InventoryAdjustmentTable = () => {
const {
@@ -102,16 +103,23 @@ const InventoryAdjustmentTable = () => {
const subtype = row.row.original.transaction_subtype;
const increase = row.row.original.increase;
const subtypeLabelMap: Record<string, string> = {
PURCHASE_IN: 'Pembelian',
MARKETING_OUT: 'Penjualan',
RECORDING_STOCK_OUT: 'Recording Stock',
RECORDING_DEPLETION_OUT: 'Recording Depletion',
RECORDING_EGG_IN: 'Recording Egg',
ADJUSTMENT_OUT: 'Penyesuaian',
const getSubtypeLabel = (subtypeValue: string): string => {
if (subtypeValue === TRANSACTION_SUBTYPE_OPTIONS.PEMBELIAN.value) {
return TRANSACTION_SUBTYPE_OPTIONS.PEMBELIAN.label;
}
if (subtypeValue === TRANSACTION_SUBTYPE_OPTIONS.PENJUALAN.value) {
return TRANSACTION_SUBTYPE_OPTIONS.PENJUALAN.label;
}
const recordingOption = TRANSACTION_SUBTYPE_OPTIONS.RECORDING.find(
(opt) => opt.value === subtypeValue
);
if (recordingOption) {
return recordingOption.label;
}
return subtypeValue || '-';
};
const label = subtypeLabelMap[subtype] || subtype || '-';
const label = getSubtypeLabel(subtype);
return (
<StatusBadge
@@ -295,9 +295,9 @@ const InventoryAdjustmentForm = ({
(opt) => opt.value === 'RECORDING_EGG_IN'
);
} else if (isChickenProduct) {
// Produk ayam: hanya RECORDING_DEPLETION_OUT
// Produk ayam: hanya RECORDING_DEPLETION_IN
return allRecordingOptions.filter(
(opt) => opt.value === 'RECORDING_DEPLETION_OUT'
(opt) => opt.value === 'RECORDING_DEPLETION_IN'
);
} else {
// Produk non-telur dan non-ayam (PAKAN, OVK, dll): hanya RECORDING_STOCK_OUT
+1 -1
View File
@@ -624,7 +624,7 @@ export const TRANSACTION_SUBTYPE_OPTIONS = {
PENJUALAN: { label: 'Penjualan', value: 'MARKETING_OUT' },
RECORDING: [
{ label: 'Recording Stock', value: 'RECORDING_STOCK_OUT' },
{ label: 'Recording Depletion', value: 'RECORDING_DEPLETION_OUT' },
{ label: 'Recording Depletion', value: 'RECORDING_DEPLETION_IN' },
{ label: 'Recording Egg', value: 'RECORDING_EGG_IN' },
],
} as const;