QR Code Document Retrieval Guide (Invoices & Estimates)
The SierraBooks application supports instant document retrieval and presentation via dynamically generated QR codes printed on physical or digital PDF invoices and estimates.
Scanning a document’s QR code bypasses manual search menus, pulling the live database record straight from Firestore and presenting it to the operator instantly.
How It Works
Each printed Invoice and Estimate document has a unique, high-resolution QR code rendered directly into the footer area.
+---------------------------------------+
| SIERRA BOOKS |
| |
| Invoice ID: #INV-928475 |
| |
| [ QR CODE ] <-- Scan to View Live |
| |
+---------------------------------------+
When an operator scans this QR code using a smartphone camera or an external scanner:
-
URL Decoded: The scanner parses the embedded deep-link:
Invoices:
https://sierrabooks.page.link/view/invoice/<invoiceId>Estimates:
https://sierrabooks.page.link/view/estimate/<estimateId>
App Interception: The SierraBooks Flutter application intercepts the incoming OS routing event via the centralized Dynamic Link Handler (
main_dynamic_links.dart).Firestore Synchronization: The app contacts Cloud Firestore to load the raw document schema in real-time, verifying its existence.
Instant View/Edit Presentation: The app opens the live view immediately, pushing
Glob.EditInvoicePageorGlob.EditEstimatePageonto the navigation stack with full edit capabilities.Analytics Recorded: A custom
processed_qr_codetracking event is sent to Firebase Analytics for business telemetry.
Generating QR Codes on Documents
QR codes are generated dynamically at the PDF compilation stage using the embedded PDF generator layout engine.
For Invoices (create_pdf_invoice.dart) and Estimates (create_pdf_estimate.dart), the QR code is compiled using the following PDF widget structure:
// --- PAY / VIEW QR CODE ---
pw.Container(
width: 60,
height: 60,
child: pw.BarcodeWidget(
barcode: pw.Barcode.qrCode(),
data: 'https://sierrabooks.page.link/view/invoice/${invoice.id}',
drawText: false,
),
)
Step-by-Step Operator Guide
Follow these simple steps to retrieve a document live:
Locate the Code: Find the square QR Code located in the bottom footer of any printed or PDF document.
Scan: Open the native iOS or Android camera app and point it at the QR code.
App Direct Launch: Tap the banner notification that appears on the screen (e.g., “Open in SierraBooks”).
Instant Editing: The app will automatically wake up, synchronize with the backend, and load the live invoice/estimate details immediately without requiring any search queries or manual entry.
Analytics & Telemetry
Every successful QR scan records a custom tracking event to measure engagement and operational speed.
The custom processed_qr_code event tracks the following parameters:
Parameter Name |
Data Type |
Description |
|---|---|---|
|
String |
Indicates if the scanned code belonged to an |
|
String |
The unique Firestore document ID retrieved. |
|
String |
The complete parsed URL of the dynamic deep link. |