Bug #2870
Develop Sales Visit Planning & Expense Management Module
Description
Objective:
Develop a Sales Visit Planning module integrated with the existing Expense Management system to enable sales executives to plan site visits, capture visit details, and submit expenses for approval.
Business Requirement:
Sales executives frequently visit customer locations for site surveys and business development. The system should allow managers to plan visits, assign executives, track visit progress, and manage visit-related expenses using the existing expense approval workflow.
Scope:
1. Sales Visit Planning
- Create Sales Visit Plan
- Assign Sales Executive
- Select Visit Date & Time
- Customer Name
- Contact Person
- Contact Number
- Visit Address
- GPS Location (Latitude/Longitude)
- Expected Capacity
- Purpose of Visit
- Remarks
- Visit Status:
- Planned
- In Progress
- Completed
- Cancelled
2. Visit Execution
- Executive can view assigned visits.
- Start and complete visit.
- Capture GPS location.
- Upload site photos.
- Add visit remarks.
3. Expense Management
Reuse the existing Expense Management module by introducing a new expense classification:
- SALES_SITE_SURVEY
Supported Expense Types:
- Travel
- Fuel
- Food
- Hotel
- Parking
- Toll
- Local Transport
- Customer Meeting
- Miscellaneous
Each expense should be linked to the corresponding Sales Visit.
4. Approval Workflow
Existing workflow will be reused:
Sales Executive
→ Sales Manager
→ Finance
→ Payment/Reimbursement
No separate approval process is required.
Database Changes:
Enhance the existing Expense table by adding:
- classification
- visit_id
Acceptance Criteria:
- Manager can create and assign Sales Visits.
- Sales Executive can view assigned visits.
- Sales Executive can complete visits with remarks and photos.
- Expenses can be submitted against a Sales Visit.
- Existing expense approval workflow functions without changes.
- Reports can filter expenses using the SALES_SITE_SURVEY classification.
Updated by Yashaditya Singh about 2 months ago
I worked on updating the Sales Visit module based on the revised business flow. I modified the repository to remove the assignment-based approach and implemented ownership using the created_by field. I updated the create, update, list, detail, start, and complete functionalities to support the new workflow. I also aligned Sales Visit with the existing Employee Expense module by linking expense claims through sales_visit_id, ensuring the existing Manager Approval and accounting voucher generation process continues to work without any duplicate implementation.
Updated by Yashaditya Singh about 1 month ago
I worked on enhancing the Sales Visit module by implementing and testing the new View All Sales Visits permission. I added the required permission constant, updated the controller to support view-all access, and created database scripts to assign the permission to tenant admin roles and users. I verified the permission mapping in the database, tested the APIs through Swagger, and debugged why all sales visits were not appearing in the list API. During validation, I confirmed the issue was caused by the applied visit date filter rather than the permission or repository logic, and completed end-to-end testing of the updated functionality.