Subversion Repositories SmartDukaan

Rev

Show changed files | Directory listing | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
37777 29 m amit /trunk/profitmandi-fofo/src/ returns: finance endpoint to reverse a return whose goods never reached the warehouse

PUT /return/reverse?imei=&reason=&dryRun= calls ReturnReversalService (r37776) for one
IMEI. Finance only, same canRefund gate as the refund it undoes, and dryRun defaults to
true so a call without it reports the plan and writes nothing.

ReturnReversalTest covers the four cases against the local database with NIC on the
sandbox: the dry run writes nothing, a note past its 24h window issues a DBN and undoes
every effect of the refund (warehouse scan and stock, partner stock and offers, order
status, wallet, return item, debit note, audit row), a note inside the window has its IRN
cancelled and drops out of the statement, and bad input or a second reversal is refused.
Run it as `gradle :test --tests ...` - without the colon the filter also reaches
profitmandi-common and fails with "No tests found".
 
37776 30 m amit /trunk/profitmandi-dao/src/main/ returns: reverse a refunded debit-note return whose goods never reached the warehouse

Once a return was refunded nothing could undo it - rejectReturn refuses an already
refunded one - so a return booked and paid for goods that never arrived left phantom
warehouse stock, the unit missing from partner stock, the order marked returned, a
wallet credit and a filed credit note, with no way back.

ReturnReversalService.reverse(imei, reason, by, dryRun) undoes exactly one unit:
the warehouse return scan (row deleted so a genuine return later is not rejected as a
duplicate) and the stock it added, partner stock with its schemes/price drop/offers,
the order's return quantity and status, the wallet refund as a REVERSAL entry, and the
return item / debit note. Guards refuse anything that has moved since the refund, and a
dry run reports the plan without writing.

The credit note follows movement and the NIC clock: inside the 24h window, and only
when the note credits nothing but this unit, its IRN is cancelled and the note marked
cancelled; past it a DBN with its own IRN is issued against the note
(CreditNoteService.issueReturnReversalDebitNote, stored as CN_CANCELLATION with no
margin month so the statement does not show it twice - the wallet REVERSAL is the
statement line); a note never filed at NIC is voided locally. Every local write happens
first and NIC last, so a refusal rolls the whole reversal back.

fofo.return_reversal (return_reversal_20260921.sql) records each reversal and, unique
per return item, makes it once-only. Also adds cancelled=0 to the RETURNS_CN branches of
the account statement queries, without which a cancelled note keeps crediting the
statement - no current effect, no RETURNS note is cancelled today.
 
37775 1 h 6 m ranu /trunk/ aging po approval process  
37774 1 h 23 m amit /trunk/profitmandi-fofo/src/main/ feat: show sanction request investment numbers as whole rupees

Adds a global $nf0 Velocity formatter (en-IN grouping, 0 decimals, HALF_UP) and
uses it for Total/Short Investment on the sanction request and RBM L2 screens.
 
37773 1 h 34 m amit /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/ fix: show live partner investment on sanction request approval screens

Total/short investment on /getSanctionRequest, /getRbmL2SanctionRequest and the
row re-render after submit now read the 2-minute partner_investment snapshot via
PartnerInvestmentService instead of yesterday's partner_daily_investment row.
 
37772 1 h 52 m amit /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/v2/controller/fofo/ fix(supplier): V2 supplier save derives state from GSTIN  
37771 1 h 52 m amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ fix(movement): movement POs no longer auto-close; open movement PO digest to Warehouse L1/L2 at 09:00 and 17:00  
37770 1 h 52 m amit /trunk/profitmandi-fofo/src/main/ fix(movement): GRN of a movement invoice validated against its own PO + billed IMEIs; Reopen removed; PO list shows Created By; supplier state from GSTIN; jsVersion 436  
37769 1 h 52 m amit /trunk/profitmandi-dao/src/ fix(movement): receive a movement invoice only against its own PO, stop auto-closing movements, cancel reduces the PO line

- GRN: movement invoice resolves invoice -> orders -> transaction -> its own movement PO (or a receive-only PO
from the billing warehouse); supplier/warehouse keyed at entry must match; scanned IMEIs must be the billed ones
- Cancelling an unbilled movement order takes its qty off the PO line; PO CLOSED/PRECLOSED once nothing is open
- reopenedAt removed (movements no longer auto-close); PO records createdBy
- SupplierStateResolver: a supplier's state is derived from its GSTIN on save
- sql: add_po_created_by (applied), drop_po_reopened_at (run AFTER fofo/cron/web deploy)
 
37768 1 h 52 m amit /trunk/profitmandi-common/src/main/java/com/spice/profitmandi/common/util/ feat(supplier): GstinUtil - read state code / PAN from a GSTIN so the GSTIN decides a supplier's state  
37767 2 h 22 m amit /trunk/profitmandi-dao/src/ fix(orders): movements ship from their source only; a row reserved beyond its stock gives nothing

Internal movement orders were allocated by the partner allocator, which spills a source
shortfall to every warehouse the brand mapping links to the destination - stock billed
there has no PO to be received against (PO 54279: 3 units put on Jaipur for a UP->Delhi
movement). createTransactionInternally now keeps the source's own rows only; a shortfall
still parks on the source's Dummy.

getItemQty took min(qty, netAvailability) on a row reserved beyond its stock - always the
case on a Dummy holding an open order - so a -1 row added a unit to the shortfall, which
then parked on the Dummy as an extra order (24 Sep: 9 units raised for a movement of 8,
refused by the cart-value guard). Rows with nothing free are now skipped and no longer
offset another row's free stock in the warehouse total.

Removes the empty, uncalled markOrdersAsGrnCompleted.
 
37766 3 h 24 m amit /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/v2/controller/fofo/ feat(store-closure): V2 closeStore goes through StoreClosureService; access checks read StoreAccess

Same rules as the fofo portal (dao r37764): reason, remark and approval mail required; mohit.gulati
removed from extend billing.
 
37765 3 h 24 m amit /trunk/profitmandi-fofo/src/main/ feat(store-closure): closure popup with reason, remark and approval mail upload

- Close Store (inactive stores page and deactivate flow) opens one shared popup; /closeStore
delegates to StoreClosureService (dao r37764)
- store status access checks read StoreAccess lists; mohit.gulati removed from extend billing
- jsVersion 435
 
37764 3 h 24 m amit /trunk/profitmandi-dao/src/main/ feat(store-closure): require reason, remark and approval mail to close a store; mail closure report

- fofo.store_closure audit table (reason, remark, approval document, closed_by); migration applied on hadb1
- StoreClosureService: validates and closes, queues closure report with approval attached to the
partner's Sales L2, top 3 Sales levels, top Accounts level and the closer
- StoreAccess: single home for store close/deactivate/activate/extend-billing access lists;
neeraj.gupta can close, mohit.gulati removed from extend billing
 
37763 5 h 40 m ranu /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/ aging po approval process  
37762 7 h 29 m ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/ aging po approval process  
37761 7 h 47 m ranu /trunk/ aging po approval process  
37760 1 d 1 h vikas /trunk/profitmandi-fofo/src/main/ Upload directory and Data correction for lead  
37759 1 d 1 h vikas /trunk/ LMS Call for App  
37758 1 d 1 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/ aging po approval process  

Show All