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

CardContent
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 headerstatus, main type, sub-type, direction, contract number (live preview: peeknumber), date_signed, currency, template + language, note
Term, renewal, terminationstart, 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 reasonsreasons from master data with own clause number and custom text
Contract textlanguage tabs: title, description, full text (HTML editor), "Load from template"
Pricing and settlementprice form, settlement mode (single, multiple, recurring), period, payment method and term, exchange rate method, billing frequency, automatic invoicing
Linked invoicesthe contract's invoices, search and linking
Leased property and cost pass-throughfor leases: the property, re-invoicing (draft or live), mark-up %
Real estate brokerageproperties to broker
Contract actions, Digital signatureAJAX cards (contract/contractaction.block, contract/esign.block)
Annexesdocument centre files linked to the contract, upload, detach
Budget items, Phasesitems (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

  1. Permission: canSave(contract/contract, id); the client must be in the user's content scope.
  2. Client and subject are required; the Hungarian title is required, and with any foreign-language text the Hungarian text is required too.
  3. date_signed: a valid date, not in the future; with digital acceptance the system fills it if empty.
  4. 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.
  5. The contract value must match the total of non-optional items (unit price × planned quantity) within ±0.01 if the header value is meaningful.
  6. Role limit per party; a missing expected role and a signatory without authority give warnings.
  7. Immediate termination reason: new ones only if active and valid for the main type and sub-type; clause number at most 32 characters.
  8. Missing power of attorney when the principal is not the owner of the property: warning.
  9. Success only for a re-read record; then persons, reasons, brokerage rows, data room sync (with grantaccess), optionally PDF generation (with generate).

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

EndpointPermission
contract/contract, .listlist
.formedit
.saveadd or edit + scope
.peeknumberedit + scope
.enable, .disableedit
.deletedelete + scope; the contract's data room access is revoked first
.invoices, .invoicesearch, .invoicelinklist or edit + scope
.fxrecalcfxrecalc + scope
.docs, .docupload, .docunlinklist or edit + scope
.templatepreview, .generategenerate

The keys statusdelete, certify, export and invoice are in the catalogue but are not checked by the controller.