1. Introduction
This document outlines the requirements for implementing an Invoice Settings feature in Agency Handy. This feature allows Super Admin and Admin users to configure invoice templates and customize various fields to suit their needs.
2. Business Needs
Provide flexibility in invoice appearance and content to match agency branding. Improve the invoicing process by allowing customization of templates. Enhance user experience by enabling easy management of invoice settings. 3. User Stories
As a Super Admin/Admin, I want to access and modify invoice settings, so I can customize invoices to match my agency's branding. As a Super Admin/Admin, I want to select and customize invoice templates, so I can apply these templates to all new and draft invoices. As a Super Admin/Admin, I want to control which fields appear on the invoice, so I can ensure only relevant information is displayed. 4. Functional Requirements
4.1 Invoice Settings Access
Super Admin and Admin: Only users with these roles can see and access the invoice settings option. Invoice settings option is visible and accessible to Super Admin and Admin roles. 4.2 Template Selection and Customization
Template Selection: Super Admin and Admin can select the template for invoices. Ability to select a template from available options. Selected template applies to all new and draft invoices. Template can be reset to default Template Customization: Super Admin and Admin can customize the selected template. Users can change the logo. Default: "Invoice" (Max 32 characters) Users can change the title. Theme, Text, Background, and additional fields based on the template. Users can customize theme, text, and background colors. Default note (Max 140 characters) Users can set and edit a default note. If user gives another note while creating invoice the default note will be replaced Users can add, replace, or delete the signature. Fields that can be hidden: Signature, Note, Agency Address, VAT Tax, Paid Amount, Customer Address, Due Amount, Discount Percentage. Users can select fields to hide when creating a manual invoice. Hidden fields do not appear on the invoice if selected. A button to reset to default for the template 4.3 Multiple Templates
Template State Management: Maintain changes made to templates even when switching between multiple templates. If a user selects Template 1, makes changes, then switches to Template 2, the state of Template 1 is saved. Users can switch back to Template 1 and find their changes preserved. 4.4 Invoice prefix
Invoice Prefix Configuration Add a new "Invoice Prefix" field under Invoice Settings. Mandatory: {n} for sequential numbering. Optional: {day} (day of invoice creation), {mm} (month), and {yyyy} (year). skytech{yyyy}{mm}{day}-{n} → skytech20241223-1, skytech20241223-2. {yyyy}-{mm}-Invoice{n} → 2024-12-Invoice1, 2024-12-Invoice2. Display:
"The {n} variable is mandatory to generate sequential invoice numbers. Optional variables: {day} (day), {mm} (month), {yyyy} (year)." Invoice Number Generation Replace {n} with an auto-incremented counter starting from 1. Replace {day}, {mm}, and {yyyy} with the corresponding date of invoice creation. Prefix: {yyyy}{mm}{day}-{n} → 20241223-1, 20241223-2. Prefix: INV-{mm}{yyyy}{n} → INV-1220241, INV-1220242. Validation and Error Handling If the prefix does not include {n}, show an error:
"The {n} variable is required to generate sequential invoice numbers." Ensure variables {day}, {{mm}}, {{yyyy}}, and {{n}} are enclosed in {{}}. Prevent saving prefixes with invalid or incomplete configurations. Allow Superadmins/Admins to update the prefix at any time. Changing the prefix does not reset the counter. The full invoice number (prefix + date variables + counter) will appear in: 5. Non-Functional Requirements
Usability: The interface for invoice settings must be user-friendly and intuitive. Performance: Changes to invoice settings should be reflected immediately without significant delay. Security: Only Super Admin and Admin users should be able to access and modify invoice settings. 6. User Interface
Invoice Settings Page: A dedicated page where Super Admin and Admin users can select and customize templates. Clear options for selecting and customizing invoice templates. Real-time preview of changes made to the invoice template. 7. Dependencies
Authentication and Authorization: Ensure that only Super Admin and Admin users have access to invoice settings. Template Management System: Development of a backend system to manage and store invoice templates and their states.
Queries: