feat: Credit Sales Summary + per-customer Items on Credit tab#323
Open
NotAbdelrahmanelsayed wants to merge 1 commit into
Open
Conversation
Add a "who owes the shop money" view reachable from the POS side rail, plus a per-customer breakdown of items taken on credit. Backend - pos_next/api/customer_dues.py: get_credit_customers_summary() (one grouped Sales Invoice query, GROUP BY customer, mirrors credit_sales.get_customer_balance math), get_customer_due_statement(), and pay_customer_due(). Permission-guarded. - pos_next/api/test_customer_dues.py: unit tests (returns netting, permission guard). Frontend - CreditSalesSummaryDialog.vue: debtor list with total-owed card and Arabic-aware client search; rows drill into the customer statement. - CustomerDuesDialog.vue: Statement / Items-on-Credit tabs; items tab aggregates due-invoice line items by item (qty + amount). - ManagementSlider.vue: new "Credit Sales" rail button. - posUI.js: register the creditSalesSummary dialog (shortcut suppression). - POSSale.vue: mount the dialogs + wire the rail action and drill-in. - utils/searchText.js, composables/useDialogSubmit.js: helpers the dialogs use. - translations/ar.csv: Arabic for all new strings. Rebased onto develop so the PR contains only the credit-sales feature. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0193VupL1jxR1L3ShCCqMjfy
0ce3799 to
dd0db84
Compare
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.
Credit Sales Summary + Per-Customer "Items on Credit" tab
Adds a fast way to answer "who owes the shop money?" and "what did this customer take on credit?" — without opening customers one by one.
What's new
Backend
pos_next/api/customer_dues.py: newget_credit_customers_summary(pos_profile, company)— one groupedSales Invoicequery (mirrorscredit_sales.get_customer_balancemath,GROUP BY customer), returns customers withnet_balance > 0, their due-invoice counts, and a company-wide total. Permission-guarded +frappe.log_errorwrapped.pos_next/api/test_customer_dues.py: unit tests (mixed regular + return invoices; permission guard).Frontend
CreditSalesSummaryDialog.vue(new),CustomerDuesDialog.vue(Statement / Items-on-Credit tabs + items aggregation),ManagementSlider.vue(rail button),posUI.js(dialog registration),POSSale.vue(wiring).translations/ar.csv; verified end-to-end in EN and AR/RTL.English
Credit Sales summary
Customer Account → Statement tab
Customer Account → Items on Credit tab
Arabic (RTL)
ملخص المبيعات الآجلة
كشف الحساب
الأصناف الآجلة
Note on scope
This feature extends files (the dues dialog, the main POS page, the UI store,
ar.csv) that already carried related in-progress local work, and the page's import graph ties them together. To keep the branch building/running as tested, it therefore also includes that related POS work rather than an artificially split, non-building diff.🤖 Generated with Claude Code