Revert "update on th redirection onte create order page"
This reverts commit 0da1bd444b.
This commit is contained in:
@@ -571,48 +571,62 @@ const Createorder1 = () => {
|
|||||||
// =============================================== || createsubmitobj1 (create orders) || ===============================================
|
// =============================================== || createsubmitobj1 (create orders) || ===============================================
|
||||||
|
|
||||||
const createsubmitobj2 = async () => {
|
const createsubmitobj2 = async () => {
|
||||||
const pickLat = pickCust.latitude || startPoint.latitude || 0;
|
let arr = {};
|
||||||
const pickLng = pickCust.longitude || startPoint.longitude || 0;
|
arr = {
|
||||||
const dropLat = dropCust.latitude || endPoint.latitude || 0;
|
orders: {
|
||||||
const dropLng = dropCust.longitude || endPoint.longitude || 0;
|
|
||||||
|
|
||||||
let arr = {
|
|
||||||
order: {
|
|
||||||
amount: Math.round(totalCharge) || 0,
|
|
||||||
applocationid: tenant.applolcationid,
|
applocationid: tenant.applolcationid,
|
||||||
categoryid: selectedCatChip,
|
cancellled: '',
|
||||||
collectionamount: +collectionamt || 0,
|
categoryid: +tenant.categoryid,
|
||||||
distance: distance || 0,
|
configid: 7,
|
||||||
driverbatchcharge: 0,
|
customerid: isNumChange1 == 0 ? +pickCust.customerid || 0 : 0,
|
||||||
drivercommissiontype: 'F',
|
deliveryaddress: dropCust.address || '',
|
||||||
drivercommissionvalue: 0,
|
deliverycharge: +totalCharge.toFixed(2) || 0,
|
||||||
enddate: startdate,
|
deliverycity: dropCust.city || '',
|
||||||
estimatedtime: 0,
|
deliverycontactno: dropCust.contactno || '',
|
||||||
eventsno: 0,
|
deliverycustomer: dropCust.firstname || '',
|
||||||
fromtime: selectedtime.split('-')[0],
|
deliveryid: isNumChange2 == 0 ? +dropCust.customerid || 0 : 0,
|
||||||
initialdistance: minKm,
|
deliverylandmark: dropCust.landmark || '',
|
||||||
initialfare: basePrice,
|
deliverylat: (dropCust.latitude || 0).toString(),
|
||||||
locationid: 0,
|
deliverylocation: dropCust.suburb || '',
|
||||||
minimumfare: basePrice,
|
deliverylocationid: dropCust.deliverylocationid || 0,
|
||||||
|
deliverylong: (dropCust.longitude || 0).toString(),
|
||||||
|
deliverytime: `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(selectedtime.$d).format('HH:mm:ss')}`,
|
||||||
|
deliverytype: pickCust.customerid !== 0 || dropCust.customerid !== 0 ? 'B' : 'C',
|
||||||
|
delivered: '',
|
||||||
|
itemcount: 1,
|
||||||
|
kms: distance.toString() || 0,
|
||||||
|
locationid: +tenanatLocoId, //main or branch
|
||||||
|
moduleid: +tenant.moduleid,
|
||||||
|
orderamount: +totalCharge.toFixed(2) || 0,
|
||||||
|
ordercharges: 0.0,
|
||||||
|
orderdate: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||||
|
orderheaderid: 0,
|
||||||
|
orderid: '', //
|
||||||
ordernotes: otherinstructions,
|
ordernotes: otherinstructions,
|
||||||
orderstatus: 'created',
|
orderstatus: 'created',
|
||||||
ordertype: deliverytype,
|
ordervalue: +totalCharge.toFixed(2) || 0,
|
||||||
ordervalue: Math.round(totalCharge) || 0,
|
partnerid: tenant.partnerid,
|
||||||
paymentmode: 'C',
|
paymentstatus: 1,
|
||||||
perkmdistance: 0,
|
paymenttype: 42,
|
||||||
priceperkm: pricePerKm,
|
pending: '',
|
||||||
promocode: '',
|
pickupaddress: pickCust.address || '',
|
||||||
promodiscount: 0,
|
pickupcity: pickCust.city || '',
|
||||||
serviceid: 0,
|
pickupcontactno: pickCust.contactno || '',
|
||||||
shiftsno: 0,
|
pickupcustomer: pickCust.firstname || '',
|
||||||
startdate: startdate,
|
pickuplandmark: pickCust.landmark || '',
|
||||||
status: 1,
|
pickuplat: (pickCust.latitude || 0).toString(),
|
||||||
subcategoryid: subCatId,
|
pickuplocation: pickCust.suburb || '',
|
||||||
tax: 0,
|
pickuplocationid: pickCust.deliverylocationid || 0,
|
||||||
|
pickuplong: (pickCust.longitude || 0).toString(),
|
||||||
|
processing: '',
|
||||||
|
ready: '',
|
||||||
|
remarks: '',
|
||||||
|
smsdelivery: isSms,
|
||||||
|
subcategoryid: +subCatId,
|
||||||
|
taxamount: 0.0,
|
||||||
tenantid: tenant.tenantid,
|
tenantid: tenant.tenantid,
|
||||||
totaltax: 0,
|
tenantuserid: parseInt(localStorage.getItem('userid')),
|
||||||
totime: selectedtime.split('-')[1],
|
collectionamt: +collectionamt || 0,
|
||||||
weight: weight,
|
|
||||||
quantity: +quantity || 1
|
quantity: +quantity || 1
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -631,8 +645,8 @@ const Createorder1 = () => {
|
|||||||
email: pickCust.email || '',
|
email: pickCust.email || '',
|
||||||
firstname: pickCust.firstname || '',
|
firstname: pickCust.firstname || '',
|
||||||
landmark: pickCust.landmark || '',
|
landmark: pickCust.landmark || '',
|
||||||
latitude: String(pickLat),
|
latitude: (pickCust.latitude || 0).toString(),
|
||||||
longitude: String(pickLng),
|
longitude: (pickCust.longitude || 0).toString(),
|
||||||
locationid: pickCust.deliverylocationid || 0,
|
locationid: pickCust.deliverylocationid || 0,
|
||||||
postcode: pickCust.postcode || '',
|
postcode: pickCust.postcode || '',
|
||||||
primaryaddress: 1,
|
primaryaddress: 1,
|
||||||
@@ -657,8 +671,8 @@ const Createorder1 = () => {
|
|||||||
email: dropCust.email || '',
|
email: dropCust.email || '',
|
||||||
firstname: dropCust.firstname || '',
|
firstname: dropCust.firstname || '',
|
||||||
landmark: dropCust.landmark || '',
|
landmark: dropCust.landmark || '',
|
||||||
latitude: String(dropLat),
|
latitude: (dropCust.latitude || 0).toString(),
|
||||||
longitude: String(dropLng),
|
longitude: (dropCust.longitude || 0).toString(),
|
||||||
locationid: dropCust.deliverylocationid || 0,
|
locationid: dropCust.deliverylocationid || 0,
|
||||||
postcode: dropCust.postcode || '',
|
postcode: dropCust.postcode || '',
|
||||||
primaryaddress: 1,
|
primaryaddress: 1,
|
||||||
@@ -683,7 +697,7 @@ const Createorder1 = () => {
|
|||||||
opentoast('Enter Pickup Postcode ', 'warning', 2000);
|
opentoast('Enter Pickup Postcode ', 'warning', 2000);
|
||||||
} else if (!pickCust.landmark) {
|
} else if (!pickCust.landmark) {
|
||||||
opentoast('Enter Pickup Landmark ', 'warning', 2000);
|
opentoast('Enter Pickup Landmark ', 'warning', 2000);
|
||||||
} else if (!Number(pickLat) || !Number(pickLng)) {
|
} else if (!pickCust.latitude || !pickCust.longitude) {
|
||||||
opentoast('Could not locate Pickup address on map, please recheck the address', 'error', 3000);
|
opentoast('Could not locate Pickup address on map, please recheck the address', 'error', 3000);
|
||||||
} else if (!dropCust.firstname) {
|
} else if (!dropCust.firstname) {
|
||||||
opentoast('Enter Drop Contact Name ', 'warning', 2000);
|
opentoast('Enter Drop Contact Name ', 'warning', 2000);
|
||||||
@@ -699,7 +713,7 @@ const Createorder1 = () => {
|
|||||||
opentoast('Enter Drop postcode ', 'warning', 2000);
|
opentoast('Enter Drop postcode ', 'warning', 2000);
|
||||||
} else if (!dropCust.landmark) {
|
} else if (!dropCust.landmark) {
|
||||||
opentoast('Enter Drop Landmark ', 'warning', 2000);
|
opentoast('Enter Drop Landmark ', 'warning', 2000);
|
||||||
} else if (!Number(dropLat) || !Number(dropLng)) {
|
} else if (!dropCust.latitude || !dropCust.longitude) {
|
||||||
opentoast('Could not locate Drop address on map, please recheck the address', 'error', 3000);
|
opentoast('Could not locate Drop address on map, please recheck the address', 'error', 3000);
|
||||||
} else if (!selectedtime) {
|
} else if (!selectedtime) {
|
||||||
opentoast('Choose deliverytime ', 'warning', 2000);
|
opentoast('Choose deliverytime ', 'warning', 2000);
|
||||||
|
|||||||
Reference in New Issue
Block a user