mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 23:35:45 +00:00
feat(FE-316): Use population instead of available_quantity
This commit is contained in:
@@ -4,11 +4,11 @@ import * as XLSX from 'xlsx';
|
||||
import { ProjectFlockKandangLookup } from '@/types/api/production/project-flock';
|
||||
|
||||
export const generateUniformityTemplate = (
|
||||
availableQuantity: number,
|
||||
population: number,
|
||||
projectFlockKandangLookup: ProjectFlockKandangLookup
|
||||
) => {
|
||||
try {
|
||||
const sampleSize = Math.round(availableQuantity * 0.02);
|
||||
const sampleSize = Math.round(population * 0.02);
|
||||
const kandangName = projectFlockKandangLookup.kandang?.name || 'Kandang';
|
||||
const flockName = projectFlockKandangLookup.project_flock?.flock_name || '';
|
||||
const flockPeriod = projectFlockKandangLookup.project_flock?.period || 1;
|
||||
@@ -23,7 +23,7 @@ export const generateUniformityTemplate = (
|
||||
['Nama Flock', flockName],
|
||||
['Periode', flockPeriod],
|
||||
['Kandang', kandangName],
|
||||
['Total Populasi', formatNumber(availableQuantity)],
|
||||
['Total Populasi', formatNumber(population)],
|
||||
['Jumlah Sampel (2%)', formatNumber(sampleSize)],
|
||||
[''],
|
||||
['CARA PENGISIAN:'],
|
||||
@@ -95,7 +95,7 @@ export const generateUniformityTemplate = (
|
||||
XLSX.writeFile(workbook, filename);
|
||||
|
||||
toast.success(
|
||||
`Template berhasil dibuat dengan ${formatNumber(sampleSize)} baris data (2% dari ${formatNumber(availableQuantity)} populasi).`
|
||||
`Template berhasil dibuat dengan ${formatNumber(sampleSize)} baris data (2% dari ${formatNumber(population)} populasi).`
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('Error generating uniformity template:', error);
|
||||
|
||||
Reference in New Issue
Block a user