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',
'senderaddress*': 'locationaddress',
'receivername*': 'firstname',
'receiverphone*': 'contactno',
receiverphone: 'contactno',
'receiveralternatephone*': 'altcontactno',
receiverfulladdress: 'address',
receiverlatitude: 'latitude',
receiverlongitude: 'longitude',
'itemdescription*': 'description',
Quantity: 'quantity',
' Collect Cash': 'collectionamt'
' Collect Cash': 'collectionamt',
customerDeliveryTime: 'customerdeliverytime',
kitchenPickupTime: 'kitchenpickuptime'
};
const handleFileDirectUpload = (event) => {
@@ -490,11 +492,14 @@ const MultipleOrders = () => {
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))
);
if (missingCols.length > 0) {
opentoast(`Missing columns: ${missingCols.join(', ')}`, 'warning');
if (missingRequired.length > 0) {
opentoast(`Missing required columns: ${missingRequired.join(', ')}`, 'warning', 3000);
setUsers([]);
return;
}
setUsers(mappedData);