Selaa lähdekoodia

Pass the tax code trough the shipping discounts

master
Viggo de Vries 1 vuosi sitten
vanhempi
commit
4b59500e2b
1 muutettua tiedostoa jossa 9 lisäystä ja 2 poistoa
  1. 9
    2
      src/oscar/apps/shipping/methods.py

+ 9
- 2
src/oscar/apps/shipping/methods.py Näytä tiedosto

@@ -160,7 +160,11 @@ class TaxExclusiveOfferDiscount(OfferDiscount):
160 160
             base_charge.excl_tax, base_charge.currency
161 161
         )
162 162
         excl_tax = base_charge.excl_tax - discount
163
-        return prices.Price(currency=base_charge.currency, excl_tax=excl_tax)
163
+        return prices.Price(
164
+            currency=base_charge.currency,
165
+            excl_tax=excl_tax,
166
+            tax_code=base_charge.tax_code,
167
+        )
164 168
 
165 169
     def discount(self, basket):
166 170
         base_charge = self.method.calculate(basket)
@@ -180,7 +184,10 @@ class TaxInclusiveOfferDiscount(OfferDiscount):
180 184
         incl_tax = base_charge.incl_tax - discount
181 185
         excl_tax = self.calculate_excl_tax(base_charge, incl_tax)
182 186
         return prices.Price(
183
-            currency=base_charge.currency, excl_tax=excl_tax, incl_tax=incl_tax
187
+            currency=base_charge.currency,
188
+            excl_tax=excl_tax,
189
+            incl_tax=incl_tax,
190
+            tax_code=base_charge.tax_code,
184 191
         )
185 192
 
186 193
     def calculate_excl_tax(self, base_charge, incl_tax):

Loading…
Peruuta
Tallenna