feat(FE-333): adding feature overhead closing report

This commit is contained in:
randy-ar
2025-12-09 18:14:46 +07:00
parent 489815ecaf
commit 8c7640eb9c
7 changed files with 558 additions and 38 deletions
+152
View File
@@ -82,6 +82,7 @@ import {
ClosingGeneralInformation,
ClosingIncomingSapronak,
ClosingOutgoingSapronak,
ClosingOverhead,
ClosingSapronakCalculation,
} from '@/types/api/closing';
import { CreatedUser, BaseApiResponse } from '@/types/api/api-general';
@@ -846,6 +847,141 @@ export const dummySapronakCalculation: ClosingSapronakCalculation = {
},
};
// ======================
// 💰 Overhead Dummy Data
// ======================
export const dummyOverhead: ClosingOverhead = {
overheads: [
{
item_name: 'Expedisi DOC',
uom_name: 'Ekor',
budget_quantity: 500,
budget_unit_price: 8000,
budget_total_amount: 4000000,
actual_date: '',
actual_quantity: 0,
actual_unit_price: 0,
actual_total_amount: 0,
cost_per_bird: 0,
},
{
item_name: 'Solar',
uom_name: 'Liter',
budget_quantity: 0,
budget_unit_price: 0,
budget_total_amount: 0,
actual_date: today,
actual_quantity: 20,
actual_unit_price: 10000,
actual_total_amount: 200000,
cost_per_bird: 200,
},
{
item_name: 'Gaji Karyawan Kandang',
uom_name: 'Orang',
budget_quantity: 3,
budget_unit_price: 3000000,
budget_total_amount: 9000000,
actual_date: today,
actual_quantity: 3,
actual_unit_price: 3200000,
actual_total_amount: 9600000,
cost_per_bird: 640,
},
{
item_name: 'Listrik Kandang',
uom_name: 'Bulan',
budget_quantity: 1,
budget_unit_price: 2500000,
budget_total_amount: 2500000,
actual_date: today,
actual_quantity: 1,
actual_unit_price: 2800000,
actual_total_amount: 2800000,
cost_per_bird: 187,
},
{
item_name: 'Air Bersih',
uom_name: 'Bulan',
budget_quantity: 1,
budget_unit_price: 500000,
budget_total_amount: 500000,
actual_date: today,
actual_quantity: 1,
actual_unit_price: 450000,
actual_total_amount: 450000,
cost_per_bird: 30,
},
{
item_name: 'Perbaikan Kandang',
uom_name: 'Paket',
budget_quantity: 1,
budget_unit_price: 3000000,
budget_total_amount: 3000000,
actual_date: yesterday,
actual_quantity: 1,
actual_unit_price: 3500000,
actual_total_amount: 3500000,
cost_per_bird: 233,
},
{
item_name: 'Service Peralatan',
uom_name: 'Kali',
budget_quantity: 2,
budget_unit_price: 500000,
budget_total_amount: 1000000,
actual_date: lastWeek,
actual_quantity: 2,
actual_unit_price: 550000,
actual_total_amount: 1100000,
cost_per_bird: 73,
},
{
item_name: 'ATK & Supplies',
uom_name: 'Paket',
budget_quantity: 1,
budget_unit_price: 500000,
budget_total_amount: 500000,
actual_date: today,
actual_quantity: 1,
actual_unit_price: 450000,
actual_total_amount: 450000,
cost_per_bird: 30,
},
{
item_name: 'Biaya Komunikasi',
uom_name: 'Bulan',
budget_quantity: 1,
budget_unit_price: 300000,
budget_total_amount: 300000,
actual_date: today,
actual_quantity: 1,
actual_unit_price: 320000,
actual_total_amount: 320000,
cost_per_bird: 21,
},
{
item_name: 'BBM Kendaraan Operasional',
uom_name: 'Liter',
budget_quantity: 200,
budget_unit_price: 10000,
budget_total_amount: 2000000,
actual_date: today,
actual_quantity: 220,
actual_unit_price: 10500,
actual_total_amount: 2310000,
cost_per_bird: 154,
},
],
total: {
budget_quantity: 710,
budget_total_amount: 23300000,
actual_quantity: 250,
actual_total_amount: 24530000,
cost_per_bird: 1568,
},
};
// ======================
// 🔧 Dummy API Response Functions
// ======================
@@ -982,3 +1118,19 @@ export const dummyGetPerhitunganSapronak = async (
data: dummySapronakCalculation,
};
};
/**
* Dummy implementation for getOverhead
* Returns overhead data
*/
export const dummyGetOverhead = async (
id: number
): Promise<BaseApiResponse<ClosingOverhead> | undefined> => {
await new Promise((resolve) => setTimeout(resolve, 400));
return {
code: 200,
status: 'success',
message: 'Data overhead berhasil diambil',
data: dummyOverhead,
};
};