Merge branch 'development' into 'devops-staging'
Development See merge request empatnusabangsa/ppob/ppob-backend!163
This commit is contained in:
commit
b1a71c4153
|
@ -380,7 +380,6 @@ export class ProductService {
|
||||||
relations: ['supplier'],
|
relations: ['supplier'],
|
||||||
where: {
|
where: {
|
||||||
code: code,
|
code: code,
|
||||||
type: type,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -78,7 +78,7 @@ export class PpobCallbackController {
|
||||||
);
|
);
|
||||||
//
|
//
|
||||||
} else {
|
} else {
|
||||||
if (response['status'] != 20) {
|
if (response['status'].toString() != '20') {
|
||||||
//TODO: UPDATE GAGAL
|
//TODO: UPDATE GAGAL
|
||||||
const updateTransaction =
|
const updateTransaction =
|
||||||
await this.transactionService.callbackOrderFailed(
|
await this.transactionService.callbackOrderFailed(
|
||||||
|
|
|
@ -485,7 +485,7 @@ export class TransactionService {
|
||||||
try {
|
try {
|
||||||
const billId = await this.checkBillHistoryRepository.findOneOrFail({
|
const billId = await this.checkBillHistoryRepository.findOneOrFail({
|
||||||
where: {
|
where: {
|
||||||
id: orderTransactionDto.bill_trx_id
|
trx_id: orderTransactionDto.bill_trx_id
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
product_price.price = billId.amount;
|
product_price.price = billId.amount;
|
||||||
|
@ -502,7 +502,6 @@ export class TransactionService {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (coaAccount.amount < product_price.mark_up_price + product_price.price) {
|
if (coaAccount.amount < product_price.mark_up_price + product_price.price) {
|
||||||
|
@ -529,16 +528,22 @@ export class TransactionService {
|
||||||
trxId,
|
trxId,
|
||||||
supplier,
|
supplier,
|
||||||
);
|
);
|
||||||
|
// let hitSupplier;
|
||||||
|
|
||||||
if (supplier.code != 'IRS') {
|
if (supplier.code != 'IRS') {
|
||||||
const parsingResponse = hitSupplier.split(' ');
|
const parsingResponse = hitSupplier.split(' ');
|
||||||
hitSupplier = {
|
console.log
|
||||||
|
const newHitSupplier = {
|
||||||
success: hitSupplier.includes('diproses'),
|
success: hitSupplier.includes('diproses'),
|
||||||
harga: parseInt(
|
harga: parseInt(
|
||||||
parsingResponse[parsingResponse.length - 2].replaceAll('.', ''),
|
parsingResponse[parsingResponse.length - 2].replace(/\./g,' '),
|
||||||
),
|
),
|
||||||
msg: hitSupplier,
|
msg: hitSupplier,
|
||||||
};
|
};
|
||||||
|
hitSupplier = newHitSupplier;
|
||||||
|
if(orderTransactionDto.bill_trx_id !== null){
|
||||||
|
hitSupplier.harga = product_price.price;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// const hitSupplier = {
|
// const hitSupplier = {
|
||||||
// harga: 2000,
|
// harga: 2000,
|
||||||
|
@ -1167,8 +1172,7 @@ export class TransactionService {
|
||||||
const coaExpense = await this.coaService.findByName(
|
const coaExpense = await this.coaService.findByName(
|
||||||
`${coaType[coaType.EXPENSE]}-SYSTEM`,
|
`${coaType[coaType.EXPENSE]}-SYSTEM`,
|
||||||
);
|
);
|
||||||
|
if (userData.partner != null) {
|
||||||
if (!userData.partner) {
|
|
||||||
//GET SALES
|
//GET SALES
|
||||||
supervisorData = await this.calculateCommission(
|
supervisorData = await this.calculateCommission(
|
||||||
supervisorData,
|
supervisorData,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user