Merge branch 'development' into 'devops-staging'
Development See merge request empatnusabangsa/ppob/ppob-backend!88
This commit is contained in:
commit
5b117976dc
|
@ -528,7 +528,7 @@ export class TransactionService {
|
|||
await this.productHistoryPriceService.updateEndDate(product.id);
|
||||
|
||||
listActivePrice.map(async (x) => {
|
||||
let newProductPrice = new ProductHistoryPrice();
|
||||
const newProductPrice = new ProductHistoryPrice();
|
||||
|
||||
newProductPrice.id = uuid.v4();
|
||||
newProductPrice.type = x.type;
|
||||
|
@ -613,30 +613,32 @@ export class TransactionService {
|
|||
|
||||
await manager.save(transactionData);
|
||||
|
||||
await this.accountingTransaction({
|
||||
createTransaction: false,
|
||||
transactionalEntityManager: manager,
|
||||
transaction: transactionData,
|
||||
amount: transactionData.amount,
|
||||
journals: [
|
||||
{
|
||||
coa_id: coaSenderWallet.id,
|
||||
credit: transactionData.amount,
|
||||
},
|
||||
{
|
||||
coa_id: coaReceiverWallet.id,
|
||||
debit: transactionData.amount,
|
||||
},
|
||||
{
|
||||
coa_id: coaAR.id,
|
||||
credit: transactionData.amount,
|
||||
},
|
||||
{
|
||||
coa_id: coaAP.id,
|
||||
debit: transactionData.amount,
|
||||
},
|
||||
],
|
||||
});
|
||||
if (statusApproval === 'accept') {
|
||||
await this.accountingTransaction({
|
||||
createTransaction: false,
|
||||
transactionalEntityManager: manager,
|
||||
transaction: transactionData,
|
||||
amount: transactionData.amount,
|
||||
journals: [
|
||||
{
|
||||
coa_id: coaSenderWallet.id,
|
||||
credit: transactionData.amount,
|
||||
},
|
||||
{
|
||||
coa_id: coaReceiverWallet.id,
|
||||
debit: transactionData.amount,
|
||||
},
|
||||
{
|
||||
coa_id: coaAR.id,
|
||||
credit: transactionData.amount,
|
||||
},
|
||||
{
|
||||
coa_id: coaAP.id,
|
||||
debit: transactionData.amount,
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return transactionData;
|
||||
|
@ -1020,6 +1022,7 @@ export class TransactionService {
|
|||
if (startDate && endDate) {
|
||||
filter['start'] = Between(new Date(startDate), new Date(endDate));
|
||||
}
|
||||
|
||||
const baseQuery = this.transactionRepository.findAndCount({
|
||||
skip: page * (pageSize || 10),
|
||||
take: pageSize || 10,
|
||||
|
@ -1028,6 +1031,7 @@ export class TransactionService {
|
|||
createdAt: 'DESC',
|
||||
},
|
||||
});
|
||||
|
||||
return baseQuery;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user