$setuptax = exists($_[0]->{setuptax}) ? $_[0]->{setuptax} : '';
$taxclass = exists($_[0]->{taxclass}) ? $_[0]->{taxclass} : '';
$classnum = exists($_[0]->{classnum}) ? $_[0]->{classnum} : '';
- $additional = $_[0]->{additional};
+ $additional = $_[0]->{additional} || [];
$taxproduct = $_[0]->{taxproductnum};
$override = { '' => $_[0]->{tax_override} };
} else {
'percent' => { label=>'Percent', size=>2, },
'reason' => 'Reason',
'taxclass' => { label=>'Tax class', type=>'select-taxclass', },
+ 'nextbill' => { label=>'Hold late fee until next invoice', type=>'checkbox', value=>'Y' },
);
}
my $amount =
sprintf('%.2f', $cust_bill->owed * $self->option('percent') / 100 );
- my $error = $cust_main->charge( {
+ my %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?
- } );
+ );
+
+ $charge{'start_date'} = $cust_main->next_bill_date #unless its more than N months away?
+ if $self->option('nextbill');
+
+ my $error = $cust_main->charge( \%charge );
die $error if $error;
'charge' => { label=>'Amount', type=>'money', }, # size=>7, },
'reason' => 'Reason',
'taxclass' => { label=>'Tax class', type=>'select-taxclass', },
+ 'nextbill' => { label=>'Hold late fee until next invoice', type=>'checkbox', value=>'Y' },
);
}
my $cust_main = $self->cust_main($cust_object);
- my $error = $cust_main->charge( {
+ my %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?
- } );
+ );
+
+ $charge{'start_date'} = $cust_main->next_bill_date #unless its more than N months away?
+ if $self->option('nextbill');
+
+ my $error = $cust_main->charge( \%charge );
die $error if $error;