Compare commits
3 Commits
5162f6553c
...
8cdc91354a
| Author | SHA1 | Date | |
|---|---|---|---|
| 8cdc91354a | |||
|
|
a87c790a62 | ||
|
|
e92e3f57fb |
@ -229,12 +229,15 @@ export function DealerCompletionDocumentsModal({
|
||||
const hasPhotos = activityPhotos.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 { isValid } = validateHSNSAC(item.hsnCode, item.isService);
|
||||
return !isValid;
|
||||
});
|
||||
|
||||
return hasCompletionDate && hasDocuments && hasPhotos && hasDescription && !hasHSNSACErrors;
|
||||
return hasCompletionDate && hasDocuments && hasPhotos && hasDescription && hasValidExpenseItems && !hasHSNSACErrors;
|
||||
}, [activityCompletionDate, completionDocuments, activityPhotos, completionDescription, isNonGst, expenseItems]);
|
||||
|
||||
// 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">
|
||||
<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">
|
||||
<p className="font-semibold mb-1">Missing Required Information</p>
|
||||
<p className="font-semibold mb-1">Missing or Invalid Information</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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -65,7 +65,8 @@ export function Form16SubmissionResult() {
|
||||
return (
|
||||
<RequestSubmissionSuccess
|
||||
status={result.status}
|
||||
requestId={result.requestNumber ?? result.requestId}
|
||||
requestId={result.requestId}
|
||||
requestDisplayId={result.requestNumber ?? result.requestId}
|
||||
creditNoteNumber={result.creditNoteNumber}
|
||||
message={result.message}
|
||||
onComplete={onComplete}
|
||||
|
||||
@ -13,7 +13,10 @@ export type SubmissionResultStatus = 'success' | 'mismatch' | 'duplicate' | 'err
|
||||
interface RequestSubmissionSuccessProps {
|
||||
/** 'success' = matched & credit note; 'mismatch' = value mismatch; 'duplicate' = already submitted; 'error' = request received / processing */
|
||||
status: SubmissionResultStatus;
|
||||
/** Internal UUID requestId (used for API actions like contact-admin). */
|
||||
requestId: string;
|
||||
/** Human-readable request number shown in UI. */
|
||||
requestDisplayId?: string;
|
||||
creditNoteNumber?: string | null;
|
||||
/** Optional message (e.g. from API or error) */
|
||||
message?: string | null;
|
||||
@ -26,6 +29,7 @@ interface RequestSubmissionSuccessProps {
|
||||
export function RequestSubmissionSuccess({
|
||||
status,
|
||||
requestId,
|
||||
requestDisplayId,
|
||||
creditNoteNumber,
|
||||
message,
|
||||
onComplete,
|
||||
@ -35,6 +39,16 @@ export function RequestSubmissionSuccess({
|
||||
const isSuccess = status === 'success';
|
||||
const isMismatch = status === 'mismatch';
|
||||
const isMissing26AsMismatch = isMismatch && (message || '').toLowerCase().includes('26as') && (message || '').toLowerCase().includes('no 26as');
|
||||
const mismatchSummary = (() => {
|
||||
const m = (message || '').toLowerCase();
|
||||
if (m.includes('no 26as')) return '26AS data is not uploaded for this TAN / FY / Quarter.';
|
||||
if (m.includes('amount mismatch')) return 'TDS amount in Form 16A does not match 26AS amount.';
|
||||
if (m.includes('tan')) return 'TAN details in Form 16A do not match 26AS records.';
|
||||
if (m.includes('pan')) return 'PAN details in Form 16A do not match 26AS records.';
|
||||
if (m.includes('quarter')) return 'Quarter in Form 16A does not match 26AS records.';
|
||||
if (m.includes('financial year') || m.includes('fy')) return 'Financial year in Form 16A does not match 26AS records.';
|
||||
return 'Form 16A details do not match with 26AS data.';
|
||||
})();
|
||||
|
||||
const onContactAdmin = async () => {
|
||||
try {
|
||||
@ -165,8 +179,7 @@ export function RequestSubmissionSuccess({
|
||||
Resubmit the form carefully.
|
||||
</p>
|
||||
<p className="text-gray-600 text-sm mt-1">
|
||||
Form 16A details did not match with 26AS data. Please verify the certificate and
|
||||
resubmit with correct details.
|
||||
{mismatchSummary} Please verify the certificate and resubmit with correct details.
|
||||
</p>
|
||||
{message && (
|
||||
<div className="mt-3 p-3 bg-amber-50 border border-amber-200 rounded-md">
|
||||
@ -210,7 +223,7 @@ export function RequestSubmissionSuccess({
|
||||
}`}
|
||||
>
|
||||
<p className={`text-sm mb-1 ${isDuplicate ? 'text-red-700' : 'text-gray-600'}`}>Request ID</p>
|
||||
<p className={`font-mono tracking-wide ${isDuplicate ? 'text-red-800 font-semibold' : 'text-gray-900'}`}>{requestId || '—'}</p>
|
||||
<p className={`font-mono tracking-wide ${isDuplicate ? 'text-red-800 font-semibold' : 'text-gray-900'}`}>{requestDisplayId || requestId || '—'}</p>
|
||||
{isSuccess && creditNoteNumber && (
|
||||
<>
|
||||
<p className="text-sm text-gray-600 mt-3 mb-1">Credit Note Number</p>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user