Skip to content

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

AttributeValue
Module IDCORE-10
PhasePhase 1
PriorityHIGH
DependenciesPayment, 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

IDAs a...I want to...So that...
US-01Business ownerSee all transactionsI track all money movement
US-02Business ownerFilter transactions by dateI review specific periods
US-03Business ownerFilter by payment methodI see QR vs cash breakdown
US-04Business ownerView transaction detailsI see full payment info
US-05CashierSee today's transactionsI know my shift activity
US-06Business ownerExport transactionsI have records for accounting

Phase 2 - Reconciliation

IDAs a...I want to...So that...
US-07Business ownerReconcile daily cashDrawer matches transactions
US-08Business ownerSee discrepanciesI know if cash is short
US-09Business ownerSet opening floatI start with known balance
US-10Business ownerRecord cash dropsI track cash taken from drawer
US-11ManagerApprove adjustmentsCorrections are authorized

Feature Matrix

FeatureP1P2P3Description
Transaction recordingAuto-record all payments
Transaction historyView all transactions
Filter & searchFilter by date, method, status
Transaction detailsFull payment information
Export (CSV/Excel)Download transactions
Daily summaryEnd of day totals
Cash reconciliationMatch cash to transactions
Opening floatSet starting cash
Cash dropsRecord cash removed
AdjustmentsManual corrections
Multi-registerPer-register reconciliation
Expense trackingPetty 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

StatusDescriptionNext Actions
PENDINGAwaiting confirmationComplete, Fail
COMPLETEDSuccessfully processedReverse
FAILEDTransaction failedRetry
REVERSEDRefunded/cancelledNone

Key Flows

Transaction Recording Flow

Daily Reconciliation Flow

Cash Float & Drop Flow

Transaction Search Flow


Business Rules

Rule IDRuleDescription
BR-01Auto-recordingAll payments auto-generate transactions
BR-02ImmutableCompleted transactions cannot be edited
BR-03Reversal onlyCorrections done via reversal/adjustment
BR-04Timestamp requiredAll transactions have exact timestamp
BR-05User trackingEvery transaction linked to user
BR-06Sequential IDsTransaction IDs are sequential
BR-07Daily reconciliationCash must be reconciled daily
BR-08Variance approvalCash discrepancies need manager approval
BR-09Audit trailAll changes logged for audit
BR-1010-year retentionTransactions 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 history
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 logged

AC-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 correctly

AC-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 applicable

Dependencies

Transaction
├── Requires: Payment, Orders
├── Required by: Reports, Tax & Invoice
└── Integrates: Accounting systems (P3)
ModuleRelationship
PaymentPayments create transactions
OrdersOrders linked to transactions
ReportsFinancial reports
Tax & InvoiceTax 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.


Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.