|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
[%USE Dumper%]
|
|
|
|
|
[%USE Math%]
|
|
|
|
|
[%USE date%]
|
|
|
|
|
[% total = {perpage => [], global => {} } -%]
|
|
|
|
|
|
|
|
|
|
[%MACRO date_format(dateval) BLOCK%]
|
|
|
|
|
[%date.format(dateval,'%B')%] [%ordinate(date.format(dateval,'%e'))%] [%date.format(dateval,'%Y')%]
|
|
|
|
@ -45,7 +44,6 @@
|
|
|
|
|
[%IF rowtype == 'datarow' %]
|
|
|
|
|
[%row = datarow(data)%]
|
|
|
|
|
[%ELSIF rowtype == 'totalrow' %]
|
|
|
|
|
===[%Dumper.dump(data)%]
|
|
|
|
|
[%row = totalrow( (pagelocal == pageslocalnum) ? data.global : data.perpage.${pagelocal} )%]
|
|
|
|
|
[%END%]
|
|
|
|
|
[% IF tt_type == 'svg' -%]
|
|
|
|
@ -76,24 +74,26 @@
|
|
|
|
|
|
|
|
|
|
[%MACRO list_zones(callsdata, page, pagelocal, pageslocalnum, rowtype, total, tt_type, rows_interval) BLOCK-%]
|
|
|
|
|
[% FOR call IN callsdata -%][%#invoice_details%]
|
|
|
|
|
[% total.global.number = total.global.number + call.get_column('number') -%]
|
|
|
|
|
[% total.global.duration = total.global.duration + call.get_column('duration') -%]
|
|
|
|
|
[% total.global.free_time = total.global.free_time + call.get_column('free_time') -%]
|
|
|
|
|
[% total.global.cost = total.global.cost + call.get_column('cost') -%]
|
|
|
|
|
[% total.perpage.${pagelocal}.number = total.perpage.${pagelocal}.number + call.get_column('number') -%]
|
|
|
|
|
[% total.perpage.${pagelocal}.duration = total.perpage.${pagelocal}.duration + call.get_column('duration') -%]
|
|
|
|
|
[% total.perpage.${pagelocal}.free_time = total.perpage.${pagelocal}.free_time + call.get_column('free_time') -%]
|
|
|
|
|
[% total.perpage.${pagelocal}.cost = total.perpage.${pagelocal}.cost + call.get_column('cost') -%]
|
|
|
|
|
[%IF call.1; calldata = call.1; END%]
|
|
|
|
|
[% total.global.number = total.global.number + calldata.get_column('number') -%]
|
|
|
|
|
[% total.global.duration = total.global.duration + calldata.get_column('duration') -%]
|
|
|
|
|
[% total.global.free_time = total.global.free_time + calldata.get_column('free_time') -%]
|
|
|
|
|
[% total.global.cost = total.global.cost + calldata.get_column('cost') -%]
|
|
|
|
|
[% total.perpage.${pagelocal}.number = total.perpage.${pagelocal}.number + calldata.get_column('number') -%]
|
|
|
|
|
[% total.perpage.${pagelocal}.duration = total.perpage.${pagelocal}.duration + calldata.get_column('duration') -%]
|
|
|
|
|
[% total.perpage.${pagelocal}.free_time = total.perpage.${pagelocal}.free_time + calldata.get_column('free_time') -%]
|
|
|
|
|
[% total.perpage.${pagelocal}.cost = total.perpage.${pagelocal}.cost + calldata.get_column('cost') -%]
|
|
|
|
|
[% adjustrow(call, page, pagelocal, pageslocalnum, rowtype, tt_type, rows_interval, loop.count) -%]
|
|
|
|
|
[%END -%]
|
|
|
|
|
[%END -%]
|
|
|
|
|
|
|
|
|
|
[%MACRO list_calls(callsdata, page, pagelocal, pageslocalnum, rowtype, total, tt_type, rows_interval) BLOCK-%]
|
|
|
|
|
[% FOR call IN callsdata -%][%#invoice_details%]
|
|
|
|
|
[% total.global.duration = total.global.duration + call.get_column('duration') -%]
|
|
|
|
|
[% total.global.cost = total.global.cost + call.get_column('source_customer_cost') -%]
|
|
|
|
|
[% total.perpage.${pagelocal}.duration = total.perpage.${pagelocal}.duration + call.get_column('duration') -%]
|
|
|
|
|
[% total.perpage.${pagelocal}.cost = total.perpage.${pagelocal}.cost + call.get_column('source_customer_cost') -%]
|
|
|
|
|
[%IF call.1; calldata = call.1; END%]
|
|
|
|
|
[% total.global.duration = total.global.duration + calldata.get_column('duration') -%]
|
|
|
|
|
[% total.global.cost = total.global.cost + calldata.get_column('source_customer_cost') -%]
|
|
|
|
|
[% total.perpage.${pagelocal}.duration = total.perpage.${pagelocal}.duration + calldata.get_column('duration') -%]
|
|
|
|
|
[% total.perpage.${pagelocal}.cost = total.perpage.${pagelocal}.cost + calldata.get_column('source_customer_cost') -%]
|
|
|
|
|
[% adjustrow(call, page, pagelocal, pageslocalnum, rowtype, tt_type, rows_interval, loop.count) -%]
|
|
|
|
|
[%END -%]
|
|
|
|
|
[%END -%]
|
|
|
|
@ -128,6 +128,9 @@
|
|
|
|
|
|
|
|
|
|
[%MACRO show_pages(invoice_details_zones, invoice_details_calls, pagetype, pagenum_in) BLOCK-%]
|
|
|
|
|
[%#todo: remove copypast with some macro, later%]
|
|
|
|
|
|
|
|
|
|
[% total = {perpage => [], global => {}, pagetype => { call=> {perpage => [], global => {}}, zone => {perpage => [], global => {}} } } -%]
|
|
|
|
|
|
|
|
|
|
[% allzonerowsnumber = invoice_details_zones.size() %]
|
|
|
|
|
[% titlezonerows = get_page_rows_number('titlepage','svg','zone') %]
|
|
|
|
|
[% midzonerows = get_page_rows_number('zonepage','svg') %]
|
|
|
|
@ -191,6 +194,13 @@
|
|
|
|
|
[% document_footer()%]
|
|
|
|
|
[%END-%]
|
|
|
|
|
[%END-%]
|
|
|
|
|
|
|
|
|
|
[% total.pagetype.zone.global.import(total.global)%]
|
|
|
|
|
[% total.pagetype.zone.perpage.import(total.perpage)%]
|
|
|
|
|
|
|
|
|
|
[% total.global = {}%]
|
|
|
|
|
[% total.perpage = [] %]
|
|
|
|
|
|
|
|
|
|
[%IF ( pagetype == 'call' || pagetype=='all' )%]
|
|
|
|
|
[% pages = pagenum_in ? [ pagenum_in ] : [ 1 .. allmidcallpages ] %]
|
|
|
|
|
[%FOREACH pagenum IN pages %]
|
|
|
|
@ -211,4 +221,6 @@
|
|
|
|
|
[% document_footer()%]
|
|
|
|
|
[%END-%]
|
|
|
|
|
[%END-%]
|
|
|
|
|
[% total.pagetype.call.global.import(total.global)%]
|
|
|
|
|
[% total.pagetype.call.perpage.import(total.perpage)%]
|
|
|
|
|
[%END-%]
|
|
|
|
|