Skip to content

Commit 63396fc

Browse files
committed
added if condition for the make payment button
1 parent ee05420 commit 63396fc

File tree

3 files changed

+12
-19
lines changed

3 files changed

+12
-19
lines changed

src/Client/Logistics.OfficeApp/src/app/pages/accounting/list-payroll/list-payroll.component.html

+10-7
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h1>Payrolls</h1>
6969
<td>{{payroll.employee.fullName}}</td>
7070
<td>{{getSalaryTypeDesc(payroll.employee.salaryType)}}</td>
7171
<td>
72-
@if (isShareOfGrossSalary(payroll.employee.salaryType)) {
72+
@if (payroll.employee.salaryType === salaryType.ShareOfGross) {
7373
{{payroll.employee.salary | percent}}
7474
}
7575
@else {
@@ -84,12 +84,15 @@ <h1>Payrolls</h1>
8484
</td>
8585
<td>{{getPaymentMethodDesc(payroll.payment.method)}}</td>
8686
<td class="overflow-visible">
87-
<p-button
88-
icon="bi bi-credit-card"
89-
pTooltip="Make payment"
90-
tooltipPosition="bottom"
91-
[routerLink]="['/payment/payroll', payroll.id]">
92-
</p-button>
87+
@if (payroll.payment.status === paymentStatus.Pending) {
88+
<p-button
89+
icon="bi bi-credit-card"
90+
pTooltip="Make payment"
91+
tooltipPosition="bottom"
92+
[routerLink]="['/payment/payroll', payroll.id]">
93+
</p-button>
94+
}
95+
9396
<p-button class="ms-2"
9497
icon="bi bi-pencil"
9598
pTooltip="Edit payroll"

src/Client/Logistics.OfficeApp/src/app/pages/accounting/list-payroll/list-payroll.component.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ import {ApiService} from '@core/services';
3939
],
4040
})
4141
export class ListPayrollComponent {
42+
public salaryType = SalaryType;
43+
public paymentStatus = PaymentStatus;
4244
public payrolls: Payroll[] = [];
4345
public isLoading = false;
4446
public totalRecords = 0;
@@ -82,14 +84,6 @@ export class ListPayrollComponent {
8284
});
8385
}
8486

85-
isShareOfGrossSalary(salaryType: SalaryType): boolean {
86-
return salaryType === SalaryType.ShareOfGross;
87-
}
88-
89-
isPendingPaymentStatus(paymentStatus: PaymentStatus): boolean {
90-
return paymentStatus === PaymentStatus.Pending;
91-
}
92-
9387
getPaymentStatusTagSeverity(paymentStatus: PaymentStatus): string {
9488
return paymentStatus === PaymentStatus.Paid ? 'success' : 'warning';
9589
}

src/Client/Logistics.OfficeApp/src/styles/global.scss

-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ body {
2727
text-decoration: none;
2828
}
2929

30-
.p-button-icon {
31-
padding-right: 4px;
32-
}
33-
3430
ol, ul {
3531
padding-left: 0;
3632
}

0 commit comments

Comments
 (0)