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 %}

@@ -59,8 +64,8 @@ - -

{{invoice.order.status}}

+ +

{{invoice.status}}

@@ -81,12 +86,19 @@ + {% if invoice.status == 'Not Completed' %} + {% else %} + + {% endif %} diff --git a/osinaweb/customercore/templates/listing_pages/customer-projects.html b/osinaweb/customercore/templates/listing_pages/customer-projects.html index 8ce26ad2..de7c5e41 100644 --- a/osinaweb/customercore/templates/listing_pages/customer-projects.html +++ b/osinaweb/customercore/templates/listing_pages/customer-projects.html @@ -8,24 +8,26 @@

My Projects

+ + {% for project in projects %}
- +
-

Geologist Safwat

-

P240022

+

{{project.name}}

+

{{project.project_id}}

-

Active

+

{{project.projectstatus_set.all.last.status}}

@@ -43,43 +45,7 @@
- - - -
-
-
- -
- -
-

Geologist Safwat

-

P240022

-
-
- -
-

Pending

-
- - -
-
-

May,2,2023

-

June,30,2023

-
-
-
- -
-
-
- -
-
+ {% endfor %}
diff --git a/osinaweb/customercore/views.py b/osinaweb/customercore/views.py index 9e6efd25..6a485385 100644 --- a/osinaweb/customercore/views.py +++ b/osinaweb/customercore/views.py @@ -150,6 +150,7 @@ def customer_add_ticket_update_reaction(request, reaction_type, ticketupdate_id) def customer_invoices(request, *args, **kwargs): invoices = Invoice.objects.filter(order__customer = request.user.customerprofile) + context = { 'invoices' : invoices, } @@ -388,8 +389,10 @@ def dedicated_servers_plans(request, *args, **kwargs): @customer_login_required def customer_projects(request, *args, **kwargs): + projects = Project.objects.filter(customer=request.user.customerprofile) context = { + 'projects': projects, } diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index e79970f5..ed107c5f 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/osinacore/__pycache__/models.cpython-310.pyc b/osinaweb/osinacore/__pycache__/models.cpython-310.pyc index 9a3d5bd5..4e55d11f 100644 Binary files a/osinaweb/osinacore/__pycache__/models.cpython-310.pyc and b/osinaweb/osinacore/__pycache__/models.cpython-310.pyc differ diff --git a/osinaweb/osinacore/migrations/0080_project_logo.py b/osinaweb/osinacore/migrations/0080_project_logo.py new file mode 100644 index 00000000..e6d73d36 --- /dev/null +++ b/osinaweb/osinacore/migrations/0080_project_logo.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.5 on 2024-05-12 13:05 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('osinacore', '0079_alter_project_end_date_alter_project_start_date'), + ] + + operations = [ + migrations.AddField( + model_name='project', + name='logo', + field=models.ImageField(blank=True, null=True, upload_to=''), + ), + ] diff --git a/osinaweb/osinacore/migrations/__pycache__/0080_project_logo.cpython-310.pyc b/osinaweb/osinacore/migrations/__pycache__/0080_project_logo.cpython-310.pyc new file mode 100644 index 00000000..9c7d754e Binary files /dev/null and b/osinaweb/osinacore/migrations/__pycache__/0080_project_logo.cpython-310.pyc differ diff --git a/osinaweb/osinacore/models.py b/osinaweb/osinacore/models.py index d7d61b75..12f87c4e 100644 --- a/osinaweb/osinacore/models.py +++ b/osinaweb/osinacore/models.py @@ -139,6 +139,7 @@ class ProjectType(models.Model): class Project(models.Model): name = models.CharField(max_length=50) + logo = models.ImageField(null=True, blank=True) customer = models.ForeignKey(CustomerProfile, on_delete=models.CASCADE, null=True) manager = models.ForeignKey(StaffProfile, on_delete=models.CASCADE, null=True) project_type = models.ManyToManyField('ProjectType', default='', related_name='manager_project') diff --git a/osinaweb/osinacore/templates/customer_main.html b/osinaweb/osinacore/templates/customer_main.html index 758a3c15..f1a315dc 100644 --- a/osinaweb/osinacore/templates/customer_main.html +++ b/osinaweb/osinacore/templates/customer_main.html @@ -417,101 +417,110 @@ {% block modules_section %}
-
-
-
-

Invoices

- - - - - - - - - -
-
-

{{customer_open_invoices_count}}

-
-
-
-
-
-
-

Projects

- - - - - - - - - - - - - - - - - + + + + -
-
-
-

Tickets

- - - - - - - - - - -
- +
{% endblock modules_section %} diff --git a/osinaweb/static/images/fbprofile.jpg b/osinaweb/static/images/fbprofile.jpg new file mode 100644 index 00000000..a9f0f3ed Binary files /dev/null and b/osinaweb/static/images/fbprofile.jpg differ