feat(web): Indicador, prefijo y número del folio juntos en una fila (documentos de facturación y asiento) y las tres fechas de la cabecera en orden
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1bb8efa77e
commit
a74c19a139
11 files changed
+170
-19
No files matched your search
@@ -26,8 +26,11 @@
|
||||
</div>
|
||||
<div class="sbo-hdr">
|
||||
<div class="sbo-col">
|
||||
<sbo-lookup-field label="Indicador" [lookup]="indicatorLookup" [value]="indicator()" (valueChange)="indicator.set($event)" [readonly]="saved()" />
|
||||
<sbo-field label="Folio">
|
||||
<sbo-field label="Indicador / Folio">
|
||||
<sbo-input width="80px" ariaLabel="Indicador" [readonly]="saved()" [value]="indicator()" (valueChange)="indicator.set($event)" />
|
||||
@if (!saved()) {
|
||||
<button type="button" class="sbo-btn" aria-label="Abrir la lista de indicadores" title="Lista de valores" (click)="indicatorOpen.set(true)">…</button>
|
||||
}
|
||||
<sbo-input width="90px" [maxlength]="10" ariaLabel="Prefijo del folio" [readonly]="saved()" [value]="folioPrefix()" (valueChange)="set('folioPrefix', $event)" />
|
||||
<sbo-input ariaLabel="Número de folio" [readonly]="saved()" [value]="folioNumber()" (valueChange)="set('folioNumber', $event)" />
|
||||
</sbo-field>
|
||||
@@ -76,3 +79,15 @@
|
||||
}
|
||||
<a sboActions class="btn" routerLink="..">{{ saved() ? 'Cerrar' : 'Descartar' }}</a>
|
||||
</sbo-window>
|
||||
|
||||
@if (indicatorOpen()) {
|
||||
<sbo-value-help
|
||||
[open]="true"
|
||||
[title]="indicatorLookup.title"
|
||||
[resource]="indicatorLookup.resource"
|
||||
[columns]="indicatorLookup.columns"
|
||||
[orderby]="indicatorLookup.orderby"
|
||||
(selected)="indicatorPicked($event)"
|
||||
(closed)="indicatorOpen.set(false)"
|
||||
/>
|
||||
}
|
||||
@@ -7,7 +7,9 @@ import { firstValueFrom, map } from 'rxjs';
|
||||
import { API_URL, apiErrorMessage } from '../../core/api';
|
||||
import { formatDate, formatNumber, todayIso } from '../../core/format';
|
||||
import { SlDocumentApi } from '../../core/sl/sl-document';
|
||||
import { DateField, LookupField, SboField, SelectField, TextField, TextInput } from '../../shared/form';
|
||||
import { DateField, SboField, SelectField, TextField, TextInput } from '../../shared/form';
|
||||
import type { ListRow } from '../../shared/list/list.types';
|
||||
import { ValueHelp } from '../../shared/value-help/value-help';
|
||||
import type { DetailColumn } from '../../shared/grid/grid.types';
|
||||
import { RowsTable } from '../../shared/grid/rows-table';
|
||||
import { Icon, SboWindow, Toolbar, type StatusMessage, type WindowBadge } from '../../shared/window';
|
||||
@@ -57,7 +59,7 @@ const dateOnly = (v: unknown): string => (typeof v === 'string' ? v.slice(0, 10)
|
||||
@Component({
|
||||
selector: 'sbo-journal-form-page',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [DateField, Icon, LookupField, RouterLink, RowsTable, SboField, SboWindow, SelectField, TextField, TextInput, Toolbar],
|
||||
imports: [DateField, Icon, RouterLink, RowsTable, SboField, SboWindow, SelectField, TextField, TextInput, Toolbar, ValueHelp],
|
||||
templateUrl: './journal-form.page.html',
|
||||
styleUrl: './journal-form.page.css',
|
||||
})
|
||||
@@ -103,6 +105,13 @@ export class JournalFormPage {
|
||||
protected readonly folioPrefix = linkedSignal(() => text(this.doc()?.['FolioPrefixString']));
|
||||
protected readonly folioNumber = linkedSignal(() => text(this.doc()?.['FolioNumber']));
|
||||
protected readonly indicatorLookup = INDICATOR_LOOKUP;
|
||||
protected readonly indicatorOpen = signal(false);
|
||||
|
||||
protected indicatorPicked(rows: ListRow[]): void {
|
||||
const row = rows[0];
|
||||
if (row) this.indicator.set(String(row['IndicatorCode'] ?? ''));
|
||||
this.indicatorOpen.set(false);
|
||||
}
|
||||
protected readonly lines = linkedSignal<Row[]>(() => {
|
||||
const rows = ((this.doc()?.['JournalEntryLines'] as Row[] | undefined) ?? []).map((l) => ({ ...l }));
|
||||
return this.doc() ? rows : [{ DueDate: today() }, { DueDate: today() }];
|
||||
|
||||
Reference in new issue
Block a user