Compare commits

...

5 Commits

Author SHA1 Message Date
Raphael Michel
dba9a56a67 Bump to 2.7.1 2019-05-14 09:16:14 +02:00
Raphael Michel
15f445cb3d Fix #1279 -- Incorrect initial price value in widget in German locale 2019-05-14 09:10:12 +02:00
Raphael Michel
c9f6c71c81 Fix #1282 -- Work around issues in file backends 2019-05-14 09:10:12 +02:00
Raphael Michel
2032d36ad6 Set original_price to TaxedPrice even with variations 2019-05-14 09:10:12 +02:00
Raphael Michel
ffb4cf08d1 Assign flag for zh_Hans 2019-05-14 09:10:12 +02:00
5 changed files with 21 additions and 4 deletions

View File

@@ -1 +1 @@
__version__ = "2.7.0"
__version__ = "2.7.1"

View File

@@ -1,7 +1,7 @@
import hashlib
from django.conf import settings
from django.core.files.base import ContentFile
from django.core.files.base import ContentFile, File
from django.core.files.storage import default_storage
from django.core.management.base import BaseCommand
@@ -35,4 +35,7 @@ class Command(BaseCommand):
gs.settings.set('widget_file_{}'.format(lc), 'file://' + newname)
gs.settings.set('widget_checksum_{}'.format(lc), checksum)
if fname:
default_storage.delete(fname)
if isinstance(fname, File):
default_storage.delete(fname.name)
else:
default_storage.delete(fname)

View File

@@ -146,6 +146,12 @@ def get_grouped_items(event, subevent=None, voucher=None, channel='web'):
display_add_to_cart = display_add_to_cart or item.order_max > 0
else:
item.original_price = (
item.tax(item.original_price, currency=event.currency, include_bundled=True,
base_price_is='net' if event.settings.display_net_prices else 'gross') # backwards-compat
if item.original_price else None
)
for var in item.available_variations:
if voucher and (voucher.allow_ignore_quota or voucher.block_quota):
var.cached_availability = (

View File

@@ -66,6 +66,7 @@ pre[lang=ck], input[lang=ck], textarea[lang=ck], div[lang=ck] { background-image
pre[lang=cl], input[lang=cl], textarea[lang=cl], div[lang=cl] { background-image: url(static('pretixbase/img/flags/cl.png')); }
pre[lang=cm], input[lang=cm], textarea[lang=cm], div[lang=cm] { background-image: url(static('pretixbase/img/flags/cm.png')); }
pre[lang=cn], input[lang=cn], textarea[lang=cn], div[lang=cn] { background-image: url(static('pretixbase/img/flags/cn.png')); }
pre[lang=zh-hans], input[lang=zh-hans], textarea[lang=zh-hans], div[lang=zh-hans] { background-image: url(static('pretixbase/img/flags/cn.png')); }
pre[lang=co], input[lang=co], textarea[lang=co], div[lang=co] { background-image: url(static('pretixbase/img/flags/co.png')); }
pre[lang=cr], input[lang=cr], textarea[lang=cr], div[lang=cr] { background-image: url(static('pretixbase/img/flags/cr.png')); }
pre[lang=cs], input[lang=cs], textarea[lang=cs], div[lang=cs] { background-image: url(static('pretixbase/img/flags/cs.png')); }

View File

@@ -234,7 +234,7 @@ Vue.component('pricebox', {
+ '<div v-if="free_price">'
+ '{{ $root.currency }} '
+ '<input type="number" class="pretix-widget-pricebox-price-input" placeholder="0" '
+ ' :min="display_price" :value="display_price" :name="field_name"'
+ ' :min="display_price_nonlocalized" :value="display_price_nonlocalized" :name="field_name"'
+ ' step="any">'
+ '</div>'
+ '<small class="pretix-widget-pricebox-tax" v-if="price.rate != \'0.00\' && price.gross != \'0.00\'">'
@@ -255,6 +255,13 @@ Vue.component('pricebox', {
return floatformat(parseFloat(this.price.gross), 2);
}
},
display_price_nonlocalized: function () {
if (this.$root.display_net_prices) {
return parseFloat(this.price.net).toFixed(2);
} else {
return parseFloat(this.price.gross).toFixed(2);
}
},
original_line: function () {
return this.$root.currency + " " + floatformat(parseFloat(this.original_price), 2);
},