From b988005162046dcbaa3d4f167f507ba6d6bb80e4 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 28 May 2014 02:32:52 -0700 Subject: rate cost fields, RT#27555 --- httemplate/browse/rate_region.html | 3 ++- httemplate/edit/elements/rate_detail.html | 13 ++++++++++--- httemplate/edit/process/rate_region.cgi | 2 +- httemplate/edit/rate_detail.html | 8 ++++++-- httemplate/misc/process/copy-rate_detail.html | 3 ++- 5 files changed, 21 insertions(+), 8 deletions(-) (limited to 'httemplate') diff --git a/httemplate/browse/rate_region.html b/httemplate/browse/rate_region.html index b0ce467c0..962841d91 100644 --- a/httemplate/browse/rate_region.html +++ b/httemplate/browse/rate_region.html @@ -96,8 +96,9 @@ sub _rate_detail_factory { my( $rate, $field ) = @_; return sub { my $rate_detail = $rate->dest_detail(shift) - || new FS::rate_region { 'min_included' => 0, + || new FS::rate_detail { 'min_included' => 0, 'min_charge' => 0, + 'min_cost' => 0, 'sec_granularity' => 0, }; my $value = $rate_detail->$field(); diff --git a/httemplate/edit/elements/rate_detail.html b/httemplate/edit/elements/rate_detail.html index 1b597fb4a..cd3efe1e3 100644 --- a/httemplate/edit/elements/rate_detail.html +++ b/httemplate/edit/elements/rate_detail.html @@ -52,6 +52,9 @@ with row headers showing the region name and prefixes. <% granularity_detail($detail) %> @@ -92,7 +95,7 @@ sub edit_link { include( '/elements/popup_link_onclick.html', 'action' => "${p}edit/rate_detail.html?$ratedetailnum", 'actionlabel' => 'Edit rate', - 'height' => 420, + 'height' => 460, #default# 'width' => 540, #default# 'color' => '#333399', ) . '">' @@ -110,7 +113,7 @@ sub add_link { ($rate_time ? $rate_time->ratetimenum : ''). ";cdrtypenum=$cdrtypenum", 'actionlabel' => 'Add rate', - 'height' => 420, + 'height' => 460, ).'">'.small('(add)').'' } @@ -157,7 +160,11 @@ sub conn_charge_detail { #return '' unless $rate_detail->conn_charge > 0 || $rate_detail->conn_sec; '' } diff --git a/httemplate/edit/process/rate_region.cgi b/httemplate/edit/process/rate_region.cgi index d342e605a..87d634a62 100755 --- a/httemplate/edit/process/rate_region.cgi +++ b/httemplate/edit/process/rate_region.cgi @@ -2,7 +2,7 @@ % $cgi->param('error', $error); <% $cgi->redirect(popurl(2). "rate_region.cgi?". $cgi->query_string ) %> %} elsif ( $action eq 'Add' ) { -<% $cgi->redirect(popurl(2). "rate_region.cgi?$regionnum") %> +<% $cgi->redirect(popurl(2). "rate_region.cgi?regionnum=$regionnum") %> %} else { <% $cgi->redirect(popurl(3). "browse/rate_region.html") %> %} diff --git a/httemplate/edit/rate_detail.html b/httemplate/edit/rate_detail.html index 0e406897f..0de6ecc1e 100644 --- a/httemplate/edit/rate_detail.html +++ b/httemplate/edit/rate_detail.html @@ -8,10 +8,12 @@ 'rate_time_name' => 'Time period', 'min_included' => 'Included minutes/calls', 'region_group' => 'Region Group', - 'conn_charge' => 'Connection charge', + 'conn_charge' => 'Retail connection charge', 'conn_sec' => 'For', - 'min_charge' => 'Charge per minute/call', + 'min_charge' => 'Retail charge per minute/call', 'sec_granularity' => 'Granularity', + 'conn_cost' => 'Wholesale connection cost', + 'min_cost' => 'Wholesale cost per minute/call', 'classnum' => 'Usage class', }, 'fields' => [ @@ -29,6 +31,7 @@ }, { field=>'min_included', type=>'text', size=>5 }, { field=>'conn_charge', type=>'money', size=>4 }, + { field=>'conn_cost', type=>'money', size=>4 }, { field =>'conn_sec', type =>'select', options => [ keys %conn_secs ], @@ -36,6 +39,7 @@ disable_empty => 1, }, { field=>'min_charge', type=>'money', size=>4 }, + { field=>'min_cost', type=>'money', size=>4 }, { field =>'sec_granularity', type =>'select', options => [ keys %granularity ], diff --git a/httemplate/misc/process/copy-rate_detail.html b/httemplate/misc/process/copy-rate_detail.html index 60b2aebee..94acce000 100644 --- a/httemplate/misc/process/copy-rate_detail.html +++ b/httemplate/misc/process/copy-rate_detail.html @@ -47,7 +47,8 @@ foreach my $countrycode ( @countrycodes ) { || new FS::rate_detail \%hash; $dst_rate_detail->$_( $src_rate_detail->get($_) ) - foreach qw( min_included conn_charge conn_sec min_charge sec_granularity classnum ); + foreach qw( min_included conn_charge conn_sec min_charge sec_granularity + conn_cost min_cost classnum ); my $method = $dst_rate_detail->ratedetailnum ? 'replace' : 'insert'; -- cgit v1.2.1 From ef3c3ca13b2b93df158e01d4fc0713a3e8191a8c Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 28 May 2014 11:28:07 -0700 Subject: rate cost fields, RT#27555 --- httemplate/edit/elements/rate_detail.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate') diff --git a/httemplate/edit/elements/rate_detail.html b/httemplate/edit/elements/rate_detail.html index cd3efe1e3..14b52110b 100644 --- a/httemplate/edit/elements/rate_detail.html +++ b/httemplate/edit/elements/rate_detail.html @@ -53,7 +53,7 @@ with row headers showing the region name and prefixes. -- cgit v1.2.1 From 5700d83bcd475134cff8afb28307174c09116924 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 28 May 2014 22:58:04 -0700 Subject: payables summary by vendor --- httemplate/elements/menu.html | 3 ++- httemplate/search/report_vend_main.html | 48 +++++++++++++++++++++++++++++++++ httemplate/search/vend_main.html | 40 +++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 httemplate/search/report_vend_main.html create mode 100644 httemplate/search/vend_main.html (limited to 'httemplate') diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 7df2448d3..fdd496230 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -377,7 +377,8 @@ if( $curuser->access_right('Financial reports') ) { } # else $report_financial contains nothing. tie my %report_payable, 'Tie::IxHash', - 'Payables' => [ $fsurl. 'search/report_vend_bill.html' ], + 'Payables summary' => [ $fsurl. 'search/report_vend_main.html', 'Payables summary by vendor' ], + 'Payables detail' => [ $fsurl. 'search/report_vend_bill.html' ], ; tie my %report_logs, 'Tie::IxHash'; diff --git a/httemplate/search/report_vend_main.html b/httemplate/search/report_vend_main.html new file mode 100644 index 000000000..c7fbb2be4 --- /dev/null +++ b/httemplate/search/report_vend_main.html @@ -0,0 +1,48 @@ +<& /elements/header.html, mt('Payables summary by vendor') &> + +
+ +
<% edit_link($detail) %><% $money_char.$detail->min_charge %> <% $detail->sec_granularity ? ' / minute':' / call' %> +% if ( $detail->min_cost ) { + (<% $money_char.$detail->min_charge %> cost) +% } <% $edit_hint %>
'. small( $money_char. $rate_detail->conn_charge. - ' for '.$conn_secs{$rate_detail->conn_sec} + ( $rate_detail->conn_cost + ? ' ('. $money_char.$rate_detail->conn_cost. ' cost)' + : '' + ). + ' for '. $conn_secs{$rate_detail->conn_sec} ). '
<% edit_link($detail) %><% $money_char.$detail->min_charge %> <% $detail->sec_granularity ? ' / minute':' / call' %> % if ( $detail->min_cost ) { - (<% $money_char.$detail->min_charge %> cost) + (<% $money_char.$detail->min_cost %> cost) % } <% $edit_hint %>
+ + + + + + + + + + + + <& /elements/tr-select-vend_class.html, + &> + +
<% mt('Date') |h %> + + <& /elements/tr-input-beginning_ending.html, + prefix => '_date', + layout => 'horiz', + &> +
+
<% mt('Payment date') |h %> + + <& /elements/tr-input-beginning_ending.html, + prefix => 'payment_date', + layout => 'horiz', + &> +
+
+ +
+ + + + +<& /elements/footer.html &> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + + + diff --git a/httemplate/search/vend_main.html b/httemplate/search/vend_main.html new file mode 100644 index 000000000..41917a517 --- /dev/null +++ b/httemplate/search/vend_main.html @@ -0,0 +1,40 @@ +<& elements/search.html, + 'title' => 'Payables summary by vendor', + 'name' => 'vendors', + 'query' => $query, + 'count_query' => $count_query, + 'count_addl' => [ '$%.2f total', ], + 'header' => [ + 'Vendor', + 'Class', + 'Amount', + '', + ], + 'fields' => [ + sub { shift->vendname }, + sub { shift->vend_class->classname }, + 'sum_charged', + ], + +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my %search = (); + +# begin/end/beginning/ending +my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, '_date'); +$search{'_date'} = [ $beginning, $ending ]; + +($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, 'payment_date'); +$search{'payment_date'} = [ $beginning, $ending ]; + +$search{'classnum'} = $cgi->param('classnum'); + +my $query = FS::vend_main->search( \%search ); +my $count_query = delete( $query->{'count_query'} ); + + + -- cgit v1.2.1 From dba6b1030a2694cbb69371c171e4ebb8c52db830 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Fri, 30 May 2014 14:04:09 -0700 Subject: MySQL support, RT#28895 --- httemplate/edit/process/tower.html | 5 ++++- httemplate/edit/tower.html | 5 ++++- httemplate/elements/tower_sector.html | 14 +++++++------- 3 files changed, 15 insertions(+), 9 deletions(-) (limited to 'httemplate') diff --git a/httemplate/edit/process/tower.html b/httemplate/edit/process/tower.html index bbfc1a670..02362db6a 100644 --- a/httemplate/edit/process/tower.html +++ b/httemplate/edit/process/tower.html @@ -2,6 +2,9 @@ table => 'tower', viewall_dir => 'browse', process_o2m => { 'table' => 'tower_sector', - 'fields' => [qw( sectorname ip_addr height freq_mhz direction width range )], + 'fields' => [qw( + sectorname ip_addr height freq_mhz direction width + sector_range + )], }, &> diff --git a/httemplate/edit/tower.html b/httemplate/edit/tower.html index 00c9adde1..fa3838dcf 100644 --- a/httemplate/edit/tower.html +++ b/httemplate/edit/tower.html @@ -37,7 +37,10 @@ my $m2_error_callback = sub { # reconstruct the list my ($cgi, $object) = @_; - my @fields = qw( sectorname ip_addr height freq_mhz direction width range ); + my @fields = qw( + sectorname ip_addr height freq_mhz direction width sector_range + ); + map { my $k = $_; new FS::tower_sector { diff --git a/httemplate/elements/tower_sector.html b/httemplate/elements/tower_sector.html index 406895ed9..151d3ba65 100644 --- a/httemplate/elements/tower_sector.html +++ b/httemplate/elements/tower_sector.html @@ -51,13 +51,13 @@ if ( $curr_value ) { my %size = ( 'title' => 12 ); tie my %label, 'Tie::IxHash', - 'sectorname' => 'Name', - 'ip_addr' => 'IP Address', - 'height' => 'Height', - 'freq_mhz' => 'Freq. (MHz)', - 'direction' => 'Direction', # or a button to set these to 0 for omni - 'width' => 'Width', # - 'range' => 'Range', + 'sectorname' => 'Name', + 'ip_addr' => 'IP Address', + 'height' => 'Height', + 'freq_mhz' => 'Freq. (MHz)', + 'direction' => 'Direction', # or a button to set these to 0 for omni + 'width' => 'Width', # + 'sector_range' => 'Range', ; my @fields = keys %label; -- cgit v1.2.1