From 908a6d28ff1076cae544c2e069d5ef4afe5433d6 Mon Sep 17 00:00:00 2001 From: Mohaimen Hasan Date: Sun, 29 Nov 2026 10:06:33 +0600 Subject: [PATCH] Done --- .../src/app/_services/payroll/lfa.service.ts | 7 +++++++ .../reports/report-viewer/report-viewer.component.ts | 11 +++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/HRM.UI/ClientApp/src/app/_services/payroll/lfa.service.ts b/HRM.UI/ClientApp/src/app/_services/payroll/lfa.service.ts index e8179ea..085abf5 100644 --- a/HRM.UI/ClientApp/src/app/_services/payroll/lfa.service.ts +++ b/HRM.UI/ClientApp/src/app/_services/payroll/lfa.service.ts @@ -62,6 +62,13 @@ export class LFAService { return this.apiService.httpPost('/lfa/undoPayment', request); } + // ── LFA Bank Advice (report viewer, /payroll-lfa/lfa-bank-advice) ── + + /** The approved batches of the payroll type. */ + getBankAdviceBatches(): Observable { + return this.apiService.httpGet('/lfa/getBankAdviceBatches'); + } + // ── LFA Payment Approval (as Salary Approve) ── getApprovalInfo(): Observable { diff --git a/HRM.UI/ClientApp/src/app/reports/report-viewer/report-viewer.component.ts b/HRM.UI/ClientApp/src/app/reports/report-viewer/report-viewer.component.ts index 4f8e4fa..00e68b1 100644 --- a/HRM.UI/ClientApp/src/app/reports/report-viewer/report-viewer.component.ts +++ b/HRM.UI/ClientApp/src/app/reports/report-viewer/report-viewer.component.ts @@ -39,6 +39,7 @@ import { User } from '../../_models/Authentication/user'; import { AuthService } from '../../_services/auth/auth.service'; import { saveAs } from 'file-saver'; import { SalaryService } from '../../_services/payroll/salary.service'; +import { LFAService } from '../../_services/payroll/lfa.service'; import { LoanIssue } from 'src/app/_models/Payroll/Loan/loanIssue'; import { Bank } from 'src/app/_models/Basic/bank'; import { formatDate } from '@progress/kendo-angular-intl'; @@ -73,6 +74,7 @@ export class ReportViewerComponent implements OnInit { public loanService: LoanService, public taxService: TaxService, public salaryService: SalaryService, + public lfaService: LFAService, public leaveYearService: LeaveService, public router: Router, public loadingPanel: loadingPanelService, public notificationService: HRMNotificationService, @@ -1291,15 +1293,12 @@ export class ReportViewerComponent implements OnInit { /** LFA Bank Advice: the approved LFA payment batches of the payroll type. */ loadLFABankAdviceBatches() { this.loadingPanel.ShowLoadingPanel = true; - this.apiService.httpGet('/lfa/getBankAdviceBatches').subscribe( + this.lfaService.getBankAdviceBatches().subscribe( (resp) => { (resp || []).forEach(x => { const paymentDate = x.paymentDate ? formatDate(new Date(x.paymentDate), 'dd MMM yyyy') : ''; - this.items.push(new Item(x.lfaPaymentID, x.batchNumber + ' (' + paymentDate + ', ' + x.headCount + ' emp)')); + this.items.push(new Item(x.lfaPaymentID, x.batchNumber + ' (' + x.headCount + ' emp)')); }); - if (this.items.length === 0) { - this.notificationService.showWarning('No approved LFA payment batch found.'); - } }, (err) => { this.loadingPanel.ShowLoadingPanel = false; @@ -1320,7 +1319,7 @@ export class ReportViewerComponent implements OnInit { this.skip = 0; this.loadData(); this.loadingPanel.ShowLoadingPanel = true; - this.apiService.httpGet('/lfa/getBatchEmployees/' + this.selectedItemid).subscribe( + this.lfaService.getBatchEmployees(this.selectedItemid).subscribe( (resp) => { this.searchEmployees = (resp || []) .filter(x => x.amount > 0)