Lease cost pass-through – system description

The two background jobs (scanner and invoice builder), the de-dup table, the matching basis and the creation of the draft invoice.

Two background jobs implement it: the scanner matches incoming cost invoices to the property of lease contracts with pass-through, the builder creates draft outgoing invoices from the queued items.

Data model

Table names carry the installation's own prefix in the database.

TableRole
contract_passthroughde-dup row per source invoice (scheduled state)
invoicesource cost invoice and the resulting draft
cron_queuerows of the contract_passthrough job

Process

  1. contract_passthrough_scan (globally scheduled, about every 2 minutes; processScanForCronqueue in the catalog contract/passthrough controller): for active lease contracts with pass-through it matches the incoming cost invoice to the property by the normalised value of the label connector (value_norm); for a new match it writes a scheduled de-dup row and a contract_passthrough queue row. It does not issue invoices.
  2. contract_passthrough (one-off, queued by the scanner): from the scheduled rows it creates a draft (status = 0) outgoing invoice to the tenant with the contract's markup, the source invoice's lines and the contract number.
  3. The admin-side contract/passthrough::getRowsBySource() reads back the rows of a source invoice.

Where the result shows

The job rows in the job queue, the draft outgoing invoices among the invoices.

Permissions

A background job, not a function key; the set-up is saved with the contract's edit right.