Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 20:56:32 +00:00
co-authored by renee-png
parent 5fd189a7b6
commit a5eaba54dc
+4 -3
View File
@@ -15,11 +15,12 @@ export interface GenerateInvoiceResult {
invoiceNumber: string;
}
// Round hours to the nearest 0.6 (per firm policy: tenths of an hour rounded
// up to the nearest 6-minute increment, capped at a 0.6h granularity).
// Round hours UP to the nearest 0.1 (6-minute increment), per firm policy:
// any time worked is billed in 6-minute units, with a 0.1h minimum.
export function roundHoursToSixTenths(hours: number): number {
const n = Math.max(0, Number(hours) || 0);
return +(Math.round(n / 0.6) * 0.6).toFixed(2);
if (n === 0) return 0;
return +(Math.max(0.1, Math.ceil(n / 0.1) * 0.1)).toFixed(2);
}
export async function generateInvoiceForClient(args: GenerateInvoiceArgs): Promise<GenerateInvoiceResult> {