File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from dataclasses import dataclass
2+
3+
4+ from process_report .invoices import invoice
5+
6+
7+ @dataclass
8+ class BMInvoice (invoice .Invoice ):
9+ export_columns_list = [
10+ invoice .INVOICE_DATE_FIELD ,
11+ invoice .PROJECT_FIELD ,
12+ invoice .PROJECT_ID_FIELD ,
13+ invoice .PI_FIELD ,
14+ invoice .INVOICE_EMAIL_FIELD ,
15+ invoice .INVOICE_ADDRESS_FIELD ,
16+ invoice .INSTITUTION_FIELD ,
17+ invoice .INSTITUTION_ID_FIELD ,
18+ invoice .SU_HOURS_FIELD ,
19+ invoice .SU_TYPE_FIELD ,
20+ invoice .RATE_FIELD ,
21+ invoice .COST_FIELD ,
22+ invoice .CREDIT_FIELD ,
23+ invoice .CREDIT_CODE_FIELD ,
24+ invoice .BALANCE_FIELD ,
25+ ]
26+
27+ def _prepare_export (self ):
28+ self .export_data = self .data [
29+ self .data [invoice .PROJECT_ID_FIELD ] == "ESI Bare Metal"
30+ ]
Original file line number Diff line number Diff line change 99
1010from process_report import util
1111from process_report .invoices import (
12+ bm_invoice ,
1213 lenovo_invoice ,
1314 nonbillable_invoice ,
1415 billable_invoice ,
@@ -190,6 +191,12 @@ def main():
190191 default = "Lenovo" ,
191192 help = "Name of output csv for Lenovo SU Types invoice" ,
192193 )
194+ parser .add_argument (
195+ "--bm-usage-file" ,
196+ required = False ,
197+ default = "bm_usage" ,
198+ help = "Name of output csv for Lenovo SU Types invoice" ,
199+ )
193200 parser .add_argument (
194201 "--old-pi-file" ,
195202 required = False ,
@@ -366,6 +373,10 @@ def main():
366373 name = "" , invoice_month = invoice_month , data = processed_data .copy ()
367374 )
368375
376+ bm_inv = bm_invoice .BMInvoice (
377+ name = args .bm_usage_file , invoice_month = invoice_month , data = processed_data
378+ )
379+
369380 util .process_and_export_invoices (
370381 [
371382 lenovo_inv ,
@@ -375,6 +386,7 @@ def main():
375386 bu_internal_inv ,
376387 pi_inv ,
377388 moca_prepaid_inv ,
389+ bm_inv ,
378390 ],
379391 args .upload_to_s3 ,
380392 )
You can’t perform that action at this time.
0 commit comments