Annulation des reventes
- On peut annuler des reventes à tout point du processus - Le formulaire d'annulation donne plus d'informations
This commit is contained in:
parent
6c983e16e5
commit
fc37c5a8a0
|
@ -55,12 +55,16 @@ class ReventeModelMultipleChoiceField(forms.ModelMultipleChoiceField):
|
||||||
label = "{show}{suffix}"
|
label = "{show}{suffix}"
|
||||||
suffix = ""
|
suffix = ""
|
||||||
if self.own:
|
if self.own:
|
||||||
# C'est notre propre revente : pas besoin de spécifier le vendeur
|
# C'est notre propre revente : informations sur le statut
|
||||||
if obj.soldTo is not None:
|
if obj.soldTo is not None:
|
||||||
suffix = " -- Vendue à {firstname} {lastname}".format(
|
suffix = " -- Vendue à {firstname} {lastname}".format(
|
||||||
firstname=obj.soldTo.user.first_name,
|
firstname=obj.soldTo.user.first_name,
|
||||||
lastname=obj.soldTo.user.last_name,
|
lastname=obj.soldTo.user.last_name,
|
||||||
)
|
)
|
||||||
|
elif obj.shotgun:
|
||||||
|
suffix = " -- Tirage infructueux"
|
||||||
|
elif obj.notif_sent:
|
||||||
|
suffix = " -- Inscriptions au tirage en cours"
|
||||||
else:
|
else:
|
||||||
# Ce n'est pas à nous : on ne voit jamais l'acheteur
|
# Ce n'est pas à nous : on ne voit jamais l'acheteur
|
||||||
suffix = " -- Vendue par {firstname} {lastname}".format(
|
suffix = " -- Vendue par {firstname} {lastname}".format(
|
||||||
|
@ -103,10 +107,10 @@ class AnnulForm(forms.Form):
|
||||||
self.fields['reventes'].queryset = (
|
self.fields['reventes'].queryset = (
|
||||||
participant.original_shows
|
participant.original_shows
|
||||||
.filter(attribution__spectacle__date__gte=timezone.now(),
|
.filter(attribution__spectacle__date__gte=timezone.now(),
|
||||||
notif_sent=False,
|
|
||||||
soldTo__isnull=True)
|
soldTo__isnull=True)
|
||||||
.select_related('attribution__spectacle',
|
.select_related('attribution__spectacle',
|
||||||
'attribution__spectacle__location')
|
'attribution__spectacle__location')
|
||||||
|
.order_by('-date')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<h2>Gestion des places que je revends</h2>
|
<h2>Gestion des places que je revends</h2>
|
||||||
{% with resell_attributions=resellform.attributions annul_reventes=annulform.reventes sold_reventes=soldform.reventes %}
|
{% with resell_attributions=resellform.attributions annul_reventes=annulform.reventes sold_reventes=soldform.reventes %}
|
||||||
|
|
||||||
{% if resellform.attributions %}
|
{% if resell_attributions %}
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<h3>Places non revendues</h3>
|
<h3>Places non revendues</h3>
|
||||||
|
@ -29,15 +29,13 @@
|
||||||
<hr />
|
<hr />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if annul_reventes or overdue %}
|
{% if annul_reventes %}
|
||||||
<h3>Places en cours de revente</h3>
|
<h3>Places en cours de revente</h3>
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
{% if annul_reventes %}
|
|
||||||
<div class="bg-info text-info center-block">
|
<div class="bg-info text-info center-block">
|
||||||
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
|
||||||
Vous pouvez annuler les places mises en vente il y a moins d'une heure.
|
Vous pouvez annuler les reventes qui n'ont pas encore trouvé preneur·se.
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class='form-group'>
|
<div class='form-group'>
|
||||||
<div class='multiple-checkbox'>
|
<div class='multiple-checkbox'>
|
||||||
|
@ -45,18 +43,10 @@
|
||||||
{% for revente in annul_reventes %}
|
{% for revente in annul_reventes %}
|
||||||
<li>{{ revente.tag }} {{ revente.choice_label }}</li>
|
<li>{{ revente.tag }} {{ revente.choice_label }}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for attrib in overdue %}
|
|
||||||
<li>
|
|
||||||
<input type="checkbox" style="visibility:hidden">
|
|
||||||
{{ attrib.spectacle }}
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% if annul_reventes %}
|
|
||||||
<input type="submit" class="btn btn-primary" name="annul" value="Annuler les reventes sélectionnées">
|
<input type="submit" class="btn btn-primary" name="annul" value="Annuler les reventes sélectionnées">
|
||||||
{% endif %}
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
@ -82,7 +72,7 @@
|
||||||
<button type="submit" class="btn btn-primary" name="reinit">Réinitialiser</button>
|
<button type="submit" class="btn btn-primary" name="reinit">Réinitialiser</button>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not resell_attributions and not annul_attributions and not overdue and not sold_reventes %}
|
{% if not resell_attributions and not annul_reventes and not sold_reventes %}
|
||||||
<p>Plus de reventes possibles !</p>
|
<p>Plus de reventes possibles !</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
10
bda/views.py
10
bda/views.py
|
@ -430,16 +430,8 @@ def revente_manage(request, tirage_id):
|
||||||
- SpectacleRevente.remorse_time)
|
- SpectacleRevente.remorse_time)
|
||||||
revente.reset(new_date=new_date)
|
revente.reset(new_date=new_date)
|
||||||
|
|
||||||
overdue = participant.attribution_set.filter(
|
|
||||||
spectacle__date__gte=timezone.now(),
|
|
||||||
revente__isnull=False,
|
|
||||||
revente__seller=participant,
|
|
||||||
revente__notif_sent=True)\
|
|
||||||
.filter(
|
|
||||||
Q(revente__soldTo__isnull=True) | Q(revente__soldTo=participant))
|
|
||||||
|
|
||||||
return render(request, "bda/revente/manage.html",
|
return render(request, "bda/revente/manage.html",
|
||||||
{'tirage': tirage, 'overdue': overdue, "soldform": soldform,
|
{'tirage': tirage, "soldform": soldform,
|
||||||
"annulform": annulform, "resellform": resellform})
|
"annulform": annulform, "resellform": resellform})
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue