updated the csv file and added the customerDeliveryTime and kitchenPickupTime

This commit is contained in:
2026-06-05 05:03:49 +05:30
parent 225c5912f5
commit b477ad7023

View File

@@ -448,14 +448,16 @@ const MultipleOrders = () => {
'senderphone*': 'locationcontact', 'senderphone*': 'locationcontact',
'senderaddress*': 'locationaddress', 'senderaddress*': 'locationaddress',
'receivername*': 'firstname', 'receivername*': 'firstname',
'receiverphone*': 'contactno', receiverphone: 'contactno',
'receiveralternatephone*': 'altcontactno', 'receiveralternatephone*': 'altcontactno',
receiverfulladdress: 'address', receiverfulladdress: 'address',
receiverlatitude: 'latitude', receiverlatitude: 'latitude',
receiverlongitude: 'longitude', receiverlongitude: 'longitude',
'itemdescription*': 'description', 'itemdescription*': 'description',
Quantity: 'quantity', Quantity: 'quantity',
' Collect Cash': 'collectionamt' ' Collect Cash': 'collectionamt',
customerDeliveryTime: 'customerdeliverytime',
kitchenPickupTime: 'kitchenpickuptime'
}; };
const handleFileDirectUpload = (event) => { const handleFileDirectUpload = (event) => {
@@ -490,11 +492,14 @@ const MultipleOrders = () => {
return newRow; return newRow;
}); });
const missingCols = Object.keys(headerMap).filter( const requiredCols = Object.keys(headerMap).filter((k) => k.trim().endsWith('*'));
const missingRequired = requiredCols.filter(
(clientCol) => !headers.includes(normalizeHeader(clientCol)) (clientCol) => !headers.includes(normalizeHeader(clientCol))
); );
if (missingCols.length > 0) { if (missingRequired.length > 0) {
opentoast(`Missing columns: ${missingCols.join(', ')}`, 'warning'); opentoast(`Missing required columns: ${missingRequired.join(', ')}`, 'warning', 3000);
setUsers([]);
return;
} }
setUsers(mappedData); setUsers(mappedData);