Work in Progress
Feature details in this document may change during investigation, discussion, design, and implementation phases.
Transaction / Giao dịch
Transaction ledger and payment records.
Overview
| Attribute | Value |
|---|---|
| Module ID | CORE-10 |
| Phase | Phase 1 |
| Priority | HIGH |
| Dependencies | Payment, Orders |
The Transaction module maintains a complete record of all financial transactions. It serves as the ledger for cash, QR payments, card transactions, and other payment methods, providing a foundation for reporting, reconciliation, and tax compliance.
┌─────────────────────────────────────────────────────────────────┐
│ TRANSACTION LEDGER │
├─────────────────────────────────────────────────────────────────┤
│ │
│ INCOMING (+) OUTGOING (-) │
│ ───────────── ─────────────── │
│ │ │ │
│ ├── Sales ├── Refunds │
│ │ └── QR, Cash, Card │ └── Customer returns │
│ │ │ │
│ ├── Deposits ├── Adjustments │
│ │ └── Pre-order deposits │ └── Cash corrections │
│ │ │ │
│ └── Adjustments └── Expenses │
│ └── Cash corrections └── Petty cash (P3) │
│ │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ DAILY RECONCILIATION │ │
│ │ Opening Balance + Income - Expenses = Closing Balance │ │
│ │ 50,000 + 500,000 - 20,000 = 530,000 │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘User Stories
Phase 1 - Core Transaction Recording
| ID | As a... | I want to... | So that... |
|---|---|---|---|
| US-01 | Business owner | See all transactions | I track all money movement |
| US-02 | Business owner | Filter transactions by date | I review specific periods |
| US-03 | Business owner | Filter by payment method | I see QR vs cash breakdown |
| US-04 | Business owner | View transaction details | I see full payment info |
| US-05 | Cashier | See today's transactions | I know my shift activity |
| US-06 | Business owner | Export transactions | I have records for accounting |
Phase 2 - Reconciliation
| ID | As a... | I want to... | So that... |
|---|---|---|---|
| US-07 | Business owner | Reconcile daily cash | Drawer matches transactions |
| US-08 | Business owner | See discrepancies | I know if cash is short |
| US-09 | Business owner | Set opening float | I start with known balance |
| US-10 | Business owner | Record cash drops | I track cash taken from drawer |
| US-11 | Manager | Approve adjustments | Corrections are authorized |
Feature Matrix
| Feature | P1 | P2 | P3 | Description |
|---|---|---|---|---|
| Transaction recording | ✓ | Auto-record all payments | ||
| Transaction history | ✓ | View all transactions | ||
| Filter & search | ✓ | Filter by date, method, status | ||
| Transaction details | ✓ | Full payment information | ||
| Export (CSV/Excel) | ✓ | Download transactions | ||
| Daily summary | ✓ | End of day totals | ||
| Cash reconciliation | ✓ | Match cash to transactions | ||
| Opening float | ✓ | Set starting cash | ||
| Cash drops | ✓ | Record cash removed | ||
| Adjustments | ✓ | Manual corrections | ||
| Multi-register | ✓ | Per-register reconciliation | ||
| Expense tracking | ✓ | Petty cash expenses |
Transaction Types
┌─────────────────────────────────────────────────────────────────┐
│ TRANSACTION TYPES │
├─────────────────────────────────────────────────────────────────┤
│ │
│ TYPE DIRECTION EXAMPLE │
│ ───────────────────────────────────────────────────────────── │
│ │ │
│ ├── SALE Income Customer payment for order │
│ │ │
│ ├── REFUND Expense Money returned to customer │
│ │ │
│ ├── DEPOSIT Income Pre-order/advance payment │
│ │ │
│ ├── ADJUSTMENT Either Manual correction (+/-) │
│ │ │
│ ├── FLOAT Neither Opening cash register │
│ │ │
│ ├── DROP Expense Cash removed from drawer │
│ │ │
│ └── EXPENSE Expense Petty cash purchase (P3) │
│ │
└─────────────────────────────────────────────────────────────────┘Transaction Statuses
| Status | Description | Next Actions |
|---|---|---|
| PENDING | Awaiting confirmation | Complete, Fail |
| COMPLETED | Successfully processed | Reverse |
| FAILED | Transaction failed | Retry |
| REVERSED | Refunded/cancelled | None |
Key Flows
Transaction Recording Flow
Daily Reconciliation Flow
Cash Float & Drop Flow
Transaction Search Flow
Business Rules
| Rule ID | Rule | Description |
|---|---|---|
| BR-01 | Auto-recording | All payments auto-generate transactions |
| BR-02 | Immutable | Completed transactions cannot be edited |
| BR-03 | Reversal only | Corrections done via reversal/adjustment |
| BR-04 | Timestamp required | All transactions have exact timestamp |
| BR-05 | User tracking | Every transaction linked to user |
| BR-06 | Sequential IDs | Transaction IDs are sequential |
| BR-07 | Daily reconciliation | Cash must be reconciled daily |
| BR-08 | Variance approval | Cash discrepancies need manager approval |
| BR-09 | Audit trail | All changes logged for audit |
| BR-10 | 10-year retention | Transactions kept for tax compliance |
Acceptance Criteria
AC-01: Transaction Recording
GIVEN a completed payment
WHEN payment is processed
THEN - Transaction is automatically created
- Transaction ID is generated
- All payment details are captured
- Transaction appears in historyAC-02: Transaction Search
GIVEN a user on the Transactions page
WHEN they apply date and method filters
THEN - Results show matching transactions
- Totals update to filtered amount
- Export includes filtered data only
- Performance is acceptable (< 2 seconds)AC-03: Daily Reconciliation
GIVEN a day with cash transactions
WHEN manager performs reconciliation
THEN - System shows expected cash total
- Actual amount can be entered
- Variance is calculated and shown
- Day can be closed with/without variance
- Reconciliation is loggedAC-04: Transaction Export
GIVEN a filtered transaction list
WHEN user exports to CSV/Excel
THEN - File downloads immediately
- All columns are included
- Data matches filtered view
- Numbers are formatted correctlyAC-05: Transaction Details
GIVEN a transaction in the list
WHEN user clicks to view details
THEN - Full payment info shown
- Related order is linked
- Receipt can be reprinted
- Refund status shown if applicableDependencies
Transaction
├── Requires: Payment, Orders
├── Required by: Reports, Tax & Invoice
└── Integrates: Accounting systems (P3)| Module | Relationship |
|---|---|
| Payment | Payments create transactions |
| Orders | Orders linked to transactions |
| Reports | Financial reports |
| Tax & Invoice | Tax compliance records |
Integration Points
Reconciliation Workflow
┌─────────────────────────────────────────────────────────────────┐
│ DAILY RECONCILIATION │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Step 1: Calculate Expected │
│ ───────────────────────── │
│ Opening Float 500,000 │
│ + Cash Sales + 800,000 │
│ - Cash Refunds - 50,000 │
│ - Cash Drops - 200,000 │
│ ───────────────────────────────────────────── │
│ = Expected Cash 1,050,000 │
│ │
│ Step 2: Count Actual │
│ ───────────────────── │
│ Actual Counted 1,048,000 │
│ │
│ Step 3: Calculate Variance │
│ ──────────────────────── │
│ Variance - 2,000 (SHORT) │
│ │
│ Step 4: Resolve │
│ ──────────────── │
│ [ ] Accept variance with explanation │
│ [ ] Investigate discrepancy │
│ [ ] Adjust if error found │
│ │
└─────────────────────────────────────────────────────────────────┘Transaction Report Format
┌─────────────────────────────────────────────────────────────────┐
│ DAILY TRANSACTION SUMMARY │
├─────────────────────────────────────────────────────────────────┤
│ Date: 2025-12-14 │
│ Store: Main Store │
│ POS: Counter 1 │
├─────────────────────────────────────────────────────────────────┤
│ SALES BY METHOD │
│ ├── Cash 50 txns 1,500,000 VND │
│ ├── QR (VNPAY) 30 txns 900,000 VND │
│ ├── Card 20 txns 600,000 VND │
│ └── TOTAL 100 txns 3,000,000 VND │
├─────────────────────────────────────────────────────────────────┤
│ REFUNDS │
│ └── Cash Refunds 2 txns 100,000 VND │
├─────────────────────────────────────────────────────────────────┤
│ NET TOTAL 2,900,000 VND │
└─────────────────────────────────────────────────────────────────┘Screenshots
Screenshots
Screenshots will be added after UI implementation.
Related Modules
- Payment - Payment processing
- Orders - Order management
- Tax & Invoice - Tax records
- Reports - Financial reports