<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SmartDukaan &#x2013; /</title><description>WebSVN RSS feed &#x2013; SmartDukaan</description><lastBuildDate>Tue, 29 Sep 2026 09:42:24 +0530</lastBuildDate><generator>WebSVN 2.8.6-DEV</generator><language>en</language><link>https://svn.smartdukaan.com/log.php?repname=SmartDukaan&amp;path=%2F&amp;max=40&amp;peg=37613</link><atom:link href="https://svn.smartdukaan.com/rss.php?peg=37613&amp;repname=SmartDukaan" rel="self" type="application/rss+xml" />
<item><pubDate>Mon, 14 Sep 2026 03:20:42 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37613 – Receive internal transfer stock that was billed but never GRNed ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 2 file(s) modified&lt;/strong&gt;&lt;br/&gt;Receive internal transfer stock that was billed but never GRNed&lt;br /&gt;
&lt;br /&gt;
Stock moved between our own warehouses is dispatched against an internal purchase order and&lt;br /&gt;
billed, but the destination warehouse still has to receive it by hand through the portal. Where&lt;br /&gt;
that never happened the units exist on an invoice and nowhere in inventory, and there is no way&lt;br /&gt;
to clear a backlog of them short of keying each invoice in again.&lt;br /&gt;
&lt;br /&gt;
This adds a cron one-off that receives them. Per invoice it builds the rows the Excel GRN upload&lt;br /&gt;
would have carried and hands them to PurchaseOrderService.addPORowModels, which creates the&lt;br /&gt;
supplier invoice, the purchase and the inventory items in a single call, so none of receiving is&lt;br /&gt;
reimplemented here - the portal and this take the same path and can only ever agree.&lt;br /&gt;
&lt;br /&gt;
It is deliberately narrow about what it will touch. Only INTERNAL buyers, because nothing should&lt;br /&gt;
be able to receive a partner&apos;s goods on their behalf. Only invoices with no supplier invoice&lt;br /&gt;
already recorded, so a repeat run skips what it has already done rather than receiving twice.&lt;br /&gt;
Only invoices resolving to a single purchase order, since addPORowModels resolves one order for&lt;br /&gt;
the whole map it is given and would otherwise attribute an invoice to the wrong one - for the&lt;br /&gt;
same reason each invoice is passed on its own. A serialized line whose serial number is missing&lt;br /&gt;
aborts its invoice instead of creating a unit no scan could ever match.&lt;br /&gt;
&lt;br /&gt;
Each invoice commits or rolls back on its own, so one bad invoice cannot undo the ones already&lt;br /&gt;
received, and a dry run reports what it would receive without writing anything.&lt;br /&gt;
&lt;br /&gt;
The receipt is recorded against the destination warehouse, which is what warehouse inventory is&lt;br /&gt;
keyed by. The buyer on the order is read only to confirm the store is internal; partner side&lt;br /&gt;
inventory is a separate receipt and is not touched.&lt;/div&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/Application.java&lt;br /&gt;+ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/migrations/InternalGrnTask.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37613&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37613&amp;peg=37613</guid></item>
<item><pubDate>Sun, 13 Sep 2026 02:37:36 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37612 – Value an internal PO&apos;s cart the same way the transaction ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Value an internal PO&apos;s cart the same way the transaction validates it&lt;br /&gt;
&lt;br /&gt;
Creating an internal PO failed with &quot;Cart Value-Payment value mismatch&quot; whenever a line&lt;br /&gt;
carried paise and the quantity was more than a handful. Two places were computing the same&lt;br /&gt;
cart total from the same stored float through two different decimal conversions, so they&lt;br /&gt;
disagreed on the value of prices binary cannot hold exactly.&lt;br /&gt;
&lt;br /&gt;
createOrderInternally read WarehouseLineItem.unitPrice through String.valueOf, which&lt;br /&gt;
resolves a float via Float.toString and yields 10499.99, while createTransactionForWarehouse&lt;br /&gt;
re-values the persisted cart lines with BigDecimal.valueOf, which widens that same float to&lt;br /&gt;
double and yields 10499.990234375. The per-unit gap is around two ten-thousandths of a rupee;&lt;br /&gt;
quantity multiplies it, and it crosses the 0.001 tolerance the validator allows at a quantity&lt;br /&gt;
of five. Round prices are exact in binary and passed, which is why this looked intermittent&lt;br /&gt;
rather than total - across randomised carts the old arithmetic disagreed 98% of the time.&lt;br /&gt;
&lt;br /&gt;
The total is no longer computed in its own loop. It is derived from the cart items that are&lt;br /&gt;
about to be written, using the conversion and the line-inclusion rule the validator applies,&lt;br /&gt;
so both sides are the same function over the same rows and cannot drift apart. That also&lt;br /&gt;
brings across two rules the PO side never had: quantities of zero or less, which&lt;br /&gt;
addItemsToCart drops and which therefore never reach the validated total, and the one paisa&lt;br /&gt;
carry bag, which the validator treats as a marker line rather than a billed one. Either of&lt;br /&gt;
those reaching an internal PO would have failed it outright, and a carry bag is only a&lt;br /&gt;
rounding error away from the paisa-per-unit pricing used for FOC stock.&lt;br /&gt;
&lt;br /&gt;
The wallet top-up still truncates the total to whole rupees, and now lands within a rupee of&lt;br /&gt;
where it did before, well inside the twenty rupee buffer it already carried. Nothing outside&lt;br /&gt;
internal PO creation is touched: the validator, bulk orders and the refurb split keep their&lt;br /&gt;
existing numbers, and the wallet debit is driven by the order totals, not by this value.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/PurchaseOrderServiceImpl.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37612&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37612&amp;peg=37613</guid></item>
<item><pubDate>Sun, 13 Sep 2026 01:49:52 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37611 – Pin the unrecorded-stock behaviour  Covers the shape behind the ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Pin the unrecorded-stock behaviour&lt;br /&gt;
&lt;br /&gt;
Covers the shape behind the 2026-09-12 bulk-upload failures: an item with some stock&lt;br /&gt;
traceable to a vendor and some with no recorded origin must move in one order, at the&lt;br /&gt;
traceable stock&apos;s price. Two genuinely different vendors must still refuse.&lt;br /&gt;
&lt;br /&gt;
Also pins that no refusal message quotes a zero price from either side - including when the&lt;br /&gt;
oldest stock is itself the unrecorded pile, which is how &apos;at 0.00 each&apos; reached users.&lt;br /&gt;
&lt;br /&gt;
Requires profitmandi-dao r37610.&lt;/div&gt;~ /trunk/profitmandi-fofo/src/test/java/com/spice/profitmandi/service/warehouse/InternalMovementPricingServiceTest.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37611&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37611&amp;peg=37613</guid></item>
<item><pubDate>Sun, 13 Sep 2026 01:49:46 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37610 – Carry stock with no recorded origin along instead of refusing ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Carry stock with no recorded origin along instead of refusing the movement&lt;br /&gt;
&lt;br /&gt;
A movement was refused whenever an item had some stock traceable to a vendor and some whose&lt;br /&gt;
origin was never recorded, telling the user to raise a second purchase order for the rest.&lt;br /&gt;
Unrecorded stock has no vendor of its own, so that second order carried no more information&lt;br /&gt;
than the first - and the prices were identical anyway: boAt 34336 at 85 both ways, Samsung&lt;br /&gt;
36343/36344 at 1099, Riversong 36589 at 524, 36590 at 657. Bulk uploads of 200 rows were&lt;br /&gt;
dying on the first such item, repeatedly.&lt;br /&gt;
&lt;br /&gt;
Only a second ORIGINAL VENDOR stops an order now, which is the case the refusal was for: a&lt;br /&gt;
line item holds one price per item, so units genuinely bought from someone else cannot ride&lt;br /&gt;
along. Unrecorded units move with the oldest stock at its price. They are not attributed to&lt;br /&gt;
that vendor as a fact - nothing persists origin today, but if that is ever added they must&lt;br /&gt;
not be stamped from this.&lt;br /&gt;
&lt;br /&gt;
The refusal also reported unrecorded stock as moving at 0.00. Such a bucket carries no price&lt;br /&gt;
until it is resolved from the catalog when units are allocated, so reading one off it early&lt;br /&gt;
reported perfectly good stock as worthless. Both sides of the message now resolve the price&lt;br /&gt;
the same way the allocation does.&lt;br /&gt;
&lt;br /&gt;
Three tests added: a mixed traceable/unrecorded item moves in one order, two genuinely&lt;br /&gt;
different vendors still refuse, and no message quotes a zero price from either side.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/InternalMovementPricingServiceImpl.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37610&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37610&amp;peg=37613</guid></item>
<item><pubDate>Sat, 12 Sep 2026 18:29:44 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37609 – Offer the stock a warehouse actually holds when ordering from ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 4 file(s) modified&lt;/strong&gt;&lt;br/&gt;Offer the stock a warehouse actually holds when ordering from an internal supplier&lt;br /&gt;
&lt;br /&gt;
The purchase order item picker listed whatever the supplier had vendor catalog pricing rows&lt;br /&gt;
for. For an outside vendor that is right - the order is for stock nobody holds yet, so their&lt;br /&gt;
catalogue is the only sensible list. For one of our own warehouses it is not: a movement can&lt;br /&gt;
only send stock that is standing there, and the pricing rows were never a statement about&lt;br /&gt;
stock. Vendor 275 was offering 6,845 items while Noida held 79; Delhi 6,637 against 330.&lt;br /&gt;
&lt;br /&gt;
It also made the picker depend on data the movement no longer needs. Pricing for internal&lt;br /&gt;
suppliers is derived from the stock itself since r37603, so those rows are inert - but&lt;br /&gt;
clearing them emptied the picker completely, because selectVendorItems joins&lt;br /&gt;
VendorCatalogPricing to Item and an internal supplier then matched nothing.&lt;br /&gt;
&lt;br /&gt;
Internal suppliers now list distinct items with currentQuantity &gt; 0 in their mapped&lt;br /&gt;
warehouse. External suppliers are untouched and still list from vendor catalog pricing.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/warehouse/WarehouseInventoryItemRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/warehouse/WarehouseInventoryItemRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/WarehouseService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/WarehouseServiceImpl.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37609&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37609&amp;peg=37613</guid></item>
<item><pubDate>Sat, 12 Sep 2026 17:57:09 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37608 – Select a default schema before the multi-table deletes  MySQL&apos;s ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Select a default schema before the multi-table deletes&lt;br /&gt;
&lt;br /&gt;
MySQL&apos;s &apos;DELETE alias FROM&apos; form needs a default database even when every table is fully&lt;br /&gt;
qualified, so the deletes aborted with &apos;No database selected&apos; while the backups above them&lt;br /&gt;
had already been written. Added USE inventory so the script runs end to end regardless of&lt;br /&gt;
how the client is invoked.&lt;br /&gt;
&lt;br /&gt;
Run on hadb1 2026-09-12: 12,372 + 17,241 + 33,252 internal-supplier rows removed, external&lt;br /&gt;
pricing untouched at 40,670 / 45,049 / 68,749.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/resources/sql/drop_internal_vendor_pricing_20260912.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37608&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37608&amp;peg=37613</guid></item>
<item><pubDate>Sat, 12 Sep 2026 17:45:19 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37607 – SQL to remove vendor pricing held against internal suppliers  ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;SQL to remove vendor pricing held against internal suppliers&lt;br /&gt;
&lt;br /&gt;
Nothing reads these since r37603-05: an internal movement is priced from the stock being&lt;br /&gt;
moved, resolved to the original external vendor, and receiving no longer validates price for&lt;br /&gt;
those movements. A stale row would silently win over the derived price if any lookup were&lt;br /&gt;
reintroduced, so they are worse than inert.&lt;br /&gt;
&lt;br /&gt;
Backs every row up to a _bak_ table and deletes against those frozen backups rather than&lt;br /&gt;
re-reading supplier.internal, so what is removed is exactly what is preserved. Run only&lt;br /&gt;
after the fofo WAR carrying the warehouse-grn-request-items.vm guard (r37606) is live.&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/drop_internal_vendor_pricing_20260912.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37607&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37607&amp;peg=37613</guid></item>
<item><pubDate>Sat, 12 Sep 2026 17:45:11 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37606 – Render a dash, not a raw reference, when there is ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Render a dash, not a raw reference, when there is no system price&lt;br /&gt;
&lt;br /&gt;
warehouse-grn-request-items.vm called getTransferPrice() straight off a map lookup with no&lt;br /&gt;
null guard. An internal movement has no vendor circular to quote a system price from, so&lt;br /&gt;
that lookup misses and Velocity prints the literal reference text into the System Price&lt;br /&gt;
column - it fails quietly rather than erroring, so the screen just looks broken.&lt;br /&gt;
&lt;br /&gt;
Renders &apos;-&apos; instead, which is what the column actually means for a movement priced from the&lt;br /&gt;
stock itself. Prerequisite for removing internal-supplier pricing rows.&lt;/div&gt;~ /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/warehouse-grn-request-items.vm&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37606&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37606&amp;peg=37613</guid></item>
<item><pubDate>Sat, 12 Sep 2026 17:01:11 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37605 – Use the derived movement price in the v2 vendor controller ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Use the derived movement price in the v2 vendor controller too&lt;br /&gt;
&lt;br /&gt;
Same change as the fofo controller: /getPricing returns the movement price for internal&lt;br /&gt;
suppliers, and addVendorPricingIfMissing is gone. This copy is component-scanned, so&lt;br /&gt;
leaving it behind would have kept writing the pricing rows the fofo side stopped writing.&lt;br /&gt;
&lt;br /&gt;
Requires profitmandi-dao r37603.&lt;/div&gt;~ /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/v2/controller/fofo/V2FofoVendorController.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37605&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37605&amp;peg=37613</guid></item>
<item><pubDate>Sat, 12 Sep 2026 17:00:50 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37604 – Show the derived movement price when building an internal purchase ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 4 file(s) modified&lt;/strong&gt;&lt;br/&gt;Show the derived movement price when building an internal purchase order&lt;br /&gt;
&lt;br /&gt;
Both places a price reaches a purchase order now use the movement price for internal&lt;br /&gt;
suppliers: the single lookup as an item is added on screen, and the per-item resolution&lt;br /&gt;
behind a bulk upload, which does the whole file in one pass instead of loading a circular&lt;br /&gt;
the sending warehouse does not have.&lt;br /&gt;
&lt;br /&gt;
Removes addVendorPricingIfMissing, which fired only when someone typed a numeric item id&lt;br /&gt;
into the search box, and only for Samsung or non-handsets, writing permanent approved&lt;br /&gt;
pricing rows onto the internal supplier from a hardcoded source vendor. Bulk upload never&lt;br /&gt;
called it at all, which is why the same item could be added on screen but rejected in a&lt;br /&gt;
file.&lt;br /&gt;
&lt;br /&gt;
Tests cover what is decided once origins are known - drawing the oldest stock first,&lt;br /&gt;
refusing a quantity that spans two original vendors while naming how many can move and&lt;br /&gt;
asking for a separate order, refusing an unmapped supplier, and falling back to the catalog&lt;br /&gt;
without ever recording an inferred vendor as though it were known.&lt;br /&gt;
&lt;br /&gt;
Requires profitmandi-dao r37603.&lt;/div&gt;~ /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/VendorController.java&lt;br /&gt;~ /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/warehouse/PurchaseOrderController.java&lt;br /&gt;+ /trunk/profitmandi-fofo/src/test/java/com/spice/profitmandi/service/warehouse&lt;br /&gt;+ /trunk/profitmandi-fofo/src/test/java/com/spice/profitmandi/service/warehouse/InternalMovementPricingServiceTest.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37604&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37604&amp;peg=37613</guid></item>
<item><pubDate>Sat, 12 Sep 2026 17:00:04 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37603 – Price internal warehouse movements from the stock&apos;s original vendor  ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 11 file(s) modified&lt;/strong&gt;&lt;br/&gt;Price internal warehouse movements from the stock&apos;s original vendor&lt;br /&gt;
&lt;br /&gt;
Stock moving between our own warehouses was priced from the sending internal supplier&apos;s&lt;br /&gt;
own vendor catalog, which only ever holds prices copied from elsewhere - so every hop let&lt;br /&gt;
the price drift further from what the group actually paid, and a movement was blocked&lt;br /&gt;
outright whenever that supplier happened to have no row for the item.&lt;br /&gt;
&lt;br /&gt;
It is now derived from the stock being moved: the original EXTERNAL vendor is established&lt;br /&gt;
per unit and that vendor&apos;s current catalog price is used. Origin is looked for in&lt;br /&gt;
descending order of certainty - the serial traced back to the external purchase that first&lt;br /&gt;
brought the unit in, then the unit&apos;s own inbound PO when that was external, both of which&lt;br /&gt;
are facts that survive any number of internal hops. Non-serialised stock that has already&lt;br /&gt;
moved internally has no recoverable origin at all, since fungible units carry no identity&lt;br /&gt;
and the movement records nothing linking the receiving row to its source, so those fall&lt;br /&gt;
back to the most recent externally approved price for the catalog and are never recorded&lt;br /&gt;
as though their vendor were known.&lt;br /&gt;
&lt;br /&gt;
A purchase order carries one price per item, so an item can only move from one original&lt;br /&gt;
vendor at a time. Where a requested quantity would run past the oldest vendor&apos;s stock into&lt;br /&gt;
another&apos;s, this refuses and reports how many can move now and at what price, leaving the&lt;br /&gt;
second order to whoever is moving the stock, rather than averaging the two or silently&lt;br /&gt;
splitting the order. Each order therefore stays attributable to one vendor.&lt;br /&gt;
&lt;br /&gt;
Receiving no longer validates price for these movements: both sides of the comparison come&lt;br /&gt;
from the same derivation, so a mismatch cannot mean anything. That also removes a null&lt;br /&gt;
dereference in GrnRequestServiceImpl, which assumed every supplier has a circular.&lt;br /&gt;
&lt;br /&gt;
Removes addVendorPricingIfMissing, which wrote permanent approved pricing rows onto internal&lt;br /&gt;
suppliers sourced from hardcoded vendor 334 for Samsung or an arbitrary findFirst() vendor&lt;br /&gt;
otherwise, stamped with hardcoded auth ids. Those rows are now not just unnecessary but&lt;br /&gt;
harmful: they would pin a stale price that wins over the derived one.&lt;br /&gt;
&lt;br /&gt;
Verified against live data: covers every unit in every warehouse with none unresolved,&lt;br /&gt;
agrees exactly with the origin join the FOCO/ImeiSupplierPricing report already runs in&lt;br /&gt;
production, and prices 12,305 of 13,589 units within 2% of what was actually paid.&lt;br /&gt;
Resolution takes 0.7ms for one item and 1.1ms for ten.&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/InternalMovementAllocationModel.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/InternalMovementPriceModel.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/inventory/VendorCatalogPricingLogRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/inventory/VendorCatalogPricingLogRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/warehouse/WarehouseInventoryItemRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/warehouse/WarehouseInventoryItemRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/GrnRequestServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/InternalMovementPricingService.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/InternalMovementPricingServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/InvoiceServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/PurchaseOrderServiceImpl.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37603&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37603&amp;peg=37613</guid></item>
<item><pubDate>Sat, 12 Sep 2026 14:51:26 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37602 – Remove no-op refreshSnapshotAgeing task; restore originalInventoryItemId backfill call  refreshSnapshotAgeing ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 2 file(s) modified&lt;/strong&gt;&lt;br/&gt;Remove no-op refreshSnapshotAgeing task; restore originalInventoryItemId backfill call&lt;br /&gt;
&lt;br /&gt;
refreshSnapshotAgeing ran every 30 minutes aggregating warehouse.inventoryItem.rootInvoiceDate,&lt;br /&gt;
a column nothing ever wrote, so its UPDATE ... JOIN matched zero rows on every run and&lt;br /&gt;
currentinventorysnapshot.oldest_invoice_date was never populated on any of 11,686 rows.&lt;br /&gt;
Removed along with the sessionFactory field it was the only consumer of.&lt;br /&gt;
&lt;br /&gt;
Application.java had migrations.migrateWarehouseOriginalInventoryItemId(batchSize) commented&lt;br /&gt;
out while still logging &apos;Starting migration...&apos; and &apos;Migration completed.&apos;, so&lt;br /&gt;
--migrateOriginalInventoryItemId reported success while doing nothing. Restored the call;&lt;br /&gt;
it remains opt-in via the CLI flag and cannot fire on its own.&lt;br /&gt;
&lt;br /&gt;
Requires profitmandi-dao r37601 (entity fields removed).&lt;/div&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/Application.java&lt;br /&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ScheduledTasks.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37602&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37602&amp;peg=37613</guid></item>
<item><pubDate>Sat, 12 Sep 2026 14:51:19 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37601 – Remove dead stock-ageing fields rootInvoiceDate and oldest/newest_invoice_date  rootInvoiceDate on ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 3 file(s) modified&lt;/strong&gt;&lt;br/&gt;Remove dead stock-ageing fields rootInvoiceDate and oldest/newest_invoice_date&lt;br /&gt;
&lt;br /&gt;
rootInvoiceDate on WarehouseInventoryItem had no writer anywhere in the codebase and&lt;br /&gt;
was read only by ScheduledTasks.refreshSnapshotAgeing(), which therefore matched zero&lt;br /&gt;
rows on every 30-minute run. oldest/newest_invoice_date on SaholicInventorySnapshot&lt;br /&gt;
were written only by that task and read by nothing. Verified on prod: null on all&lt;br /&gt;
1,528,669 inventoryItem rows and all 11,686 snapshot rows respectively.&lt;br /&gt;
&lt;br /&gt;
Stock ageing that is actually in use resolves the original external supplier at query&lt;br /&gt;
time by serialNumber + supplier.internal = false, and does not read these columns.&lt;br /&gt;
originalInventoryItemId is deliberately left alone - it is populated on 157,020 rows.&lt;br /&gt;
&lt;br /&gt;
Includes sql/drop_dead_ageing_columns_20260912.sql to drop the columns. Run it only&lt;br /&gt;
after web, fofo and cron are all on this build.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/inventory/SaholicInventorySnapshot.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/warehouse/WarehouseInventoryItem.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/drop_dead_ageing_columns_20260912.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37601&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37601&amp;peg=37613</guid></item>
<item><pubDate>Fri, 11 Sep 2026 20:40:13 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37600 – Replace entity loads with scalar aggregates in the investment sweep ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 4 file(s) modified&lt;/strong&gt;&lt;br/&gt;Replace entity loads with scalar aggregates in the investment sweep&lt;br /&gt;
&lt;br /&gt;
Order.lineItem is a ManyToOne with FetchType.EAGER, so getInTransitOrders() and&lt;br /&gt;
selectPendingGrnOrders() pulled ~6,865 Order entities plus a LineItem for each&lt;br /&gt;
into the session every two minutes - all dirty-checked at flush - when the sweep&lt;br /&gt;
only reads getRetailerId() and getTotalAmount(). That, plus ~1,690 FofoStore and&lt;br /&gt;
~984 PartnerInvestment rows, put roughly 17,000 entities in one session per pass&lt;br /&gt;
and is most of the ~10s each sweep was taking.&lt;br /&gt;
&lt;br /&gt;
Adds two scalar named queries returning (retailerId, sum(totalAmount)) grouped by&lt;br /&gt;
partner. A projection never hydrates the entity, so the eager association never&lt;br /&gt;
fires - about 13,700 entities become ~1,000 rows. The predicates copy&lt;br /&gt;
selectOrders(ids, pendingOrderStatus) and selectPendingGrnOrders(ids) exactly,&lt;br /&gt;
including the SD_START_DATE floor, and the comment on the named queries says to&lt;br /&gt;
change them together.&lt;br /&gt;
&lt;br /&gt;
Deliberately NOT done by making lineItem lazy: that mapping is shared by every&lt;br /&gt;
Order consumer in the codebase and flipping it globally is a far wider change than&lt;br /&gt;
this needs.&lt;br /&gt;
&lt;br /&gt;
Entity-returning variants are untouched for their existing callers. Drops the now&lt;br /&gt;
unused sumOrderAmounts helper and the TransactionService dependency.&lt;br /&gt;
&lt;br /&gt;
Not a fix for a problem - the sweep was comfortably inside its 120s window at ~8%&lt;br /&gt;
duty. It removes waste that would matter if the cadence were ever shortened.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/transaction/Order.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/OrderRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/OrderRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/PartnerInvestmentSweepService.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37600&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37600&amp;peg=37613</guid></item>
<item><pubDate>Fri, 11 Sep 2026 20:09:50 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37599 – Reuse the managed snapshot row in the sweep instead of ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 2 file(s) modified&lt;/strong&gt;&lt;br/&gt;Reuse the managed snapshot row in the sweep instead of building a second instance&lt;br /&gt;
&lt;br /&gt;
Every sweep after the first failed with &apos;A different object with the same&lt;br /&gt;
identifier value was already associated with the session :&lt;br /&gt;
PartnerInvestment#107198&apos; and wrote nothing.&lt;br /&gt;
&lt;br /&gt;
selectByFofoIds returns managed entities. The loop then constructed a fresh&lt;br /&gt;
PartnerInvestment for the same id and called saveOrUpdate on it, which Hibernate&lt;br /&gt;
rejects. Sweep one survived only because the table was empty, so no row was&lt;br /&gt;
managed - the failure could not appear until a second run.&lt;br /&gt;
&lt;br /&gt;
Now mutates the row already in the session when there is one, falling back to a&lt;br /&gt;
new instance only for partners with no snapshot. The previous base and gross stock&lt;br /&gt;
are captured before mutation, since comparing the row against itself afterwards&lt;br /&gt;
would report nothing as ever changed.&lt;br /&gt;
&lt;br /&gt;
persist() is kept: a no-op for the managed rows (dirty checking flushes them), and&lt;br /&gt;
still the INSERT for partners appearing between sweeps.&lt;br /&gt;
&lt;br /&gt;
Drops baseDiffersFrom(), now unused - the comparison is against the captured prior&lt;br /&gt;
value, still rounded to paise by the setter on both sides.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/PartnerInvestment.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/PartnerInvestmentSweepService.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37599&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37599&amp;peg=37613</guid></item>
<item><pubDate>Fri, 11 Sep 2026 19:57:29 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37598 – Add missing @Transactional to the investment sweep  The sweep ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Add missing @Transactional to the investment sweep&lt;br /&gt;
&lt;br /&gt;
The sweep failed on every run with &apos;Could not obtain transaction-synchronized&lt;br /&gt;
Session for current thread&apos; and wrote nothing. BatchScheduledTasks deliberately&lt;br /&gt;
carries no class-level @Transactional - each partner gets its own via REQUIRES_NEW&lt;br /&gt;
in the helper beans - so the sweep ran outside a transaction and&lt;br /&gt;
sessionFactory.getCurrentSession() threw at the first repository call.&lt;br /&gt;
&lt;br /&gt;
PartnerLimitHelper already does this correctly with @Transactional(readOnly=true)&lt;br /&gt;
on its read phase; the sweep simply did not mirror it. Compilation cannot catch&lt;br /&gt;
this - only a run can.&lt;br /&gt;
&lt;br /&gt;
sweep() and refreshAgedStockDaily() both read and write, so they take a read-write&lt;br /&gt;
transaction. Annotations sit on the service rather than the caller because&lt;br /&gt;
BatchScheduledTasks is intentionally non-transactional, and the service is a&lt;br /&gt;
separate bean so the proxy applies.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/PartnerInvestmentSweepService.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37598&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37598&amp;peg=37613</guid></item>
<item><pubDate>Fri, 11 Sep 2026 19:55:40 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37597 – Register /agedAppleImeis for the partner role  RoleInterceptor authorises every ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Register /agedAppleImeis for the partner role&lt;br /&gt;
&lt;br /&gt;
RoleInterceptor authorises every non-admin request through&lt;br /&gt;
RoleManager.isAuthorizedURI(), which regex-matches the URI against dtr.api rows&lt;br /&gt;
reachable via dtr.role_api and throws GE_1004 when nothing matches. The new&lt;br /&gt;
aged-Apple IMEI endpoint (r37593) had no row, so partners would have been denied -&lt;br /&gt;
the Java change alone does not expose an endpoint.&lt;br /&gt;
&lt;br /&gt;
Adds the api row and links it to FOFO, mirroring /activatedImeis (id 215) and&lt;br /&gt;
/activated-imeis-grn-pending (id 285). FOFO_ADMIN needs no row because isAdmin()&lt;br /&gt;
short-circuits before the lookup.&lt;br /&gt;
&lt;br /&gt;
Applied to hadb1: api id 330, linked to role FOFO. Both inserts are guarded by&lt;br /&gt;
NOT EXISTS so the script is safe to re-run per environment.&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/register_aged_apple_imeis_api.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37597&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37597&amp;peg=37613</guid></item>
<item><pubDate>Fri, 11 Sep 2026 19:43:21 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37596 – Mirror the gateway sanction when a hard limit is released ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Mirror the gateway sanction when a hard limit is released&lt;br /&gt;
&lt;br /&gt;
/resetHardLimit set hard_limit=false and reverted credit_limit to suggested_limit&lt;br /&gt;
but never touched dtr.credit_account, so the SIDBI/SDDIRECT gateway kept the old&lt;br /&gt;
pinned sanction until some later full limit pass rewrote it. Releasing a hard&lt;br /&gt;
limit can move the number a long way - RJAMR501 Inder Mobile is pinned at 800,000&lt;br /&gt;
against a suggested 909,114, so the gateway would under-report him by 109,114.&lt;br /&gt;
&lt;br /&gt;
This was previously masked rather than absent: the 20-minute pass rewrote ~220&lt;br /&gt;
partners every run because float noise made almost every comparison look like a&lt;br /&gt;
change, which repaired the mirror by accident. Rounding that comparison to paise&lt;br /&gt;
(r37589) removed the accidental repair and moving the full pass to daily (r37595)&lt;br /&gt;
stretched the window to most of a day, so the gap is now worth closing properly.&lt;br /&gt;
&lt;br /&gt;
Mirrors sanctioned/available in the same request, matching what&lt;br /&gt;
/creditRequirement already does, and stamps update_timestamp so the change is&lt;br /&gt;
visible as a real limit movement.&lt;/div&gt;~ /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/SDCreditController.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37596&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37596&amp;peg=37613</guid></item>
<item><pubDate>Fri, 11 Sep 2026 19:24:56 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37595 – Move the full partner-limit pass from every 20 minutes to ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Move the full partner-limit pass from every 20 minutes to daily&lt;br /&gt;
&lt;br /&gt;
The 2-minute sweep already recalculates the limit for every partner whose base&lt;br /&gt;
moved, which covers investment and utilisation - the inputs that actually change.&lt;br /&gt;
The full 980-partner rescan only exists for inputs base cannot see: credit risk,&lt;br /&gt;
the SIDBI floor and hard_limit.&lt;br /&gt;
&lt;br /&gt;
Those move on a far slower clock. RISK_DECREASE_DAYS_THRESHOLD is 90 days, and&lt;br /&gt;
transaction.fofo_sidbi_sanction has had no new row since Oct 2024 and no recorded&lt;br /&gt;
settlement. Running the rescan 72 times a day to catch them was 71 wasted passes.&lt;br /&gt;
&lt;br /&gt;
Folded into the existing daily job, after the aged-stock refresh so the limit pass&lt;br /&gt;
sees haircuts for partners whose Apple or demo stock crossed its threshold&lt;br /&gt;
overnight. Leaves two scheduled jobs instead of three.&lt;br /&gt;
&lt;br /&gt;
Limit latency is unaffected - that is the 2-minute sweep&apos;s job and it is unchanged&lt;br /&gt;
(~3 partners per window show a changed base, peak 18). The --updatePartnerLimitWithBatch&lt;br /&gt;
CLI entrypoint is untouched for manual runs.&lt;/div&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ScheduledSkeleton.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37595&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37595&amp;peg=37613</guid></item>
<item><pubDate>Fri, 11 Sep 2026 19:22:09 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37594 – Format activated-stock amounts as currency on the dashboard banners  ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 2 file(s) modified&lt;/strong&gt;&lt;br/&gt;Format activated-stock amounts as currency on the dashboard banners&lt;br /&gt;
&lt;br /&gt;
Both banners rendered the raw float - &apos;112682.0&apos; instead of a formatted amount -&lt;br /&gt;
because the value sat in a plain &amp;lt;strong&gt; with no currency class, so&lt;br /&gt;
common.js formatCurrency() never picked it up. The sibling&lt;br /&gt;
dashboard-grn-pending-activated-imeis.vm already had the class, which is why one&lt;br /&gt;
banner formatted and the one above it did not.&lt;br /&gt;
&lt;br /&gt;
No jsVersion bump needed: template-only change, no JS or CSS touched.&lt;/div&gt;~ /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/analysis-dashboard-activated-imeis.vm&lt;br /&gt;~ /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/dashboard-activated-imeis.vm&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37594&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37594&amp;peg=37613</guid></item>
<item><pubDate>Fri, 11 Sep 2026 19:19:53 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37593 – Show partners their aged Apple stock and why it lowers ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 7 file(s) modified&lt;/strong&gt;&lt;br/&gt;Show partners their aged Apple stock and why it lowers their credit limit&lt;br /&gt;
&lt;br /&gt;
Apple handsets held past 30 days are deducted when the credit limit is&lt;br /&gt;
calculated, but nothing told the partner - they saw a limit drop with no&lt;br /&gt;
explanation. Adds a dashboard banner alongside the existing &apos;activated but not&lt;br /&gt;
billed&apos; one, shown only when the partner actually has such stock (70 of 980&lt;br /&gt;
today), with the unit count, the value, and View Imeis for the detail.&lt;br /&gt;
&lt;br /&gt;
- dashboard-aged-apple-stock.vm, parsed in dashboard1.vm under&lt;br /&gt;
  #if($investments.aged_apple_qty &gt; 0)&lt;br /&gt;
- count and value both read from the maintained partner_investment snapshot, so&lt;br /&gt;
  the banner never runs its own query and always matches the amount the limit is&lt;br /&gt;
  actually reduced by&lt;br /&gt;
- amount wrapped in &amp;lt;span class=&quot;currency&quot;&gt; so common.js formatCurrency() renders&lt;br /&gt;
  it instead of a raw float&lt;br /&gt;
- /agedAppleImeis + aged-apple-imeis.vm list the units, excluding activated ones -&lt;br /&gt;
  those are already deducted as activated stock and shown in their own banner, so&lt;br /&gt;
  no handset appears in both&lt;br /&gt;
- click handler added to the existing activated-imeis.js rather than inline in the&lt;br /&gt;
  fragment: an inline script in an AJAX-injected fragment re-registers&lt;br /&gt;
  $(document).on on every load and stacks duplicate requests&lt;br /&gt;
- jsVersion 420 -&gt; 421&lt;/div&gt;~ /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/config/AppConfig.java&lt;br /&gt;~ /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/DashboardController.java&lt;br /&gt;~ /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/InventoryController.java&lt;br /&gt;~ /trunk/profitmandi-fofo/src/main/webapp/resources/js/business/activated-imeis.js&lt;br /&gt;+ /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/aged-apple-imeis.vm&lt;br /&gt;+ /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/dashboard-aged-apple-stock.vm&lt;br /&gt;~ /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/dashboard1.vm&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37593&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37593&amp;peg=37613</guid></item>
<item><pubDate>Fri, 11 Sep 2026 19:19:38 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37592 – Fix live-demo deduction lost in the investment snapshot; maintain aged-Apple ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 8 file(s) modified&lt;/strong&gt;&lt;br/&gt;Fix live-demo deduction lost in the investment snapshot; maintain aged-Apple qty&lt;br /&gt;
&lt;br /&gt;
BUG FIX to r37588. InventoryService.getTotalAmountInStock() returns stock net of&lt;br /&gt;
live-demo units held past 90 days, and both original investment paths assigned&lt;br /&gt;
that netted value to inStockAmount - which is why&lt;br /&gt;
PartnerDailyInvestment.getTotalInvestment() carries no separate demo term. The&lt;br /&gt;
sweep stored the RAW snapshot sum and never applied the deduction, overstating&lt;br /&gt;
investment for 328 partners by Rs 5.19 crore and their limits by roughly Rs 1.3&lt;br /&gt;
crore. Maxwell validated clean earlier only because he holds no demo stock.&lt;br /&gt;
&lt;br /&gt;
Fixed by storing what is measured and deriving what is computed: the column is&lt;br /&gt;
now in_stock_gross_amount and getNetInStockAmount() applies the haircut. The demo&lt;br /&gt;
holding moves on its own daily clock, so storing the netted figure would have&lt;br /&gt;
meant re-netting it in three places every time the haircut changed - the same&lt;br /&gt;
&apos;two things must move together&apos; trap behind the original cache bug. Deriving it&lt;br /&gt;
means a daily demo refresh flows through to stock and base with nothing to sync.&lt;br /&gt;
&lt;br /&gt;
Also:&lt;br /&gt;
- aged_apple_qty stored on the snapshot and maintained on the same daily cycle as&lt;br /&gt;
  aged_apple_stock_amount, so the partner banner reads a saved count instead of&lt;br /&gt;
  running a count query per dashboard load, and count and value can never disagree&lt;br /&gt;
- selectPartnerStockCountMap mirrors selectPartnerStockValueMap, including the&lt;br /&gt;
  activated exclusion&lt;br /&gt;
- selectAgedAppleStock lists the units behind the haircut for the partner view&lt;br /&gt;
- FofoUser exposes aged_apple_stock / aged_apple_qty&lt;br /&gt;
- stock-moved detection compares GROSS: a demo unit crossing 90 days changes net&lt;br /&gt;
  stock but nothing physically moved, and that is the daily refresh&apos;s job&lt;br /&gt;
&lt;br /&gt;
Schema: partner_investment_snapshot.sql updated (in_stock_gross_amount,&lt;br /&gt;
aged_apple_qty). Applied to prod - the table was empty, so it was dropped and&lt;br /&gt;
recreated from the script.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/PartnerDailyInvestment.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/PartnerInvestment.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/InventoryItemRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/InventoryItemRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/FofoUser.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/PartnerInvestmentServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/PartnerInvestmentSweepService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/resources/sql/partner_investment_snapshot.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37592&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37592&amp;peg=37613</guid></item>
<item><pubDate>Fri, 11 Sep 2026 17:30:13 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37591 – Route V2 admin wallet adjustment through WalletServiceImpl  Byte-identical duplicate ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Route V2 admin wallet adjustment through WalletServiceImpl&lt;br /&gt;
&lt;br /&gt;
Byte-identical duplicate of the fofo /walletUpdate handler, with the same missing&lt;br /&gt;
row lock. Points at the shared walletService.applyManualAdjustment so both&lt;br /&gt;
modules share one code path.&lt;/div&gt;~ /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/v2/controller/fofo/V2FofoWalletController.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37591&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37591&amp;peg=37613</guid></item>
<item><pubDate>Fri, 11 Sep 2026 17:30:12 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37590 – Route admin wallet adjustment through WalletServiceImpl  /walletUpdate hand-rolled the ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Route admin wallet adjustment through WalletServiceImpl&lt;br /&gt;
&lt;br /&gt;
/walletUpdate hand-rolled the balance update and history row, bypassing the&lt;br /&gt;
service entirely, and read the wallet with selectByRetailerId instead of&lt;br /&gt;
selectByRetailerIdForUpdate - so unlike every other wallet path it took no row&lt;br /&gt;
lock, and a concurrent adjustment and purchase could lose an update.&lt;br /&gt;
&lt;br /&gt;
Now calls walletService.applyManualAdjustment, which reuses getManualReference&lt;br /&gt;
for the reference allocation and routes the movement through&lt;br /&gt;
addAmountToWallet/consumeAmountFromWallet(forced). Behaviour is preserved: admin&lt;br /&gt;
debits stay forced, so they can still push a wallet negative as before. Removes&lt;br /&gt;
~45 duplicated lines.&lt;/div&gt;~ /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/WalletController.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37590&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37590&amp;peg=37613</guid></item>
<item><pubDate>Fri, 11 Sep 2026 17:30:03 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37589 – Drive credit limits off the investment sweep; stop phantom limit ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 3 file(s) modified&lt;/strong&gt;&lt;br/&gt;Drive credit limits off the investment sweep; stop phantom limit writes&lt;br /&gt;
&lt;br /&gt;
Adds the 2-minute sweep schedule and points the limit recalculation at the&lt;br /&gt;
partners whose base_value actually moved, instead of rescanning all 980 every&lt;br /&gt;
20 minutes. Measured on production: 3 partners change per 2-minute window on&lt;br /&gt;
average, peak 18.&lt;br /&gt;
&lt;br /&gt;
- ScheduledSkeleton: 2-min sweepPartnerInvestment, daily refreshAgedStockDaily&lt;br /&gt;
  at 00:20; the 20-min full pass is kept as a backstop for inputs base does not&lt;br /&gt;
  capture (risk, the SIDBI floor, hard_limit)&lt;br /&gt;
- BatchScheduledTasks.sweepPartnerInvestment: sweep, then limits for changed&lt;br /&gt;
  bases only&lt;br /&gt;
- calculateChangedPartnerLimits(restrictTo) to support that&lt;br /&gt;
- scaleMoney(): round to paise before comparing and storing. The limit comes out&lt;br /&gt;
  of a double multiply, so 65123.7400 round-tripped as 65123.740000000005 and&lt;br /&gt;
  compareTo called it a change. 208 of 230 &apos;changed&apos; partners in one production&lt;br /&gt;
  run differed by under half a paisa, rewriting sd_credit_requirement and&lt;br /&gt;
  dtr.credit_account ~14,000 times a day for identical values and churning the&lt;br /&gt;
  SIDBI mirror. Real changes were never below a rupee, so 2dp cannot suppress one.&lt;br /&gt;
- getFirstBillingDates: one grouped query instead of one per partner&lt;br /&gt;
&lt;br /&gt;
Credit limits for 24 partners will rise on the first sweep after deploy - that is&lt;br /&gt;
the aged-Apple double-deduction correction landing (see r37588), not a defect.&lt;br /&gt;
&lt;br /&gt;
NOTE: cron is a standalone Spring Boot jar; the new schedules only fire once it&lt;br /&gt;
is restarted with --spring.profiles.active=scheduled.&lt;/div&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/BatchScheduledTasks.java&lt;br /&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/PartnerLimitHelper.java&lt;br /&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ScheduledSkeleton.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37589&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37589&amp;peg=37613</guid></item>
<item><pubDate>Fri, 11 Sep 2026 17:29:49 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37588 – Serve partner investment from a 2-minute snapshot instead of a ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 17 file(s) modified&lt;/strong&gt;&lt;br/&gt;Serve partner investment from a 2-minute snapshot instead of a 3-hour cache&lt;br /&gt;
&lt;br /&gt;
getInvestment() was @Cacheable on a 3-hour Redis cache that addAmountToWallet&lt;br /&gt;
evicted but consumeAmountFromWallet did not. A partner whose advance payment was&lt;br /&gt;
swept straight to a loan had the money counted twice - once as a still-cached&lt;br /&gt;
wallet balance, once as the reduced utilisation - overstating their credit limit&lt;br /&gt;
by the payment x their tier until the cache expired.&lt;br /&gt;
&lt;br /&gt;
Replaced with fofo.partner_investment, refreshed every 2 minutes by&lt;br /&gt;
PartnerInvestmentSweepService. Every coupled term is read in one pass, so wallet&lt;br /&gt;
and utilisation (and in-stock and aged-Apple) can never come from different&lt;br /&gt;
moments. A shorter TTL would only have made the error rarer - it scales with the&lt;br /&gt;
payment, not the delay.&lt;br /&gt;
&lt;br /&gt;
- PartnerInvestment entity/repository + partner_investment_snapshot.sql&lt;br /&gt;
- PartnerInvestmentSweepService: 9 batched reads, stores base_value for change&lt;br /&gt;
  detection, refreshes aged-Apple for partners whose stock moved intra-day&lt;br /&gt;
- getInvestment/getInvestmentsForFofoStores both read the snapshot, so the two&lt;br /&gt;
  paths no longer disagree; live compute retained as fallback&lt;br /&gt;
- selectActivatedStockAmountByFofoIds: batches an N+1 that cost 233ms x 1690&lt;br /&gt;
  partners (6.6 min -&gt; 1.0 s)&lt;br /&gt;
- getFirstBillingDates: batches another N+1 (4.6 s -&gt; 0.67 s)&lt;br /&gt;
- selectPendingGrnOrders(List) now applies the same SD_START_DATE floor as the&lt;br /&gt;
  single-partner overload; the two were reporting different GRN-pending&lt;br /&gt;
- selectPartnerStockValueMap takes excludeActivated: an activated Apple handset&lt;br /&gt;
  held past the aging window was added once to in-stock and subtracted twice&lt;br /&gt;
  (activated stock, then the aged haircut). 90 units, 24 partners, Rs 65.19 lakh&lt;br /&gt;
  double-deducted. Live-demo passes false - no overlap there.&lt;br /&gt;
- applyManualAdjustment: routes the two hand-rolled admin wallet adjustments&lt;br /&gt;
  through WalletServiceImpl so they take the FOR UPDATE lock&lt;br /&gt;
- add_idx_order_grn_pending.sql: covering index, GRN query 1320ms -&gt; 514ms&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/InventoryItem.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/PartnerInvestment.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/transaction/Order.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/InventoryItemRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/InventoryItemRepositoryImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/PartnerInvestmentRepository.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/PartnerInvestmentRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/OrderRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/TransactionRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/TransactionRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/InventoryServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/PartnerInvestmentServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/PartnerInvestmentSweepService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/wallet/WalletService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/wallet/WalletServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/add_idx_order_grn_pending.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/partner_investment_snapshot.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37588&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37588&amp;peg=37613</guid></item>
<item><pubDate>Fri, 11 Sep 2026 15:51:38 +0530</pubDate><dc:creator>ranu</dc:creator><title>Rev 37587 – ticket download option given and some enhancement on notification panel</title><description>&lt;div&gt;&lt;strong&gt;ranu – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;ticket download option given and some enhancement on notification panel&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/WarehouseOpeningByMovementModel.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37587&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37587&amp;peg=37613</guid></item>
<item><pubDate>Fri, 11 Sep 2026 15:48:56 +0530</pubDate><dc:creator>ranu</dc:creator><title>Rev 37586 – drr view modification</title><description>&lt;div&gt;&lt;strong&gt;ranu – 5 file(s) modified&lt;/strong&gt;&lt;br/&gt;drr view modification&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/RbmTargetService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/RbmTargetServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/monitors/RbmDrrDashboardController.java&lt;br /&gt;~ /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/rbm-drr-dashboard.vm&lt;br /&gt;~ /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/retailer-details.vm&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37586&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37586&amp;peg=37613</guid></item>
<item><pubDate>Thu, 10 Sep 2026 17:19:06 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37585 – Fix web-offer sync: selectModelOffers join order (Unknown column &apos;o.id&apos; in ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Fix web-offer sync: selectModelOffers join order (Unknown column &apos;o.id&apos; in &apos;on clause&apos;)&lt;br /&gt;
&lt;br /&gt;
selectModelOffers led its FROM with offers.offer_product p and then joined&lt;br /&gt;
offers.offer_raw_row r ON r.offer_id = o.id, referencing alias o one join&lt;br /&gt;
before o was introduced. An ON clause resolves only against tables already&lt;br /&gt;
in the join order, so MySQL rejected it with SQLSyntaxErrorException:&lt;br /&gt;
Unknown column &apos;o.id&apos; in &apos;on clause&apos;. Every per-model sync since r37581 has&lt;br /&gt;
therefore failed - webOfferSync=FAILED on the 15:04 and 17:14 re-ingests of&lt;br /&gt;
document 4 - leaving the 166 legacy NULL-key row-badges active and zero&lt;br /&gt;
consolidated badges published.&lt;br /&gt;
&lt;br /&gt;
Reordered to lead with offers.offer o, matching the proven shape of the&lt;br /&gt;
sibling selectRowOffers query. All three are inner joins so the result set&lt;br /&gt;
is unchanged; BEST_OFFER_WINS and ORDER BY p.catalog_id still resolve.&lt;br /&gt;
&lt;br /&gt;
Verified by executing the corrected statement read-only against prod for&lt;br /&gt;
document 4: 733 rows over 314 distinct catalog ids, the expected model&lt;br /&gt;
count. Not caught by tests because all 53 offercircular tests are&lt;br /&gt;
stub-based (no Spring, no DB) and never execute this SQL.&lt;br /&gt;
&lt;br /&gt;
Failure was visible only because r37568 records webOfferSync= in&lt;br /&gt;
ingest_summary; the runner still swallows the exception by design.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/offers/WebOfferSyncRepositoryImpl.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37585&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37585&amp;peg=37613</guid></item>
<item><pubDate>Thu, 10 Sep 2026 15:24:07 +0530</pubDate><dc:creator>ranu</dc:creator><title>Rev 37584 – ticket download option given and some enhancement on notification panel</title><description>&lt;div&gt;&lt;strong&gt;ranu – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;ticket download option given and some enhancement on notification panel&lt;/div&gt;~ /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/rbm-drr-dashboard.vm&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37584&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37584&amp;peg=37613</guid></item>
<item><pubDate>Thu, 10 Sep 2026 15:21:19 +0530</pubDate><dc:creator>ranu</dc:creator><title>Rev 37583 – ticket download option given and some enhancement on notification panel</title><description>&lt;div&gt;&lt;strong&gt;ranu – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;ticket download option given and some enhancement on notification panel&lt;/div&gt;~ /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/rbm-drr-dashboard.vm&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37583&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37583&amp;peg=37613</guid></item>
<item><pubDate>Thu, 10 Sep 2026 15:13:31 +0530</pubDate><dc:creator>ranu</dc:creator><title>Rev 37582 – ticket download option given and some enhancement on notification panel</title><description>&lt;div&gt;&lt;strong&gt;ranu – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;ticket download option given and some enhancement on notification panel&lt;/div&gt;~ /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/rbm-drr-dashboard.vm&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37582&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37582&amp;peg=37613</guid></item>
<item><pubDate>Thu, 10 Sep 2026 14:58:44 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37581 – web offer sync: retire the pre-consolidation badges instead of deleting ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 2 file(s) modified&lt;/strong&gt;&lt;br/&gt;web offer sync: retire the pre-consolidation badges instead of deleting them&lt;br /&gt;
&lt;br /&gt;
The sync now deactivates any CIRCULAR row with a NULL circular_offer_key on its next&lt;br /&gt;
run. A row-keyed badge is a fragment of what a consolidated badge says, so leaving it&lt;br /&gt;
active would show a partner the same offer twice - once whole and once in pieces.&lt;br /&gt;
&lt;br /&gt;
That removes the DELETE from the migration entirely, which is strictly better:&lt;br /&gt;
&lt;br /&gt;
  * nothing is destroyed, so a bad sync is one UPDATE away from being undone&lt;br /&gt;
  * web_offer_product has NO foreign key to web_offer, so the DELETE had to clear its&lt;br /&gt;
    532 rows separately or strand them as orphans&lt;br /&gt;
  * no window where a circular has no badges at all - the old ones stay live until the&lt;br /&gt;
    new ones exist&lt;br /&gt;
&lt;br /&gt;
The migration is now purely additive: one ALTER, safe to run ahead of the deploy, which&lt;br /&gt;
is how it was applied to prod.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/offers/WebOfferSyncRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/resources/sql/add_web_offer_per_model.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37581&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37581&amp;peg=37613</guid></item>
<item><pubDate>Thu, 10 Sep 2026 14:55:17 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37580 – web offer: state an EMI scheme the circular gave without ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 3 file(s) modified&lt;/strong&gt;&lt;br/&gt;web offer: state an EMI scheme the circular gave without months&lt;br /&gt;
&lt;br /&gt;
  Rs.2,500 on Credit Card EMI (CIB) with IDFC First Bank, Kotak Mahindra Bank&lt;br /&gt;
&lt;br /&gt;
52 Sep&apos;26 offers have a bare &apos;CIB&apos; tenure cell - the circular names the EMI type and&lt;br /&gt;
gives no months. TenureParser correctly yields no tenure row for a cell with no digits,&lt;br /&gt;
so the type vanished and the badge said only &apos;on Credit Card EMI&apos;. Every one of those&lt;br /&gt;
52 carries a cashback, so it was 52 offers&apos; worth of SKUs silent about the EMI they&lt;br /&gt;
apply to.&lt;br /&gt;
&lt;br /&gt;
The type is stated because the circular stated it. The MONTHS are not invented,&lt;br /&gt;
because it did not give them - the same line the CIB expansion was left on.&lt;br /&gt;
&lt;br /&gt;
Read from offer_raw_row.col_emi_tenure rather than stored: &apos;scheme, no month&apos; is not a&lt;br /&gt;
tenure, and offer_tenure.tenure_months is NOT NULL, so persisting it would mean a fake&lt;br /&gt;
0 row standing for a fact that is not a tenure.&lt;br /&gt;
&lt;br /&gt;
Only ever attached to an EMI mode, and real tenures always win over the bare code.&lt;br /&gt;
&lt;br /&gt;
ModelOfferTest 8 -&gt; 11.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/offers/WebOfferSyncRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/offercircular/WebOfferSyncService.java&lt;br /&gt;~ /trunk/profitmandi-fofo/src/test/java/com/spice/profitmandi/web/offercircular/ModelOfferTest.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37580&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37580&amp;peg=37613</guid></item>
<item><pubDate>Thu, 10 Sep 2026 13:47:02 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37579 – web offer: one badge per model, consolidating everything the circular ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 2 file(s) modified&lt;/strong&gt;&lt;br/&gt;web offer: one badge per model, consolidating everything the circular grants it&lt;br /&gt;
&lt;br /&gt;
Edge 60 Pro 12+256 carried five badges - a Full Swipe cashback, an EMI cashback and&lt;br /&gt;
three EMI schemes - and the partner&apos;s card listed all five. It now carries one:&lt;br /&gt;
&lt;br /&gt;
  SEPTEMBER 2026 Motorola Cashback Offer-2,500 On Credit Card EMI&lt;br /&gt;
                                         &amp; 2,000 On Credit Card Full Swipe&lt;br /&gt;
&lt;br /&gt;
Models whose consolidated terms are IDENTICAL share a badge, so 314 models collapse to&lt;br /&gt;
~107 rows while every model still appears in exactly one.&lt;br /&gt;
&lt;br /&gt;
Rules, from the taxonomy: any model has cashback on Full Swipe and/or EMI, instant or&lt;br /&gt;
deferred, plus NCE/LCE/CIB with tenures, and any of it may differ per bank.&lt;br /&gt;
- &apos;Upto&apos; only where a mode carries several values - which is what per-bank pricing&lt;br /&gt;
  looks like. One value is stated plainly.&lt;br /&gt;
- Highest value first.&lt;br /&gt;
- Banks ride with each line only when they DIFFER; one shared set is hoisted to a&lt;br /&gt;
  single trailing &apos;Banks:&apos; line. A third of models need the per-line form.&lt;br /&gt;
- An amount whose window is narrower than the badge&apos;s states its own end date. Apple&lt;br /&gt;
  1025780 pays Rs.6,000 to the 16th then Rs.4,000 to the 26th; without this the badge&lt;br /&gt;
  would advertise Rs.6,000 for ten days it is not available.&lt;br /&gt;
&lt;br /&gt;
⚠️ Banks and tenures belong to the OFFER a line came from, never to the model. On Edge&lt;br /&gt;
60 Pro the no-cost EMI is ICICI on 3 and 6 months but SBI on 3 only, and the EMI&lt;br /&gt;
cashback is IDFC/Kotak with no tenure at all. Attaching the model&apos;s tenures to its&lt;br /&gt;
cashback would promise no-cost EMI on a bank that never offered it. This also corrects&lt;br /&gt;
an earlier reading of mine that called the SBI 3-month line a duplicate of ICICI&apos;s -&lt;br /&gt;
it is a different bank, not noise.&lt;br /&gt;
&lt;br /&gt;
New ModelOfferTest, 8 cases, every one taken from a real Sep&apos;26 row.&lt;/div&gt;~ /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/offercircular/WebOfferSyncService.java&lt;br /&gt;+ /trunk/profitmandi-fofo/src/test/java/com/spice/profitmandi/web/offercircular/ModelOfferTest.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37579&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37579&amp;peg=37613</guid></item>
<item><pubDate>Thu, 10 Sep 2026 13:46:45 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37578 – web offer sync: read what the circular grants each MODEL, ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 3 file(s) modified&lt;/strong&gt;&lt;br/&gt;web offer sync: read what the circular grants each MODEL, not each row&lt;br /&gt;
&lt;br /&gt;
selectModelOffers returns one row per (catalog_id, benefit), carrying the context that&lt;br /&gt;
qualifies it - the banks it applies to, its tenures and their scheme, the timing and&lt;br /&gt;
the window. Consolidation happens in the service; this is the read it needs.&lt;br /&gt;
&lt;br /&gt;
LEFT JOIN on the benefit, because a scheme-only offer carries no cashback and dropping&lt;br /&gt;
it here would lose the NCE/LCE badge entirely.&lt;br /&gt;
&lt;br /&gt;
Content-keyed writes alongside: selectSyncedByKey, insertKeyedWebOffer,&lt;br /&gt;
replaceProducts, deactivateMissingKeys. A badge is now identified by a sha256 of its&lt;br /&gt;
terms, so models with identical terms share one and a model appears in exactly one.&lt;br /&gt;
&lt;br /&gt;
Migration add_web_offer_per_model.sql adds circular_offer_key + its unique key, and&lt;br /&gt;
drops the row-keyed CIRCULAR badges - one of those is a fragment of what a&lt;br /&gt;
content-keyed badge says and there is no mapping from five fragments to one whole, so&lt;br /&gt;
they are regenerated by the next ingest.&lt;br /&gt;
&lt;br /&gt;
⚠️ web_offer_product has NO foreign key to web_offer, so its rows do not cascade and&lt;br /&gt;
are deleted explicitly or they are orphaned. web_offer_sync_shadow does cascade.&lt;br /&gt;
source=&apos;CIRCULAR&apos; only - the 3,850 hand-authored rows are never touched.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/offers/WebOfferSyncRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/offers/WebOfferSyncRepositoryImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/add_web_offer_per_model.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37578&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37578&amp;peg=37613</guid></item>
<item><pubDate>Thu, 10 Sep 2026 13:17:50 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37577 – web offer: an EMI cashback names its tenures WITH their ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 2 file(s) modified&lt;/strong&gt;&lt;br/&gt;web offer: an EMI cashback names its tenures WITH their scheme&lt;br /&gt;
&lt;br /&gt;
  Rs.2,500 on Credit Card EMI (NCE 3, 6; LCE 9, 12 months)&lt;br /&gt;
&lt;br /&gt;
A bare &apos;3, 6, 9, 12 months&apos; says which tenures earn the cashback but not which of&lt;br /&gt;
them are no-cost - and at the counter the two facts are only useful together.&lt;br /&gt;
&lt;br /&gt;
The trailing scheme sentence is dropped when an EMI benefit already carried it, since&lt;br /&gt;
it would state the same thing twice. It stays when the cashback is on Full Swipe only:&lt;br /&gt;
EMI is still available, it just is not what the cashback is on.&lt;br /&gt;
&lt;br /&gt;
Tenures whose scheme the circular never gave keep their months but carry no label -&lt;br /&gt;
the months are real, the scheme would be invented.&lt;br /&gt;
&lt;br /&gt;
Tests 16 -&gt; 18.&lt;/div&gt;~ /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/offercircular/WebOfferSyncService.java&lt;br /&gt;~ /trunk/profitmandi-fofo/src/test/java/com/spice/profitmandi/web/offercircular/WebOfferSyncServiceTest.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37577&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37577&amp;peg=37613</guid></item>
<item><pubDate>Thu, 10 Sep 2026 13:02:55 +0530</pubDate><dc:creator>ranu</dc:creator><title>Rev 37576 – ticket download option given and some enhancement on notification panel</title><description>&lt;div&gt;&lt;strong&gt;ranu – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;ticket download option given and some enhancement on notification panel&lt;/div&gt;~ /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/rbm-drr-dashboard.vm&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37576&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37576&amp;peg=37613</guid></item>
<item><pubDate>Thu, 10 Sep 2026 12:51:28 +0530</pubDate><dc:creator>ranu</dc:creator><title>Rev 37575 – ticket download option given and some enhancement on notification panel</title><description>&lt;div&gt;&lt;strong&gt;ranu – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;ticket download option given and some enhancement on notification panel&lt;/div&gt;~ /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/rbm-drr-dashboard.vm&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37575&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37575&amp;peg=37613</guid></item>
<item><pubDate>Thu, 10 Sep 2026 12:45:42 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37574 – web offer: print the EMI scheme code, not a guessed ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 2 file(s) modified&lt;/strong&gt;&lt;br/&gt;web offer: print the EMI scheme code, not a guessed expansion&lt;br /&gt;
&lt;br /&gt;
NCE / LCE / CIB are industry standard and now appear verbatim:&lt;br /&gt;
&lt;br /&gt;
  Instant cashback. Rs.3,000 on Credit Card EMI (3, 6 months);&lt;br /&gt;
  Rs.3,000 on Credit Card Full Swipe. LCE on 3, 6 months. Banks: ...&lt;br /&gt;
&lt;br /&gt;
The expansions were not ours to invent. emi_scheme.display_name carries &apos;Cashback&lt;br /&gt;
Instant Benefit&apos; for CIB, and the evidence contradicts it: the Sep&apos;26 cell&lt;br /&gt;
&apos;3 NC 6,9,12 CIB&apos; puts CIB in ONE ladder with NCE, so it describes who bears the&lt;br /&gt;
interest on a tenure rather than how a cashback is delivered - and 53 of 55 CIB rows&lt;br /&gt;
carry a separate cashback amount anyway, which that expansion would make redundant.&lt;br /&gt;
Pine Labs&apos; own docs define ICB as Instant Cashback on UPI; the circular writes CIB 60&lt;br /&gt;
times and ICB never.&lt;br /&gt;
&lt;br /&gt;
A guessed expansion on a partner badge risks stating the opposite of the truth - for&lt;br /&gt;
CIB, advertising a benefit where the customer may in fact be bearing the interest.&lt;br /&gt;
The code cannot be wrong that way.&lt;br /&gt;
&lt;br /&gt;
A scheme is still stated ONLY when the circular gave one; tenures with no scheme are&lt;br /&gt;
described as nothing at all.&lt;br /&gt;
&lt;br /&gt;
Also fixes the singular: &apos;NCE on 3 month&apos;, not &apos;3 months&apos;.&lt;/div&gt;~ /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/offercircular/WebOfferSyncService.java&lt;br /&gt;~ /trunk/profitmandi-fofo/src/test/java/com/spice/profitmandi/web/offercircular/WebOfferSyncServiceTest.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37574&amp;peg=37613</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F&amp;isdir=1&amp;rev=37574&amp;peg=37613</guid></item>
</channel></rss>