Incentive Done!!

Employee Benefit Done!!
This commit is contained in:
tanshu
2020-05-23 09:45:02 +05:30
parent 814d289758
commit e3286c87ba
20 changed files with 515 additions and 415 deletions
@@ -6,7 +6,7 @@ import {ActivatedRoute, Router} from '@angular/router';
import {BehaviorSubject, Observable, of as observableOf} from 'rxjs';
import {EmployeeBenefitsDataSource} from './employee-benefits-datasource';
import {VoucherService} from '../core/voucher.service';
import {EmployeeBenefit, Journal, Voucher} from '../core/voucher';
import {EmployeeBenefit, Voucher} from '../core/voucher';
import * as moment from 'moment';
import {AuthService} from '../auth/auth.service';
import {ConfirmDialogComponent} from '../shared/confirm-dialog/confirm-dialog.component';
@@ -106,7 +106,7 @@ export class EmployeeBenefitsComponent implements OnInit, AfterViewInit {
}
addRow() {
const oldFiltered = this.voucher.employeeBenefits.filter((x) => x.journal.account.id === this.employee.id);
const oldFiltered = this.voucher.employeeBenefits.filter((x) => x.employee.id === this.employee.id);
if (oldFiltered.length) {
this.toaster.show('Danger', 'Employee has already been added');
return;
@@ -121,7 +121,7 @@ export class EmployeeBenefitsComponent implements OnInit, AfterViewInit {
const pf = this.getPf(grossSalary, daysWorked, daysInMonth);
this.voucher.employeeBenefits.push({
journal: new Journal({account: new Account(this.employee)}),
employee: this.employee,
grossSalary: grossSalary,
daysWorked: daysWorked,
esiEmployee: esi.ee,