Commit a9253dfa authored by root's avatar root
Browse files

Why is the prod with a merge not commited ?

parent 98de5c9a
...@@ -100,7 +100,7 @@ class PaymentAllocatedReadOnly(admin.TabularInline): ...@@ -100,7 +100,7 @@ class PaymentAllocatedReadOnly(admin.TabularInline):
class PaymentInlineAdd(admin.StackedInline): class PaymentInlineAdd(admin.StackedInline):
model = Payment model = Payment
extra = 0 extra = 0
fields = (('date', 'payment_mean', 'amount'),) fields = (('date', 'payment_mean', 'amount', 'label'),)
can_delete = False can_delete = False
verbose_name_plural = "Ajouter des paiements" verbose_name_plural = "Ajouter des paiements"
...@@ -246,7 +246,9 @@ class PaymentAdmin(admin.ModelAdmin): ...@@ -246,7 +246,9 @@ class PaymentAdmin(admin.ModelAdmin):
fields = (('member'), fields = (('member'),
('amount', 'payment_mean', 'date', 'label'), ('amount', 'payment_mean', 'date', 'label'),
('amount_already_allocated')) ('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__') form = autocomplete_light.modelform_factory(Payment, fields='__all__')
def get_readonly_fields(self, request, obj=None): def get_readonly_fields(self, request, obj=None):
...@@ -303,6 +305,8 @@ class PaymentAdmin(admin.ModelAdmin): ...@@ -303,6 +305,8 @@ class PaymentAdmin(admin.ModelAdmin):
class MembershipFeeAdmin(admin.ModelAdmin): class MembershipFeeAdmin(admin.ModelAdmin):
list_display = ('member', 'end_date', '_amount') 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__') form = autocomplete_light.modelform_factory(MembershipFee, fields='__all__')
......
...@@ -158,8 +158,8 @@ def create_member_invoice_for_a_period(member, date, antidate): ...@@ -158,8 +158,8 @@ def create_member_invoice_for_a_period(member, date, antidate):
invoice.save() invoice.save()
transaction.savepoint_commit(sid) transaction.savepoint_commit(sid)
# Valide la facture et génère le PDF # 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: if antidate:
invoice.date_due = None # (reset the due date, will automatically be redefined when validating)
invoice.validate(period_to) invoice.validate(period_to)
else: else:
invoice.validate() invoice.validate()
......
...@@ -316,7 +316,7 @@ class Invoice(Bill): ...@@ -316,7 +316,7 @@ class Invoice(Bill):
"Draft invoice {} validated as invoice {}. ".format( "Draft invoice {} validated as invoice {}. ".format(
old_number, self.number) + old_number, self.number) +
"(Total amount : {} ; Member : {})".format( "(Total amount : {} ; Member : {})".format(
self.amount(), self.member)) self.amount, self.member))
assert self.pdf_exists() assert self.pdf_exists()
if self.member is not None: if self.member is not None:
update_accounting_for_member(self.member) update_accounting_for_member(self.member)
...@@ -415,7 +415,7 @@ class Invoice(Bill): ...@@ -415,7 +415,7 @@ class Invoice(Bill):
class InvoiceDetail(models.Model): 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, amount = models.DecimalField(max_digits=8, decimal_places=2,
verbose_name='montant') verbose_name='montant')
quantity = models.DecimalField(null=True, verbose_name='quantité', quantity = models.DecimalField(null=True, verbose_name='quantité',
...@@ -513,6 +513,10 @@ class MembershipFee(Bill): ...@@ -513,6 +513,10 @@ class MembershipFee(Bill):
return True return True
def save(self, *args, **kwargs): 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) super(MembershipFee, self).save(*args, **kwargs)
......
...@@ -21,8 +21,10 @@ ...@@ -21,8 +21,10 @@
{% csrf_token %} {% csrf_token %}
<fieldset class="module aligned wide"> <fieldset class="module aligned wide">
{{ form.as_p }} {{ 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> </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> </form>
</div> </div>
</div> </div>
...@@ -47,6 +49,9 @@ $(document).ready(function () { ...@@ -47,6 +49,9 @@ $(document).ready(function () {
} }
return false; return false;
}; };
$('#status').on('change', function() {
$('#submit').prop( "disabled", !$('#submit').prop( "disabled"));
});
$('#id_type').on('change', hideFields); $('#id_type').on('change', hideFields);
if (!$('#id_organization_name').val()) { if (!$('#id_organization_name').val()) {
$('#id_type').val('natural_person'); $('#id_type').val('natural_person');
......
...@@ -29,7 +29,7 @@ class HousingConfiguration(Configuration): ...@@ -29,7 +29,7 @@ class HousingConfiguration(Configuration):
verbose_name="IPv6", blank=True, null=True, verbose_name="IPv6", blank=True, null=True,
help_text="Adresse IPv6 utilisée par " help_text="Adresse IPv6 utilisée par "
"défaut sur le Housing") "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() objects = NetManager()
def get_absolute_url(self): def get_absolute_url(self):
...@@ -104,7 +104,7 @@ class HousingConfiguration(Configuration): ...@@ -104,7 +104,7 @@ class HousingConfiguration(Configuration):
self.check_endpoints() self.check_endpoints()
def __unicode__(self): def __unicode__(self):
return 'Housing ' #+ self.login return 'Housing ' + str(self.vlan)
class Meta: class Meta:
verbose_name = 'Housing' verbose_name = 'Housing'
......
Supports Markdown
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