|
|
@@ -1,5 +1,5 @@
|
|
1
|
1
|
import zlib
|
|
2
|
|
-from decimal import Decimal as D
|
|
|
2
|
+from decimal import Decimal as D, ROUND_HALF_DOWN
|
|
3
|
3
|
from operator import itemgetter
|
|
4
|
4
|
|
|
5
|
5
|
from django.conf import settings
|
|
|
@@ -983,12 +983,15 @@ class AbstractLine(models.Model):
|
|
983
|
983
|
if self.line_price_incl_tax is not None and incl_tax_discounts:
|
|
984
|
984
|
return max(0, self.line_price_incl_tax - self._discount_incl_tax)
|
|
985
|
985
|
elif self.line_price_excl_tax is not None and excl_tax_discounts:
|
|
986
|
|
- return max(
|
|
987
|
|
- 0,
|
|
988
|
|
- round_half_up(
|
|
989
|
|
- (self.line_price_excl_tax - excl_tax_discounts) / self._tax_ratio
|
|
990
|
|
- ),
|
|
991
|
|
- )
|
|
|
986
|
+ return round_half_up(self.line_price_excl_tax_incl_discounts / self._tax_ratio)
|
|
|
987
|
+ # return max(0, self.line_price_incl_tax - (excl_tax_discounts / self._tax_ratio).quantize(D("0.01"), ROUND_HALF_DOWN))
|
|
|
988
|
+ # return max(0, self.line_price_incl_tax - round_half_up(excl_tax_discounts / self._tax_ratio))
|
|
|
989
|
+ # return max(
|
|
|
990
|
+ # 0,
|
|
|
991
|
+ # round_half_up(
|
|
|
992
|
+ # (self.line_price_excl_tax - excl_tax_discounts) / self._tax_ratio
|
|
|
993
|
+ # ),
|
|
|
994
|
+ # )
|
|
992
|
995
|
|
|
993
|
996
|
return self.line_price_incl_tax
|
|
994
|
997
|
|