|
|
|
@ -22,6 +22,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
controller: 'addPartnerCtrl'
|
|
|
|
|
}).state('partners.edit', {
|
|
|
|
|
url: '/{clientMoniker}/edit',
|
|
|
|
|
params: {"commitCardPayment": false, commitCrossBorderPayment: false},
|
|
|
|
|
templateUrl: '/static/payment/partner/templates/partner_edit.html',
|
|
|
|
|
controller: 'partnerEditCtrl',
|
|
|
|
|
resolve: {
|
|
|
|
@ -38,7 +39,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
} else {
|
|
|
|
|
$scope.partner = {timezone: 'Australia/Melbourne'};
|
|
|
|
|
}
|
|
|
|
|
$scope.partner.enable_cross_payment = true;
|
|
|
|
|
$scope.partner.enable_cross_payment = false;
|
|
|
|
|
$scope.partner.enable_cross_payment = false;
|
|
|
|
|
$scope.initMerchantCode = function () {
|
|
|
|
|
$http.get('/sys/partners/init/merchant_code').then(function (response) {
|
|
|
|
@ -47,11 +48,16 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
$scope.merchantIsValid = true;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
$scope.enablePaymentType = function (type) {
|
|
|
|
|
$scope.partner[type] = !$scope.partner[type];
|
|
|
|
|
};
|
|
|
|
|
$scope.enablePaymentType('enable_cross_payment');
|
|
|
|
|
$scope.initMerchantCode();
|
|
|
|
|
$scope.partner.company_phone_c = 61;
|
|
|
|
|
$scope.partner.contact_phone_c = 61;
|
|
|
|
|
$scope.partner.client_pay_type = [];
|
|
|
|
|
$scope.partner.client_pay_desc = [];
|
|
|
|
|
|
|
|
|
|
var resetClientPayDescByTpey = function (type) {
|
|
|
|
|
type = parseInt(type);
|
|
|
|
|
if (type == 1) {
|
|
|
|
@ -63,9 +69,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
};
|
|
|
|
|
$scope.partner.sameAsContactPerson = false;
|
|
|
|
|
|
|
|
|
|
$scope.enablePaymentType = function (type) {
|
|
|
|
|
$scope.partner[type] = !$scope.partner[type];
|
|
|
|
|
};
|
|
|
|
|
$scope.checkboxOnclick = function (){
|
|
|
|
|
$scope.partner.sameAsContactPerson = !($scope.partner.sameAsContactPerson);
|
|
|
|
|
if($scope.partner.sameAsContactPerson) {
|
|
|
|
@ -499,6 +502,14 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
|
|
|
|
|
$scope.partner[type] = !$scope.partner[type];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if ($state.params.commitCardPayment) {
|
|
|
|
|
$scope.enablePaymentType('enable_card_payment');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($state.params.commitCrossBorderPayment) {
|
|
|
|
|
$scope.enablePaymentType('enable_cross_payment');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function hasRole() {
|
|
|
|
|
var rolenum;
|
|
|
|
|
switch (sessionStorage.getItem('role')) {
|
|
|
|
|