From 4c175a9142bdd4ebbd498c3757e7c27552ec8a01 Mon Sep 17 00:00:00 2001 From: Aaron Kitzmiller Date: Mon, 4 Nov 2024 13:29:57 -0500 Subject: [PATCH 1/2] Add a display, url for Lab Billing Summary, showing charges for the last 6 months for every lab that has charges during that period Checkbox filters the rows for those that have at least one empty table cell --- .gitignore | 1 + .../plugins/ifx/lab_billing_summary.html | 215 ++++++++++++++++++ coldfront/plugins/ifx/urls.py | 6 +- coldfront/plugins/ifx/views.py | 10 + ifxbilling | 2 +- 5 files changed, 231 insertions(+), 3 deletions(-) create mode 100644 coldfront/plugins/ifx/templates/plugins/ifx/lab_billing_summary.html diff --git a/.gitignore b/.gitignore index 44c14c4b7..e08e214d4 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ django-q.log media/reports* .devcontainer/* .bin/* +test.http diff --git a/coldfront/plugins/ifx/templates/plugins/ifx/lab_billing_summary.html b/coldfront/plugins/ifx/templates/plugins/ifx/lab_billing_summary.html new file mode 100644 index 000000000..bedaa0816 --- /dev/null +++ b/coldfront/plugins/ifx/templates/plugins/ifx/lab_billing_summary.html @@ -0,0 +1,215 @@ +{% extends "common/base.html" %} +{% load common_tags %} +{% load crispy_forms_tags %} +{% load static %} + +{% block ifx_head %} + + + + + + +{% endblock %} + +{% block title %} +Lab Billing Summary +{% endblock %} + +{% block content %} + +
+

Lab Billing Summary

+
+

+

+

+
+
+
+ + +
+
+ + +
+
+ +
+
+ +
+
+
+
+ + + + + +
+
+
+{% endblock %} \ No newline at end of file diff --git a/coldfront/plugins/ifx/urls.py b/coldfront/plugins/ifx/urls.py index 3cb87121f..fb072730e 100644 --- a/coldfront/plugins/ifx/urls.py +++ b/coldfront/plugins/ifx/urls.py @@ -1,10 +1,10 @@ from django.urls import path, include from rest_framework import routers from ifxbilling.views import unauthorized as unauthorized_api -from ifxbilling.views import get_orgs_with_billing +from ifxbilling.views import get_orgs_with_billing, get_charge_history from ifxuser.views import get_org_names from coldfront.plugins.ifx.viewsets import ColdfrontBillingRecordViewSet, ColdfrontReportRunViewSet, ColdfrontProductUsageViewSet -from coldfront.plugins.ifx.views import update_user_accounts_view, get_billing_record_list, unauthorized, report_runs, run_report, calculate_billing_month, billing_month, get_product_usages, billing_records, send_billing_record_review_notification +from coldfront.plugins.ifx.views import update_user_accounts_view, get_billing_record_list, unauthorized, report_runs, run_report, calculate_billing_month, billing_month, get_product_usages, billing_records, send_billing_record_review_notification, lab_billing_summary router = routers.DefaultRouter() router.register(r'billing-records', ColdfrontBillingRecordViewSet, 'billing-record') @@ -15,6 +15,7 @@ path('api/unauthorized/', unauthorized_api), path('api/billing/get-billing-record-list/', get_billing_record_list), path('api/billing/get-orgs-with-billing////', get_orgs_with_billing), + path('api/billing/get-charge-history/', get_charge_history), path('api/calculate-billing-month///', calculate_billing_month), path('api/run-report/', run_report), path('api/get-org-names/', get_org_names, name='get-org-names'), @@ -26,4 +27,5 @@ path('report-runs/', report_runs, name='report-runs'), path('billing-month/', billing_month, name='billing-month'), path('billing-records/', billing_records, name='billing-records'), + path('lab-billing-summary/', lab_billing_summary, name='lab-billing-summary'), ] diff --git a/coldfront/plugins/ifx/views.py b/coldfront/plugins/ifx/views.py index 97cbffe5a..30aef1136 100644 --- a/coldfront/plugins/ifx/views.py +++ b/coldfront/plugins/ifx/views.py @@ -327,3 +327,13 @@ def update_user_accounts_view(request): ) return Response('OK') + +@login_required +def lab_billing_summary(request): + ''' + Show lab billing summary + ''' + if not request.user.is_superuser: + raise PermissionDenied + token = request.user.auth_token.key + return render(request, 'plugins/ifx/lab_billing_summary.html', { 'auth_token': token }) diff --git a/ifxbilling b/ifxbilling index b937bbdc9..c8bcbec53 160000 --- a/ifxbilling +++ b/ifxbilling @@ -1 +1 @@ -Subproject commit b937bbdc93186f4c3412c18cf1062cfa974ec3ed +Subproject commit c8bcbec538f5adc6e03353424e91470b85671763 From 3a9c52990744d08fbfe10231930088867a16a985 Mon Sep 17 00:00:00 2001 From: Aaron Kitzmiller Date: Mon, 4 Nov 2024 14:09:01 -0500 Subject: [PATCH 2/2] default isilon not working --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c271e65f7..b2c2f099a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -51,7 +51,7 @@ django-tables2==2.3.4 djangorestframework==3.15.2 djangorestframework-datatables==0.7.0 ipython==7.16.3 -isilon-sdk +isilon-sdk==0.3.0.1 ldap3 logging_tree==1.9 mysqlclient==2.2.0