iptdevs-design-system 3.1.671 → 3.1.673

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3149,6 +3149,11 @@ class CommercialService extends IPTGeneralService {
3149
3149
  this.generateRequestParams(params);
3150
3150
  return this.http.post(serviceUrl, this.httpOptions);
3151
3151
  }
3152
+ createCodSelfManaged(params) {
3153
+ let serviceUrl = this.SERVICE_URL + 'post/cod/self/managed';
3154
+ this.generateRequestParams(params);
3155
+ return this.http.post(serviceUrl, this.httpOptions);
3156
+ }
3152
3157
  }
3153
3158
  CommercialService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CommercialService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
3154
3159
  CommercialService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CommercialService, providedIn: 'root' });
@@ -7210,6 +7215,7 @@ class CodSelfFormStepThreeComponent extends CodSelfManagedSteps {
7210
7215
  this.feeResponse = false;
7211
7216
  this.thereArePlans = false;
7212
7217
  this.isFinancing = false;
7218
+ this.dataFinancingMaster = [];
7213
7219
  this.dataFinancing = [];
7214
7220
  this.selectedRow = null;
7215
7221
  this.errorMessage = 'Faltan campos por llenar.';
@@ -7376,30 +7382,30 @@ class CodSelfFormStepThreeComponent extends CodSelfManagedSteps {
7376
7382
  quotaTimes: Number(this.codSelfFormStepThree.controls['fee_number'].value),
7377
7383
  totalPrice: this.codSelfFormStepThree.controls['total_price'].value,
7378
7384
  };
7379
- this.dataFinancing = this.calculateQuotesService.calculateQuotes(params);
7380
- if (this.dataFinancing.length > 1) {
7381
- const enrollmentValue = this.dataFinancing[0][1];
7382
- const firstQuotaValue = this.dataFinancing[1][1];
7385
+ this.dataFinancingMaster = this.calculateQuotesService.calculateQuotes(params);
7386
+ if (this.dataFinancingMaster.length > 1) {
7387
+ const enrollmentValue = this.dataFinancingMaster[0][1];
7388
+ const firstQuotaValue = this.dataFinancingMaster[1][1];
7383
7389
  this.totalInitialPaymentSpan = parseFloat(enrollmentValue.replace(/[^\d.-]/g, '')) + parseFloat(firstQuotaValue.replace(/[^\d.-]/g, ''));
7384
7390
  console.log('linea, 237', this.totalInitialPaymentSpan);
7385
- const enrollmentValueTwo = parseFloat(this.dataFinancing[0][1].replace(/[^\d.-]/g, ''));
7386
- const firstQuotaValueTwo = parseFloat(this.dataFinancing[1][1].replace(/[^\d.-]/g, ''));
7391
+ const enrollmentValueTwo = parseFloat(this.dataFinancingMaster[0][1].replace(/[^\d.-]/g, ''));
7392
+ const firstQuotaValueTwo = parseFloat(this.dataFinancingMaster[1][1].replace(/[^\d.-]/g, ''));
7387
7393
  this.totalInitialPayment = enrollmentValueTwo + firstQuotaValueTwo;
7388
7394
  console.log('linea, 246', this.totalInitialPayment);
7389
7395
  const totalInitialPaymentInteger = Math.round(this.totalInitialPayment);
7390
7396
  const formattedTotalInitialPayment = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 0 }).format(totalInitialPaymentInteger);
7391
7397
  console.log('linea, 246', formattedTotalInitialPayment);
7392
7398
  const combinedRecord = [
7393
- this.dataFinancing[0][0],
7399
+ this.dataFinancingMaster[0][0],
7394
7400
  formattedTotalInitialPayment,
7395
- this.dataFinancing[0][2] // Mantener la fecha del primer registro
7401
+ this.dataFinancingMaster[0][2] // Mantener la fecha del primer registro
7396
7402
  ];
7397
7403
  console.log('linea, 253', combinedRecord);
7398
- this.dataFinancing = [combinedRecord, ...this.dataFinancing.slice(2)];
7404
+ this.dataFinancing = [combinedRecord, ...this.dataFinancingMaster.slice(2)];
7399
7405
  console.log('inea, 255', this.dataFinancing);
7400
7406
  }
7401
7407
  this.isFinancing = true;
7402
- this.financingData.emit(this.dataFinancing);
7408
+ this.financingData.emit(this.dataFinancingMaster);
7403
7409
  this.isLoadingSelectLevels = false;
7404
7410
  }
7405
7411
  // calculateNewQuotes() {
@@ -7737,41 +7743,42 @@ class CodSelfManagedComponent {
7737
7743
  this.loaderMessage = 'Creando COD, espere un momento';
7738
7744
  let request = this.getCreateCOD(totalData);
7739
7745
  console.log(request);
7740
- // this.commercialService.createCOD(request).subscribe({
7741
- // next: (response: any) => {
7742
- // if (response.message.code === 1) {
7743
- // this.isLoading = false;
7744
- // this.loaderMessage = '';
7745
- // Swal.fire({
7746
- // title: 'Perfecto!',
7747
- // text: 'El COD ha sido creado exitosamente.',
7748
- // icon: 'success'
7749
- // })
7750
- // this.localStorageCodSelfManaged.clearData();
7751
- // this.okCreatedCOD.emit(true);
7752
- // }else{
7753
- // this.isLoading = false;
7754
- // this.loaderMessage = '';
7755
- // Swal.fire({
7756
- // title: 'Warning!',
7757
- // text: response.message.message,
7758
- // icon: 'error'
7759
- // })
7760
- // }
7761
- // },
7762
- // error: (err: any) => {
7763
- // this.isLoading = false;
7764
- // this.loaderMessage = '';
7765
- // Swal.fire({
7766
- // title: 'Error in cod creation',
7767
- // text: err.message,
7768
- // icon: 'error'
7769
- // })
7770
- // },
7771
- // complete: () => {
7772
- // this.codCreationSubscription = null;
7773
- // }
7774
- // })
7746
+ this.commercialService.createCodSelfManaged(request).subscribe({
7747
+ next: (response) => {
7748
+ if (response.message.code === 1) {
7749
+ this.isLoading = false;
7750
+ this.loaderMessage = '';
7751
+ Swal.fire({
7752
+ title: 'Perfecto!',
7753
+ text: 'El COD ha sido creado exitosamente.',
7754
+ icon: 'success'
7755
+ });
7756
+ this.localStorageCodSelfManaged.clearData();
7757
+ this.okCreatedCOD.emit(true);
7758
+ }
7759
+ else {
7760
+ this.isLoading = false;
7761
+ this.loaderMessage = '';
7762
+ Swal.fire({
7763
+ title: 'Warning!',
7764
+ text: response.message.message,
7765
+ icon: 'error'
7766
+ });
7767
+ }
7768
+ },
7769
+ error: (err) => {
7770
+ this.isLoading = false;
7771
+ this.loaderMessage = '';
7772
+ Swal.fire({
7773
+ title: 'Error in cod creation',
7774
+ text: err.message,
7775
+ icon: 'error'
7776
+ });
7777
+ },
7778
+ complete: () => {
7779
+ this.codCreationSubscription = null;
7780
+ }
7781
+ });
7775
7782
  }
7776
7783
  getCreateCOD(data) {
7777
7784
  let request = {
@@ -7798,11 +7805,11 @@ class CodSelfManagedComponent {
7798
7805
  course_modality: data.filter(data => data.control === 'course_modality')[0].value,
7799
7806
  program_price: data.filter(data => data.control === 'program_price')[0].value,
7800
7807
  payment_date: data.filter(data => data.control === 'payment_date')[0].value,
7808
+ payment_dates: this.financingData,
7801
7809
  payment_method: data.filter(data => data.control === 'payment_method')[0].value,
7802
7810
  quota_times: data.filter(data => data.control === 'quota_times')[0].value,
7803
7811
  total_price: data.filter(data => data.control === 'total_price')[0].value,
7804
7812
  paid_level: data.filter(data => data.control === 'paid_level')[0].value,
7805
- payment_dates: this.financingData,
7806
7813
  optionsPayments: data.filter(data => data.control === 'optionsPayments')[0].value,
7807
7814
  invoicing_name: data.filter(data => data.control === 'invoicing_name')[0].value,
7808
7815
  invoicing_Apellido: data.filter(data => data.control === 'invoicing_Apellido')[0].value,