Assetsmanagement/Advanced Asset Management/Parent View
In order to implement the parent view in the assets management project, this will be the approach:
Make Assets Management dependent on generic tree report module
Contents |
Improve Generic Tree Report module
- Add two additional (and optional) fields:
- Sequence number column:
- will make possible for the user to choose any of the columns belonging to the table to be shown in the report
- if null, current behavior
- if a numeric column of the table to show is selected, nodes of the tree to be printed are shorted accordingly to this value (in ascendant order).
- Root node:
- will show all the elements in the table (using the ad_column_identifier function)
- if null, current behavior
- if one element of the table is chosen here by the user, the report will show the tree, starting from this node: instead of showing the whole tree for all the elements in the table, it will just show the portion of tree which root element is the one chosen here
- Sequence number column:
Improve Assets Management module
This is the way Parent View are configured:
An asset have got this values:
- [Flag Y/N] - Is Summary
- [Combo] - Parent View (Possible options: nothing / casual / strong)
- [Combo] - Parent Asset (Possible options: any other asset with Is Summary=Yes)
So, for example, in order to implement this assets configuration:
- Camera
- (Strong) Lens
- (Casual) Protective Case
This will be the configuration:
Asset | Is Summary | Parent View | Main Asset |
Camera | Yes | ||
Lens | No | Strong | Camera |
Protective Case | No | Casual | Camera |
Two objectives must be achieved with this development:
- Develop the content of the Parent View sub-tab in asset card window
- Configure assets management module to show (using generic tree report) the hierarchy configured for a concrete asset
Content of the Parent View sub-tab
This tab must show all the assets (including the one in asset sub-tab) involved in the hierarchy. For example, for the previous example, in all the three assets (Camera, lens and case) the content of the parent view sub-tab will have same content: will show (in grid mode, by default) the three elements, with these values:
Asset | Relationship |
Camera | Main Asset |
Lens | Strong |
Protective Case | Casual |
If user clicks on the print button, it will launch the report in generic tree report, providing all the needed information: table, column for summary, column for parent and root element. The output will be something like:
- Camera
- (Strong) Lens
- (Casual) Case
DB
A new view must be created to show all the assets related to the one given. Some SQL like the next one must be implemented:
select son.issummary, son.mainasset, son.parentview from aam_asset parent, aam_asset son where parent.aam_asset_id = son.mainasset and (parent.aam_asset_id=? or son.aam_asset_id=?) (being ? -> the AAM_ASSET_ID of the parent tab)
AD
The view created must be the one populating the sub-tab Parent View. Default view will be grid. Print button will launch a process that will launch the generic tree report function, providing the required values.