From ce84749100ee3f4a7b7ffe7b3d49752cd34ca165 Mon Sep 17 00:00:00 2001 From: Irina Peshinskaya Date: Fri, 3 Aug 2018 21:01:53 +0200 Subject: [PATCH] TT#29751 Remove minus from cents in negative costs Change-Id: I57b034aa4f55c4df198e9e754afe4b27cd1fb9fb --- lib/NGCP/Panel/Utils/InvoiceTemplate.pm | 5 +++-- share/templates/invoice/default/invoice_template_aux.tt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/NGCP/Panel/Utils/InvoiceTemplate.pm b/lib/NGCP/Panel/Utils/InvoiceTemplate.pm index f61213784f..9cacb43682 100644 --- a/lib/NGCP/Panel/Utils/InvoiceTemplate.pm +++ b/lib/NGCP/Panel/Utils/InvoiceTemplate.pm @@ -201,7 +201,7 @@ sub process_child_nodes { } sub get_dummy_data { - return { + my $data = { rescontact => { gender => 'male', firstname => 'Resellerfirst', @@ -290,7 +290,7 @@ sub get_dummy_data { source_cli => '1234567890', destination_user_in => "1".$_."1234567890", start_time => time, - source_customer_cost => int(rand(100000)), + source_customer_cost => int( (rand()-1/2) * rand(1000000)), duration => int(rand(7200)) + 10, call_type => (qw/cfu cfb cft cfna cfs cfr/)[int(rand 4)], zone => "Zone $_", @@ -312,6 +312,7 @@ sub get_dummy_data { }, }; + return $data; } 1; diff --git a/share/templates/invoice/default/invoice_template_aux.tt b/share/templates/invoice/default/invoice_template_aux.tt index 01ee452175..ddcab3ba13 100644 --- a/share/templates/invoice/default/invoice_template_aux.tt +++ b/share/templates/invoice/default/invoice_template_aux.tt @@ -136,7 +136,7 @@ cents = String.new(cent); cents = cents.format("%.0f",cents); cents_format_string = "%0" _ money_signs _ "d"; - cents = cents.format(cents_format_string); + cents = cents.format(cents_format_string).replace('^-', ''); aux.val = full _ comma _ cents; END;