@@ -98,9 +98,8 @@ def cli(env, identifier, passwords=False, price=False):
9898 'billingItem' ,
9999 'nextInvoiceTotalRecurringAmount' ) or 0
100100 if total_price != 0 :
101- price_data = _get_price_data (utils .lookup (result , 'billingItem' ), total_price )
102- table .add_row (['Prices' , price_data ['priceTable' ]])
103- table .add_row (['Price rate' , price_data ['totalPrice' ]])
101+ table .add_row (['Prices' , _price_table (utils .lookup (result , 'billingItem' ), total_price )])
102+ table .add_row (['Price rate' , total_price ])
104103
105104 if passwords :
106105 pass_table = formatting .Table (['software' , 'username' , 'password' ])
@@ -154,20 +153,15 @@ def _bw_table(bw_data):
154153 return table
155154
156155
157- def _get_price_data (billing_item , total_price ):
158- """Returns an item table and price rate value in an object """
156+ def _price_table (billing_item , total_price ):
157+ """Returns an item table"""
159158 price_table = formatting .Table (['Item' , 'CategoryCode' , 'Recurring Price' ])
160159 price_table .add_row (['Total' , '-' , total_price ])
161160 items = billing_item ['nextInvoiceChildren' ]
162161 for item in items :
163162 if item .get ('recurringFee' ) is not None :
164- total_price += float (item ['recurringFee' ])
165163 price_table .add_row ([item ['description' ], item ['categoryCode' ], item ['recurringFee' ]])
166- response = {
167- "priceTable" : price_table ,
168- "totalPrice" : total_price ,
169- }
170- return response
164+ return price_table
171165
172166
173167def _cli_helper_dedicated_host (env , result , table ):
0 commit comments