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
|
@@ -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.
|
|
7380
|
-
if (this.
|
|
7381
|
-
const enrollmentValue = this.
|
|
7382
|
-
const firstQuotaValue = this.
|
|
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.
|
|
7386
|
-
const firstQuotaValueTwo = parseFloat(this.
|
|
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.
|
|
7399
|
+
this.dataFinancingMaster[0][0],
|
|
7394
7400
|
formattedTotalInitialPayment,
|
|
7395
|
-
this.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
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,
|