|
|
@@ -166,20 +166,16 @@ class AbstractOrder(models.Model):
|
|
166
|
166
|
"""
|
|
167
|
167
|
Return basket total including tax but before discounts are applied
|
|
168
|
168
|
"""
|
|
169
|
|
- total = D('0.00')
|
|
170
|
|
- for line in self.lines.all():
|
|
171
|
|
- total += line.line_price_before_discounts_incl_tax
|
|
172
|
|
- return total
|
|
|
169
|
+ result = self.lines.aggregate(total=Sum('line_price_before_discounts_incl_tax'))
|
|
|
170
|
+ return result['total']
|
|
173
|
171
|
|
|
174
|
172
|
@property
|
|
175
|
173
|
def basket_total_before_discounts_excl_tax(self):
|
|
176
|
174
|
"""
|
|
177
|
175
|
Return basket total excluding tax but before discounts are applied
|
|
178
|
176
|
"""
|
|
179
|
|
- total = D('0.00')
|
|
180
|
|
- for line in self.lines.all():
|
|
181
|
|
- total += line.line_price_before_discounts_excl_tax
|
|
182
|
|
- return total
|
|
|
177
|
+ result = self.lines.aggregate(total=Sum('line_price_before_discounts_excl_tax'))
|
|
|
178
|
+ return result['total']
|
|
183
|
179
|
|
|
184
|
180
|
@property
|
|
185
|
181
|
def basket_total_incl_tax(self):
|