mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 23:46:28 +00:00
update
This commit is contained in:
@@ -288,10 +288,6 @@ const insertLoadingBalance = async (
|
||||
.insert(data)
|
||||
.returning('i_load_balance')
|
||||
.then((resp) => {
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} inserting loading balance 1 ${JSON.stringify(resp)}`
|
||||
);
|
||||
|
||||
let id = resp[0];
|
||||
let loadDetail = [];
|
||||
detail.forEach((element) => {
|
||||
@@ -317,8 +313,6 @@ const insertLoadingBalance = async (
|
||||
.insert(loadDetail);
|
||||
})
|
||||
.then(() => {
|
||||
winston.logger.warn(`${uniqueCode} inserting loading balance 2...}`);
|
||||
|
||||
// insert load balance history
|
||||
return knex('trx.t_d_load_balance_history')
|
||||
.transacting(trx)
|
||||
@@ -326,12 +320,6 @@ const insertLoadingBalance = async (
|
||||
.insert(data);
|
||||
})
|
||||
.then((history) => {
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} inserting loading balance 3 ${JSON.stringify(
|
||||
history
|
||||
)}`
|
||||
);
|
||||
|
||||
let id = history[0];
|
||||
let loadDetail = [];
|
||||
detail.forEach((element) => {
|
||||
@@ -357,8 +345,6 @@ const insertLoadingBalance = async (
|
||||
.insert(loadDetail);
|
||||
})
|
||||
.then(() => {
|
||||
winston.logger.warn(`${uniqueCode} inserting loading balance 4...}`);
|
||||
|
||||
// update reservation
|
||||
return knex('trx.t_d_reservation_balance')
|
||||
.transacting(trx)
|
||||
@@ -377,8 +363,6 @@ const insertLoadingBalance = async (
|
||||
.whereIn('c_reservation_no', reservationNumber);
|
||||
})
|
||||
.then(() => {
|
||||
winston.logger.warn(`${uniqueCode} inserting loading balance 5...}`);
|
||||
|
||||
// delete flag counting
|
||||
return knex('trx.t_d_flag_counting')
|
||||
.transacting(trx)
|
||||
@@ -387,8 +371,6 @@ const insertLoadingBalance = async (
|
||||
.del();
|
||||
})
|
||||
.then(() => {
|
||||
winston.logger.warn(`${uniqueCode} inserting loading balance 6...}`);
|
||||
|
||||
// insert flag counting
|
||||
return knex('trx.t_d_flag_counting').transacting(trx).insert({
|
||||
d_request: now,
|
||||
@@ -399,34 +381,18 @@ const insertLoadingBalance = async (
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} inserting loading balance 7 COMMIT... }`
|
||||
);
|
||||
|
||||
trx.commit;
|
||||
})
|
||||
.catch((err) => {
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} ERRORRRRRRR ROLLBACK ${JSON.stringify(err.message)}`
|
||||
);
|
||||
trx.rollback;
|
||||
});
|
||||
})
|
||||
.then((result) => {
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} inserting loading balance 8 ${JSON.stringify(result)}`
|
||||
);
|
||||
|
||||
// console.log(result);
|
||||
return result;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error.message);
|
||||
winston.logger.warn(
|
||||
`${uniqueCode} inserting loadbalance 9 ERRORRRRRRR CATCH ${JSON.stringify(
|
||||
err.message
|
||||
)}`
|
||||
);
|
||||
return error.message;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user