Commit a9253dfa authored by root's avatar root

Why is the prod with a merge not commited ?

parent 98de5c9a
......@@ -100,7 +100,7 @@ class PaymentAllocatedReadOnly(admin.TabularInline):
class PaymentInlineAdd(admin.StackedInline):
model = Payment
extra = 0
fields = (('date', 'payment_mean', 'amount'),)
fields = (('date', 'payment_mean', 'amount', 'label'),)
can_delete = False
verbose_name_plural = "Ajouter des paiements"
......@@ -246,7 +246,9 @@ class PaymentAdmin(admin.ModelAdmin):
fields = (('member'),
('amount', 'payment_mean', 'date', 'label'),
('amount_already_allocated'))
readonly_fields = ('amount_already_allocated', 'label')
readonly_fields = ('amount_already_allocated',)
list_filter = ['payment_mean']
search_fields = ['member__username', 'member__first_name', 'member__last_name', 'member__email', 'member__nickname']
form = autocomplete_light.modelform_factory(Payment, fields='__all__')
def get_readonly_fields(self, request, obj=None):
......@@ -303,6 +305,8 @@ class PaymentAdmin(admin.ModelAdmin):
class MembershipFeeAdmin(admin.ModelAdmin):
list_display = ('member', 'end_date', '_amount')
search_fields = ['member__username', 'member__first_name', 'member__last_name', 'member__email', 'member__nickname']
list_filter = ['date']
form = autocomplete_light.modelform_factory(MembershipFee, fields='__all__')
......
......@@ -158,8 +158,8 @@ def create_member_invoice_for_a_period(member, date, antidate):
invoice.save()
transaction.savepoint_commit(sid)
# Valide la facture et génère le PDF
invoice.date_due = None # (reset the due date, will automatically be redefined when validating, to date+PAYMENT_DELAY)
if antidate:
invoice.date_due = None # (reset the due date, will automatically be redefined when validating)
invoice.validate(period_to)
else:
invoice.validate()
......
......@@ -316,7 +316,7 @@ class Invoice(Bill):
"Draft invoice {} validated as invoice {}. ".format(
old_number, self.number) +
"(Total amount : {} ; Member : {})".format(
self.amount(), self.member))
self.amount, self.member))
assert self.pdf_exists()
if self.member is not None:
update_accounting_for_member(self.member)
......@@ -415,7 +415,7 @@ class Invoice(Bill):
class InvoiceDetail(models.Model):
label = models.CharField(max_length=100)
label = models.CharField(max_length=255)
amount = models.DecimalField(max_digits=8, decimal_places=2,
verbose_name='montant')
quantity = models.DecimalField(null=True, verbose_name='quantité',
......@@ -513,6 +513,10 @@ class MembershipFee(Bill):
return True
def save(self, *args, **kwargs):
# Only if no amount already allocated...
#if self.pk is None and (not self.member or self.member.balance < self.amount):
# raise ValidationError("Le solde n'est pas suffisant pour payer cette cotisation. \
# Merci de commencer par enregistrer un paiement pour ce membre.")
super(MembershipFee, self).save(*args, **kwargs)
......
......@@ -21,8 +21,10 @@
{% csrf_token %}
<fieldset class="module aligned wide">
{{ form.as_p }}
<input type="checkbox" id="status" /> J'ai lu les <a href="https://wiki.arn-fai.net/administratif:statuts" target="_BLANK">statuts de l'association</a>
</fieldset>
<input type="submit" class="button radius" value="Créer mon compte" />
<p class="captcha">1+1: <input type="text" value="" /></p>
<input type="submit" class="button radius" value="Créer mon compte" id="submit" disabled />
</form>
</div>
</div>
......@@ -47,6 +49,9 @@ $(document).ready(function () {
}
return false;
};
$('#status').on('change', function() {
$('#submit').prop( "disabled", !$('#submit').prop( "disabled"));
});
$('#id_type').on('change', hideFields);
if (!$('#id_organization_name').val()) {
$('#id_type').val('natural_person');
......
......@@ -29,7 +29,7 @@ class HousingConfiguration(Configuration):
verbose_name="IPv6", blank=True, null=True,
help_text="Adresse IPv6 utilisée par "
"défaut sur le Housing")
vlan = models.IntegerField(verbose_name="vlan id", null=True)
vlan = models.IntegerField(verbose_name="vlan id",blank=True, null=True)
objects = NetManager()
def get_absolute_url(self):
......@@ -104,7 +104,7 @@ class HousingConfiguration(Configuration):
self.check_endpoints()
def __unicode__(self):
return 'Housing ' #+ self.login
return 'Housing ' + str(self.vlan)
class Meta:
verbose_name = 'Housing'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment