diff --git a/process_report/invoices/hu_bu_invoice.py b/process_report/invoices/NERC_total_invoice.py similarity index 60% rename from process_report/invoices/hu_bu_invoice.py rename to process_report/invoices/NERC_total_invoice.py index 96817aa..9133333 100644 --- a/process_report/invoices/hu_bu_invoice.py +++ b/process_report/invoices/NERC_total_invoice.py @@ -5,7 +5,17 @@ @dataclass -class HUBUInvoice(invoice.Invoice): +class NERCTotalInvoice(invoice.Invoice): + INCLUDED_INSTITUTIONS = [ + "Harvard University", + "Boston University", + "University of Rhode Island", + ] + + @property + def output_path(self) -> str: + return f"NERC-{self.invoice_month}-Total-Invoice.csv" + @property def output_s3_key(self) -> str: return ( @@ -18,6 +28,5 @@ def output_s3_archive_key(self): def _prepare_export(self): self.data = self.data[ - (self.data[invoice.INSTITUTION_FIELD] == "Harvard University") - | (self.data[invoice.INSTITUTION_FIELD] == "Boston University") + self.data[invoice.INSTITUTION_FIELD].isin(self.INCLUDED_INSTITUTIONS) ].copy() diff --git a/process_report/process_report.py b/process_report/process_report.py index 8af2545..8797b53 100644 --- a/process_report/process_report.py +++ b/process_report/process_report.py @@ -14,7 +14,7 @@ lenovo_invoice, nonbillable_invoice, billable_invoice, - hu_bu_invoice, + NERC_total_invoice, ) @@ -173,9 +173,9 @@ def main(): help="Name of output csv for BU invoices", ) parser.add_argument( - "--HU-BU-invoice-file", + "--NERC-total-invoice-file", required=False, - default="HU_BU", + default="NERC", help="Name of output csv for HU and BU invoice", ) parser.add_argument( @@ -270,16 +270,16 @@ def main(): billable_inv.process() billable_inv.export() - hu_bu_inv = hu_bu_invoice.HUBUInvoice( - name=args.HU_BU_invoice_file, + nerc_total_inv = NERC_total_invoice.NERCTotalInvoice( + name=args.NERC_total_invoice_file, invoice_month=invoice_month, data=billable_inv.data, ) - hu_bu_inv.process() - hu_bu_inv.export() + nerc_total_inv.process() + nerc_total_inv.export() if args.upload_to_s3: - for invoice in [billable_inv, hu_bu_inv]: + for invoice in [billable_inv, nerc_total_inv]: bucket = get_invoice_bucket() invoice.export_s3(bucket)