Merge branch 'master' of https://gitlab.com/empatnusabangsa/ppob/ppob-backend into devops-production

This commit is contained in:
Fadli 2022-09-06 22:31:00 +07:00
commit 775da60bff
3 changed files with 14 additions and 1 deletions

View File

@ -50,6 +50,7 @@ export class CoaService {
} }
async findByUser(id: string, typeOfCoa: coaType) { async findByUser(id: string, typeOfCoa: coaType) {
console.log('findbyuser', 'msk')
try { try {
return await this.coaRepository.findOneOrFail({ return await this.coaRepository.findOneOrFail({
user: id, user: id,
@ -72,6 +73,7 @@ export class CoaService {
async findByTwoUser(from: string, destination: string, typeOfCoa: coaType) { async findByTwoUser(from: string, destination: string, typeOfCoa: coaType) {
try { try {
console.log('findbytwouser', 'msk')
return await this.coaRepository.findOneOrFail({ return await this.coaRepository.findOneOrFail({
user: from, user: from,
relatedUser: destination, relatedUser: destination,

View File

@ -165,6 +165,7 @@ export class TransactionService {
currentUser.userId, currentUser.userId,
coaType.ACCOUNT_RECEIVABLE, coaType.ACCOUNT_RECEIVABLE,
); );
console.log('coamsk1', 'coa')
const coaWallet = await this.coaService.findByUser( const coaWallet = await this.coaService.findByUser(
distributeTransactionDto.destination, distributeTransactionDto.destination,
coaType.WALLET, coaType.WALLET,
@ -226,6 +227,7 @@ export class TransactionService {
); );
// GET COA // GET COA
console.log('coamsk2', 'coa')
const coaSenderWallet = await this.coaService.findByUser( const coaSenderWallet = await this.coaService.findByUser(
userData.id, userData.id,
coaType.WALLET, coaType.WALLET,
@ -237,6 +239,7 @@ export class TransactionService {
coaType.ACCOUNT_PAYABLE, coaType.ACCOUNT_PAYABLE,
); );
console.log('coamsk3', 'coa')
const coaReceiverWallet = await this.coaService.findByUser( const coaReceiverWallet = await this.coaService.findByUser(
distributeTransactionDto.destination, distributeTransactionDto.destination,
coaType.WALLET, coaType.WALLET,
@ -351,6 +354,7 @@ export class TransactionService {
let profit = product_price.mark_up_price; let profit = product_price.mark_up_price;
//GET COA //GET COA
console.log('coamsk4', 'coa')
const coaAccount = await this.coaService.findByUser( const coaAccount = await this.coaService.findByUser(
userData.id, userData.id,
coaType.WALLET, coaType.WALLET,
@ -509,6 +513,7 @@ export class TransactionService {
); );
//GET COA //GET COA
console.log('coamsk5', 'coa')
const coaAccount = await this.coaService.findByUser( const coaAccount = await this.coaService.findByUser(
userData.id, userData.id,
coaType.WALLET, coaType.WALLET,
@ -732,6 +737,7 @@ export class TransactionService {
); );
//GET COA //GET COA
console.log('coamsk6', 'coa')
const coaAccount = await this.coaService.findByUser( const coaAccount = await this.coaService.findByUser(
userData.id, userData.id,
coaType.WALLET, coaType.WALLET,
@ -1251,6 +1257,7 @@ export class TransactionService {
} }
//GET COA //GET COA
console.log('coamsk7', 'coa')
const coaAccount = await this.coaService.findByUser( const coaAccount = await this.coaService.findByUser(
userData.id, userData.id,
coaType.WALLET, coaType.WALLET,
@ -1496,10 +1503,10 @@ export class TransactionService {
seriNumber: string, seriNumber: string,
status: string, status: string,
) { ) {
console.log('callbackpartner', 'masuk')
const partnerData = await this.userService.findPartner(partnerId); const partnerData = await this.userService.findPartner(partnerId);
const userData = await this.userService.findOneByPartner(partnerId); const userData = await this.userService.findOneByPartner(partnerId);
console.log('coamsk8', 'coa')
const coaAccount = await this.coaService.findByUser( const coaAccount = await this.coaService.findByUser(
userData.id, userData.id,
coaType.WALLET, coaType.WALLET,
@ -1582,6 +1589,7 @@ export class TransactionService {
async withdrawBenefit(user) { async withdrawBenefit(user) {
const userData = await this.userService.findExist(user); const userData = await this.userService.findExist(user);
console.log('coamsk9', 'coa')
const coaProfit = await this.coaService.findByUser(user, coaType.PROFIT); const coaProfit = await this.coaService.findByUser(user, coaType.PROFIT);
const coaBank = await this.coaService.findByName( const coaBank = await this.coaService.findByName(
@ -2057,6 +2065,7 @@ export class TransactionService {
), ),
); );
console.log('coamsk10', 'coa')
return Promise.all( return Promise.all(
supervisorData.map(async (it) => { supervisorData.map(async (it) => {
const coaAccount = await this.coaService.findByUser( const coaAccount = await this.coaService.findByUser(

View File

@ -443,6 +443,7 @@ export class UsersService {
]) ])
.getOne(); .getOne();
console.log('coamsk11', 'coa')
const coa = await this.coaService.findByUser(id, coaType.WALLET); const coa = await this.coaService.findByUser(id, coaType.WALLET);
let coaProfit; let coaProfit;
@ -450,6 +451,7 @@ export class UsersService {
userData.roles.id != 'e4dfb6a3-2338-464a-8fb8-5cbc089d4209' && userData.roles.id != 'e4dfb6a3-2338-464a-8fb8-5cbc089d4209' &&
userData.roles.id != '21dceea2-416e-4b55-b74c-12605e1f8d1b' userData.roles.id != '21dceea2-416e-4b55-b74c-12605e1f8d1b'
) { ) {
console.log('coamsk12', 'coa')
coaProfit = await this.coaService.findByUser(id, coaType.PROFIT); coaProfit = await this.coaService.findByUser(id, coaType.PROFIT);
} }