projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix UI for package editing w/recur_show_zero, add setup_show_zero, RT#9777
[freeside.git]
/
FS
/
FS
/
cust_bill.pm
diff --git
a/FS/FS/cust_bill.pm
b/FS/FS/cust_bill.pm
index
1e47545
..
7bf4fd2
100644
(file)
--- a/
FS/FS/cust_bill.pm
+++ b/
FS/FS/cust_bill.pm
@@
-4088,10
+4088,8
@@
sub _did_summary {
# increment usage minutes
if ( $phone_inserted ) {
# increment usage minutes
if ( $phone_inserted ) {
- my @cdrs = $phone_inserted->get_cdrs('begin'=>$start,'end'=>$end);
- foreach my $cdr ( @cdrs ) {
- $minutes += $cdr->billsec/60;
- }
+ my @cdrs = $phone_inserted->get_cdrs('begin'=>$start,'end'=>$end,'billsec_sum'=>1);
+ $minutes = $cdrs[0]->billsec_sum if scalar(@cdrs) == 1;
}
else {
warn "WARNING: no matching h_svc_phone insert record for insert time $inserted, svcnum " . $h_cust_svc->svcnum;
}
else {
warn "WARNING: no matching h_svc_phone insert record for insert time $inserted, svcnum " . $h_cust_svc->svcnum;
@@
-4499,13
+4497,21
@@
sub _items_cust_bill_pkg {
my $cust_pkg = $cust_bill_pkg->cust_pkg;
my $cust_pkg = $cust_bill_pkg->cust_pkg;
- if ( $cust_bill_pkg->setup != 0 && (!$type || $type eq 'S') ) {
+ if ( (!$type || $type eq 'S')
+ && ( $cust_bill_pkg->setup != 0
+ || $cust_bill_pkg->setup_show_zero
+ )
+ )
+ {
warn "$me _items_cust_bill_pkg adding setup\n"
if $DEBUG > 1;
my $description = $desc;
warn "$me _items_cust_bill_pkg adding setup\n"
if $DEBUG > 1;
my $description = $desc;
- $description .= ' Setup' if $cust_bill_pkg->recur != 0;
+ $description .= ' Setup'
+ if $cust_bill_pkg->recur != 0
+ || $discount_show_always
+ || $cust_bill_pkg->recur_show_zero;
my @d = ();
unless ( $cust_pkg->part_pkg->hide_svc_detail
my @d = ();
unless ( $cust_pkg->part_pkg->hide_svc_detail
@@
-4534,6
+4540,7
@@
sub _items_cust_bill_pkg {
push @{ $s->{ext_description} }, @d;
} else {
$s = {
push @{ $s->{ext_description} }, @d;
} else {
$s = {
+ _is_setup => 1,
description => $description,
#pkgpart => $part_pkg->pkgpart,
pkgnum => $cust_bill_pkg->pkgnum,
description => $description,
#pkgpart => $part_pkg->pkgpart,
pkgnum => $cust_bill_pkg->pkgnum,
@@
-4566,7
+4573,8
@@
sub _items_cust_bill_pkg {
$description .= " (" . time2str($date_format, $cust_bill_pkg->sdate).
" - ". time2str($date_format, $cust_bill_pkg->edate).
")"
$description .= " (" . time2str($date_format, $cust_bill_pkg->sdate).
" - ". time2str($date_format, $cust_bill_pkg->edate).
")"
- unless $conf->exists('disable_line_item_date_ranges');
+ unless $conf->exists('disable_line_item_date_ranges')
+ || $cust_pkg->part_pkg->option('disable_line_item_date_ranges',1);
my @d = ();
my @d = ();
@@
-4709,7
+4717,9
@@
sub _items_cust_bill_pkg {
push @b, { %$_ }
if $_->{amount} != 0
|| $discount_show_always
push @b, { %$_ }
if $_->{amount} != 0
|| $discount_show_always
- || $cust_bill_pkg->recur_show_zero;
+ || ( ! $_->{_is_setup} && $cust_bill_pkg->recur_show_zero )
+ || ( $_->{_is_setup} && $cust_bill_pkg->setup_show_zero )
+ ;
$_ = undef;
}
}
$_ = undef;
}
}