From 3ee4f3e61ddec292e9dc1f136bc00cf7e47ab389 Mon Sep 17 00:00:00 2001 From: Irina Peshinskaya Date: Thu, 12 Jun 2014 13:09:39 +0300 Subject: [PATCH] MT#5879 Implement countr name in controller. --- lib/NGCP/Panel/Controller/Invoice.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/NGCP/Panel/Controller/Invoice.pm b/lib/NGCP/Panel/Controller/Invoice.pm index de87820c02..aa79f27753 100644 --- a/lib/NGCP/Panel/Controller/Invoice.pm +++ b/lib/NGCP/Panel/Controller/Invoice.pm @@ -9,6 +9,7 @@ use NGCP::Panel::Utils::Contract; use NGCP::Panel::Utils::InvoiceTemplate; use NGCP::Panel::Utils::Invoice; use NGCP::Panel::Form::Invoice::Invoice; +use Geography::Countries qw/country/; sub auto :Private { my ($self, $c) = @_; @@ -250,8 +251,8 @@ sub create :Chained('inv_list') :PathPart('create') :Args() :Does(ACL) :ACLDetac $vars->{customer} = { $customer->get_inflated_columns }; $vars->{custcontact} = { $customer->contact->get_inflated_columns }; - $vars->{custcontact}->{country} = $customer->contact->country_name(); - $vars->{rescontact}->{country} = $customer->contact->reseller->contract->contact->country_name(); + $vars->{custcontact}->{country} = country($vars->{custcontact}->{country} || ''); + $vars->{rescontact}->{country} = country($vars->{rescontact}->{country} || ''); $vars->{billprof} = { $billing_profile->get_inflated_columns }; $vars->{invoice} = {