Remove bank, Kfet and add BDA and BDS (need to fix activity, permission and registration)
This commit is contained in:
parent
3a3e3be64c
commit
838bd2bb23
43 changed files with 128 additions and 639 deletions
|
|
@ -132,8 +132,6 @@ class LinkTransactionToRemittanceForm(forms.ModelForm):
|
|||
|
||||
first_name = forms.Field(label=_("First name"))
|
||||
|
||||
bank = forms.Field(label=_("Bank"))
|
||||
|
||||
amount = forms.IntegerField(label=_("Amount"), min_value=0, widget=AmountInput(), disabled=True, required=False)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
|
@ -148,7 +146,6 @@ class LinkTransactionToRemittanceForm(forms.ModelForm):
|
|||
cleaned_data = super().clean()
|
||||
self.instance.transaction.last_name = cleaned_data["last_name"]
|
||||
self.instance.transaction.first_name = cleaned_data["first_name"]
|
||||
self.instance.transaction.bank = cleaned_data["bank"]
|
||||
return cleaned_data
|
||||
|
||||
@transaction.atomic
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Generated by Django 2.2.28 on 2022-08-06 13:33
|
||||
# Generated by Django 2.2.28 on 2022-08-17 20:53
|
||||
|
||||
import datetime
|
||||
import django.core.validators
|
||||
|
|
@ -12,7 +12,7 @@ class Migration(migrations.Migration):
|
|||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('note', '0006_trust'),
|
||||
('note', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
|
|
|||
|
|
@ -118,5 +118,5 @@ class SpecialTransactionTable(tables.Table):
|
|||
}
|
||||
model = SpecialTransaction
|
||||
template_name = 'django_tables2/bootstrap4.html'
|
||||
fields = ('created_at', 'source', 'destination', 'last_name', 'first_name', 'bank', 'amount', 'reason',)
|
||||
fields = ('created_at', 'source', 'destination', 'last_name', 'first_name', 'amount', 'reason',)
|
||||
order_by = ('-created_at',)
|
||||
|
|
|
|||
|
|
@ -187,7 +187,6 @@ class TestRemittances(TestCase):
|
|||
reason="Credit",
|
||||
last_name="TOTO",
|
||||
first_name="Toto",
|
||||
bank="Société générale",
|
||||
)
|
||||
|
||||
self.second_credit = SpecialTransaction.objects.create(
|
||||
|
|
@ -197,7 +196,6 @@ class TestRemittances(TestCase):
|
|||
reason="Second credit",
|
||||
last_name="TOTO",
|
||||
first_name="Toto",
|
||||
bank="Société générale",
|
||||
)
|
||||
|
||||
self.remittance = Remittance.objects.create(
|
||||
|
|
@ -275,7 +273,6 @@ class TestRemittances(TestCase):
|
|||
remittance=self.remittance.pk,
|
||||
last_name="Last Name",
|
||||
first_name="First Name",
|
||||
bank="Bank",
|
||||
))
|
||||
self.assertRedirects(response, reverse("treasury:remittance_list"), 302, 200)
|
||||
self.credit.refresh_from_db()
|
||||
|
|
@ -320,8 +317,7 @@ class TestTreasuryAPI(TestAPI):
|
|||
amount=4200,
|
||||
reason="Credit",
|
||||
last_name="TOTO",
|
||||
first_name="Toto",
|
||||
bank="Société générale",
|
||||
first_name="Toto"
|
||||
)
|
||||
|
||||
self.remittance = Remittance.objects.create(
|
||||
|
|
@ -332,7 +328,7 @@ class TestTreasuryAPI(TestAPI):
|
|||
self.credit.specialtransactionproxy.remittance = self.remittance
|
||||
self.credit.specialtransactionproxy.save()
|
||||
|
||||
self.kfet = Club.objects.get(name="Kfet")
|
||||
self.kfet = Club.objects.get(name="BDA")
|
||||
self.bde = self.kfet.parent_club
|
||||
|
||||
self.kfet_membership = Membership(
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ class InvoiceUpdateView(ProtectQuerysetMixin, LoginRequiredMixin, UpdateView):
|
|||
|
||||
class InvoiceDeleteView(ProtectQuerysetMixin, LoginRequiredMixin, DeleteView):
|
||||
"""
|
||||
Delete a non-validated WEI registration
|
||||
Delete a non-validated registration
|
||||
"""
|
||||
model = Invoice
|
||||
extra_context = {"title": _("Delete invoice")}
|
||||
|
|
@ -368,7 +368,6 @@ class LinkTransactionToRemittanceView(ProtectQuerysetMixin, LoginRequiredMixin,
|
|||
form = context["form"]
|
||||
form.fields["last_name"].initial = self.object.transaction.last_name
|
||||
form.fields["first_name"].initial = self.object.transaction.first_name
|
||||
form.fields["bank"].initial = self.object.transaction.bank
|
||||
form.fields["amount"].initial = self.object.transaction.amount
|
||||
form.fields["remittance"].queryset = form.fields["remittance"] \
|
||||
.queryset.filter(remittance_type__note=self.object.transaction.source)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue