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.
- package/esm2020/lib/cod-self-managed/cod-form-self-managed/cod-self-managed.component.mjs +38 -37
- package/esm2020/lib/cod-self-managed/steps/cod-form-step-three/cod-self-form-step-three.component.mjs +12 -11
- package/esm2020/lib/core/services/commercial-service/comercial.service.mjs +6 -1
- package/fesm2015/iptdevs-design-system.mjs +53 -46
- package/fesm2015/iptdevs-design-system.mjs.map +1 -1
- package/fesm2020/iptdevs-design-system.mjs +53 -46
- package/fesm2020/iptdevs-design-system.mjs.map +1 -1
- package/lib/cod-self-managed/steps/cod-form-step-three/cod-self-form-step-three.component.d.ts +1 -0
- package/lib/core/services/commercial-service/comercial.service.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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.
|
|
7393
|
-
if (this.
|
|
7394
|
-
const enrollmentValue = this.
|
|
7395
|
-
const firstQuotaValue = this.
|
|
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.
|
|
7399
|
-
const firstQuotaValueTwo = parseFloat(this.
|
|
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.
|
|
7412
|
+
this.dataFinancingMaster[0][0],
|
|
7407
7413
|
formattedTotalInitialPayment,
|
|
7408
|
-
this.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
7773
|
-
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
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,
|