<?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; /trunk/profitmandi-dao/src/main/resources/sql/</title><description>WebSVN RSS feed &#x2013; SmartDukaan</description><lastBuildDate>Tue, 06 Oct 2026 20:47:39 +0530</lastBuildDate><generator>WebSVN 2.8.6-DEV</generator><language>en</language><link>https://svn.smartdukaan.com/log.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;max=40&amp;</link><atom:link href="https://svn.smartdukaan.com/rss.php?isdir=1&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;repname=SmartDukaan" rel="self" type="application/rss+xml" />
<item><pubDate>Mon, 05 Oct 2026 19:51:04 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37853 – docs(warehouse): record-only migration files for 2026-10-05 HR move - suspended-warehouse ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 3 file(s) modified&lt;/strong&gt;&lt;br/&gt;docs(warehouse): record-only migration files for 2026-10-05 HR move - suspended-warehouse brand mapping (1:1 HR substitution, 1,062 deleted / 51 added), 3 franchise stores 7678-&gt;13372, note for the store remap and pending-order move done outside the code (all already applied on hadb1, do not re-run)&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/20261005_franchise_stores_7678_to_13372.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/20261005_hr_move_stores_orders_NOTE.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/20261005_suspended_warehouse_brand_mapping.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37853</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37853</guid></item>
<item><pubDate>Mon, 05 Oct 2026 19:44:42 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37850 – refactor(warehouse): retire hardcoded Delhi ids - allocation fallback vendor warehouse ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 4 file(s) modified&lt;/strong&gt;&lt;br/&gt;refactor(warehouse): retire hardcoded Delhi ids - allocation fallback vendor warehouse 7573 -&gt; 13368 (central HR-NSSPL/GGN); Vivo Noida/Ghaziabad partner-sale rule 7573 -&gt; 13370; drop unused InventoryWarehouse WH_DL/WH_HR_DL/WAREHOUSE_IDS; migration 20261005_hr_ggn_central_brand_mapping.sql (13368 central for every ACTIVE warehouse, all brands except Oppo/Vivo, 532 rows, applied on hadb1)&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/FofoStore.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/inventory/InventoryWarehouse.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/TransactionServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/20261005_hr_ggn_central_brand_mapping.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37850</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37850</guid></item>
<item><pubDate>Mon, 05 Oct 2026 18:48:21 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37845 – feat(warehouse): ACTIVE/SUSPENDED/INACTIVE status + label on sellerwarehouse replace WAREHOUSE_MAP - ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 33 file(s) modified&lt;/strong&gt;&lt;br/&gt;feat(warehouse): ACTIVE/SUSPENDED/INACTIVE status + label on sellerwarehouse replace WAREHOUSE_MAP - BillingWarehouseService (active for dashboards, active+suspended for warehouse screens, names in every state, 5 min cache); setup service: guarded status change (no suspend while franchise stores or brand mapping route there, no close while stock/unshipped orders), rename, all-warehouse overview with usage; partner store assignable only to an active warehouse; daily stock alert for suspended/inactive warehouses to logistics/accounts top 2 staffed levels + leadership; dashboard warehouse list = active (replaces r37834 stock-holding loop); migration sellerwarehouse_status_display_name_20261005.sql (applied on hadb1)&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/transaction/SellerWarehouse.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/enumuration/warehouse/WarehouseStatus.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/warehouse/PhysicalWarehouseView.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/warehouse/WarehouseStockLine.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/warehouse/WarehouseUsage.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/dtr/FofoStoreRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/inventory/InventoryWarehouseRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/inventory/SaholicInventoryCISRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/inventory/SaholicInventoryCISRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/inventory/WarehouseRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/SellerWarehouseRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/SellerWarehouseRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/service/solr/FofoSolr.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/AdminUser.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/authentication/JWTUtil.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/offers/OfferServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/RbmTargetServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/TransactionServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/user/RetailerServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/BillingWarehouseService.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/BillingWarehouseServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/PoStockApprovalDigestServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/PoStockApprovalServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/PurchaseOrderServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/SuspendedWarehouseStockAlertService.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/SuspendedWarehouseStockAlertServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/WarehouseSetupService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/WarehouseSetupServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/WarehouseSetupValidator.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/sellerwarehouse_status_display_name_20261005.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/test/java/com/spice/profitmandi/service/warehouse/BillingWarehouseServiceImplTest.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/test/java/com/spice/profitmandi/service/warehouse/SuspendedWarehouseStockAlertServiceImplTest.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/test/java/com/spice/profitmandi/service/warehouse/WarehouseSetupServiceImplTest.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37845</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37845</guid></item>
<item><pubDate>Sun, 04 Oct 2026 13:53:44 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37835 – chore(sql): record applied migrations - HR movement HSN/GST-rate/category fixes (2026-10-02) ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 2 file(s) modified&lt;/strong&gt;&lt;br/&gt;chore(sql): record applied migrations - HR movement HSN/GST-rate/category fixes (2026-10-02) and HR warehouse self brand mapping (2026-10-04); both re-runnable, already applied on hadb1&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/20261002_hr_movement_hsn_tax_category_fixes.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/20261004_hr_warehouse_self_brand_mapping.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37835</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37835</guid></item>
<item><pubDate>Thu, 01 Oct 2026 21:06:34 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37822 – feat(warehouse): physical warehouse setup service, supplier mapping PO guard, address ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 24 file(s) modified&lt;/strong&gt;&lt;br/&gt;feat(warehouse): physical warehouse setup service, supplier mapping PO guard, address active flag&lt;br /&gt;
&lt;br /&gt;
- WarehouseSetupService + WarehouseSetupValidator: create seller (state from GSTIN,&lt;br /&gt;
  unique label/GSTIN), address master (city stored last, 6-digit pin, contact),&lt;br /&gt;
  physical warehouse (OURS/BAD vendor 40 + Dummy/G + sellerwarehouse + mapping in&lt;br /&gt;
  one transaction), activate/deactivate (sellerwarehouse.is_active), remap address&lt;br /&gt;
  with internal store sync. Limits follow column sizes (sql_mode is empty).&lt;br /&gt;
- WarehouseAddressMaster.active: only active addresses are offered for assignment.&lt;br /&gt;
  Migration sql/20261001_warehouseaddressmaster_active.sql (applied on hadb1).&lt;br /&gt;
- PO guard: createPurchaseOrder refuses a supplier with no OURS/GOOD vendor&lt;br /&gt;
  warehouse at the destination (GRN could never receive it).&lt;br /&gt;
  InventoryWarehouseRepository.hasGoodSupplierWarehouse / selectSupplierIdsWithGoodWarehouse&lt;br /&gt;
  use existence checks; 67 pairs carry duplicate OURS/GOOD rows.&lt;br /&gt;
- SellerService.syncInternalStoreAddress(store); RetailerServiceImpl syncs an&lt;br /&gt;
  INTERNAL store&apos;s address when it moves warehouse or becomes internal.&lt;br /&gt;
- Record of 2026-10-01 HR Gurugram setup SQL (seller 21, warehouses 13368/13370/13372).&lt;br /&gt;
- Tests: WarehouseSetupValidatorTest (10), WarehouseSetupServiceImplTest (7).&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/transaction/WarehouseAddressMaster.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/warehouse/NewPhysicalWarehouseRequest.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/warehouse/NewSellerRequest.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/warehouse/NewWarehouseAddressRequest.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/warehouse/PhysicalWarehouseView.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/warehouse/WarehouseAddressView.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/inventory/InventoryWarehouseRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/inventory/InventoryWarehouseRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/WarehouseAddressMappingRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/WarehouseAddressMappingRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/SellerService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/SellerServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/user/RetailerServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/PurchaseOrderService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/PurchaseOrderServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/WarehouseSetupService.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/WarehouseSetupServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/WarehouseSetupValidator.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/20261001_delete_hrgn1715_hr_uk_store.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/20261001_hr_gurugram_vendor_warehouses.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/20261001_hr_gurugram_virtual_warehouses.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/20261001_warehouseaddressmaster_active.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/test/java/com/spice/profitmandi/service/warehouse/WarehouseSetupServiceImplTest.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/test/java/com/spice/profitmandi/service/warehouse/WarehouseSetupValidatorTest.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37822</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37822</guid></item>
<item><pubDate>Tue, 29 Sep 2026 04:14:47 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37805 – fix(catalog): trim f_ colour prefix space; age delisted listings from ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 8 file(s) modified&lt;/strong&gt;&lt;br/&gt;fix(catalog): trim f_ colour prefix space; age delisted listings from last activation&lt;br /&gt;
&lt;br /&gt;
- Item.normalizeColor drops the space after f_ on every write (upload sheets typed&lt;br /&gt;
  &apos;f_ Black&apos;, which read &apos; Black&apos; everywhere); ItemLoaderService uses it so the&lt;br /&gt;
  duplicate-colour check compares the clean value&lt;br /&gt;
- tag_listing.last_activated, stamped by TagListing.setActive on off-&gt;on;&lt;br /&gt;
  updateActiveById now goes through the entity (+flush) so the toggle stamps it&lt;br /&gt;
- delist cron + SQL script age a listing from GREATEST(start_date, last_activated),&lt;br /&gt;
  so a re-activated listing is not delisted again the next morning&lt;br /&gt;
- migrations: add_tag_listing_last_activated_20260929.sql, fix_item_color_prefix_space_20260929.sql&lt;br /&gt;
  (both applied on hadb1 2026-09-29; 174 items trimmed, 36830 excluded - clashes with 37089)&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/catalog/Item.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/catalog/TagListing.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/catalog/TagListingRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/catalog/CatalogDelistServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/catalog/ItemLoaderService.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/add_tag_listing_last_activated_20260929.sql&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/resources/sql/delist_inactive_listings_rolling_24m.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/fix_item_color_prefix_space_20260929.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37805</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37805</guid></item>
<item><pubDate>Tue, 29 Sep 2026 00:19:53 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37804 – fix(fofo-store): store every GSTIN in upper case at the entity ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 2 file(s) modified&lt;/strong&gt;&lt;br/&gt;fix(fofo-store): store every GSTIN in upper case at the entity setter&lt;br /&gt;
&lt;br /&gt;
FofoStore.setGstNumber now normalises through StringUtils.normalizeGstNumber,&lt;br /&gt;
so no write path can store a mixed-case GSTIN. Only the partner-update path&lt;br /&gt;
normalised before; the LOI and trial-form paths wrote the field directly,&lt;br /&gt;
which is how 06bmlpk3545g1z0 and 03AAccn9802g1zp reached the table. NIC&lt;br /&gt;
expects upper case, and case-sensitive comparisons (including the own-seller&lt;br /&gt;
GSTIN check behind a NIC refusal) silently failed to match.&lt;br /&gt;
&lt;br /&gt;
uppercase_fofo_store_gstin_20260928.sql corrects the four rows already on&lt;br /&gt;
record; it is already applied on hadb1 (0 mixed-case GSTINs remain).&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/FofoStore.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/uppercase_fofo_store_gstin_20260928.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37804</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37804</guid></item>
<item><pubDate>Mon, 28 Sep 2026 16:50:59 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37797 – Stop a settled debit note being received a second time ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 3 file(s) modified&lt;/strong&gt;&lt;br/&gt;Stop a settled debit note being received a second time&lt;br /&gt;
&lt;br /&gt;
A return settled before the receive workflow (first purchase_return_order&lt;br /&gt;
2026-03-16) wrote the warehouse SALE_RET scan, a returnorderinfo row and a&lt;br /&gt;
wallet refund, but never touched the debit note: it stayed CREATED with no&lt;br /&gt;
purchase_return_order. Those are exactly the two things the receive screens&lt;br /&gt;
read, so 5,557 fully settled notes looked like they were still awaiting&lt;br /&gt;
receipt, Receive button included.&lt;br /&gt;
&lt;br /&gt;
Receiving one of them (DN UPBLY975/4, IMEI 864973083197734, Antu Enterprises)&lt;br /&gt;
restored to the partner a phone that had already been returned, refunded&lt;br /&gt;
Rs 38,999 and resold to another partner, and a duplicate debit note followed&lt;br /&gt;
that Finance could not refund.&lt;br /&gt;
&lt;br /&gt;
- receiveDebitNoteItems: refuse a note that already has a return order, one&lt;br /&gt;
  whose status is not CREATED, and one whose every unit is already back at the&lt;br /&gt;
  warehouse. Checked BEFORE the condition-mismatch gate - a mismatch there&lt;br /&gt;
  returns into rejectOnConditionMismatch without reaching any later check, and&lt;br /&gt;
  acknowledging that rejection hands the stock back to the partner. That is&lt;br /&gt;
  how the Antu case slipped through.&lt;br /&gt;
- getAlreadyReturnedDebitNotes: the last of those checks, batched for a page of&lt;br /&gt;
  notes. Mirrors applyReceipt - SALE_RET/DOA_IN/SALE_RET_UNUSABLE for the unit&lt;br /&gt;
  against the order its invoice was billed on - so a screen can never disagree&lt;br /&gt;
  with what the refund step will accept.&lt;br /&gt;
- processInvoiceReturn: one open return per document.&lt;br /&gt;
- sql/backfill_debit_note_status_old_flow_20260924.sql: APPLIED on hadb1&lt;br /&gt;
  2026-09-24. 4,154 notes -&gt; APPROVED, 6,639 items -&gt; RETURNED, on the same&lt;br /&gt;
  evidence (returned and refunded). Open notes 5,557 -&gt; 1,404; the rest are&lt;br /&gt;
  left CREATED for review, bucketed in fofo._dn_backfill_20260922.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/PurchaseReturnService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/PurchaseReturnServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/backfill_debit_note_status_old_flow_20260924.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37797</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37797</guid></item>
<item><pubDate>Mon, 28 Sep 2026 14:34:01 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37790 – Return refund as B2C when NIC refuses the buyer&apos;s GSTIN ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 13 file(s) modified&lt;/strong&gt;&lt;br/&gt;Return refund as B2C when NIC refuses the buyer&apos;s GSTIN&lt;br /&gt;
&lt;br /&gt;
A return whose credit note NIC refuses because the BUYER&apos;s GSTIN is&lt;br /&gt;
cancelled or invalid could not be settled at all: the approval threw, and&lt;br /&gt;
with it went the refund, the stock and the return rows (NSUPDL5176, Mobile&lt;br /&gt;
Hub, GSTIN 08DCUPD7948K1ZP). Where the invoice itself had never been filed&lt;br /&gt;
the return was instead refunded with no credit note at all, leaving the&lt;br /&gt;
refund undocumented.&lt;br /&gt;
&lt;br /&gt;
Raising the note automatically is not the answer - it is Finance&apos;s call,&lt;br /&gt;
and the GST on a cancelled-GSTIN sale is not recoverable, so paying the&lt;br /&gt;
full value back loses it. Both flows therefore record the refusal and stop.&lt;br /&gt;
&lt;br /&gt;
GstProService: getIrnFailureReason (NIC&apos;s refusal for an invoice),&lt;br /&gt;
isInvalidBuyerGstin (that refusal is about the buyer&apos;s registration -&lt;br /&gt;
deliberately NOT a state-code mismatch, which is a data error to fix and&lt;br /&gt;
retry, nor anything naming our own seller GSTIN) and briefIrnReason (one&lt;br /&gt;
plain-ASCII line of 128 chars; credit_note is latin1 and sql_mode is empty,&lt;br /&gt;
so anything else would store as &apos;?&apos;).&lt;br /&gt;
&lt;br /&gt;
PurchaseReturnServiceImpl: both the invoice-return and the debit-note&lt;br /&gt;
refund detect that refusal, record it through ReturnIrnFailureRecorder and&lt;br /&gt;
throw ReturnIrnGstinFailureException. The recorder commits in REQUIRES_NEW&lt;br /&gt;
because the approval it records is about to roll back, and it only inserts -&lt;br /&gt;
return_irn_failure carries no foreign key on purpose, since an FK check&lt;br /&gt;
would take a shared lock on the very PurchaseReturnOrder row the dying&lt;br /&gt;
transaction may still hold.&lt;br /&gt;
&lt;br /&gt;
Finance may then settle the return as B2C for the rest of that calendar day:&lt;br /&gt;
refundAsB2c credits the value NET of GST in whole rupees (B2cRefundQuote,&lt;br /&gt;
HALF_UP per line, so the line table and the total always agree), restores&lt;br /&gt;
the stock and issues a local credit note for exactly that amount with no tax&lt;br /&gt;
on its lines, no IRN and NIC&apos;s reason recorded. The amount is fixed - the&lt;br /&gt;
caller must pass back the quoted figure - and a remark and explicit consent&lt;br /&gt;
are required. On a later day the option only reopens after a fresh approval&lt;br /&gt;
attempt is refused again, so NIC is always re-checked first.&lt;br /&gt;
&lt;br /&gt;
Mails: every refusal notifies Accounts L2 and above; the B2C settlement&lt;br /&gt;
notifies them and the partner&apos;s Warehouse L1/L2, both tabulated.&lt;br /&gt;
&lt;br /&gt;
The partner account statement is unaffected: it skips RETURNS notes and&lt;br /&gt;
credits returns from returnorderinfo, so the new notes cannot double-credit.&lt;br /&gt;
&lt;br /&gt;
DEPLOY ORDER: apply sql/add_return_b2c_refund_20260921.sql BEFORE any war&lt;br /&gt;
built from this dao. CreditNote now maps irn_skip_reason and b2c, so every&lt;br /&gt;
credit-note read in web, fofo and cron fails until the columns exist.&lt;br /&gt;
Untested beyond compilation.&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/ReturnIrnFailure.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/transaction/CreditNote.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/ReturnIrnFailureRepository.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/ReturnIrnFailureRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/integrations/gstpro/GstProService.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/B2cRefundQuote.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/PurchaseReturnNotificationService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/PurchaseReturnNotificationServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/PurchaseReturnService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/PurchaseReturnServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/ReturnIrnFailureRecorder.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/ReturnIrnGstinFailureException.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/add_return_b2c_refund_20260921.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37790</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37790</guid></item>
<item><pubDate>Fri, 25 Sep 2026 16:18:12 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37785 – feat(cs): demo partner access menu for Sales L6 and above ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;feat(cs): demo partner access menu for Sales L6 and above&lt;br /&gt;
&lt;br /&gt;
menu_category rows for Sales (category 4) ordinals 5-9 (L6..Final) on the&lt;br /&gt;
Demo Partner Access menu. INSERT IGNORE on the PK (latin1 column rejects a&lt;br /&gt;
utf8-literal NOT EXISTS compare). Applied on hadb1 2026-09-25.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/resources/sql/migration_demo_partner_access.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37785</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37785</guid></item>
<item><pubDate>Fri, 25 Sep 2026 13:16:59 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37779 – feat(cs): demo partner access for sales team  New cs.demo_partner_access ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 7 file(s) modified&lt;/strong&gt;&lt;br/&gt;feat(cs): demo partner access for sales team&lt;br /&gt;
&lt;br /&gt;
New cs.demo_partner_access binding (sales auth user -&gt; partner) used only to&lt;br /&gt;
open a partner&apos;s dashboard/app for demos. Read only at partner-view entry&lt;br /&gt;
points; CsService position mappings are untouched, so performance, targets,&lt;br /&gt;
reports and cron mails are unaffected.&lt;br /&gt;
&lt;br /&gt;
- DemoPartnerAccess entity + repository&lt;br /&gt;
- DemoPartnerAccessService: grant (sales-only, active store, skips duplicate&lt;br /&gt;
  and position-mapped), soft revoke, isAllowed (position OR demo),&lt;br /&gt;
  demo emails for app lists, canManage (mirrors sidebar menu rule)&lt;br /&gt;
- AdminUser.ALL_MENU_EMAILS extracted so canManage and the sidebar share it&lt;br /&gt;
- migration_demo_partner_access.sql: table + &quot;Demo Partner Access&quot; menu&lt;br /&gt;
  under Admin Control (NOT yet applied on hadb1)&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/cs/DemoPartnerAccess.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/cs/DemoPartnerAccessRepository.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/cs/DemoPartnerAccessRepositoryImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/cs/DemoPartnerAccessService.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/cs/DemoPartnerAccessServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/AdminUser.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/migration_demo_partner_access.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37779</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37779</guid></item>
<item><pubDate>Thu, 24 Sep 2026 22:37:06 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37778 – fix(catalog): delist cron retires only models it darkened in the ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 3 file(s) modified&lt;/strong&gt;&lt;br/&gt;fix(catalog): delist cron retires only models it darkened in the same run&lt;br /&gt;
&lt;br /&gt;
Step 4 scanned every mobile model with no active listing and moved it to OTHER,&lt;br /&gt;
so new launches (categorised before listing) and hand-paused models were retired&lt;br /&gt;
the next morning, e.g. Nothing Phone 4 1026596-603 on 2026-09-15. Scope it to&lt;br /&gt;
models whose listing this run delisted (_delist_audit run_date = today).&lt;br /&gt;
Add fix_dark_model_retire_20260924.sql to restore the 16 models still stuck on OTHER.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/catalog/CatalogDelistServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/resources/sql/delist_inactive_listings_rolling_24m.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/fix_dark_model_retire_20260924.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37778</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37778</guid></item>
<item><pubDate>Thu, 24 Sep 2026 20:16:26 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37776 – returns: reverse a refunded debit-note return whose goods never reached ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 16 file(s) modified&lt;/strong&gt;&lt;br/&gt;returns: reverse a refunded debit-note return whose goods never reached the warehouse&lt;br /&gt;
&lt;br /&gt;
Once a return was refunded nothing could undo it - rejectReturn refuses an already&lt;br /&gt;
refunded one - so a return booked and paid for goods that never arrived left phantom&lt;br /&gt;
warehouse stock, the unit missing from partner stock, the order marked returned, a&lt;br /&gt;
wallet credit and a filed credit note, with no way back.&lt;br /&gt;
&lt;br /&gt;
ReturnReversalService.reverse(imei, reason, by, dryRun) undoes exactly one unit:&lt;br /&gt;
the warehouse return scan (row deleted so a genuine return later is not rejected as a&lt;br /&gt;
duplicate) and the stock it added, partner stock with its schemes/price drop/offers,&lt;br /&gt;
the order&apos;s return quantity and status, the wallet refund as a REVERSAL entry, and the&lt;br /&gt;
return item / debit note. Guards refuse anything that has moved since the refund, and a&lt;br /&gt;
dry run reports the plan without writing.&lt;br /&gt;
&lt;br /&gt;
The credit note follows movement and the NIC clock: inside the 24h window, and only&lt;br /&gt;
when the note credits nothing but this unit, its IRN is cancelled and the note marked&lt;br /&gt;
cancelled; past it a DBN with its own IRN is issued against the note&lt;br /&gt;
(CreditNoteService.issueReturnReversalDebitNote, stored as CN_CANCELLATION with no&lt;br /&gt;
margin month so the statement does not show it twice - the wallet REVERSAL is the&lt;br /&gt;
statement line); a note never filed at NIC is voided locally. Every local write happens&lt;br /&gt;
first and NIC last, so a refusal rolls the whole reversal back.&lt;br /&gt;
&lt;br /&gt;
fofo.return_reversal (return_reversal_20260921.sql) records each reversal and, unique&lt;br /&gt;
per return item, makes it once-only. Also adds cancelled=0 to the RETURNS_CN branches of&lt;br /&gt;
the account statement queries, without which a cancelled note keeps crediting the&lt;br /&gt;
statement - no current effect, no RETURNS note is cancelled today.&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/ReturnReversal.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/ReturnReversalRepository.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/ReturnReversalRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/CreditNoteRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/CreditNoteRepositoryImpl.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/inventory/InventoryService.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/inventory/ReturnReversalModel.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/ReturnReversalService.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/ReturnReversalServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/CreditNoteService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/CreditNoteServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/WarehouseInventoryService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/WarehouseInventoryServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/return_reversal_20260921.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37776</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37776</guid></item>
<item><pubDate>Thu, 24 Sep 2026 18:54:23 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37769 – fix(movement): receive a movement invoice only against its own PO, ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 10 file(s) modified&lt;/strong&gt;&lt;br/&gt;fix(movement): receive a movement invoice only against its own PO, stop auto-closing movements, cancel reduces the PO line&lt;br /&gt;
&lt;br /&gt;
- GRN: movement invoice resolves invoice -&gt; orders -&gt; transaction -&gt; its own movement PO (or a receive-only PO&lt;br /&gt;
  from the billing warehouse); supplier/warehouse keyed at entry must match; scanned IMEIs must be the billed ones&lt;br /&gt;
- Cancelling an unbilled movement order takes its qty off the PO line; PO CLOSED/PRECLOSED once nothing is open&lt;br /&gt;
- reopenedAt removed (movements no longer auto-close); PO records createdBy&lt;br /&gt;
- SupplierStateResolver: a supplier&apos;s state is derived from its GSTIN on save&lt;br /&gt;
- sql: add_po_created_by (applied), drop_po_reopened_at (run AFTER fofo/cron/web deploy)&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/warehouse/WarehousePurchaseOrder.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/warehouse/InvoiceService.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;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/SupplierStateResolver.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/add_po_created_by_20260924.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/drop_po_reopened_at_20260924.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/test/java/com/spice/profitmandi/service/warehouse&lt;br /&gt;+ /trunk/profitmandi-dao/src/test/java/com/spice/profitmandi/service/warehouse/SupplierStateResolverTest.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37769</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37769</guid></item>
<item><pubDate>Thu, 24 Sep 2026 17:21:58 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37764 – feat(store-closure): require reason, remark and approval mail to close a ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 7 file(s) modified&lt;/strong&gt;&lt;br/&gt;feat(store-closure): require reason, remark and approval mail to close a store; mail closure report&lt;br /&gt;
&lt;br /&gt;
- fofo.store_closure audit table (reason, remark, approval document, closed_by); migration applied on hadb1&lt;br /&gt;
- StoreClosureService: validates and closes, queues closure report with approval attached to the&lt;br /&gt;
  partner&apos;s Sales L2, top 3 Sales levels, top Accounts level and the closer&lt;br /&gt;
- StoreAccess: single home for store close/deactivate/activate/extend-billing access lists;&lt;br /&gt;
  neeraj.gupta can close, mohit.gulati removed from extend billing&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/fofo/StoreClosure.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/enumuration/fofo/StoreClosureReason.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/StoreClosureRepository.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/StoreClosureRepositoryImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/user/StoreAccess.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/user/StoreClosureService.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/migration_store_closure.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37764</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37764</guid></item>
<item><pubDate>Fri, 18 Sep 2026 18:15:09 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37724 – chore(hot-deals): restore 5 catalogs to OEM brand, add POCO M7 ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;chore(hot-deals): restore 5 catalogs to OEM brand, add POCO M7 Plus 5G (4GB 128GB)_s to Hot Deal&lt;br /&gt;
&lt;br /&gt;
Applied on hadb1 2026-09-18. Removed 1025252/1025253 (Samsung A06) and&lt;br /&gt;
1026085/1026403/1026408 (Refurbished iPhones) via _hot_deal_brand_freeze;&lt;br /&gt;
added catalog 1026568 (item 40832) with freeze + scope rows.&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/hot_deal_brand_remove_5_catalogs_20260918.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37724</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37724</guid></item>
<item><pubDate>Fri, 18 Sep 2026 05:05:15 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37713 – fix(warehouse): record the order&apos;s own vendor when a receipt line ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 2 file(s) modified&lt;/strong&gt;&lt;br/&gt;fix(warehouse): record the order&apos;s own vendor when a receipt line carries no origin&lt;br /&gt;
&lt;br /&gt;
- r37694 took the origin only from lineitem.origin_vendor_id, which exists on orders raised from that revision onward, so goods arriving on older open orders landed with a cost but no vendor - 282 rows on the first day&lt;br /&gt;
- A purchase from an outside vendor now falls back to that supplier; internal movements are unchanged and an unknowable origin still stays NULL&lt;br /&gt;
- sql/backfill_receipt_origin_20260918.sql repairs the 282 already received (run on prod 2026-09-18; bak warehouse._bak_receipt_origin_20260918); in-stock unknown 895 -&gt; 648&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/WarehouseServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/backfill_receipt_origin_20260918.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37713</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37713</guid></item>
<item><pubDate>Fri, 18 Sep 2026 04:26:13 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37708 – Migration: state the algorithm and lock mode, and why it ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Migration: state the algorithm and lock mode, and why it runs before the release&lt;br /&gt;
&lt;br /&gt;
hadb1 is MySQL 5.7, so adding a column rebuilds the table rather than only touching metadata.&lt;br /&gt;
At ~53k rows that is seconds and InnoDB permits concurrent reads and writes throughout, but&lt;br /&gt;
ALGORITHM/LOCK are now stated explicitly so it fails loudly rather than quietly taking a table&lt;br /&gt;
lock if that ever stops holding.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/resources/sql/add_po_reopened_at_20260918.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37708</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37708</guid></item>
<item><pubDate>Fri, 18 Sep 2026 04:18:12 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37704 – Reopen a movement PO whose stock arrived late, and stop ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 8 file(s) modified&lt;/strong&gt;&lt;br/&gt;Reopen a movement PO whose stock arrived late, and stop stranding GRN price corrections&lt;br /&gt;
&lt;br /&gt;
Internal movements auto-close after four days, which fits 99.6% of them - 5,491 of 5,515 receipts&lt;br /&gt;
land inside the window. The remainder leave the PO closed with the stock still in transit and&lt;br /&gt;
nowhere to receive it: 998 internal POs closed during 2026 still holding 21,996 unreceived units.&lt;br /&gt;
&lt;br /&gt;
A closed movement PO can now be reopened from the purchase order list. Reopening stamps&lt;br /&gt;
reopenedAt, and auto-close measures from WarehousePurchaseOrder.getOpenSince() - reopenedAt when&lt;br /&gt;
set, the PO date otherwise - so a reopened PO gets the same fresh window a new one gets instead of&lt;br /&gt;
being closed straight back on the next sweep. Only movements between our own warehouses: an&lt;br /&gt;
external vendor PO that has closed is settled with that vendor, not reopened unilaterally.&lt;br /&gt;
&lt;br /&gt;
Separately, a GRN price correction now checks that the PO it just raised is one the invoice can&lt;br /&gt;
actually be received against. Matching reads POs that are open and approved for the same supplier&lt;br /&gt;
and warehouse dated on or before the invoice; it never looks at the PO being corrected, so what&lt;br /&gt;
matters is that the new PO is receivable. 54 were not - backdated into INIT by the old approval&lt;br /&gt;
gate, hence outside the match - and each stranded silently: original line discarded, GRN completed&lt;br /&gt;
without it, the correction left holding a reservation for stock that had already arrived.&lt;br /&gt;
&lt;br /&gt;
isOpen() names the open set - INIT, READY, PARTIALLY_FULFILLED - that the movement and commitment&lt;br /&gt;
queries already read.&lt;br /&gt;
&lt;br /&gt;
Migration sql/add_po_reopened_at_20260918.sql adds reopenedAt, nullable and additive. It must run&lt;br /&gt;
before this ships: the entity maps the column.&lt;/div&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/purchaseorder/POScheduler.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/warehouse/WarehousePurchaseOrder.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/resources/sql/add_po_reopened_at_20260918.sql&lt;br /&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/warehouse/PurchaseOrderController.java&lt;br /&gt;~ /trunk/profitmandi-fofo/src/main/webapp/resources/js/warehouse-purchase.js&lt;br /&gt;~ /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/warehouse-purchase-order.vm&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37704</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37704</guid></item>
<item><pubDate>Thu, 17 Sep 2026 18:19:28 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37694 – feat(warehouse): record where stock came from and what it cost; ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 11 file(s) modified&lt;/strong&gt;&lt;br/&gt;feat(warehouse): record where stock came from and what it cost; price internal movements at that cost&lt;br /&gt;
&lt;br /&gt;
- inventoryItem.origin_vendor_id / receipt_unit_cost and lineitem.origin_vendor_id (sql/add_inventory_cost_layer_20260917.sql, applied on prod 2026-09-17 in 75s): GRN copies both from the PO line it arrived on, so origin survives any number of hops and non-serialised stock keeps it too. Unknowable origin stays NULL - never a guess, never an internal supplier&lt;br /&gt;
- A movement now moves stock at the cost it was received at, not the origin vendor&apos;s current catalog TP. Layers are grouped by cost; a quantity spanning two costs is refused with both numbers, since a PO line carries one price&lt;br /&gt;
- Stock already promised on open outbound movement orders is no longer offered again (176 item/warehouse pairs on prod are fully promised today)&lt;br /&gt;
- Stock on open inbound POs is offered for planning at that order&apos;s price and reported as &apos;on the way in&apos;, but cannot be dispatched until received; the PO item picker lists those items too&lt;br /&gt;
- Backfill: 4,010 of 4,646 in-stock rows on prod got origin and cost; 636 stay unknown and are priced from the latest approved external catalog price as before&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/warehouse/WarehouseInventoryItem.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/warehouse/WarehouseLineItem.java&lt;br /&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/warehouse/WarehouseInventoryItemRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/warehouse/WarehouseLineItemRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/warehouse/WarehouseLineItemRepositoryImpl.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/PurchaseOrderServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/WarehouseServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/add_inventory_cost_layer_20260917.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37694</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37694</guid></item>
<item><pubDate>Thu, 17 Sep 2026 17:59:10 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37688 – Record that the counter/privatedealuser rename was applied on hadb1 (suffix ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Record that the counter/privatedealuser rename was applied on hadb1 (suffix _dropped_20260917)&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/resources/sql/retire_counter_privatedealuser_20260916.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37688</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37688</guid></item>
<item><pubDate>Thu, 17 Sep 2026 16:29:06 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37679 – feat(warehouse): carry the PO creator through purchase order creation for ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 4 file(s) modified&lt;/strong&gt;&lt;br/&gt;feat(warehouse): carry the PO creator through purchase order creation for backdated auto-approval&lt;br /&gt;
&lt;br /&gt;
Backdated POs are to be auto-approved in the name of whoever raised them, but the service had no way&lt;br /&gt;
to know who that was: the model carried no user and buyerId is the seller, not a person.&lt;br /&gt;
&lt;br /&gt;
- CreateWarehousePurchaseOrderModel carries createdBy&lt;br /&gt;
- resolvedMismatchRequest takes resolvedBy, so the correction PO raised on a GRN price mismatch -&lt;br /&gt;
  dated to the supplier invoice and therefore backdated by nature - is credited to whoever resolved it&lt;br /&gt;
- staged backfill SQL for the three backdated POs still stuck in INIT inside POScheduler&apos;s&lt;br /&gt;
  auto-close window; data only, no schema change, not yet run&lt;br /&gt;
&lt;br /&gt;
The release-to-READY change in PurchaseOrderServiceImpl follows separately.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/CreateWarehousePurchaseOrderModel.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/GrnRequestService.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/resources/sql/backdated_po_auto_approval_backfill_20260917.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37679</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37679</guid></item>
<item><pubDate>Wed, 16 Sep 2026 19:22:00 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37667 – chore(sql): drop vendor catalog pricing for supplier 1 Hotspot, flagged ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;chore(sql): drop vendor catalog pricing for supplier 1 Hotspot, flagged internal 2026-09-16 (as run on prod; backups _bak_vcp/_vcpl_internal_hotspot_20260916)&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/drop_internal_vendor_catalog_pricing_hotspot_20260916.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37667</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37667</guid></item>
<item><pubDate>Wed, 16 Sep 2026 15:32:35 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37652 – Internal store buyer address: always read user.address  An INTERNAL ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 4 file(s) modified&lt;/strong&gt;&lt;br/&gt;Internal store buyer address: always read user.address&lt;br /&gt;
&lt;br /&gt;
An INTERNAL store is the buying identity of a warehouse, so order creation&lt;br /&gt;
resolved its address from transaction.warehouseaddressmaster while every&lt;br /&gt;
screen read transaction.addId -&gt; user.address. The Delhi warehouses moved to&lt;br /&gt;
warehouseaddressmaster 26 in Sept 2024 and nothing carried that across, so&lt;br /&gt;
user.address still held the 2021 L-222 premises: same buyer, two addresses.&lt;br /&gt;
&lt;br /&gt;
user.address for active internal stores is now aligned with the mapped&lt;br /&gt;
warehouse address (sql/20260916_sync_internal_store_addresses.sql), split&lt;br /&gt;
exactly as getCustomAddress() does so the next invoice is unchanged. With&lt;br /&gt;
that true, createTransactionForWarehouse no longer special-cases internal.&lt;br /&gt;
&lt;br /&gt;
SellerService.syncInternalStoreAddresses carries a warehouse address remap&lt;br /&gt;
through to its internal stores - the mapping has no edit screen and is&lt;br /&gt;
repointed directly in the database, which is why nothing propagated before.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/SellerService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/SellerServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/TransactionServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/20260916_sync_internal_store_addresses.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37652</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37652</guid></item>
<item><pubDate>Wed, 16 Sep 2026 09:28:33 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37650 – SQL to retire user.counter / user.privatedealuser / address mapping after ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;SQL to retire user.counter / user.privatedealuser / address mapping after r37648-49 deploy (rename, reversible)&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/retire_counter_privatedealuser_20260916.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37650</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37650</guid></item>
<item><pubDate>Tue, 15 Sep 2026 18:40:23 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37646 – Hot Deal brand: dedupe model_hot_deal to one row per catalog ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;Hot Deal brand: dedupe model_hot_deal to one row per catalog before the unique key (prod had one Realme duplicate from the old windowed model)&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/resources/sql/hot_deal_brand_migration.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37646</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37646</guid></item>
<item><pubDate>Tue, 15 Sep 2026 17:39:20 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37640 – Hot Deal brand: brand-driven membership, model_hot_deal reduced to attributes + ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 14 file(s) modified&lt;/strong&gt;&lt;br/&gt;Hot Deal brand: brand-driven membership, model_hot_deal reduced to attributes + oem_brand + oem_catalog_id, migration SQL&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/cart/CartServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/catalog/ModelHotDeal.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/catalog/TagListing.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/catalog/CatalogRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/catalog/CatalogRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/catalog/ModelHotDealRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/catalog/ModelHotDealRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/service/solr/FofoSolr.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/catalog/ModelHotDealService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/catalog/ModelHotDealServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/pricing/PricingServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/hot_deal_brand_migration.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/hot_deal_brand_schema.sql&lt;br /&gt;~ /trunk/profitmandi-dao/src/test/java/com/spice/profitmandi/service/catalog/ModelHotDealServiceImplTest.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37640</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37640</guid></item>
<item><pubDate>Tue, 15 Sep 2026 17:38:59 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37639 – chore(sql): second internal vendor catalog pricing cleanup, as run on ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 1 file(s) modified&lt;/strong&gt;&lt;br/&gt;chore(sql): second internal vendor catalog pricing cleanup, as run on prod 2026-09-15&lt;br /&gt;
&lt;br /&gt;
- 100 internal rows recreated 2026-09-14 18:07 for 325/326/371/382/406 (guard r37634 not yet deployed) and supplier 452, switched to internal 2026-09-15&lt;br /&gt;
- Backups _bak_vcp_internal_20260915 (251) / _bak_vcpl_internal_20260915 (367)&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/drop_internal_vendor_catalog_pricing_20260915.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37639</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37639</guid></item>
<item><pubDate>Tue, 15 Sep 2026 17:23:02 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37634 – feat(pricing): tag_listing price change log; retire vendoritempricing writes/reads in dao; ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 14 file(s) modified&lt;/strong&gt;&lt;br/&gt;feat(pricing): tag_listing price change log; retire vendoritempricing writes/reads in dao; price drops no longer touch vendor catalog pricing&lt;br /&gt;
&lt;br /&gt;
- New catalog.tag_listing_price_log (sql/create_tag_listing_price_log_20260915.sql, applied on prod 2026-09-15) + TagListingPriceService: the single setter for tag_listing DP/MOP/MRP, logging old/new values, source and user&lt;br /&gt;
- Remove applyPriceDrop (r37622): price drops write only price_drop + tag_listing; sql/revert_price_drop_vendor_catalog_pricing_20260915.sql restores the 30 rows it wrote (run on prod)&lt;br /&gt;
- VendorCatalogPricingService: reference TP = latest approved external TP (single + batched); internal suppliers rejected on create, bulk upload and approval&lt;br /&gt;
- Stop copying pricing into vendoritempricing on approval and item upload; tag listing detail TP from reference TP; indent DP from tag_listing only&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/catalog/TagListingPriceLog.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/inventory/SaholicInventoryCIS.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/catalog/TagListingPriceLogRepository.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/catalog/TagListingPriceLogRepositoryImpl.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/service/catalog/ItemLoaderService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/VendorCatalogPricingService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/VendorCatalogPricingServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/tag/TagListingPriceService.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/tag/TagListingPriceServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/tag/TagServiceImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/create_tag_listing_price_log_20260915.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/revert_price_drop_vendor_catalog_pricing_20260915.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37634</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37634</guid></item>
<item><pubDate>Mon, 14 Sep 2026 18:57:18 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37625 – fix(internal-movement): trace serial origin to the latest external purchase, matching ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 3 file(s) modified&lt;/strong&gt;&lt;br/&gt;fix(internal-movement): trace serial origin to the latest external purchase, matching billing&lt;br /&gt;
&lt;br /&gt;
- resolveInternalMovementPrices orders the serial&apos;s external purchases newest first (was oldest), so transfers and billing name the same original vendor; no in-stock unit on prod changes (0 of 3,734)&lt;br /&gt;
- Restore resolveInternalMovementPrices javadoc onto its own method&lt;br /&gt;
- Add drop_internal_vendor_catalog_pricing_20260914.sql, as run on prod 2026-09-14 17:33 (15 New Spice internal suppliers; backups _bak_vcp/_bak_vcpl_internal_20260914)&lt;/div&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/warehouse/WarehouseInventoryItemRepositoryImpl.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/drop_internal_vendor_catalog_pricing_20260914.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37625</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37625</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=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37608</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37608</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=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37607</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37607</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=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37601</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37601</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=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37597</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37597</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=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37592</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37592</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=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37588</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37588</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=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37581</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37581</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=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37578</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37578</guid></item>
<item><pubDate>Thu, 10 Sep 2026 11:58:08 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37566 – Delist logic v3: require a month of no movement; add ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 4 file(s) modified&lt;/strong&gt;&lt;br/&gt;Delist logic v3: require a month of no movement; add CatalogDelistService&lt;br /&gt;
&lt;br /&gt;
Zero stock alone was too weak a test. It fired on SKUs partners were still&lt;br /&gt;
transacting, where the recent movement was often the very sale that emptied the&lt;br /&gt;
stock. v3 additionally requires no movement for a month on either side:&lt;br /&gt;
- SmartDukaan via warehouse.scanNew (3.4M rows, live). Note warehouse.scan is a&lt;br /&gt;
  dead Saholic relic - 2,476 rows, last write 2012.&lt;br /&gt;
- any partner via fofo.scan_record, any scan type.&lt;br /&gt;
Phrased as NOT EXISTS so they short-circuit on the first recent row and use the&lt;br /&gt;
(inventoryItemId, scannedAt) / (inventory_item_id, create_timestamp) indexes.&lt;br /&gt;
An item that has never moved still qualifies, which is correct.&lt;br /&gt;
&lt;br /&gt;
Also in v3:&lt;br /&gt;
- the internal pseudo-brands (Dummy, FOC, FOC HANDSET, Live Demo) are no longer&lt;br /&gt;
  excluded and are swept like anything else.&lt;br /&gt;
- vendor-PO guard narrowed to status = 1. PARTIALLY_FULFILLED is UNREACHABLE,&lt;br /&gt;
  not merely rare: none of the 8 PO-status writes in the codebase sets it, no&lt;br /&gt;
  native SQL writes the column, and status = 2 has 0 rows across 51,593+ POs&lt;br /&gt;
  back to 2011. Partial receipt is modelled per line (unfulfilledQuantity), so a&lt;br /&gt;
  part-received PO sits in READY and is already caught. Documented so it is not&lt;br /&gt;
  &apos;restored&apos; later as a supposed gap.&lt;br /&gt;
&lt;br /&gt;
CatalogDelistService/Impl mirrors the migration statement for statement, for the&lt;br /&gt;
daily scheduled run. Bulk SQL rather than per-row updateActiveById +&lt;br /&gt;
publishStatusChange, which would commit to Solr once per catalog (~1,750 times&lt;br /&gt;
on the 2026-09-10 backlog); the job is instead scheduled ahead of the existing&lt;br /&gt;
06:00 full reindex. The dark-model step is deliberately house-wide rather than&lt;br /&gt;
run-scoped so it converges instead of leaving pre-existing dark models on a&lt;br /&gt;
stale RUNNING forever.&lt;br /&gt;
&lt;br /&gt;
rollback_delist_recent_movement_20260910.sql restores the 24 listings / 21&lt;br /&gt;
models that the v2 run delisted before NEW 3 existed; their partners had&lt;br /&gt;
transacted them within the month. Id list frozen, not re-derived.&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/catalog/CatalogDelistService.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/catalog/CatalogDelistServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/resources/sql/delist_inactive_listings_rolling_24m.sql&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/resources/sql/rollback_delist_recent_movement_20260910.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37566</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37566</guid></item>
<item><pubDate>Thu, 10 Sep 2026 02:52:18 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37563 – Filter delisted SKUs out of creation pickers; add rolling 24m ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 7 file(s) modified&lt;/strong&gt;&lt;br/&gt;Filter delisted SKUs out of creation pickers; add rolling 24m delist migration&lt;br /&gt;
&lt;br /&gt;
Creation screens could offer items whose catalog.tag_listing.active = 0:&lt;br /&gt;
- Item.selectAllModels (scheme/offer model dropdown) joined tag_listing with&lt;br /&gt;
  no active predicate. Adding tl.active = true also gives the model-level&lt;br /&gt;
  rollup, since callers dedupe to catalogItemId: a model whose colours are&lt;br /&gt;
  all inactive now yields no rows, one keeping a listed colour stays.&lt;br /&gt;
- The shared partner item picker had no active filter at all. Added a second&lt;br /&gt;
  basis via getAllPartnerItemStringDescription(anyColor, activeOnly);&lt;br /&gt;
  activeOnly participates in the fofoItems cache key so the two bases cannot&lt;br /&gt;
  serve each other&apos;s cached results. Default stays false for screens that&lt;br /&gt;
  inspect or edit existing records.&lt;br /&gt;
- New TagListing.selectActiveItemIds named query backs the filter.&lt;br /&gt;
&lt;br /&gt;
Also adds the rolling 24-month delist migration: zero stock both sides, no&lt;br /&gt;
outstanding vendor PO (status IN (1,2), external supplier, unfulfilled &gt; 0 --&lt;br /&gt;
INIT is excluded as it is a drawer of stale drafts), and re-categorises&lt;br /&gt;
fully-dark mobile models to OTHER. Idempotent, audited, rollback documented.&lt;/div&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/catalog/Item.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/catalog/TagListing.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/catalog/TagListingRepository.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/catalog/TagListingRepositoryImpl.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/InventoryService.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/resources/sql/delist_inactive_listings_rolling_24m.sql&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37563</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fresources%2Fsql%2F&amp;isdir=1&amp;rev=37563</guid></item>
</channel></rss>