mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-05 19:36:28 +00:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fa7a38c713 | |||
| d13ac26b95 | |||
| 6e7e390ac8 | |||
| 3c8fc4d81d | |||
| 22ce0b611a | |||
| a6c6146933 | |||
| 0113e6dbb1 | |||
| 8d2f4bcda2 | |||
| 9aa3428620 | |||
| e8c73abf2e | |||
| 6275d8cf86 | |||
| 8af96b9a5f | |||
| d9f3516d56 | |||
| b7dec2613f | |||
| d540308d2d |
@@ -261,6 +261,12 @@ const _generateCashIn = async (uniqueCode) => {
|
||||
item.d_payment,
|
||||
item.c_invoice_no
|
||||
);
|
||||
|
||||
// winston.logger.info(
|
||||
// `SCHEDULER-FB70-${uniqueCode} cashIn reserv ${code} DATA : ${JSON.stringify(
|
||||
// reserv
|
||||
// )}`
|
||||
// );
|
||||
|
||||
//TOTAL AMOUNT CASH-IN
|
||||
let cashInAmount = 0;
|
||||
@@ -269,6 +275,12 @@ const _generateCashIn = async (uniqueCode) => {
|
||||
}
|
||||
dataCahsIn.i_amount = cashInAmount;
|
||||
|
||||
winston.logger.info(
|
||||
`SCHEDULER-FB70-${uniqueCode} cashInAmount ${code} DATA : ${JSON.stringify(
|
||||
cashInAmount
|
||||
)}`
|
||||
);
|
||||
|
||||
if(cashInAmount > 0) {
|
||||
//INSERT CASH-IN
|
||||
const cashIn = await model.insertCashIn(trx, dataCahsIn);
|
||||
|
||||
@@ -299,9 +299,11 @@ const getReserve = async (trx, code, date, invoice) => {
|
||||
.where('tdpr.c_status', '=', 'S')
|
||||
.whereNotNull('tdi.c_return_sap')
|
||||
.whereNotNull('tdrb.c_load_balance_no')
|
||||
.whereRaw(
|
||||
`tdrb.c_reservation_no in (SELECT c_reservation_no FROM payment.t_d_payment_recon where c_status = 'S' ) AND tdrb.c_reservation_no NOT IN (SELECT c_reservation_no FROM payment.t_d_cash_in_detail WHERE b_reversal IS NOT TRUE)`
|
||||
);
|
||||
.whereNull('tdrb.c_cash_in_no')
|
||||
// .whereRaw(
|
||||
// `tdrb.c_reservation_no in (SELECT c_reservation_no FROM payment.t_d_payment_recon where c_status = 'S' ) AND tdrb.c_reservation_no NOT IN (SELECT c_reservation_no FROM payment.t_d_cash_in_detail WHERE b_reversal IS NOT TRUE)`
|
||||
// );
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ const insertLoadingBalance = async (
|
||||
let loadDetail = [];
|
||||
detail.forEach((element) => {
|
||||
loadDetail.push({
|
||||
i_load_balance: id,
|
||||
i_load_balance: id.i_load_balance,
|
||||
i_reservation_balance: element.i_reservation_balance,
|
||||
c_reservation_no: element.c_reservation_no,
|
||||
i_amount: element.i_amount,
|
||||
@@ -336,7 +336,7 @@ const insertLoadingBalance = async (
|
||||
let loadDetail = [];
|
||||
detail.forEach((element) => {
|
||||
loadDetail.push({
|
||||
i_load_balance: id,
|
||||
i_load_balance: id.i_load_balance,
|
||||
i_reservation_balance: element.i_reservation_balance,
|
||||
c_reservation_no: element.c_reservation_no,
|
||||
i_amount: element.i_amount,
|
||||
|
||||
@@ -79,7 +79,7 @@ const callbackOy = async (req, res) => {
|
||||
`${uniqueCode} [ RESPONSE REFUND-KMT ]: ${JSON.stringify(result)}`
|
||||
);
|
||||
|
||||
let recipient_bank_code = recipient_bank.toLowerCase();
|
||||
let recipient_bank_code = recipient_bank.toUpperCase();
|
||||
// check trx_id yang di request match
|
||||
let checkRequest = await model.checkRedeem(
|
||||
partner_trx_id,
|
||||
@@ -129,11 +129,14 @@ const callbackOy = async (req, res) => {
|
||||
};
|
||||
}
|
||||
|
||||
const unixTimeZero = Date.parse(last_updated_date);
|
||||
const date_reimbursement = moment(unixTimeZero).format(
|
||||
const date_reimbursement = moment(last_updated_date, 'DD-MM-YYYY HH:mm:ss').format(
|
||||
'YYYY-MM-DD HH:mm:ss'
|
||||
);
|
||||
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} [ log date_reimbusement ]: ${JSON.stringify(date_reimbursement)}`
|
||||
);
|
||||
|
||||
//Update Card Replacement
|
||||
await model.updateReplacementComplete(
|
||||
checkRequest.i_card_replacement,
|
||||
@@ -141,6 +144,7 @@ const callbackOy = async (req, res) => {
|
||||
date_reimbursement
|
||||
);
|
||||
|
||||
/*
|
||||
//Notif Email
|
||||
let urlCMS = '';
|
||||
if (process.env.SERVER_FOR == 'production') {
|
||||
@@ -170,7 +174,8 @@ const callbackOy = async (req, res) => {
|
||||
status: 'complete',
|
||||
},
|
||||
});
|
||||
console.log('urlCMS', url);
|
||||
*/
|
||||
// console.log('urlCMS', url)
|
||||
|
||||
result = {
|
||||
code: '00',
|
||||
|
||||
@@ -32,6 +32,13 @@ const updateReplacementComplete = (i_replacement, request_no, date_disburse) =>
|
||||
let result = knex("trx.t_d_card_replacement")
|
||||
.where("i_card_replacement", i_replacement)
|
||||
.where("c_request_no", request_no)
|
||||
// .update({
|
||||
// c_status: "A",
|
||||
// c_status_name: "COMPLETED",
|
||||
// d_disburse: date_disburse,
|
||||
// c_response_code: "000",
|
||||
// c_response_message: "Success"
|
||||
// });
|
||||
.update({
|
||||
c_status: "A",
|
||||
c_status_name: "COMPLETED",
|
||||
|
||||
@@ -2653,6 +2653,8 @@ const reservationV2 = async (req, res) => {
|
||||
// `${uniqueCode} [ PROCESSING RESERVATION-V2 ] inserting reservation transaction...`
|
||||
// );
|
||||
|
||||
// (belum) ada issue disini, jadi ada case reservation number nya sama, terus error query harusnya ada handle response message nya, yg sekarang malah masuk ke blok reservation saved successfully.
|
||||
|
||||
// insert transaction
|
||||
let insert = await model.insertReservation(data);
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "topuponline",
|
||||
"version": "1.0.0",
|
||||
"version": "1.5.4",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user