add: profit akun coa
This commit is contained in:
parent
ef1ef4d429
commit
d9415dbaa3
|
@ -30,6 +30,7 @@ export enum coaType {
|
|||
ACCOUNT_PAYABLE,
|
||||
BUDGET,
|
||||
CONTRA_BUDGET,
|
||||
PROFIT,
|
||||
}
|
||||
|
||||
export enum balanceType {
|
||||
|
|
|
@ -737,7 +737,7 @@ export class TransactionService {
|
|||
supervisorData.map(async (it) => {
|
||||
const coaAccount = await this.coaService.findByUser(
|
||||
it.id,
|
||||
coaType.WALLET,
|
||||
coaType.PROFIT,
|
||||
);
|
||||
const commissionValue = await this.commissionService.findOne(
|
||||
it.roles.id,
|
||||
|
|
|
@ -95,6 +95,15 @@ export class UsersService {
|
|||
dataCoaAR.coaEntityManager = manager;
|
||||
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) {
|
||||
const dataCoaAP = new InputCoaDto();
|
||||
dataCoaAP.user = userData;
|
||||
|
|
Loading…
Reference in New Issue
Block a user