Orders
Order routes power the customer profile Orders List tab (orders_for_cust + order custom fields + all_status type=order_status). This is NOT Documents.List with type=detail_orders (Detail orders tab) and NOT the global dashboard/order report.
Orders List Data
- Rows live in orders_for_cust joined to catalog orders (product name). Order Number in the UI is usually orders_for_cust.id.
- Custom columns such as ORDER SELECT are keys like order-1731… stored in orders_for_cust.custom_fields JSON (definitions in user_detail.order_custom_fields).
- Order Status dropdown options come from all_status where type=order_status. Use Order.Statuses or Statuses.List with type=order_status.
- Visible columns follow user_detail.order_fields_on_dashboard (Order.Fields / Order.List columns).
CRUD And Status
- Order.List / Count: cust_id = customer-wise (profile Orders List); order_id = catalog orders.id for order-wise list (dashboard order report). Both optional together; at least one required.
- Order.Get / FormData load one row for the edit modal.
- Order.Add / Edit match dashboard setting/orders_for_cust. Send catalog order_id (product), cust_id, price/total_price/notes/order_status, plus order-* custom keys or custom_fields JSON.
- Order.Status matches expences/update_order_status (orders_for_cust_id + order_val).
- Order.Delete only allows unpaid rows (paid_status=0), same as dashboard.
- Order.Catalog / Products lists without_date catalog products for the add modal.
Common Flow
- Order.Fields + Order.Statuses + Order.Catalog to build filters and add/edit forms.
- Order.List with cust_id for customer Orders List, or order_id for order-wise list across customers.
- Order.Add / Edit / Status / Delete for row actions; refresh Order.List after success.