Bogføring behavior
Documented against app commit ed7d6935. The same text lives in docs/agent/bogforing.md in the app repo.
Bogføring
Section titled “Bogføring”The daybook. It lists bilag for the active company and year, edits them, and shows the change log. It does not import CSV. Posting shape is docs/agent/transactions.md.
Middleware: auth.check, module:bogforing, account, and year, except Ændringslog, which does not require year.
Screens
Section titled “Screens”| Path | View | What it is |
|---|---|---|
GET /bogforings/{category?}/{quarter?} | resources/views/pages/bogforings/index.blade.php | The list. Default category is daglig. alle shows every category. Quarter 0 is the whole year. These are filters of this view, not other pages. |
| Create and edit | resources/views/pages/bogforings/partials/modalform.blade.php | Modal on the list. Create posts to POST /bogforings. Edit posts to POST /bogforings/{id}. |
GET /bogforings/bogforing-cleanup | resources/views/pages/bogforingcleanups/index.blade.php | Cleanup of existing bilag. Also accepts POST on the same URL. |
GET /bogforings/audit-log | resources/views/pages/bogforings/audit-log/index.blade.php | Ændringslog for the active company, across years. |
The list header links to Ændringslog. The same log for one bilag is loaded inside the form from GET /bogforings/audit-log/bogforing/{id}.
List regions: category tabs, quarter, the transaction table (bilagsnr, date, text, konto, modkonto, amounts), row filters, batch actions, the create button, and the PDF upload. The modal regions are the header fields, the konto and modkonto lines, the moms fields, and the per-bilag Ændringslog.
The table shows the folded konto and modkonto from transformTransactions, not the raw lines.
Off-screen
Section titled “Off-screen”BogforingController@index loads headers with BogforingService::getAllFiltered. The list passes bogfoVisible, so only is_active = 1 and is_bogfo_visible = 1 rows appear. Category and quarter narrow that set. Lines are folded before the table renders.
POST /bogforings (store) validates with BogforingRequest. If the request includes invoiceimg, InvoiceImgService::upload runs first and the new id is merged onto the request. Then:
BogforingService::storewrites the header.flipValueis set when type is4and the kontoplan type is2, or type is3and the kontoplan type is1.computeTransactionthenBogforingTransactionService::storewrite the lines.
POST /bogforings/{id} (update) updates the header with BogforingService::update and rebuilds the lines the same way. Triggers write the Ændringslog. Do not insert a second log row here.
POST /bogforings/batch-update (groupUpdate) takes a JSON list of header ids. When the request includes rules, each rule is applied to those headers (konto, type, leverandør or kunde) and the lines are rebuilt. This is how a rule is pushed onto existing bilag from the daybook. The rule master data lives in docs/agent/rules.md.
POST /bogforings/delete (groupDelete) and GET /bogforings/delete/{id} call BogforingService::delete. Delete sets the header inactive rather than removing the audit history. The trigger records the delete.
POST /bogforings/upload (uploadPdf) attaches a PDF to an existing header through invoice_img_id. It does not create lines.
GET /bogforings/bogforing-cleanup loads bilag for text and rule cleanup. The page script posts text changes to POST /api/bogforing/update-text (Api\BogforingController@updateBogforingText). Cleanup rules themselves are docs/agent/rules.md.
Scripts on the list (public/js/bogforing.js) call:
| Call | Method | Effect |
|---|---|---|
POST /api/bogforing/checkFakturanr | Api\BogforingController@checkFakturanr | Warns when the fakturanummer already exists on this company. Does not write. |
POST /api/bogforing/update | Api\BogforingController@update | Saves an inline edit of a header field from the grid. |
POST /api/bogforing/remove-generated-from | Api\BogforingController@removeGeneratedFromBogforingId | Clears generated_from_bogforing_id when a modfaktura link is removed. Also used from the kontokort. |
POST /api/rules/get-rules | Api\RuleController@getRules | Loads rules that match the row being edited, so the modal can offer them. |
Ændringslog reads bogforing_change_logs. GET /bogforings/audit-log/data feeds the DataTable. Filters are filed date, action, bilagsnr, posting date, text, summary tags, and user, plus the toolbar range (whole year, half years, quarters). BogforingAuditLogController@forBogforing returns the rows for one header. Ordinary creates, updates, and deletes are inserted by the audit triggers, not by the controller. Modfaktura adds one explicit modfaktura_generated row. See docs/agent/transactions.md.
public/js/conversion.js on this page calls GET /api/currencyexchange/db to fill the rate when the valuta is not the company currency. The daily rate command fills that table. The curl and historical endpoints are not used.