Bug #3004
Recievable Finance Customer
Updated by Saransh Bakoliya about 2 months ago
Service API Layer: Created receivablesService.ts integrating all endpoints for Finance Customers, Sales Invoices, and Customer Receipts.
Modular Tabbed UI: Built ReceivablesPage.tsx featuring a 3-tab layout for Finance Customers, Customer Invoices, and Customer Receipts.
Customer Master Table: Implemented the Finance Customer table with search, status filters, credit terms, and status badges.
Auto-Ledger Creation: Integrated POST /api/v1/master-data/finance-customer to create credit customers and auto-generate Sundry Debtors ledgers (CUST-####).
Debounced Duplicate Validation: Implemented live debounced validation to check duplicate customer names and GST numbers while typing.
Customer Profile Updates: Integrated PUT /api/v1/master-data/finance-customer/{id} to update customer details and sync linked ledgers.
Account Status Control: Integrated PATCH /activate and /deactivate endpoints with confirmation modals for account status management.
Customer Profile Drawer: Designed a detailed view drawer displaying credit days, credit limit, contact info, tax IDs, and ledger ID.
Sales Invoice Master Table: Implemented the Customer Invoices list view tracking invoice number, totals, tax, status, and balance due.
Dynamic Line-Item Invoice Builder: Built a multi-line invoice item creator with real-time rate, quantity, and GST (0-28%) calculation.
Draft Invoice Creation: Integrated POST /api/v1/master-data/sales/customer-invoice endpoint to generate draft sales invoices.
Invoice Posting Workflow: Integrated POST /{id}/post endpoint to post draft invoices, debiting Sundry Debtors and crediting Sales Revenue.
Invoice Cancellation & Deletion: Integrated POST /{id}/cancel and DELETE /{id} endpoints to cancel or soft-delete draft invoices.
Itemized Invoice Viewer: Created an Invoice Details drawer rendering full line items, subtotal, tax breakdown, and payment status.
Customer Receipts Ledger: Built the Customer Receipts list view tracking voucher numbers (BR/2026-27/####), payment modes, and allocations.
Collection Receipt Recording: Integrated POST /api/v1/master-data/sales/customer-receipts to record money received against posted unpaid invoices.
Sidebar & Route Integration: Configured permission-gated routing and sidebar navigation for Receivables under the Accounts menu (/company-admin/receivables).
Updated by Saransh Bakoliya about 2 months ago
Bound /api/v1/master-data/item endpoint to Sales Invoice line item descriptions using MUI Autocomplete (freeSolo).
Added MasterItem interface and getMasterItems() service call in receivablesService.ts.
Configured line item selection to auto-prefill item description, default unit rate, and GST percentage.
Resolved backend 0-results search query bug by routing search terms individually to customerName, customerCode, or gstNumber.
Added live Total Outstanding Balance (Pending) calculation to the Customer Profile drawer.
Upgraded native HTML date inputs to MUI @mui/x-date-pickers DatePicker across all modals.
Standardized DatePicker display to dd/MM/yyyy format using AdapterDateFns with Clear and OK action buttons.
Aligned header Close (✕) icon buttons to the top-right end using ml: 'auto' and flexShrink: 0.
Styled modal exit buttons as circular grey pills (#F1F5F9, 32px, borderRadius: '50%') matching TenantUserManagement.tsx.
Cleaned up input labels (Select Customer, Invoice Date, Receipt Date) to prevent duplicate ** rendering on required fields.
Applied uniform borderRadius: '10px !important' across getTextFieldStyle() and DatePicker input outlines.
Fixed 0 clearing bug on line item Rate (₹) input field by rendering empty string when rate is 0 with placeholder="0".
Enhanced modal layout spacing with p: 3 card padding, spacing={2.5} grid spacing, and mb: 2.5 section margins.
Integrated server-side pagination for getCustomerReceipts() API accepting page & pageSize and returning totalCount.
Added recPage, recPageSize, and recTotal pagination states to ReceivablesPage.tsx.
Added MUI TablePagination to Customer Receipts tab supporting 5, 10, 20, 50 rows per page.
Added Actions header column to Customer Receipts table and updated loading/empty row colSpan to 7.
Implemented ViewIcon (VisibilityOutlined) button in Receipts table with View Receipt tooltip and primary hover highlight.
Implemented EditIcon button in Receipts table with Edit Receipt tooltip guarded by canManageReceipts.
Aligned Receipts action button styles (sx={{ color: 'text.secondary', '&:hover': { bgcolor: '#F1F5F9' } }}) to StationTechVisitPlanPage.tsx.
Fixed TypeScript parameter overload and event handler type mismatches (TS2554, TS2552, TS2769).
Dynamic theme color binding using useBrandingStyles() (primaryButtonStyle, getBrandedColor, getBrandedAlpha).
Verified 100% clean application build with zero TypeScript compilation errors.
Updated by Saransh Bakoliya about 2 months ago
Module Renaming: Updated module title, headers, and sidebar navigation item from "Customer Receipts" to "Receivables".
Receivables Slide-Over Drawer: Integrated a detailed right-side drawer panel for viewing receipt overview and itemized invoice allocations.
Live API Data Binding: Tied receipt drawer fetching to GET /finance-customer/{id} and GET /sales/customer-invoice/{id} endpoints.
Balance Due Column: Added a dedicated Balance Due column to the Receivables table placed right next to Total Amount.
Balance Synchronization Fix: Fixed the calculation discrepancy between outer table balance due and inner slide-over panel balance due.
Finance Customer Action Styling: Redesigned View and Edit action buttons in Finance Customers table to match clean minimal primary UI theme.
Customer Invoice Action Buttons: Standardized View, Edit, Post, and Cancel button styles in Customer Invoices table with branding theme.
Draft Delete Restriction: Enforced status rule on Customer Invoices so the Delete icon is only visible when invoice status is DRAFT.
Eye Icon Standardization: Standardized the Eye Button (<ViewIcon fontSize="small" />, sx={{ color: primary }}) across all three tables.
Table Column Left Alignment: Updated Total Amount and Balance Due headers and cell values from right-aligned to Left Aligned.
Number Field Clearance Fix: Resolved the input clearance bug on Credit Limit, Opening Balance, and Credit Days in Create Customer modal.
Invoice Quantity & Rate Validation: Restricted negative numbers (< 0) on Quantity and Rate inputs in Sales Invoice line items.
Customer Credit Limit Validation: Added non-negative input validation (min="0") for Credit Days, Credit Limit, and Opening Balance.
Quantity Input Clearing: Fixed Sales Invoice line item Quantity field so it clears smoothly on backspace without forcing default 1.
Customer Drawer UI Cleanup: Removed the redundant Total Outstanding Balance (Pending) card block from the Customer Profile drawer.
Mode Field Removal: Removed Receipt Mode column from Receivables table, Payment Mode from Receipt drawer, and Receipt Mode dropdown from Record Receipt modal.
5:55 PM
Updated by Saransh Bakoliya about 2 months ago
Entity Count Discrepancy Analysis: Detailed technical explanation provided for count differences across tabs (21 Finance Customers $\rightarrow$ 47 Customer Invoices $\rightarrow$ 61 Receivables Collection Receipts).
Receivables API Client-Side Pagination Slicing: Applied fallback array slicing (list.slice(...)) across API fetch handlers in ReceivablesPage.tsx to guarantee page size enforcement in UI.
Finance Customers Dropdown Options Fix: Added rowsPerPageOptions={[5, 10, 20, 50, 100]} to TablePagination to fix blank "Rows per page" dropdown display on initial load.
Customer Invoices Table Pagination Option Sync: Fixed missing "Rows per page" selection on page load for the Customer Invoices table view.
Receivables Table Pagination Enhancement: Aligned MUI TablePagination options across Customer Receipts to support custom page sizes ([5, 10, 20, 50, 100]).
Currency Symbol Standardization: Updated AddProposedLocationDrawer.tsx icon imports from AttachMoney to CurrencyRupee.
Input Adornment Rupee Symbol Replacement: Replaced all $ icons next to "Client Offer", "Proposed Offer", and price text field start adornments with ₹ (Currency Rupee).
Create Credit Customer Modal to Slider Conversion: Replaced the center Dialog modal with a sleek right-side Drawer slider panel for adding credit customers.
Edit Finance Customer Drawer Integration: Seamlessly integrated the editing flow for Finance Customers into the right-side Drawer slider panel structure.
Customer Form Validation & Duplicate Checker Retention: Preserved 100% of GST warnings, Name duplicate checker logic, and form validation state inside the new Customer panel.
Responsive Panel Width Customization (65%): Standardized the Create/Edit Credit Customer side panel width to 65% of screen width (width: { xs: '100%', sm: '80%', md: '65%' }).
Create Sales Invoice Modal Conversion: Converted the "Create Sales Invoice (Draft)" center Dialog modal into a right-side Drawer slider panel.
Itemized Line Items Table Integration: Preserved multi-line product/service additions, master items autocomplete lookup, and line totals calculation inside the Invoice drawer.
Real-Time Subtotal & GST Recalculation: Maintained live GST tax calculation, subtotal, and total amount summary cards within the Invoice slider drawer.
Record Collection Receipt Drawer Conversion: Converted the "Record Collection Receipt" center Dialog modal into a right-side Drawer slider panel.
Invoice Allocation & Receipt Verification: Preserved full unpaid posted invoice allocation table, automatic total receipt sum calculation, and payment submission logic inside the 65% width Receivables side panel.
5:26 PM