- logs in find all coa by user
This commit is contained in:
parent
42403184b1
commit
e11c6a285b
|
@ -50,6 +50,7 @@ export class CoaService {
|
|||
}
|
||||
|
||||
async findByUser(id: string, typeOfCoa: coaType) {
|
||||
console.log('findbyuser', 'msk')
|
||||
try {
|
||||
return await this.coaRepository.findOneOrFail({
|
||||
user: id,
|
||||
|
@ -72,6 +73,7 @@ export class CoaService {
|
|||
|
||||
async findByTwoUser(from: string, destination: string, typeOfCoa: coaType) {
|
||||
try {
|
||||
console.log('findbytwouser', 'msk')
|
||||
return await this.coaRepository.findOneOrFail({
|
||||
user: from,
|
||||
relatedUser: destination,
|
||||
|
|
|
@ -165,6 +165,7 @@ export class TransactionService {
|
|||
currentUser.userId,
|
||||
coaType.ACCOUNT_RECEIVABLE,
|
||||
);
|
||||
console.log('coamsk1', 'coa')
|
||||
const coaWallet = await this.coaService.findByUser(
|
||||
distributeTransactionDto.destination,
|
||||
coaType.WALLET,
|
||||
|
@ -226,6 +227,7 @@ export class TransactionService {
|
|||
);
|
||||
|
||||
// GET COA
|
||||
console.log('coamsk2', 'coa')
|
||||
const coaSenderWallet = await this.coaService.findByUser(
|
||||
userData.id,
|
||||
coaType.WALLET,
|
||||
|
@ -237,6 +239,7 @@ export class TransactionService {
|
|||
coaType.ACCOUNT_PAYABLE,
|
||||
);
|
||||
|
||||
console.log('coamsk3', 'coa')
|
||||
const coaReceiverWallet = await this.coaService.findByUser(
|
||||
distributeTransactionDto.destination,
|
||||
coaType.WALLET,
|
||||
|
@ -351,6 +354,7 @@ export class TransactionService {
|
|||
let profit = product_price.mark_up_price;
|
||||
|
||||
//GET COA
|
||||
console.log('coamsk4', 'coa')
|
||||
const coaAccount = await this.coaService.findByUser(
|
||||
userData.id,
|
||||
coaType.WALLET,
|
||||
|
@ -509,6 +513,7 @@ export class TransactionService {
|
|||
);
|
||||
|
||||
//GET COA
|
||||
console.log('coamsk5', 'coa')
|
||||
const coaAccount = await this.coaService.findByUser(
|
||||
userData.id,
|
||||
coaType.WALLET,
|
||||
|
@ -732,6 +737,7 @@ export class TransactionService {
|
|||
);
|
||||
|
||||
//GET COA
|
||||
console.log('coamsk6', 'coa')
|
||||
const coaAccount = await this.coaService.findByUser(
|
||||
userData.id,
|
||||
coaType.WALLET,
|
||||
|
@ -1251,6 +1257,7 @@ export class TransactionService {
|
|||
}
|
||||
|
||||
//GET COA
|
||||
console.log('coamsk7', 'coa')
|
||||
const coaAccount = await this.coaService.findByUser(
|
||||
userData.id,
|
||||
coaType.WALLET,
|
||||
|
@ -1496,10 +1503,10 @@ export class TransactionService {
|
|||
seriNumber: string,
|
||||
status: string,
|
||||
) {
|
||||
console.log('callbackpartner', 'masuk')
|
||||
const partnerData = await this.userService.findPartner(partnerId);
|
||||
const userData = await this.userService.findOneByPartner(partnerId);
|
||||
|
||||
console.log('coamsk8', 'coa')
|
||||
const coaAccount = await this.coaService.findByUser(
|
||||
userData.id,
|
||||
coaType.WALLET,
|
||||
|
@ -1582,6 +1589,7 @@ export class TransactionService {
|
|||
async withdrawBenefit(user) {
|
||||
const userData = await this.userService.findExist(user);
|
||||
|
||||
console.log('coamsk9', 'coa')
|
||||
const coaProfit = await this.coaService.findByUser(user, coaType.PROFIT);
|
||||
|
||||
const coaBank = await this.coaService.findByName(
|
||||
|
@ -2057,6 +2065,7 @@ export class TransactionService {
|
|||
),
|
||||
);
|
||||
|
||||
console.log('coamsk10', 'coa')
|
||||
return Promise.all(
|
||||
supervisorData.map(async (it) => {
|
||||
const coaAccount = await this.coaService.findByUser(
|
||||
|
|
|
@ -443,6 +443,7 @@ export class UsersService {
|
|||
|
||||
])
|
||||
.getOne();
|
||||
console.log('coamsk11', 'coa')
|
||||
const coa = await this.coaService.findByUser(id, coaType.WALLET);
|
||||
let coaProfit;
|
||||
|
||||
|
@ -450,6 +451,7 @@ export class UsersService {
|
|||
userData.roles.id != 'e4dfb6a3-2338-464a-8fb8-5cbc089d4209' &&
|
||||
userData.roles.id != '21dceea2-416e-4b55-b74c-12605e1f8d1b'
|
||||
) {
|
||||
console.log('coamsk12', 'coa')
|
||||
coaProfit = await this.coaService.findByUser(id, coaType.PROFIT);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user