|
|
@ -380,7 +380,8 @@ exports.deliveryboystartandstop = async (req, reply) => {
|
|
|
|
exports.amountUpdateByDeliveryBoy = async (req, reply) => {
|
|
|
|
exports.amountUpdateByDeliveryBoy = async (req, reply) => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const { bookingId } = req.params;
|
|
|
|
const { bookingId } = req.params;
|
|
|
|
const { amount_paid, payment_mode, orderStatus, deliveredDate } = req.body;
|
|
|
|
const { amount_paid, payment_mode, orderStatus } = req.body;
|
|
|
|
|
|
|
|
const deliveredDate = req.body.deliveredDate;
|
|
|
|
|
|
|
|
|
|
|
|
const booking = await Tankerbooking.findOne({ bookingid: bookingId });
|
|
|
|
const booking = await Tankerbooking.findOne({ bookingid: bookingId });
|
|
|
|
if (!booking) {
|
|
|
|
if (!booking) {
|
|
|
@ -397,9 +398,10 @@ exports.amountUpdateByDeliveryBoy = async (req, reply) => {
|
|
|
|
orderStatus,
|
|
|
|
orderStatus,
|
|
|
|
amount_due,
|
|
|
|
amount_due,
|
|
|
|
payment_status: amount_due === 0 ? "paid" : "due",
|
|
|
|
payment_status: amount_due === 0 ? "paid" : "due",
|
|
|
|
deliveredDate: deliveredDate,
|
|
|
|
//deliveredDate: deliveredDate,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
updateData.deliveredDate = deliveredDate
|
|
|
|
|
|
|
|
console.log("update--", updateData)
|
|
|
|
await Tankerbooking.findOneAndUpdate(
|
|
|
|
await Tankerbooking.findOneAndUpdate(
|
|
|
|
{ bookingid: bookingId },
|
|
|
|
{ bookingid: bookingId },
|
|
|
|
{ $set: updateData }
|
|
|
|
{ $set: updateData }
|
|
|
|