Merge branch 'development' into 'devops-staging'
add: profit akun coa See merge request empatnusabangsa/ppob/ppob-backend!64
This commit is contained in:
commit
5222381d39
|
@ -30,6 +30,7 @@ export enum coaType {
|
||||||
ACCOUNT_PAYABLE,
|
ACCOUNT_PAYABLE,
|
||||||
BUDGET,
|
BUDGET,
|
||||||
CONTRA_BUDGET,
|
CONTRA_BUDGET,
|
||||||
|
PROFIT,
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum balanceType {
|
export enum balanceType {
|
||||||
|
|
|
@ -737,7 +737,7 @@ export class TransactionService {
|
||||||
supervisorData.map(async (it) => {
|
supervisorData.map(async (it) => {
|
||||||
const coaAccount = await this.coaService.findByUser(
|
const coaAccount = await this.coaService.findByUser(
|
||||||
it.id,
|
it.id,
|
||||||
coaType.WALLET,
|
coaType.PROFIT,
|
||||||
);
|
);
|
||||||
const commissionValue = await this.commissionService.findOne(
|
const commissionValue = await this.commissionService.findOne(
|
||||||
it.roles.id,
|
it.roles.id,
|
||||||
|
|
|
@ -95,6 +95,15 @@ export class UsersService {
|
||||||
dataCoaAR.coaEntityManager = manager;
|
dataCoaAR.coaEntityManager = manager;
|
||||||
await this.coaService.create(dataCoaAR);
|
await this.coaService.create(dataCoaAR);
|
||||||
|
|
||||||
|
if (roles.name == 'Supervisor' || roles.name == 'Sales') {
|
||||||
|
const dataCOAProfit = new InputCoaDto();
|
||||||
|
dataCOAProfit.user = userData;
|
||||||
|
dataCOAProfit.balanceType = balanceType.CREDIT;
|
||||||
|
dataCOAProfit.type = coaType.PROFIT;
|
||||||
|
dataCOAProfit.coaEntityManager = manager;
|
||||||
|
await this.coaService.create(dataCOAProfit);
|
||||||
|
}
|
||||||
|
|
||||||
if (createUserDto.superior) {
|
if (createUserDto.superior) {
|
||||||
const dataCoaAP = new InputCoaDto();
|
const dataCoaAP = new InputCoaDto();
|
||||||
dataCoaAP.user = userData;
|
dataCoaAP.user = userData;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user