diff --git a/Common-UI b/Common-UI index da84760..c99b568 160000 --- a/Common-UI +++ b/Common-UI @@ -1 +1 @@ -Subproject commit da84760d7329386161a21aff07a3377c568a2eeb +Subproject commit c99b56866ce4068bfe3298a07fc11f386d7c11d0 diff --git a/src/app/app-modules/core/components/batch-adjustment/batch-adjustment.component.ts b/src/app/app-modules/core/components/batch-adjustment/batch-adjustment.component.ts index 4c65e19..e11a2e6 100644 --- a/src/app/app-modules/core/components/batch-adjustment/batch-adjustment.component.ts +++ b/src/app/app-modules/core/components/batch-adjustment/batch-adjustment.component.ts @@ -117,10 +117,21 @@ export class BatchAdjustmentComponent implements OnInit, DoCheck { selectBatch(event: any, batch: any) { if (event.checked) { batch.selected = true; - this.selectedBatchList.push(batch); + // Guard against adding the same batch twice (same no-dedup bug as #9): + // a repeated checked event would otherwise push a duplicate row. + const exists = this.selectedBatchList.some( + (b: any) => b.itemStockEntryID === batch.itemStockEntryID, + ); + if (!exists) { + this.selectedBatchList.push(batch); + } } else { - const index = this.selectedBatchList.indexOf(batch); - this.selectedBatchList.splice(index, 1); + const index = this.selectedBatchList.findIndex( + (b: any) => b.itemStockEntryID === batch.itemStockEntryID, + ); + if (index > -1) { + this.selectedBatchList.splice(index, 1); + } batch.selected = false; } } diff --git a/src/app/app-modules/core/components/common-dialog/common-dialog.component.html b/src/app/app-modules/core/components/common-dialog/common-dialog.component.html index d0883bb..713c807 100644 --- a/src/app/app-modules/core/components/common-dialog/common-dialog.component.html +++ b/src/app/app-modules/core/components/common-dialog/common-dialog.component.html @@ -36,7 +36,7 @@

{{ message }}

@@ -56,7 +56,7 @@ dialogHeader; context: { status: status, - text: (status === 'warn' ? 'warning' : status) | titlecase, + text: alertHeading, } " > @@ -68,7 +68,7 @@ (click)="dialogRef.close()" cdkFocusInitial > - {{ btnOkText }} + {{ btnOkText || currentLanguageSet?.common?.ok || 'Ok' }} @@ -88,14 +88,14 @@ />
@@ -117,14 +117,14 @@ >
@@ -152,14 +152,14 @@
@@ -185,7 +185,7 @@ (click)="dialogRef.close(true)" cdkFocusInitial > - {{ btnOkText }} + {{ btnOkText || currentLanguageSet?.common?.ok || 'Ok' }} @@ -202,7 +202,7 @@
@@ -231,7 +231,7 @@

diff --git a/src/app/app-modules/core/components/common-dialog/common-dialog.component.ts b/src/app/app-modules/core/components/common-dialog/common-dialog.component.ts index ba88581..9c11bb8 100644 --- a/src/app/app-modules/core/components/common-dialog/common-dialog.component.ts +++ b/src/app/app-modules/core/components/common-dialog/common-dialog.component.ts @@ -162,4 +162,28 @@ export class CommonDialogComponent implements OnInit { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } // -----End------ + + /** + * Localized heading for the alert dialog. The status word (info/success/ + * warning/error) used to be shown raw via the titlecase pipe, so the heading + * was always English regardless of the selected language. Read it from the + * language set, falling back to the English label when a translation is + * missing. + */ + get alertHeading(): string { + const status = (this.status || 'info').toLowerCase(); + const key = + status === 'warn' ? 'warning' : status === 'fail' ? 'error' : status; + const translated = this.currentLanguageSet?.alerts?.[key]; + if (translated) { + return translated; + } + const fallback: { [k: string]: string } = { + info: 'Info', + success: 'Success', + warning: 'Warning', + error: 'Error', + }; + return fallback[key] || key.charAt(0).toUpperCase() + key.slice(1); + } } diff --git a/src/app/app-modules/core/services/confirmation.service.ts b/src/app/app-modules/core/services/confirmation.service.ts index 59d3a74..a11afb0 100644 --- a/src/app/app-modules/core/services/confirmation.service.ts +++ b/src/app/app-modules/core/services/confirmation.service.ts @@ -53,8 +53,8 @@ export class ConfirmationService { public confirm( title: string, message: string, - btnOkText = 'OK', - btnCancelText = 'Cancel', + btnOkText?: string, + btnCancelText?: string, ): Observable { const dialogRef = this.createDialog('420px', true); const instance = dialogRef.componentInstance!; @@ -70,7 +70,7 @@ export class ConfirmationService { public alert( message: string, status = 'info', - btnOkText = 'OK', + btnOkText?: string, ): ZardDialogRef { // Non-mask-closable: an alert should stay until the user clicks OK. When it // was mask-closable, a programmatic click elsewhere (e.g. the report's @@ -89,7 +89,7 @@ export class ConfirmationService { titleAlign = 'center', messageAlign = 'center', btnOkText = 'Submit', - btnCancelText = 'Cancel', + btnCancelText?: string, ): Observable { const dialogRef = this.createDialog('420px', true); const instance = dialogRef.componentInstance!; @@ -107,7 +107,7 @@ export class ConfirmationService { titleAlign = 'center', messageAlign = 'center', btnOkText = 'Submit', - btnCancelText = 'Cancel', + btnCancelText?: string, ): Observable { const dialogRef = this.createDialog('60%', true); const instance = dialogRef.componentInstance!; @@ -125,7 +125,7 @@ export class ConfirmationService { mandatories: any, titleAlign = 'center', messageAlign = 'center', - btnOkText = 'OK', + btnOkText?: string, ): Observable { const dialogRef = this.createDialog('420px', true); const instance = dialogRef.componentInstance!; @@ -142,7 +142,7 @@ export class ConfirmationService { titleAlign = 'center', messageAlign = 'center', btnOkText = 'Confirm', - btnCancelText = 'Cancel', + btnCancelText?: string, ): Observable { const dialogRef = this.createDialog('420px', true); const instance = dialogRef.componentInstance!; @@ -160,7 +160,7 @@ export class ConfirmationService { message: string, timer: number, btnOkText = 'Continue', - btnCancelText = 'Cancel', + btnCancelText?: string, ): Observable { const dialogRef = this.createDialog('420px', false); const instance = dialogRef.componentInstance!; @@ -180,7 +180,7 @@ export class ConfirmationService { titleAlign = 'center', messageAlign = 'center', btnOkText = 'Confirm', - btnCancelText = 'Cancel', + btnCancelText?: string, ): Observable { const dialogRef = this.createDialog('60%', true); const instance = dialogRef.componentInstance!; diff --git a/src/app/app-modules/inventory/indent/indent-order-worklist/main-store-indent-order-worklist/main-store-item-model/main-store-item-model.component.html b/src/app/app-modules/inventory/indent/indent-order-worklist/main-store-indent-order-worklist/main-store-item-model/main-store-item-model.component.html index 9e7925a..d4d947a 100644 --- a/src/app/app-modules/inventory/indent/indent-order-worklist/main-store-indent-order-worklist/main-store-item-model/main-store-item-model.component.html +++ b/src/app/app-modules/inventory/indent/indent-order-worklist/main-store-indent-order-worklist/main-store-item-model/main-store-item-model.component.html @@ -2,7 +2,7 @@ class="flex items-center justify-between gap-2 border-b border-border px-6 py-4" >

- ItemList Details + {{ currentLanguageSet?.inventory?.itemListDetails || "ItemList Details" }}