Synthesizes Harleys_China_Import_Operating_Pack_v1.xlsx (9 sheets, 37 lifecycle steps, 8 Golden Control Rules, 28-row Landed Cost engine) + /Users/srinivas/Desktop/harleys-imports (492 unit tests, E1–E7 DB invariants) into the Consolidated :8000 OneOps/HOP Master App.
HARLEY'S® 1983 · ONEOPS👑 FINE BAKINGImport File: IMP-CHN-26-0042 (Jubilee Hills NSO + Central Kitchen)
3 Vendors Quoted · Indicative FX: 1 CNY = ₹11.90
• Item: 3-Deck Artisan Patisserie Oven (三层法式烘焙炉)
• Photos: 3/3 Approved (Front, Side/Detail, Finish)
• Critical Dims: 1820×1240×1680 mm (±2 mm)
• Material: SUS304 1.5mm Brushed + Gold Crown Logo
• Electrical: 380V 3-Phase 50Hz · CE Cert Attached
Spec Version v2 frozen by Product Approver (distinct from Buyer Requestor). Ready to convert Quote -> Draft PO.
Enforces Golden Rules #1 and #2 from Harleys_China_Import_Operating_Pack_v1.xlsx and Slices L1 / L1b / C-QTOPO from harleys-imports:
| Control / Table | Rule & Database Enforcement |
|---|---|
import_files & rfq_requests | Every import begins with canonical IMP-CHN-YY-####. Quotes normalized with indicative FX (USD>CNY, CNY>INR keyed per pair per FIX-QA-RFQ). |
item_spec_versions & item_image_versions | Stores English + Chinese descriptions, 8 dimensional tolerances (mm), 11 material/finish/logo fields, and 3 mandatory reference photo roles (main, view, finish). Frozen at insert (E4 enforce_frozen_version) and approved by an independent reviewer (E1). |
POST /api/po/from-quote (IM-11) | Converting an RFQ quote to a PO automatically attaches the item's approved image versions (preserving SHA-256 storage keys) and links po_line_quote_refs. |
HARLEY'S® 1983 · ONEOPS👑 FINE BAKINGVendor: Guangzhou BakeTech Equipment Co., Ltd. (广州烘焙设备有限公司)
Total FOB Guangzhou: CNY 240,000 (₹28,56,000)
Tranches (E7 Sum=100%): T1 30% (72,000) · T2 50% (120,000) · T3 20% (48,000)
Vendor submitted new bank account ending ••8841 (was ••3109).
DB Trigger on_revision_event_bank(): Automatically flipped T1 Advance Request to HELD!
Finance Checker must independently verify beneficiary SWIFT + callback proof before releasing T1 Advance. Preparer is blocked (403 same_person).
Enforces Golden Rule #4 ("NO beneficiary-bank verification = NO payment") and Golden Rule #5 / E3 (One True Value):
| Control / Table | Rule & Database Enforcement |
|---|---|
Two PO Views & Deterministic PDF (IM-12) | 1) Commercial/Internal Tracker View (tranches, INR exposure, production readiness) and 2) Printable Bilingual Supplier PO PDF rendered via headless Chromium with embedded Noto Sans SC + Public Sans fonts and immutable po_documents.sha256. |
One-True-Value Schema Guard (E3) | po_lines has a single unit_price and generated line_total. Schema test rejects any column matching /declared|books|under_inv|inflat|indirect/. |
Bank-Change Hold Trigger (A09) | bank_account_versions requires verified_by <> created_by (E1). Any new bank version fires fund_on_bank_change, holding open tranches and raising a critical flag until Finance Checker revalidates. |
HARLEY'S® 1983 · ONEOPS👑 FINE BAKING• Pre-Production (6/6): PASS (SUS304 sheet & Pantone verified)
• Inline QC (6/6): PASS (Thermostat & weld seams checked)
• Final QC (6/6): Ordered 10 · Inspected 10 · Passed 9 · Failed 1
• Packing QC (6/6): Fumigated crate + corner foam + marks OK
1 unit failed functional heating test -> Held for rework (qc_dispositions). Shortfall flagged at 100% sensitivity (blank extra % = no over-qty flag).
qc_ok=true · packing_checked=true · qty_date_verified=true · compliance_ok=true. Unlocks proportional T2 Balance Payment.
Enforces Golden Rule #3 ("NO QC PASS + packing approval = NO balance payment"):
| Control / Table | Rule & Database Enforcement |
|---|---|
production_batches & qc_inspections | Separates supplier_reported_ready_date from verified_ready_date. Enforces passed_qty + failed_qty <= batch.qty against the PO's frozen spec_version_id. |
qc_dispositions & concessions | Failed units require independent disposition (rework, reinspect, concession, reject). SQL constraint CHECK (NOT waives_legal_requirement) makes waiving BIS/FSSAI/statutory compliance impossible. |
IM-11 QC Defaults | Any quantity shortfall vs PO is flagged at 100%; blank extra-quantity tolerance raises no false flag. |
HARLEY'S® 1983 · ONEOPS👑 FINE BAKINGConsolidated 3 Vendors (BakeTech Ovens + Packaging Boxes + Cafe Chairs)
Used: 64.2 CBM (95.8% Fill) · Gross: 14,820 kg
CBM/Weight Variance vs PO: +0.3% (Within IM-08 ±0.5% tolerance!)
1. Youhetong Logistics: ₹3,42,000 (18 days · 14 Free Days) ⭐
2. SinoIndia Freight: ₹3,68,500 (21 days · 7 Free Days)
3. Pearl River Cargo: ₹3,59,000 (19 days · 10 Free Days)
Signed off by Imports Lead (SHA-256 plan hash locked). Any post-signoff line change raises container_plan_changed.
Implements Sheet 06_Shipment_Control Section B and SHIP-PLAN / IM-08 / IM-09:
| Control / Table | Rule & Database Enforcement |
|---|---|
shipment_reservations (E2) | Advisory lock pg_advisory_xact_lock(hashtext('po_line:'||id)) ensures SUM(reserved_qty) <= ready_qty across concurrent planners—zero double-booking across containers. |
| CBM Fill & Capacity Engine | Calculates fill % across 20GP (33 CBM), 40GP (67 CBM), 40HQ (76 CBM), LCL W/M, and Air Chargeable kg. |
| 6-Component Freight Comparison | Compares Pickup/Origin, Main Ocean/Air Freight, Insurance, India Destination/DO/CFS/Liner, CHA/Port, and Hyderabad Inland Delivery + Free Detention Days. Approval creates a freight_selection obligation in Fund Flow. |
HARLEY'S® 1983 · ONEOPS👑 FINE BAKING• Final CI & PL: Matched to PO (CNY 240,000 · 148 Cartons)
• HS-6 Prefix Check (IM-08): 8417.20 matches across PO, CI & Draft B/L
• CBM / Weight Check (IM-08): 0.32% diff (≤ 0.5% limit)
• Cert of Origin & CE/Manuals: Verified & attached
1. Empty clean container ✓ · 2. Container No. MSCU8492014 ✓
3. First layer ✓ · 4. 50% loaded ✓ · 5. 100% loaded ✓
6. Right door closed & Seal CN-994812 locked ✓
Enforces Golden Rules #5 and #6 from 06_Shipment_Control:
| Control / Table | Rule & Database Enforcement |
|---|---|
Bilingual OCR + AI Extraction (docservice) | Extracts fields from PDF/XLSX/Scanned Commercial Invoices and Packing Lists using local pdfjs-dist + tesseract.js (eng + chi_sim) with optional Claude Haiku 4.5 fallback (capped at $0.50/day; never auto-accepted without human confirmation). |
IM-08 Automated Tolerance Checks | Verifies 6-digit HS prefix consistency across PO/CI/PL/BL and enforces ≤ 0.5% CBM and Gross Weight tolerance before dispatch release. |
| 6-Stage Loading Photo Checklist | Requires timestamped photos of (1) Empty interior, (2) Container number plate, (3) First tier, (4) 50% load, (5) 100% tail-load, and (6) Locked seal number matching the Bill of Lading. |
HARLEY'S® 1983 · ONEOPS👑 FINE BAKINGAssessable CIF Value: ₹30,18,400 (Not a cash cost)
• BCD (10%): ₹3,01,840 · SWS (10% of BCD): ₹30,184
• AIDC / ADD: ₹0 · IGST Base: ₹33,50,424
• Import IGST (18%): ₹6,03,076 (Recoverable Input Credit)
Mapped Executed Remittances TT-2026-101 (30%) + TT-2026-118 (70%) = CNY 240,000 to BOE #7849201.
Remaining Unmatched BOE Value: CNY 0.00 (IDPMS Bank Submission Ready).
Duty paid & OOC PDF uploaded before free-days expiry (0 ₹ demurrage).
Enforces 07_Receiving_Landed_Cost customs formulas and RBI/FEMA bank-matching controls:
| Control / Table | Rule & Database Enforcement |
|---|---|
boes & boe_lines (E3) | Trigger verifies boe_lines.invoice_value = qty * po_lines.unit_price. Assessable CIF value is stored strictly as a customs calculation base, never added to cash outflow. |
remittance_boe_mappings (E2 + E6) | Many-to-many mapping between executed bank remittances and BOEs with dual-cap advisory locks (SUM(mapped) <= remitted_amount and <= boe_invoice_value). |
RBI IDPMS / Bank Knock-Off (A15) | Separates internal BOE matching from Bank Submission and Bank-Confirmed IDPMS Closure (cannot mark compliance closed until external bank evidence is attached). |
HARLEY'S® 1983 · ONEOPS👑 FINE BAKINGContainer MSCU8492014 · Seal CN-994812 matches B/L ✓
Seal intact photo + Unloading video attached ✓
• Expected: 148 Cartons
• Received: 148 Cartons (Accepted: 146 · Damaged: 2 · Quarantined: 0 · Short: 0)
2 Acrylic Box cartons crushed in transit (¥1,840).
Disposition by Independent Approver: CLAIM CREATED (CLM-2026-09) -> Posted to Vendor Ledger for credit note.
Enforces Golden Rule #7 and links physical receiving to the Enterprise Audit Engine (App 3.5):
| Control / Table | Rule & Database Enforcement |
|---|---|
grns & grn_lines | Enforces CHECK (accepted_qty + quarantined_qty + damaged_qty = received_qty) and generated short_qty = GREATEST(expected_qty - received_qty, 0). |
grn_discrepancies & claims | Discrepancy rows are undeletable. Resolving with disposition='claim' requires a linked claim_id (shortage, damage, quality) and independent reviewer sign-off (E1). |
Integration with App 3.5 Audit Engine | Container arrival at Central Warehouse / NSO Cafe site automatically triggers a T4 High-Value Delivery Spot-Check Mission in audit_missions. |
HARLEY'S® 1983 · ONEOPS👑 FINE BAKING• 1. Cash Cost (Incl. GST): ₹42,18,400
• 2. Recoverable IGST + Service GST: -₹6,41,876
• 3. Accounting Acquisition Cost (Ex-GST): ₹35,76,524
• Unit Landed Cost (Deck Oven): ₹2,98,043 / unit (1.25x FOB)
• Physical Closure: CLOSED (148/148 accounted + Claim linked) ✓
• Financial Closure: CLOSED (All tranches, BOE & CHA reconciled) ✓
• Compliance Closure: CLOSED (IDPMS Bank Knock-Off verified) ✓
Capitalized 9 Deck Ovens directly into App 2 Cafe Projects BOQ & minted AST-2041..2049 QR tags in App 3 Fixed Assets!
Completes the financial, physical, and compliance loop across the Harley's Enterprise Spine:
| Control / Table | Rule & Database Enforcement |
|---|---|
| 28-Row Landed Cost Formula Engine | Computes Product Cost INR = FCY * FX, CIF Assessable = Product + Freight + Insurance, BCD = CIF * BCD%, SWS = BCD * 10%, IGST = (CIF + BCD + SWS + AIDC + ADD) * IGST%, plus Ex-GST CFS/Liner/DO, CHA, and Hyderabad Transport. |
Late Cost Versioning (A14) | If a late detention or CHA invoice arrives after closure, cost_items inserts a new version, supersedes the provisional estimate without double-counting, and automatically reopens Financial Closure. |
Master-App Convergence (IM-15) | Adapters in src/platform/{identity,people,notifications}.js bridge Imports into hop.people SSO, s3_document_assets, accountability_nudges, cafe_projects CapEx BOQ, and fixed_assets WDV ledger. |