Skip to content

Standard Operating Procedure (SOP-05): Pronto POS Transaction Bulk Ingestion & Reconciliation Governance

Document ID: SOP-05-PRONTO-POS-INGESTION Linked Ticket: STG-TICK-039, STG-TICK-047, STG-TICK-048 | Knowledge Base: KB-039, KB-047, KB-048 Owner: CPL Real Rewards Team (Business Owner) & ERP Operations Technical Maintenance: Systems Developer Effective Date: October 2026 Status: Approved & Operational Baseline


1. Purpose & Policy Statement

This Standard Operating Procedure establishes the governance protocol for ingesting daily Point of Sale (POS) retail transaction data exported from Pronto ERP into the CPL Real Rewards Loyalty Platform.

All POS transaction uploads must: 1. Guarantee mathematical invariance and idempotency across daily, weekly, and catch-up ingestion runs. 2. Maintain complete segregation of duties and auditable operator logs for every executed batch. 3. Execute asynchronously in isolated background worker threads to guarantee zero performance degradation or table lockouts on retail cash registers (till operations).


2. Roles and Responsibilities (RACI Matrix)

Activity ERP Administrator ERP Operations Lead Real Rewards Checker Systems Developer
Extract POS Feeds from Pronto ERP R A I I
Upload & Launch Bulk Import Batch R R I I
Audit Import History Logs & Batch Status R R C I
Investigate File Formatting Errors / Rejections R A C C
Cross-Verify Member Loyalty Points Accrual I C A I
Technical Process Troubleshooting / Background Thread Inspection C C I R

Legend: R = Responsible, A = Accountable, C = Consulted, I = Informed.


3. Operational Standards & Safeguards

Standard 1: Background Execution

  • Bulk imports must be executed via CPL Real Rewards > Configuration > Bulk Upload (Zinrelo) using mode POS Daily Transactions.
  • Once launched, the Odoo server spawns a dedicated background thread with an assigned Ubuntu OS PID and unique audit reference PID <pid> / IMP-xxxxx.
  • Operators must allow the background worker to complete without re-submitting identical files while a batch is marked Processing.

Standard 2: Mathematical Idempotency

  • Incoming transaction keys (pos_reference = POS/<store>/<order>) are validated against database unique constraints.
  • If a transaction was previously ingested, Odoo skips the row without modifying existing ledger balances.
  • Ingestion runs can be audited at any time in Configuration > Import History Logs.

Standard 3: Retention and Archiving

  • Daily CSV files and ZIP archives uploaded to the system are permanently cataloged in ir.attachment linked to the corresponding real.rewards.import.log record for audit trail preservation.

Standard 4: Concurrency Lock & Stale-Lock Auto-Expiry (STG-TICK-047)

  • Single-Batch Concurrency Lock: Only one bulk POS import batch (status = 'processing') may execute at a time. While a batch is running:
  • Opening the Bulk Upload POS Transactions wizard displays an active warning banner showing the running Batch ID, operator name, start time, and live progress counts.
  • Clicking Start Import while a batch is active is blocked by a ValidationError popup and a PostgreSQL transaction-level advisory lock (pg_try_advisory_xact_lock).
  • 30-Minute Auto-Expiry & Admin Force Unlock:
  • Any In Progress import log that has not updated for more than 30 minutes is automatically marked as Failed (Stale Import Lock Auto-Expired) so subsequent imports are never permanently blocked.
  • Head Office Checkers and Administrators can also manually clear a running/stuck lock at any time by opening the batch in Import History Logs and clicking Force Cancel / Unlock.

Standard 5: Per-Order Savepoint Isolation & 3-Stage Email Lifecycle (STG-TICK-047)

  • Per-Order Savepoint Failsafe: Every order in a bulk CSV upload executes inside an isolated PostgreSQL savepoint (with cr.savepoint():). If an individual order encounters a constraint or data error, only that single order is rolled back and recorded in the Isolated Order Errors & Warnings table, allowing the rest of the batch to finish with status Completed with Warnings (partial).
  • Unknown Card Quarantine: Transactions referencing unregistered or blocked card numbers are routed directly into real.rewards.quarantine.queue without creating dummy res.partner records.
  • 3-Stage Email Lifecycle:
  • Started Email: Sent immediately upon launch with the Process ID, Operator, and uploaded file list.
  • 50% Progress Milestone Email: Sent automatically at the halfway mark for large batches (>= 1,000 unique orders), alongside real-time UI toast notifications every 200 orders.
  • Final Completion / Warnings / Failure Email: Sent upon completion with per-file metrics, quarantine counts, and any isolated error details.

Standard 6: Pronto RR Report (.xlsx / .csv) & PS / PB / RD / RF Transaction Breakdown (STG-TICK-048)

  • Multi-Format Upload Support: The Bulk Importer (zinrelo.importer.wizard) natively accepts CSV (.csv), Excel (.xlsx), and ZIP (.zip) files for both ZN_DAILY_TRANSACTIONS exports and Pronto RR Reports (Whse Code, Store Description, Member ID, Card No, Trans Date, Cashier, Stock Code, Item Description, Points, Shipped Qty, Line cost, Type).
  • Pronto Transaction Code Classification (pronto_code):
  • PS (earn — Standard Points Earned): Standard 1x points earned on eligible retail purchases (1 PGK = 1 Point).
  • PB (bonus — Bonus / Double Points): Promotional double/bonus points (+1x bonus points paired with the 1x PS standard line on the same docket so PS + PB = 2x Double Points, or 2x directly if uploaded as a standalone PB line).
  • RD (redeem — Voucher Redemption Deductions): Negative points deducted for reward redemptions.
  • RF (return — Returned Items Deductions): Negative points deducted for merchandise returns/refunds.
  • Immediate Point Availability & Transaction Date Stamping:
  • Every imported ledger entry (real.rewards.loyalty.ledger) stamps transaction_date with the physical POS docket date (Trans Date / order_timestamp).
  • real_rewards.pending_clearance_days defaults to 0 so all imported Pronto POS points (PS and PB) are immediately credited to Available Points (loyalty_points_available) with Pending Points = 0.
  • Members List & Member Form Visibility:
  • The Members List (res.partner tree view) and Member Form (Card & Points Breakdown and KPI's) explicitly display Standard Points (PS), Bonus / Double Points (PB), Total Earned (PS+PB), Redeemed (RD), and Available Points.

4. Verification & Audit Checklist

Before signing off on daily ingestion, the ERP operator must verify: - [ ] In Configuration > Import History Logs, the latest batch shows Status = Success. - [ ] Number of Created orders matches the expected docket count from Pronto ERP. - [ ] If Skipped (Duplicates) is non-zero, verify whether the batch was a resubmission. - [ ] If Errors is greater than 0, inspect the Status Breakdown Report table to identify line-level syntax issues. - [ ] Sample 2 member cards in Members > Customers to confirm real-time loyalty point updates.