mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-05 11:06:28 +00:00
update payment recon
This commit is contained in:
@@ -515,7 +515,7 @@ const paymentRecon = async (req, res) => {
|
||||
let partnerCode = getPartner.partner_code;
|
||||
let PaymentReconNumber;
|
||||
let maxLoop = 0;
|
||||
let maxLoopParameter = 30;
|
||||
let maxLoopParameter = 10;
|
||||
|
||||
// log debug
|
||||
winston.logger.debug(`${uniqueCode} generating payment recon number...`);
|
||||
@@ -524,11 +524,6 @@ const paymentRecon = async (req, res) => {
|
||||
await _sleep(helper.randomNumberInt());
|
||||
PaymentReconNumber = await generatePaymentReconNumber(partnerCode, now);
|
||||
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} Loop: ${maxLoop}`
|
||||
);
|
||||
|
||||
maxLoop++;
|
||||
} while (PaymentReconNumber == "XX" && (maxLoop <= maxLoopParameter));
|
||||
|
||||
@@ -1190,6 +1185,14 @@ const generatePaymentReconNumber = async (partnerCode, reconDate) => {
|
||||
} else {
|
||||
counter = counter.padStart(6, "0");
|
||||
}
|
||||
// log warn
|
||||
winston.logger.warn(
|
||||
`${uniqueCode}Last Counter: ${parseInt(
|
||||
getLastCounterPaymentReconNo.c_payment_recon_no.substr(
|
||||
getLastCounterPaymentReconNo.c_payment_recon_no.length - 6
|
||||
)
|
||||
)} New Counter: ${counter}`
|
||||
);
|
||||
let paymentReconNumber;
|
||||
paymentReconNumber = `RC${partnerCode}${moment(reconDate).format(
|
||||
"YYMMDD"
|
||||
|
||||
+19
-19
@@ -1,31 +1,31 @@
|
||||
require("dotenv").config();
|
||||
|
||||
module.exports = {
|
||||
// development: {
|
||||
// client: "pg",
|
||||
// connection: process.env.DB_URL,
|
||||
// migrations: {
|
||||
// directory: "./infrastructure/database/migrations",
|
||||
// },
|
||||
// seeds: { directory: "./infrastructure/database/seeds" },
|
||||
// },
|
||||
development: {
|
||||
client: "pg",
|
||||
connection: {
|
||||
host : '10.1.201.95',
|
||||
database: "postgres",
|
||||
user: "cms",
|
||||
password: "Cm5kc1#2021",
|
||||
},
|
||||
// connection: process.env.DB_URL,
|
||||
pool: {
|
||||
min: 2,
|
||||
max: 10,
|
||||
},
|
||||
connection: process.env.DB_URL,
|
||||
migrations: {
|
||||
directory: "./infrastructure/database/migrations",
|
||||
},
|
||||
seeds: { directory: "./infrastructure/database/seeds" },
|
||||
},
|
||||
// development: {
|
||||
// client: "pg",
|
||||
// connection: {
|
||||
// host : '10.1.201.95',
|
||||
// database: "postgres",
|
||||
// user: "cms",
|
||||
// password: "Cm5kc1#2021",
|
||||
// },
|
||||
// // connection: process.env.DB_URL,
|
||||
// pool: {
|
||||
// min: 2,
|
||||
// max: 10,
|
||||
// },
|
||||
// migrations: {
|
||||
// directory: "./infrastructure/database/migrations",
|
||||
// },
|
||||
// },
|
||||
|
||||
testing: {
|
||||
client: "pg",
|
||||
|
||||
Reference in New Issue
Block a user