summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2009-07-01 05:34:43 +0000
committerivan <ivan>2009-07-01 05:34:43 +0000
commitcb57a42a578be11b85959c295828c995ad97f143 (patch)
tree755d5c8cad044acdcd38ca2c1f42801e260c39d2 /FS
parent891171bfdf53febbfd295e3264521c587f4ba406 (diff)
add tax class selection back for late charges w/1.9 events, RT#5665
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/part_event/Action/cust_bill_fee_percent.pm19
-rw-r--r--FS/FS/part_event/Action/fee.pm12
2 files changed, 22 insertions, 9 deletions
diff --git a/FS/FS/part_event/Action/cust_bill_fee_percent.pm b/FS/FS/part_event/Action/cust_bill_fee_percent.pm
index 570fd6316..c6f37265a 100644
--- a/FS/FS/part_event/Action/cust_bill_fee_percent.pm
+++ b/FS/FS/part_event/Action/cust_bill_fee_percent.pm
@@ -11,8 +11,9 @@ sub eventtable_hashref {
sub option_fields {
(
- 'percent' => { label=>'Percent', size=>2, },
- 'reason' => 'Reason',
+ 'percent' => { label=>'Percent', size=>2, },
+ 'reason' => 'Reason',
+ 'taxclass' => { label=>'Tax class', type=>'select-taxclass', },
);
}
@@ -24,10 +25,16 @@ sub do_action {
#my $cust_main = $self->cust_main($cust_bill);
my $cust_main = $cust_bill->cust_main;
- my $error = $cust_main->charge(
- sprintf('%.2f', $cust_bill->owed * $self->option('percent') / 100 ),
- $self->option('reason')
- );
+ my $amount =
+ sprintf('%.2f', $cust_bill->owed * $self->option('percent') / 100 );
+
+ my $error = $cust_main->charge( {
+ 'amount' => $amount,
+ 'pkg' => $self->option('reason'),
+ 'taxclass' => $self->option('taxclass'),
+ #'start_date' => $cust_main->next_bill_date, #unless its more than N months away?
+ } );
+
die $error if $error;
'';
diff --git a/FS/FS/part_event/Action/fee.pm b/FS/FS/part_event/Action/fee.pm
index 3cf50fbca..7d07df5c7 100644
--- a/FS/FS/part_event/Action/fee.pm
+++ b/FS/FS/part_event/Action/fee.pm
@@ -7,8 +7,9 @@ sub description { 'Late fee (flat)'; }
sub option_fields {
(
- 'charge' => { label=>'Amount', type=>'money', }, # size=>7, },
- 'reason' => 'Reason',
+ 'charge' => { label=>'Amount', type=>'money', }, # size=>7, },
+ 'reason' => 'Reason',
+ 'taxclass' => { label=>'Tax class', type=>'select-taxclass', },
);
}
@@ -19,7 +20,12 @@ sub do_action {
my $cust_main = $self->cust_main($cust_object);
- my $error = $cust_main->charge( $self->option('charge'), $self->option('reason') );
+ my $error = $cust_main->charge( {
+ 'amount' => $self->option('charge'),
+ 'pkg' => $self->option('reason'),
+ 'taxclass' => $self->option('taxclass')
+ #'start_date' => $cust_main->next_bill_date, #unless its more than N months away?
+ } );
die $error if $error;