Budget views
https://redmine.teklia.com/issues/10050
Requires enterprise#46, enterprise#47, enterprise#48
-
In
src/types/rights.ts, theMembershipContentTypeParametersneeds to be updated to support the newbudgetquery parameter onListMemberships. -
A new
useBudgetStorePinia store provides thelist,getandlistEntriesaction, corresponding to theListBudgets,RetrieveBudgetandListBudgetEntriesAPIs. -
The API bindings should be in
src/api/budget.ts, and should be re-exported fromapi/index.ts. -
The type definitions should be in
src/types/budget.ts. -
A new view
src/views/Budget/List.vueat/budgetlists the budgets that the user has access to.- This view requires the
enterprisefeature flag and a verified email. - The usual paginated table shows the name, with a clickable link to the budget details view, as well as the current total.
- This view requires the
-
A new, very smol component
src/components/Budget/Value.vueshows aBudgetEntry.valuedecimal in a simple<span>, followed by€. When the value is negative, it should be in red. -
A new view
src/views/Budget/Details.vueat/budget/:idallows viewing the details of a budget and its entries.- This view requires the
enterprisefeature flag and a verified email. - A
<h1>shows the budget name, with anItemIdas the subtitle. - A single read-only
fieldshows the current total using theValuecomponent. - Nothing is editable since there is no API to edit a budget.
- A paragraph can state "To edit a budget, please contact an instance administrator."
- If the user is an admin, "To edit a budget, use the administration interface" with a link to
/admin/budget_enterprise/budget/${id}/change/. - Just like on the worker details view, a
← Budgetsbutton allows users to go back to the budgets list. - A paginated table shows the budget entries, with the following columns:
- Date, using the
agohelper; - Description;
- User: the user email, or
—when there is none; - Process: a link to the process details view, or
—when there is no process ID; - Amount: value of the entry using the
Valuecomponent.
- Date, using the
- This view requires the
-
Under the user menu on the top-right corner, a new Budgets button leads to the
/budgetview. It is only shown when theenterprisefeature flag is set.