amount sign fixed
This commit is contained in:
parent
5e29adef1b
commit
d7f44057cc
@ -67,6 +67,14 @@ export async function getDealerCodeForUser(userId: string, userEmail?: string |
|
||||
const SECTION_26AS_194Q = '194Q';
|
||||
const AMOUNT_MATCH_TOLERANCE = 1;
|
||||
|
||||
/**
|
||||
* Form 16 INCOMING CSV `TDS_AMT`: amount digits first, sign last — credit `123.45+`, debit `123.45-`.
|
||||
*/
|
||||
function formatForm16IncomingCsvTdsAmt(amount: number, kind: 'credit' | 'debit'): string {
|
||||
const n = Math.abs(Number(amount)).toFixed(2);
|
||||
return kind === 'credit' ? `${n}+` : `${n}-`;
|
||||
}
|
||||
|
||||
type Latest26asRow = {
|
||||
panNumber: string | null;
|
||||
amountPaid: number | null;
|
||||
@ -1042,7 +1050,7 @@ async function run26asMatchAndCreditNote(submission: Form16aSubmission): Promise
|
||||
DLR_TAN_NO: tanNumber,
|
||||
'FIN_YEAR&QUARTER': finYearAndQuarter,
|
||||
DOC_DATE: docDate,
|
||||
TDS_AMT: `+${Number(Math.abs(tdsAmount)).toFixed(2)}`,
|
||||
TDS_AMT: formatForm16IncomingCsvTdsAmt(tdsAmount, 'credit'),
|
||||
TDS_CERTIFICATE_NO: certificateNumber,
|
||||
};
|
||||
const fileName = `${cnNumber}.csv`;
|
||||
@ -2819,7 +2827,7 @@ export async function process26asUploadAggregation(uploadLogId: number): Promise
|
||||
DLR_TAN_NO: tanNumber,
|
||||
'FIN_YEAR&QUARTER': finYearAndQuarter,
|
||||
DOC_DATE: docDate,
|
||||
TDS_AMT: `-${Math.abs(Number(amount)).toFixed(2)}`,
|
||||
TDS_AMT: formatForm16IncomingCsvTdsAmt(Number(amount), 'debit'),
|
||||
TDS_CERTIFICATE_NO: creditNoteCertNumber,
|
||||
};
|
||||
const fileName = `${debitNum}.csv`;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user