4 use vars qw( %seen $opt_d );
6 use FS::UID qw(adminsuidsetup);
7 use FS::Record qw(qsearch);
8 use FS::cust_bill_pkg_detail;
12 my $user = shift or die &usage;
15 my $extra_sql = "AND detail LIKE 'Date,Time%'";
16 my @cust_bill_pkg_detail = qsearch( { 'table' => 'cust_bill_pkg_detail',
17 'hashref' => {format => 'C'},
18 'extra_sql' => $extra_sql,
20 for my $detail (@cust_bill_pkg_detail) {
21 if ( $seen{$detail->billpkgnum} ) {
22 if ($opt_d) { # dry run
23 print "DELETE cust_bill_pkg_detail WHERE detailnum=". $detail->detailnum.
29 $seen{$detail->billpkgnum} = 1;
34 die "Usage:\n\n freeside-sqlradius-dedup-group [-d] user\n";
39 freeside-dedup-cust_bill_pkg_detail-header - Command line tool to eliminate duplicate headers from cdr details on invoices
43 freeside-dedup-cust_bill_pkg_detail-header user
47 Removes all but one header when duplicate entries exist on invoice
54 L<FS::part_pkg::voip_cdr>