Subversion Repositories SmartDukaan

Rev

Show changed files | Directory listing | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
36535 6 h 21 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/ moveToBill: fix response unwrapping, auto-move qty=1 orders to warehouse with gross stock  
36532 13 h 55 m amit /trunk/ Fix moveToBill to use net availability, add bulk PO items upload UI with template download  
36516 3 d 6 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/ Refactor CreditNoteServiceImpl: use atStartOfDay for cnDate, extract DN generation into REQUIRES_NEW transactional method, cache generated CN PDFs to disk in downloadCN  
36505 4 d 17 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/ DN date: use CN month-end instead of CN date — avoids NIC 30-day backdating rejection  
36504 4 d 18 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ DN generation: DUPIRN reconciliation flow + fix cnDate to use NIC acknowledge date + extract /A prefix handling  
36502 5 d 3 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ DN generation for cancelled MARGINS CNs + fix /A CN prefix extraction NPE

- Add generateDebitNotesForCancelled(List<String>) for explicit CN list
- Add selectByCreditNoteNumbers repository method
- Fix GstProService sandbox: use SANDBOX_GST_NUMBER before isGstEnabled check, sandbox buyer details
- Fix prefix extraction NPE for /A suffixed CN numbers (getCreditNotePdfModel, existingCNMap, extractPrefix)
 
36498 5 d 9 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Add CN_CANCELLATION type for cancellation-reversal debit notes, distinguish from regular MARGINS  
36497 5 d 9 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/ Fix dedup key to distinguish CRN vs DBN — existing CRN no longer blocks DBN for same vendor  
36496 5 d 9 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/ Consolidate 3 redundant eInvoiceDetails lookups into single fetch in issueMonthlyMarginsCN  
36495 5 d 9 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/ Fix cn_date to use end-of-month instead of IRN ack timestamp, remove unused persistEi fetch  
36494 5 d 9 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/ CreditNoteServiceImpl: use end-of-month CN date, pass cnDate to IRN wrappers, mark generateDebitNotesForCancelled as exception path  
36475 8 d 6 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/ Remove reissueMarginsCN, recoverMonthlyMarginsCN, resendCNReport — one-time recovery methods no longer needed. Fix SGST/IGST CSV header swap (was swapped since r36196). Clean up unused imports/fields.  
36474 8 d 6 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/ Fix: guard empty-list bulk queries in issueMonthlyMarginsCN to prevent crash on dev (no margin data)  
36453 11 d 7 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Fix NPE in credit note IRN: modularize InvoiceService.getInvoicePdfModel into core (ForIrn) and enrichment (EWB/eInvoice), switch purchase return CN to model-based IRN builder  
36438 12 d 14 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Fix SD Credit over-utilization: use live loan SUM + row lock + sanction guard

- blockLoan: use SELECT FOR UPDATE to prevent concurrent orders from both passing credit check
- processLoanRequest: replace stored utilized_limit counter with live SUM(pending_amount) from loan table
- processLoanRequest + getAvailableAmount: only add sanction amount if not already used today
- Prevents credit limit from going negative due to counter drift or race conditions
 
36434 14 d 3 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/ Fix: wrap PDF file save in try-catch for test reissue method (path may not exist locally)  
36431 14 d 3 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Add reissueMarginsCN: reissue MARGINS credit notes with /A suffix, March 31 book date, Delhi GST skip, consolidated partner emails  
36429 14 d 7 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Fix credit limit settlement not happening on billing and post-billing cancellation

createLoanForBilling has REQUIRES_NEW (added for lock isolation against
order row locks held by the billing method). Inside that new transaction it
queried orders to find which were just billed — but the billing timestamps
set in the suspended outer transaction are invisible, so the condition
always evaluates FALSE when all orders are billed in one call. The limit
block is never converted to a loan and never released.

Fix: remove the order query. The caller already passes invoiceAmount (sum
of walletAmount for the billed orders). Use it directly with Math.min to
cap at pendingAmount. REQUIRES_NEW kept for lock isolation.

Also: cancelInvoiceFully and applyInvoiceReturnViaCreditNote (post-billing
invoice cancellation/return paths) credit the partner wallet but never
settle the non-limit loan created during billing. Added settleLoan call
after wallet credit in both paths, guarded by settledOn == null check.

Data defect: 95 stuck limit blocks totaling Rs 56.95 lakh across partners.
Most have no actual loan created. Needs one-time remediation via
fixBlockedCredit() in ScheduledTasks.
 
36411 15 d 12 h amit /trunk/ Fix lock contention: REQUIRES_NEW for wallet lock in createLoanForBilling, handle HDFC payment deadlock as duplicate  
36399 16 d 11 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Replace mailSender (SendGrid) with gmailRelaySender - SendGrid API key expired/revoked  

Show All