Subversion Repositories SmartDukaan

Rev

Show changed files | Directory listing | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
37089 6 d 23 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ Optimize partnerPerformance data access: fofoId-scoped + month-bucketed query variants

- Order: fofoId-scoped billing-avg named queries (replace all-partner scan+filter)
- MonthlyTarget: selectByDatesAndFofoId batches 7 per-month lookups into one
- SchemeInOut/OfferPayout: month-bucketed ...ByMonth earnings queries collapsing the
per-month loop; new MonthlyBrandIncomeModel / MonthlyOfferPayoutModel
All additive; existing shared queries and their callers unchanged.
 
37055 11 d 0 h ranu /trunk/ allocation of hid and opening stock suggested qty logic updated as per tarun sir  
36981 19 d 23 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/ changeList  
36980 19 d 23 h ranu /trunk/ optimize bi report  
36972 20 d 1 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ changeList  
36967 20 d 20 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/ Add date-range query methods for approved HID allocations (filter by approval date)  
36920 26 d 20 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ Remove unused Digify retailer integration (controllers, entity, repository, model, views, JS handler, assets)  
36901 28 d 18 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ HID requested-allocations: fully batch HID computation (batched tier + SUM(current_qty) + 2-day sales per pair, replacing per-partner query) and add Pending list pagination  
36898 28 d 20 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ HID allocation: batch the requested-allocations screen (catalog-filtered HID query + batched billed/activated serial lookups) and add approved-list pagination (50/page) reusing GenericRepository paginated+count helpers  
36894 28 d 23 h amit /trunk/profitmandi-dao/src/main/ HID allocation: requested qty is now an additional one-time allowance (purchase-limit override, HID target unchanged); add approved_by column; add 5-day billed/activated serial lookups for the edit screen  
36708 54 d 21 h aman /trunk/ Fix:Credit note report fix  
36679 56 d 1 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/ Filter focused model shortage report by brands partner stocked in past 30 days  
36649 59 d 1 h vikas /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ Reverted deleted files  
36646 59 d 1 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/ delete commit  
36508 72 d 12 h ranu /trunk/ code committed for scheme and offers earning for v2  
36471 77 d 18 h vikas /trunk/ V2 Profile Update APIs  
36407 84 d 18 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 84 d 20 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 84 d 23 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 89 d 21 h ranu /trunk/ rbm rating dashboard view commited  

Show All