fixing: product transaction
This commit is contained in:
parent
f66f071a3c
commit
fe3404db32
|
@ -380,7 +380,6 @@ export class ProductService {
|
|||
relations: ['supplier'],
|
||||
where: {
|
||||
code: code,
|
||||
type: type,
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
|
|
|
@ -485,7 +485,7 @@ export class TransactionService {
|
|||
try {
|
||||
const billId = await this.checkBillHistoryRepository.findOneOrFail({
|
||||
where: {
|
||||
id: orderTransactionDto.bill_trx_id
|
||||
trx_id: orderTransactionDto.bill_trx_id
|
||||
},
|
||||
});
|
||||
product_price.price = billId.amount;
|
||||
|
@ -502,7 +502,6 @@ export class TransactionService {
|
|||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (coaAccount.amount < product_price.mark_up_price + product_price.price) {
|
||||
|
@ -529,16 +528,22 @@ export class TransactionService {
|
|||
trxId,
|
||||
supplier,
|
||||
);
|
||||
// let hitSupplier;
|
||||
|
||||
if (supplier.code != 'IRS') {
|
||||
const parsingResponse = hitSupplier.split(' ');
|
||||
hitSupplier = {
|
||||
console.log
|
||||
const newHitSupplier = {
|
||||
success: hitSupplier.includes('diproses'),
|
||||
harga: parseInt(
|
||||
parsingResponse[parsingResponse.length - 2].replaceAll('.', ''),
|
||||
parsingResponse[parsingResponse.length - 2].replace(/\./g,' '),
|
||||
),
|
||||
msg: hitSupplier,
|
||||
};
|
||||
hitSupplier = newHitSupplier;
|
||||
if(orderTransactionDto.bill_trx_id !== null){
|
||||
hitSupplier.harga = product_price.price;
|
||||
}
|
||||
}
|
||||
// const hitSupplier = {
|
||||
// harga: 2000,
|
||||
|
|
Loading…
Reference in New Issue
Block a user