partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit fe156591cb0a3b38b9a2df474bd9e76b8b1197fd
parent 7d6837ec6d6441414fb2711c803f70557981223f
Author: Felicitus <felicitus@felicitus.org>
Date:   Mon,  2 Jan 2012 00:23:33 +0100

Added storage location in the stock history grid and changed the default field order

Diffstat:
Msrc/backend/de/RaumZeitLabor/PartKeepr/Stock/StockManager.php | 4++++
Msrc/frontend/js/Components/StockReport/AbstractStockHistoryGrid.js | 3++-
Msrc/frontend/js/Components/StockReport/StockHistoryGrid.js | 9++++++++-
Msrc/frontend/js/Models/StockEntry.js | 1+
4 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/backend/de/RaumZeitLabor/PartKeepr/Stock/StockManager.php b/src/backend/de/RaumZeitLabor/PartKeepr/Stock/StockManager.php @@ -52,6 +52,10 @@ class StockManager extends AbstractManager { case "q.direction": $filter->setSortField("q.dateTime"); break; + case "q.storageLocation_name": + $qb->join("q.part", "p")->join("p.storageLocation", "st"); + $filter->setSortField("st.name"); + break; } } } \ No newline at end of file diff --git a/src/frontend/js/Components/StockReport/AbstractStockHistoryGrid.js b/src/frontend/js/Components/StockReport/AbstractStockHistoryGrid.js @@ -21,6 +21,7 @@ Ext.define('PartKeepr.AbstractStockHistoryGrid', { }, width: 20 }, + {header: i18n("Date"), dataIndex: 'dateTime', width: 120}, { header: i18n("User"), dataIndex: 'user_id', @@ -38,7 +39,7 @@ Ext.define('PartKeepr.AbstractStockHistoryGrid', { xtype:'numberfield', allowBlank:false }}, - {header: i18n("Date"), dataIndex: 'dateTime', width: 120}, + { header: i18n("Price"), editor: { diff --git a/src/frontend/js/Components/StockReport/StockHistoryGrid.js b/src/frontend/js/Components/StockReport/StockHistoryGrid.js @@ -10,12 +10,19 @@ Ext.define('PartKeepr.StockHistoryGrid', { defineColumns: function () { this.callParent(); - this.columns.splice(1, 0, { + this.columns.splice(2, 0, { header: i18n("Part"), dataIndex: 'part_name', flex: 1, minWidth: 200 }); + + this.columns.splice(3, 0, { + header: i18n("Storage Location"), + dataIndex: 'storageLocation_name', + flex: 1, + minWidth: 200 + }); }, initComponent: function () { this.callParent(); diff --git a/src/frontend/js/Models/StockEntry.js b/src/frontend/js/Models/StockEntry.js @@ -6,6 +6,7 @@ Ext.define("PartKeepr.StockEntry", { { name: 'user_id', type: 'int'}, { name: 'dateTime', type: 'datetime'}, { name: 'stockLevel', type: 'int'}, + { name: 'storageLocation_name', type: 'string'}, { name: 'direction', type: 'string'}, { name: 'part_name', type: 'string'}, { name: 'price', type: 'float'}