diff --git a/lib/NGCP/Panel/Form/Balance/CustomerBalanceAPI.pm b/lib/NGCP/Panel/Form/Balance/CustomerBalanceAPI.pm index 00d3b636a5..1f23fc8fa7 100644 --- a/lib/NGCP/Panel/Form/Balance/CustomerBalanceAPI.pm +++ b/lib/NGCP/Panel/Form/Balance/CustomerBalanceAPI.pm @@ -46,10 +46,20 @@ has_field 'ratio' => ( }, ); +has_field 'external_id' => ( + type => 'Text', + label => 'External ID', + required => 0, + element_attr => { + rel => ['tooltip'], + title => ['A non-unique external ID e.g., provided by a 3rd party provisioning'] + }, +); + has_block 'fields' => ( tag => 'div', class => [qw/modal-body/], - render_list => [qw/cash_balance cash_debit free_time_balance free_time_spent ratio/], + render_list => [qw/cash_balance cash_debit free_time_balance free_time_spent ratio external_id/], ); 1; diff --git a/lib/NGCP/Panel/Role/API/CustomerBalances.pm b/lib/NGCP/Panel/Role/API/CustomerBalances.pm index 2dcbe00a9a..0b27e50e6b 100644 --- a/lib/NGCP/Panel/Role/API/CustomerBalances.pm +++ b/lib/NGCP/Panel/Role/API/CustomerBalances.pm @@ -83,6 +83,7 @@ sub resource_from_item{ my %resource = $item->get_inflated_columns; #$resource{cash_balance} /= 100.0; ##$resource{cash_balance_interval} /= 100.0; + $resource{external_id} = $item->contract->external_id if $item->contract->external_id; $resource{cash_balance} /= 100.0; $resource{cash_debit} = (delete $resource{cash_balance_interval}) / 100.0; $resource{free_time_spent} = delete $resource{free_time_balance_interval};