From 498bb7cbc0e0d3a657df2f59b52f6d3696bb7c9e Mon Sep 17 00:00:00 2001 From: dharaneesh-r Date: Thu, 13 Aug 2026 12:26:22 +0530 Subject: [PATCH] updates on the createorder page and preview page as well --- src/pages/nearle/dispatch/Preview.js | 29 +++++++++++++-- src/pages/nearle/orders/createorder1.js | 47 ++++++++++++++----------- 2 files changed, 54 insertions(+), 22 deletions(-) diff --git a/src/pages/nearle/dispatch/Preview.js b/src/pages/nearle/dispatch/Preview.js index 9558008..9dcc977 100644 --- a/src/pages/nearle/dispatch/Preview.js +++ b/src/pages/nearle/dispatch/Preview.js @@ -664,7 +664,27 @@ const Preview = () => { }; return ( - + // Mirrors Dispatch.css's `.dispatch-container` sizing exactly (this page + // embeds that same component below) — MainLayout's `.main-content-area` + // has 24px left/right/bottom padding and no padding-top (AppTopNav sits + // above it in normal flow), and exposes its own measured height via the + // --appshell-header-height CSS var. A bare `height: '100vh'` here (the + // previous value) doesn't subtract the top nav's height or cancel the + // surrounding padding, so the page's real content was taller than the + // visible viewport by roughly the nav height + padding — turning the + // whole page (not just the intended internal panels) into a scroll + // container, which dragged the rider sidebar along with it instead of + // it staying in place. + theme.zIndex.modal + 1 }} open={isLoading} @@ -742,7 +762,12 @@ const Preview = () => { - + {/* minHeight: 0 overrides the flex-item default of min-height: auto — + without it, this flex:1 child can grow past its allotted space to + fit its content's natural height instead of clipping to it, which + is what let the embedded Dispatch view (and its internal + overflow-y:auto sidebar) overflow into page-level scroll. */} + {tabValue === 0 && dispatchPreviewData && ( { const [stafflist, setStafflist] = useState([]); const [loading2, setLoading2] = useState(false); const [loading, setLoading] = useState(false); - const [btnLoading, setBtnLoading] = useState(false); const [shiftarr, setShiftarr] = useState([]); const [shiftarr1, setShiftarr1] = useState([]); const [orderarr, setOrderarr] = useState([]); @@ -595,13 +594,18 @@ const Createorder1 = () => { service_option: 'Normal', finalprice: +totalCharge.toFixed(2) || 0, notes: otherinstructions || '', - parcels: [ - { - itemcategory: category || 'General', - itemdescription: 'Order', - declaredvalue: +totalCharge.toFixed(2) || 0 - } - ] + // The parcel object has no numeric quantity field (confirmed against + // express-console-api.md's schema) — "N items" is expressed by sending + // N parcel entries, which is also how the Deliveries page already reads + // it back (fetchDeliveries in api.js: `Quantity: b.parcels?.length`). + // This previously always sent exactly one parcel regardless of what the + // operator typed into the Quantity field, so it silently got dropped — + // matching "I entered 5, deliveries page shows 1". + parcels: Array.from({ length: Math.max(1, Number(quantity) || 1) }, () => ({ + itemcategory: category || 'General', + itemdescription: 'Order', + declaredvalue: +totalCharge.toFixed(2) || 0 + })) }; if (!arr.tenantid) { opentoast('Pick a tenant before creating an order', 'warning', 2000); @@ -2218,18 +2222,21 @@ const Createorder1 = () => { )}