<?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-cron/src/main/java/com/smartdukaan/cron/migrations/InternalGrnReverser.java</title><description>WebSVN RSS feed &#x2013; SmartDukaan</description><lastBuildDate>Tue, 06 Oct 2026 14:14:04 +0530</lastBuildDate><generator>WebSVN 2.8.6-DEV</generator><language>en</language><link>https://svn.smartdukaan.com/log.php?repname=SmartDukaan&amp;path=%2F%2Ftrunk%2Fprofitmandi-cron%2Fsrc%2Fmain%2Fjava%2Fcom%2Fsmartdukaan%2Fcron%2Fmigrations%2FInternalGrnReverser.java&amp;max=40&amp;</link><atom:link href="https://svn.smartdukaan.com/rss.php?path=%2F%2Ftrunk%2Fprofitmandi-cron%2Fsrc%2Fmain%2Fjava%2Fcom%2Fsmartdukaan%2Fcron%2Fmigrations%2FInternalGrnReverser.java&amp;repname=SmartDukaan" rel="self" type="application/rss+xml" />
<item><pubDate>Mon, 14 Sep 2026 05:37:03 +0530</pubDate><dc:creator>amit</dc:creator><title>Rev 37617 – Undo an internal GRN so its invoice can be received ...</title><description>&lt;div&gt;&lt;strong&gt;amit – 3 file(s) modified&lt;/strong&gt;&lt;br/&gt;Undo an internal GRN so its invoice can be received again&lt;br /&gt;
&lt;br /&gt;
A receipt taken before the serials were split left stock that cannot be corrected in place: a&lt;br /&gt;
serialised unit is held one to a row, so an invoice that should have created several rows created one,&lt;br /&gt;
and the rows that are missing cannot be added without also unpicking the running figures the receipt&lt;br /&gt;
moved. Reversing the receipt and taking it again through the same path is the only way to arrive at&lt;br /&gt;
what the invoice actually says.&lt;br /&gt;
&lt;br /&gt;
The reversal removes what receiving created - the scans, the inventory units, the invoice items, the&lt;br /&gt;
purchase and the supplier invoice - and gives back the two running figures it moved: the warehouse&lt;br /&gt;
availability, and the quantity taken off the purchase order line. Both are worked out from the rows&lt;br /&gt;
being deleted rather than recomputed, so whatever the receipt added is exactly what comes off. A&lt;br /&gt;
purchase order the receipt closed is opened again. Availability is kept only as a running count with&lt;br /&gt;
nothing to rebuild it from, which is why it is adjusted by what is known to have been added rather&lt;br /&gt;
than by anything inferred.&lt;br /&gt;
&lt;br /&gt;
An invoice whose stock has moved since is refused, not worked around. A unit that has been scanned out&lt;br /&gt;
or partly consumed is no longer the receipt&apos;s to remove, and deleting around it would leave the&lt;br /&gt;
warehouse holding stock that no record explains. Each invoice is reversed on its own so one refusal&lt;br /&gt;
leaves the rest untouched, and a dry run reports everything it would delete and every figure it would&lt;br /&gt;
change without writing.&lt;br /&gt;
&lt;br /&gt;
Invoices are named explicitly rather than selected by date, so a reversal can only ever touch what it&lt;br /&gt;
was given.&lt;/div&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/Application.java&lt;br /&gt;+ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/migrations/InternalGrnReverser.java&lt;br /&gt;~ /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/migrations/InternalGrnTask.java&lt;br /&gt;</description><link>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F%2Ftrunk%2Fprofitmandi-cron%2Fsrc%2Fmain%2Fjava%2Fcom%2Fsmartdukaan%2Fcron%2Fmigrations%2FInternalGrnReverser.java&amp;rev=37617</link><guid>https://svn.smartdukaan.com/revision.php?repname=SmartDukaan&amp;path=%2F%2Ftrunk%2Fprofitmandi-cron%2Fsrc%2Fmain%2Fjava%2Fcom%2Fsmartdukaan%2Fcron%2Fmigrations%2FInternalGrnReverser.java&amp;rev=37617</guid></item>
</channel></rss>