diff --git a/doc/release-notes.rst b/doc/release-notes.rst index 0a8b3c3878..20f47fbed0 100644 --- a/doc/release-notes.rst +++ b/doc/release-notes.rst @@ -22,6 +22,9 @@ This release is scheduled for end Februari 2024. You can already check out a `pr - | Addition of the item *unit of measure* column in the `supply path screen `_. +- | Addition of hyperlinks in the network status widget to get detailed information + on the displayed numbers. + .. rubric:: Odoo integration - | 15, 16, 17: The mapping of calendars now includes the odoo identifier. diff --git a/freppledb/input/static/operationplandetail/src/networkstatusDrv.js b/freppledb/input/static/operationplandetail/src/networkstatusDrv.js index 98906245cd..f7d8439516 100644 --- a/freppledb/input/static/operationplandetail/src/networkstatusDrv.js +++ b/freppledb/input/static/operationplandetail/src/networkstatusDrv.js @@ -80,12 +80,51 @@ function shownetworkstatusDrv($window, gettextCatalog) { + "" + '' - + grid.formatNumber(thenetwork[3]) + '' - + grid.formatNumber(thenetwork[4]) + '' - + grid.formatNumber(thenetwork[5]) + '' - + grid.formatNumber(thenetwork[6]) + '' - + grid.formatNumber(thenetwork[7]) + '' - + grid.formatNumber(thenetwork[8]) + ''; + + grid.formatNumber(thenetwork[3]) + + '' + + grid.formatNumber(thenetwork[4]); + + if (thenetwork[4] > 0) { + rows += ""; + } + rows += '' + + grid.formatNumber(thenetwork[5]); + + if (thenetwork[5] != 0) { + rows += ""; + } + rows += '' + + grid.formatNumber(thenetwork[6]); + + if (thenetwork[6] > 0) { + rows += ""; + } + rows += '' + + grid.formatNumber(thenetwork[7]); + + if (thenetwork[7] > 0) { + rows += ""; + } + rows += '' + + grid.formatNumber(thenetwork[8]); + + if (thenetwork[8] > 0) { + rows += ""; + } + rows += ''; }); } } diff --git a/freppledb/input/views/utils.py b/freppledb/input/views/utils.py index 9808cb968d..df424b3c91 100644 --- a/freppledb/input/views/utils.py +++ b/freppledb/input/views/utils.py @@ -2109,7 +2109,7 @@ def getData(self, request): cursor.execute( """ with items as ( - select name from item where name = %s + select name from item where name = %%s ) select items.name, @@ -2120,7 +2120,8 @@ def getData(self, request): coalesce(orders_plus.DO, 0) - coalesce(orders_minus.DO, 0), orders_plus.MO, sales.BO, - sales.SO + sales.SO, + to_char(%%s,'%s HH24:MI:SS') as current_date from items cross join location left outer join ( @@ -2160,8 +2161,8 @@ def getData(self, request): on orders_minus.item_id = items.name and orders_minus.location_id = location.name left outer join ( select item_id, location_id, - sum(case when due < %s then quantity end) as BO, - sum(case when due >= %s then quantity end) as SO + sum(case when due < %%s then quantity end) as BO, + sum(case when due >= %%s then quantity end) as SO from demand inner join items on items.name = demand.item_id where status in ('open', 'quote') @@ -2176,13 +2177,15 @@ def getData(self, request): or orders_minus.DO is not null or sales.BO is not null or sales.SO is not null - or (items.name = %s and location.name = %s) + or (items.name = %%s and location.name = %%s) order by items.name, location.name - """, + """ + % (settings.DATE_FORMAT_JS,), ( opplan.item_id, current_date, current_date, + current_date, opplan.item_id, opplan.location_id, ), @@ -2200,6 +2203,7 @@ def getData(self, request): float(a[6] or 0), float(a[7] or 0), float(a[8] or 0), + a[9], ] )