iptdevs-design-system 2.7.134 → 2.7.136
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.
- package/esm2020/lib/cod/steps/cod-form-step-four/cod-form-step-four.component.mjs +47 -26
- package/esm2020/lib/cod/steps/cod-form-step-one/cod-form-step-one.component.mjs +4 -1
- package/esm2020/lib/core/models/commercial/commercial.model.mjs +1 -1
- package/esm2020/lib/core/services/commercial-service/comercial.service.mjs +6 -1
- package/fesm2015/iptdevs-design-system.mjs +54 -25
- package/fesm2015/iptdevs-design-system.mjs.map +1 -1
- package/fesm2020/iptdevs-design-system.mjs +54 -25
- package/fesm2020/iptdevs-design-system.mjs.map +1 -1
- package/lib/cod/steps/cod-form-step-four/cod-form-step-four.component.d.ts +1 -0
- package/lib/core/models/commercial/commercial.model.d.ts +4 -0
- package/lib/core/services/commercial-service/comercial.service.d.ts +2 -1
- package/package.json +1 -1
|
@@ -2410,6 +2410,11 @@ class CommercialService extends IPTGeneralService {
|
|
|
2410
2410
|
this.generateRequestParams(params);
|
|
2411
2411
|
return this.http.post(serviceUrl, this.httpOptions);
|
|
2412
2412
|
}
|
|
2413
|
+
getCodPricesByAgreementTypePayment(params) {
|
|
2414
|
+
let serviceUrl = this.SERVICE_URL + 'post/cod/prices/by/agreement/and/type/payment';
|
|
2415
|
+
this.generateRequestParams(params);
|
|
2416
|
+
return this.http.post(serviceUrl, this.httpOptions);
|
|
2417
|
+
}
|
|
2413
2418
|
}
|
|
2414
2419
|
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 });
|
|
2415
2420
|
CommercialService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CommercialService, providedIn: 'root' });
|
|
@@ -2853,6 +2858,9 @@ class CodFormStepOneComponent extends CodFormSteps {
|
|
|
2853
2858
|
selectAcademicPlan(academic_plan) {
|
|
2854
2859
|
if (academic_plan !== 'Plan') {
|
|
2855
2860
|
this.codFormStepOne.controls['academic_plan'].setValue(academic_plan);
|
|
2861
|
+
// this.codFormStepOne.controls['agreement_by_category'].setValue(null);
|
|
2862
|
+
// this.codFormStepOne.controls['school_name'].setValue(null);
|
|
2863
|
+
// this.codFormStepOne.controls['course_type'].setValue(null);
|
|
2856
2864
|
this.getCourseType(academic_plan);
|
|
2857
2865
|
this.getAgreementByPlan(academic_plan);
|
|
2858
2866
|
}
|
|
@@ -3572,30 +3580,43 @@ class CodFormStepFourComponent extends CodFormSteps {
|
|
|
3572
3580
|
else {
|
|
3573
3581
|
agreementSelected = this.localStorageCOD.getCodFormData(1, 'agreement_by_category');
|
|
3574
3582
|
}
|
|
3575
|
-
this.
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3583
|
+
if (this.codFormStepFour.controls['payment_method'].value === '1') {
|
|
3584
|
+
this.searchPriceByTypePayment(agreementSelected, 'cuotas');
|
|
3585
|
+
const aux = this.codPrices.filter(codPrice => codPrice.agreement === Number(agreementSelected))[0];
|
|
3586
|
+
this.codFormStepFour.controls['quota_times'].setValue(aux.code);
|
|
3587
|
+
this.codFormStepFour.controls['program_price'].setValue(aux.normal_price);
|
|
3588
|
+
}
|
|
3589
|
+
else {
|
|
3590
|
+
if (this.codFormStepFour.controls['payment_method'].value === '2') {
|
|
3591
|
+
this.searchPriceByTypePayment(agreementSelected, 'contado');
|
|
3592
|
+
const aux = this.codPrices.filter(codPrice => codPrice.fee_number === 1)[0];
|
|
3593
|
+
this.codFormStepFour.controls['quota_times'].setValue(aux.code);
|
|
3594
|
+
this.codFormStepFour.controls['program_price'].setValue(aux.normal_price);
|
|
3595
|
+
this.codFormStepFour.controls['total_price'].setValue(aux.enrollment);
|
|
3596
|
+
}
|
|
3597
|
+
}
|
|
3598
|
+
// this.commercialService.getCodPricesByAgreement(Number(agreementSelected)).subscribe({
|
|
3599
|
+
// next: (response: any) => {
|
|
3600
|
+
// if (response.data) {
|
|
3601
|
+
// const codPrices: CodPrices[] = response.data;
|
|
3602
|
+
// this.codPrices = codPrices;
|
|
3603
|
+
// if (this.codFormStepFour.controls['payment_method'].value === '1') {
|
|
3604
|
+
// const aux = this.codPrices.filter(codPrice => codPrice.agreement === Number(agreementSelected))[0];
|
|
3605
|
+
// this.codFormStepFour.controls['quota_times'].setValue(aux.code)
|
|
3606
|
+
// this.codFormStepFour.controls['program_price'].setValue(aux.normal_price)
|
|
3607
|
+
// }else {
|
|
3608
|
+
// if (this.codFormStepFour.controls['payment_method'].value === '2') {
|
|
3609
|
+
// // const aux = this.codPrices.filter(codPrice => codPrice.agreement === Number(agreementSelected))[0];
|
|
3610
|
+
// const aux = this.codPrices.filter(codPrice => codPrice.fee_number === 1)[0];
|
|
3611
|
+
// this.codFormStepFour.controls['quota_times'].setValue(aux.code);
|
|
3612
|
+
// this.codFormStepFour.controls['program_price'].setValue(aux.normal_price)
|
|
3613
|
+
// this.codFormStepFour.controls['total_price'].setValue(aux.enrollment);
|
|
3614
|
+
// }
|
|
3615
|
+
// }
|
|
3616
|
+
// }
|
|
3617
|
+
// },
|
|
3618
|
+
// error: (err) => console.log(err)
|
|
3619
|
+
// })
|
|
3599
3620
|
}
|
|
3600
3621
|
validateErrors() {
|
|
3601
3622
|
this.codFormStepFour.valueChanges.subscribe(changes => {
|
|
@@ -3610,6 +3631,15 @@ class CodFormStepFourComponent extends CodFormSteps {
|
|
|
3610
3631
|
}
|
|
3611
3632
|
});
|
|
3612
3633
|
}
|
|
3634
|
+
searchPriceByTypePayment(agreementSelected, type) {
|
|
3635
|
+
let request = {
|
|
3636
|
+
agreement: Number(agreementSelected),
|
|
3637
|
+
payment_method: 'contad'
|
|
3638
|
+
};
|
|
3639
|
+
this.commercialService.getCodPricesByAgreementTypePayment(request).subscribe((response) => {
|
|
3640
|
+
this.codPrices = response.data;
|
|
3641
|
+
});
|
|
3642
|
+
}
|
|
3613
3643
|
initForm() {
|
|
3614
3644
|
this.codFormStepFour = this.fb.group({
|
|
3615
3645
|
program_price: [{ value: '', disabled: true }, [Validators.required]],
|
|
@@ -3727,7 +3757,6 @@ class CodFormStepFourComponent extends CodFormSteps {
|
|
|
3727
3757
|
console.log(quotas);
|
|
3728
3758
|
if (quotas !== 'Número de cuotas') {
|
|
3729
3759
|
const codPrice = this.codPrices.filter(codPrice => codPrice.code === Number(quotas));
|
|
3730
|
-
console.log(codPrice[0].code);
|
|
3731
3760
|
this.codFormStepFour.controls['quota_times'].setValue(codPrice[0].code);
|
|
3732
3761
|
this.codFormStepFour.controls['total_price'].setValue(codPrice[0].enrollment);
|
|
3733
3762
|
this.codFormStepFour.controls['program_price'].setValue(codPrice[0].financed_price);
|