feat(management): content-based duplicate detection for scanned receipts #182

Closed
opened 2026-09-30 16:32:33 +00:00 by yuris · 0 comments
Owner

Problem

When scanning physical receipts or invoices in the purchase and sales modals, identical or similar documents (e.g. delivery notes vs stamped cashier invoices, or duplicate scans) are prefilled without warning, risking duplicate transaction records in the database.

Acceptance Criteria

  • Scanned purchase receipts are checked against recorded purchases within a $\pm 7$-day window and matching supplier names.
  • Scanned sales order receipts are checked against recorded orders within a $\pm 3$-day window and matching customer or vehicle information.
  • Heuristic matching accounts for trade discounts, tax calculations, and rupiah rounding tolerances (\pm 2\% or Rp 500).
  • When potential duplicates are detected, display an in-modal warning banner detailing matching transactions (ID, date, party, amount, reason) with an dismiss option.
  • Warning is non-blocking so operators can still proceed if the transaction is valid.
  • Scanning pipeline fails open if database duplicate checks encounter errors.
  • Comprehensive unit tests verify matching heuristics and error resilience.
## Problem When scanning physical receipts or invoices in the purchase and sales modals, identical or similar documents (e.g. delivery notes vs stamped cashier invoices, or duplicate scans) are prefilled without warning, risking duplicate transaction records in the database. ## Acceptance Criteria - [ ] Scanned purchase receipts are checked against recorded purchases within a $\pm 7$-day window and matching supplier names. - [ ] Scanned sales order receipts are checked against recorded orders within a $\pm 3$-day window and matching customer or vehicle information. - [ ] Heuristic matching accounts for trade discounts, tax calculations, and rupiah rounding tolerances ($\pm 2\%$ or Rp 500). - [ ] When potential duplicates are detected, display an in-modal warning banner detailing matching transactions (ID, date, party, amount, reason) with an dismiss option. - [ ] Warning is non-blocking so operators can still proceed if the transaction is valid. - [ ] Scanning pipeline fails open if database duplicate checks encounter errors. - [ ] Comprehensive unit tests verify matching heuristics and error resilience.
yuris closed this issue 2026-09-30 16:52:18 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yuris/garage#182
No description provided.