From 9b2d98f7cec4a2b41abb29f6e7ead6af367a0210 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Thu, 18 Dec 2025 08:59:07 +0700 Subject: [PATCH] feat(FE-355,357): Add egg columns to HPP table and disable sale tabs --- .../pages/report/sale/SaleReportTabs.tsx | 30 ++++---- .../report/sale/tab/HppPerKandangTab.tsx | 72 +++++++++++++++---- 2 files changed, 73 insertions(+), 29 deletions(-) diff --git a/src/components/pages/report/sale/SaleReportTabs.tsx b/src/components/pages/report/sale/SaleReportTabs.tsx index ed1ce0ac..988c16b2 100644 --- a/src/components/pages/report/sale/SaleReportTabs.tsx +++ b/src/components/pages/report/sale/SaleReportTabs.tsx @@ -5,21 +5,21 @@ import HppPerKandangTab from '@/components/pages/report/sale/tab/HppPerKandangTa const SaleReportTabs = () => { const tabs = [ - { - id: '1', - label: 'Penjualan Harian', - content: 'Penjualan Harian Tab', - }, - { - id: '2', - label: 'Transaksi Penjualan DO', - content: 'Transaksi Penjualan DO Tab', - }, - { - id: '3', - label: 'Perbandingan HPP Per Rentang BW', - content: 'Perbandingan HPP Per Rentang BW Tab', - }, + // { + // id: '1', + // label: 'Penjualan Harian', + // content: 'Penjualan Harian Tab', + // }, + // { + // id: '2', + // label: 'Transaksi Penjualan DO', + // content: 'Transaksi Penjualan DO Tab', + // }, + // { + // id: '3', + // label: 'Perbandingan HPP Per Rentang BW', + // content: 'Perbandingan HPP Per Rentang BW Tab', + // }, { id: '4', label: 'HPP Harian Kandang', diff --git a/src/components/pages/report/sale/tab/HppPerKandangTab.tsx b/src/components/pages/report/sale/tab/HppPerKandangTab.tsx index a92a5f75..8cf54194 100644 --- a/src/components/pages/report/sale/tab/HppPerKandangTab.tsx +++ b/src/components/pages/report/sale/tab/HppPerKandangTab.tsx @@ -536,6 +536,20 @@ const HppPerKandangTab = () => { }, footer: () =>
-
, }, + { + id: 'avg_weight_kg', + header: 'Rata-Rata Bobot (KG)', + accessorKey: 'avg_weight_kg', + cell: (props) => { + const value = props.row.original.avg_weight_kg; + return
{formatNumber(value)}
; + }, + footer: () => ( +
+ {formatNumber(summary?.average_weight_kg || 0)} +
+ ), + }, { id: 'remaining_chicken_birds', header: 'Sisa Ayam (Ekor)', @@ -565,17 +579,39 @@ const HppPerKandangTab = () => { ), }, { - id: 'avg_weight_kg', - header: 'Rata-Rata Bobot (KG)', - accessorKey: 'avg_weight_kg', + id: 'egg_production_pieces', + header: 'Produksi Telur (Butir)', + accessorKey: 'egg_production_pieces', cell: (props) => { - const value = props.row.original.avg_weight_kg; + const value = props.row.original.egg_production_pieces; return
{formatNumber(value)}
; }, footer: () => ( -
- {formatNumber(summary?.average_weight_kg || 0)} -
+
-
+ ), + }, + { + id: 'egg_production_kg', + header: 'Produksi Telur (KG)', + accessorKey: 'egg_production_kg', + cell: (props) => { + const value = props.row.original.egg_production_kg; + return
{formatNumber(value)}
; + }, + footer: () => ( +
-
+ ), + }, + { + id: 'egg_value_rp', + header: 'Nilai Nominal Telur (RP)', + accessorKey: 'egg_value_rp', + cell: (props) => { + const value = props.row.original.egg_value_rp; + return
{formatCurrency(value)}
; + }, + footer: () => ( +
-
), }, { @@ -615,23 +651,31 @@ const HppPerKandangTab = () => { return
{formatCurrency(value)}
; }, footer: () => ( -
- {formatCurrency(summary?.average_egg_hpp_rp_per_kg || 0)} -
+
-
), }, { id: 'hpp_rp', - header: 'HPP (RP)', + header: 'HPP Ayam (RP)', accessorKey: 'hpp_rp', cell: (props) => { const value = props.row.original.hpp_rp; return
{formatCurrency(value)}
; }, footer: () => ( -
- {formatCurrency(summary?.total_egg_value_rp || 0)} -
+
-
+ ), + }, + { + id: 'egg_hpp_rp_per_kg', + header: 'HPP Telur (RP/KG)', + accessorKey: 'egg_hpp_rp_per_kg', + cell: (props) => { + const value = props.row.original.egg_hpp_rp_per_kg; + return
{formatCurrency(value)}
; + }, + footer: () => ( +
-
), }, {