How the contract form and list work
The cards of the contract form, types and role pairs, the server-side saving rules, contract numbering, currency, status, the list and the endpoints.
The contract form (contract/contract.form) writes the contract header, descriptions, parties, persons, termination reasons and brokerage rows with one AJAX save (contract/contract.save); the form stays open and the new identifier is written back.
Cards of the form
| Card | Content |
|---|---|
| Client company (left, 40%) | client picker (only companies in content scope), tax number, address, bank account (8-8-8), the client's persons |
| Contracting parties (right, 60%) | main partner and further parties with the same card macro; persons with roles |
| Contract header | status, main type, sub-type, direction, contract number (live preview: peeknumber), date_signed, currency, template + language, note |
| Term, renewal, termination | start, end, duration_type (fixed, open, project, until_task), renewal, auto-termination, ordinary termination, notice period and deadline, certificate required, expiry notice days and clause |
| Immediate termination reasons | reasons from master data with own clause number and custom text |
| Contract text | language tabs: title, description, full text (HTML editor), "Load from template" |
| Pricing and settlement | price form, settlement mode (single, multiple, recurring), period, payment method and term, exchange rate method, billing frequency, automatic invoicing |
| Linked invoices | the contract's invoices, search and linking |
| Leased property and cost pass-through | for leases: the property, re-invoicing (draft or live), mark-up % |
| Real estate brokerage | properties to broker |
| Contract actions, Digital signature | AJAX cards (contract/contractaction.block, contract/esign.block) |
| Annexes | document centre files linked to the contract, upload, detach |
| Budget items, Phases | items (product, service, property; unit price, quantity, VAT, optional) and milestones |
Types and roles
Main types: mandate, works, employment, lease, sale. Sub-types: under mandate real_estate_brokerage, accounting, site_supervision, controlling; under lease vehicle_lease, property_lease, equipment_lease; under sale property_sale, business_share_sale. Role pairs (seller side and buyer side): agent and principal, contractor and orderer, lessor and lessee, employee and employer, seller and buyer. Values of contract_parties.role: customer, supplier, principal, agent, orderer, employer, contractor, employee, lessor, lessee, contributor.
Saving rules
- Permission:
canSave(contract/contract, id); the client must be in the user's content scope. - Client and subject are required; the Hungarian title is required, and with any foreign-language text the Hungarian text is required too.
date_signed: a valid date, not in the future; with digital acceptance the system fills it if empty.- Property to broker: commission 0–100%, long lease months 0–120, the row end cannot precede its start; a row without a property fails with its row number.
- The contract value must match the total of non-optional items (unit price × planned quantity) within ±0.01 if the header value is meaningful.
- Role limit per party; a missing expected role and a signatory without authority give warnings.
- Immediate termination reason: new ones only if active and valid for the main type and sub-type; clause number at most 32 characters.
- Missing power of attorney when the principal is not the owner of the property: warning.
- Success only for a re-read record; then persons, reasons, brokerage rows, data room sync (with
grantaccess), optionally PDF generation (withgenerate).
Contract number: client + prefix + highest serial of the year + 1, padded to four digits; an existing number is not overwritten.
Currency and status
The currency comes from the currency master (currency_code, currency_value). Amounts in documents: forint as whole numbers, other currencies with two decimals. fxrecalc recalculates invoice exchange rates according to the contract (preview and apply; invoices of closed periods are skipped). Status: 0 inactive, 1 active, 9 deleted (bin, visible only to holders of permanent delete and the super admin). Termination deactivates the contract on the end date.
Background jobs
The contract_passthrough_scan job watches lease cost pass-through roughly every 2 minutes and queues the contract_passthrough job, which creates a re-invoicing draft invoice.
Endpoints and permissions
| Endpoint | Permission |
|---|---|
contract/contract, .list | list |
.form | edit |
.save | add or edit + scope |
.peeknumber | edit + scope |
.enable, .disable | edit |
.delete | delete + scope; the contract's data room access is revoked first |
.invoices, .invoicesearch, .invoicelink | list or edit + scope |
.fxrecalc | fxrecalc + scope |
.docs, .docupload, .docunlink | list or edit + scope |
.templatepreview, .generate | generate |
The keys statusdelete, certify, export and invoice are in the catalogue but are not checked by the controller.