feriennet.collections.billing
Classes
Creates invoices from bookings. |
Module Contents
- class feriennet.collections.billing.BillingCollection(request: onegov.feriennet.request.FeriennetRequest, period: Period | PeriodMeta, username: str | None = None, expand: bool = False, state: Literal['paid', 'unpaid'] | None = None)[source]
-
- property invoices_by_period: Query[InvoicesByPeriodRow][source]
- class Bill[source]
Bases:
NamedTuple
- items: tuple[InvoicesByPeriodRow, Ellipsis][source]
- first: InvoicesByPeriodRow[source]
- include_donation(text: str, user_id: uuid.UUID, amount: decimal.Decimal) onegov.activity.InvoiceItem | None [source]
Includes a donation for the given user and period.
Unlike manual positions, donations are supposed to be off/on per period. Therefore this interface is somewhat different and has an exclude_donation counterpart.
- class feriennet.collections.billing.BookingInvoiceBridge(session: sqlalchemy.orm.Session, period: Period | PeriodMeta)[source]
Creates invoices from bookings.
Should be used in a two-phase process, with one exception:
The bookings are processed using process.
Premiums are applied by calling complete.
The exception is if you want to simply process a single booking after the premiums have been processed already. This is an exception for admins which may add bookings after all bills have been processed already.