This commit is contained in:
Fadli 2022-12-15 15:40:46 +07:00
commit 251308e5e4

View File

@ -367,6 +367,7 @@ export class TransactionService {
userData.partner?.id,
);
let costInventory = product_price.price;
let supervisorData = [];
let profit = product_price.mark_up_price;
@ -441,6 +442,8 @@ export class TransactionService {
transactionData.destination = orderTransactionDto.destination;
transactionData.partner_trx_id = orderTransactionDto.trx_id;
transactionData.supplier_trx_id = trxId;
transactionData.balance_remaining =
coaAccount.amount - product_price.mark_up_price - costInventory;
await manager.insert(Transactions, transactionData);
await this.accountingTransaction({
@ -1667,6 +1670,7 @@ export class TransactionService {
);
if (!partnerData.callback_url) {
console.log('nopartnerurl', 'msk');
this.logger.error(`Call to partner failed, reason: no callback url`);
return false;
@ -1681,9 +1685,10 @@ export class TransactionService {
try {
const res = await axios.get(url);
console.log('successcallback', res);
return res;
} catch (e) {
console.log('errorsendcallback', 'msk');
this.logger.error(`Call to partner failed, reason: ${e.message}`);
return false;