diff --git a/src/components/pages/report/sale/export/HppPerkandangExport.tsx b/src/components/pages/report/sale/export/HppPerkandangExport.tsx index d6bd3e25..12d0a697 100644 --- a/src/components/pages/report/sale/export/HppPerkandangExport.tsx +++ b/src/components/pages/report/sale/export/HppPerkandangExport.tsx @@ -219,11 +219,37 @@ const rekapitulasiData = (data: HppPerKandangReport['rows']) => { const getParameterText = (params: HppPerKandangExportParams['params']) => { const paramsText = []; + if (params.area_name && params.area_name !== 'Semua Area') { + paramsText.push(`Area: ${params.area_name}`); + } + + if (params.location_name && params.location_name !== 'Semua Lokasi') { + paramsText.push(`Lokasi: ${params.location_name}`); + } + + if (params.kandang_name && params.kandang_name !== 'Semua Kandang') { + paramsText.push(`Kandang: ${params.kandang_name}`); + } + if (params.period) { const formattedDate = formatDate(params.period, 'DD MMM YYYY'); paramsText.push(`Tanggal: ${formattedDate}`); } + if (params.weight_min || params.weight_max) { + const weightRange = + params.weight_min && params.weight_max + ? `${params.weight_min} - ${params.weight_max} kg` + : params.weight_min + ? `≥ ${params.weight_min} kg` + : `≤ ${params.weight_max} kg`; + paramsText.push(`Rentang Bobot: ${weightRange}`); + } + + if (params.show_unrecorded === 'true') { + paramsText.push('Tampilkan: Tanpa Recording'); + } + const currentDate = formatDate(new Date().toISOString(), 'DD MMM YYYY HH:mm'); paramsText.push(`Dicetak: ${currentDate}`);