update order list serializer add get order view and its permission
This commit is contained in:
+14
-14
@@ -59,7 +59,7 @@ class OrderModel(models.Model):
|
||||
bank_records = models.ManyToManyField(Bank, max_length=100, verbose_name='رکورد بانکی', null=True, blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return f'سفارش: {self.id}'
|
||||
return f'سفارش: {self.id + 1000}'
|
||||
|
||||
class Meta:
|
||||
verbose_name = 'سفارش'
|
||||
@@ -80,27 +80,27 @@ class OrderModel(models.Model):
|
||||
|
||||
|
||||
|
||||
def discount(self):
|
||||
# total_with_item_discount = sum(item.total_with_discount() for item in self.items.all())
|
||||
# discount_percent = self.discount_code.percent
|
||||
# return total_with_item_discount * ((100 - discount_percent) / 100)
|
||||
pass
|
||||
# def discount(self):
|
||||
# # total_with_item_discount = sum(item.total_with_discount() for item in self.items.all())
|
||||
# # discount_percent = self.discount_code.percent
|
||||
# # return total_with_item_discount * ((100 - discount_percent) / 100)
|
||||
# pass
|
||||
|
||||
|
||||
def tax(self):
|
||||
return self.total_without_tax() * 0.2
|
||||
# def tax(self):
|
||||
# return self.total_without_tax() * 0.2
|
||||
|
||||
|
||||
def total(self):
|
||||
pass
|
||||
# def total(self):
|
||||
# pass
|
||||
# return self.total_with_discount() + self.tax()
|
||||
|
||||
|
||||
def final_price(self):
|
||||
pass
|
||||
# def final_price(self):
|
||||
# pass
|
||||
|
||||
def submit_cart(self):
|
||||
pass
|
||||
# def submit_cart(self):
|
||||
# pass
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user