Merge branch 'laxman_dev' of http://10.10.1.3:2010/sipl/re-workflow-fe into laxman_dev
This commit is contained in:
commit
4b725e42ca
@ -229,12 +229,15 @@ export function DealerCompletionDocumentsModal({
|
|||||||
const hasPhotos = activityPhotos.length > 0;
|
const hasPhotos = activityPhotos.length > 0;
|
||||||
const hasDescription = completionDescription.trim().length > 0;
|
const hasDescription = completionDescription.trim().length > 0;
|
||||||
|
|
||||||
|
const hasValidExpenseItems = expenseItems.length > 0 &&
|
||||||
|
expenseItems.every(item => item.description.trim() !== '' && item.amount >= 0);
|
||||||
|
|
||||||
const hasHSNSACErrors = isNonGst ? false : expenseItems.some(item => {
|
const hasHSNSACErrors = isNonGst ? false : expenseItems.some(item => {
|
||||||
const { isValid } = validateHSNSAC(item.hsnCode, item.isService);
|
const { isValid } = validateHSNSAC(item.hsnCode, item.isService);
|
||||||
return !isValid;
|
return !isValid;
|
||||||
});
|
});
|
||||||
|
|
||||||
return hasCompletionDate && hasDocuments && hasPhotos && hasDescription && !hasHSNSACErrors;
|
return hasCompletionDate && hasDocuments && hasPhotos && hasDescription && hasValidExpenseItems && !hasHSNSACErrors;
|
||||||
}, [activityCompletionDate, completionDocuments, activityPhotos, completionDescription, isNonGst, expenseItems]);
|
}, [activityCompletionDate, completionDocuments, activityPhotos, completionDescription, isNonGst, expenseItems]);
|
||||||
|
|
||||||
// Get today's date in YYYY-MM-DD format for max date
|
// Get today's date in YYYY-MM-DD format for max date
|
||||||
@ -1358,9 +1361,9 @@ export function DealerCompletionDocumentsModal({
|
|||||||
<div className="bg-amber-50 border border-amber-200 rounded-lg p-3 sm:p-4 flex items-start gap-2 sm:gap-3">
|
<div className="bg-amber-50 border border-amber-200 rounded-lg p-3 sm:p-4 flex items-start gap-2 sm:gap-3">
|
||||||
<CircleAlert className="w-4 h-4 sm:w-5 sm:h-5 text-amber-600 flex-shrink-0 mt-0.5" />
|
<CircleAlert className="w-4 h-4 sm:w-5 sm:h-5 text-amber-600 flex-shrink-0 mt-0.5" />
|
||||||
<div className="text-xs sm:text-sm text-amber-800">
|
<div className="text-xs sm:text-sm text-amber-800">
|
||||||
<p className="font-semibold mb-1">Missing Required Information</p>
|
<p className="font-semibold mb-1">Missing or Invalid Information</p>
|
||||||
<p>
|
<p>
|
||||||
Please ensure completion date, at least one document/photo, and description are provided before submitting.
|
Please ensure completion date, documents/photos, description, and expense details (non-negative amounts and descriptions) are provided before submitting.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user