diff --git a/scripts/document_gen/templates/mcs150_pdf_filler.py b/scripts/document_gen/templates/mcs150_pdf_filler.py index 89da166..f3a2cdb 100644 --- a/scripts/document_gen/templates/mcs150_pdf_filler.py +++ b/scripts/document_gen/templates/mcs150_pdf_filler.py @@ -319,6 +319,11 @@ def fill_mcs150(intake: dict, order_number: str = "") -> str: intake.get("primary_vehicle_type", "straight"), "straight") if power_units not in (None, ""): field_updates[f"{prefix}Own"] = str(power_units) + # Simple intake also collects a flat trailer count (no owned/leased + # breakdown). Default trailers to the Owned column of the trailer row. + trailers = intake.get("trailers", "") + if trailers not in (None, "", 0, "0"): + field_updates["trailerOwn"] = str(trailers) # Non-CMV count, if provided. if intake.get("non_cmv_vehicles") not in (None, ""): diff --git a/scripts/workers/services/mcs150_update.py b/scripts/workers/services/mcs150_update.py index 319b76d..e17f8a9 100644 --- a/scripts/workers/services/mcs150_update.py +++ b/scripts/workers/services/mcs150_update.py @@ -200,7 +200,7 @@ class MCS150UpdateHandler: missing = self._missing_intake_fields(slug, intake) if missing and not client_approved and not admin_approved: self._request_intake_completion( - order_number, entity_name, customer_email, dot_number, missing) + order_number, entity_name, customer_email, dot_number, missing, slug) LOG.info("[%s] Held for customer intake completion; missing=%s", order_number, missing) return [] @@ -222,7 +222,7 @@ class MCS150UpdateHandler: self._persist_intake(order_number, intake) self._set_fulfillment_status(order_number, "awaiting_intake") self._request_intake_completion( - order_number, entity_name, customer_email, dot_number, missing) + order_number, entity_name, customer_email, dot_number, missing, slug) LOG.info("[%s] Admin-assisted %s held for intake; missing=%s", order_number, slug, missing) return [] @@ -521,11 +521,17 @@ class MCS150UpdateHandler: return missing def _request_intake_completion(self, order_number, entity_name, - customer_email, dot_number, missing): + customer_email, dot_number, missing, slug=None): """Email the customer a census-pre-filled intake link and create a low-priority admin todo noting we're waiting on intake completion.""" domain = os.environ.get("PUBLIC_SITE_URL", "https://performancewest.net").rstrip("/") - intake_url = f"{domain}/order/dot-compliance?order={order_number}" + # Link to the per-service intake WIZARD (/order/?order=...), which + # loads the existing paid order, pre-fills it from the FMCSA census, and + # drops the payment step. Do NOT link to /order/dot-compliance -- that is + # the sales/checkout page; it ignores ?order= and asks the customer to + # re-select services and pay again (they can't "enter any data" there). + intake_slug = slug or self.SERVICE_SLUG + intake_url = f"{domain}/order/{intake_slug}?order={order_number}" # Customer email (no paper/mail mechanics; public form names are fine). try: diff --git a/site/src/components/intake/steps/DOTIntakeStep.astro b/site/src/components/intake/steps/DOTIntakeStep.astro index d385a83..c9641fd 100644 --- a/site/src/components/intake/steps/DOTIntakeStep.astro +++ b/site/src/components/intake/steps/DOTIntakeStep.astro @@ -102,8 +102,12 @@
+ +
+
@@ -441,6 +445,7 @@ "dot-entity-type": d.entity_type || "", "dot-carrier-op": d.carrier_operation || "", "dot-interstate": d.interstate_intrastate || "", "dot-hazmat": d.hazmat || "", "dot-power-units": d.power_units || "", "dot-drivers": d.drivers || "", + "dot-trailers": d.trailers || "", "dot-miles": d.annual_miles || "", "dot-signer-name": d.signer_name || "", "dot-signer-title": d.signer_title || "", "dot-cdl-drivers": d.cdl_drivers || "", "dot-owner-ops": d.owner_operators || "0", "dot-der-name": d.der_name || "", @@ -508,6 +513,7 @@ entity_type: val("dot-entity-type"), carrier_operation: val("dot-carrier-op"), interstate_intrastate: val("dot-interstate"), hazmat: val("dot-hazmat"), power_units: val("dot-power-units"), drivers: val("dot-drivers"), + trailers: val("dot-trailers"), annual_miles: val("dot-miles"), cargo_types: cargoTypes, signer_name: val("dot-signer-name"), signer_title: val("dot-signer-title"), fleet_size_bracket: val("dot-ucr-bracket"), base_state: val("dot-ucr-state"),