Add royalty mechanism#306
Conversation
| IS_EXTERNALLY_FUNDED_COLUMN = InvoiceColumn( | ||
| name=IS_EXTERNALLY_FUNDED_FIELD, dtype=BOOL_FIELD_TYPE, default_value=False | ||
| ) # TODO: We are fine with this default? | ||
| ROYALTY_COLUMN = InvoiceColumn(name=ROYALTY_FIELD, dtype=BALANCE_FIELD_TYPE) |
There was a problem hiding this comment.
@joachimweyl @naved001 @knikolla Are we fine with False as the default for this field. This will mean, if a Coldfront project does not specify the Is Externally Funded attribute, invoicing will assume it is internally funded.
| export_columns_list = [ # TODO: Confirm list of information we want to include in royalty report | ||
| invoice.INVOICE_DATE_FIELD, | ||
| invoice.PROJECT_FIELD, | ||
| invoice.PI_FIELD, | ||
| invoice.CLUSTER_NAME_FIELD, | ||
| invoice.INSTITUTION_FIELD, | ||
| invoice.SU_TYPE_FIELD, | ||
| invoice.BALANCE_FIELD, | ||
| invoice.ROYALTY_FIELD, | ||
| ] |
There was a problem hiding this comment.
@joachimweyl @knikolla @naved001 Are we fine with these sets of columns for now for the royalty invoice? Are there any other info we want to provide to RH?
| @dataclass | ||
| class PrepaymentProcessor(discount_processor.DiscountProcessor): | ||
| IS_DISCOUNT_BY_NERC = True | ||
| IS_DISCOUNT_BY_NERC = False |
There was a problem hiding this comment.
This change was to address the fact that prepayments are still subject to the royalty. With this change, the prepay discount will no longer impact the Balance column, which we've used to indicate the money we (the MOC) expect to obtain, which is our revenue, which is the actually value subject to the royalty, as opposed to the money PIs are expected to pay (PI Balance), which are not subject to the royalty.
This change will impact how the PI-specific invoices are exported, and as mentioned by @knikolla in slack, we may want to review how we handle these balance columns and refactor them.
@knikolla @naved001 Given that we have no prepayments yet, are we fine with postponing refactoring the balance fields after this PR is merged?
This involved several changes: - New field `moc_member` in institution list - New pipeline setting `royalty_rate`, default to fetching from nerc_rates - Coldfront processor will now obtain info on whether a project is externally funded from Coldfront API - New processor and invoice to calculate and export the royalties
Closes #303. I'll set this as draft, as I have some questions.
This involved several changes:
moc_memberin institution listroyalty_rate, default to fetching from nerc_rates