Android_Retail/src/utils/calculations.js

12 lines
389 B
JavaScript
Raw Normal View History

2026-02-24 14:40:44 +05:30
export const calculateOverAllQtyLimit = (orders) => {
return orders?.reduce((acc, cartItem) => {
return acc + (cartItem?.OrderQty || 0);
}, 0)
2026-02-25 16:26:02 +05:30
}
export const capitalizeFirstLetter = (text) => {
if (!text) return '';
return text.charAt(0).toUpperCase() + text.slice(1);
};
export const isIndianMobile = (mobile) => /^\d{10}$/.test(mobile) && /^[6-9]/.test(mobile);