MT#5879 And fake invoice data into aux template too.

ipeshinskaya/InvoiceTemplate5
Irina Peshinskaya 12 years ago committed by Victor Seva
parent 00a0e08054
commit 99edada339

@ -7,6 +7,7 @@ use strict;
extends 'Catalyst::View::TT';
__PACKAGE__->config(
TEMPLATE_EXTENSION => '.tt',
render_die => 1,
@ -26,7 +27,14 @@ sub process
{
my ( $self, $c ) = @_;
#$c->res->content_type("image/svg+xml");
$self->{template}->context->define_vmethod(
hash => get_column => sub {
my($item,$col) = @_;
if('HASH' eq ref $item){
return $item->{$col};
}
}
);
if($c->stash->{VIEW_NO_TT_PROCESS}) {
$c->log->debug("VIEW_NO_TT_PROCESS=".$c->stash->{VIEW_NO_TT_PROCESS}.";\n");

@ -196,8 +196,8 @@
[%END-%]
[%END-%]
[%# total.pagetype.zone.global.import(total.global)%]
[%# total.pagetype.zone.perpage.import(total.perpage)%]
[% total.pagetype.call.global = total.pagetype.call.global.import(total.global)%]
[% total.pagetype.call.perpage = total.pagetype.call.perpage.import(total.perpage)%]
[% total.global = {}%]
[% total.perpage = [] %]

@ -2,7 +2,7 @@
USE Date;
USE Math;
DEFAULT date.month_end = date_format('00:00:00 00-' _ (Math.int(date.format(date.now(),'%m'))+1) _ date.format(date.now(),'-%Y'), noyear = 1 );
DEFAULT date.month_end = date_format('00:00:00 00-' _ (Math.int(date.format(date.now(),'%m')) + 1) _ date.format(date.now(),'-%Y'), noyear = 1 );
DEFAULT date.month_start = date_format('00:00:00 01-' _ date.format(date.now(),'%m-%Y'), noyear = 1 );
DEFAULT date.year=date.format(date.now(),'%Y');
@ -48,4 +48,36 @@ DEFAULT client.sepa='AT1234567890';
DEFAULT client.street='Client Street';
DEFAULT client.vatid='AA1234';
END;
invoice_details_zones = [];
invoice_details_calls = [];
IF !invoice_details_calls.size();
i=1;
WHILE i <= 44;
invoice_details_calls.push([i,{
start_time => date.format(date.now(),'%s'),
source_customer_cost => i / 10,
duration => i * 10,
destination_user_in => '+1234567890',
call_type => 'call',
zone => 'Example Zone',
zone_detail => 'Default',
}]);
i = i + 1;
END;
END;
IF !invoice_details_zones.size();
i=1;
WHILE i <= 45;
invoice_details_zones.push([i,{
number => i * 2 ,
cost => i / 10,
duration => i * 10,
free_time => i / 10,
zone => 'Example Zone',
zone_detail => 'Default',
}]);
i = i + 1;
END;
END;
%]
Loading…
Cancel
Save