From 9e133090578e965088e4355e9d99cdfd5aab69d5 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Thu, 22 Aug 2013 05:05:50 -0400 Subject: #24570 Clarify usage_mandate instructions --- FS/FS/part_pkg/voip_cdr.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'FS') diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm index de17cd3b8..79235edd5 100644 --- a/FS/FS/part_pkg/voip_cdr.pm +++ b/FS/FS/part_pkg/voip_cdr.pm @@ -263,7 +263,7 @@ tie my %detail_formats, 'Tie::IxHash', 'type' => 'checkbox', }, - 'usage_mandate' => { 'name' => 'Always put usage details in separate section', + 'usage_mandate' => { 'name' => 'Always put usage details in separate section. The section is defined the section is defined in the next option', 'type' => 'checkbox', }, #eofalse @@ -340,7 +340,7 @@ tie my %detail_formats, 'Tie::IxHash', 411_rewrite output_format selfservice_format selfservice_inbound_format - usage_mandate summarize_usage usage_section + usage_mandate usage_section summarize_usage usage_nozero bill_every_call bill_inactive_svcs count_available_phones suspend_bill ) -- cgit v1.2.1 From 25c5adf89c41e5a7d4eb7af7dc55cc5efded7e7e Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Mon, 16 Sep 2013 12:48:54 -0400 Subject: #24570 Typo --- FS/FS/part_pkg/voip_cdr.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FS') diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm index 79235edd5..5a27f064f 100644 --- a/FS/FS/part_pkg/voip_cdr.pm +++ b/FS/FS/part_pkg/voip_cdr.pm @@ -263,7 +263,7 @@ tie my %detail_formats, 'Tie::IxHash', 'type' => 'checkbox', }, - 'usage_mandate' => { 'name' => 'Always put usage details in separate section. The section is defined the section is defined in the next option', + 'usage_mandate' => { 'name' => 'Always put usage details in separate section. The section is defined in the next option.', 'type' => 'checkbox', }, #eofalse -- cgit v1.2.1 From 0e7d79b663203cf83f2b14ade82b8fd0e6b389aa Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Thu, 19 Sep 2013 15:57:10 -0400 Subject: #24831 Change documentation link in Conf.pm --- FS/FS/Conf.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FS') diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index d63c12fa8..03280c484 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -2967,7 +2967,7 @@ and customer address. Include units.', { 'key' => 'network_monitoring_system', 'section' => 'network_monitoring', - 'description' => 'Networking monitoring system (NMS) integration. Torrus_Internal uses the built-in Torrus ticketing system (see the integrated networking monitoring system installation instructions).', + 'description' => 'Networking monitoring system (NMS) integration. Torrus_Internal uses the built-in Torrus ticketing system (see the integrated networking monitoring system installation instructions).', 'type' => 'select', 'select_enum' => [ '', qw(Torrus_Internal) ], }, -- cgit v1.2.1 From b5d22578f60ba105934c92c031799671bf6c0f29 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Thu, 19 Sep 2013 13:34:02 -0700 Subject: more accurate calculation of package start delays, #20686 --- FS/FS/part_pkg.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'FS') diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index e1874259e..9e3b67ef1 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -5,7 +5,8 @@ use strict; use vars qw( %plans $DEBUG $setup_hack $skip_pkg_svc_hack ); use Carp qw(carp cluck confess); use Scalar::Util qw( blessed ); -use Time::Local qw( timelocal timelocal_nocheck ); +use DateTime; +use Time::Local qw( timelocal timelocal_nocheck ); # eventually replace with DateTime use Tie::IxHash; use FS::Conf; use FS::Record qw( qsearch qsearchs dbh dbdef ); @@ -1094,10 +1095,11 @@ sub delay_start_date { my $self = shift; my $delay = $self->delay_start or return ''; - - my ($mday,$mon,$year) = (localtime(time))[3,4,5]; - timelocal(0,0,0,$mday,$mon,$year) + 86400 * $delay; + # avoid timelocal silliness + my $dt = DateTime->today(time_zone => 'local'); + $dt->add(days => $delay); + $dt->epoch; } sub can_currency_exchange { 0; } -- cgit v1.2.1 From 60e557fcb48a2aea0aa4ddc5132b7afc8fe82a26 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Fri, 20 Sep 2013 16:17:09 -0700 Subject: cleanup for package report class filtering on sales report, #24776 --- FS/FS/Report/Table.pm | 49 +++++++++++++++++++------------------------------ 1 file changed, 19 insertions(+), 30 deletions(-) (limited to 'FS') diff --git a/FS/FS/Report/Table.pm b/FS/FS/Report/Table.pm index 03ee27391..1d60b6420 100644 --- a/FS/FS/Report/Table.pm +++ b/FS/FS/Report/Table.pm @@ -56,12 +56,7 @@ sub signups { push @where, "refnum = ".$opt{'refnum'}; } - if ( $opt{'cust_classnum'} ) { - my $classnums = $opt{'cust_classnum'}; - $classnums = [ $classnums ] if !ref($classnums); - @$classnums = grep /^\d+$/, @$classnums; - push @where, 'cust_main.classnum in('. join(',',@$classnums) .')'; - } + push @where, $self->with_cust_classnum(%opt); $self->scalar_sql( "SELECT COUNT(*) FROM cust_main $join WHERE ".join(' AND ', @where) @@ -448,12 +443,7 @@ sub cust_bill_pkg_setup { # yuck, false laziness push @where, "cust_main.refnum = ". $opt{'refnum'} if $opt{'refnum'}; - if ( $opt{'cust_classnum'} ) { - my $classnums = $opt{'cust_classnum'}; - $classnums = [ $classnums ] if !ref($classnums); - @$classnums = grep /^\d+$/, @$classnums; - push @where, 'cust_main.classnum in('. join(',',@$classnums) .')'; - } + push @where, $self->with_cust_classnum(%opt); my $total_sql = "SELECT COALESCE(SUM(cust_bill_pkg.setup),0) FROM cust_bill_pkg @@ -478,12 +468,7 @@ sub cust_bill_pkg_recur { push @where, 'cust_main.refnum = '. $opt{'refnum'} if $opt{'refnum'}; - if ( $opt{'cust_classnum'} ) { - my $classnums = $opt{'cust_classnum'}; - $classnums = [ $classnums ] if !ref($classnums); - @$classnums = grep /^\d+$/, @$classnums; - push @where, 'cust_main.classnum in('. join(',',@$classnums) .')'; - } + push @where, $self->with_cust_classnum(%opt); # subtract all usage from the line item regardless of date my $item_usage; @@ -540,12 +525,7 @@ sub cust_bill_pkg_detail { push @where, 'cust_main.refnum = '. $opt{'refnum'} if $opt{'refnum'}; - if ( $opt{'cust_classnum'} ) { - my $classnums = $opt{'cust_classnum'}; - $classnums = [ $classnums ] if !ref($classnums); - @$classnums = grep /^\d+$/, @$classnums; - push @where, 'cust_main.classnum in('. join(',',@$classnums) .')'; - } + push @where, $self->with_cust_classnum(%opt); $agentnum ||= $opt{'agentnum'}; @@ -688,12 +668,8 @@ sub for_opts { if ( $opt{'refnum'} =~ /^(\d+)$/ ) { $sql .= " and refnum = $1 "; } - if ( $opt{'cust_classnum'} ) { - my $classnums = $opt{'cust_classnum'}; - $classnums = [ $classnums ] if !ref($classnums); - @$classnums = grep /^\d+$/, @$classnums; - $sql .= ' and cust_main.classnum in('. join(',',@$classnums) .')' - if @$classnums; + if ( my $where = $self->with_cust_classnum(%opt) ) { + $sql .= " and $where"; } $sql; @@ -772,6 +748,19 @@ sub with_report_option { $comparison; } +sub with_cust_classnum { + my ($self, %opt) = @_; + if ( $opt{'cust_classnum'} ) { + my $classnums = $opt{'cust_classnum'}; + $classnums = [ $classnums ] if !ref($classnums); + @$classnums = grep /^\d+$/, @$classnums; + return 'cust_main.classnum in('. join(',',@$classnums) .')' + if @$classnums; + } + ''; +} + + sub scalar_sql { my( $self, $sql ) = ( shift, shift ); my $sth = dbh->prepare($sql) or die dbh->errstr; -- cgit v1.2.1 From 0d81877c6ae8ea9732065f5400ff37a7458587ed Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Sat, 21 Sep 2013 20:22:04 -0700 Subject: use Business::CreditCard in cust_payby, #23741 --- FS/FS/cust_payby.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'FS') diff --git a/FS/FS/cust_payby.pm b/FS/FS/cust_payby.pm index 68c824515..5914ab5c5 100644 --- a/FS/FS/cust_payby.pm +++ b/FS/FS/cust_payby.pm @@ -6,6 +6,7 @@ use FS::UID; use FS::Record qw( qsearchs ); #qsearch; use FS::payby; use FS::cust_main; +use Business::CreditCard qw( validate cardtype ); use vars qw( $conf @encrypted_fields $ignore_expired_card $ignore_banned_card -- cgit v1.2.1