emile 11 months ago
parent c11d964b51
commit 621306c28d

BIN
.DS_Store vendored

Binary file not shown.

@ -42,6 +42,15 @@ class Order(models.Model):
total = sum([item.get_total for item in orderitems])
return total
@property
def get_paid_amount(self):
payments = self.orderpayment_set.filter(date_paid__isnull=False)
total_paid = sum([payment.amount for payment in payments])
return total_paid
@property
def remaining_balance(self):
return self.get_cart_total - self.get_paid_amount
@property
def get_purchased_date(self):
first_orderitem = self.orderitem_set.first()
if first_orderitem:

@ -26,7 +26,7 @@
</div>
<p class="text-secondosiblue font-poppinsBold">Remaining Balance: $<span>12.00</span></p>
<p class="text-secondosiblue font-poppinsBold">Remaining Balance: $<span>{{order.remaining_balance}}</span></p>
</div>
<div

@ -318,7 +318,7 @@ def buy_free_osicard(request):
'first_name': request.user.first_name,
'last_name': request.user.last_name
},
'customer': {
'profile': {
'mobile_number': request.user.customerprofile.mobile_number
},
'subscription': {

@ -23,7 +23,7 @@
</div>
<p class="text-secondosiblue font-poppinsBold">Remaining Balance: $<span>12.00</span></p>
<p class="text-secondosiblue font-poppinsBold">Remaining Balance: $<span>{{order.remaining_balance}}</span></p>
</div>
<div

@ -5,7 +5,7 @@
<div class="w-full px-5 s:px-9 flex flex-col gap-3">
<!-- INVOICES -->
<div class="w-full bg-white rounded-md h-fit shadow-md p-5">
<h1 class="text-secondosiblue text-[25px]">Invoices</h1>
<h1 class="text-secondosiblue text-[25px]">My Invoices</h1>
<div class="overflow-x-auto border border-gray-300 rounded-md mt-4">
<table class="min-w-full divide-y">
<!-- TABLE HEADER -->

Binary file not shown.
Loading…
Cancel
Save