Skip to content

Regnskab behavior

Documented against app commit ed7d6935. The same text lives in docs/agent/regnskab.md in the app repo.

Read-only views of posted lines, plus sammenligning pairs. They do not create bogføringer. Column totals use the fold in docs/agent/transactions.md.

Middleware: auth.check, account, year. Saldobalance also requires module:regnskab. Sammenligning requires module:sammenligning. The navbar only shows Sammenligning to role id 1.

PathViewWhat it is
GET /regnskabs/{category?}/{quarter?}resources/views/pages/regnskabs/index.blade.phpSaldobalance. Category and quarter filter this view.
GET /regnskabs/detailed/{category?}/{quarter?}resources/views/pages/regnskabs/detailed.blade.phpThe same totals with the bilag under each konto.
GET /sammenligningresources/views/pages/sammenlignings/index.blade.phpSaved pairs. Tabs are Lev./Kundekontokort and Mellemregning. Date filters from and to are a GET form.
GET /sammenligning/add and POST /sammenligning/addresources/views/pages/sammenlignings/form.blade.phpPick the two sides of a new pair.

The pair-transaction modal is resources/views/pages/sammenlignings/partials/pairtransactiontablemodal.blade.php on the index, not its own route. The saldobalance bilag modal is resources/views/pages/regnskabs/partials/transactiontablemodal.blade.php.

Index regions: the two tabs, date filter, the pair table (firma, leverandør/kunde, type, the other side, underkud), and Tilføj ny par. The add form regions are the two companies, years, konti, and leverandør or kunde.

RegnskabController@index and @detailed load kontoplan rows for the year and the bogføring lines under them. Totals go through BogforingTransactionService::getTotalPerFilteredTransactions (or the same fold via transformTransactions on the detail modal). Headers must be is_active = 1 and is_approve = 1. Unapproved inbox items and unfinished bank rows stay out. The amount used on the balance is base_amount when the company currency is not the document currency, and the folded konto or modkonto amount otherwise.

SammenligningController@add lists the companies, years, and parties the user can pair. POST /sammenligning/store writes a pairs row: type, firma, year, konto, and leverandør or kunde for each side. GET /sammenligning/delete/{id} removes that pair. It does not delete the underlying bogføringer.

Opening a pair loads both sides’ lines and runs transformTransactions. When the match is on the modkonto, the header is given flip_value so getDkkBelob reverses the displayed amount. Underkud on the index is the DKK difference between the two folded sides.

A new column on saldobalance has to use the same fold. Summing bogforings.amount will not match the konto column after moms has been split.