Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
5fd189a7b6
commit
a5eaba54dc
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user