Increase size of monetary decimal fields

This commit is contained in:
Raphael Michel
2023-03-16 21:26:37 +01:00
parent e9ab0d8654
commit 4c9640561c
19 changed files with 248 additions and 65 deletions

View File

@@ -52,7 +52,7 @@ from pretix.base.models import (
class InlineItemVariationSerializer(I18nAwareModelSerializer):
price = serializers.DecimalField(read_only=True, decimal_places=2, max_digits=10,
price = serializers.DecimalField(read_only=True, decimal_places=2, max_digits=13,
coerce_to_string=True)
meta_data = MetaDataField(required=False, source='*')
@@ -76,7 +76,7 @@ class InlineItemVariationSerializer(I18nAwareModelSerializer):
class ItemVariationSerializer(I18nAwareModelSerializer):
price = serializers.DecimalField(read_only=True, decimal_places=2, max_digits=10,
price = serializers.DecimalField(read_only=True, decimal_places=2, max_digits=13,
coerce_to_string=True)
meta_data = MetaDataField(required=False, source='*')

View File

@@ -781,7 +781,7 @@ class OrderPositionCreateSerializer(I18nAwareModelSerializer):
attendee_name = serializers.CharField(required=False, allow_null=True)
seat = serializers.CharField(required=False, allow_null=True)
price = serializers.DecimalField(required=False, allow_null=True, decimal_places=2,
max_digits=10)
max_digits=13)
voucher = serializers.SlugRelatedField(slug_field='code', queryset=Voucher.objects.none(),
required=False, allow_null=True)
country = CompatibleCountryField(source='*')

View File

@@ -47,7 +47,7 @@ class OrderPositionCreateForExistingOrderSerializer(OrderPositionCreateSerialize
attendee_name = serializers.CharField(required=False, allow_null=True)
seat = serializers.CharField(required=False, allow_null=True)
price = serializers.DecimalField(required=False, allow_null=True, decimal_places=2,
max_digits=10)
max_digits=13)
country = CompatibleCountryField(source='*')
class Meta:

View File

@@ -128,7 +128,7 @@ class MembershipSerializer(I18nAwareModelSerializer):
class GiftCardSerializer(I18nAwareModelSerializer):
value = serializers.DecimalField(max_digits=10, decimal_places=2, min_value=Decimal('0.00'))
value = serializers.DecimalField(max_digits=13, decimal_places=2, min_value=Decimal('0.00'))
def validate(self, data):
data = super().validate(data)

View File

@@ -1507,7 +1507,7 @@ class PaymentViewSet(CreateModelMixin, viewsets.ReadOnlyModelViewSet):
@action(detail=True, methods=['POST'])
def refund(self, request, **kwargs):
payment = self.get_object()
amount = serializers.DecimalField(max_digits=10, decimal_places=2).to_internal_value(
amount = serializers.DecimalField(max_digits=13, decimal_places=2).to_internal_value(
request.data.get('amount', str(payment.amount))
)
if 'mark_refunded' in request.data:

View File

@@ -197,7 +197,7 @@ class GiftCardViewSet(viewsets.ModelViewSet):
@transaction.atomic()
def transact(self, request, **kwargs):
gc = GiftCard.objects.select_for_update(of=OF_SELF).get(pk=self.get_object().pk)
value = serializers.DecimalField(max_digits=10, decimal_places=2).to_internal_value(
value = serializers.DecimalField(max_digits=13, decimal_places=2).to_internal_value(
request.data.get('value')
)
text = serializers.CharField(allow_blank=True, allow_null=True).to_internal_value(

View File

@@ -44,8 +44,8 @@ class Command(BaseCommand):
OrderPosition.objects.filter(
order=OuterRef('pk')
).order_by().values('order').annotate(p=Sum('price')).values('p'),
output_field=models.DecimalField(decimal_places=2, max_digits=10)
), Value(0), output_field=models.DecimalField(decimal_places=2, max_digits=10)
output_field=models.DecimalField(decimal_places=2, max_digits=13)
), Value(0), output_field=models.DecimalField(decimal_places=2, max_digits=13)
),
position_cnt=Case(
When(Q(status__in=('e', 'c')) | Q(require_approval=True), then=Value(0)),
@@ -64,16 +64,16 @@ class Command(BaseCommand):
OrderFee.objects.filter(
order=OuterRef('pk')
).order_by().values('order').annotate(p=Sum('value')).values('p'),
output_field=models.DecimalField(decimal_places=2, max_digits=10)
), Value(0), output_field=models.DecimalField(decimal_places=2, max_digits=10)
output_field=models.DecimalField(decimal_places=2, max_digits=13)
), Value(0), output_field=models.DecimalField(decimal_places=2, max_digits=13)
),
tx_total=Coalesce(
Subquery(
Transaction.objects.filter(
order=OuterRef('pk')
).order_by().values('order').annotate(p=Sum(F('price') * F('count'))).values('p'),
output_field=models.DecimalField(decimal_places=2, max_digits=10)
), Value(0), output_field=models.DecimalField(decimal_places=2, max_digits=10)
output_field=models.DecimalField(decimal_places=2, max_digits=13)
), Value(0), output_field=models.DecimalField(decimal_places=2, max_digits=13)
),
tx_cnt=Coalesce(
Subquery(
@@ -81,15 +81,15 @@ class Command(BaseCommand):
order=OuterRef('pk'),
item__isnull=False,
).order_by().values('order').annotate(p=Sum(F('count'))).values('p'),
output_field=models.DecimalField(decimal_places=2, max_digits=10)
), Value(0), output_field=models.DecimalField(decimal_places=2, max_digits=10)
output_field=models.DecimalField(decimal_places=2, max_digits=13)
), Value(0), output_field=models.DecimalField(decimal_places=2, max_digits=13)
),
).annotate(
correct_total=Case(
When(Q(status=Order.STATUS_CANCELED) | Q(status=Order.STATUS_EXPIRED) | Q(require_approval=True),
then=Value(0)),
default=F('position_total') + F('fee_total'),
output_field=models.DecimalField(decimal_places=2, max_digits=10)
output_field=models.DecimalField(decimal_places=2, max_digits=13)
),
).exclude(
total=F('position_total') + F('fee_total'),

View File

@@ -0,0 +1,165 @@
# Generated by Django 3.2.18 on 2023-03-16 20:23
from decimal import Decimal
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pretixbase', '0234_total_ordering'),
]
operations = [
migrations.AlterField(
model_name='cancellationrequest',
name='cancellation_fee',
field=models.DecimalField(decimal_places=2, max_digits=13),
),
migrations.AlterField(
model_name='cartposition',
name='custom_price_input',
field=models.DecimalField(decimal_places=2, max_digits=13, null=True),
),
migrations.AlterField(
model_name='cartposition',
name='line_price_gross',
field=models.DecimalField(decimal_places=2, max_digits=13, null=True),
),
migrations.AlterField(
model_name='cartposition',
name='listed_price',
field=models.DecimalField(decimal_places=2, max_digits=13, null=True),
),
migrations.AlterField(
model_name='cartposition',
name='price',
field=models.DecimalField(decimal_places=2, max_digits=13),
),
migrations.AlterField(
model_name='cartposition',
name='price_after_voucher',
field=models.DecimalField(decimal_places=2, max_digits=13, null=True),
),
migrations.AlterField(
model_name='discount',
name='condition_min_value',
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=13),
),
migrations.AlterField(
model_name='giftcardtransaction',
name='value',
field=models.DecimalField(decimal_places=2, max_digits=13),
),
migrations.AlterField(
model_name='invoice',
name='foreign_currency_rate',
field=models.DecimalField(decimal_places=4, max_digits=13, null=True),
),
migrations.AlterField(
model_name='invoiceline',
name='gross_value',
field=models.DecimalField(decimal_places=2, max_digits=13),
),
migrations.AlterField(
model_name='invoiceline',
name='tax_value',
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=13),
),
migrations.AlterField(
model_name='item',
name='default_price',
field=models.DecimalField(decimal_places=2, max_digits=13, null=True),
),
migrations.AlterField(
model_name='item',
name='original_price',
field=models.DecimalField(decimal_places=2, max_digits=13, null=True),
),
migrations.AlterField(
model_name='itembundle',
name='designated_price',
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=13),
),
migrations.AlterField(
model_name='itemvariation',
name='default_price',
field=models.DecimalField(decimal_places=2, max_digits=13, null=True),
),
migrations.AlterField(
model_name='itemvariation',
name='original_price',
field=models.DecimalField(decimal_places=2, max_digits=13, null=True),
),
migrations.AlterField(
model_name='order',
name='total',
field=models.DecimalField(decimal_places=2, max_digits=13),
),
migrations.AlterField(
model_name='orderfee',
name='tax_value',
field=models.DecimalField(decimal_places=2, max_digits=13),
),
migrations.AlterField(
model_name='orderfee',
name='value',
field=models.DecimalField(decimal_places=2, max_digits=13),
),
migrations.AlterField(
model_name='orderpayment',
name='amount',
field=models.DecimalField(decimal_places=2, max_digits=13),
),
migrations.AlterField(
model_name='orderposition',
name='price',
field=models.DecimalField(decimal_places=2, max_digits=13),
),
migrations.AlterField(
model_name='orderposition',
name='tax_value',
field=models.DecimalField(decimal_places=2, max_digits=13),
),
migrations.AlterField(
model_name='orderposition',
name='voucher_budget_use',
field=models.DecimalField(decimal_places=2, max_digits=13, null=True),
),
migrations.AlterField(
model_name='orderrefund',
name='amount',
field=models.DecimalField(decimal_places=2, max_digits=13),
),
migrations.AlterField(
model_name='subeventitem',
name='price',
field=models.DecimalField(decimal_places=2, max_digits=13, null=True),
),
migrations.AlterField(
model_name='subeventitemvariation',
name='price',
field=models.DecimalField(decimal_places=2, max_digits=13, null=True),
),
migrations.AlterField(
model_name='transaction',
name='price',
field=models.DecimalField(decimal_places=2, max_digits=13),
),
migrations.AlterField(
model_name='transaction',
name='tax_value',
field=models.DecimalField(decimal_places=2, max_digits=13),
),
migrations.AlterField(
model_name='voucher',
name='budget',
field=models.DecimalField(decimal_places=2, max_digits=13, null=True),
),
migrations.AlterField(
model_name='voucher',
name='value',
field=models.DecimalField(decimal_places=2, max_digits=13, null=True),
),
]

View File

@@ -116,7 +116,7 @@ class Discount(LoggedModel):
condition_min_value = models.DecimalField(
verbose_name=_('Minimum gross value of matching products'),
decimal_places=2,
max_digits=10,
max_digits=13,
default=Decimal('0.00'),
)

View File

@@ -129,7 +129,7 @@ class GiftCardTransaction(models.Model):
)
value = models.DecimalField(
decimal_places=2,
max_digits=10
max_digits=13
)
order = models.ForeignKey(
'Order',

View File

@@ -152,7 +152,7 @@ class Invoice(models.Model):
footer_text = models.TextField(blank=True)
foreign_currency_display = models.CharField(max_length=50, null=True, blank=True)
foreign_currency_rate = models.DecimalField(decimal_places=4, max_digits=10, null=True, blank=True)
foreign_currency_rate = models.DecimalField(decimal_places=4, max_digits=13, null=True, blank=True)
foreign_currency_rate_date = models.DateField(null=True, blank=True)
foreign_currency_source = models.CharField(max_length=100, null=True, blank=True)
@@ -347,8 +347,8 @@ class InvoiceLine(models.Model):
invoice = models.ForeignKey('Invoice', related_name='lines', on_delete=models.CASCADE)
position = models.PositiveIntegerField(default=0)
description = models.TextField()
gross_value = models.DecimalField(max_digits=10, decimal_places=2)
tax_value = models.DecimalField(max_digits=10, decimal_places=2, default=Decimal('0.00'))
gross_value = models.DecimalField(max_digits=13, decimal_places=2)
tax_value = models.DecimalField(max_digits=13, decimal_places=2, default=Decimal('0.00'))
tax_rate = models.DecimalField(max_digits=7, decimal_places=2, default=Decimal('0.00'))
tax_name = models.CharField(max_length=190)
subevent = models.ForeignKey('SubEvent', null=True, blank=True, on_delete=models.PROTECT)

View File

@@ -164,7 +164,7 @@ class SubEventItem(models.Model):
"""
subevent = models.ForeignKey('SubEvent', on_delete=models.CASCADE)
item = models.ForeignKey('Item', on_delete=models.CASCADE)
price = models.DecimalField(max_digits=7, decimal_places=2, null=True, blank=True)
price = models.DecimalField(max_digits=13, decimal_places=2, null=True, blank=True)
disabled = models.BooleanField(default=False, verbose_name=_('Disable product for this date'))
available_from = models.DateTimeField(
verbose_name=_("Available from"),
@@ -220,7 +220,7 @@ class SubEventItemVariation(models.Model):
"""
subevent = models.ForeignKey('SubEvent', on_delete=models.CASCADE)
variation = models.ForeignKey('ItemVariation', on_delete=models.CASCADE)
price = models.DecimalField(max_digits=7, decimal_places=2, null=True, blank=True)
price = models.DecimalField(max_digits=13, decimal_places=2, null=True, blank=True)
disabled = models.BooleanField(default=False, verbose_name=_('Disable product for this date'))
available_from = models.DateTimeField(
verbose_name=_("Available from"),
@@ -407,7 +407,7 @@ class Item(LoggedModel):
help_text=_("If this product has multiple variations, you can set different prices for each of the "
"variations. If a variation does not have a special price or if you do not have variations, "
"this price will be used."),
max_digits=7, decimal_places=2, null=True
max_digits=13, decimal_places=2, null=True
)
free_price = models.BooleanField(
default=False,
@@ -538,7 +538,7 @@ class Item(LoggedModel):
original_price = models.DecimalField(
verbose_name=_('Original price'),
blank=True, null=True,
max_digits=7, decimal_places=2,
max_digits=13, decimal_places=2,
help_text=_('If set, this will be displayed next to the current price to show that the current price is a '
'discounted one. This is just a cosmetic setting and will not actually impact pricing.')
)
@@ -952,14 +952,14 @@ class ItemVariation(models.Model):
verbose_name=_("Position")
)
default_price = models.DecimalField(
decimal_places=2, max_digits=7,
decimal_places=2, max_digits=13,
null=True, blank=True,
verbose_name=_("Default price"),
)
original_price = models.DecimalField(
verbose_name=_('Original price'),
blank=True, null=True,
max_digits=7, decimal_places=2,
max_digits=13, decimal_places=2,
help_text=_('If set, this will be displayed next to the current price to show that the current price is a '
'discounted one. This is just a cosmetic setting and will not actually impact pricing.')
)
@@ -1304,7 +1304,7 @@ class ItemBundle(models.Model):
)
designated_price = models.DecimalField(
default=Decimal('0.00'), blank=True,
decimal_places=2, max_digits=10,
decimal_places=2, max_digits=13,
verbose_name=_('Designated price part'),
help_text=_('If set, it will be shown that this bundled item is responsible for the given value of the total '
'gross price. This might be important in cases of mixed taxation, but can be kept blank otherwise. This '

View File

@@ -220,7 +220,7 @@ class Order(LockModel, LoggedModel):
verbose_name=_("Expiration date")
)
total = models.DecimalField(
decimal_places=2, max_digits=10,
decimal_places=2, max_digits=13,
verbose_name=_("Total amount")
)
comment = models.TextField(
@@ -403,8 +403,8 @@ class Order(LockModel, LoggedModel):
state__in=(OrderRefund.REFUND_STATE_CREATED, OrderRefund.REFUND_STATE_TRANSIT),
order=OuterRef('pk')
)
payment_sum_sq = Subquery(payment_sum, output_field=models.DecimalField(decimal_places=2, max_digits=10))
refund_sum_sq = Subquery(refund_sum, output_field=models.DecimalField(decimal_places=2, max_digits=10))
payment_sum_sq = Subquery(payment_sum, output_field=models.DecimalField(decimal_places=2, max_digits=13))
refund_sum_sq = Subquery(refund_sum, output_field=models.DecimalField(decimal_places=2, max_digits=13))
if sums:
qs = qs.annotate(
payment_sum=payment_sum_sq,
@@ -1313,7 +1313,7 @@ class AbstractPosition(models.Model):
on_delete=models.PROTECT
)
price = models.DecimalField(
decimal_places=2, max_digits=10,
decimal_places=2, max_digits=13,
verbose_name=_("Price")
)
attendee_name_cached = models.CharField(
@@ -1545,7 +1545,7 @@ class OrderPayment(models.Model):
max_length=190, choices=PAYMENT_STATES
)
amount = models.DecimalField(
decimal_places=2, max_digits=10,
decimal_places=2, max_digits=13,
verbose_name=_("Amount")
)
order = models.ForeignKey(
@@ -1929,7 +1929,7 @@ class OrderRefund(models.Model):
max_length=190, choices=REFUND_SOURCES
)
amount = models.DecimalField(
decimal_places=2, max_digits=10,
decimal_places=2, max_digits=13,
verbose_name=_("Amount")
)
order = models.ForeignKey(
@@ -2078,7 +2078,7 @@ class OrderFee(models.Model):
)
value = models.DecimalField(
decimal_places=2, max_digits=10,
decimal_places=2, max_digits=13,
verbose_name=_("Value")
)
order = models.ForeignKey(
@@ -2102,7 +2102,7 @@ class OrderFee(models.Model):
null=True, blank=True
)
tax_value = models.DecimalField(
max_digits=10, decimal_places=2,
max_digits=13, decimal_places=2,
verbose_name=_('Tax value')
)
canceled = models.BooleanField(default=False)
@@ -2236,7 +2236,7 @@ class OrderPosition(AbstractPosition):
)
voucher_budget_use = models.DecimalField(
max_digits=10, decimal_places=2, null=True, blank=True,
max_digits=13, decimal_places=2, null=True, blank=True,
)
tax_rate = models.DecimalField(
@@ -2249,7 +2249,7 @@ class OrderPosition(AbstractPosition):
null=True, blank=True
)
tax_value = models.DecimalField(
max_digits=10, decimal_places=2,
max_digits=13, decimal_places=2,
verbose_name=_('Tax value')
)
@@ -2670,7 +2670,7 @@ class Transaction(models.Model):
verbose_name=pgettext_lazy("subevent", "Date"),
)
price = models.DecimalField(
decimal_places=2, max_digits=10,
decimal_places=2, max_digits=13,
verbose_name=_("Price")
)
tax_rate = models.DecimalField(
@@ -2683,7 +2683,7 @@ class Transaction(models.Model):
null=True, blank=True
)
tax_value = models.DecimalField(
max_digits=10, decimal_places=2,
max_digits=13, decimal_places=2,
verbose_name=_('Tax value')
)
fee_type = models.CharField(
@@ -2761,19 +2761,19 @@ class CartPosition(AbstractPosition):
verbose_name=_('Tax rate')
)
listed_price = models.DecimalField(
decimal_places=2, max_digits=10, null=True,
decimal_places=2, max_digits=13, null=True,
)
price_after_voucher = models.DecimalField(
decimal_places=2, max_digits=10, null=True,
decimal_places=2, max_digits=13, null=True,
)
custom_price_input = models.DecimalField(
decimal_places=2, max_digits=10, null=True,
decimal_places=2, max_digits=13, null=True,
)
custom_price_input_is_net = models.BooleanField(
default=False,
)
line_price_gross = models.DecimalField(
decimal_places=2, max_digits=10, null=True,
decimal_places=2, max_digits=13, null=True,
)
requested_valid_from = models.DateTimeField(
null=True,
@@ -3056,7 +3056,7 @@ class CachedCombinedTicket(models.Model):
class CancellationRequest(models.Model):
order = models.ForeignKey(Order, on_delete=models.CASCADE, related_name='cancellation_requests')
created = models.DateTimeField(auto_now_add=True)
cancellation_fee = models.DecimalField(max_digits=10, decimal_places=2)
cancellation_fee = models.DecimalField(max_digits=13, decimal_places=2)
refund_as_giftcard = models.BooleanField(default=False)

View File

@@ -213,7 +213,7 @@ class Voucher(LoggedModel):
verbose_name=_("Maximum discount budget"),
help_text=_("This is the maximum monetary amount that will be discounted using this voucher across all usages. "
"If this is sum reached, the voucher can no longer be used."),
decimal_places=2, max_digits=10,
decimal_places=2, max_digits=13,
null=True, blank=True
)
valid_until = models.DateTimeField(
@@ -243,7 +243,7 @@ class Voucher(LoggedModel):
)
value = models.DecimalField(
verbose_name=_("Voucher value"),
decimal_places=2, max_digits=10, null=True, blank=True,
decimal_places=2, max_digits=13, null=True, blank=True,
)
item = models.ForeignKey(
Item, related_name='vouchers',
@@ -599,7 +599,7 @@ class Voucher(LoggedModel):
Order.STATUS_PENDING
]
).order_by().values('voucher_id').annotate(s=Sum('voucher_budget_use')).values('s')
return qs.annotate(budget_used_orders=Coalesce(Subquery(opq, output_field=models.DecimalField(max_digits=10, decimal_places=2)), Decimal('0.00')))
return qs.annotate(budget_used_orders=Coalesce(Subquery(opq, output_field=models.DecimalField(max_digits=13, decimal_places=2)), Decimal('0.00')))
def budget_used(self):
ops = OrderPosition.objects.filter(

View File

@@ -1512,7 +1512,7 @@ DEFAULTS = {
'form_class': forms.DecimalField,
'serializer_class': serializers.DecimalField,
'serializer_kwargs': dict(
max_digits=10, decimal_places=2
max_digits=13, decimal_places=2
),
'form_kwargs': dict(
label=_("Charge a fixed cancellation fee"),
@@ -1537,7 +1537,7 @@ DEFAULTS = {
'form_class': forms.DecimalField,
'serializer_class': serializers.DecimalField,
'serializer_kwargs': dict(
max_digits=10, decimal_places=2
max_digits=13, decimal_places=2
),
'form_kwargs': dict(
label=_("Charge a percentual cancellation fee"),
@@ -1571,7 +1571,7 @@ DEFAULTS = {
'form_class': forms.DecimalField,
'serializer_class': serializers.DecimalField,
'serializer_kwargs': dict(
max_digits=10, decimal_places=2
max_digits=13, decimal_places=2
),
'form_kwargs': dict(
label=_("Keep a fixed cancellation fee"),
@@ -1592,7 +1592,7 @@ DEFAULTS = {
'form_class': forms.DecimalField,
'serializer_class': serializers.DecimalField,
'serializer_kwargs': dict(
max_digits=10, decimal_places=2
max_digits=13, decimal_places=2
),
'form_kwargs': dict(
label=_("Keep a percentual cancellation fee"),
@@ -1631,10 +1631,10 @@ DEFAULTS = {
'form_class': forms.DecimalField,
'serializer_class': serializers.DecimalField,
'serializer_kwargs': dict(
max_digits=10, decimal_places=2
max_digits=13, decimal_places=2
),
'form_kwargs': dict(
max_digits=10, decimal_places=2,
max_digits=13, decimal_places=2,
label=_("Step size for reduction amount"),
help_text=_('By default, customers can choose an arbitrary amount for you to keep. If you set this to e.g. '
'10, they will only be able to choose values in increments of 10.')

View File

@@ -1568,7 +1568,7 @@ class QuickSetupProductForm(I18nForm):
)
default_price = forms.DecimalField(
label=_("Price (optional)"),
max_digits=7, decimal_places=2, required=False,
max_digits=13, decimal_places=2, required=False,
localize=True,
widget=forms.TextInput(
attrs={

View File

@@ -167,7 +167,7 @@ class CancelForm(ForceQuotaConfirmationForm):
)
cancellation_fee = forms.DecimalField(
required=False,
max_digits=10, decimal_places=2,
max_digits=13, decimal_places=2,
localize=True,
label=_('Keep a cancellation fee of'),
help_text=_('If you keep a fee, all positions within this order will be canceled and the order will be reduced '
@@ -213,7 +213,7 @@ class MarkPaidForm(ConfirmPaymentForm):
)
amount = forms.DecimalField(
required=True,
max_digits=10, decimal_places=2,
max_digits=13, decimal_places=2,
localize=True,
label=_('Payment amount'),
)
@@ -318,7 +318,7 @@ class OrderPositionAddForm(forms.Form):
)
price = forms.DecimalField(
required=False,
max_digits=10, decimal_places=2,
max_digits=13, decimal_places=2,
localize=True,
label=_('Gross price'),
help_text=_("Including taxes, if any. Keep empty for the product's default price")
@@ -444,7 +444,7 @@ class OrderPositionChangeForm(forms.Form):
)
price = forms.DecimalField(
required=False,
max_digits=10, decimal_places=2,
max_digits=13, decimal_places=2,
localize=True,
label=_('New price (gross)')
)
@@ -566,7 +566,7 @@ class OrderPositionChangeForm(forms.Form):
class OrderFeeChangeForm(forms.Form):
value = forms.DecimalField(
required=False,
max_digits=10, decimal_places=2,
max_digits=13, decimal_places=2,
localize=True,
label=_('New price (gross)')
)
@@ -731,7 +731,7 @@ class OrderRefundForm(forms.Form):
)
)
partial_amount = forms.DecimalField(
required=False, max_digits=10, decimal_places=2,
required=False, max_digits=13, decimal_places=2,
localize=True
)
@@ -820,18 +820,18 @@ class EventCancelForm(forms.Form):
)
keep_fee_fixed = forms.DecimalField(
label=_("Keep a fixed cancellation fee"),
max_digits=10, decimal_places=2,
max_digits=13, decimal_places=2,
required=False
)
keep_fee_per_ticket = forms.DecimalField(
label=_("Keep a fixed cancellation fee per ticket"),
help_text=_("Free tickets and add-on products are not counted"),
max_digits=10, decimal_places=2,
max_digits=13, decimal_places=2,
required=False
)
keep_fee_percentage = forms.DecimalField(
label=_("Keep a percentual cancellation fee"),
max_digits=10, decimal_places=2,
max_digits=13, decimal_places=2,
required=False
)
keep_fees = forms.MultipleChoiceField(

View File

@@ -0,0 +1,18 @@
# Generated by Django 3.2.18 on 2023-03-16 20:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('banktransfer', '0007_refundexport'),
]
operations = [
migrations.AlterField(
model_name='banktransaction',
name='amount',
field=models.DecimalField(decimal_places=2, max_digits=13),
),
]

View File

@@ -83,7 +83,7 @@ class BankTransaction(models.Model):
checksum = models.CharField(max_length=190, db_index=True)
payer = models.TextField(blank=True)
reference = models.TextField(blank=True)
amount = models.DecimalField(max_digits=10, decimal_places=2)
amount = models.DecimalField(max_digits=13, decimal_places=2)
date = models.CharField(max_length=50)
date_parsed = models.DateField(null=True)
iban = models.CharField(max_length=250, blank=True)