Skip to content

Commit 57d65d0

Browse files
authored
Merge pull request #156 from LabKey/fb_merge_22.11_to_develop
Merge discvr-22.11 to develop
2 parents ff035ae + 8843536 commit 57d65d0

File tree

49 files changed

+2699
-2620
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2699
-2620
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Location
2+
Office
3+
Bench
4+
Fridge
5+
Mini-Freezer
6+
Main -20 Freezer
7+
-80 Freezer
8+
LN2
9+
Cabinets/Stocks

LabPurchasing/resources/data/referenceItems.tsv

Lines changed: 1853 additions & 2484 deletions
Large diffs are not rendered by default.

LabPurchasing/resources/queries/labpurchasing/duplicateReferenceItems.sql

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ SELECT
1414

1515
FROM labpurchasing.referenceItems r1
1616
JOIN labpurchasing.referenceItems r2 ON (
17+
r1.rowId != r2.rowId AND
1718
r1.itemNumber = r2.itemNumber and
1819
r1.vendorId = r2.vendorId
1920
)
20-
WHERE (
21-
r1.itemName != r2.itemName OR
22-
r1.units != r2.units OR
23-
r1.unitCost != r2.unitCost
24-
) AND r1.itemNumber NOT IN ('NA', '1')
21+
22+
WHERE r1.itemNumber NOT IN ('NA', '1')
2523

2624
GROUP BY r1.rowId, r1.vendorId, r1.itemNumber, r1.itemName, r1.units, r1.unitCost
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
2+
<columns>
3+
<column name="rowId"/>
4+
<column name="vendorId"/>
5+
<column name="itemName"/>
6+
<column name="itemNumber"/>
7+
<column name="units"/>
8+
<column name="quantity"/>
9+
<column name="unitCost"/>
10+
</columns>
11+
<sorts>
12+
<sort column="vendorId/vendorName"/>
13+
<sort column="itemName"/>
14+
<sort column="itemNumber"/>
15+
</sorts>
16+
</customView>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ALTER TABLE labpurchasing.purchases ADD purchaseOrder varchar(1000);
2+
3+
CREATE TABLE labpurchasing.purchasingLocations (
4+
rowId serial,
5+
6+
location varchar(4000),
7+
8+
container entityid,
9+
created timestamp,
10+
modified timestamp,
11+
createdBy int,
12+
modifiedBy int,
13+
14+
CONSTRAINT PK_purchasingLocations PRIMARY KEY (rowid)
15+
);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ALTER TABLE labpurchasing.purchases ADD purchaseOrder varchar(1000);
2+
3+
CREATE TABLE labpurchasing.purchasingLocations (
4+
rowId int identity(1,1),
5+
6+
location varchar(4000),
7+
8+
container entityid,
9+
created datetime,
10+
modified datetime,
11+
createdBy int,
12+
modifiedBy int,
13+
14+
CONSTRAINT PK_purchasingLocations PRIMARY KEY (rowid)
15+
);

LabPurchasing/resources/schemas/labpurchasing.xml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
<isHidden>true</isHidden>
9292
</column>
9393
<column columnName="orderNumber">
94-
<columnTitle>Order Number</columnTitle>
94+
<columnTitle>Requisition/Order #</columnTitle>
9595
</column>
9696
<column columnName="orderedBy">
9797
<columnTitle>Ordered By</columnTitle>
@@ -101,6 +101,10 @@
101101
<columnTitle>Order Date</columnTitle>
102102
<formatString>Date</formatString>
103103
</column>
104+
<column columnName="purchaseOrder">
105+
<columnTitle>PO #</columnTitle>
106+
<inputType>textfield</inputType>
107+
</column>
104108
<column columnName="receivedBy">
105109
<columnTitle>Received By</columnTitle>
106110
<inputType>textfield</inputType>
@@ -112,6 +116,12 @@
112116
<column columnName="itemLocation">
113117
<columnTitle>Item Location</columnTitle>
114118
<inputType>textfield</inputType>
119+
<fk>
120+
<fkDbSchema>labpurchasing</fkDbSchema>
121+
<fkTable>locations</fkTable>
122+
<fkColumnName>location</fkColumnName>
123+
<fkDisplayColumnName useRawValue="true" />
124+
</fk>
115125
</column>
116126
<column columnName="invoiceNumber">
117127
<columnTitle>Invoice Number</columnTitle>
@@ -379,6 +389,45 @@
379389
<inputType>textfield</inputType>
380390
</column>
381391

392+
<column columnName="container">
393+
<isHidden>true</isHidden>
394+
</column>
395+
<column columnName="createdby">
396+
<isHidden>true</isHidden>
397+
</column>
398+
<column columnName="created">
399+
<isUserEditable>false</isUserEditable>
400+
<shownInInsertView>false</shownInInsertView>
401+
<shownInUpdateView>false</shownInUpdateView>
402+
<nullable>true</nullable>
403+
<isHidden>true</isHidden>
404+
</column>
405+
<column columnName="modifiedby">
406+
<isHidden>true</isHidden>
407+
</column>
408+
<column columnName="modified">
409+
<isUserEditable>false</isUserEditable>
410+
<shownInInsertView>false</shownInInsertView>
411+
<shownInUpdateView>false</shownInUpdateView>
412+
<nullable>true</nullable>
413+
<isHidden>true</isHidden>
414+
</column>
415+
</columns>
416+
</table>
417+
<table tableName="purchasingLocations" tableDbType="TABLE">
418+
<javaCustomizer class="org.labkey.ldk.query.DefaultTableCustomizer" />
419+
<tableTitle>Item Locations</tableTitle>
420+
<auditLogging>DETAILED</auditLogging>
421+
<columns>
422+
<column columnName="rowId">
423+
<nullable>false</nullable>
424+
</column>
425+
<column columnName="location">
426+
<columnTitle>Location</columnTitle>
427+
<nullable>false</nullable>
428+
<inputType>textfield</inputType>
429+
</column>
430+
382431
<column columnName="container">
383432
<isHidden>true</isHidden>
384433
</column>

LabPurchasing/resources/views/begin.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@
4343
},{
4444
name: 'Manage Vendors',
4545
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {schemaName: 'labpurchasing', queryName: 'vendors'})
46+
},{
47+
name: 'Manage Units',
48+
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {schemaName: 'labpurchasing', queryName: 'purchasingUnits'})
49+
},{
50+
name: 'Manage Locations',
51+
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {schemaName: 'labpurchasing', queryName: 'purchasingLocations'})
4652
},{
4753
name: 'Manage Reference Items',
4854
url: LABKEY.ActionURL.buildURL('labpurchasing', 'manageReferenceItems.view')

LabPurchasing/resources/views/populateData.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@
151151
schemaName: 'labpurchasing',
152152
queryName: 'purchasingUnits',
153153
pk: 'rowid'
154+
}, {
155+
label: 'Locations',
156+
populateFn: 'populateFromFile',
157+
moduleName: 'labpurchasing',
158+
schemaName: 'labpurchasing',
159+
queryName: 'purchasingLocations',
160+
pk: 'rowid'
154161
},{
155162
label: 'Reference Items',
156163
populateFn: 'populateFromFile',

LabPurchasing/resources/web/labpurchasing/panel/OrderItemsGrid.js

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Ext4.define('LabPurchasing.panel.OrderItemsGrid', {
88
Ext4.apply(this, {
99
border: true,
1010
minHeight: 300,
11-
width: '100%',
11+
//width: '100%',
1212
xtype: 'ldk-gridpanel',
1313
clicksToEdit: 1,
1414
// This causes the editor plugin to begin on the vendor column
@@ -27,7 +27,7 @@ Ext4.define('LabPurchasing.panel.OrderItemsGrid', {
2727
queryName: 'purchases',
2828
filterArray: this.rowIds && this.rowIds.length ? [LABKEY.Filter.create('rowId', this.rowIds.join(';'), LABKEY.Filter.Types.IN)] : [],
2929
maxRows: this.rowIds && this.rowIds.length ? -1 : 0,
30-
columns: 'requestor,vendorId,itemName,itemNumber,units,quantity,unitCost,totalCost,description,fundingSource,orderedBy,orderDate,orderNumber,emailOnArrival',
30+
columns: 'requestor,vendorId,itemName,itemNumber,units,quantity,unitCost,totalCost,description,fundingSource,emailOnArrival,orderedBy,orderDate,orderNumber,purchaseOrder',
3131
autoLoad: true,
3232
listeners: {
3333
scope: this,
@@ -69,19 +69,22 @@ Ext4.define('LabPurchasing.panel.OrderItemsGrid', {
6969
vendorId: {
7070
fixedWidthCol: true,
7171
required: true,
72+
wordWrap: true,
7273
columnConfig: {
73-
width: 250,
74+
width: 175,
7475
showLink: false
7576
}
7677
},
7778
itemName: {
7879
fixedWidthCol: true,
80+
wordWrap: true,
7981
columnConfig: {
8082
width: 175
8183
}
8284
},
8385
itemNumber: {
8486
fixedWidthCol: true,
87+
wordWrap: true,
8588
columnConfig: {
8689
width: 150
8790
}
@@ -92,7 +95,8 @@ Ext4.define('LabPurchasing.panel.OrderItemsGrid', {
9295
plugins: ['ldk-usereditablecombo']
9396
},
9497
columnConfig: {
95-
width: 100
98+
width: 100,
99+
showLink: false
96100
}
97101
},
98102
quantity: {
@@ -102,7 +106,7 @@ Ext4.define('LabPurchasing.panel.OrderItemsGrid', {
102106
minValue: 0
103107
},
104108
columnConfig: {
105-
width: 100
109+
width: 75
106110
}
107111
},
108112
unitCost: {
@@ -112,7 +116,7 @@ Ext4.define('LabPurchasing.panel.OrderItemsGrid', {
112116
minValue: 0
113117
},
114118
columnConfig: {
115-
width: 100
119+
width: 75
116120
}
117121
},
118122
totalCost: {
@@ -122,11 +126,12 @@ Ext4.define('LabPurchasing.panel.OrderItemsGrid', {
122126
minValue: 0
123127
},
124128
columnConfig: {
125-
width: 100
129+
width: 75
126130
}
127131
},
128132
description: {
129133
fixedWidthCol: true,
134+
wordWrap: true,
130135
columnConfig: {
131136
width: 200
132137
},
@@ -137,8 +142,9 @@ Ext4.define('LabPurchasing.panel.OrderItemsGrid', {
137142
},
138143
fundingSource: {
139144
fixedWidthCol: true,
145+
wordWrap: true,
140146
columnConfig: {
141-
width: 150
147+
width: 125
142148
}
143149
},
144150
orderedBy: {
@@ -159,6 +165,15 @@ Ext4.define('LabPurchasing.panel.OrderItemsGrid', {
159165
},
160166
orderNumber: {
161167
fixedWidthCol: true,
168+
wordWrap: true,
169+
columnConfig: {
170+
hidden: !this.showPlaceOrderUI,
171+
width: 130
172+
}
173+
},
174+
purchaseOrder: {
175+
fixedWidthCol: true,
176+
wordWrap: true,
162177
columnConfig: {
163178
hidden: !this.showPlaceOrderUI,
164179
width: 120
@@ -234,6 +249,15 @@ Ext4.define('LabPurchasing.panel.OrderItemsGrid', {
234249
text: 'Add New',
235250
hidden: this.showPlaceOrderUI,
236251
}), {
252+
text: 'Re-order Previous Item',
253+
scope: this,
254+
handler: function (btn) {
255+
Ext4.create('LabPurchasing.window.ReorderPreviousWindow', {
256+
gridPanel: this
257+
}).show();
258+
259+
}
260+
},{
237261
text: 'Remove Selected',
238262
scope: this,
239263
handler: function (btn) {
@@ -271,15 +295,6 @@ Ext4.define('LabPurchasing.panel.OrderItemsGrid', {
271295
}]
272296
}).show();
273297
}
274-
},{
275-
text: 'Re-order Previous Item',
276-
scope: this,
277-
handler: function (btn) {
278-
Ext4.create('LabPurchasing.window.ReorderPreviousWindow', {
279-
gridPanel: this
280-
}).show();
281-
282-
}
283298
}]
284299
});
285300

0 commit comments

Comments
 (0)