percentage late fees too
authorivan <ivan>
Thu, 29 Jun 2006 15:19:59 +0000 (15:19 +0000)
committerivan <ivan>
Thu, 29 Jun 2006 15:19:59 +0000 (15:19 +0000)
httemplate/edit/part_bill_event.cgi

index 57eedbc..32a3f2d 100755 (executable)
@@ -139,13 +139,21 @@ my $money_char = $conf->config('money_char') || '$';
 tie my %events, 'Tie::IxHash',
 
   'fee' => {
-    'name'   => 'Late fee',
+    'name'   => 'Late fee (flat)',
     'code'   => '$cust_main->charge( %%%charge%%%, \'%%%reason%%%\' );',
     'html'   => 
       'Amount <INPUT TYPE="text" SIZE="7" NAME="charge" VALUE="%%%charge%%%">'.
       '<BR>Reason <INPUT TYPE="text" NAME="reason" VALUE="%%%reason%%%">',
     'weight' => 10,
   },
+  'fee_percent' => {
+    'name'   => 'Late fee (percentage)',
+    'code'   => '$cust_main->charge( sprintf(\'%.2f\', $cust_bill->owed * %%%percent%%% / 100 ), \'%%%reason%%%\' );',
+    'html'   => 
+      'Percent <INPUT TYPE="text" SIZE="2" NAME="percent" VALUE="%%%percent%%%">%'.
+      '<BR>Reason <INPUT TYPE="text" NAME="reason" VALUE="%%%reason%%%">',
+    'weight' => 10,
+  },
   'suspend' => {
     'name'   => 'Suspend',
     'code'   => '$cust_main->suspend();',