(root)/ – Rev 37290
Rev 37289 |
Last modification |
Compare with Previous |
View Log
| RSS feed
Last modification
- Rev 37290 2026-08-11 02:29:47
- Author: amit
- Log message:
- Credit Note IRN: credit only the returned units, not the whole invoice
refundOrder persisted the CreditNote and its lines from the returned
inventory items, but then called generateCreditNoteIrn(invoiceNumber, ...),
which rebuilt the NIC payload by re-reading the original invoice - every
line at billed quantity. A 1-pc DOA return against NSDL37092 therefore
tried to register a CN covering the full invoice (2 phones + 27 carry
bags, Rs 26,664.27) against a Rs 13,332 wallet refund, and the legacy
4-digit HSN on the carry-bag line failed NIC validation with error 2311.
The wallet credit, the CreditNote row and its lines were always correct;
only the e-invoice payload was wrong.
- InvoiceService.getInvoicePdfModelForIrn: optional returnedQtyByOrderId
restricts the item list to the returned orders and prices each line at
the returned quantity. The existing single-arg method delegates with
null, so invoice PDF generation is unchanged. Margin-scheme, delivery
challan, IMEI-suffix and HSN handling apply to the reduced line as-is.
- GstProService.generateCreditNoteIrn: 4-arg overload taking the map; the
3-arg version delegates with null for whole-invoice returns.
- PurchaseReturnServiceImpl.refundOrder: passes orderReturnQtyMap, which
was already built for the ReturnOrderInfo rows.
Verified against the NIC sandbox using the real NSDL37092 rows: the old
payload is rejected with error 2311, the new payload is accepted
(DocTyp CRN, ItemCnt 1, MainHsnCode 85171300, TotInvVal 13331.99).
Not covered here: applyInvoiceReturnViaCreditNote still sends the whole
invoice, so an invoice partially returned earlier re-credits those units.