from 16 submission validation show
This commit is contained in:
parent
def22be1b1
commit
e92e3f57fb
@ -65,7 +65,8 @@ export function Form16SubmissionResult() {
|
|||||||
return (
|
return (
|
||||||
<RequestSubmissionSuccess
|
<RequestSubmissionSuccess
|
||||||
status={result.status}
|
status={result.status}
|
||||||
requestId={result.requestNumber ?? result.requestId}
|
requestId={result.requestId}
|
||||||
|
requestDisplayId={result.requestNumber ?? result.requestId}
|
||||||
creditNoteNumber={result.creditNoteNumber}
|
creditNoteNumber={result.creditNoteNumber}
|
||||||
message={result.message}
|
message={result.message}
|
||||||
onComplete={onComplete}
|
onComplete={onComplete}
|
||||||
|
|||||||
@ -13,7 +13,10 @@ export type SubmissionResultStatus = 'success' | 'mismatch' | 'duplicate' | 'err
|
|||||||
interface RequestSubmissionSuccessProps {
|
interface RequestSubmissionSuccessProps {
|
||||||
/** 'success' = matched & credit note; 'mismatch' = value mismatch; 'duplicate' = already submitted; 'error' = request received / processing */
|
/** 'success' = matched & credit note; 'mismatch' = value mismatch; 'duplicate' = already submitted; 'error' = request received / processing */
|
||||||
status: SubmissionResultStatus;
|
status: SubmissionResultStatus;
|
||||||
|
/** Internal UUID requestId (used for API actions like contact-admin). */
|
||||||
requestId: string;
|
requestId: string;
|
||||||
|
/** Human-readable request number shown in UI. */
|
||||||
|
requestDisplayId?: string;
|
||||||
creditNoteNumber?: string | null;
|
creditNoteNumber?: string | null;
|
||||||
/** Optional message (e.g. from API or error) */
|
/** Optional message (e.g. from API or error) */
|
||||||
message?: string | null;
|
message?: string | null;
|
||||||
@ -26,6 +29,7 @@ interface RequestSubmissionSuccessProps {
|
|||||||
export function RequestSubmissionSuccess({
|
export function RequestSubmissionSuccess({
|
||||||
status,
|
status,
|
||||||
requestId,
|
requestId,
|
||||||
|
requestDisplayId,
|
||||||
creditNoteNumber,
|
creditNoteNumber,
|
||||||
message,
|
message,
|
||||||
onComplete,
|
onComplete,
|
||||||
@ -35,6 +39,16 @@ export function RequestSubmissionSuccess({
|
|||||||
const isSuccess = status === 'success';
|
const isSuccess = status === 'success';
|
||||||
const isMismatch = status === 'mismatch';
|
const isMismatch = status === 'mismatch';
|
||||||
const isMissing26AsMismatch = isMismatch && (message || '').toLowerCase().includes('26as') && (message || '').toLowerCase().includes('no 26as');
|
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 () => {
|
const onContactAdmin = async () => {
|
||||||
try {
|
try {
|
||||||
@ -165,8 +179,7 @@ export function RequestSubmissionSuccess({
|
|||||||
Resubmit the form carefully.
|
Resubmit the form carefully.
|
||||||
</p>
|
</p>
|
||||||
<p className="text-gray-600 text-sm mt-1">
|
<p className="text-gray-600 text-sm mt-1">
|
||||||
Form 16A details did not match with 26AS data. Please verify the certificate and
|
{mismatchSummary} Please verify the certificate and resubmit with correct details.
|
||||||
resubmit with correct details.
|
|
||||||
</p>
|
</p>
|
||||||
{message && (
|
{message && (
|
||||||
<div className="mt-3 p-3 bg-amber-50 border border-amber-200 rounded-md">
|
<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={`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 && (
|
{isSuccess && creditNoteNumber && (
|
||||||
<>
|
<>
|
||||||
<p className="text-sm text-gray-600 mt-3 mb-1">Credit Note Number</p>
|
<p className="text-sm text-gray-600 mt-3 mb-1">Credit Note Number</p>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user