|
|
|
@ -2784,10 +2784,20 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
} else {
|
|
|
|
|
$scope.partner = {timezone: 'Australia/Melbourne'};
|
|
|
|
|
}
|
|
|
|
|
$scope.initMerchantCode = function () {
|
|
|
|
|
$http.get('/sys/partners/init/merchant_code').then(function (response) {
|
|
|
|
|
$scope.partner.client_moniker = response.data;
|
|
|
|
|
$scope.merchantCodeChecked = true;
|
|
|
|
|
$scope.merchantIsValid = true;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
$scope.initMerchantCode();
|
|
|
|
|
$scope.partner.company_phone_c = 61;
|
|
|
|
|
$scope.partner.contact_phone_c = 61;
|
|
|
|
|
$scope.partner.client_pay_type = [];
|
|
|
|
|
$scope.partner.client_pay_desc = [];
|
|
|
|
|
$scope.merchantIsValid = false;
|
|
|
|
|
$scope.merchantCodeChecked = false;
|
|
|
|
|
var resetClientPayDescByTpey = function (type) {
|
|
|
|
|
type = parseInt(type);
|
|
|
|
|
if (type == 1) {
|
|
|
|
@ -2914,6 +2924,17 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
$scope.timezones = timezone.configs();
|
|
|
|
|
$scope.states = stateMap.configs();
|
|
|
|
|
$scope.countries = countryMap.configs();
|
|
|
|
|
$scope.checkMerchantCodeIsValid = function (code) {
|
|
|
|
|
if (code.length != 4) {
|
|
|
|
|
$scope.merchantCodeChecked = false;
|
|
|
|
|
$scope.merchantIsValid = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$http.get('/sys/partners/init/check_code_isvalid',{params:{clientMoniker:code}}).then(function (response) {
|
|
|
|
|
$scope.merchantIsValid = response.data;
|
|
|
|
|
$scope.merchantCodeChecked = true;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
$scope.saveSubPartner = function (form) {
|
|
|
|
|
if (form.$invalid) {
|
|
|
|
|
angular.forEach(form, function (item, key) {
|
|
|
|
|