Acq: improve General Search's ability to find invoices
Invoices in Evergreen have complex relationships with other items. They
can be related to lineitems (and ultimately POs and selection lists) by
invoice *entries*, or to PO items (and ultimately etc etc) by invoice
*items*, or directly to purchase orders by either of the above mentioned
acq.invoice_{entry,item} objects.
This should make general search more able to find invoices related to
other objects whose fields you might search against in Acquistions
General search.
Here's a diagram that I created to help me think about how to write
these joins:
At Bill Erickson's suggestion, I wound up putting the joins into an IDL view
("acqus") rather than trying to express them in JSON query, which was turnin
into a real time sink.
To prevent this change from making Acq General Search slower than it
was, I've also added indices on all the foreign keys used in the IDL
view, so that the joins should be as fast as possible.
Here's a solution. Testing appreciated.
Acq: improve General Search's ability to find invoices
Invoices in Evergreen have complex relationships with other items. They invoice_ {entry, item} objects.
can be related to lineitems (and ultimately POs and selection lists) by
invoice *entries*, or to PO items (and ultimately etc etc) by invoice
*items*, or directly to purchase orders by either of the above mentioned
acq.
This should make general search more able to find invoices related to
other objects whose fields you might search against in Acquistions
General search.
Here's a diagram that I created to help me think about how to write
these joins:
https:/ /docs.google. com/drawings/ d/15ExkiYvq0skf obbocvPWxwdZkb7 aykEZpLGfbP9P
At Bill Erickson's suggestion, I wound up putting the joins into an IDL view
("acqus") rather than trying to express them in JSON query, which was turnin
into a real time sink.
To prevent this change from making Acq General Search slower than it
was, I've also added indices on all the foreign keys used in the IDL
view, so that the joins should be as fast as possible.
http:// git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ senator/ lp-927685