-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This invoice has custom output filepaths for S3, and only lists projects belonging to prepay groups not managed by MGHPCC
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from process_report.invoices import invoice | ||
import process_report.util as util | ||
|
||
|
||
class MOCAPrepaidInvoice(invoice.Invoice): | ||
export_columns_list = [ | ||
invoice.INVOICE_DATE_FIELD, | ||
invoice.PROJECT_FIELD, | ||
invoice.PROJECT_ID_FIELD, | ||
invoice.PI_FIELD, | ||
invoice.INVOICE_EMAIL_FIELD, | ||
invoice.INVOICE_ADDRESS_FIELD, | ||
invoice.INSTITUTION_FIELD, | ||
invoice.INSTITUTION_ID_FIELD, | ||
invoice.SU_HOURS_FIELD, | ||
invoice.SU_TYPE_FIELD, | ||
invoice.RATE_FIELD, | ||
invoice.GROUP_NAME_FIELD, | ||
invoice.GROUP_INSTITUTION_FIELD, | ||
invoice.GROUP_BALANCE_FIELD, | ||
invoice.COST_FIELD, | ||
invoice.GROUP_BALANCE_USED_FIELD, | ||
invoice.CREDIT_FIELD, | ||
invoice.CREDIT_CODE_FIELD, | ||
invoice.BALANCE_FIELD, | ||
] | ||
|
||
@property | ||
def output_path(self) -> str: | ||
return f"MOCA-A_Prepaid_Groups-{self.invoice_month}-Invoice.csv" | ||
|
||
@property | ||
def output_s3_key(self) -> str: | ||
return f"Invoices/{self.invoice_month}/MOCA-A_Prepaid_Groups-{self.invoice_month}-Invoice.csv" | ||
|
||
@property | ||
def output_s3_archive_key(self): | ||
return f"Invoices/{self.invoice_month}/Archive/MOCA-A_Prepaid_Groups-{self.invoice_month}-Invoice {util.get_iso8601_time()}.csv" | ||
|
||
def _prepare_export(self): | ||
self.data = self.data[self.data[invoice.GROUP_MANAGED_FIELD] == False] # noqa: E712 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters