emile 10 months ago
parent f8f1ba1bbc
commit 1ea62f5f90

@ -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=''),
),
]

@ -16,6 +16,7 @@ class Item(models.Model):
item_type = models.ForeignKey(ProjectType, on_delete=models.CASCADE, null=True, blank=True) item_type = models.ForeignKey(ProjectType, on_delete=models.CASCADE, null=True, blank=True)
amount = models.FloatField(null=True) amount = models.FloatField(null=True)
recurring = models.BooleanField(default=False) recurring = models.BooleanField(default=False)
photo = models.ImageField(null=True, blank=True)
def __str__(self): def __str__(self):
return self.title return self.title

Binary file not shown.

@ -302,20 +302,26 @@
</div> </div>
<div class="grid grid-cols-1 s:grid-cols-2 l:grid-cols-3 gap-3 mt-3"> <div class="grid grid-cols-1 s:grid-cols-2 l:grid-cols-3 gap-3 mt-3">
<div {% 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">
<div <div
class="w-full py-8 px-3 bg-gray-50 flex justify-center items-center rounded-t-md relative h-[130px]"> class="flex flex-col justify-center items-center shadow-md rounded-md cursor-pointer hover:scale-105 transition-transform duration-300 relative">
<img src="{% static 'images/ositcom_logos/osicardblue.png' %}" class="w-[80%] h-auto"> <div
class="w-full py-8 px-3 bg-gray-50 flex justify-center items-center rounded-t-md relative h-[130px]">
{% if subscription.item.item_type.name == 'OSIMENU' %}
<img src="{% static 'images/ositcom_logos/osimenublue.png' %}" class="w-[80%] h-auto">
{% elif subscription.item.item_type.name == 'OSICARD' %}
<img src="{% static 'images/ositcom_logos/osicardblue.png' %}" class="w-[80%] h-auto">
{% endif %}
</div>
<div class="w-full bg-white border border-gray-100 shadow-md flex justify-start items-center p-3">
<p class="text-secondosiblue text-base">Expires:{% if subscription.end_at %} <span
class="font-semibold">{{subscription.end_at}} {% else %} <span class="font-semibold">No
Expiry {% endif %}</span>
</p>
</div>
</div> </div>
<div class="w-full bg-white border border-gray-100 shadow-md flex justify-start items-center p-3"> {% endfor %}
<p class="text-secondosiblue text-base">Expires:{% if subscription.end_at %} <span
class="font-semibold">{{subscription.end_at}} {% else %} <span class="font-semibold">No
Expiry {% endif %}</span>
</p>
</div>
</div>
</div> </div>
</div> </div>

@ -465,13 +465,14 @@ def tags(request):
def customerdetails(request, customer_id): def customerdetails(request, customer_id):
customer = get_object_or_404(CustomerProfile, customer_id=customer_id) customer = get_object_or_404(CustomerProfile, customer_id=customer_id)
customer_projects = Project.objects.filter(customer=customer).order_by('-id') customer_projects = Project.objects.filter(customer=customer).order_by('-id')
customer_payments = OrderPayment.objects.filter(order__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 = { context = {
'customer' : customer, 'customer' : customer,
'customer_projects' : customer_projects, '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) return render(request, 'details_templates/customer-details.html', context)

Loading…
Cancel
Save