export function incrementInvoiceNumber(lastInvoiceNumber?: string): string { if (!lastInvoiceNumber) return ''; // Extract the year and number parts const number = parseInt(lastInvoiceNumber, 10); // Increment the number const incrementedNumber = number + 1; // Format it back into the original format with leading zeros (assuming a max of 3 digits) const formattedNumber = incrementedNumber.toString(); return formattedNumber; }