Implement full Sales page with KPIs, AI, and invoice management#2
Open
coder-contrib-bot wants to merge 1 commit into
Open
Implement full Sales page with KPIs, AI, and invoice management#2coder-contrib-bot wants to merge 1 commit into
coder-contrib-bot wants to merge 1 commit into
Conversation
…gement - Add sales_repository.dart with models for invoices/items and API methods - Add sales_provider.dart with filtered list, KPI computation, and status enums - Rewrite sales_page.dart with search, KPI cards, AI insight panel, status/type filters, invoice list with payment progress, record payment dialog, and AI dialog - Add sale_detail_drawer.dart with Overview/AI Insights/Actions tabs - Add create_sale_dialog.dart with 4-step flow: Customer > Products > Payment > Confirm GIT_AUTHOR_NAME: Claude Code (AI Agent) GIT_AUTHOR_EMAIL: noreply@anthropic.com Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary\n\n- Sales Repository (
sales_repository.dart): Data layer withSalesInvoiceModel,SalesItemModel, and repository methods (getAll, getById, create, recordPayment, aiChat)\n- Sales Provider (sales_provider.dart): Riverpod state management with filtered invoices, KPI computation (total sales, cash/credit %, unpaid amounts), search, and status/type filters\n- Sales Page (sales_page.dart): Full Revenue Engine Control Center with:\n - Search bar, New Sale button, AI button, refresh, alerts badge\n - KPI row (Total Sales, Invoices, Cash %, Credit %, Unpaid)\n - AI Insight panel with dynamic insights\n - Payment status filters (All/Paid/Partial/Unpaid) + type filters (Cash/Credit)\n - Invoice cards with status color bar, payment progress, quick actions (View/Pay/AI)\n- Sale Detail Drawer (sale_detail_drawer.dart): Right-side panel with 3 tabs:\n - Overview: financial summary, payment progress, invoice details\n - AI Insights: contextual questions about the invoice\n - Actions: record payment, print, edit, return, AI analysis\n- Create Sale Dialog (create_sale_dialog.dart): 4-step wizard:\n 1. Customer selection (or walk-in) + warehouse\n 2. Product line items with quantity, unit type, price, discount\n 3. Payment details (cash/credit/mixed) + discount + notes\n 4. Review & confirm with auto stock deduction notice\n\n## AI Agent\n\nThis PR was created by Claude Code (AI Agent).\n- GIT_AUTHOR_NAME: Claude Code\n- GIT_AUTHOR_EMAIL: noreply@anthropic.com\n\n## Test plan\n\n- [ ] Verify sales page loads and fetches invoices from/api/sales\n- [ ] Test KPI cards display correct totals\n- [ ] Test status and type filters work correctly\n- [ ] Test search by invoice number and customer name\n- [ ] Test clicking an invoice opens the detail drawer\n- [ ] Test Create Sale 4-step wizard flow\n- [ ] Test Record Payment dialog and provider refresh\n- [ ] Test AI dialog sends queries to/api/ai/chat\n\n🤖 Generated with Claude Code