|
|
@ -686,13 +686,13 @@ exports.distrubanceStatus = async (req, reply) => {
|
|
|
|
const amount_due = parseInt(booking.amount_due .replace(/,/g, ''), 10)
|
|
|
|
const amount_due = parseInt(booking.amount_due .replace(/,/g, ''), 10)
|
|
|
|
const price_variation = price-distrubance_price
|
|
|
|
const price_variation = price-distrubance_price
|
|
|
|
if (action === "accept") {
|
|
|
|
if (action === "accept") {
|
|
|
|
await Tankerbooking.findOneAndUpdate({ bookingid:bookingid }, { $set: { amount_due: price,amount_difference:"0" } });
|
|
|
|
await Tankerbooking.findOneAndUpdate({ bookingid:bookingid }, { $set: { amount_due: distrubance_price,amount_difference:price_variation},distrubance_status:"1" });
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (action === "reject") {
|
|
|
|
if (action === "reject") {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await Tankerbooking.findOneAndUpdate({ bookingid:bookingid }, { $set: { amount_due: distrubance_price,amount_difference:"0" } });
|
|
|
|
await Tankerbooking.findOneAndUpdate({ bookingid:bookingid }, { $set: { amount_due: price,amount_difference:"0",distrubance_status:"0" } });
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|