Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion WNPRC_EHR/resources/views/wnprcUnits.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@
]},
{header: 'Purchasing Services',
items: [
{name: 'Issue Tracker', url: '<%=contextPath%>/project/WNPRC/WNPRC_Units/Operation_Services/Purchasing/Issue_Tracker/start.view?'}
{name: 'Issue Tracker', url: '<%=contextPath%>/project/WNPRC/WNPRC_Units/Operation_Services/Purchasing/Issue_Tracker/start.view?'},
{name: 'Purchasing Requests', url: '<%=contextPath%>/WNPRC/WNPRC_Units/Operation_Services/Purchasing/WNPRC_Purchasing-requester.view?'},
{name: 'Purchasing Admin', url: '<%=contextPath%>/WNPRC/WNPRC_Units/Operation_Services/Purchasing/WNPRC_Purchasing-purchaseAdmin.view?'}
]}
]
});
Expand Down
7 changes: 7 additions & 0 deletions WNPRC_Purchasing/resources/data/paymentOptions.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
paymentOption
Internal PO
External PO
MDS
Blanket Order
Direct Payment
Purchasing Card
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
<columns>
<column name="requestRowId"/>
<column name="item"/>
<column name="itemUnitId"/>
<column name="controlledSubstance"/>
<column name="quantity"/>
<column name="unitCost"/>
</columns>
<sorts>
<sort column="requestRowId" descending="true" />
</sorts>
</customView>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="myOpenRequests" tableDbType="NOT_IN_DB" useColumnOrder="true">
<tableTitle>My Open Requests</tableTitle>
</table>
</tables>
</metadata>
</query>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- open requests assigned to the current purchase admin user
SELECT
pr.rowId AS requestNum,
pr.created AS requestDate,
pr.vendorId,
pr.totalCost,
pr.account || pr.otherAcctAndInves AS account,
pr.qcState AS requestStatus,
pr.createdBy AS requester,
pr.assignedTo
FROM ehr_purchasing.purchasingRequests pr
WHERE ISMEMBEROF(pr.assignedTo)
55 changes: 55 additions & 0 deletions WNPRC_Purchasing/resources/queries/ehr_purchasing/pCard.query.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="pCard" tableDbType="NOT_IN_DB" useColumnOrder="true">
<tableTitle>P-Card View</tableTitle>
<columns>
<column columnName="vendorId">
<columnTitle>Vendor</columnTitle>
<nullable>false</nullable>
<fk>
<fkDbSchema>ehr_purchasing</fkDbSchema>
<fkTable>vendor</fkTable>
</fk>
</column>
<column columnName="description"/>
<column columnName="justification">
<columnTitle>Business purpose</columnTitle>
</column>
<column columnName="orderDate">
<formatString>yyyy-MM-dd</formatString>
</column>
<column columnName="cardPostDate">
<formatString>yyyy-MM-dd</formatString>
<columnTitle>Post Date</columnTitle>
</column>
<column columnName="totalCost">
<formatString>###,##0.00</formatString>
</column>
<column columnName="account">
<columnTitle>Acct code</columnTitle>
<fk>
<fkDbSchema>ehr_billingLinked</fkDbSchema>
<fkTable>aliases</fkTable>
</fk>
</column>
<column columnName="program">
<columnTitle>Prog</columnTitle>
</column>
<column columnName="createdBy">
<columnTitle>Requested by</columnTitle>
</column>
<column columnName="comments">
<columnTitle>Notes/Internal Ref#</columnTitle>
</column>
<column columnName="invoiceNum">
<columnTitle>Invoice No</columnTitle>
</column>
<column columnName="paymentOptionId">
<columnTitle>Payment Option</columnTitle>
</column>
</columns>
</table>
</tables>
</metadata>
</query>
25 changes: 25 additions & 0 deletions WNPRC_Purchasing/resources/queries/ehr_purchasing/pCard.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
SELECT
pr.vendorId,
items.description,
pr.justification,
pr.orderDate,
pr.cardPostDate,
pr.totalCost,
pr.account,

pr.program,
pr.createdBy,
pr.comments,
pr.rowId AS orderNum,
pr.invoiceNum,
pr.paymentOptionId

FROM ehr_purchasing.purchasingRequests pr
LEFT JOIN
(
SELECT requestRowId,
group_concat(item, ', ') AS description
FROM ehr_purchasing.lineItems
GROUP BY requestRowId
) items
ON pr.rowId = items.requestRowId
19 changes: 19 additions & 0 deletions WNPRC_Purchasing/resources/queries/ehr_purchasing/pCard/.qview.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
<columns>
<column name="vendorId"/>
<column name="description"/>
<column name="justification"/>
<column name="orderDate"/>
<column name="cardPostDate"/>
<column name="totalCost"/>
<column name="account"/>
<column name="account/uw_fund"/>
<column name="account/uw_udds"/>
<column name="program"/>
<column name="createdBy"/>
<column name="comments"/>
<column name="orderNum"/>
<column name="invoiceNum"/>
<column name="paymentOptionId"/>
</columns>
</customView>
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
<column columnName="shippingAttentionTo">
<nullable>false</nullable>
</column>
<column columnName="creditCardOptionId">
<column columnName="paymentOptionId">
<fk>
<fkDbSchema>wnprc_purchasing</fkDbSchema>
<fkTable>creditCardOptions</fkTable>
<fkTable>paymentOptions</fkTable>
<fkColumnName>rowId</fkColumnName>
</fk>
</column>
Expand All @@ -59,6 +59,13 @@
</column>
<column columnName="orderDate"/>
<column columnName="cardPostDate"/>
<column columnName="assignedTo">
<fk>
<fkDbSchema>core</fkDbSchema>
<fkTable>Users</fkTable>
<fkColumnName>UserId</fkColumnName>
</fk>
</column>
</columns>
</table>
</tables>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- this is the query that displays on the requesters page
SELECT
pr.rowId,
pr.vendorId,
Expand All @@ -6,14 +7,6 @@ SELECT
pr.qcState AS requestStatus,
pr.created AS requestDate,
pr.createdBy AS requester,
items.totalCost
pr.totalCost
FROM ehr_purchasing.purchasingRequests pr
LEFT JOIN
(
SELECT requestRowId,
round(sum(quantity * unitCost), 2) AS totalCost
FROM ehr_purchasing.lineItems
GROUP BY requestRowId
) items
ON pr.rowId = items.requestRowId
WHERE ISMEMBEROF(pr.createdBy)
WHERE ISMEMBEROF(pr.createdBy) -- only sees requests created by the current user/requester
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="purchasingRequestsOverview" tableDbType="NOT_IN_DB" useColumnOrder="true">
<tableTitle>Purchase Requests</tableTitle>
</table>
</tables>
</metadata>
</query>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SELECT
pr.rowId AS requestNum,
pr.vendorId,
pr.account,
pr.otherAcctAndInves,
pr.qcState AS requestStatus,
pr.created AS requestDate,
pr.createdBy AS requester,
pr.totalCost,
pr.assignedTo
FROM ehr_purchasing.purchasingRequests pr
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
<columns>
<column name="requestNum"/>
<column name="requestDate"/>
<column name="vendorId"/>
<column name="account"/>
<column name="totalCost"/>
<column name="requestStatus"/>
<column name="otherAccountAndInves"/>
<column name="requester"/>
<column name="assignedTo"/>
</columns>
<filters>
<filter column="requestStatus/Label" operator="in" value="Review Pending; Request Approved" />
</filters>
</customView>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
<columns>
<column name="requestNum"/>
<column name="requestDate"/>
<column name="vendorId"/>
<column name="account"/>
<column name="totalCost"/>
<column name="requestStatus"/>
<column name="otherAccountAndInves"/>
<column name="requester"/>
</columns>
<filters>
<filter column="requestStatus/Label" operator="eq" value="Order Complete" />
</filters>
</customView>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
<columns>
<column name="shippingAlias"/>
<column name="streetAddress"/>
<column name="city"/>
<column name="state"/>
<column name="country"/>
<column name="zip"/>
<column name="phoneNumber"/>
<column name="email"/>
<column name="notes"/>
</columns>
</customView>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
<columns>
<column name="userId"/>
<column name="account"/>
<column name="accessToAllAccounts"/>
</columns>
<sorts>
<sort column="userId" descending="false" />
</sorts>
</customView>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
<columns>
<column name="vendorName"/>
<column name="streetAddress"/>
<column name="city"/>
<column name="state"/>
<column name="country"/>
<column name="zip"/>
<column name="phoneNumber"/>
<column name="faxNumber"/>
<column name="email"/>
<column name="url"/>
<column name="notes"/>
<column name="isValidVendor"/>
</columns>
<sorts>
<sort column="vendorName" descending="false" />
</sorts>
</customView>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
DROP TABLE wnprc_purchasing.creditCardOptions;

CREATE TABLE wnprc_purchasing.paymentOptions
(
rowId serial,
paymentOption varchar(500),
container ENTITYID NOT NULL,
createdBy USERID,
created timestamp,
modifiedBy USERID,
modified timestamp,

CONSTRAINT PK_WNPRC_PURCHASING_PAYMENT_OPTIONS PRIMARY KEY (rowId),
CONSTRAINT FK_WNPRC_PURCHASING_PAYMENT_OPTIONS_CONTAINER FOREIGN KEY (Container) REFERENCES core.Containers (EntityId)
);

CREATE INDEX IDX_WNPRC_PURCHASING_PAYMENT_OPTIONS_CONTAINER ON wnprc_purchasing.paymentOptions(Container);
10 changes: 10 additions & 0 deletions WNPRC_Purchasing/resources/schemas/ehr_billingLinked.template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!--Linked Schema named ehr_billingLinked with this template to be created in Purchasing Admin Folder-->

<templateSchema xmlns="http://labkey.org/data/xml/externalSchema"
xmlns:dat="http://labkey.org/data/xml"
xmlns:cv="http://labkey.org/data/xml/queryCustomView"
sourceSchemaName="ehr_billing">
<tables>
<tableName>aliases</tableName>
</tables>
</templateSchema>
8 changes: 4 additions & 4 deletions WNPRC_Purchasing/resources/schemas/wnprc_purchasing.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="creditCardOptions" tableDbType="TABLE" useColumnOrder="true">
<tableTitle>Credit Card Options</tableTitle>
<titleColumn>cardOption</titleColumn>
<table tableName="paymentOptions" tableDbType="TABLE" useColumnOrder="true">
<tableTitle>Payment Options</tableTitle>
<titleColumn>paymentOption</titleColumn>
<auditLogging>DETAILED</auditLogging>
<insertUrl/>
<columns>
<column columnName="rowId"/>
<column columnName="cardOption"/>
<column columnName="paymentOption"/>
<column columnName="container"/>
<column columnName="createdBy"/>
<column columnName="created"/>
Expand Down
Loading