brainloper-ui 20.1.1 → 20.1.3

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.
@@ -810,6 +810,9 @@ class CombosComponent {
810
810
  });
811
811
  }
812
812
  this.control.setValue(this.configuration.selected);
813
+ if (this.disabled) {
814
+ this.control.disable();
815
+ }
813
816
  //console.log(this.configuration)
814
817
  }
815
818
  ngOnChanges(changes) {
@@ -817,6 +820,9 @@ class CombosComponent {
817
820
  this.dataCombos = changes['dataCombos'].currentValue;
818
821
  this.filteredList = this.dataCombos.slice();
819
822
  }
823
+ if (changes?.['disabled']) {
824
+ changes['disabled'].currentValue ? this.control.disable() : this.control.enable();
825
+ }
820
826
  if (this.control && this.control.value) {
821
827
  this.configuration.selected = this.control.value;
822
828
  }
@@ -904,11 +910,11 @@ class CombosComponent {
904
910
  }
905
911
  }
906
912
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CombosComponent, deps: [{ token: HttpService }], target: i0.ɵɵFactoryTarget.Component });
907
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: CombosComponent, isStandalone: false, selector: "combos", inputs: { dataCombos: "dataCombos", additionalData: "additionalData", configuration: "configuration", filter: "filter", checkbox: "checkbox", required: "required", disabled: "disabled", addFinal: "addFinal", appearance: "appearance", reloadCombo: "reloadCombo", control: "control" }, outputs: { changeOption: "changeOption", changeOptionDataComplete: "changeOptionDataComplete", returnDataCombo: "returnDataCombo" }, viewQueries: [{ propertyName: "tooltip", first: true, predicate: ["tooltip"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div style=\"display: flex; flex-direction: row; justify-content: space-between\">\n <div class=\"combo-container\">\n\n @if (tooltipDescription) {\n <mat-icon\n class=\"m-1 icon-information\"\n matTooltip=\"{{tooltipDescription}}\"\n matTooltipPosition=\"above\"\n #tooltip=\"matTooltip\"\n (click)=\"toggleTooltip()\"\n matTooltipClass=\"custom-tooltip\"\n >info</mat-icon>\n }\n\n <mat-form-field style=\"width: 100%\" [appearance]=\"appearance\">\n <mat-label style=\"text-transform: capitalize\">{{\n configuration.label\n }}</mat-label>\n <mat-select [multiple]=\"checkbox\" (selectionChange)=\"selectedData(control)\" [required]=\"required\"\n [formControl]=\"$any(control)\" [disabled]=\"disabled\">\n @if (filter) {\n <app-select-filter [noResultsMessage]=\"'No hay resultados'\" [placeholder]=\"'Filter'\" [displayMember]=\"configuration.visibleField\"\n [array]=\"dataCombos\" (filteredReturn)=\"filteredList = $event\">\n </app-select-filter>\n }\n @for (data of filteredList; track data) {\n <mat-option [value]=\"data[configuration.selectionField]\">\n {{ data[configuration.visibleField] }}\n </mat-option>\n }\n </mat-select>\n @if (required) {\n <mat-error>Campo requerido</mat-error>\n }\n </mat-form-field>\n </div>\n</div>\n\n", styles: [".mat-mdc-form-field{width:100%}.combo-container{width:100%;display:flex;align-items:center}.icon-information{cursor:pointer;color:gray}.mat-icon{font-size:1.1rem}::ng-deep .custom-tooltip{background-color:#fbe870!important;color:#000!important;line-height:17px!important;font-size:.8rem}@media (max-width: 400px){combo-container{width:100%;justify-content:center;padding-left:8px;padding-right:8px}.mat-mdc-form-field{width:100%!important;min-width:120px;max-width:100vw;font-size:14px}.mat-mdc-select{font-size:14px}}\n"], dependencies: [{ kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i6.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i8.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: SelectFilterComponent, selector: "app-select-filter", inputs: ["array", "placeholder", "color", "displayMember", "showSpinner", "noResultsMessage", "hasGroup", "groupArrayName"], outputs: ["filteredReturn"] }] });
913
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: CombosComponent, isStandalone: false, selector: "combos", inputs: { dataCombos: "dataCombos", additionalData: "additionalData", configuration: "configuration", filter: "filter", checkbox: "checkbox", required: "required", disabled: "disabled", addFinal: "addFinal", appearance: "appearance", reloadCombo: "reloadCombo", control: "control" }, outputs: { changeOption: "changeOption", changeOptionDataComplete: "changeOptionDataComplete", returnDataCombo: "returnDataCombo" }, viewQueries: [{ propertyName: "tooltip", first: true, predicate: ["tooltip"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div style=\"display: flex; flex-direction: row; justify-content: space-between\">\n <div class=\"combo-container\">\n\n @if (tooltipDescription) {\n <mat-icon\n class=\"m-1 icon-information\"\n matTooltip=\"{{tooltipDescription}}\"\n matTooltipPosition=\"above\"\n #tooltip=\"matTooltip\"\n (click)=\"toggleTooltip()\"\n matTooltipClass=\"custom-tooltip\"\n >info</mat-icon>\n }\n\n <mat-form-field style=\"width: 100%\" [appearance]=\"appearance\">\n <mat-label style=\"text-transform: capitalize\">{{\n configuration.label\n }}</mat-label>\n <mat-select [multiple]=\"checkbox\" (selectionChange)=\"selectedData(control)\" [required]=\"required\"\n [formControl]=\"$any(control)\">\n @if (filter) {\n <app-select-filter [noResultsMessage]=\"'No hay resultados'\" [placeholder]=\"'Filter'\" [displayMember]=\"configuration.visibleField\"\n [array]=\"dataCombos\" (filteredReturn)=\"filteredList = $event\">\n </app-select-filter>\n }\n @for (data of filteredList; track data) {\n <mat-option [value]=\"data[configuration.selectionField]\">\n {{ data[configuration.visibleField] }}\n </mat-option>\n }\n </mat-select>\n @if (required) {\n <mat-error>Campo requerido</mat-error>\n }\n </mat-form-field>\n </div>\n</div>\n\n", styles: [".mat-mdc-form-field{width:100%}.combo-container{width:100%;display:flex;align-items:center}.icon-information{cursor:pointer;color:gray}.mat-icon{font-size:1.1rem}::ng-deep .custom-tooltip{background-color:#fbe870!important;color:#000!important;line-height:17px!important;font-size:.8rem}@media (max-width: 400px){combo-container{width:100%;justify-content:center;padding-left:8px;padding-right:8px}.mat-mdc-form-field{width:100%!important;min-width:120px;max-width:100vw;font-size:14px}.mat-mdc-select{font-size:14px}}\n"], dependencies: [{ kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i6.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i8.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: SelectFilterComponent, selector: "app-select-filter", inputs: ["array", "placeholder", "color", "displayMember", "showSpinner", "noResultsMessage", "hasGroup", "groupArrayName"], outputs: ["filteredReturn"] }] });
908
914
  }
909
915
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CombosComponent, decorators: [{
910
916
  type: Component,
911
- args: [{ selector: 'combos', standalone: false, template: "<div style=\"display: flex; flex-direction: row; justify-content: space-between\">\n <div class=\"combo-container\">\n\n @if (tooltipDescription) {\n <mat-icon\n class=\"m-1 icon-information\"\n matTooltip=\"{{tooltipDescription}}\"\n matTooltipPosition=\"above\"\n #tooltip=\"matTooltip\"\n (click)=\"toggleTooltip()\"\n matTooltipClass=\"custom-tooltip\"\n >info</mat-icon>\n }\n\n <mat-form-field style=\"width: 100%\" [appearance]=\"appearance\">\n <mat-label style=\"text-transform: capitalize\">{{\n configuration.label\n }}</mat-label>\n <mat-select [multiple]=\"checkbox\" (selectionChange)=\"selectedData(control)\" [required]=\"required\"\n [formControl]=\"$any(control)\" [disabled]=\"disabled\">\n @if (filter) {\n <app-select-filter [noResultsMessage]=\"'No hay resultados'\" [placeholder]=\"'Filter'\" [displayMember]=\"configuration.visibleField\"\n [array]=\"dataCombos\" (filteredReturn)=\"filteredList = $event\">\n </app-select-filter>\n }\n @for (data of filteredList; track data) {\n <mat-option [value]=\"data[configuration.selectionField]\">\n {{ data[configuration.visibleField] }}\n </mat-option>\n }\n </mat-select>\n @if (required) {\n <mat-error>Campo requerido</mat-error>\n }\n </mat-form-field>\n </div>\n</div>\n\n", styles: [".mat-mdc-form-field{width:100%}.combo-container{width:100%;display:flex;align-items:center}.icon-information{cursor:pointer;color:gray}.mat-icon{font-size:1.1rem}::ng-deep .custom-tooltip{background-color:#fbe870!important;color:#000!important;line-height:17px!important;font-size:.8rem}@media (max-width: 400px){combo-container{width:100%;justify-content:center;padding-left:8px;padding-right:8px}.mat-mdc-form-field{width:100%!important;min-width:120px;max-width:100vw;font-size:14px}.mat-mdc-select{font-size:14px}}\n"] }]
917
+ args: [{ selector: 'combos', standalone: false, template: "<div style=\"display: flex; flex-direction: row; justify-content: space-between\">\n <div class=\"combo-container\">\n\n @if (tooltipDescription) {\n <mat-icon\n class=\"m-1 icon-information\"\n matTooltip=\"{{tooltipDescription}}\"\n matTooltipPosition=\"above\"\n #tooltip=\"matTooltip\"\n (click)=\"toggleTooltip()\"\n matTooltipClass=\"custom-tooltip\"\n >info</mat-icon>\n }\n\n <mat-form-field style=\"width: 100%\" [appearance]=\"appearance\">\n <mat-label style=\"text-transform: capitalize\">{{\n configuration.label\n }}</mat-label>\n <mat-select [multiple]=\"checkbox\" (selectionChange)=\"selectedData(control)\" [required]=\"required\"\n [formControl]=\"$any(control)\">\n @if (filter) {\n <app-select-filter [noResultsMessage]=\"'No hay resultados'\" [placeholder]=\"'Filter'\" [displayMember]=\"configuration.visibleField\"\n [array]=\"dataCombos\" (filteredReturn)=\"filteredList = $event\">\n </app-select-filter>\n }\n @for (data of filteredList; track data) {\n <mat-option [value]=\"data[configuration.selectionField]\">\n {{ data[configuration.visibleField] }}\n </mat-option>\n }\n </mat-select>\n @if (required) {\n <mat-error>Campo requerido</mat-error>\n }\n </mat-form-field>\n </div>\n</div>\n\n", styles: [".mat-mdc-form-field{width:100%}.combo-container{width:100%;display:flex;align-items:center}.icon-information{cursor:pointer;color:gray}.mat-icon{font-size:1.1rem}::ng-deep .custom-tooltip{background-color:#fbe870!important;color:#000!important;line-height:17px!important;font-size:.8rem}@media (max-width: 400px){combo-container{width:100%;justify-content:center;padding-left:8px;padding-right:8px}.mat-mdc-form-field{width:100%!important;min-width:120px;max-width:100vw;font-size:14px}.mat-mdc-select{font-size:14px}}\n"] }]
912
918
  }], ctorParameters: () => [{ type: HttpService }], propDecorators: { dataCombos: [{
913
919
  type: Input
914
920
  }], additionalData: [{
@@ -3781,6 +3787,9 @@ class PurchaseOrderPdfService {
3781
3787
  currentY += 20;
3782
3788
  // === ITEMS DE LA ORDEN ===
3783
3789
  currentY = this.addOrderItems(doc, order, currentY, margin, pageWidth);
3790
+ currentY += 10;
3791
+ // === TOTAL ===
3792
+ currentY = this.addTotal(doc, order, currentY, margin, pageWidth);
3784
3793
  currentY += 20;
3785
3794
  // === COMENTARIOS ===
3786
3795
  if (order.comment) {
@@ -3880,13 +3889,15 @@ class PurchaseOrderPdfService {
3880
3889
  return doc.lastAutoTable.finalY;
3881
3890
  }
3882
3891
  addOrderItems(doc, order, y, margin, pageWidth) {
3883
- const head = [['Código', 'Nombre', 'U.M.', 'Cant.', 'Descripción']];
3884
- const body = order.items.map(item => [
3892
+ const head = [['#', 'Código', 'Nombre', 'U.M.', 'Cant.', 'V. Unitario', 'V. Total']];
3893
+ const body = order.items.map((item, index) => [
3894
+ index + 1,
3885
3895
  item.code,
3886
3896
  item.itemName,
3887
3897
  item.unitMeasurement,
3888
3898
  item.amount,
3889
- item.description || ''
3899
+ this.functions.formatNumber(item.costItem),
3900
+ this.functions.formatNumber(item.totalCostItems)
3890
3901
  ]);
3891
3902
  autoTable(doc, {
3892
3903
  startY: y,
@@ -3895,14 +3906,31 @@ class PurchaseOrderPdfService {
3895
3906
  theme: 'grid',
3896
3907
  headStyles: { fillColor: [220, 220, 220], textColor: 0, fontStyle: 'bold' },
3897
3908
  columnStyles: {
3898
- 3: { halign: 'right' },
3899
- 4: { halign: 'right' },
3900
- 5: { halign: 'right' }
3909
+ 0: { halign: 'center', cellWidth: 30 }, // #
3910
+ 4: { halign: 'right' }, // Cant.
3911
+ 5: { halign: 'right' }, // V. Unitario
3912
+ 6: { halign: 'right' }, // V. Total
3901
3913
  }
3902
3914
  });
3903
3915
  let finalY = doc.lastAutoTable.finalY;
3904
3916
  return finalY;
3905
3917
  }
3918
+ addTotal(doc, order, y, margin, pageWidth) {
3919
+ const totalLabel = 'TOTAL ORDEN:';
3920
+ const totalValue = this.functions.formatNumber(order.totalCost);
3921
+ doc.setFontSize(10);
3922
+ doc.setFont('helvetica', 'bold');
3923
+ // Alineado a la derecha, cerca de la columna de V. Total
3924
+ const labelX = pageWidth - margin - 150;
3925
+ const valueX = pageWidth - margin;
3926
+ doc.text(totalLabel, labelX, y);
3927
+ doc.text(totalValue, valueX, y, { align: 'right' });
3928
+ // Línea decorativa bajo el total
3929
+ doc.setDrawColor(0);
3930
+ doc.setLineWidth(1);
3931
+ doc.line(labelX - 5, y + 4, pageWidth - margin, y + 4);
3932
+ return y + 15;
3933
+ }
3906
3934
  addComments(doc, order, y, margin, pageWidth) {
3907
3935
  doc.setFontSize(10);
3908
3936
  doc.setFont('helvetica', 'bold');