contracts
Recurring contracts with billing cycles and auto-billing settings.
Status codes
| Status | Activity | ID | Color |
|---|---|---|---|
| Draft | DRAFT | 0 | green |
| Awaiting approval | DRAFT | 1 | orange |
| Approved | OPEN | 2 | green |
| Dismissed | CANCELLED | 3 | red |
| Active | OPEN | 4 | green |
| Inactive | OPEN | 5 | orange |
| Expired | CLOSED | 6 | black |
| Cancelled | CANCELLED | 7 | red |
| Closed | CLOSED | 8 | black |
| Name | Type | Nullable | Default Value | Notes |
|---|---|---|---|---|
PKID | integer | Contract ID | ||
fork forks.ID | integer | Fork ID (`null` for base module) | ||
ownergroup groups.ID | integer | Owner group ID (`null`=PUBLIC) | ||
creator | integer | Creator user ID (defaults to authenticated user on creation) | ||
assigneduser users.ID | integer | Assigned user ID | ||
creationdate | bigint | date_part('epoch', now()) | Creation date and time as a Unix timestamp (defaults to current date and time on creation) | |
lastmodified | bigint | date_part('epoch', now()) | Last modification date and time as a Unix timestamp (auto-reset on modification) | |
account accounts.ID | integer | Account ID | ||
visibility | smallint | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) | |
name | text | Name | ||
contractnum | text | '' | Contract number | |
date | bigint | EXTRACT(epoch FROM now()) | Designated date and time as a Unix timestamp (defaults to current date and time on creation) | |
datefrom | bigint | Start date as a Unix timestamp; must be less than or equal to `dateto` | ||
dateto | bigint | End date as a Unix timestamp; must be greater than or equal to `datefrom` | ||
datecancel | bigint | Cancellation date as a Unix timestamp | ||
status | smallint | 0 | Status (`0`=DRAFT, `1`=AWAITINGAPPROVAL, `2`=APPROVED, `3`=DISMISSED, `4`=ACTIVE, `5`=INACTIVE, `6`=EXPIRED, `7`=CANCELLED, `8`=CLOSED) | |
currency | character varying(3) | Currency code (ISO 4217) | ||
exchangerate | double precision | 1 | Exchange rate as a multiple of one monetary unit of the fixed system currency | |
billingcycle | smallint | Billing cycle in months | ||
lastbilling | bigint | Last billing date and time as a Unix timestamp | ||
description | text | '' | Detailed general description | |
contractitems | json | JSON-encoded items (array) | ||
billingitems | json | JSON-encoded items (array) | ||
procurementitems | json | JSON-encoded items (array) | ||
autobilling | json | JSON-encoded auto-billing data (object); only if `billingcycle` is not `null` |
| Name | Unique | Nulls Distinct | Primary | Partial | Method | Keys |
|---|---|---|---|---|---|---|
| fk_contracts_account | btree | account | ||||
| fk_contracts_assigneduser | gin | assigneduser | ||||
| fk_contracts_fork | gin | fork | ||||
| fk_contracts_ownergroup | gin | ownergroup | ||||
| i_contracts_autobilling | gin | status | ||||
| i_contracts_date | btree | date | ||||
| i_contracts_nofork | gin | fork | ||||
| i_contracts_noowner | gin | ownergroup | ||||
| pk_contracts | btree | ID | ||||
| s_contracts_contractnum | gin | contractnum | ||||
| s_contracts_name | gin | name |
| Name | Type |
|---|---|
| c_contracts_date | check |
| dc_contracts_autobilling | check |
| dc_contracts_billingcycle | check |
| dc_contracts_billingitems | check |
| dc_contracts_contractitems | check |
| dc_contracts_contractnum | check |
| dc_contracts_currency | check |
| dc_contracts_description | check |
| dc_contracts_exchangerate | check |
| dc_contracts_name | check |
| dc_contracts_procurementitems | check |
| dc_contracts_status | check |
| dc_contracts_visibility | check |
| fk_contracts_account | foreign_key |
| fk_contracts_assigneduser | foreign_key |
| fk_contracts_fork | foreign_key |
| fk_contracts_ownergroup | foreign_key |
| pk_contracts | primary_key |
Loading...