diff --git a/osinaweb/billing/__pycache__/models.cpython-310.pyc b/osinaweb/billing/__pycache__/models.cpython-310.pyc index 65d3e9aa..5bebdfb3 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 597098bd..96805bb1 100644 --- a/osinaweb/billing/models.py +++ b/osinaweb/billing/models.py @@ -39,6 +39,12 @@ class Order(models.Model): order_id = models.CharField(max_length=100, null=True, blank=True) due_date = models.DateField(null=True) paid = models.BooleanField(null=True, default=False) + @property + def get_cart_total(self): + orderitems = self.orderitem_set.all() + total = sum([item.get_total for item in orderitems]) + return total + def save(self, *args, **kwargs): if not self.order_id: order_count = Order.objects.filter(customer=self.customer).count() @@ -53,6 +59,11 @@ class OrderItem(models.Model): purchased_at = models.DateField(null=True, blank=True) due_at = models.DateField(blank=True, null=True) recurring_cycle = models.ForeignKey(RecurringCycle, on_delete=models.SET_NULL, null=True, blank=True) + @property + def get_total(self): + total = self.item.amount + total = round(total, 2) + return total def save(self, *args, **kwargs): if self.purchased_at: try: diff --git a/osinaweb/customercore/__pycache__/urls.cpython-310.pyc b/osinaweb/customercore/__pycache__/urls.cpython-310.pyc index 851d795d..786b047b 100644 Binary files a/osinaweb/customercore/__pycache__/urls.cpython-310.pyc and b/osinaweb/customercore/__pycache__/urls.cpython-310.pyc differ diff --git a/osinaweb/customercore/__pycache__/views.cpython-310.pyc b/osinaweb/customercore/__pycache__/views.cpython-310.pyc index c4d49f55..a430825d 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-orders.html b/osinaweb/customercore/templates/listing_pages/customer-orders.html index a6c0804a..6832602c 100644 --- a/osinaweb/customercore/templates/listing_pages/customer-orders.html +++ b/osinaweb/customercore/templates/listing_pages/customer-orders.html @@ -37,49 +37,25 @@
-1
-Standard Osimenu
-$169
-Pending
-3
+{{order.order_id}}
Premium Osimenu
+ {% for item in order.orderitem_set.all %} +{{item.item.title}}
+ {% endfor %}$200
+${{order.get_cart_total}}
Completed
+{{order.status}}
Basic
@@ -46,11 +46,6 @@Best Value
-Standard
@@ -137,7 +132,7 @@Shared Basic
@@ -150,10 +145,6 @@Best Value
-OSICLOUD 1
@@ -205,10 +196,6 @@Best Value
-DEDICATED 1
@@ -270,10 +257,6 @@Best Value
-