<?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/java/com/spice/profitmandi/service/warehouse/InvoiceService.java</title><description>WebSVN RSS feed &#x2013; SmartDukaan</description><lastBuildDate>Wed, 07 Oct 2026 19:35:34 +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%2Fjava%2Fcom%2Fspice%2Fprofitmandi%2Fservice%2Fwarehouse%2FInvoiceService.java&amp;max=40&amp;</link><atom:link href="https://svn.smartdukaan.com/rss.php?path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fjava%2Fcom%2Fspice%2Fprofitmandi%2Fservice%2Fwarehouse%2FInvoiceService.java&amp;repname=SmartDukaan" rel="self" type="application/rss+xml" />
<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%2Fjava%2Fcom%2Fspice%2Fprofitmandi%2Fservice%2Fwarehouse%2FInvoiceService.java&amp;rev=37769</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fjava%2Fcom%2Fspice%2Fprofitmandi%2Fservice%2Fwarehouse%2FInvoiceService.java&amp;rev=37769</guid></item>
<item><pubDate>Mon, 09 Feb 2026 23:56:47 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 35716 – Refactor GrnController and PurchaseOrderController: extract business logic into focused services ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 10 file(s) modified&lt;/strong&gt;&lt;br/&gt;Refactor GrnController and PurchaseOrderController: extract business logic into focused services and fix N+1 query performance issues&lt;br /&gt;
&lt;br /&gt;
- Create InvoiceService: invoice item CRUD, validation, vendor price matching&lt;br /&gt;
- Create GrnRequestService: GRN request lifecycle, mismatch resolution state machine&lt;br /&gt;
- Create DebitNoteService: debit note generation, PDF model building&lt;br /&gt;
- Move PO amendment logic from PurchaseOrderController to PurchaseOrderService&lt;br /&gt;
- Delegate generateDebitNote from PurchaseOrderServiceImpl to DebitNoteService&lt;br /&gt;
- Thin GrnController from ~1215 to ~717 lines, remove 15 unused autowired dependencies&lt;br /&gt;
- Thin PurchaseOrderController editPurchaseOrder from 40+ lines to 3 lines&lt;br /&gt;
&lt;br /&gt;
Performance fixes:&lt;br /&gt;
- InvoiceServiceImpl.validateInvoiceDetail: batch item/vendor pricing/GST loading (4N+3 queries -&gt; ~5)&lt;br /&gt;
- DebitNoteServiceImpl: batch item loading in buildDebitNotePdfModel and generateDebitNote&lt;br /&gt;
- GrnController.generateDebitNote: eliminate 2 redundant DB fetches&lt;br /&gt;
- Replace 3x supplierRepository.selectAll() with targeted selectBySupplierIds()&lt;/div&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/DebitNoteService.java&lt;br /&gt;+ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/DebitNoteServiceImpl.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/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/PurchaseOrderService.java&lt;br /&gt;~ /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/PurchaseOrderServiceImpl.java&lt;br /&gt;~ /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/warehouse/GrnController.java&lt;br /&gt;~ /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/warehouse/PurchaseOrderController.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fjava%2Fcom%2Fspice%2Fprofitmandi%2Fservice%2Fwarehouse%2FInvoiceService.java&amp;rev=35716</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2Ftrunk%2Fprofitmandi-dao%2Fsrc%2Fmain%2Fjava%2Fcom%2Fspice%2Fprofitmandi%2Fservice%2Fwarehouse%2FInvoiceService.java&amp;rev=35716</guid></item>
</channel></rss>