Salg behavior
Documented against app commit ed7d6935. The same text lives in docs/agent/salg.md in the app repo.
Customer invoices, item groups, and items. An invoice save creates a bogføring. The posting shape is docs/agent/transactions.md. The live controller is BogfoInvoiceController. InvoiceController, InvoiceController_v2, BogfoInvoiceController_v1, and AccountProductController have no live route. emailReceipt does not exist.
Middleware: auth.check, module:bogforing, account, year. The routes sit under /bogforings/salg because they share the bogføring module.
Screens
Section titled “Screens”| Path | View | What it is |
|---|---|---|
GET /bogforings/salg/invoice | resources/views/pages/bogfoinvoice/index.blade.php | Open invoices. |
GET /bogforings/salg/invoice/add and GET /bogforings/salg/invoice/{id} | resources/views/pages/bogfoinvoice/form.blade.php | Create and edit. |
GET /bogforings/salg/group | resources/views/pages/kontogroups/index.blade.php | Varegrupper. |
GET /bogforings/salg/product | resources/views/pages/salgproduct/index.blade.php | Varer. |
The invoice PDF is GET /bogforings/salg/invoice/download/{id}. It renders pdftemplates.invoicereceipt through dompdf. It is a download, not a screen.
Form regions: customer, dates, lines (vare, group, quantity, price, subscription interval, start date), and the preview. The list shows interval names when a line is a subscription. Those fields are stored on products. Nothing in the scheduler or the live scripts calls GET /api/subscription, so that generator is not part of the running app.
Off-screen
Section titled “Off-screen”POST /bogforings/salg/invoice/add (store) and POST /bogforings/salg/invoice/{id} (update) call storeBogforingAndProducts. That private method writes the header with BogforingService::store (invoice_id set, type Kundefaktura) and then the lines with BogforingTransactionService::store, and stores each invoice line as a products row on the header. Editing replaces those children and rebuilds the posting. Deleting is GET /bogforings/salg/invoice/delete/{id}.
POST /bogforings/salg/email and POST /bogforings/salg/invoice/email both hit emailSend. The mail is sent for an existing invoice. It does not create a second bogføring.
public/js/conversion.js on the form calls GET /api/currencyexchange/db when the invoice currency is not the company currency. The rate is stored on the header as conversion_rate.
Varegrupper: KontoGroupController GET/POST /bogforings/salg/group, POST /bogforings/salg/group/{id}, GET /bogforings/salg/group/delete/{id}. A group is a label and a default konto. It is not a posting.
Varer: SalgProductController on /bogforings/salg/product with the same store, update, and delete pattern. A vare is the catalog row the invoice line copies from. GET /bogforings/product/delete/{id} (ProductController@delete) removes one invoice line product, not a catalog vare.
A new invoice field that should affect the books has to be mapped inside storeBogforingAndProducts before computeTransaction. Saving it only on products will show it on the invoice and leave the konto column unchanged.