feat(web): formulario de documentos de ventas y compras (cargar, crear, actualizar con If-Match, navegar)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
51982fd3ab
commit
d900a96740
9 files changed
+621
-11
No files matched your search
@@ -0,0 +1,95 @@
|
||||
<sbo-toolbar aria-label="Acciones del documento">
|
||||
<a class="tb" routerLink=".." title="Volver a la lista"><sbo-icon name="find" />Lista</a>
|
||||
<a class="tb" [routerLink]="isNew() ? '.' : '../nuevo'" title="Documento nuevo"><sbo-icon name="new" />Nuevo</a>
|
||||
<span class="tb-sep"></span>
|
||||
<button class="tb" type="button" aria-label="Primero" (click)="go('first')"><sbo-icon name="first" /></button>
|
||||
<button class="tb" type="button" aria-label="Anterior" (click)="go('prev')"><sbo-icon name="prev" /></button>
|
||||
<button class="tb" type="button" aria-label="Siguiente" (click)="go('next')"><sbo-icon name="next" /></button>
|
||||
<button class="tb" type="button" aria-label="Último" (click)="go('last')"><sbo-icon name="last" /></button>
|
||||
</sbo-toolbar>
|
||||
|
||||
<sbo-window [title]="windowTitle()" [badge]="badge()" [status]="status()">
|
||||
@if (partner) {
|
||||
<div class="sbo-hdr">
|
||||
<div class="sbo-col">
|
||||
<sbo-lookup-field
|
||||
[label]="partner.label"
|
||||
required
|
||||
[readonly]="readOnly() || !isNew()"
|
||||
[value]="str(header()['CardCode'])"
|
||||
(valueChange)="setHeader('CardCode', $event)"
|
||||
[lookup]="partnerLookup"
|
||||
(picked)="onPartner($event)"
|
||||
/>
|
||||
<sbo-text-field label="Nombre" readonly [value]="partnerName()" />
|
||||
<sbo-text-field
|
||||
label="Nº referencia"
|
||||
[readonly]="readOnly()"
|
||||
[value]="str(header()['NumAtCard'])"
|
||||
(valueChange)="setHeader('NumAtCard', $event)"
|
||||
/>
|
||||
</div>
|
||||
<div class="sbo-col">
|
||||
<sbo-text-field label="Número" readonly [value]="str(doc()?.['DocNum'])" />
|
||||
<sbo-date-field
|
||||
label="Fecha de contabilización"
|
||||
required
|
||||
[readonly]="readOnly()"
|
||||
[value]="str(header()['DocDate'])"
|
||||
(valueChange)="setHeader('DocDate', $event)"
|
||||
/>
|
||||
<sbo-date-field
|
||||
label="Fecha de vencimiento"
|
||||
[readonly]="readOnly()"
|
||||
[value]="str(header()['DocDueDate'])"
|
||||
(valueChange)="setHeader('DocDueDate', $event)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<sbo-lines-grid
|
||||
[columns]="columns"
|
||||
[lines]="lines()"
|
||||
(linesChange)="setLines($event)"
|
||||
[readonly]="readOnly()"
|
||||
[newLine]="newLine"
|
||||
[recalc]="recalc"
|
||||
[multiAdd]="multi"
|
||||
/>
|
||||
|
||||
<div class="sbo-hdr" style="margin-top: 14px">
|
||||
<div class="sbo-col">
|
||||
<sbo-textarea-field
|
||||
label="Comentarios"
|
||||
[readonly]="readOnly()"
|
||||
[value]="str(header()['Comments'])"
|
||||
(valueChange)="setHeader('Comments', $event)"
|
||||
/>
|
||||
</div>
|
||||
<div class="sbo-col">
|
||||
<sbo-text-field label="Total antes del descuento" readonly [value]="fmt(totals().subtotal)" />
|
||||
<sbo-number-field
|
||||
label="Descuento %"
|
||||
[decimals]="2"
|
||||
[readonly]="readOnly()"
|
||||
[value]="+str(header()['DiscountPercent'])"
|
||||
(valueChange)="setHeader('DiscountPercent', $event ?? 0)"
|
||||
/>
|
||||
<sbo-text-field label="Impuesto" readonly [value]="fmt(totals().tax)" />
|
||||
<sbo-text-field label="Total del documento" readonly [value]="fmt(totals().total)" />
|
||||
</div>
|
||||
</div>
|
||||
} @else {
|
||||
<p>El formulario de este documento aún no está disponible. <a routerLink="..">Volver a la lista</a></p>
|
||||
}
|
||||
|
||||
@if (partner && !readOnly()) {
|
||||
<button sboActions class="btn main" type="button" [disabled]="saving() || loading()" (click)="save()">
|
||||
{{ isNew() ? 'Crear' : 'Actualizar' }}
|
||||
</button>
|
||||
}
|
||||
@if (conflict()) {
|
||||
<button sboActions class="btn" type="button" (click)="reload()">Recargar</button>
|
||||
}
|
||||
<a sboActions class="btn" routerLink="..">{{ readOnly() ? 'Cerrar' : 'Cancelar' }}</a>
|
||||
</sbo-window>
|
||||
Reference in new issue
Block a user