diff --git a/osinaweb/billing/__pycache__/models.cpython-310.pyc b/osinaweb/billing/__pycache__/models.cpython-310.pyc index a5e583c3..9aeed20c 100644 Binary files a/osinaweb/billing/__pycache__/models.cpython-310.pyc and b/osinaweb/billing/__pycache__/models.cpython-310.pyc differ diff --git a/osinaweb/billing/models.py b/osinaweb/billing/models.py index 429a669d..3956c37d 100644 --- a/osinaweb/billing/models.py +++ b/osinaweb/billing/models.py @@ -95,6 +95,13 @@ class Invoice(models.Model): pdf = models.FileField(upload_to='generated_invoices', null=True, blank=True) def __str__(self): return self.invoice_number + @property + def status(self): + payments = OrderPayment.objects.filter(order=self.order) + if all(payment.date_paid for payment in payments): + return "Completed" + else: + return "Not Completed" def save(self, *args, **kwargs): if not self.invoice_number: current_year = str(timezone.now().year)[-2:] diff --git a/osinaweb/customercore/__pycache__/views.cpython-310.pyc b/osinaweb/customercore/__pycache__/views.cpython-310.pyc index 5a22e0ff..7f324cff 100644 Binary files a/osinaweb/customercore/__pycache__/views.cpython-310.pyc and b/osinaweb/customercore/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/customercore/templates/listing_pages/customer-invoices.html b/osinaweb/customercore/templates/listing_pages/customer-invoices.html index bbe8730f..0bf4d3c1 100644 --- a/osinaweb/customercore/templates/listing_pages/customer-invoices.html +++ b/osinaweb/customercore/templates/listing_pages/customer-invoices.html @@ -46,7 +46,12 @@
{{invoice.order.due_date}}
++ {% if invoice.order.orderpayment_set.all.last.date_due %} + {{invoice.order.orderpayment_set.all.last.date_due}} + {% else %} + - + {% endif %}
{{invoice.order.status}}
+{{invoice.status}}
Geologist Safwat
-P240022
+{{project.name}}
+{{project.project_id}}
Active
+{{project.projectstatus_set.all.last.status}}
Geologist Safwat
-P240022
-Pending
-May,2,2023
-June,30,2023
-Invoices
- - -{{customer_open_invoices_count}}
-Projects
- + + +Invoices
+ + +{{customer_open_invoices_count}}
+{{customer_open_projects_count}}
+Projects
+ +{{customer_open_projects_count}}
+Tickets
- -{{customer_open_tickets_count}}
+ +Tickets
+ +{{customer_open_tickets_count}}
+