Delivery tools
Delivery is for the project manager of won work. It lets an assistant change a delivery project’s budget (its deliverables, tasks, resource lines and expense lines), and draft a variation and fill in what the variation adds or changes. It can answer “add a 10% contingency to the survey task” or “draft a variation that adds two site visits to Stage 2”, and make the change.
The toolset also has:
search_records. Search withkindsvariationto find a variation’s id.delete_recordwith the budget and variation row kinds (see Delete a row). There is norestore_recordin this toolset, because a deleted budget row cannot be restored.list_projectsandget_project.get_projectwithinclude: ["budget_lines"]andresponse_format: "detailed"is the budget read.- The three report tools,
get_overview_report,get_revenue_reportandget_receivables_report.
An account admin gets 11 tools.
The same operations run the web Budget tab, the web variation page and the REST endpoints under Project budgets and Variations, so a row is refused or saved for the same reasons everywhere.
What the tools cannot do
- Submit, approve or reject a variation. These stay in Drum.
create_variationmakes a draft, and the assistant can fill in its rows while it is a draft or submitted. Ask the person who approves variations to do the rest in Drum. - Change an opportunity. An opportunity is not found here. Use
add_opportunity_rowandupdate_opportunity_rowin Sales. - Restore a deleted row.
How the tools fit together
- Find the project.
search_recordsorlist_projectsgives theproject_id. - Read the budget.
get_projectwithresponse_format: "detailed"andinclude: ["budget_lines"]gives each deliverable and task with its id, budget type and money, and each task’s resource and expense lines. It shows only approved variations. - Change the original budget.
add_budget_rowandupdate_budget_rowwithoutvariation_idwrite a row of the budget as it was sold. - Or draft a variation.
create_variationmakes a draft and answers its id.add_budget_rowwith thatvariation_idadds its rows.get_variationreads it back, with the budget before, the change and the budget after on each row. - Show the user. The assistant should show the change, then ask the user to submit and approve the variation in Drum.
Budget rows
Without variation_id, row_type is one of:
row_type |
Is | Parent on add | Main fields of row |
|---|---|---|---|
deliverable |
A deliverable | None | name, description, budget_type (fixed_fee or time_and_materials), client_cap, project_phase_id, rate_card_id, and on update reprice_resources |
task |
A task of a deliverable | deliverable_id |
name, note, budget_type (fixed or dynamic), quantity, quantity_unit, rate_cents, contingency_percent |
task_budget_resource |
A resource line of a task | task_id |
resource_type_id, member_id, quantity, quantity_unit, rate_cents, note |
budget_cost |
An expense line of a task | task_id |
name, cost_type_id, quantity, quantity_unit, billable_rate_cents, markup_percent |
The pricing follows Drum’s budget rules:
- A fixed task is priced by its own
quantityandrate_cents. Its lines, once it has any, make its internal budget. - A dynamic task is priced by its lines. Its contract value is its resource lines, plus its contingency, plus the price of each expense line. Contingency is
contingency_percentof the resource and expense lines at cost, never of the markup. An expense line’s price is its cost plusmarkup_percentof it. contingency_percentandmarkup_percentare numbers from 0 to 999.99. A new expense line withoutmarkup_percenttakes the project’s default cost markup, else the account’s.- Contingency and markup apply only on a fixed fee deliverable in an account that shows contract values. On a time and materials deliverable, or a budget only account, the contract value is the budget.
- Switching a task to
dynamicprefills the contingency that keeps the old price as close as possible. Acontingency_percentsent in the same call wins. Switching it tofixedsets quantity 1, per item, at the current price with contingency and markup. - A row that a variation adds, while that variation is not approved, is refused with reason
row_in_variation. Change it withvariation_id. Once a variation is approved, its rows are ordinary budget rows.
Estimate or client cap
A time and materials deliverable’s budget is either an estimate (a planning figure) or a client cap (a limit agreed with the client). client_cap: true makes it a client cap, and false an estimate. A fixed fee deliverable refuses true (reason client_cap_needs_hourly). A live project changes it with no variation. Deliverable rows, and get_project, give client_cap and limit_kind: fixed_fee, client_cap, estimate or open (hourly work with no amount). Only a fixed fee and a client cap hold resourcing and invoicing to their amount: an estimate earns revenue as time is billed.
Deliverable rate card
A deliverable’s rate_card_id is a card from selectable_rate_cards of get_project. null makes the deliverable use the project’s rates. On update_budget_row, reprice_resources: true with a new card also moves the lines that are at the old card’s rate to the new card’s rate, in the same write. Lines with a typed rate, lump sums and tasks that a variation changes keep their rates. The result’s warnings give the figures: resources_repriced (with the budget and contract change in the message), typed_rates_kept, tasks_skipped_variation and rates_unchanged.
Variation rows
With variation_id, the variation must be a draft or submitted. An approved or rejected variation answers conflict with reason variation_locked.
A variation adds new rows, and changes existing rows of the budget:
row_type |
Is | Parent on add | Main fields of row |
|---|---|---|---|
deliverable |
A deliverable the variation adds. It starts with one dynamic task | None | name, rate_card_id. On update also description, budget_type, client_cap, project_phase_id, reprice_resources |
task |
A task the variation adds. It starts dynamic | deliverable_id |
name, note, budget_type, quantity, quantity_unit, rate_cents, contingency_percent |
budget_cost |
An expense line the variation adds to a task | task_id |
name, cost_type_id, quantity, quantity_unit, billable_rate_cents, markup_percent |
task_change |
A change to an existing task | task_id |
budget_type, quantity_unit, quantity_delta, rate_cents, or adjustment_cents on an internal variation |
resource_change |
A new resource line on an existing task, or a change to one of its lines | task_id |
resource_type_id and member_id to add a line, or task_budget_resource_id and quantity (after the variation) to change one. On update quantity or delta_quantity, and delta_rate_cents |
cost_change |
A change to an existing expense line | budget_cost_id |
quantity_delta, quantity_unit, billable_rate_cents, cost_type_id, variation_type (adjustment, or removal to take the line out) |
Rules:
quantity_deltais the change, and can be negative.- Vary an existing task with a
task_changebefore you add abudget_costto it. Otherwise the add answers reasontask_not_varied. - A task the variation adds is changed as a
task, not with atask_change(reasontask_in_variation). - Adding a
task_changeorcost_changefor a row that already has one returns the one it has. - A
resource_changewithtask_budget_resource_id(a resource line id fromget_projectwithbudget_lines) changes that one line in one call, as the Change button on the web variation page does. A variation records only the lines it changes, so the task’s other lines stay ordinary budget lines. - A variation can change the rows that an approved variation added, but not the rows of another variation that is still pending.
External and internal variations
create_variation takes variation_scope:
external(the default) changes the client price. A project that sells its variations through an opportunity refuses one made here (reasonvariation_opportunity_required). Make that variation in Drum, which also makes its opportunity.internalmoves budget between existing lines and does not change the client price. It needs an account that shows contract values (reasoninternal_variation_unsupported). It adds no deliverables or tasks (reasoninternal_variation_row_not_allowed) and cannot touch a time and materials deliverable (reasoninternal_variation_time_and_materials). Itstask_changetakesadjustment_cents, a positive amount. A zero amount is refused. To remove an adjustment, delete thetask_change.
What a variation result shows
get_variation and create_variation answer variation (the header), rows and rows_page. A row write answers variation, the written rows and warnings.
- The header has
id,project_id,name,description,status,variation_scope,effective_dateandlocked, and with the budget money permissionbudget_change, pluscontract_changewith the contract value right. - Each row has
record_kind(therow_typeand the deletekind),id, its own fields, andbudget_before,budget_changeandbudget_after. With the contract value right it also hascontract_change, andcontract_beforeandcontract_afterwhere Drum can work them out. The contingency and markup percents also need the contract value right. - Rows come in pages of 50, in the order of the web variation page: deliverables, tasks, task changes, resource changes, expense lines, expense changes. When
rows_page.has_moreis true, call again withrow_offsetset tooffsetpluscount.
Delete a row
delete_record takes the row’s record_kind as kind: deliverable, task, task_budget_resource, budget_cost, task_change, resource_change or cost_change. The row decides how it is deleted:
- A row of a variation that is not approved deletes through the variation, and needs the right to change the variation.
- Any other row of a delivery project deletes from its budget, with the web delete rights.
deliverableandtaskare also the kinds of opportunity rows, which delete as in Sales.
Deleting a task_change also deletes the variation’s resource, expense and booking rows of that task. A delete is for good.
Errors you may see
| Reason | Meaning |
|---|---|
project_not_found |
Not a delivery project the user can read. An opportunity answers this too |
variation_not_found |
Not a variation of that project that the user can read |
variation_locked |
The variation is approved or rejected |
row_in_variation |
A budget row that a pending variation adds. Send variation_id |
task_not_varied |
Add a task_change before an expense line on an existing task |
task_in_variation |
The task is added by this variation: change it as a task |
contingency_dynamic_only |
contingency_percent on a fixed task. Switch it to dynamic in the same call, or leave the percent out |
variation_opportunity_required, internal_variation_unsupported, internal_variation_row_not_allowed, internal_variation_time_and_materials, adjustment_internal_only |
The scope rules above |
rate_card_reprice_locked, rate_card_locked_variation, rate_card_locked_internal_variation |
The deliverable’s variation does not allow the card or the new rates |
row_busy |
Another change to the same row or variation ran at the same time. Try again |
Tools
Each tool below shows what the server sends: its description (written for the AI), its kind, the permissions it needs, the fields it returns, and its inputs. An input in a.b or a[].b form is a field inside an object or a list. For the shared rules on results, pages, money and errors, see Results, errors and limits.
get_variation
Read one variation of a delivery project with its rows: the deliverables, tasks and budget_cost lines it adds, and its task_change, resource_change and cost_change rows of existing ones, with budget_before, budget_change and budget_after. get_project shows only approved variations, so read this before you change a draft. Rows come in pages of 50: when rows_page.has_more is true, call again with row_offset set to offset plus count. A locked variation (approved or rejected) cannot change.
| Title | Get variation |
| Toolsets | Delivery |
| Kind | Read only, Idempotent |
| Needs | api_read, read access to the project, and read_budgets or a project role with view_budgets |
| Returns | variation, rows, rows_page |
| Input | Type | Required | Description |
|---|---|---|---|
project_id |
integer | Yes | From search_records or list_projects. |
variation_id |
integer | Yes | From search_records with kinds variation. |
row_offset |
integer | Rows to skip, from rows_page. Default 0. |
create_variation
Make a draft variation of a delivery project, then add its rows with add_budget_row and variation_id. An external variation changes the client price, and an internal one moves budget between existing lines only. Submitting, approving and rejecting are done in Drum. After a timeout, read the variations with search_records before you try again.
| Title | Create variation |
| Toolsets | Delivery |
| Kind | Writes data |
| Needs | api_create, read access to the project, and create_budgets or a project role with update_budgets |
| Returns | variation, rows, rows_page |
| Input | Type | Required | Description |
|---|---|---|---|
project_id |
integer | Yes | From search_records or list_projects. |
name |
string | Yes | |
description |
string | ||
effective_date |
string | yyyy-mm-dd. | |
variation_scope |
string | Default external. One of external, internal. |
add_budget_row
Add a row to a delivery project’s budget, or with variation_id to a draft or submitted variation. Budget rows: deliverable, task (deliverable_id), task_budget_resource and budget_cost (task_id). Variation rows (read them with get_variation): deliverable, task and budget_cost it adds, task_change (task_id), resource_change (task_id, or task_budget_resource_id to change that line) and cost_change (budget_cost_id) of existing rows. Vary a task with task_change before you add its budget_cost. A dynamic task is priced by its lines and takes contingency_percent, and a budget_cost takes markup_percent. After a timeout, read the budget with get_project before you try again.
| Title | Add budget row |
| Toolsets | Delivery |
| Kind | Writes data |
| Needs | api_create, read access to the project, and the web rights of the row: update_budgets (or a project role with it) for budget fields, lines and variation rows, or the task or deliverable edit rights for their other fields |
| Returns | variation, rows, warnings |
| Input | Type | Required | Description |
|---|---|---|---|
project_id |
integer | Yes | From search_records or list_projects. |
variation_id |
integer | From get_variation or create_variation. Omit for the original budget. | |
row_type |
string | Yes | One of deliverable, task, task_budget_resource, budget_cost, task_change, resource_change, cost_change. |
deliverable_id |
integer | row_type task: its deliverable, from get_project. | |
task_id |
integer | task_budget_resource, budget_cost, task_change, resource_change: from get_project or get_variation. | |
budget_cost_id |
integer | cost_change: the expense line, from get_project with include budget_lines. | |
task_budget_resource_id |
integer | resource_change: the resource line to change, from get_project with include budget_lines. In place of task_id. row.quantity is the quantity after the variation. | |
position |
integer | Budget deliverable, task or task_budget_resource, and a variation task: 1-based place. Default last. | |
row |
object | The fields of the new row. | |
row.name |
string | ||
row.description |
string | deliverable. | |
row.budget_type |
string | deliverable: fixed_fee or time_and_materials. task, task_change: fixed or dynamic. One of fixed_fee, time_and_materials, fixed, dynamic. |
|
row.client_cap |
boolean | deliverable (time_and_materials): true makes its budget a client cap, false an estimate. Refused on fixed_fee. | |
row.project_phase_id |
integer | deliverable. | |
row.rate_card_id |
integer | deliverable, from get_project. | |
row.quantity |
number | task (fixed), task_budget_resource, budget_cost. resource_change of a line, or its update: the quantity after the variation. | |
row.quantity_unit |
string | One of hour, day, per_item. |
|
row.rate_cents |
integer | task (fixed), task_budget_resource, task_change. | |
row.billable_rate_cents |
integer | budget_cost, cost_change. | |
row.contingency_percent |
number | task (dynamic), 0 to 999.99. | |
row.markup_percent |
number | budget_cost, 0 to 999.99. Default: the project’s. | |
row.resource_type_id |
integer | task_budget_resource, resource_change. | |
row.member_id |
integer | task_budget_resource, resource_change. | |
row.cost_type_id |
integer | budget_cost, cost_change. | |
row.note |
string | task, task_budget_resource. | |
row.quantity_delta |
number | task_change, cost_change: the change, can be negative. | |
row.adjustment_cents |
integer | task_change of an internal variation: positive cents moved. To remove it use delete_record kind task_change. | |
row.variation_type |
string | cost_change. removal takes the line out. One of adjustment, removal. |
update_budget_row
Change a row of a delivery project’s budget, or with variation_id a row of a draft or submitted variation, by row_type and id from get_project or get_variation. Omit a field to keep it, and send null to clear it. A task switched to dynamic is priced from its lines with a prefilled contingency_percent, and one switched to fixed keeps its price. A deliverable’s rate_card_id with reprice_resources true re-rates its card-rated lines. Delete rows with delete_record, row_type as kind.
| Title | Update budget row |
| Toolsets | Delivery |
| Kind | Writes data, Idempotent |
| Needs | api_update, and the same rights as add_budget_row |
| Returns | variation, rows, warnings |
| Input | Type | Required | Description |
|---|---|---|---|
project_id |
integer | Yes | From search_records or list_projects. |
variation_id |
integer | From get_variation. Omit for the original budget. | |
row_type |
string | Yes | One of deliverable, task, task_budget_resource, budget_cost, task_change, resource_change, cost_change. |
id |
integer | Yes | From get_project or get_variation. |
position |
integer | 1-based place among its siblings. | |
row |
object | The fields to change. | |
row.name |
string | ||
row.description |
string or null | deliverable. null clears it. | |
row.budget_type |
string | deliverable: fixed_fee or time_and_materials. task, task_change: fixed or dynamic. One of fixed_fee, time_and_materials, fixed, dynamic. |
|
row.client_cap |
boolean | deliverable (time_and_materials): true makes its budget a client cap, false an estimate. Refused on fixed_fee. | |
row.project_phase_id |
integer or null | deliverable. null clears it. | |
row.rate_card_id |
integer or null | deliverable, from get_project. null clears it. | |
row.reprice_resources |
boolean | deliverable: true re-rates lines on the old card. | |
row.quantity |
number | task (fixed), task_budget_resource, budget_cost. resource_change of a line, or its update: the quantity after the variation. | |
row.quantity_unit |
string | One of hour, day, per_item. |
|
row.rate_cents |
integer | task (fixed), task_budget_resource, task_change. | |
row.billable_rate_cents |
integer | budget_cost, cost_change. | |
row.contingency_percent |
number | task (dynamic), 0 to 999.99. | |
row.markup_percent |
number | budget_cost, 0 to 999.99. Default: the project’s. | |
row.resource_type_id |
integer or null | task_budget_resource, resource_change. null clears it. | |
row.member_id |
integer or null | task_budget_resource, resource_change. null clears it. | |
row.cost_type_id |
integer | budget_cost, cost_change. | |
row.note |
string or null | task, task_budget_resource. null clears it. | |
row.quantity_delta |
number | task_change, cost_change: the change, can be negative. | |
row.delta_quantity |
number | resource_change: hours or days added, negative down to the original. | |
row.delta_rate_cents |
integer | resource_change. | |
row.adjustment_cents |
integer | task_change of an internal variation: positive cents moved. To remove it use delete_record kind task_change. | |
row.variation_type |
string | cost_change. removal takes the line out. One of adjustment, removal. |
Related
- Draft a variation with an assistant
- Toolsets
- Project budgets and Variations in the REST API