feat(web): resolver al salir del campo el socio y los códigos de línea escritos a mano

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
GeorgeandClaude Sonnet 5.5 committed 2026-10-14 11:42:51 -05:00
1 parent 4b35aa6bfd
commit cafe4bc035
9 files changed
+232 -4

No files matched your search

@@ -17,8 +17,9 @@
required
[readonly]="readOnly() || !isNew()"
[value]="str(header()['CardCode'])"
(valueChange)="setHeader('CardCode', $event)"
(valueChange)="onPartnerText($event)"
[lookup]="partnerLookup"
resolveOnLeave
(picked)="onPartner($event)"
/>
<sbo-text-field label="Nombre" readonly [value]="partnerName()" />
@@ -51,6 +52,7 @@
[columns]="columns"
[lines]="lines()"
(linesChange)="setLines($event)"
(notice)="notify($event)"
[readonly]="readOnly()"
[newLine]="newLine"
[recalc]="recalc"
@@ -173,6 +173,17 @@ export class DocumentFormPage {
this.message.set(null);
}
/** Al escribir otro código el nombre anterior ya no vale; se completa al salir del campo o al elegir de la lista. */
protected onPartnerText(code: string): void {
if (code === text(this.header()['CardCode'])) return;
this.setHeader('CardCode', code);
this.partnerName.set('');
}
protected notify(textMessage: string): void {
this.message.set({ kind: 'warn', text: textMessage });
}
protected onPartner(row: Record<string, unknown>): void {
this.partnerName.set(text(row['CardName']));
}