mor_12_api_when_cli_exist_in_cc_group
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/test/load_delta_sql/sql/mor_eleven_extend
waitForElementPresent //body
open /billing/currencies/currencies
clickAndWait //a[contains(@href, '/billing/currencies/currencies_change_update_status/2')]
assertTextPresent Currency update disabled
open /billing/currencies/edit/2
type id=exchange_rate 2
clickAndWait css=input[type="image"]
assertTextPresent Currency details updated
clickAndWait id=icon_cross_curr_upd_enable_2
assertText id=icon_chech_curr_upd_disable_2
open /billing/cardgroups/edit/1
type id=tax1_value 10.0
type name=price_with_vat 100
type id=cardgroup_setup_fee 10.0
type id=cardgroup_daily_charge 10
select id=cardgroup_tell_balance_in_currency label=USD
clickAndWait name=commit
waitForTextPresent Card group was successfully updated
open /billing/functions/settings
click id=allow_api
click id=allow_get_api
type id=api_secret_key 123456
click id=xml_api_extension
click id=api_login_redirect_to_main
click id=api_allow_registration
clickAndWait name=commit
waitForTextPresent Settings saved
open /billing/cardgroups/new
type id=cardgroup_name cardgroup 3
type id=price_with_vat 25
select id=cardgroup_tell_balance_in_currency label=EUR
type id=cardgroup_number_length 5
type id=cardgroup_pin_length 3
type id=tax1_value 10
type id=tax2_name tax2
check id=tax2_enabled
type id=tax2_value 10.0
type id=tax3_name tax3
check id=tax3_enabled
type id=tax3_value 10.0
type id=tax4_name tax4
check id=tax4_enabled
type id=tax4_value 10.0
clickAndWait name=commit
waitForTextPresent Card group was successfully created
open /billing/cards/edit/1
type id=card_callerid 4444
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/test/test_api?callerid=4444&amount=100
storeText css=body hash1
open /billing/cards/new?cg=3
type id=start_number 10002
type id=end_number 10010
clickAndWait name=commit
waitForTextPresent Cards created: 9
open /billing/cards/edit/27
type id=card_callerid 5555
select id=card[user_id] label=Test Accountant
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/test/test_api?cardgroup_id=3&callerid=5555&amount=300
waitForTextPresent b0faeac147951820a747b35fbccba653cda876d1
open /billing/cards/list?cg=1&clean=1
assertText id=callerid_1 4444
assertText id=balance_1 10.0840
assertElementPresent css=#sold_1 > img[alt="Cross"]
open /billing/cards/list?cg=3&clean=1
assertText id=callerid_27 5555
assertText id=balance_27 0.0000
assertText css=#sold_27 > img[alt="Cross"]
open /billing/callc/logout
open /billing/api/cc_by_cli?u=admin&p=admin1&callerid=4444&amount=100&test=1&hash=${hash1}
verifyText css=status ok
verifyText css=cardgroup_id 1
assertText css=balance 100.9931
assertText css=balance_with_vat 111.0924
verifyText css=callerid 4444
verifyText css=pin 7856
verifyText css=number 1111111000
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=3&callerid=5555&amount=300&test=1&hash=b0faeac147951820a747b35fbccba653cda876d1
verifyText css=id 27
verifyText css=status ok
verifyText css=cardgroup_id 3
assertText css=balance 102.4520
assertText css=balance_with_vat 150.0000
verifyText css=callerid 5555
storeText css=pin pin1
storeText css=number number1
open /billing/api/cc_by_cli?u=accountant&p=accountant1&callerid=4444&amount=100&test=1&hash=${hash1}
waitForTextPresent Dont be so smart
open /billing/api/cc_by_cli?u=accountant&p=accountant1&cardgroup_id=3&callerid=5555&amount=300&test=1&hash=b0faeac147951820a747b35fbccba653cda876d1
waitForTextPresent Dont be so smart
open /billing/api/cc_by_cli?u=reseller&p=reseller1&callerid=4444&amount=100&test=1&hash=${hash1}
waitForTextPresent Dont be so smart
open /billing/api/cc_by_cli?u=101&p=1011&callerid=4444&amount=100&test=1&hash=${hash1}
waitForTextPresent Dont be so smart
open /billing/api/cc_by_cli?u=user_reseller&p=user_reseller1&callerid=4444&amount=100&test=1&hash=${hash1}
waitForTextPresent Dont be so smart
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/payments/list
verifyTextPresent 1111111000 (7856)
verifyTextPresent ${number1} (${pin1})
assertText id=amount_10 10.0840
assertText id=amout_with_tax_10 11.0924
assertText id=currency_10 USD
verifyText id=amount_11 90.9091
verifyText id=amout_with_tax_11 100.0000
verifyText id=currency_11 USD
assertText id=amount_12 0.0000
assertText id=amount_12 0.0000
assertText id=currency_12 EUR
verifyText id=amount_13 204.9040
verifyText id=amout_with_tax_13 300.0000
verifyText id=currency_13 EUR
open /billing/cards/list?cg=3&clean=1
verifyText id=number_27 ${number1}
verifyText id=pin_27 ${pin1}
verifyText id=callerid_27 5555
verifyText id=balance_27 102.4520
verifyText id=user_27 Test Accountant
assertText css=img[alt="Check"]
open /billing/cards/list?cg=1&clean=1
verifyText //td[@id='number_1'] 1111111000
verifyText //td[@id='pin_1'] 7856
verifyText id=callerid_1 4444
verifyText //td[@id='balance_1'] 100.9931
assertText css=img[alt="Check"]
open /billing/users/list
verifyText id=balance_0 0.0000
verifyText id=balance_4 0.0000
verifyText id=balance_3 0.0000
verifyText id=balance_2 0.0000
open /billing/test/test_api?cardgroup_id=1&callerid=4444&amount=100&pin=7856
waitForTextPresent 118f394ea0b031da71270d528fdfd7464e24d799
open /billing/test/test_api?cardgroup_id=1&callerid=5555&amount=300&pin=1111
waitForTextPresent c1cd383224e94abfdfb8a742191fe44d9a2dc70e
open /billing/test/test_api?cardgroup_id=3&callerid=5555&amount=300&pin=${pin1}
storeText css=body hash1
open /billing/callc/logout
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=3&callerid=4444&amount=100&pin=7856&test=1&hash=613d121a397050e80af0f556ed696c0395c803d2
waitForTextPresent PIN number not found
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=1&callerid=4444&amount=100&pin=7856&test=1&hash=118f394ea0b031da71270d528fdfd7464e24d799
waitForTextPresent PIN number not found
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=1&callerid=5555&amount=300&pin=1111&test=1&hash=c1cd383224e94abfdfb8a742191fe44d9a2dc70e
waitForTextPresent PIN number not found
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=1&callerid=5555&amount=300&pin=${pin1}&test=1&hash=${hash1}
waitForTextPresent Incorrect hash
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=3&callerid=5555&amount=300&pin=${pin1}&test=1&hash=${hash1}
verifyText css=error PIN number not found
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/payments/list
verifyText id=amount_11 90.9091
verifyText id=amount_13 204.9040
verifyText id=amout_with_tax_11 100.0000
verifyText id=amout_with_tax_13 300.0000
verifyText id=currency_11 USD
verifyText id=currency_13 EUR
open /billing/cards/list?cg=3&clean=1
verifyText id=number_27 10007
verifyText id=callerid_27 5555
verifyText id=balance_27 102.4520
open /billing/cards/list?cg=1&clean=1
verifyText //td[@id='number_1'] 1111111000
verifyText //td[@id='pin_1'] 7856
verifyText id=callerid_1 4444
verifyText //td[@id='balance_1'] 100.9931
open /billing/users/list
verifyText id=balance_0 0.0000
verifyText id=balance_4 0.0000
verifyText id=balance_3 0.0000
verifyText id=balance_2 0.0000
open /billing/cards/edit/12
type id=card_callerid 6666
clickAndWait name=commit
assertElementPresent css=img[alt="Cross"]
waitForTextPresent Card was successfully updated
open /billing/cards/list?cg=3&clean=1
storeText id=pin_24 pin3
open /billing/cards/edit/30
type id=card_callerid 7777
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/test/test_api?cardgroup_id=1&callerid=6666&amount=150&pin=6930
waitForTextPresent 259336c380436060303905c3fd69593a3753c102
open /billing/test/test_api?cardgroup_id=3&callerid=7777&amount=50&pin=${pin3}
storeText css=body hash2
open /billing/callc/logout
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=3&callerid=4444&amount=100&pin=7856&test=1&hash=613d121a397050e80af0f556ed696c0395c803d2
waitForTextPresent PIN number not found
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=1&callerid=6666&amount=150&pin=6930&test=1&hash=259336c380436060303905c3fd69593a3753c102
verifyText css=status ok
verifyText css=id 12
verifyText css=cardgroup_id 1
verifyText css=balance 20.1681
verifyText css=callerid 6666
verifyText css=pin 3996
verifyText css=number 1111111011
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=3&callerid=7777&amount=50&pin=${pin3}&test=1&hash=${hash2}
assertTextPresent PIN number balance is zero
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/payments/list
verifyText id=amount_11 90.9091
verifyText id=amount_13 204.9040
verifyText id=amout_with_tax_11 100.0000
verifyText id=amout_with_tax_13 300.0000
verifyText id=currency_11 USD
verifyText id=currency_13 EUR
assertText id=amount_14 10.0840
assertText id=amout_with_tax_14 11.0924
open /billing/cards/list?cg=3&clean=1
verifyText id=callerid_30 7777
verifyText id=balance_30 0.0000
assertElementPresent css=#sold_30 > img[alt="Cross"]
verifyText id=callerid_24
verifyText id=balance_24 0.0000
verifyText css=#sold_24 > img[alt="Cross"]
open /billing/cards/list?cg=1&clean=1
verifyText id=callerid_8
verifyText id=balance_8 0.0000
verifyText css=#sold_8 > img[alt="Cross"]
verifyText id=callerid_12 6666
verifyText id=balance_12 20.1681
assertElementPresent css=img[alt="Check"]
open /billing/test/load_delta_sql/acc_groups
waitForElementPresent //body
open /billing/permissions/edit/12?group_type=reseller
click id=calling_cards_2
clickAndWait name=commit
waitForTextPresent Group was updated
open /billing/users/edit/3
clickAndWait css=#confirm_without_message > input[name="commit"]
waitForTextPresent User's settings succesfully changed: Test Reseller
open /billing/permissions/edit/11?group_type=accountant
click id=callingcard_pin_2
click id=callingcard_manage_2
click id=see_financial_data_2
click id=cli_ivr_2
click id=device_edit_opt_1_2
click id=device_edit_opt_2_2
click id=device_edit_opt_3_2
click id=device_edit_opt_4_2
click id=device_pin_2
click id=device_password_2
click id=voicemail_password_2
click id=device_create_2
click id=device_manage_2
click id=manage_dids_opt_1_2
click id=invoices_manage_2
click id=monitorings_manage_2
click id=payments_manage_2
click id=services_manage_2
click id=manage_subscriptions_opt_1_2
click id=tariff_manage_2
click id=user_create_opt_1_2
click id=user_create_opt_2_2
click id=user_create_opt_3_2
click id=user_create_2
click id=user_create_opt_4_2
click id=user_create_opt_5_2
click id=user_create_opt_6_2
click id=user_create_opt_7_2
click id=vouchers_manage_2
click id=user_manage_2
clickAndWait name=commit
waitForTextPresent Group was updated
open /billing/users/edit/4
clickAndWait css=#confirm_without_message > input[name="commit"]
waitForTextPresent User's settings succesfully changed: Test
open /billing/callc/logout
open /billing/api/cc_by_cli?u=accountant&p=accountant1&cardgroup_id=1&callerid=4444&amount=100&test=1&hash=d703d39e26dd770b614d3e0786373aecb4378fa3
verifyText css=status ok
verifyText css=id 1
verifyText css=cardgroup_id 1
assertText css=balance 191.9022
assertText css=balance_with_vat 211.0924
verifyText css=callerid 4444
storeText css=pin pin6
storeText css=number number6
open /billing/api/cc_by_cli?u=accountant&p=accountant1&cardgroup_id=3&callerid=5555&amount=300&test=1&hash=b0faeac147951820a747b35fbccba653cda876d1
verifyText css=status ok
verifyText css=id 27
verifyText css=cardgroup_id 3
assertText css=balance 204.9040
assertText css=balance_with_vat 300.0000
verifyText css=callerid 5555
open /billing/api/cc_by_cli?u=reseller&p=reseller1&cardgroup_id=1&callerid=4444&amount=100&test=1&hash=d703d39e26dd770b614d3e0786373aecb4378fa3
waitForTextPresent You do not have permission to access card
open /billing/api/cc_by_cli?u=101&p=1011&cardgroup_id=1&callerid=4444&amount=100&test=1&hash=d703d39e26dd770b614d3e0786373aecb4378fa3
waitForTextPresent Dont be so smart
open /billing/api/cc_by_cli?u=user_reseller&p=user_reseller1&cardgroup_id=1&callerid=4444&amount=100&test=1&hash=d703d39e26dd770b614d3e0786373aecb4378fa3
waitForTextPresent Dont be so smart
open /billing/api/cc_by_cli?u=accountant&p=accountant1&cardgroup_id=3&callerid=7777&amount=50&pin=${pin3}&test=1&hash=${hash2}
assertTextPresent PIN number balance is zero
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/cards/list?cg=1&clean=1
assertText //td[@id='balance_1'] 191.9022
open /billing/cards/list?cg=3&clean=1
verifyText id=number_27 10007
verifyText id=callerid_27 5555
assertText id=balance_27 204.9040
open /billing/callc/logout
type login_username accountant
type login_psw accountant1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/payments/list
verifyText id=amount_11 90.9091
verifyText id=amount_13 204.9040
verifyText id=amout_with_tax_11 100.0000
verifyText id=amout_with_tax_13 300.0000
verifyText id=currency_11 USD
verifyText id=currency_13 EUR
open /billing/callc/logout
type login_username reseller
type login_psw reseller1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/cardgroups/new
type id=cardgroup_name cardgroup
type id=cardgroup_setup_fee 10.0
type name=price_with_vat 20.0000
select id=cardgroup_tell_balance_in_currency label=EUR
type id=tax1_value 50
clickAndWait name=commit
waitForTextPresent Card group was successfully created
open /billing/cards/new?cg=4
type id=start_number 1111111114
type id=end_number 1111111123
clickAndWait name=commit
waitForTextPresent Cards created: 10
clickAndWait css=input[type="submit"]
storeText id=pin_31 pinre1
open /billing/cards/edit/32
type id=card_callerid 09090909
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/cards/edit/33
type id=card_callerid 08080808
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/test/test_api?cardgroup_id=4&callerid=09090909&amount=55
waitForTextPresent 6def0e9d462c376f47f31ab231447263da3c9843
open /billing/test/test_api?cardgroup_id=4&callerid=08080808&amount=50&pin=${pinre1}
storeText css=body hashre1
open /billing/test/test_api?callerid=4444&amount=100
storeText css=body hash10
open /billing/test/test_api?callerid=4444&amount=100&pin=7856
storeText css=body hash11
open /billing/callc/logout
open /billing/api/cc_by_cli?u=reseller&p=reseller1&cardgroup_id=4&callerid=09090909&amount=55&test=1&hash=6def0e9d462c376f47f31ab231447263da3c9843
verifyText css=status ok
verifyText css=id 32
assertText css=balance 31.6667
assertText css=balance_with_vat 47.5000
verifyText css=cardgroup_id 4
verifyText css=callerid 09090909
verifyText css=number 1111111115
open /billing/api/cc_by_cli?u=reseller&p=reseller1&cardgroup_id=4&callerid=08080808&amount=50&pin=${pinre1}&test=1&hash=${hashre1}
verifyText css=status ok
verifyText css=id 33
verifyText css=cardgroup_id 4
assertText css=balance 26.6667
assertText css=balance_with_vat 40.0000
verifyText css=callerid 08080808
verifyText css=number 1111111116
open /billing/callc/logout
type login_username reseller
type login_psw reseller1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/cards/list?cg=4&clean=1
verifyText id=balance_31 0.0000
assertText id=callerid_32 09090909
assertText id=balance_32 31.6667
verifyText id=callerid_33 08080808
verifyText id=balance_33 26.6667
open /billing/callc/logout
open /billing/api/cc_by_cli?u=admin&p=admin1&callerid=4444&amount=100&test=1&hash=${hash10}
assertText css=balance 282.8113
assertText css=balance_with_vat 311.0924
verifyText css=callerid 4444
verifyText css=pin 7856
verifyText css=number 1111111000
open /billing/api/cc_by_cli?u=admin&p=admin1&callerid=4444&amount=100&pin=7856&test=1&hash=${hash11}
waitForTextPresent PIN number not found
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/cards/list?cg=1&clean=1
verifyText //td[@id='number_1'] 1111111000
verifyText //td[@id='pin_1'] 7856
verifyText id=callerid_1 4444
assertText //td[@id='balance_1'] 282.8113
open /billing/cards/act?cg=1
type id=start_number 1111111002
type id=end_number 1111111007
click id=distributor
select id=user_id label=Test User #1
clickAndWait name=commit
assertTextPresent Action : Change distributor
assertTextPresent Card interval : 1111111002 - 1111111007
clickAndWait name=commit
assertTextPresent Distributor changed
assertText id=user_3 Test User #1
open /billing/cards/edit/5
type id=card_callerid 32313231
clickAndWait name=commit
assertTextPresent Card was successfully updated
open /billing/stats/action_log
assertText id=type_30 Added to cards balance
assertText id=type_49 Added to cards balance
assertText id=type_31 Added to cards balance
assertText id=type_50 Added to cards balance
assertText id=data_30 -10.0840
assertText id=data_49 -13.3333
assertText id=data_31 10.0840
assertText id=data_50 13.3333
open /billing/test/test_api?callerid=32313231&pin=1360
storeText css=body hash12
open /billing/test/test_api?callerid=32313231&amount=100
storeText css=body hash13
open /billing/callc/logout
open /billing/api/cc_by_cli?u=reseller&p=reseller1&callerid=32313231&amount=100&test=1&hash=${hash13}
waitForTextPresent You do not have permission to access card
open /billing/api/cc_by_cli?u=reseller&p=reseller1&callerid=32313231&pin=1360&test=1&hash=${hash12}
waitForTextPresent You do not have permission to access card