|
|
@ -185,7 +185,12 @@ exports.tankerBooking = async (req, reply) => {
|
|
|
|
const month = (date.getMonth() + 1).toString().padStart(2, '0')
|
|
|
|
const month = (date.getMonth() + 1).toString().padStart(2, '0')
|
|
|
|
const day = date.getDate().toString().padStart(2, '0')
|
|
|
|
const day = date.getDate().toString().padStart(2, '0')
|
|
|
|
const bookingId = `ARM${year}${month}${day}${b_id}`
|
|
|
|
const bookingId = `ARM${year}${month}${day}${b_id}`
|
|
|
|
|
|
|
|
const customer = await User.findOne({customerId:customerId})
|
|
|
|
|
|
|
|
const customer_mobile = customer.phoneNumber
|
|
|
|
|
|
|
|
const customer_name = customer.username
|
|
|
|
|
|
|
|
const supplier = await Supplier.findOne({supplierId:req.body.supplierId})
|
|
|
|
|
|
|
|
const supplier_name = supplier.suppliername
|
|
|
|
|
|
|
|
const supplier_mobile = supplier.phoneNumber
|
|
|
|
var booking_id = await Tankerbooking.findOne({ bookingid: bookingId})
|
|
|
|
var booking_id = await Tankerbooking.findOne({ bookingid: bookingId})
|
|
|
|
if(booking_id){
|
|
|
|
if(booking_id){
|
|
|
|
b_id= await generateBookingId()
|
|
|
|
b_id= await generateBookingId()
|
|
|
@ -228,6 +233,10 @@ exports.tankerBooking = async (req, reply) => {
|
|
|
|
tankersBookingData.tankLocation = usertobeInserted.tankLocation;
|
|
|
|
tankersBookingData.tankLocation = usertobeInserted.tankLocation;
|
|
|
|
//tankersBookingData.date = usertobeInserted.date;
|
|
|
|
//tankersBookingData.date = usertobeInserted.date;
|
|
|
|
//tankersBookingData.time = usertobeInserted.time;
|
|
|
|
//tankersBookingData.time = usertobeInserted.time;
|
|
|
|
|
|
|
|
tankersBookingData.customerPhone = customer_mobile;
|
|
|
|
|
|
|
|
tankersBookingData.supplierPhone = supplier_mobile;
|
|
|
|
|
|
|
|
tankersBookingData.customerName = customer_name;
|
|
|
|
|
|
|
|
tankersBookingData.supplierName = supplier_name;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|