1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48:21 +02:00

Close remittances

This commit is contained in:
Yohann D'ANELLO
2020-03-24 00:50:55 +01:00
parent 414722df18
commit 5682c5489e
4 changed files with 64 additions and 8 deletions

View File

@ -236,10 +236,12 @@ class RemittanceUpdateView(LoginRequiredMixin, UpdateView):
def get_context_data(self, **kwargs):
ctx = super().get_context_data(**kwargs)
form = ctx["form"]
ctx["table"] = RemittanceTable(data=Remittance.objects.all())
data = SpecialTransaction.objects.filter(specialtransactionproxy__remittance=self.object).all()
ctx["special_transactions"] = SpecialTransactionTable(
data=SpecialTransaction.objects.filter(specialtransactionproxy__remittance=self.object).all(),
exclude=('remittance_add', ))
data=data,
exclude=('remittance_add', 'remittance_remove', ) if self.object.closed else ('remittance_add', ))
return ctx