summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-06-02 15:56:11 -0700
committerIvan Kohler <ivan@freeside.biz>2014-06-02 15:56:11 -0700
commitba46a6a90321490da78c764657ae19d5c6fd81f8 (patch)
tree452b535bcaee9440cd1c5f8b38d6a9e8728f4d3f /httemplate
parent6c8ed91f99f9173b024b78e7f05ccf434e65e0de (diff)
parent313a3715952e448b9efda129597e83df514be4ec (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/browse/rate_region.html3
-rw-r--r--httemplate/edit/elements/rate_detail.html13
-rwxr-xr-xhttemplate/edit/process/rate_region.cgi2
-rw-r--r--httemplate/edit/process/tower.html5
-rw-r--r--httemplate/edit/rate_detail.html8
-rw-r--r--httemplate/edit/tower.html5
-rw-r--r--httemplate/elements/menu.html3
-rw-r--r--httemplate/elements/tower_sector.html14
-rw-r--r--httemplate/misc/process/copy-rate_detail.html3
-rw-r--r--httemplate/search/report_vend_main.html48
-rw-r--r--httemplate/search/vend_main.html40
11 files changed, 126 insertions, 18 deletions
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..14b52110b 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.
<TABLE CLASS="inv" STYLE="border:none">
<TR><TD><% edit_link($detail) %><% $money_char.$detail->min_charge %>
<% $detail->sec_granularity ? ' / minute':' / call' %>
+% if ( $detail->min_cost ) {
+ (<% $money_char.$detail->min_cost %> cost)
+% }
<% $edit_hint %></A>
</TD></TR>
<% 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)').'</A>'
}
@@ -157,7 +160,11 @@ sub conn_charge_detail {
#return '' unless $rate_detail->conn_charge > 0 || $rate_detail->conn_sec;
'<TR><TD>'.
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}
).
'</TD></TR>'
}
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/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/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/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/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/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;
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';
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') &>
+
+<FORM ACTION="vend_main.html" METHOD="GET">
+
+ <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
+
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Date') |h %></TD>
+ <TD>
+ <TABLE>
+ <& /elements/tr-input-beginning_ending.html,
+ prefix => '_date',
+ layout => 'horiz',
+ &>
+ </TABLE>
+ </TD>
+ </TR>
+
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Payment date') |h %></TD>
+ <TD>
+ <TABLE>
+ <& /elements/tr-input-beginning_ending.html,
+ prefix => 'payment_date',
+ layout => 'horiz',
+ &>
+ </TABLE>
+ </TD>
+ </TR>
+
+ <& /elements/tr-select-vend_class.html,
+ &>
+
+ </TABLE>
+
+<BR>
+<INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
+
+</FORM>
+
+<& /elements/footer.html &>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
+
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'} );
+
+</%init>
+