Subversion Repositories SmartDukaan

Rev

Show changed files | Directory listing | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
36508 4 d 2 h ranu /trunk/ code committed for scheme and offers earning for v2  
36471 9 d 8 h vikas /trunk/ V2 Profile Update APIs  
36407 16 d 8 h amit /trunk/profitmandi-dao/src/main/ Sale-return reversal: cancellability gate, CN on approve, INV reject, ROI semantics

GstProService.isIrnCancellable(invoiceNumber): predicate extracted from
the inline 24h check used in cancelInvoiceGst, so callers outside the
service can decide branching without duplicating the rule. DC and no-IRN
cases return false — those paths use EWB cancel / credit-note issuance.

PurchaseReturnServiceImpl: split single-phase return-receive into
submitReceiptForApproval + applyReceipt. Submit persists per-item return
type on PurchaseReturnItem so apply (called inline on auto-approve, or
later from refundOrder when finance clicks Process Refund) can replay
the scan loop without the original itemReturnTypes map.

processInvoiceReturn(autoApprove=true) no longer creates a PRO. Routes
through new cancelInvoiceFully which calls gstProService.cancelInvoiceGst
(the canonical IRN-cancel path setting Order.status=INVOICE_CANCELLED)
and adds wallet credit + warehouse-stock restoration. Cancellations now
live on Order/EInvoiceDetails screens, not in the returns ledger —
matches standard ERP practice and the existing cancelInvoiceGst flow.

processInvoiceReturn(autoApprove=false) creates an INV-prefix PRO in
pending state and calls notifyFinanceApprovalPending (Finance L1+L2
emails resolved dynamically from PositionRepository).

approveInvoiceReturn now runs applyInvoiceReturnViaCreditNote — raises
local CreditNote + CreditNoteLine rows (sequential CN# from
SellerWarehouse), issues CRN at GST via generateCreditNoteIrn, restores
warehouse stock, populates ReturnOrderInfo (this path IS a customer
return without DN — ROI is the right anchor), credits wallet. Drops the
old applyInvoiceReturnEffects helper which mishandled both cancel and
return-via-CN as the same path.

rejectInvoiceReturn: new method for finance to reject pending INV PROs.
Sale stands — only stamps reject_timestamp/reject_remark. No inventory,
no wallet, no GST action, no ROI. Closes the gap where finance had
Approve as the only option on a pending INV PRO.

refundOrder gains a refund guard (PRO must exist, not refunded, not
rejected) and applyReceipt-if-needed at the top — Finance's existing
Process Refund button now drives approve+refund atomically.

PurchaseReturnOrderRepository.selectByWarehouseIdsAndDateRange: Hibernate
query for a date-range listing on /return/invoice (default last 30
days, limit 200).

@Transactional(rollbackFor=Exception.class) at class level —
ProfitMandiBusinessException is checked, so Spring's default rollback
didn't fire on guard failures, allowing partial commits. Closing that
silently broken behaviour.

LineItemImei N+1 fix: receiveDebitNoteItems / refundOrder / rejectReturn
each iterated orders calling selectByLineItemId per row. Switched to the
existing batch selectByLineItemIds(List).

Email template finance-receipt-approval-pending.vm and SQL migration
migration_imei_net_margin_modal_api.sql added (registers the
/getImeiNetMarginModal endpoint in dtr.api and grants access to the
roles that currently access /order).
 
36405 16 d 10 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Fix duplicate SchemeInOut on concurrent GRN: SELECT FOR UPDATE on inventory_item before createSchemeInOut to serialise concurrent GRN calls per IMEI  
36397 16 d 13 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Scheme item windowing: add startDate/endDate per scheme_item.

Each fofo.scheme_item row now carries an optional [start_date, end_date]
window so the same (scheme_id, catalog_id) pair can be applicable for
different date ranges. Backward compatible: NULL window = always active.

- SchemeItem entity: composite (schemeId, catalogId) PK -> surrogate
long id (IDENTITY), unique (catalog_id, scheme_id, start_date, end_date),
audit cols (updatedBy, updatedOn).
- Scheme + TagListing named queries: gated by
'(si.start_date is null or :onDate between si.start_date and si.end_date)'.
- SchemeItemRepository: + selectById, selectBySchemeId,
existsOverlapping (half-open, with self-exclude), selectItemsOutsideWindow.
- SchemeService: + updateSchemeItemWindow / addSchemeItemWithDates /
clampSchemeItems with containment + overlap validation; drop dead
getTotalMargin.
- SchemeServiceImpl.processSchemeOut: pin scheme resolution to each
IMEI's GRN billing date (Purchase -> Order.billingTimestamp via
PurchaseService.getBillingDateOfPurchase) instead of fofoOrder
createTimestamp, aligning OUT with the existing IN behaviour.
 
36356 21 d 11 h ranu /trunk/ rbm rating dashboard view commited  
36336 21 d 16 h ranu /trunk/ sales dispostion updated  
36316 23 d 9 h aman /trunk/ Fix:Migrate legacy Purchase Return flow (Report + Bulk Create + Debit Notes) into FOFO  
36291 26 d 15 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/ Optimize slow DB queries: split fan-out join, FORCE INDEX on wallet history

- CurrentInventorySnapshotRepositoryImpl.getSpilitStockBatch: split
LEFT-JOIN fan-out into two independent aggregates (~8x faster);
fixes SUM(DISTINCT) undercounting bug where same availability/qty
values across items collapsed into one.
- UserWalletRepositoryImpl.getWarehousewiseCollection: HQL -> native
SQL with FORCE INDEX(idx_uwh_wallet_timestamp) so timestamp range
filters at index level instead of row filter (~4x faster, 3.1s -> 722ms).
- PartnerCollectionPlanRepositoryImpl.getCommitmentCollectionSummary:
Criteria 3-Root CROSS JOIN -> explicit INNER JOIN + FORCE INDEX
(idx_uwh_wallet_timestamp) (~3.5x faster).
 
36287 27 d 8 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ sales dispostion updated  
36285 27 d 8 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ Force idx_order_customer_billing index on spilitStock queries — optimizer picks wrong index (978K global scan vs 902 rows per partner)  
36282 27 d 8 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ Optimize /partner/hidAllocation: replace N+1 getSpilitStock loop with batch call, add fofo_id filter to sales subquery, fix DATE() preventing index usage on create_timestamp  
36261 30 d 9 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ Fix JPQL: replace date() and string literals with typed :billingStartDate parameter, use NOT EXISTS instead of NOT IN  
36259 30 d 12 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ Fix: re-apply tertiary query, add NOT NULL guard in NOT IN subquery, @Transactional(readOnly) on repo reads, fix persist ordering in saveActivation  
36252 31 d 17 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ Add tertiary IMEI activation query, shared saveActivation method, fix date() query performance  
36152 41 d 16 h aman /trunk/ Feat:Request Panel for brand dealer registration,Admin panel for managing WOD request templates  
36101 44 d 10 h ranu /trunk/ weekly rating system live on calling module  
36008 57 d 8 h aman /trunk/ Fix:Redesign the Po Approval page add total count, Add mail in bcc for testing , partnerpending task api response optimisation,  
35997 60 d 8 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Invoice Return: PurchaseReturnOrder entity, ReturnAction DAO enum, receive/refund/reject service, ReturnOrderInfo selectByOrderId  
35942 69 d 9 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Reduce log noise: demote verbose INFO to DEBUG, fix empty list SQLGrammarException in getItemAvailability, fix copy-paste bug in PartnerTypeChangeServiceImpl, fix string concatenation in log statements  

Show All