iptdevs-design-system 2.7.124 → 2.7.126

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.
@@ -3577,15 +3577,18 @@ class CodFormStepFourComponent extends CodFormSteps {
3577
3577
  const codPrices = response.data;
3578
3578
  this.codPrices = codPrices;
3579
3579
  console.log(this.codPrices);
3580
- if (this.codFormStepFour.controls['payment_method'].value === '2') {
3581
- const aux = this.codPrices.filter(codPrice => codPrice.agreement === Number(agreementSelected))[0];
3582
- this.codFormStepFour.controls['program_price'].setValue(aux.normal_price);
3583
- }
3584
3580
  if (this.codFormStepFour.controls['payment_method'].value === '1') {
3585
3581
  const aux = this.codPrices.filter(codPrice => codPrice.agreement === Number(agreementSelected))[0];
3586
3582
  this.codFormStepFour.controls['quota_times'].setValue(aux.code);
3587
3583
  this.codFormStepFour.controls['program_price'].setValue(aux.normal_price);
3588
3584
  }
3585
+ else {
3586
+ if (this.codFormStepFour.controls['payment_method'].value === '2') {
3587
+ // const aux = this.codPrices.filter(codPrice => codPrice.agreement === Number(agreementSelected))[0];
3588
+ const aux = this.codPrices.filter(codPrice => codPrice.fee_number === 1)[0];
3589
+ this.codFormStepFour.controls['program_price'].setValue(aux.normal_price);
3590
+ }
3591
+ }
3589
3592
  }
3590
3593
  },
3591
3594
  error: (err) => console.log(err)
@@ -4024,48 +4027,27 @@ class CodFormComponent {
4024
4027
  this.loaderMessage = 'Creando COD, espere un momento';
4025
4028
  let request = this.getCreateCOD(totalData);
4026
4029
  console.log(request);
4027
- // this.commercialService.createCOD(request).subscribe({
4028
- // next: (response: any) => {
4029
- // console.log(response);
4030
- // if (response.message.code === 1) {
4031
- // this.isLoading = false;
4032
- // this.loaderMessage = '';
4033
- // Swal.fire({
4034
- // title: 'Perfecto!',
4035
- // text: 'El COD ha sido creado exitosamente.',
4036
- // icon: 'success'
4037
- // })
4038
- // this.cleanStorage();
4039
- // }
4040
- // },
4041
- // error: (err: any) => {
4042
- // console.log(err);
4043
- // this.isLoading = false;
4044
- // this.loaderMessage = '';
4045
- // Swal.fire({
4046
- // title: 'Error in cod creation',
4047
- // text: err.message,
4048
- // icon: 'error'
4049
- // })
4050
- // }
4051
- // })
4052
- this.commercialService.createCOD(request).subscribe((response) => {
4053
- if (response.message.code === 1) {
4054
- this.isLoading = false;
4055
- this.loaderMessage = '';
4056
- Swal.fire({
4057
- title: 'Perfecto!',
4058
- text: 'El COD ha sido creado exitosamente.',
4059
- icon: 'success'
4060
- });
4061
- this.cleanStorage();
4062
- }
4063
- else {
4030
+ this.commercialService.createCOD(request).subscribe({
4031
+ next: (response) => {
4032
+ console.log(response);
4033
+ if (response.message.code === 1) {
4034
+ this.isLoading = false;
4035
+ this.loaderMessage = '';
4036
+ Swal.fire({
4037
+ title: 'Perfecto!',
4038
+ text: 'El COD ha sido creado exitosamente.',
4039
+ icon: 'success'
4040
+ });
4041
+ this.cleanStorage();
4042
+ }
4043
+ },
4044
+ error: (err) => {
4045
+ console.log(err);
4064
4046
  this.isLoading = false;
4065
4047
  this.loaderMessage = '';
4066
4048
  Swal.fire({
4067
4049
  title: 'Error in cod creation',
4068
- text: 'Ops Algo salio mal',
4050
+ text: err.message,
4069
4051
  icon: 'error'
4070
4052
  });
4071
4053
  }