iptdevs-design-system 3.1.910 → 3.1.912
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/logic/calculate-quotes.service.mjs +73 -53
- package/esm2020/lib/cod/steps/cod-form-step-four/cod-form-step-four.component.mjs +7 -3
- package/esm2020/lib/cod-self-managed/logic/calculate-quotes.service.mjs +99 -0
- package/esm2020/lib/cod-self-managed/steps/cod-form-step-three/cod-self-form-step-three.component.mjs +2 -2
- package/fesm2015/iptdevs-design-system.mjs +181 -61
- package/fesm2015/iptdevs-design-system.mjs.map +1 -1
- package/fesm2020/iptdevs-design-system.mjs +181 -61
- package/fesm2020/iptdevs-design-system.mjs.map +1 -1
- package/lib/cod/logic/calculate-quotes.service.d.ts +3 -0
- package/lib/cod-self-managed/logic/calculate-quotes.service.d.ts +16 -0
- package/lib/cod-self-managed/steps/cod-form-step-three/cod-self-form-step-three.component.d.ts +1 -1
- package/package.json +1 -1
|
@@ -4634,8 +4634,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
4634
4634
|
type: Output
|
|
4635
4635
|
}] } });
|
|
4636
4636
|
|
|
4637
|
-
class CalculateQuotesService {
|
|
4637
|
+
class CalculateQuotesService$1 {
|
|
4638
4638
|
constructor() {
|
|
4639
|
+
this.specialCourseTypes = [3, 4, 5, 6, 7, 8, 15, 21, 24, 25, 26, 30, 33]; //tecnicas
|
|
4639
4640
|
this.monthsDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
4640
4641
|
}
|
|
4641
4642
|
calculateQuotes(params) {
|
|
@@ -4643,51 +4644,80 @@ class CalculateQuotesService {
|
|
|
4643
4644
|
let index = 1; // Indicador de cant. de cuotas
|
|
4644
4645
|
let dateJs = new Date(params.date);
|
|
4645
4646
|
let isEndMonth = false;
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4647
|
+
const isSpecialCourseType = this.specialCourseTypes.includes(Number(params.courseType));
|
|
4648
|
+
if (!isSpecialCourseType) {
|
|
4649
|
+
// Non-special case: add one day and check for Sunday
|
|
4650
|
+
dateJs.setMilliseconds(dateJs.getMilliseconds() + (1000 * 3600 * 24));
|
|
4651
|
+
isEndMonth = this.monthsDays[dateJs.getMonth()] === dateJs.getDate();
|
|
4652
|
+
if (dateJs.getDay() === 0) {
|
|
4653
|
+
Swal.fire({
|
|
4654
|
+
title: 'Fecha inválida',
|
|
4655
|
+
text: 'Debe seleccionar un día de la semana diferente al domingo',
|
|
4656
|
+
icon: 'error'
|
|
4657
|
+
});
|
|
4658
|
+
return [];
|
|
4659
|
+
}
|
|
4654
4660
|
}
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4661
|
+
// Enrollment
|
|
4662
|
+
let enrollment = [
|
|
4663
|
+
index,
|
|
4664
|
+
Intl.NumberFormat('en-US', {
|
|
4665
|
+
style: 'currency',
|
|
4666
|
+
currency: 'USD',
|
|
4667
|
+
minimumFractionDigits: 0
|
|
4668
|
+
}).format(Math.round(parseFloat(params.totalPrice.toString()))),
|
|
4669
|
+
this.getStringDate(dateJs)
|
|
4670
|
+
];
|
|
4671
|
+
// First quota
|
|
4672
|
+
let firstQuotaDate = isSpecialCourseType ? new Date(params.date) : dateJs;
|
|
4673
|
+
if (isSpecialCourseType) {
|
|
4674
|
+
firstQuotaDate.setMonth(firstQuotaDate.getMonth() + 1);
|
|
4675
|
+
// Adjust if day exceeds max days in month
|
|
4676
|
+
const maxDays = this.monthsDays[firstQuotaDate.getMonth()];
|
|
4677
|
+
if (firstQuotaDate.getDate() > maxDays) {
|
|
4678
|
+
firstQuotaDate.setDate(maxDays);
|
|
4679
|
+
}
|
|
4680
|
+
}
|
|
4681
|
+
let quota = [
|
|
4682
|
+
index,
|
|
4683
|
+
Intl.NumberFormat('en-US', {
|
|
4684
|
+
style: 'currency',
|
|
4685
|
+
currency: 'USD',
|
|
4686
|
+
minimumFractionDigits: 0
|
|
4687
|
+
}).format(Math.round(parseFloat(params.quotaValues.toString()))),
|
|
4688
|
+
this.getStringDate(firstQuotaDate)
|
|
4689
|
+
];
|
|
4690
|
+
dataFinancing.push(enrollment);
|
|
4691
|
+
dataFinancing.push(quota);
|
|
4692
|
+
while (index < params.quotaTimes) {
|
|
4693
|
+
index = index + 1;
|
|
4694
|
+
let newJsDate;
|
|
4695
|
+
if (isSpecialCourseType) {
|
|
4696
|
+
// Special case: add (index) months from params.date
|
|
4697
|
+
newJsDate = new Date(params.date);
|
|
4698
|
+
newJsDate.setMonth(newJsDate.getMonth() + index);
|
|
4699
|
+
// Adjust if day exceeds max days in month
|
|
4700
|
+
const maxDays = this.monthsDays[newJsDate.getMonth()];
|
|
4701
|
+
if (newJsDate.getDate() > maxDays) {
|
|
4702
|
+
newJsDate.setDate(maxDays);
|
|
4703
|
+
}
|
|
4704
|
+
}
|
|
4705
|
+
else {
|
|
4706
|
+
// Non-special case: use existing logic
|
|
4707
|
+
const nextDates = this.setPlusOneMonth(dateJs, isEndMonth);
|
|
4708
|
+
newJsDate = nextDates[nextDates.length - 1];
|
|
4709
|
+
dateJs = nextDates[0];
|
|
4710
|
+
}
|
|
4711
|
+
let row = [
|
|
4666
4712
|
index,
|
|
4667
4713
|
Intl.NumberFormat('en-US', {
|
|
4668
4714
|
style: 'currency',
|
|
4669
4715
|
currency: 'USD',
|
|
4670
4716
|
minimumFractionDigits: 0
|
|
4671
4717
|
}).format(Math.round(parseFloat(params.quotaValues.toString()))),
|
|
4672
|
-
this.getStringDate(
|
|
4718
|
+
this.getStringDate(newJsDate)
|
|
4673
4719
|
];
|
|
4674
|
-
dataFinancing.push(
|
|
4675
|
-
dataFinancing.push(quota);
|
|
4676
|
-
while (index < params.quotaTimes) {
|
|
4677
|
-
index = index + 1;
|
|
4678
|
-
let newJsDate = this.setPlusOneMonth(dateJs, isEndMonth);
|
|
4679
|
-
let row = [
|
|
4680
|
-
index,
|
|
4681
|
-
Intl.NumberFormat('en-US', {
|
|
4682
|
-
style: 'currency',
|
|
4683
|
-
currency: 'USD',
|
|
4684
|
-
minimumFractionDigits: 0
|
|
4685
|
-
}).format(Math.round(parseFloat(params.quotaValues.toString()))),
|
|
4686
|
-
this.getStringDate(newJsDate[newJsDate.length - 1])
|
|
4687
|
-
];
|
|
4688
|
-
dataFinancing.push(row);
|
|
4689
|
-
dateJs = newJsDate[0];
|
|
4690
|
-
}
|
|
4720
|
+
dataFinancing.push(row);
|
|
4691
4721
|
}
|
|
4692
4722
|
return dataFinancing;
|
|
4693
4723
|
}
|
|
@@ -4698,32 +4728,22 @@ class CalculateQuotesService {
|
|
|
4698
4728
|
let plusMonthDate = new Date(originDate.getFullYear(), originDate.getMonth() + 1, day);
|
|
4699
4729
|
response.push(new Date(originDate.getFullYear(), originDate.getMonth() + 1, day));
|
|
4700
4730
|
while (plusMonthDate.getDay() === 0) {
|
|
4701
|
-
plusMonthDate.setMilliseconds(
|
|
4731
|
+
plusMonthDate.setMilliseconds(plusMonthDate.getMilliseconds() - oneDayMilis);
|
|
4702
4732
|
}
|
|
4703
4733
|
response.push(plusMonthDate);
|
|
4704
4734
|
return response;
|
|
4705
4735
|
}
|
|
4706
|
-
// setPlusOneMonth2(originDate: Date, isEndMonth: boolean): Date[] {
|
|
4707
|
-
// let response: Date[] = [];
|
|
4708
|
-
// let oneDayMilis = 1000 * 3600 * 24;
|
|
4709
|
-
// let day = isEndMonth ? this.monthsDays[(originDate.getMonth() + 1) % 12] : originDate.getDate();
|
|
4710
|
-
// let plusMonthDate: Date = new Date(originDate.getFullYear(), originDate.getMonth() + 1, day);
|
|
4711
|
-
// while (plusMonthDate.getDay() === 0) {
|
|
4712
|
-
// plusMonthDate.setMilliseconds(plusMonthDate.getMilliseconds() - oneDayMilis);
|
|
4713
|
-
// }
|
|
4714
|
-
// response.push(plusMonthDate);
|
|
4715
|
-
// response.push(new Date(originDate.getFullYear(), originDate.getMonth() + 1, day + 1));
|
|
4716
|
-
// return response;
|
|
4717
|
-
// }
|
|
4718
4736
|
getStringDate(originDate) {
|
|
4719
4737
|
let month = originDate.getMonth() + 1;
|
|
4720
|
-
let stringMonth = month < 10 ? '0' + month : month;
|
|
4721
|
-
|
|
4738
|
+
let stringMonth = month < 10 ? '0' + month : month.toString();
|
|
4739
|
+
let day = originDate.getDate();
|
|
4740
|
+
let stringDay = day < 10 ? '0' + day : day.toString();
|
|
4741
|
+
return originDate.getFullYear() + '-' + stringMonth + '-' + stringDay;
|
|
4722
4742
|
}
|
|
4723
4743
|
}
|
|
4724
|
-
CalculateQuotesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CalculateQuotesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4725
|
-
CalculateQuotesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CalculateQuotesService, providedIn: 'root' });
|
|
4726
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CalculateQuotesService, decorators: [{
|
|
4744
|
+
CalculateQuotesService$1.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CalculateQuotesService$1, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4745
|
+
CalculateQuotesService$1.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CalculateQuotesService$1, providedIn: 'root' });
|
|
4746
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CalculateQuotesService$1, decorators: [{
|
|
4727
4747
|
type: Injectable,
|
|
4728
4748
|
args: [{
|
|
4729
4749
|
providedIn: 'root'
|
|
@@ -4985,8 +5005,12 @@ class CodFormStepFourComponent extends CodFormSteps {
|
|
|
4985
5005
|
quotaValues: Number(this.codFormStepFour.controls['quota_price'].value),
|
|
4986
5006
|
quotaTimes: Number(this.codFormStepFour.controls['fee_number'].value),
|
|
4987
5007
|
totalPrice: this.codFormStepFour.controls['total_price'].value,
|
|
5008
|
+
courseType: Number(this.localStorageCOD.getCodFormData(1, 'course_type')),
|
|
5009
|
+
englishLevel: Number(this.localStorageCOD.getCodFormData(1, 'english_level')),
|
|
4988
5010
|
};
|
|
5011
|
+
console.log("params", params);
|
|
4989
5012
|
this.dataFinancing = this.calculateQuotesService.calculateQuotes(params);
|
|
5013
|
+
console.log("dataFinancing", this.dataFinancing);
|
|
4990
5014
|
this.isFinancing = true;
|
|
4991
5015
|
this.financingData.emit(this.dataFinancing);
|
|
4992
5016
|
}
|
|
@@ -5130,12 +5154,12 @@ class CodFormStepFourComponent extends CodFormSteps {
|
|
|
5130
5154
|
// this.codFormStepFour.controls['quota_times'].setValue(this.initialData.cod_payment.lenght == 1 ? 1 : this.initialData.cod_price.fee_number);
|
|
5131
5155
|
}
|
|
5132
5156
|
}
|
|
5133
|
-
CodFormStepFourComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CodFormStepFourComponent, deps: [{ token: i1$1.FormBuilder }, { token: CalculateQuotesService }, { token: CodFormControls }, { token: CommercialService }, { token: BaseService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5134
|
-
CodFormStepFourComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: CodFormStepFourComponent, selector: "app-cod-form-step-four", inputs: { isEditCod: "isEditCod", initialData: "initialData", isRenovation: "isRenovation" }, outputs: { changeStepEvent: "changeStepEvent", financingData: "financingData" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"isSemestral\" class=\"m-1 p-2 border-round-lg bg-blue-500 text-white\">\n <strong>Nota: </strong>\n El tipo de curso seleccionado fue semestral, por lo tanto el estudiante debe pagar matr\u00EDcula y primera cuota (M&M)\n</div>\n\n<form autocomplete=\"off\" [formGroup]=\"codFormStepFour\" class=\"grid mt-2\">\n\n <div class=\"col-12\">\n <ipt-select\n [initialValue]=\"codFormStepFour.controls['payment_method'].value\"\n [control]=\"codFormStepFour.controls['payment_method']\"\n (eventSelect)=\"selectPaymentMethod($event)\"\n [data]=\"paymentMethods\"\n [defaultText]=\"'M\u00E9todo de pago'\"\n [disabledSel]=\"isDisabledSel\"\n ></ipt-select>\n <ipt-loader *ngIf=\"feeResponse\"></ipt-loader>\n\n <div class=\"col-12\" *ngIf=\"thereArePlans\">\n <p-table\n [value]=\"dataPrices\"\n [tableStyle]=\"{'min-width': '100%'}\"\n [rowHover]=\"true\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex align-items-center\">\n Seleccion de niveles a cancelar.\n </div>\n </ng-template>\n <ng-template pTemplate=\"header\">\n <tr>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Cancelar</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Cuotas</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Admin</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-data>\n <tr>\n <td class=\"text-center\">{{ data.paid_level }} Nivel(es)</td>\n <td class=\"text-center\">{{ data.fee_number }}</td>\n <td class=\"pt-2 pb-2 text-center\">\n <button\n pButton\n pRipple\n icon=\"pi pi-money-bill\"\n class=\"p-button-sm p-button-rounded\"\n (click)=\"selectLevels(data)\"\n\n ></button>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n\n <!-- [initialValue]=\"codFormStepFour.controls['quota_times'].value\" -->\n <!-- <ipt-select *ngIf=\"isFinanced();\"\n [initialValue]=\"'1'\"\n [control]=\"codFormStepFour.controls['quota_times']\"\n (eventSelect)=\"selectQuotas($event)\"\n [defaultText]=\"'N\u00FAmero de cuotas'\"\n [data]=\"codPrices\"\n ></ipt-select> -->\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Monto total de la matr\u00EDcula'\"\n [control]=\"codFormStepFour.controls['total_price']\"\n [withPipe]=\"true\"\n ></ipt-input>\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n [withPipe]=\"true\"\n [inputType]=\"'text'\"\n [control]=\"codFormStepFour.controls['program_price']\"\n [placeHolder]=\"'Valor total del programa'\"\n ></ipt-input>\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n onfocus=\"(this.type='date')\"\n [inputType]=\"'date'\"\n [control]=\"codFormStepFour.controls['payment_date']\"\n [placeHolder]=\"'Fecha de pago'\"\n ></ipt-input>\n </div>\n\n <!-- Tabla de financiaci\u00F3n -->\n <div *ngIf=\"isFinancing && isRenovation === false\" class=\"container_tablet\">\n <div class=\"col-12\" *ngIf=\"isFinancing\">\n <p-table\n [value]=\"dataFinancing\"\n [tableStyle]=\"{'min-width': '100%'}\"\n [rowHover]=\"true\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex align-items-center\">\n C\u00E1lculo de cuotas\n <button pButton class=\"p-button-sm ml-auto\" label=\"Nuevo c\u00E1lculo\" (click)=\"calculateNewQuotes()\" [disabled]=\"isDisabledSel\" lab icon=\"pi pi-replay\"></button>\n </div>\n </ng-template>\n <ng-template pTemplate=\"header\">\n <tr>\n <th>#</th>\n <th>Valor</th>\n <th>Fecha</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-data>\n <tr>\n <td>{{ data[0] }}</td>\n <td>{{ data[1] }}</td>\n <td>{{ data[2] }}</td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n </div>\n <!-- ---------------------- -->\n\n</form>\n\n<div class=\"flex mt-3 align-items-center gap-3\">\n <span *ngIf=\"codFormStepFour.invalid && codFormStepFour.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\n <div class=\"flex ml-auto gap-2\">\n <button *ngIf=\"codFormStepFour.controls['payment_method'].value === '1'\" [disabled]=\"isFinancing || codFormStepFour.controls['payment_method'].value !== '1'\"type=\"submit\" class=\"ml-auto p-button-sm p-button-secondary\" (click)=\"showTable()\" pButton label=\"Calcular cuotas\" icon=\"pi pi-sliders-h\"></button>\n <button [disabled]=\"!isFinancing && codFormStepFour.controls['payment_method'].value === '1'\" type=\"submit\" [class]=\"isEditCod ? 'ml-auto yellow-300 p-button-sm' : 'ml-auto p-button-sm'\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\n </div>\n</div>\n", styles: [".yellow-300{background-color:var(--yellow-500)!important;color:#fff}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: InputComponent, selector: "ipt-input", inputs: ["inputType", "placeHolder", "validateText", "withPipe", "list", "iconUrl", "control", "prefix", "thousands", "decimal", "disabledSel"], outputs: ["dateSelected"] }, { kind: "component", type: LoaderComponent, selector: "ipt-loader", inputs: ["message", "isDialog"] }, { kind: "component", type: SelectComponent, selector: "ipt-select", inputs: ["isRequired", "data", "defaultText", "selectCode", "disabledSel", "initialValue", "label", "control"], outputs: ["eventSelect"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i11.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i6$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
|
|
5157
|
+
CodFormStepFourComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CodFormStepFourComponent, deps: [{ token: i1$1.FormBuilder }, { token: CalculateQuotesService$1 }, { token: CodFormControls }, { token: CommercialService }, { token: BaseService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5158
|
+
CodFormStepFourComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: CodFormStepFourComponent, selector: "app-cod-form-step-four", inputs: { isEditCod: "isEditCod", initialData: "initialData", isRenovation: "isRenovation" }, outputs: { changeStepEvent: "changeStepEvent", financingData: "financingData" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"isSemestral\" class=\"m-1 p-2 border-round-lg bg-blue-500 text-white\">\n <strong>Nota: </strong>\n El tipo de curso seleccionado fue semestral, por lo tanto el estudiante debe pagar matr\u00EDcula y primera cuota (M&M)\n</div>\n\n<form autocomplete=\"off\" [formGroup]=\"codFormStepFour\" class=\"grid mt-2\">\n\n <div class=\"col-12\">\n <ipt-select\n [initialValue]=\"codFormStepFour.controls['payment_method'].value\"\n [control]=\"codFormStepFour.controls['payment_method']\"\n (eventSelect)=\"selectPaymentMethod($event)\"\n [data]=\"paymentMethods\"\n [defaultText]=\"'M\u00E9todo de pago'\"\n [disabledSel]=\"isDisabledSel\"\n ></ipt-select>\n <ipt-loader *ngIf=\"feeResponse\"></ipt-loader>\n\n <div class=\"col-12\" *ngIf=\"thereArePlans\">\n <p-table\n [value]=\"dataPrices\"\n [tableStyle]=\"{'min-width': '100%'}\"\n [rowHover]=\"true\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex align-items-center\">\n Seleccion de niveles a cancelar.\n </div>\n </ng-template>\n <ng-template pTemplate=\"header\">\n <tr>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Cancelar</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Cuotas</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Admin</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-data>\n <tr>\n <td class=\"text-center\">{{ data.paid_level }} Nivel(es)</td>\n <td class=\"text-center\">{{ data.fee_number }}</td>\n <td class=\"pt-2 pb-2 text-center\">\n <button\n pButton\n pRipple\n icon=\"pi pi-money-bill\"\n class=\"p-button-sm p-button-rounded\"\n (click)=\"selectLevels(data)\"\n\n ></button>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n\n <!-- [initialValue]=\"codFormStepFour.controls['quota_times'].value\" -->\n <!-- <ipt-select *ngIf=\"isFinanced();\"\n [initialValue]=\"'1'\"\n [control]=\"codFormStepFour.controls['quota_times']\"\n (eventSelect)=\"selectQuotas($event)\"\n [defaultText]=\"'N\u00FAmero de cuotas'\"\n [data]=\"codPrices\"\n ></ipt-select> -->\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Monto total de la matr\u00EDcula'\"\n [control]=\"codFormStepFour.controls['total_price']\"\n [withPipe]=\"true\"\n ></ipt-input>\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n [withPipe]=\"true\"\n [inputType]=\"'text'\"\n [control]=\"codFormStepFour.controls['program_price']\"\n [placeHolder]=\"'Valor total del programa'\"\n ></ipt-input>\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n onfocus=\"(this.type='date')\"\n [inputType]=\"'date'\"\n [control]=\"codFormStepFour.controls['payment_date']\"\n [placeHolder]=\"'Fecha de pago'\"\n ></ipt-input>\n </div>\n\n <!-- Tabla de financiaci\u00F3n -->\n <div *ngIf=\"isFinancing && isRenovation === false\" class=\"container_tablet\">\n <div class=\"col-12\" *ngIf=\"isFinancing\">\n <p-table\n [value]=\"dataFinancing\"\n [tableStyle]=\"{'min-width': '100%'}\"\n [rowHover]=\"true\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex align-items-center\">\n C\u00E1lculo de cuotas\n <button pButton class=\"p-button-sm ml-auto\" label=\"Nuevo c\u00E1lculo\" (click)=\"calculateNewQuotes()\" [disabled]=\"isDisabledSel\" lab icon=\"pi pi-replay\"></button>\n </div>\n </ng-template>\n <ng-template pTemplate=\"header\">\n <tr>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">#</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Valor</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Fecha</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-data>\n <tr>\n <td class=\"p-0 text-center text-sm\">{{ data[0] }}</td>\n <td class=\"p-0 text-center text-sm\">{{ data[1] }}</td>\n <td class=\"p-0 text-center text-sm\">{{ data[2] }}</td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n </div>\n <!-- ---------------------- -->\n\n</form>\n\n<div class=\"flex mt-3 align-items-center gap-3\">\n <span *ngIf=\"codFormStepFour.invalid && codFormStepFour.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\n <div class=\"flex ml-auto gap-2\">\n <button *ngIf=\"codFormStepFour.controls['payment_method'].value === '1'\" [disabled]=\"isFinancing || codFormStepFour.controls['payment_method'].value !== '1'\"type=\"submit\" class=\"ml-auto p-button-sm p-button-secondary\" (click)=\"showTable()\" pButton label=\"Calcular cuotas\" icon=\"pi pi-sliders-h\"></button>\n <button [disabled]=\"!isFinancing && codFormStepFour.controls['payment_method'].value === '1'\" type=\"submit\" [class]=\"isEditCod ? 'ml-auto yellow-300 p-button-sm' : 'ml-auto p-button-sm'\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\n </div>\n</div>\n", styles: [".yellow-300{background-color:var(--yellow-500)!important;color:#fff}.container_tablet{width:-webkit-fill-available}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: InputComponent, selector: "ipt-input", inputs: ["inputType", "placeHolder", "validateText", "withPipe", "list", "iconUrl", "control", "prefix", "thousands", "decimal", "disabledSel"], outputs: ["dateSelected"] }, { kind: "component", type: LoaderComponent, selector: "ipt-loader", inputs: ["message", "isDialog"] }, { kind: "component", type: SelectComponent, selector: "ipt-select", inputs: ["isRequired", "data", "defaultText", "selectCode", "disabledSel", "initialValue", "label", "control"], outputs: ["eventSelect"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i11.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i6$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
|
|
5135
5159
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CodFormStepFourComponent, decorators: [{
|
|
5136
5160
|
type: Component,
|
|
5137
|
-
args: [{ selector: 'app-cod-form-step-four', template: "<div *ngIf=\"isSemestral\" class=\"m-1 p-2 border-round-lg bg-blue-500 text-white\">\n <strong>Nota: </strong>\n El tipo de curso seleccionado fue semestral, por lo tanto el estudiante debe pagar matr\u00EDcula y primera cuota (M&M)\n</div>\n\n<form autocomplete=\"off\" [formGroup]=\"codFormStepFour\" class=\"grid mt-2\">\n\n <div class=\"col-12\">\n <ipt-select\n [initialValue]=\"codFormStepFour.controls['payment_method'].value\"\n [control]=\"codFormStepFour.controls['payment_method']\"\n (eventSelect)=\"selectPaymentMethod($event)\"\n [data]=\"paymentMethods\"\n [defaultText]=\"'M\u00E9todo de pago'\"\n [disabledSel]=\"isDisabledSel\"\n ></ipt-select>\n <ipt-loader *ngIf=\"feeResponse\"></ipt-loader>\n\n <div class=\"col-12\" *ngIf=\"thereArePlans\">\n <p-table\n [value]=\"dataPrices\"\n [tableStyle]=\"{'min-width': '100%'}\"\n [rowHover]=\"true\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex align-items-center\">\n Seleccion de niveles a cancelar.\n </div>\n </ng-template>\n <ng-template pTemplate=\"header\">\n <tr>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Cancelar</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Cuotas</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Admin</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-data>\n <tr>\n <td class=\"text-center\">{{ data.paid_level }} Nivel(es)</td>\n <td class=\"text-center\">{{ data.fee_number }}</td>\n <td class=\"pt-2 pb-2 text-center\">\n <button\n pButton\n pRipple\n icon=\"pi pi-money-bill\"\n class=\"p-button-sm p-button-rounded\"\n (click)=\"selectLevels(data)\"\n\n ></button>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n\n <!-- [initialValue]=\"codFormStepFour.controls['quota_times'].value\" -->\n <!-- <ipt-select *ngIf=\"isFinanced();\"\n [initialValue]=\"'1'\"\n [control]=\"codFormStepFour.controls['quota_times']\"\n (eventSelect)=\"selectQuotas($event)\"\n [defaultText]=\"'N\u00FAmero de cuotas'\"\n [data]=\"codPrices\"\n ></ipt-select> -->\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Monto total de la matr\u00EDcula'\"\n [control]=\"codFormStepFour.controls['total_price']\"\n [withPipe]=\"true\"\n ></ipt-input>\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n [withPipe]=\"true\"\n [inputType]=\"'text'\"\n [control]=\"codFormStepFour.controls['program_price']\"\n [placeHolder]=\"'Valor total del programa'\"\n ></ipt-input>\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n onfocus=\"(this.type='date')\"\n [inputType]=\"'date'\"\n [control]=\"codFormStepFour.controls['payment_date']\"\n [placeHolder]=\"'Fecha de pago'\"\n ></ipt-input>\n </div>\n\n <!-- Tabla de financiaci\u00F3n -->\n <div *ngIf=\"isFinancing && isRenovation === false\" class=\"container_tablet\">\n <div class=\"col-12\" *ngIf=\"isFinancing\">\n <p-table\n [value]=\"dataFinancing\"\n [tableStyle]=\"{'min-width': '100%'}\"\n [rowHover]=\"true\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex align-items-center\">\n C\u00E1lculo de cuotas\n <button pButton class=\"p-button-sm ml-auto\" label=\"Nuevo c\u00E1lculo\" (click)=\"calculateNewQuotes()\" [disabled]=\"isDisabledSel\" lab icon=\"pi pi-replay\"></button>\n </div>\n </ng-template>\n <ng-template pTemplate=\"header\">\n <tr>\n <th>#</th>\n <th>Valor</th>\n <th>Fecha</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-data>\n <tr>\n <td>{{ data[0] }}</td>\n <td>{{ data[1] }}</td>\n <td>{{ data[2] }}</td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n </div>\n <!-- ---------------------- -->\n\n</form>\n\n<div class=\"flex mt-3 align-items-center gap-3\">\n <span *ngIf=\"codFormStepFour.invalid && codFormStepFour.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\n <div class=\"flex ml-auto gap-2\">\n <button *ngIf=\"codFormStepFour.controls['payment_method'].value === '1'\" [disabled]=\"isFinancing || codFormStepFour.controls['payment_method'].value !== '1'\"type=\"submit\" class=\"ml-auto p-button-sm p-button-secondary\" (click)=\"showTable()\" pButton label=\"Calcular cuotas\" icon=\"pi pi-sliders-h\"></button>\n <button [disabled]=\"!isFinancing && codFormStepFour.controls['payment_method'].value === '1'\" type=\"submit\" [class]=\"isEditCod ? 'ml-auto yellow-300 p-button-sm' : 'ml-auto p-button-sm'\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\n </div>\n</div>\n", styles: [".yellow-300{background-color:var(--yellow-500)!important;color:#fff}\n"] }]
|
|
5138
|
-
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: CalculateQuotesService }, { type: CodFormControls }, { type: CommercialService }, { type: BaseService }]; }, propDecorators: { isEditCod: [{
|
|
5161
|
+
args: [{ selector: 'app-cod-form-step-four', template: "<div *ngIf=\"isSemestral\" class=\"m-1 p-2 border-round-lg bg-blue-500 text-white\">\n <strong>Nota: </strong>\n El tipo de curso seleccionado fue semestral, por lo tanto el estudiante debe pagar matr\u00EDcula y primera cuota (M&M)\n</div>\n\n<form autocomplete=\"off\" [formGroup]=\"codFormStepFour\" class=\"grid mt-2\">\n\n <div class=\"col-12\">\n <ipt-select\n [initialValue]=\"codFormStepFour.controls['payment_method'].value\"\n [control]=\"codFormStepFour.controls['payment_method']\"\n (eventSelect)=\"selectPaymentMethod($event)\"\n [data]=\"paymentMethods\"\n [defaultText]=\"'M\u00E9todo de pago'\"\n [disabledSel]=\"isDisabledSel\"\n ></ipt-select>\n <ipt-loader *ngIf=\"feeResponse\"></ipt-loader>\n\n <div class=\"col-12\" *ngIf=\"thereArePlans\">\n <p-table\n [value]=\"dataPrices\"\n [tableStyle]=\"{'min-width': '100%'}\"\n [rowHover]=\"true\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex align-items-center\">\n Seleccion de niveles a cancelar.\n </div>\n </ng-template>\n <ng-template pTemplate=\"header\">\n <tr>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Cancelar</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Cuotas</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Admin</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-data>\n <tr>\n <td class=\"text-center\">{{ data.paid_level }} Nivel(es)</td>\n <td class=\"text-center\">{{ data.fee_number }}</td>\n <td class=\"pt-2 pb-2 text-center\">\n <button\n pButton\n pRipple\n icon=\"pi pi-money-bill\"\n class=\"p-button-sm p-button-rounded\"\n (click)=\"selectLevels(data)\"\n\n ></button>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n\n <!-- [initialValue]=\"codFormStepFour.controls['quota_times'].value\" -->\n <!-- <ipt-select *ngIf=\"isFinanced();\"\n [initialValue]=\"'1'\"\n [control]=\"codFormStepFour.controls['quota_times']\"\n (eventSelect)=\"selectQuotas($event)\"\n [defaultText]=\"'N\u00FAmero de cuotas'\"\n [data]=\"codPrices\"\n ></ipt-select> -->\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Monto total de la matr\u00EDcula'\"\n [control]=\"codFormStepFour.controls['total_price']\"\n [withPipe]=\"true\"\n ></ipt-input>\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n [withPipe]=\"true\"\n [inputType]=\"'text'\"\n [control]=\"codFormStepFour.controls['program_price']\"\n [placeHolder]=\"'Valor total del programa'\"\n ></ipt-input>\n </div>\n\n <div class=\"col-12\">\n <ipt-input\n onfocus=\"(this.type='date')\"\n [inputType]=\"'date'\"\n [control]=\"codFormStepFour.controls['payment_date']\"\n [placeHolder]=\"'Fecha de pago'\"\n ></ipt-input>\n </div>\n\n <!-- Tabla de financiaci\u00F3n -->\n <div *ngIf=\"isFinancing && isRenovation === false\" class=\"container_tablet\">\n <div class=\"col-12\" *ngIf=\"isFinancing\">\n <p-table\n [value]=\"dataFinancing\"\n [tableStyle]=\"{'min-width': '100%'}\"\n [rowHover]=\"true\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex align-items-center\">\n C\u00E1lculo de cuotas\n <button pButton class=\"p-button-sm ml-auto\" label=\"Nuevo c\u00E1lculo\" (click)=\"calculateNewQuotes()\" [disabled]=\"isDisabledSel\" lab icon=\"pi pi-replay\"></button>\n </div>\n </ng-template>\n <ng-template pTemplate=\"header\">\n <tr>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">#</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Valor</th>\n <th class=\"bg-blue-200 text-center font-medium pt-2 pb-2\">Fecha</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-data>\n <tr>\n <td class=\"p-0 text-center text-sm\">{{ data[0] }}</td>\n <td class=\"p-0 text-center text-sm\">{{ data[1] }}</td>\n <td class=\"p-0 text-center text-sm\">{{ data[2] }}</td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n </div>\n <!-- ---------------------- -->\n\n</form>\n\n<div class=\"flex mt-3 align-items-center gap-3\">\n <span *ngIf=\"codFormStepFour.invalid && codFormStepFour.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\n <div class=\"flex ml-auto gap-2\">\n <button *ngIf=\"codFormStepFour.controls['payment_method'].value === '1'\" [disabled]=\"isFinancing || codFormStepFour.controls['payment_method'].value !== '1'\"type=\"submit\" class=\"ml-auto p-button-sm p-button-secondary\" (click)=\"showTable()\" pButton label=\"Calcular cuotas\" icon=\"pi pi-sliders-h\"></button>\n <button [disabled]=\"!isFinancing && codFormStepFour.controls['payment_method'].value === '1'\" type=\"submit\" [class]=\"isEditCod ? 'ml-auto yellow-300 p-button-sm' : 'ml-auto p-button-sm'\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\n </div>\n</div>\n", styles: [".yellow-300{background-color:var(--yellow-500)!important;color:#fff}.container_tablet{width:-webkit-fill-available}\n"] }]
|
|
5162
|
+
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: CalculateQuotesService$1 }, { type: CodFormControls }, { type: CommercialService }, { type: BaseService }]; }, propDecorators: { isEditCod: [{
|
|
5139
5163
|
type: Input
|
|
5140
5164
|
}], initialData: [{
|
|
5141
5165
|
type: Input
|
|
@@ -7812,6 +7836,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
7812
7836
|
type: Input
|
|
7813
7837
|
}] } });
|
|
7814
7838
|
|
|
7839
|
+
class CalculateQuotesService {
|
|
7840
|
+
constructor() {
|
|
7841
|
+
this.monthsDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
7842
|
+
}
|
|
7843
|
+
calculateQuotes(params) {
|
|
7844
|
+
let dataFinancing = [];
|
|
7845
|
+
let index = 1; // Indicador de cant. de cuotas
|
|
7846
|
+
let dateJs = new Date(params.date);
|
|
7847
|
+
let isEndMonth = false;
|
|
7848
|
+
dateJs.setMilliseconds(dateJs.getMilliseconds() + (1000 * 3600 * 24));
|
|
7849
|
+
isEndMonth = this.monthsDays[dateJs.getMonth()] === dateJs.getDate();
|
|
7850
|
+
if (dateJs.getDay() === 0) {
|
|
7851
|
+
Swal.fire({
|
|
7852
|
+
title: 'Fecha inválida',
|
|
7853
|
+
text: 'Debe seleccionar un día de la semana diferente al domingo',
|
|
7854
|
+
icon: 'error'
|
|
7855
|
+
});
|
|
7856
|
+
}
|
|
7857
|
+
else {
|
|
7858
|
+
let enrollment = [
|
|
7859
|
+
index,
|
|
7860
|
+
Intl.NumberFormat('en-US', {
|
|
7861
|
+
style: 'currency',
|
|
7862
|
+
currency: 'USD',
|
|
7863
|
+
minimumFractionDigits: 0
|
|
7864
|
+
}).format(Math.round(parseFloat(params.totalPrice.toString()))),
|
|
7865
|
+
this.getStringDate(dateJs)
|
|
7866
|
+
];
|
|
7867
|
+
let quota = [
|
|
7868
|
+
index,
|
|
7869
|
+
Intl.NumberFormat('en-US', {
|
|
7870
|
+
style: 'currency',
|
|
7871
|
+
currency: 'USD',
|
|
7872
|
+
minimumFractionDigits: 0
|
|
7873
|
+
}).format(Math.round(parseFloat(params.quotaValues.toString()))),
|
|
7874
|
+
this.getStringDate(dateJs)
|
|
7875
|
+
];
|
|
7876
|
+
dataFinancing.push(enrollment);
|
|
7877
|
+
dataFinancing.push(quota);
|
|
7878
|
+
while (index < params.quotaTimes) {
|
|
7879
|
+
index = index + 1;
|
|
7880
|
+
let newJsDate = this.setPlusOneMonth(dateJs, isEndMonth);
|
|
7881
|
+
let row = [
|
|
7882
|
+
index,
|
|
7883
|
+
Intl.NumberFormat('en-US', {
|
|
7884
|
+
style: 'currency',
|
|
7885
|
+
currency: 'USD',
|
|
7886
|
+
minimumFractionDigits: 0
|
|
7887
|
+
}).format(Math.round(parseFloat(params.quotaValues.toString()))),
|
|
7888
|
+
this.getStringDate(newJsDate[newJsDate.length - 1])
|
|
7889
|
+
];
|
|
7890
|
+
dataFinancing.push(row);
|
|
7891
|
+
dateJs = newJsDate[0];
|
|
7892
|
+
}
|
|
7893
|
+
}
|
|
7894
|
+
return dataFinancing;
|
|
7895
|
+
}
|
|
7896
|
+
setPlusOneMonth(originDate, isEndMonth) {
|
|
7897
|
+
let response = [];
|
|
7898
|
+
let oneDayMilis = 1000 * 3600 * 24;
|
|
7899
|
+
let day = isEndMonth ? this.monthsDays[(originDate.getMonth() + 1) % 12] : originDate.getDate();
|
|
7900
|
+
let plusMonthDate = new Date(originDate.getFullYear(), originDate.getMonth() + 1, day);
|
|
7901
|
+
response.push(new Date(originDate.getFullYear(), originDate.getMonth() + 1, day));
|
|
7902
|
+
while (plusMonthDate.getDay() === 0) {
|
|
7903
|
+
plusMonthDate.setMilliseconds(originDate.getMilliseconds() - oneDayMilis);
|
|
7904
|
+
}
|
|
7905
|
+
response.push(plusMonthDate);
|
|
7906
|
+
return response;
|
|
7907
|
+
}
|
|
7908
|
+
// setPlusOneMonth2(originDate: Date, isEndMonth: boolean): Date[] {
|
|
7909
|
+
// let response: Date[] = [];
|
|
7910
|
+
// let oneDayMilis = 1000 * 3600 * 24;
|
|
7911
|
+
// let day = isEndMonth ? this.monthsDays[(originDate.getMonth() + 1) % 12] : originDate.getDate();
|
|
7912
|
+
// let plusMonthDate: Date = new Date(originDate.getFullYear(), originDate.getMonth() + 1, day);
|
|
7913
|
+
// while (plusMonthDate.getDay() === 0) {
|
|
7914
|
+
// plusMonthDate.setMilliseconds(plusMonthDate.getMilliseconds() - oneDayMilis);
|
|
7915
|
+
// }
|
|
7916
|
+
// response.push(plusMonthDate);
|
|
7917
|
+
// response.push(new Date(originDate.getFullYear(), originDate.getMonth() + 1, day + 1));
|
|
7918
|
+
// return response;
|
|
7919
|
+
// }
|
|
7920
|
+
getStringDate(originDate) {
|
|
7921
|
+
let month = originDate.getMonth() + 1;
|
|
7922
|
+
let stringMonth = month < 10 ? '0' + month : month;
|
|
7923
|
+
return originDate.getFullYear() + '-' + stringMonth + '-' + originDate.getDate();
|
|
7924
|
+
}
|
|
7925
|
+
}
|
|
7926
|
+
CalculateQuotesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CalculateQuotesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
7927
|
+
CalculateQuotesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CalculateQuotesService, providedIn: 'root' });
|
|
7928
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CalculateQuotesService, decorators: [{
|
|
7929
|
+
type: Injectable,
|
|
7930
|
+
args: [{
|
|
7931
|
+
providedIn: 'root'
|
|
7932
|
+
}]
|
|
7933
|
+
}], ctorParameters: function () { return []; } });
|
|
7934
|
+
|
|
7815
7935
|
class CodSelfFormStepThreeComponent extends CodSelfManagedSteps {
|
|
7816
7936
|
constructor(fb, messageService, commercialService, baseService, codFormControls, calculateQuotesService) {
|
|
7817
7937
|
super();
|
|
@@ -8807,5 +8927,5 @@ class AnnouncementUserRs {
|
|
|
8807
8927
|
* Generated bundle index. Do not edit.
|
|
8808
8928
|
*/
|
|
8809
8929
|
|
|
8810
|
-
export { AcademicService, ActivityService, AnnouncementService, AnnouncementUserRs, AsideButtonComponent, AttendanceService, BaseService, BudgetService, ButtonComponent, CalculateQuotesService, CalendarService, CardCourseComponent, CardSelectCourseComponent, CertificateService, CheckboxComponent, ClassroomService, CodDocumentsSectionComponent, CodFormComponent, CodFormControls, CodFormStepFiveComponent, CodFormStepFourComponent, CodFormStepOneComponent, CodFormStepThreeComponent, CodFormStepTwoComponent, CodFormSteps, CodModule, CodSelfFormStepFourComponent, CodSelfFormStepOneComponent, CodSelfFormStepThreeComponent, CodSelfFormStepTwoComponent, CodSelfManagedComponent, CodSelfManagedControls, CodSelfManagedSteps, CommercialService, CommunicatorService, ComponentsModule, CopiesService, CoreModule, CourseService, CreateUserFormComponent, DatalistComponent, DesignSystemModule, EpaycoService, IUnitNameClubRs, IUserEktRs, IUserFullDataRs, InputComponent, LevelButtonComponent, LevelTextComponent, LoaderComponent, LocalStorageCODService, LocalStorageCodSelfMaganedService, LoginFormComponent, MarketingService, NotesService, ParameterService, PlacementService, QuestionTypeComponent, RadioComponent, RedirectGuard, ScheduleFormatPipe, ScheduleTimeFormatPipe, SelectComponent, Session, SidenavComponent, StorageService, StudentService, SwitchService, TestService, TextLinkComponent, TypeLevelPipe, UserEktService, UserLoginRs, UserRs, UserService, codSelfManagedModule, validateCoupunts };
|
|
8930
|
+
export { AcademicService, ActivityService, AnnouncementService, AnnouncementUserRs, AsideButtonComponent, AttendanceService, BaseService, BudgetService, ButtonComponent, CalculateQuotesService$1 as CalculateQuotesService, CalendarService, CardCourseComponent, CardSelectCourseComponent, CertificateService, CheckboxComponent, ClassroomService, CodDocumentsSectionComponent, CodFormComponent, CodFormControls, CodFormStepFiveComponent, CodFormStepFourComponent, CodFormStepOneComponent, CodFormStepThreeComponent, CodFormStepTwoComponent, CodFormSteps, CodModule, CodSelfFormStepFourComponent, CodSelfFormStepOneComponent, CodSelfFormStepThreeComponent, CodSelfFormStepTwoComponent, CodSelfManagedComponent, CodSelfManagedControls, CodSelfManagedSteps, CommercialService, CommunicatorService, ComponentsModule, CopiesService, CoreModule, CourseService, CreateUserFormComponent, DatalistComponent, DesignSystemModule, EpaycoService, IUnitNameClubRs, IUserEktRs, IUserFullDataRs, InputComponent, LevelButtonComponent, LevelTextComponent, LoaderComponent, LocalStorageCODService, LocalStorageCodSelfMaganedService, LoginFormComponent, MarketingService, NotesService, ParameterService, PlacementService, QuestionTypeComponent, RadioComponent, RedirectGuard, ScheduleFormatPipe, ScheduleTimeFormatPipe, SelectComponent, Session, SidenavComponent, StorageService, StudentService, SwitchService, TestService, TextLinkComponent, TypeLevelPipe, UserEktService, UserLoginRs, UserRs, UserService, codSelfManagedModule, validateCoupunts };
|
|
8811
8931
|
//# sourceMappingURL=iptdevs-design-system.mjs.map
|