Bug fixes for 9999 and payment button.
authorgniibe <gniibe@fsij.org>
Thu, 27 May 2010 03:31:33 +0000 (12:31 +0900)
committergniibe <gniibe@fsij.org>
Thu, 27 May 2010 03:31:33 +0000 (12:31 +0900)
ChangeLog
membership/views.py
templates/accounting/transaction_list.html

index ef5f823..de2f46c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-05-27  NIIBE Yutaka  <gniibe@fsij.org>
 
+       * templates/accounting/transaction_list.html: Show payment button
+       only if t.get_debit.account is None.
+
        * +migrate+/20100528_gc.sql: New.
 
        DB migration.
@@ -8,7 +11,8 @@
        meaning of special value (was: 9999==Nyuukai-kin, 0==Maeuke-kin).
        * templates/membership/member_payment.html: Follow the change.
        * templates/membership/edit_member_payment.html: Likewise.
-       * membership/views.py (edit_member_payment, member_payment): Likewise.
+       * membership/views.py (edit_member_payment, member_payment)
+       (add_member_payment_with_le): Likewise.
 
        * templates/membership/member_payment.html: Added link to transaction.
        Handle Maeuke-kin.
index a6ef97b..d6c29c9 100644 (file)
@@ -183,7 +183,7 @@ def add_member_payment_with_le(request):
     p = MemberPayment(member = member,
                       date = date,
                       member_type = member.member_type,
-                      fee_year = 0,
+                      fee_year = 9999,
                       contribution = contribution,
                       le = le)
     p.save()
@@ -219,7 +219,7 @@ def edit_member_payment(request, member_payment):
             fee_list.append(9999)    # Advance payment
             fee_list.append(0) # Admission fee
         fee_list_in_payments = map(lambda (p): p.fee_year, member.memberpayment_set.all())
-        if orig_fee_year == 0:
+        if orig_fee_year == 9999:
             fee_list = filter(lambda (f): not f in fee_list_in_payments, fee_list)
     else:
         fee_list = None
index 6152bef..bb46b25 100644 (file)
      {% include "accounting/tr_le.html" %}
    {% else %}
    {% ifequal t.get_credit.account.name '前受金' %}
+   {% if not t.get_debit.account %}
      {% include "accounting/tr_le.html" %}
+   {% endif %}
    {% else %}
    {% ifequal t.get_credit.account.name '未収金' %}
      {% include "accounting/tr_le.html" %}