Renders a list of delivery visit cards with inline action buttons, a reschedule modal, and a completion modal that supports photo capture, signature drawing, and item selection.
VisitCard — set as ReportType in def_report.
def Render(self, Param1="", Param2="", Param3="") -> str:
No parameters are used. Visit data is read from self.data_list using FieldLookup to resolve column indices. Expected columns: visit_id, customer_name, address, scheduled_time, status, type, with optional phone and sequence.
Returns an HTML fragment containing one Bootstrap card per visit, two modal dialogs (reschedule and complete), and the JavaScript to drive them.
RpcUpdatevisitstatus(data)Updates a delivery's status by joining data_delivery to list_delivery_status on the provided new_status code. Sets completed_at automatically when status is COMPLETED. Input: {visit_id, new_status}.
RpcReschedule(data)Updates data_delivery with a new date, from-time, and to-time, and sets the status to RESCHEDULED. Validates that from-time is before to-time. Input: {visit_id, scheduled_date, scheduled_from, scheduled_to}.
RpcDeliveryitems(data)Returns undelivered items for a delivery from data_delivery_item. Input: {visit_id}. Output: {ok, items: [{id, code, name, delivered}]}.
RpcComplete(data)Saves an optional customer photo and recipient signature to disk (under UPLOAD_ROOT), records attachment rows in data_attachment, marks the selected item IDs as delivered in data_delivery_item, and sets the delivery status to COMPLETED. Input: {visit_id, delivered_item_ids, photo_data_url, signature_data_url}.
Options read from self._Options JSON.
| Key | Effect |
|---|---|
status_reportcode |
Report code of an ObjReportStatusPill instance used to render the status badge; if omitted, a plain <span class="badge"> is used |
on_change |
"reload" (default) reloads the page after a successful action; "none" closes the modal only |
actions |
List of action button labels to show on each card (default: ["En_Route","Arrived","Completed","Failed","Rescheduled"]). "Rescheduled" opens the reschedule modal; "Completed" opens the completion modal; all others call RpcUpdatevisitstatus directly |
axion.rpc.js.UPLOAD_ROOT (default: /root/axion/local.documents/pakkie.data), sharded into two-level subdirectories by SHA-256 hash prefix.list_attachment_type with codes DELIVERY_CUSTOMER_PHOTO and DELIVERY_RECIPIENT_SIGNATURE; hard-coded fallbacks of 1 and 2 apply if the table lookup fails.<canvas> element with mouse and touch event listeners; the signature is captured as PNG via toDataURL.pakkie.data schema (DATA_SCHEMA).