You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import { Injectable } from '@angular/core';
|
|
import { Observable } from 'rxjs';
|
|
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
|
|
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class AccrualService {
|
|
public static GET_ACCRUAL_BALANCE =
|
|
'Services/ERP.svc/REST/GET_ACCRUAL_BALANCES';
|
|
constructor(
|
|
public con: ConnectorService,
|
|
public authService: AuthenticationService
|
|
) {}
|
|
public getAccrualBalances(balance: any, onError?: any, errorLabel?: string, isPostNoLoad = false) {
|
|
const request = balance;
|
|
this.authService.authenticateRequest(request);
|
|
if (isPostNoLoad) {
|
|
return this.con.postNoLoad(
|
|
AccrualService.GET_ACCRUAL_BALANCE,
|
|
request,
|
|
onError,
|
|
errorLabel
|
|
);
|
|
} else {
|
|
return this.con.post(
|
|
AccrualService.GET_ACCRUAL_BALANCE,
|
|
request,
|
|
onError,
|
|
errorLabel
|
|
);
|
|
}
|
|
}
|
|
}
|