import { Injectable } from "@angular/core"; import { HttpClient, HttpHeaders } from "@angular/common/http"; import { Config } from '../../_helpers/config.class'; import { AuthenticationService } from "../../_services/authentication.service"; import { EmpSalaryMastModel } from "./emp-salary-class"; @Injectable() export class EmployeeSalaryServices { headers: HttpHeaders = new HttpHeaders(); constructor(private http: HttpClient, _authenticationService: AuthenticationService) { this.headers.set('Content-Type', 'application/x-www-form-urlencoded'); this.headers.set('Authorization', 'Bearer ' + _authenticationService.getToken()) } public getEmployeefroCommissionSalary(id: number, td: any, fd: any) { return this.http.post(`${Config.getControllerUrl('Salary', 'GetEmployeefroCommissionSalary')}`, { Id: id, ToDate: td, FromDate: fd }); } public getEmployeeCashReceving(id: number, td: any, fd: any) { return this.http.post(`${Config.getControllerUrl('Salary', 'GetEmployeeCashReceving')}`, { Id: id, ToDate: td, FromDate: fd }); } public saveSalary(obj: EmpSalaryMastModel) { return this.http.post(`${Config.getControllerUrl('Salary', 'SaveCommissionSalery')}`, obj); } public getSalaryList(skip: number, pageSize: number, query: string, hfId: string, geoLvlCode: string, hfType: string, stockId: number) { return this.http.post(`${Config.getControllerUrl('Salary', 'GetSalaryList')}`, { Skip: skip, PageSize: pageSize, Query: query, HfId: hfId, GeoLvlCode: geoLvlCode, HfType: hfType, StockId: stockId }); } public getSalaryInvDetail(id: number) { return this.http.post(`${Config.getControllerUrl('Salary', 'GetSalaryInvDetail')}`, { Id: id }); } }