One more line for transaction input.
authorgniibe <gniibe@fsij.org>
Thu, 27 May 2010 05:29:54 +0000 (14:29 +0900)
committergniibe <gniibe@fsij.org>
Thu, 27 May 2010 05:29:54 +0000 (14:29 +0900)
ChangeLog
accounting/views.py
templates/accounting/transaction_list.html

index de2f46c..e8b9cde 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-05-27  NIIBE Yutaka  <gniibe@fsij.org>
 
+       * accounting/views.py (transaction_new): Added one more line for
+       entry of a transaction.
+       * templates/accounting/transaction_list.html: Follow the change.
+
        * templates/accounting/transaction_list.html: Show payment button
        only if t.get_debit.account is None.
 
index 194cf2d..3f3529c 100644 (file)
@@ -60,6 +60,16 @@ def transaction_new(request):
         c_amount = request.POST['credit_amount4']
         l = LedgerEntry(t=t, is_credit=True, account=c_account, amount=c_amount)
         l.save()
+    if request.POST['debit5']:
+        d_account = Account.objects.get(pk=request.POST['debit5'])
+        d_amount  = request.POST['debit_amount5']
+        l = LedgerEntry(t=t, is_credit=False, account=d_account, amount=d_amount)
+        l.save()
+    if request.POST['credit5']:
+        c_account = Account.objects.get(pk=request.POST['credit5'])
+        c_amount = request.POST['credit_amount5']
+        l = LedgerEntry(t=t, is_credit=True, account=c_account, amount=c_amount)
+        l.save()
     return HttpResponseRedirect(request.POST['original_path'])
 
 @user_passes_test(lambda u: u.has_perm('accounting.can_manage'), LOGIN_URL)
index bb46b25..9dbfd83 100644 (file)
 <td align=right><input type="text" name="credit_amount4" size=10 maxlength=10 /></td>
 <td></td>
 <td></td>
+<td></td>
+</tr>
+<tr>
+<td></td>
+<td></td>
+<td align=right><select name="debit5">
+<option value="" /></option>
+{% for a in a_list %}
+<option value="{{ a.id }}" />{{ a.name }}</option>
+{% endfor %}
+</select></td>
+<td align=right><input type="text" name="debit_amount5" size=10 maxlength=10 /></td>
+<td align=right><select name="credit5">
+<option value="" /></option>
+{% for a in a_list %}
+<option value="{{ a.id }}" />{{ a.name }}</option>
+{% endfor %}
+</select></td>
+<td align=right><input type="text" name="credit_amount5" size=10 maxlength=10 /></td>
+<td></td>
+<td></td>
 <td><input type="submit" value="登録" /></td>
 </tr>
 <input type="hidden" value="{{ original_path }}" name="original_path" />