Skip to content

Replace invoice templates with contract lines #278

Description

@mlebreuil

netbox-contract plugin version

v2.5.0

NetBox version

v4.3.0

Feature type

Data model extension

Proposed functionality

New models:

ContractLine
New model to replace the invoice templates
Describes the billable or deliverable items within the contract.

Attributes:

id
contract_id
description
quantity
unit_price ( will be MoneyField from the [django-money](https://github.com/django-money/django-money) app  
unit (ref to a unit model instance - see below )
start_date, end_date (specific to the line, default to contract start and end)
accounting_dimensions

invoice line should be generated from contract lines and editable
On the invoice line automatically add a reference to the contract line

Unit
This is a new model

Attributes:

id
name
description
billing_method (unique, recurring, usage_based)
month (only relevant for recurring units. quantity of month)

Invoice line computation:

Unique costs are calculated for each invoice based on the remaining amount to pay compared to the sum of amount paid for this contract line over the entire contract period.
Recurring costs a billed for each invoice in relation with the period covered by the invoice.
Usage_based cost are calculated for each invoice based on quantity and unit price only.
All invoice lines can be adjusted.

Contract model changes:

mrc, yrc and nrc are replaced by the units and associated billing methods and deprecated.
Add "billable" field to the contract. This will control invoice generation for the contract.
Add calculated fields for:

  • Total contract value
  • Yearly contract value
  • Yearly contract billable value

Invoice Generation:

  • If the contract is not billable generate an error.
  • if the contract is billable create invoice line for each of the contract line and child contact lines if the corresponding contract is not billable.

Currency:

  • Enforce invoice line currency to be the invoice currency.
  • Enforce contract line currency to be the contract currency.
  • Enforce Invoice currency to be the contract currency.

Use case

Better management of the billing method:

  • non recurring cost vs recurring costs.
  • fixed versus usage based costs

External dependencies

none

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions