Commit 8670c5905975ee818129d7b8e4bb5679543283d0

Authored by Jaideep Singh
1 parent 98b2beef17
Exists in master

new changes

app/partials/viewCompany/viewCompany.controller.js
... ... @@ -66,6 +66,7 @@
66 66 })
67 67 }
68 68  
  69 +
69 70 $scope.cancelStatus = function(){
70 71 $('#delete3').css('display', 'none');
71 72 $scope.companyData.activate = !$scope.companyData.activate;
... ... @@ -268,6 +269,8 @@
268 269 }
269 270 $scope.showLoader = false;
270 271 })
  272 +
  273 +
271 274  
272 275 }
273 276  
... ... @@ -479,5 +482,44 @@
479 482 $scope.cancelToogle = function(){
480 483 $('#toogleMail').css('display', 'none');
481 484 }
  485 +
  486 + $scope.checkboxStatus = function(value){
  487 + console.log("checkbox",value)
  488 + $scope.showUpdateBtn = true;
  489 + }
  490 +
  491 + $scope.fuelercheckboxStatus = function(value){
  492 + $('#fuelerchange').css('display', 'block');
  493 + if(value == true){
  494 + $scope.statusMessage = 'Please confirm! Enabling FuelerLinx for this customer will enable price distribution web services and disable price emails for the contacts in this company'
  495 + }else{
  496 + $scope.statusMessage = 'Please confirm! Disabling FuelerLinx for this customer will disable price distribution web services into their FuelerLinx account. If you proceed then remember to enable price emails for the appropriate contacts in this company.'
  497 + }
  498 +
  499 +
  500 + }
  501 +
  502 + $scope.fuelerCancelStatus = function(){
  503 + $('#fuelerchange').css('display', 'none');
  504 + $scope.companyData.fuelerlinxCustomer = !$scope.companyData.fuelerlinxCustomer;
  505 + }
  506 +
  507 + $scope.fuelerAcceptStatus = function(){
  508 + var statusData;
  509 + if($scope.companyData.fuelerlinxCustomer == false){
  510 + statusData = "status=true";
  511 + } else {
  512 + statusData = "status=false";
  513 + }
  514 + ViewCompanyService.fuelerPricingChange(companyId, statusData).then(function(result) {
  515 + if(result.success){
  516 + $('#fuelerchange').css('display', 'none');
  517 +
  518 + $scope.editData();
  519 + getContactList();
  520 +
  521 + }
  522 + })
  523 + }
482 524  
483 525 }]);
484 526 \ No newline at end of file
... ...
app/partials/viewCompany/viewCompany.html
... ... @@ -190,14 +190,14 @@
190 190 </div>
191 191 <div class="row" style="margin-left:0px;">
192 192 <div class="col-md-5" style="padding-left: 0;">
193   - <input type="checkbox" name="" ng-model="companyData.baseTenant"> Tenant/Base Customer
  193 + <input type="checkbox" name="" ng-model="companyData.baseTenant" ng-change="checkboxStatus(companyData.baseTenant)"> Tenant/Base Customer
194 194 </div>
195 195 <div class="col-md-5" style="padding-left: 0;">
196   - <input type="checkbox" name="" ng-model="companyData.fuelerlinxCustomer"> FuelerLinx Customer
  196 + <input type="checkbox" name="" ng-model="companyData.fuelerlinxCustomer" ng-change="fuelercheckboxStatus(companyData.fuelerlinxCustomer)"> FuelerLinx Customer
197 197 </div>
198 198 </div>
199 199 <div>
200   - <input type="checkbox" name="" ng-model="companyData.contractFuelVendor"> CAA Member
  200 + <input type="checkbox" name="" ng-model="companyData.contractFuelVendor" ng-change="checkboxStatus(companyData.contractFuelVendor)"> CAA Member
201 201 </div>
202 202 </br>
203 203 <div class="new-address">
... ... @@ -632,7 +632,26 @@
632 632 </div>
633 633 </div>
634 634 </form>
635   -
  635 +<div class="customConfirmPopBackdrop" id="fuelerchange" >
  636 + <div class="customModalInner" style="max-width: 550px;">
  637 + <div class="customModelBody" style="border-radius: 5px 5px 0 0;">
  638 + <table>
  639 + <tr>
  640 + <td>
  641 + <img src="img/info.png" style="width: 50px;">
  642 + </td>
  643 + <td>
  644 + <p style="padding: 5px 10px; margin-bottom: 0;">{{statusMessage}}</p>
  645 + </td>
  646 + </tr>
  647 + </table>
  648 + </div>
  649 + <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;">
  650 + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="fuelerAcceptStatus()">Accept</button>
  651 + <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="fuelerCancelStatus()">Cancel</button>
  652 + </div>
  653 + </div>
  654 +</div>
636 655 <div class="customConfirmPopBackdrop" id="confirm1">
637 656 <div class="customModalInner" style="max-width: 400px;">
638 657 <div class="customModelBody" style="border-radius: 5px 5px 0 0;">
... ...
app/partials/viewCompany/viewCompany.service.js
... ... @@ -134,6 +134,22 @@
134 134 return deferred.promise;
135 135 }
136 136  
  137 + this.fuelerPricingChange = function(companyId, data){
  138 + var deferred = $q.defer();
  139 + $http({
  140 + method : 'PUT',
  141 + url : BASE_URL.url +'/company/contact/disablePriceEmail/'+companyId,
  142 + data : data,
  143 + headers : {'Content-Type': 'application/json'},
  144 + })
  145 + .then(function (result){
  146 + deferred.resolve(result.data);
  147 + },function (result){
  148 + deferred.resolve(result.data);
  149 + })
  150 + return deferred.promise;
  151 + }
  152 +
137 153 this.updateContact = function(data) {
138 154  
139 155 var deferred = $q.defer();
... ...