Part 1
- Add following models to plugin basic:
- resource with fields
- number - string identifier of resource
- quantity - quantity of resource
- product - related product from plugin basic
- transfer with fields
- resource - related resource
- quantity - quantity of product in transfer
- type - type of transfer (incoming or outgoing)
- status - status of transfer (planned or done)
- request date,
- the worker who filled the request
- confirmation date/worker.
- resource with fields
- Create views with list of resources and transfers
- Create view with resource details:
- form will contains three inputs
- number
- product's lookup
- quantity - disabled, because it is set using custom action
- expression will be used to generate window header
- window header will be displayed
- form will contains three inputs
- Create view with transfer details:
- form will contains eight inputs
- resource's lookup
- quantity
- type
- status
- requestWorker - disabled, because it is set using custom action
- requestDate - disabled, because it is set using custom action
- confirmWorker - disabled, because it is set using custom action
- confirmDate - disabled, because it is set using custom action
- expression will be used to generate window header
- window header will be displayed
- form will contains eight inputs
- Add custom action on save for transfer model - it should automatically set the transfer's workers and dates. Workers will be set using the current logged user - the one who create request will be put into requestWorker, Afterwards the one who changes the status to done will be put into confirmWorker. If transfer has not been saved (id is null) it should set requests worker and date, if transfer's status is done it should set confirmation worker and date. This action should also change quantity of the related resources, when the transfer is done.
- Add custom validation for transfer model - it should check if a resource has enough quantity for delivery transfer.
Part 2
- Add new model with name purchase:
- product - product from basic plugin,
- quantity - quantity of product,
- price - price of product,
- date - date with time.
- Add validator which would check if product price is > 0.
- Add validator which would check if product quantity is > 0.
- Add validator which would check if there is no product with the same name and price.
- Add views for that model.
- Add hooks which would set default system currency in field next to price (locale chosen in framework).
- Add hooks which would set product unit in field next to quantity - when product changes, this field also should be updated.
- Add button to ribbon in purchases list or details which will count average price of all purchases or average price of product. The result can be presented in any way (for example as a simple popup or field on the view).
Useful links