Merge branch 'development' of https://gitlab.com/empatnusabangsa/ppob/ppob-backend into devops-staging
This commit is contained in:
commit
c428574ae3
|
@ -141,13 +141,13 @@ export class PpobCallbackController {
|
||||||
if (response['msg'] != 'Transaksi Sukses') {
|
if (response['msg'] != 'Transaksi Sukses') {
|
||||||
//TODO: UPDATE GAGAL
|
//TODO: UPDATE GAGAL
|
||||||
await this.transactionService.checkCallbackOrderFailed(
|
await this.transactionService.checkCallbackOrderFailed(
|
||||||
response['clientid'],
|
response['data']['idtransaction'],
|
||||||
response,
|
response,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
//TODO: UPDATE BERHASIL
|
//TODO: UPDATE BERHASIL
|
||||||
await this.transactionService.checkCallbackOrderSuccess(
|
await this.transactionService.checkCallbackOrderSuccess(
|
||||||
response['clientid'],
|
response['data']['idtransaction'],
|
||||||
response,
|
response,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1361,13 +1361,9 @@ export class TransactionService {
|
||||||
product_price.product.id,
|
product_price.product.id,
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log('inipricetable', dataTransaction.product_price.price);
|
|
||||||
console.log('inipricecallback', callback['price']);
|
|
||||||
|
|
||||||
if (callback['message']) {
|
if (callback['message']) {
|
||||||
if (callback['message'].includes('METRO')) {
|
if (callback['message'].includes('METRO')) {
|
||||||
if (callback['price'] != dataTransaction.product_price.price) {
|
if (callback['price'] != dataTransaction.product_price.price) {
|
||||||
console.log('mskupdt', 'msk');
|
|
||||||
dataTransaction.product_price.price = parseInt(callback['price']);
|
dataTransaction.product_price.price = parseInt(callback['price']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1463,8 +1459,24 @@ export class TransactionService {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const product_price = await this.productHistoryPriceService.findById(
|
||||||
|
dataTransaction.product_price.id,
|
||||||
|
);
|
||||||
|
|
||||||
|
const product = await this.productService.findOneById(
|
||||||
|
product_price.product.id,
|
||||||
|
);
|
||||||
|
|
||||||
|
const supplier = await this.supplierService.findByCode(
|
||||||
|
product.supplier.code,
|
||||||
|
);
|
||||||
|
|
||||||
dataTransaction.status = statusTransaction.SUCCESS;
|
dataTransaction.status = statusTransaction.SUCCESS;
|
||||||
|
|
||||||
|
if (supplier.code == 'Hemat') {
|
||||||
|
dataTransaction.seri_number = callback['data']['serial_number'];
|
||||||
|
dataProductHistoryPrice.price = parseInt(callback['data']['additional']['harga']);
|
||||||
|
} else {
|
||||||
if (callback['sn']) {
|
if (callback['sn']) {
|
||||||
dataTransaction.seri_number = callback['sn'];
|
dataTransaction.seri_number = callback['sn'];
|
||||||
console.log('msksn1', dataTransaction.seri_number);
|
console.log('msksn1', dataTransaction.seri_number);
|
||||||
|
@ -1489,19 +1501,12 @@ export class TransactionService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const userData = await this.userService.findExist(dataTransaction.user);
|
const userData = await this.userService.findExist(dataTransaction.user);
|
||||||
|
|
||||||
let supervisorData = [];
|
let supervisorData = [];
|
||||||
|
|
||||||
const product_price = await this.productHistoryPriceService.findById(
|
|
||||||
dataTransaction.product_price.id,
|
|
||||||
);
|
|
||||||
|
|
||||||
const product = await this.productService.findOneById(
|
|
||||||
product_price.product.id,
|
|
||||||
);
|
|
||||||
|
|
||||||
let profit = product_price.mark_up_price;
|
let profit = product_price.mark_up_price;
|
||||||
|
|
||||||
//GET COA
|
//GET COA
|
||||||
|
|
Loading…
Reference in New Issue
Block a user