diff --git a/Program.fs b/Program.fs index 78d4b8d..8005f14 100644 --- a/Program.fs +++ b/Program.fs @@ -17,11 +17,14 @@ module Program = forward "/install" DredgePos.Installer.Router.router } - let app = application { - use_mime_types [(".woff", "application/font-woff")] - use_static "wwwroot" - use_router router - url "http://0.0.0.0:5001" - } + let app = + let ipAddress = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList[2]; + printf $"DredgePOS is now running at http://{ipAddress}:5001\n" + application { + use_mime_types [(".woff", "application/font-woff")] + use_static "wwwroot" + use_router router + url "http://0.0.0.0:5001" + } run app diff --git a/typescript/dredgepos.orderScreen.ts b/typescript/dredgepos.orderScreen.ts index 02a6bb6..77ea05a 100644 --- a/typescript/dredgepos.orderScreen.ts +++ b/typescript/dredgepos.orderScreen.ts @@ -123,7 +123,9 @@ const setItemQty = (orderItem: orderItem, qty: number) => { const instructionIds = getInstructionItems(orderItem.id).map(orderItem => orderItem.id) if(qty < 1){ - const newItems = OrderScreen.order_items.filter(existingOrderItem => existingOrderItem.id != orderItem.id) + const newItems = OrderScreen.order_items.filter(existingOrderItem => + (existingOrderItem.id != orderItem.id) && !instructionIds.includes(existingOrderItem.id) + ) OrderScreen.selected_item_ids = array_remove(OrderScreen.selected_item_ids, orderItem.id) if(orderItem.item.item_type == "item") { @@ -434,7 +436,7 @@ const voidLastItem = () => { decrementItemQty(OrderScreen.order_items.last()) } -const getSelectedTotals = () => +const getSelectedTotals = () => OrderScreen.selected_item_ids .map(selectedId => OrderScreen.order_items.find(orderItem => orderItem.id == selectedId)) .reduce((resultSoFar, currentOrderItem) => { @@ -459,13 +461,13 @@ const scrollToElement = (JQueryElement: JQuery) => { const element = JQueryElement.get()[0] const container = JQueryElement.closest('.orderBox').get()[0] const containerTop = $(container).scrollTop() - const containerBottom = containerTop + $(container).height(); + const containerBottom = containerTop + $(container).height() const elemTop = element.offsetTop - const elemBottom = elemTop + $(element).height(); + const elemBottom = elemTop + $(element).height() if (elemTop < containerTop) { - $(container).scrollTop(elemTop); + $(container).scrollTop(elemTop) } else if (elemBottom > containerBottom) { - $(container).scrollTop(elemBottom - $(container).height()); + $(container).scrollTop(elemBottom - $(container).height()) } }