Add Expenses
Link.→ {base url}/mgramseva/home/addExpense
Enables employees to add expenses - the process of onboarding the end-users
Add Expenses card is available on the home screen for defined user roles having the EXPENSE PROCESSING permission.
Clicking the Add Expense Record tile/card on the home screen navigates the user to Add Expenses screen.
The user enters the required details to add the expenses for the vendors.
If a user logs in for the first time then a walkthrough is populated following the same logic as in the home screen.
Clicking on the Submit button navigates the user to the Expenditure Added Successful acknowledgement screen.
Logic Implemented for Date Validation and File Attachments
File Attachments
This feature allows the user to take a picture or choose a single file. The Image Picker plugin is used to implementing this.
Whenever this application is used on mobile, it prompts the user with two options - Camera and File Picker. If the application is opened on desktop or laptop browsers, the camera option is not available. The user has to select an image from the folder.
The maximum supported file size is 5 MB.
Date Validation
For validating the form we use the Form widget. Once the user selects a bill date the Bill Pay option is enabled and also from and to dates are auto populated with Bill date, user can update the from and to dates and but they cannot be after the bill date. Else, the auto validation process is enabled.
Based on the bill date, the party selection date is enabled. If the user selects the party selection date first, the bill date can be selected only after entering the party date.
Whenever the bill paid option is true, the paid date field is enabled and mandatory. The date selection range allows date input only after the bill date and before the current date.
File Path
Primary Files - https://github.com/egovernments/punjab-mgramseva/blob/develop/frontend/mgramseva/lib/screeens/AddExpense/ExpenseDetails.dart ,https://github.com/egovernments/punjab-mgramseva/blob/develop/frontend/mgramseva/lib/screeens/AddExpense/AddExpenseWalkThrough/WalkThroughContainer.dart ,https://github.com/egovernments/punjab-mgramseva/blob/develop/frontend/mgramseva/lib/screeens/AddExpense/AddExpenseWalkThrough/expenseWalkThrough.dart
SL | Fields | Validations |
---|---|---|
1 | Vendor Name* |
|
2 | Mobile Number* |
|
3 | Type of Expense* | None |
4 | Amount* |
|
5 | Bill Date* | Before Current Date and after party Bill Date. |
6 | From Date | Cannot be after Bill Date |
7 | To Date | Cannot be after Bill Date and cannot be before the From date |
8 | Party Bill Date |
|
9 | Bill Paid | None |
10 | Paid Date | After Bill date and less than current Date. |
11 | Attach Documents | Option to upload a single document, Supported files - PDF, JPEG, PNG (maximun 5MB) |
Note: All fields are validated on Submit apart from the Mobile number which gets validated on change.
API Details
SL | API | Params | Description |
---|---|---|---|
1 |
|
| To get the Expense Type for the Dropdown |
2 |
|
| To get the list of vendors in the selected tenant for the suggestion text box - Vendor Name |
Stack
1 → Home Screen. + Add Expense Screen
Pop → Home Screen
Widgets Utilised from Library
SL No | Widgets | File Path | Description |
---|---|---|---|
1 |
| Text Field | |
2 |
| Suggestion Text Field | |
3 |
(Primary File)
(Secondary File) | Searchable Drop down | |
4 |
| Date Picker | |
5 |
| Success Screen | |
6 |
| Button |