diff --git a/osinaweb/billing/__pycache__/models.cpython-310.pyc b/osinaweb/billing/__pycache__/models.cpython-310.pyc index 53ba5160..9be8db96 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/migrations/0053_item_photo.py b/osinaweb/billing/migrations/0053_item_photo.py new file mode 100644 index 00000000..0b67d45b --- /dev/null +++ b/osinaweb/billing/migrations/0053_item_photo.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.5 on 2024-07-18 07:22 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('billing', '0052_alter_orderstatus_status'), + ] + + operations = [ + migrations.AddField( + model_name='item', + name='photo', + field=models.ImageField(blank=True, null=True, upload_to=''), + ), + ] diff --git a/osinaweb/billing/migrations/__pycache__/0053_item_photo.cpython-310.pyc b/osinaweb/billing/migrations/__pycache__/0053_item_photo.cpython-310.pyc new file mode 100644 index 00000000..ed9f24ac Binary files /dev/null and b/osinaweb/billing/migrations/__pycache__/0053_item_photo.cpython-310.pyc differ diff --git a/osinaweb/billing/models.py b/osinaweb/billing/models.py index 47b2c202..ba6733f2 100644 --- a/osinaweb/billing/models.py +++ b/osinaweb/billing/models.py @@ -16,6 +16,7 @@ class Item(models.Model): item_type = models.ForeignKey(ProjectType, on_delete=models.CASCADE, null=True, blank=True) amount = models.FloatField(null=True) recurring = models.BooleanField(default=False) + photo = models.ImageField(null=True, blank=True) def __str__(self): return self.title diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index 56bab1e8..3d9790ec 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/osinacore/__pycache__/views.cpython-310.pyc b/osinaweb/osinacore/__pycache__/views.cpython-310.pyc index e73bf97e..819703dd 100644 Binary files a/osinaweb/osinacore/__pycache__/views.cpython-310.pyc and b/osinaweb/osinacore/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/osinacore/templates/details_templates/customer-details.html b/osinaweb/osinacore/templates/details_templates/customer-details.html index 20d3b6fd..34408c89 100644 --- a/osinaweb/osinacore/templates/details_templates/customer-details.html +++ b/osinaweb/osinacore/templates/details_templates/customer-details.html @@ -302,20 +302,26 @@
-
+ {% for subscription in customer_active_subscriptions %}
- + class="flex flex-col justify-center items-center shadow-md rounded-md cursor-pointer hover:scale-105 transition-transform duration-300 relative"> +
+ {% if subscription.item.item_type.name == 'OSIMENU' %} + + {% elif subscription.item.item_type.name == 'OSICARD' %} + + {% endif %} +
+
+

Expires:{% if subscription.end_at %} {{subscription.end_at}} {% else %} No + Expiry {% endif %} +

+
-
-

Expires:{% if subscription.end_at %} {{subscription.end_at}} {% else %} No - Expiry {% endif %} -

-
-
+ {% endfor %}
diff --git a/osinaweb/osinacore/views.py b/osinaweb/osinacore/views.py index 24c5ae08..d2e7dc0d 100644 --- a/osinaweb/osinacore/views.py +++ b/osinaweb/osinacore/views.py @@ -465,13 +465,14 @@ def tags(request): def customerdetails(request, customer_id): customer = get_object_or_404(CustomerProfile, customer_id=customer_id) customer_projects = Project.objects.filter(customer=customer).order_by('-id') - customer_payments = OrderPayment.objects.filter(order__customer=customer).order_by('-id') + customer_active_subscriptions = OrderItem.objects.filter(active=True, order__customer=customer) context = { 'customer' : customer, 'customer_projects' : customer_projects, - 'customer_payments': customer_payments + 'customer_payments': customer_payments, + 'customer_active_subscriptions': customer_active_subscriptions, } return render(request, 'details_templates/customer-details.html', context)