projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a81ff71
)
option to separate customer and package display, RT#32301
author
Ivan Kohler
<ivan@freeside.biz>
Sat, 13 Dec 2014 01:09:23 +0000
(17:09 -0800)
committer
Ivan Kohler
<ivan@freeside.biz>
Sat, 13 Dec 2014 01:09:23 +0000
(17:09 -0800)
FS/FS/part_pkg/agent.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_pkg/agent.pm
b/FS/FS/part_pkg/agent.pm
index
0e89f42
..
37e7d9d
100644
(file)
--- a/
FS/FS/part_pkg/agent.pm
+++ b/
FS/FS/part_pkg/agent.pm
@@
-36,6
+36,10
@@
$me = '[FS::part_pkg::agent]';
'type' => 'checkbox',
},
'type' => 'checkbox',
},
+ 'display_separate_cust'=> { 'name' => 'Separate customer from package display on invoices',
+ 'type' => 'checkbox',
+ },
+
},
'fieldorder' => [qw( cutoff_day add_full_period no_pkg_prorate ) ],
},
'fieldorder' => [qw( cutoff_day add_full_period no_pkg_prorate ) ],
@@
-97,12
+101,14
@@
sub calc_recur {
}
$cust_main->all_pkgs;
}
$cust_main->all_pkgs;
+ my $cust_details = 0;
+
foreach my $cust_pkg ( @cust_pkg ) {
warn "$me billing agent charges for pkgnum ". $cust_pkg->pkgnum. "\n"
if $DEBUG;
foreach my $cust_pkg ( @cust_pkg ) {
warn "$me billing agent charges for pkgnum ". $cust_pkg->pkgnum. "\n"
if $DEBUG;
- my $pkg_details =
$cust_main->name_short. ': '; #name?
+ my $pkg_details =
'';
my $cust_location = $cust_pkg->cust_location;
$pkg_details .= $cust_location->locationname. ': '
my $cust_location = $cust_pkg->cust_location;
$pkg_details .= $cust_location->locationname. ': '
@@
-159,12
+165,21
@@
sub calc_recur {
$pkg_charge += $quantity * $recur_charge;
$pkg_charge += $quantity * $recur_charge;
- push @$details, $pkg_details
- if $pkg_charge;
+ if ( $pkg_charge ) {
+ if ( $self->option('display_separate_cust') ) {
+ push @$details, $cust_main->name.':' unless $cust_details++;
+ push @$details, ' '.$pkg_details;
+ } else {
+ push @$details, $cust_main->name_short.': '. $pkg_details;
+ }
+ };
+
$total_agent_charge += $pkg_charge;
} #foreach $cust_pkg
$total_agent_charge += $pkg_charge;
} #foreach $cust_pkg
+ push @$details, ' ' if $cust_details;
+
} #foreach $cust_main
} #foreach $agent;
} #foreach $cust_main
} #foreach $agent;