fix: order product
This commit is contained in:
		| @@ -83,6 +83,14 @@ export class UsersService { | ||||
|       dataCoaWallet.coaEntityManager = manager; | ||||
|       await this.coaService.create(dataCoaWallet); | ||||
|  | ||||
|       const dataCoaAR = new InputCoaDto(); | ||||
|       dataCoaAR.user = userData; | ||||
|       dataCoaAR.balanceType = balanceType.DEBIT; | ||||
|       dataCoaAR.relatedUserId = superior.id; | ||||
|       dataCoaAR.type = coaType.ACCOUNT_RECEIVABLE; | ||||
|       dataCoaAR.coaEntityManager = manager; | ||||
|       await this.coaService.create(dataCoaAR); | ||||
|  | ||||
|       if (createUserDto.superior) { | ||||
|         const dataCoaAP = new InputCoaDto(); | ||||
|         dataCoaAP.user = userData; | ||||
| @@ -91,14 +99,6 @@ export class UsersService { | ||||
|         dataCoaAP.type = coaType.ACCOUNT_PAYABLE; | ||||
|         dataCoaAP.coaEntityManager = manager; | ||||
|         await this.coaService.create(dataCoaAP); | ||||
|  | ||||
|         const dataCoaAR = new InputCoaDto(); | ||||
|         dataCoaAR.user = userData; | ||||
|         dataCoaAR.balanceType = balanceType.DEBIT; | ||||
|         dataCoaAR.relatedUserId = superior.id; | ||||
|         dataCoaAR.type = coaType.ACCOUNT_RECEIVABLE; | ||||
|         dataCoaAR.coaEntityManager = manager; | ||||
|         await this.coaService.create(dataCoaAR); | ||||
|       } | ||||
|     }); | ||||
|  | ||||
| @@ -169,7 +169,7 @@ export class UsersService { | ||||
|         where: { | ||||
|           username: username, | ||||
|         }, | ||||
|         relations: ['roles'], | ||||
|         relations: ['superior', 'roles', 'partner'], | ||||
|       }); | ||||
|     } catch (e) { | ||||
|       if (e instanceof EntityNotFoundError) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user