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.
| Table | Role |
|---|---|
contract_passthrough | de-dup row per source invoice (scheduled state) |
invoice | source cost invoice and the resulting draft |
cron_queue | rows of the contract_passthrough job |
Process
contract_passthrough_scan(globally scheduled, about every 2 minutes;processScanForCronqueuein the catalogcontract/passthroughcontroller): 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 ascheduledde-dup row and acontract_passthroughqueue row. It does not issue invoices.contract_passthrough(one-off, queued by the scanner): from thescheduledrows 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.- 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.