Opened 17 years ago

Closed 11 years ago

#334 closed enhancement (fixed)

Dataview order_request needs enhancement

Reported by: Mark J. Millard Owned by: dbmulg
Priority: major Milestone: Beta 3
Component: Dataviews (CT) Version: 1.5.988
Severity: Keywords: order_request
Cc: Database Engine: N/A
Operating System: N/A

Description

The fields on dataview get_order_request needs to be sequenced more like GRIN-Classic. Here is the proposed SQL. I have attached an image of how I propose it should be and a dataview file I created on local for inserting in this version.

select

distinct(o.order_request_id)

,o.ordered_date
,o.site_code
,o.original_order_request_id
,o.local_number
,o.order_type
,o.status
,o.acted_date
,o.is_completed
,o.is_supply_low
,(select count(*) from order_request_item ori where ori.order_request_id = o.order_request_id) as items
,o.final_recipient_cooperator_id
,o.requestor_cooperator_id
,o.ship_to_cooperator_id
,o.source_cooperator_id
,o.order_obtained_via
,o.special_instruction
,o.note
,o.created_by
,o.created_date
,o.modified_by
,o.modified_date
,o.owned_by
,o.owned_date

from

order_request o

where

o.order_request_id in (:orderrequestid)

union

select

distinct(o.order_request_id)

,o.ordered_date
,o.site_code
,o.original_order_request_id
,o.local_number
,o.order_type
,o.status
,o.acted_date
,o.is_completed
,o.is_supply_low
,(select count(*) from order_request_item ori where ori.order_request_id = o.order_request_id) as items
,o.final_recipient_cooperator_id
,o.requestor_cooperator_id
,o.ship_to_cooperator_id
,o.source_cooperator_id
,o.order_obtained_via
,o.special_instruction
,o.note
,o.created_by
,o.created_date
,o.modified_by
,o.modified_date
,o.owned_by
,o.owned_date

from

order_request o, order_request_item oi, inventory i

where

o.order_request_id = oi.order_request_id
and oi.inventory_id = i.inventory_id
and i.accession_id in (:accessionid)

union

select

distinct(o.order_request_id)

,o.ordered_date
,o.site_code
,o.original_order_request_id
,o.local_number
,o.order_type
,o.status
,o.acted_date
,o.is_completed
,o.is_supply_low
,(select count(*) from order_request_item oi where oi.order_request_id = o.order_request_id) as items
,o.final_recipient_cooperator_id
,o.requestor_cooperator_id
,o.ship_to_cooperator_id
,o.source_cooperator_id
,o.order_obtained_via
,o.special_instruction
,o.note
,o.created_by
,o.created_date
,o.modified_by
,o.modified_date
,o.owned_by
,o.owned_date

from

order_request o, order_request_item oi

where

o.order_request_id = oi.order_request_id
and oi.inventory_id in (:inventoryid)

union

select

distinct(o.order_request_id)

,o.ordered_date
,o.site_code
,o.original_order_request_id
,o.local_number
,o.order_type
,o.status
,o.acted_date
,o.is_completed
,o.is_supply_low
,(select count(*) from order_request_item oi where oi.order_request_id = o.order_request_id) as items
,o.final_recipient_cooperator_id
,o.requestor_cooperator_id
,o.ship_to_cooperator_id
,o.source_cooperator_id
,o.order_obtained_via
,o.special_instruction
,o.note
,o.created_by
,o.created_date
,o.modified_by
,o.modified_date
,o.owned_by
,o.owned_date

from

order_request o

where

o.final_recipient_cooperator_id in (:cooperatorid)

Attachments (2)

admin1_export_2010_02_20_08_25_36.dat​ (262.2 KB ) - added by Mark J. Millard 17 years ago.
Dataview worked out for MJM on local
ProposedDataviewforOrder_Request_2010-02-20_2-20-2010 8-40-56 AM.jpg​ (605.7 KB ) - added by Mark J. Millard 17 years ago.
Image of proposed order_result 2010-02-20 from dataview editor

Download all attachments as: .zip

Change History (8)

by Mark J. Millard, 17 years ago

Dataview worked out for MJM on local

by Mark J. Millard, 17 years ago

Image of proposed order_result 2010-02-20 from dataview editor

comment:1 by dbmulg, 17 years ago

Import MJM's dataview to dev1 for sql server, and modified the same dataview for MYSQL and postgre SQL version (add one extr element: original request cooperator id, and move the special instruction down to right before note item). All will be included in the next build.

comment:2 by dbmulg, 17 years ago

Status: new → addressed

comment:3 by bweaver, 17 years ago

Status: addressed → released

comment:4 by Mark J. Millard, 17 years ago

Status: released → verified

comment:5 by Mark J. Millard, 11 years ago

Still working in 1.9.6.42. There have been additional fields added that the NPGS has not indicated there was a problem. This was verified with the intent that another user would close. This has changed, so I am closing now. It can be reopend should the issue arise again, however since new fields are present I encourage a new ticket be written.

comment:6 by Mark J. Millard, 11 years ago

Resolution: → fixed
Status: verified → closed
Note: See TracTickets for help on using tickets.