MT#5879 Templates alignments.

ipeshinskaya/InvoiceTemplate5
Irina Peshinskaya 12 years ago committed by Victor Seva
parent 5e30919042
commit dbf2b5414a

@ -11,10 +11,12 @@ use NGCP::Panel::Utils::Contract;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::Message;
use NGCP::Panel::Utils::Navigation;
use NGCP::Panel::Form::InvoiceTemplate::Basic;
use NGCP::Panel::Model::DB::InvoiceTemplate;
use NGCP::Panel::Utils::InvoiceTemplate;
use JSON;
use Number::Phone;
sub auto {
my ($self, $c) = @_;
@ -471,11 +473,20 @@ sub invoice_details_calls :Chained('invoice_details_zones') :PathPart('') :Captu
stime => $stime,
etime => $etime,
);
#$invoice_details_calls
#TODO: FAKE FAKE FAKE FAKE
my $invoice_details_calls_raw = $invoice_details_calls;
#foreach my $call(@$invoice_details_calls_raw) {
# next unless($call->source_cli && $call->source_cli =~ /^\d{5,}$/ &&
# $call->destination_user_in && $call->destination_user_in =~ /^\d{5,}$/);
# my $s = Number::Phone->new($call->source_cli);
# my $d = Number::Phone->new($call->destination_user_in);
# next unless($s && $d);
#}
$invoice_details_calls = [$invoice_details_calls_raw->all()];
my $i = 1;
$invoice_details_calls = [map{[$i++,$_]} (@$invoice_details_calls) x 21];
$invoice_details_calls = [map{[$i++,$_]} (@$invoice_details_calls) x 1];
$c->stash( invoice_details_calls => $invoice_details_calls );
$c->stash( invoice_details_calls_raw => $invoice_details_calls_raw );
}
@ -695,7 +706,7 @@ sub invoice_template_delete :Chained('base') :PathPart('invoice_template/delete'
$c->forward( 'invoice_template_list' );
}
sub invoice_template_list_data :Chained('invoice_details_zones') :PathPart('') :CaptureArgs(0) {
sub invoice_template_list_data :Chained('invoice_details_calls') :PathPart('') :CaptureArgs(0) {
my ($self, $c) = @_;
$c->log->debug('invoice_template_list_data');
my($validator,$backend,$in,$out);

@ -36,7 +36,7 @@ var svgWhiteList_ = {
"feGaussianBlur": ["class", "color-interpolation-filters", "id", "requiredFeatures", "stdDeviation"],
"filter": ["class", "color-interpolation-filters", "filterRes", "filterUnits", "height", "id", "primitiveUnits", "requiredFeatures", "width", "x", "xlink:href", "y"],
"foreignObject": ["class", "font-size", "height", "id", "opacity", "requiredFeatures", "style", "transform", "width", "x", "y"],
"g": ["class", "clip-path", "clip-rule", "id", "display", "fill", "fill-opacity", "fill-rule", "filter", "mask", "opacity", "requiredFeatures", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "style", "systemLanguage", "transform", "font-family", "font-size", "font-style", "font-weight", "text-anchor", "rows"],
"g": ["class", "clip-path", "clip-rule", "id", "display", "fill", "fill-opacity", "fill-rule", "filter", "mask", "opacity", "requiredFeatures", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "style", "systemLanguage", "transform", "font-family", "font-size", "font-style", "font-weight", "text-anchor", "rows", "zone-rows", "call-rows", "rows-interval", "zone-rows-interval", "call-rows-interval"],
"image": ["class", "clip-path", "clip-rule", "filter", "height", "id", "mask", "opacity", "requiredFeatures", "style", "systemLanguage", "transform", "width", "x", "xlink:href", "xlink:title", "y"],
"line": ["class", "clip-path", "clip-rule", "fill", "fill-opacity", "fill-rule", "filter", "id", "marker-end", "marker-mid", "marker-start", "mask", "opacity", "requiredFeatures", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "style", "systemLanguage", "transform", "x1", "x2", "y1", "y2"],
"linearGradient": ["class", "id", "gradientTransform", "gradientUnits", "requiredFeatures", "spreadMethod", "systemLanguage", "x1", "x2", "xlink:href", "y1", "y2"],

@ -85,7 +85,7 @@ var uriForAction = function( data, type ){
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#customer_invoice_template" href="#collapse_invoice_details_zones">[% c.loc('Invoice details') %]</a>
<a class="accordion-toggle" data-toggle="collapse" data-parent="#customer_invoice_template" href="#collapse_invoice_details_zones">[% c.loc('Invoice Connection Fees') %]</a>
</div>
<div class="accordion-body collapse" id="collapse_invoice_details_zones">
@ -116,30 +116,31 @@ var uriForAction = function( data, type ){
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#customer_invoice_template" href="#collapse_invoice_details_zones">[% c.loc('Invoice details') %]</a>
<a class="accordion-toggle" data-toggle="collapse" data-parent="#customer_invoice_template" href="#collapse_invoice_details_calls">[% c.loc('Invoice Calls') %]</a>
</div>
<div class="accordion-body collapse" id="collapse_invoice_details_zones">
<div class="accordion-body collapse" id="collapse_invoice_details_calls">
<div class="accordion-inner" style="overflow:auto; height: 300px;">
[%
clearHelper();
helper.name = c.loc('Invoice Details');
helper.name = c.loc('Invoice Calls');
helper.dt_columns = [
{ name => 'start_time', title => c.loc('Start time'), search=> 1 },
{ name => 'duration', title => c.loc('Duration') },
{ name => 'destination_user', title => c.loc('Destination') },
{ name => 'call_type', title => c.loc('Type') },
{ name => 'source_customer_billing_zones_history.zone', title => c.loc('Zone'), search=> 1 },
{ name => 'number', title => c.loc('Calls') },
{ name => 'duration', title => c.loc('Usage') },
{ name => 'free_time', title => c.loc('Free time') },
{ name => 'cost', title => c.loc('Amount EUR') },
{ name => 'source_customer_cost', title => c.loc('Amount EUR') },
];
helper.name_single = c.loc('Invoice Connections Records');
helper.identifier = 'invoice_details_zones_raw';
helper.ajax_uri = c.uri_for_action( '/reseller/invoice_details_zones_ajax', [ contract.id ] ) ;
helper.name_single = c.loc('Invoice calls');
helper.identifier = 'invoice_details_calls_raw';
helper.ajax_uri = c.uri_for_action( '/reseller/invoice_details_calls_ajax', [ contract.id ] ) ;
initHelperAuto();
PROCESS 'helpers/datatables.tt';
-%]
[%PROCESS 'invoice/invoice_details_zones_list.tt' %]
[%PROCESS 'invoice/invoice_details_calls_list.tt' %]
</div>
</div>

@ -1,4 +1,6 @@
[%# USE Dumper %]
[% USE date %]
[% USE Math %]
[%# Dumper.dump(invoice_details_zones)%]
[%# invoice_details_zones.size%]
@ -12,31 +14,28 @@
<th>[% c.loc('Type') %]</th>
<th>[% c.loc('Zone/Details') %]</th>
<th>[% c.loc('Cash') %]</th>
<th class="ngcp-actions-column"></th>
</tr>
</thead>
<tbody>
[%# Dumper.dump_html(invoice_details_zones.as_query)%]
[% FOR call IN invoice_details_zones -%]
[% FOR call IN invoice_details_calls -%]
[%IF call.1; row_number = call.0; call = call.1; END%]
[% total_duration = total_duration + call.get_column('duration') %]
[% total_cost = total_cost + call.get_column('cost') %]
[% total_cost = total_cost + call.get_column('source_customer_cost') / 100 %]
<tr class="sw_action_row">
<td>[% row_number %]</td>
<td><div class="pull-right">[% call.get_column('start_time') %]</div></td>
<td><div class="pull-right">[% date.format(Math.int(call.get_column('start_time')),'%Y-%m-%d %H:%M:%S') %]</div></td>
<td><div class="pull-right">[% call.get_column('duration')|format('%.3f') %]</div></td>
<td><div class="pull-right">[% call.get_column('destination')%][%#to mscro or view .replace('(.*?)\d{4}$','$1****') %]</div></td>
<td><div class="pull-right">[% call.get_column('destination_user_in').replace('(.*?)\d{4}$','$1****') %][%#to mscro or view .replace('(.*?)\d{4}$','$1****') %]</div></td>
<td><div class="pull-right">[% call.get_column('call_type') %]</div></td>
<td>[% call.get_column('zone') _ '/' _ call.get_column('detail') %]</td>
<td><div class="pull-right">[% money_format( call.get_column('cost') / 100 ) %]</div></td>
<td>[% call.get_column('zone') _ '/' _ call.get_column('zone_detail') %]</td>
<td><div class="pull-right">[% money_format( call.get_column('source_customer_cost') / 100 ) %]</div></td>
</tr>
[%END%]
<tr>
<td colspan="2">[% c.loc('Total') %]</td>
<td><div class="pull-right">[% total_number %]</div></td>
<td><div class="pull-right">[% total_duration | format('%.3f') %]</div></td>
<td><div class="pull-right">[% total_free_time | format('%d')%]</div></td>
<td><div class="pull-right">[% money_format( total_cost / 100 ) %]</div></td>
<td><div class="pull-right" colspan="4">[% money_format( total_cost ) %]</div></td>
</tr>
</tbody>
</table>

@ -1,14 +1,8 @@
[%USE Dumper%]
[%USE Math%]
[%USE date%]
[% total = {perpage => [], global => {} } -%]
[%MACRO row_y_re(tt_type) BLOCK -%]
[% IF tt_type == 'svg' -%]
[% y_re = '(?s)(<text[^>]*\s+y\s?=.*?)(\d+)(.*)' -%]
[%END%]
[%y_re%]
[%END%]
[%MACRO if(prefix, value) BLOCK -%]
[%value_clear = value.replace('[ ,]','')%]
[% IF value_clear -%]
@ -16,23 +10,6 @@
[%END%]
[%END%]
[%MACRO page_rows_re(tt_type) BLOCK -%]
[% IF tt_type == 'svg' -%]
[%# page_rows_re = '(?si)<g\s+[^>]*(?:\s+rows\s*=.*?(\d+))?[^>]*\s+id\s*=.*?(?:page_invoicedetails)[^>]*(?:\s+rows\s*=.*?(\d+))?[^>]*>' -%]
[% page_rows_re = 'rows="([0-9]+)"' -%]
[%END%]
[%page_rows_re%]
[%END%]
[%MACRO page_g_y_and_height_re(tt_type) BLOCK -%]
[%#macro intended to be used when no rows specified in data table grouping g %]
[%#all <g y and heights supposed to be taken and from them attempted to define free place for data row%]
[% IF tt_type == 'svg' -%]
[% page_rows_re = '(?s)<g [^>]*\s+\s?=.*?(\d+)[^>]*>' -%]
[%END%]
[%page_rows_re%]
[%END%]
[%MACRO get_row(data, rowtype) BLOCK -%]
[%#use this macro until no symbolic references in tt %]
[%#data can be empty, if we just need y - it doesn't depend on data %]
@ -58,22 +35,22 @@
[%page%]
[%END%]
[%MACRO adjustrow(data, page, rowtype, tt_type, row_vertical_interval, rownumber) BLOCK -%]
[%MACRO adjustrow(data, page, rowtype, tt_type, rows_interval_in, rownumber) BLOCK -%]
[%# y_re = row_y_re(tt_type) %]
[% rows_interval = ( rows_interval_in > 0 ) ? rows_interval_in : row_vertical_interval%]
[% row = get_row(data, rowtype) %]
[% IF tt_type == 'svg' -%]
[% y_re = '(?s)(<(?:text)[^>]*\s+y\s?=.*?)(\d+)(.*)' -%]
[%END%]
[% matches = row.match( y_re ) -%]
[% IF matches.size > 0 -%]
[% y = matches.1 + ( row_vertical_interval * ( rownumber - 1 ) ) %]
[% y = matches.1 + ( rows_interval * ( rownumber - 1 ) ) %]
[% row = matches.0 _ y _ matches.2 %]
[%END -%]
[%row%]
[%END -%]
[%MACRO list_calls(callsdata, page, rowtype, total, tt_type, row_vertical_interval) BLOCK-%]
[%MACRO list_zones(callsdata, page, rowtype, total, tt_type, rows_interval) BLOCK-%]
[% FOR call IN callsdata -%][%#invoice_details%]
[% total.global.number = total.number + call.get_column('number') -%]
[% total.global.duration = total.duration + call.get_column('duration') -%]
@ -83,17 +60,23 @@
[% total.perpage.${page}.duration = total.duration + call.get_column('duration') -%]
[% total.perpage.${page}.free_time = total.free_time + call.get_column('free_time') -%]
[% total.perpage.${page}.cost = total.cost + call.get_column('cost') -%]
[% adjustrow(call, page, rowtype, tt_type, row_vertical_interval, loop.count) -%]
[% adjustrow(call, page, rowtype, tt_type, rows_interval, loop.count) -%]
[%END -%]
[%END -%]
[%MACRO list_calls(callsdata, page, rowtype, total, tt_type, rows_interval) BLOCK-%]
[% FOR call IN callsdata -%][%#invoice_details%]
[% total.global.duration = total.duration + call.get_column('duration') -%]
[% total.global.cost = total.cost + call.get_column('source_customer_cost') -%]
[% total.perpage.${page}.duration = total.duration + call.get_column('duration') -%]
[% total.perpage.${page}.cost = total.cost + call.get_column('source_customer_cost') -%]
[% adjustrow(call, page, rowtype, tt_type, rows_interval, loop.count) -%]
[%END -%]
[%END -%]
[%MACRO get_page_zonerows_number(pagetype, tt_type, row_vertical_interval) BLOCK-%]
[%#doesn't work %]
[% page_zonerows_re = page_zonerows_re(tt_type) %]
[%MACRO get_page_rows_number(pagetype, tt_type, rows_type) BLOCK-%]
[% IF tt_type == 'svg' -%]
[%# page_rows_re = '(?si)<g\s+[^>]*(?:\s+rows\s*=.*?(\d+))?[^>]*\s+id\s*=.*?(?:page_invoicedetails)[^>]*(?:\s+rows\s*=.*?(\d+))?[^>]*>' -%]
[% page_rows_re = 'zonerows="([0-9]+)"' -%]
[% rows_type = rows_type ? rows_type _ '-' : '' %]
[% page_rows_re = rows_type _ 'rows="([0-9]+)"' -%]
[%END%]
[% page = get_page(pagetype) %]
@ -104,29 +87,30 @@
[%rows%]
[%END -%]
[%MACRO get_page_callrows_number(pagetype, tt_type, row_vertical_interval) BLOCK-%]
[%#doesn't work %]
[% page_rows_re = page_rows_re(tt_type) %]
[%MACRO get_page_interval(pagetype, tt_type, interval_type) BLOCK-%]
[% IF tt_type == 'svg' -%]
[%# page_rows_re = '(?si)<g\s+[^>]*(?:\s+rows\s*=.*?(\d+))?[^>]*\s+id\s*=.*?(?:page_invoicedetails)[^>]*(?:\s+rows\s*=.*?(\d+))?[^>]*>' -%]
[% page_rows_re = 'callrows="([0-9]+)"' -%]
[% interval_type = interval_type ? interval_type _ '-' : '' %]
[% page_interval_re = interval_type _ 'rows-interval="([0-9]+)"' -%]
==[%page_interval_re%]==
[%END%]
[% page = get_page(pagetype) %]
[% matches = page.match( page_rows_re ) -%]
[% matches = page.match( page_interval_re ) -%]
[%rows = matches.0 || matches.1 %]
[%rows = Math.int(rows)%]
[%rows%]
[%interval = matches.0 || matches.1 %]
[%interval = Math.int(rows)%]
[%interval%]
[%END -%]
[%MACRO show_pages(invoice_details_zones, invoice_details_calls, pagetype, pagenum_in) BLOCK-%]
[%#todo: remove copypast with some macro, later%]
[% allzonerowsnumber = invoice_details_zones.size() %]
[% titlezonerows = get_page_zonerows_number('titlepage','svg') %]
[% midzonerows = get_page_zonerows_number('zonepage','svg') %]
[% midzonerows = ( midzonerows == 0 ) ? 30 : midzonerows %]
[% titlezonerows = get_page_rows_number('titlepage','svg','zone') %]
[% midzonerows = get_page_rows_number('zonepage','svg') %]
[% titlezoneinterval = get_page_interval('titlepage','svg','zone') %]
[% midzoneinterval = get_page_interval('zonepage','svg') %]
[% midzonerows = get_page_rows_number('zonepage','svg') %]
[% midzonerows = ( midzonerows < 1 ) ? 30 : midzonerows %]
[% allzonepages = ( (allzonerowsnumber - titlezonerows) / midzonerows )|format('%d') %]
[% allmidzonerows = allzonepages * midzonerows %]
@ -134,9 +118,11 @@
[% allcallrowsnumber = invoice_details_calls.size() %]
[% titlecallrows = get_page_callrows_number('titlepage','svg') %]
[% midcallrows = get_page_callrows_number('callpage','svg') %]
[% titlecallrows = get_page_rows_number('titlepage','svg','call') %]
[% midcallrows = get_page_rows_number('callpage','svg') %]
[% midcallrows = ( midcallrows < 1 ) ? 30 : midcallrows %]
[% titlecallinterval = get_page_interval('titlepage','svg', 'call') %]
[% midcallinterval = get_page_interval('callpage','svg') %]
[% allcallpages = ( (allcallrowsnumber - titlecallrows) / midcallrows )|format('%d') %]
[% allmidcallrows = allcallpages * midcallrows %]
[% lastcallrows = allcallrowsnumber - allmidcallrows - titlecallrows %]
@ -150,7 +136,9 @@
( titlezonerows > 0 && invoice_details_zones.size > 0 ) ? invoice_details_zones.slice(0, titlezonerows - 1 ) : [],
( titlecallrows > 0 && invoice_details_calls.size > 0 ) ? invoice_details_calls.slice(0, titlecallrows - 1 ) : [],
pagenum
pagenum,
titlezoneinterval
titlecallinterval
) -%]
[% bgpage(pagenum) -%]
[% document_footer()%]
@ -161,7 +149,7 @@
[% pagerowsstart = titlezonerows + midzonerows * ( pagenum - 1 )%]
[% pagerowsend = titlezonerows + midzonerows * pagenum - 1 %]
[% document_header()%]
[% zonepage( invoice_details_zones.slice( pagerowsstart, pagerowsend ), pagenum + 1 ) -%]
[% zonepage( invoice_details_zones.slice( pagerowsstart, pagerowsend ), pagenum + 1, midzoneinterval ) -%]
[%#+1 because of 1 for titlepage %]
[% bgpage(pagenum + 1) -%]
[% document_footer()%]
@ -170,7 +158,7 @@
[%#2 because zonepages started from 1, not from 0, and we need add 1 for titlepage %]
[% pagenum = 2 + allzonepages %]
[% document_header()%]
[% zonepage( invoice_details_zones.slice( allzonerowsnumber - lastzonerows, allzonerowsnumber ), pagenum ) -%]
[% zonepage( invoice_details_zones.slice( allzonerowsnumber - lastzonerows, allzonerowsnumber ), pagenum, midzoneinterval ) -%]
[% bgpage(pagenum) -%]
[% document_footer()%]
[%END-%]
@ -181,7 +169,7 @@
[% pagerowsstart = titlecallrows + midcallrows * ( pagenum - 1 )%]
[% pagerowsend = titlecallrows + midcallrows * pagenum - 1 %]
[% document_header()%]
[% callpage( invoice_details_calls.slice( pagerowsstart, pagerowsend ), pagenum + 1 ) -%]
[% callpage( invoice_details_calls.slice( pagerowsstart, pagerowsend ), pagenum + 1, midcallinterval ) -%]
[%#+1 because of 1 for titlepage %]
[% bgpage(pagenum + allzonepages + 1) -%]
[% document_footer()%]
@ -190,7 +178,7 @@
[%#2 because callpages started from 1, not from 0, and we need add 1 for titlepage %]
[% pagenum = 2 + allcallpages %]
[% document_header()%]
[% callpage( invoice_details_calls.slice( allcallrowsnumber - lastcallrows, allcallrowsnumber ), pagenum ) -%]
[% callpage( invoice_details_calls.slice( allcallrowsnumber - lastcallrows, allcallrowsnumber ), pagenum, midcallinterval ) -%]
[% bgpage(pagenum) -%]
[% document_footer()%]
[%END-%]

@ -27,6 +27,9 @@ g, text, tspan {
.bgpage{
font-size:2pt;
}
.widedatarow tspan{
font-size:2pt;
}
]]>
</style>
</defs>
@ -86,7 +89,7 @@ g, text, tspan {
<!--/page-->
<!--{[%END-%]}-->
<!--{[%MACRO zonepage(callsdata, page) BLOCK-%]}-->
<!--{[%MACRO zonepage(callsdata, page,rows_interval) BLOCK-%]}-->
<!--page-->
<g id="zonepage" display="none">
<title>ZonePage</title>
@ -105,7 +108,7 @@ g, text, tspan {
</text>
<!--{[%END-%]}-->
<!--{[%MACRO datarow(call) BLOCK-%]}-->
<text y="10" text-anchor="end" id="zonepage_calls[%loop.count-%]" class="datarow">
<text y="10" text-anchor="end" id="zonepage_calls[%loop.count-%]" class="datarow widedatarow">
<tspan x="5" id="zonepage_calls_num[%loop.count-%]" text-anchor="start"><!--{[% call.0 %]}--><!--{[%#}-->1<!--{%]}--></tspan>
<!--{[%IF call.1; call = call.1; END%]}-->
<tspan x="15" id="zonepage_calls_zone[%loop.count-%]" text-anchor="start"><!--{[% call.get_column('zone') %]}--><!--{[%#}-->Example zone<!--{%]}--></tspan>
@ -125,8 +128,8 @@ g, text, tspan {
</text>
<!--{[%END-%]}-->
<!--{[% titlerow(page) -%]}-->
<!--{[% list_calls(callsdata, page, 'datarow', total, 'svg', row_vertical_interval) -%]}-->
<!--{[% adjustrow (total, page, 'totalrow', 'svg', row_vertical_interval, callsdata.size) -%]}-->
<!--{[% list_zones(callsdata, page, 'datarow', total, 'svg', rows_interval) -%]}-->
<!--{[% adjustrow (total, page, 'totalrow', 'svg', rows_interval, callsdata.size) -%]}-->
</g>
</g>
@ -134,50 +137,48 @@ g, text, tspan {
<!--{[%END-%]}-->
<!--{[%MACRO callpage(callsdata, page) BLOCK-%]}-->
<!--{[%MACRO callpage(callsdata, page, rows_interval) BLOCK-%]}-->
<!--page-->
<g id="callpage" display="none">
<title>CallPage</title>
<g y="50" x="10" width="195" height="150" id="callpage_invoicedetails" transform="translate(10, 50)">
<g y="50" x="10" width="195" height="150" id="callpage_invoicedetails" transform="translate(10, 50)" rows="20" rows-interval="20">
<!--{[%MACRO titlerow BLOCK-%]}-->
<text id="callpage_calls_title" text-anchor="end">
<tspan x="5" id="callpage_calls_num" text-anchor="start">#</tspan>
<tspan x="15" id="callpage_calls_starttime" text-anchor="start">Start time</tspan>
<tspan x="70" id="callpage_calls_duration">Duration</tspan>
<tspan x="110" id="callpage_calls_destination">Destination</tspan>
<tspan x="150" id="callpage_calls_type">Type</tspan>
<tspan x="180" id="callpage_calls_zone" text-anchor="start">Zone/Detail</tspan>
<tspan x="200" id="callpage_calls_cost">Amount EUR</tspan>
<tspan x="0" id="callpage_calls_num" text-anchor="start">#</tspan>
<tspan x="10" id="callpage_calls_starttime" text-anchor="start">Start time</tspan>
<tspan x="65" id="callpage_calls_duration">Duration</tspan>
<tspan x="100" id="callpage_calls_destination">Destination</tspan>
<tspan x="115" id="callpage_calls_type">Type</tspan>
<tspan x="125" id="callpage_calls_zone" text-anchor="start">Zone/Detail</tspan>
<tspan x="185" id="callpage_calls_cost">Amount EUR</tspan>
</text>
<!--{[%END-%]}-->
<!--{[%MACRO datarow(call) BLOCK-%]}-->
<text y="10" text-anchor="end" id="callpage_calls[%loop.count-%]" class="datarow">
<tspan x="5" id="callpage_calls_num[%loop.count-%]" text-anchor="start"><!--{[% call.0 %]}--><!--{[%#}-->1<!--{%]}--></tspan>
<text y="10" text-anchor="end" id="callpage_calls[%loop.count-%]" class="datarow widedatarow">
<tspan x="0" id="callpage_calls_num[%loop.count-%]" text-anchor="start"><!--{[% call.0 %]}--><!--{[%#}-->1<!--{%]}--></tspan>
<!--{[%IF call.1; call = call.1; END%]}-->
<tspan x="15" id="callpage_calls_start_time%loop.count-%]"><!--{[% call.get_column('start_time') %]}--><!--{[%#}-->0001/01/31 23:59:59<!--{%]}--></tspan>
<tspan x="70" id="callpage_calls_duration[%loop.count-%]"><!--{[% call.get_column('duration')|format('%.3f') %]}--><!--{[%#}-->0.000<!--{%]}--></tspan>
<tspan x="110" id="callpage_calls_destination[%loop.count-%]"><!--{[% call.get_column('destination').replace('(.*?)\d{4}$','$1****') %]}--><!--{[%#}-->+00000000****<!--{%]}--></tspan>
<tspan x="150" id="callpage_calls_type[%loop.count-%]"><!--{[% call.get_column('call_type') %]}--><!--{[%#}-->call<!--{%]}--></tspan>
<tspan x="180" id="callpage_calls_zone[%loop.count-%]" text-anchor="start"><!--{[% call.get_column('zone') _ '/' _ call.get_column('zone_detail') %]}--><!--{[%#}-->Example zone/Fixed<!--{%]}--></tspan>
<tspan x="200" id="callpage_calls_cost[%loop.count-%]"><!--{[% ( call.get_column('cost') / 100 ) |format('%.2f') %]}--><!--{[%#}-->0.00<!--{%]}--></tspan>
<tspan x="10" id="callpage_calls_start_time%loop.count-%]" text-anchor="start"><!--{[% date.format(Math.int(call.get_column('start_time')),'%y-%m-%D %H:%M:%S') %]}--><!--{[%#}-->0001-01-31 23:59:59<!--{%]}--></tspan>
<tspan x="65" id="callpage_calls_duration[%loop.count-%]" ><!--{[% call.get_column('duration')|format('%.3f') %]}--><!--{[%#}-->0.000<!--{%]}--></tspan>
<tspan x="100" id="callpage_calls_destination[%loop.count-%]"><!--{[% call.get_column('destination_user_in').replace('(.*?)\d{4}$','$1****') %]}--><!--{[%#}-->+00000000****<!--{%]}--></tspan>
<tspan x="115" id="callpage_calls_type[%loop.count-%]"><!--{[% call.get_column('call_type') %]}--><!--{[%#}-->call<!--{%]}--></tspan>
<tspan x="125" id="callpage_calls_zone[%loop.count-%]" text-anchor="start"><!--{[% call.get_column('zone') _ '/' _ call.get_column('zone_detail') %]}--><!--{[%#}-->Example zone/Fixed<!--{%]}--></tspan>
<tspan x="185" id="callpage_calls_cost[%loop.count-%]"><!--{[% ( call.get_column('source_customer_cost') / 100 ) |format('%.2f') %]}--><!--{[%#}-->0.00<!--{%]}--></tspan>
</text>
<!--{[%END-%]}-->
<!--{[%MACRO totalrow BLOCK-%]}-->
<text y="20" text-anchor="end" id="callpage_calls_total" class="datarow">
<tspan x="5" id="callpage_calls_total_title" text-anchor="start">Total:</tspan>
<tspan x="95" id="callpage_calls_total_number"><!--{[% total_number %]}--><!--{[%#}-->0<!--{%]}--></tspan>
<tspan x="130" id="callpage_calls_total_duration"><!--{[% total_duration|format('%.3f') %]}--><!--{[%#}-->0.000<!--{%]}--></tspan>
<tspan x="160" id="callpage_calls_total_freetime"><!--{[% total_free_time|format('%d') %]}--><!--{[%#}-->0.0<!--{%]}--></tspan>
<tspan x="190" id="callpage_calls_total_cost"><!--{[% ( total_cost / 100 )|format('%.2f') %]}--><!--{[%#}-->0.00<!--{%]}--></tspan>
<tspan x="0" id="callpage_calls_total_title" text-anchor="start">Total:</tspan>
<tspan x="65" id="callpage_calls_total_duration"><!--{[% total_duration|format('%.3f') %]}--><!--{[%#}-->0.000<!--{%]}--></tspan>
<tspan x="185" id="callpage_calls_total_cost"><!--{[% ( total_cost / 100 )|format('%.2f') %]}--><!--{[%#}-->0.00<!--{%]}--></tspan>
</text>
<!--{[%END-%]}-->
<!--{[% titlerow -%]}-->
<!--{[% list_calls(callsdata, page, 'datarow', total, 'svg', row_vertical_interval) -%]}-->
<!--{[% adjustrow (total, page, 'totalrow', 'svg', row_vertical_interval, callsdata.size) -%]}-->
<!--{[% list_calls(callsdata, page, 'datarow', total, 'svg', rows_interval) -%]}-->
<!--{[% adjustrow (total, page, 'totalrow', 'svg', rows_interval, callsdata.size) -%]}-->
</g>
</g>
<!--/page-->
@ -191,7 +192,7 @@ g, text, tspan {
<path stroke="#888888" stroke-width="0.25" fill="none" d="m10,278l190,0"/>
<text x="105" y="282" text-anchor="middle" class="bgpage">[%provider.company%] [%if(', ', provider.street )%] [%if(', ', provider.postcode _ ' ' _ provider.city _ ' ' _ provider.country)%]</text>
<text x="105" y="282" text-anchor="middle" class="bgpage">[%provider.company%] [%if(', ', provider.street )%] [%if(', ', provider.postcode _ ' ' _ provider.city _ ' ' _ provider.country ) %]</text>
<text x="105" y="286" text-anchor="middle" class="bgpage">[%if('FN ', provider.fn )%] [%if('VAT ', provider.vat )%] [%provider.atu%] [%if('IBAN ', provider.iban )%] [%if('BIC ', provider.bic )%]</text>
<text x="105" y="290" text-anchor="middle" class="bgpage">[%if('Phone: ', provider.phone _' ' _ provider.mobile)%] [%if('Fax: ', provider.fax)%] [%provider.url%] [%provider.email%]</text>
@ -210,5 +211,4 @@ g, text, tspan {
<!--{[%# show_pages(invoice_details,'title')-%]}-->
<!--{[%# show_pages('zone',3)-%]}-->
<!--{[%# show_pages('last')-%]}-->
<!--{[%invoice_details_calls = []%]}-->
<!--{[% show_pages( invoice_details_zones, invoice_details_calls, 'all' )-%]}-->

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

@ -221,23 +221,23 @@
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#reseller_details" href="#collapse_zones">[% c.loc('Balance details') %]</a>
<a class="accordion-toggle" data-toggle="collapse" data-parent="#reseller_details" href="#collapse_zones">[% c.loc('Invoice details. Connection fees.') %]</a>
</div>
<div class="accordion-body collapse" id="collapse_zones">
<div class="accordion-inner" style="height: 300px; overflow: auto;">
<span>
<a class="btn btn-primary btn-large" href="[% c.uri_for_action('/reseller/invoice', [contract.id]) %]">[% c.loc('Invoice Connections Fees')%] <i class="icon-edit"></i></a>
<a class="btn btn-primary btn-large" href="[% c.uri_for_action('/reseller/invoice', [contract.id]) %]">[% c.loc('Invoice Template')%] <i class="icon-edit"></i></a>
</span>
<div class="ngcp-separator"></div>
[%PROCESS 'invoice/invoice_details_zones_list.tt' %]
</div>
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#reseller_details" href="#collapse_calls">[% c.loc('Balance details') %]</a>
<a class="accordion-toggle" data-toggle="collapse" data-parent="#reseller_details" href="#collapse_calls">[% c.loc('Invoice details. Calls.') %]</a>
</div>
<div class="accordion-body collapse" id="collapse_calls">
<div class="accordion-inner" style="height: 300px; overflow: auto;">

Loading…
Cancel
Save