Gesamtsumme bei Bankeinzug
authorPascal Hofmann <mail@pascalhofmann.de>
Tue, 1 Feb 2011 10:39:14 +0000 (11:39 +0100)
committerPascal Hofmann <mail@pascalhofmann.de>
Tue, 1 Feb 2011 10:39:14 +0000 (11:39 +0100)
include/dtaus.php

index 6415efa..65f84ec 100644 (file)
@@ -26,6 +26,7 @@ function action_dtaus() {
     js_modal_windows();
     js_get_master_key();
 
+       $total = 0;
 ?>
     <noscript>
         <p class="error">
@@ -47,7 +48,14 @@ function action_dtaus() {
         <td><?=html_escape($debit['purpose'])?></td>
         <td style="text-align: right;"><?=html_escape(format_money($debit['amount']))?></td>
     </tr>
+    <?php $total = bcadd($total, $debit['amount']); ?>
 <?php endforeach ?>
+    <tr class="total">
+        <td>Gesamt</td>
+        <td></td>
+        <td></td>
+        <td style="text-align: right;"><?=html_escape(format_money($total))?></td>
+    </tr>
 </table>
 <input class="submit" type="button" name="btn_dtaus" value="DTAUS erzeugen" onclick="ask_for_password()" id="btn_change_bank_details"/>
 <br/>
@@ -55,13 +63,13 @@ function action_dtaus() {
 <form action="<?=link_to('create_earnings')?>" method="post" class="clearfix">
 <?php $count = 0; ?>
 <?php foreach ($debits as $debit) : ?>
-       <?=html_hidden_field(sprintf('earnings[%d][date]',        $count), format_date(time()))?>
-       <?=html_hidden_field(sprintf('earnings[%d][type]',        $count), 'fee')?>
-       <?=html_hidden_field(sprintf('earnings[%d][status]',      $count), 'paid')?>
-       <?=html_hidden_field(sprintf('earnings[%d][value]',       $count), $debit['amount'])?>
-       <?=html_hidden_field(sprintf('earnings[%d][member_id]',   $count), $debit['member_id'])?>
-       <?=html_hidden_field(sprintf('earnings[%d][description]', $count), $debit['purpose'])?>
-<?php $count++; ?>
+    <?=html_hidden_field(sprintf('earnings[%d][date]',        $count), format_date(time()))?>
+    <?=html_hidden_field(sprintf('earnings[%d][type]',        $count), 'fee')?>
+    <?=html_hidden_field(sprintf('earnings[%d][status]',      $count), 'paid')?>
+    <?=html_hidden_field(sprintf('earnings[%d][value]',       $count), $debit['amount'])?>
+    <?=html_hidden_field(sprintf('earnings[%d][member_id]',   $count), $debit['member_id'])?>
+    <?=html_hidden_field(sprintf('earnings[%d][description]', $count), $debit['purpose'])?>
+    <?php $count++; ?>
 <?php endforeach ?>
 <input class="submit" type="submit" name="btn_create_earnings" value="Einnahmen verbuchen"/>
 </form>