'0', # 29 | Other Taxes & Fees*** NUM* 9
);
+ } elsif ( lc($opt{'format'}) eq 'oneline' ) { #name?
+
+ my ($previous_balance) = $self->previous;
+ my $totaldue = sprintf('%.2f', $self->owed + $previous_balance);
+ my @items = map {
+ ($_->{pkgnum} || ''),
+ $_->{description},
+ $_->{amount}
+ } $self->_items_pkg;
+
+ $csv->combine(
+ $cust_main->agentnum,
+ $cust_main->agent->agent,
+ $self->custnum,
+ $cust_main->first,
+ $cust_main->last,
+ $cust_main->address1,
+ $cust_main->address2,
+ $cust_main->city,
+ $cust_main->state,
+ $cust_main->zip,
+
+ # invoice fields
+ time2str("%x", $self->_date),
+ $self->invnum,
+ $self->charged,
+ $totaldue,
+
+ @items,
+ );
+
} else {
$csv->combine(
}
+ } elsif ( lc($opt{'format'}) eq 'oneline' ) {
+
+ #do nothing
+
} else {
foreach my $cust_bill_pkg ( $self->cust_bill_pkg ) {
}
}
- unless ( $conf->exists('disable_previous_balance')
+ unless ( $conf->exists('disable_previous_balance', $agentnum)
|| $conf->exists('previous_balance-summary_only')
)
{
}
- if ( @pr_cust_bill && !$conf->exists('disable_previous_balance') ) {
+ if ( @pr_cust_bill && !$conf->exists('disable_previous_balance', $agentnum) )
+ {
push @buf, ['','-----------'];
push @buf, [ $self->mt('Total Previous Balance'),
$money_char. sprintf("%10.2f", $pr_total) ];
$invoice_data{current_less_finance} =
sprintf('%.2f', $self->charged - $invoice_data{finance_amount} );
- if ( $multisection && !$conf->exists('disable_previous_balance')
+ if ( $multisection && !$conf->exists('disable_previous_balance', $agentnum)
|| $conf->exists('previous_balance-summary_only') )
{
unshift @sections, $previous_section if $pr_total;
push @buf,['','-----------'];
push @buf,[$self->mt(
- $conf->exists('disable_previous_balance')
+ $conf->exists('disable_previous_balance', $agentnum)
? 'Total Charges'
: 'Total New Charges'
),
|| 'Total New Charges'
if $conf->exists('previous_balance-exclude_from_total');
my $amount = $self->charged +
- ( $conf->exists('disable_previous_balance') ||
+ ( $conf->exists('disable_previous_balance', $agentnum) ||
$conf->exists('previous_balance-exclude_from_total')
? 0
: $pr_total
push @buf,['',''];
}
- unless ( $conf->exists('disable_previous_balance') ) {
+ unless ( $conf->exists('disable_previous_balance', $agentnum) ) {
#foreach my $thing ( sort { $a->_date <=> $b->_date } $self->_items_credits, $self->_items_payments
# credits
my $description = ($is_summary && $type && $type eq 'U')
? "Usage charges" : $desc;
- $description .= " (" . time2str($date_format, $cust_bill_pkg->sdate).
- " - ". time2str($date_format, $cust_bill_pkg->edate).
- ")"
- unless $conf->exists('disable_line_item_date_ranges')
- || $cust_pkg->part_pkg->option('disable_line_item_date_ranges',1);
+ unless (
+ $conf->exists('disable_line_item_date_ranges')
+ || $cust_pkg->part_pkg->option('disable_line_item_date_ranges',1)
+ ) {
+ my $time_period;
+ my $date_style = $conf->config('cust_bill-line_item-date_style');
+ if ( defined($date_style) && $date_style eq 'month_of' ) {
+ $time_period = time2str('The month of %B', $cust_bill_pkg->sdate);
+ } else {
+ $time_period = time2str($date_format, $cust_bill_pkg->sdate).
+ " - ". time2str($date_format, $cust_bill_pkg->edate);
+ }
+ $description .= " ($time_period)";
+ }
my @d = ();
my @seconds = (); # for display of usage info
join(', ', map { "#$_" } $plan->pkgnums)
if $list_pkgnums;
+ # discounts for non-integer months don't work anyway
+ $months = sprintf("%d", $months);
+
+{
description => $self->mt('Save [_1]% by paying for [_2] months',
$percent, $months),