Subversion Repositories SmartDukaan

Rev

Show changed files | Directory listing | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
36144 6 h 11 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/ Wire Credit Note on debit note refund — proper CN numbering and persistence

refundOrder(debitNoteId):
- Generate CN number via SellerWarehouse.creditNoteSequence (CN-{prefix}{seq})
- Persist CreditNote record (type=RETURNS) in transaction.credit_note
- Persist CreditNoteLine per returned item with tax rates from original order
- Generate CRN e-invoice IRN on NIC referencing original invoice
- Non-fatal: CN/IRN failure doesn't block the refund
 
36143 6 h 19 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/ Wire Credit Note e-invoice generation on debit note refund

refundOrder(debitNoteId):
- After wallet refund and status updates, generate CRN e-invoice on NIC
- Credit Note number: CN-{debitNoteNumber}
- References original transaction invoice via PrecDocDtls
- Non-fatal: CRN failure doesn't block the refund
- Supports multiple CRNs per invoice (partial returns over time)
 
36142 6 h 51 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/ Prevent duplicate SALE_RET scans — fix double wallet refund bug

receiveDebitNoteItems():
- Build alreadyReturnedSet from existing SALE_RET/DOA_IN/SALE_RET_UNUSABLE scans
- Serialized: throw exception if IMEI already returned against same order
- Non-serialized: include existing return count in over-return check

processInvoiceReturn():
- Same alreadyReturnedSet check — skip with warning if already returned

Prevents the bug where same IMEI is returned, re-sold, then returned again
against the original order causing duplicate wallet refund.
 
36141 7 h 5 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/integrations/gstpro/ Fix Credit Note: PrecDocDtls must be a list for NIC API. Sandbox verified all 3 flows: IRN generate, IRN cancel (within 24h), Credit Note CRN (past 24h)  
36140 7 h 23 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/integrations/gstpro/ Handle IRN cancellation with 24h window + Credit Note fallback

cancelInvoiceGst(invoiceNumber, reason, creditNoteNumber):
- Within 24h: cancel IRN directly (EWB auto-cancelled by NIC)
- Past 24h: generate Credit Note e-invoice (DocType=CRN) referencing original invoice
- DC invoices: cancel standalone EWB regardless of time

generateCreditNoteIrn(originalInvoice, creditNoteNo, reason):
- Same endpoint as IRN generation but DocType=CRN
- RefDtls.PrecDocDtls references original invoice number and date
- No EWB details in credit note
- IRN persisted in einvoice_details table

Sandbox verified: CRN generation works with DocType=CRN
 
36139 7 h 36 m ranu /trunk/ code for socket snapshot  
36138 8 h 15 m amit /trunk/profitmandi-common/src/main/java/com/spice/profitmandi/common/util/ Delivery Challan: show CHALLAN DETAILS and Challan No instead of INVOICE DETAILS and Invoice No  
36137 8 h 18 m amit /trunk/profitmandi-common/src/main/java/com/spice/profitmandi/common/util/ Indian currency formatting: lakh/crore amount in words + Indian comma style (1,25,129.00) for all money fields in invoice table and summary  
36136 9 h 31 m amit /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/ Fix date formatting: use dateFormatter (dd/MM/yyyy) instead of toLocalDate() in all GRN correction views  
36135 9 h 56 m amit /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/warehouse/ Include correction To Item IDs in itemMap so item names resolve in approval view  
36134 10 h 0 m amit /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/ Fix item description: use getItemDescription() (brand+model+number+color) instead of just modelName  
36133 10 h 3 m amit /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/ GRN correction approval: add GRN By column  
36132 10 h 10 m amit /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/ GRN correction views: add invoice date, show item names in qty corrections, wrap JS in Velocity literal blocks  
36131 10 h 37 m amit /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/ Fix Velocity parse error: wrap JS in literal block to prevent jQuery $ conflicts  
36130 10 h 45 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Generate standalone EWB for Delivery Challans > 20K

GstProService.generateEwbForDeliveryChallan():
- Builds GENEWAYBILL payload from order data (seller, buyer, items, transport)
- docType=CHL, subSupplyType=8, transactionType=4 (intra-state same GSTIN)
- Zero GST, items aggregated by HSN
- Stores EWB number in einvoice_details table
- Skips if EWB already exists for the invoice

InvoiceService.saveInvoice():
- DC invoices with total > 20K trigger standalone EWB generation
- EWB failure is non-fatal (logged, doesn't block PDF generation)
 
36129 11 h 7 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/integrations/gstpro/ Refactor EWB API to use headers (consistent with e-invoice auth style)

Auth: params in headers (aspid, password, Gstin, Username, Ewbpwd)
Generate/Cancel: credentials in headers, action in query param
Extracted common ewbApiCall() with retry-on-GSP752 logic
getEwbApiHeaders() in GstProAuthService for reuse
 
36128 11 h 36 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/integrations/gstpro/ EWB auth with Redis cache (6h TTL) + auto-retry on token expiry

GstProAuthService: getEwbAuthToken() cached via redisCacheManager (6h TTL),
fetchEwbAuthToken() for direct API call on cache miss/eviction.

GstProService: getEwbToken() tries cache first, evicts and retries on failure.
generateStandaloneEwb/cancelEwb retry once on GSP752 (expired token) error.
 
36127 11 h 42 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/integrations/gstpro/ Add standalone E-Way Bill APIs for Delivery Challans

- getEwbAuthToken(): authenticate with EWB portal (separate from e-invoice auth)
- generateStandaloneEwb(): GENEWAYBILL action for DC documents
- cancelEwb(): CANEWB action with reason code 3 (order cancelled)
- Sandbox and production endpoints configured
- Uses existing RestClient, no external library needed
- Sandbox verified: auth, generate, cancel all working
 
36126 13 h 51 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/order/ Change FOFO invoice PDF title from Retailer Invoice to Tax Invoice  
36125 14 h 40 m ranu /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/monitors/ weekly rating system live on calling module  

Show All