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.
@@ -3152,6 +3152,11 @@ class CommercialService extends IPTGeneralService {
3152
3152
  this.generateRequestParams(params);
3153
3153
  return this.http.post(serviceUrl, this.httpOptions);
3154
3154
  }
3155
+ createCodSelfManaged(params) {
3156
+ let serviceUrl = this.SERVICE_URL + 'post/cod/self/managed';
3157
+ this.generateRequestParams(params);
3158
+ return this.http.post(serviceUrl, this.httpOptions);
3159
+ }
3155
3160
  }
3156
3161
  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 });
3157
3162
  CommercialService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CommercialService, providedIn: 'root' });
@@ -7222,6 +7227,7 @@ class CodSelfFormStepThreeComponent extends CodSelfManagedSteps {
7222
7227
  this.feeResponse = false;
7223
7228
  this.thereArePlans = false;
7224
7229
  this.isFinancing = false;
7230
+ this.dataFinancingMaster = [];
7225
7231
  this.dataFinancing = [];
7226
7232
  this.selectedRow = null;
7227
7233
  this.errorMessage = 'Faltan campos por llenar.';
@@ -7389,30 +7395,30 @@ class CodSelfFormStepThreeComponent extends CodSelfManagedSteps {
7389
7395
  quotaTimes: Number(this.codSelfFormStepThree.controls['fee_number'].value),
7390
7396
  totalPrice: this.codSelfFormStepThree.controls['total_price'].value,
7391
7397
  };
7392
- this.dataFinancing = this.calculateQuotesService.calculateQuotes(params);
7393
- if (this.dataFinancing.length > 1) {
7394
- const enrollmentValue = this.dataFinancing[0][1];
7395
- const firstQuotaValue = this.dataFinancing[1][1];
7398
+ this.dataFinancingMaster = this.calculateQuotesService.calculateQuotes(params);
7399
+ if (this.dataFinancingMaster.length > 1) {
7400
+ const enrollmentValue = this.dataFinancingMaster[0][1];
7401
+ const firstQuotaValue = this.dataFinancingMaster[1][1];
7396
7402
  this.totalInitialPaymentSpan = parseFloat(enrollmentValue.replace(/[^\d.-]/g, '')) + parseFloat(firstQuotaValue.replace(/[^\d.-]/g, ''));
7397
7403
  console.log('linea, 237', this.totalInitialPaymentSpan);
7398
- const enrollmentValueTwo = parseFloat(this.dataFinancing[0][1].replace(/[^\d.-]/g, ''));
7399
- const firstQuotaValueTwo = parseFloat(this.dataFinancing[1][1].replace(/[^\d.-]/g, ''));
7404
+ const enrollmentValueTwo = parseFloat(this.dataFinancingMaster[0][1].replace(/[^\d.-]/g, ''));
7405
+ const firstQuotaValueTwo = parseFloat(this.dataFinancingMaster[1][1].replace(/[^\d.-]/g, ''));
7400
7406
  this.totalInitialPayment = enrollmentValueTwo + firstQuotaValueTwo;
7401
7407
  console.log('linea, 246', this.totalInitialPayment);
7402
7408
  const totalInitialPaymentInteger = Math.round(this.totalInitialPayment);
7403
7409
  const formattedTotalInitialPayment = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 0 }).format(totalInitialPaymentInteger);
7404
7410
  console.log('linea, 246', formattedTotalInitialPayment);
7405
7411
  const combinedRecord = [
7406
- this.dataFinancing[0][0],
7412
+ this.dataFinancingMaster[0][0],
7407
7413
  formattedTotalInitialPayment,
7408
- this.dataFinancing[0][2] // Mantener la fecha del primer registro
7414
+ this.dataFinancingMaster[0][2] // Mantener la fecha del primer registro
7409
7415
  ];
7410
7416
  console.log('linea, 253', combinedRecord);
7411
- this.dataFinancing = [combinedRecord, ...this.dataFinancing.slice(2)];
7417
+ this.dataFinancing = [combinedRecord, ...this.dataFinancingMaster.slice(2)];
7412
7418
  console.log('inea, 255', this.dataFinancing);
7413
7419
  }
7414
7420
  this.isFinancing = true;
7415
- this.financingData.emit(this.dataFinancing);
7421
+ this.financingData.emit(this.dataFinancingMaster);
7416
7422
  this.isLoadingSelectLevels = false;
7417
7423
  }
7418
7424
  // calculateNewQuotes() {
@@ -7753,41 +7759,42 @@ class CodSelfManagedComponent {
7753
7759
  this.loaderMessage = 'Creando COD, espere un momento';
7754
7760
  let request = this.getCreateCOD(totalData);
7755
7761
  console.log(request);
7756
- // this.commercialService.createCOD(request).subscribe({
7757
- // next: (response: any) => {
7758
- // if (response.message.code === 1) {
7759
- // this.isLoading = false;
7760
- // this.loaderMessage = '';
7761
- // Swal.fire({
7762
- // title: 'Perfecto!',
7763
- // text: 'El COD ha sido creado exitosamente.',
7764
- // icon: 'success'
7765
- // })
7766
- // this.localStorageCodSelfManaged.clearData();
7767
- // this.okCreatedCOD.emit(true);
7768
- // }else{
7769
- // this.isLoading = false;
7770
- // this.loaderMessage = '';
7771
- // Swal.fire({
7772
- // title: 'Warning!',
7773
- // text: response.message.message,
7774
- // icon: 'error'
7775
- // })
7776
- // }
7777
- // },
7778
- // error: (err: any) => {
7779
- // this.isLoading = false;
7780
- // this.loaderMessage = '';
7781
- // Swal.fire({
7782
- // title: 'Error in cod creation',
7783
- // text: err.message,
7784
- // icon: 'error'
7785
- // })
7786
- // },
7787
- // complete: () => {
7788
- // this.codCreationSubscription = null;
7789
- // }
7790
- // })
7762
+ this.commercialService.createCodSelfManaged(request).subscribe({
7763
+ next: (response) => {
7764
+ if (response.message.code === 1) {
7765
+ this.isLoading = false;
7766
+ this.loaderMessage = '';
7767
+ Swal.fire({
7768
+ title: 'Perfecto!',
7769
+ text: 'El COD ha sido creado exitosamente.',
7770
+ icon: 'success'
7771
+ });
7772
+ this.localStorageCodSelfManaged.clearData();
7773
+ this.okCreatedCOD.emit(true);
7774
+ }
7775
+ else {
7776
+ this.isLoading = false;
7777
+ this.loaderMessage = '';
7778
+ Swal.fire({
7779
+ title: 'Warning!',
7780
+ text: response.message.message,
7781
+ icon: 'error'
7782
+ });
7783
+ }
7784
+ },
7785
+ error: (err) => {
7786
+ this.isLoading = false;
7787
+ this.loaderMessage = '';
7788
+ Swal.fire({
7789
+ title: 'Error in cod creation',
7790
+ text: err.message,
7791
+ icon: 'error'
7792
+ });
7793
+ },
7794
+ complete: () => {
7795
+ this.codCreationSubscription = null;
7796
+ }
7797
+ });
7791
7798
  }
7792
7799
  getCreateCOD(data) {
7793
7800
  let request = {
@@ -7814,11 +7821,11 @@ class CodSelfManagedComponent {
7814
7821
  course_modality: data.filter(data => data.control === 'course_modality')[0].value,
7815
7822
  program_price: data.filter(data => data.control === 'program_price')[0].value,
7816
7823
  payment_date: data.filter(data => data.control === 'payment_date')[0].value,
7824
+ payment_dates: this.financingData,
7817
7825
  payment_method: data.filter(data => data.control === 'payment_method')[0].value,
7818
7826
  quota_times: data.filter(data => data.control === 'quota_times')[0].value,
7819
7827
  total_price: data.filter(data => data.control === 'total_price')[0].value,
7820
7828
  paid_level: data.filter(data => data.control === 'paid_level')[0].value,
7821
- payment_dates: this.financingData,
7822
7829
  optionsPayments: data.filter(data => data.control === 'optionsPayments')[0].value,
7823
7830
  invoicing_name: data.filter(data => data.control === 'invoicing_name')[0].value,
7824
7831
  invoicing_Apellido: data.filter(data => data.control === 'invoicing_Apellido')[0].value,