Subversion Repositories SmartDukaan

Rev

Show changed files | Directory listing | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
37819 7 h 41 m amit /trunk/profitmandi-fofo/src/main/ feat(loi): allow all Accounts users (L1-L4) to download Pending LOI Forms report  
37818 9 h 18 m amit /trunk/profitmandi-fofo/src/ feat(movement): allow full movable qty on PO screen, split raised as separate POs

- Cap the movement quantity at everything that can move; stock at more than one cost is
raised as one PO per cost on create (dao r37817). Note replaces 'raise a separate PO'.
- Tests: split by cost, multi-item PO grouping, same-warehouse refusal, shelf before arriving.
- jsVersion 440.
 
37817 9 h 18 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ fix(movement): shelf stock before arriving, one PO per cost, close PO on invoice cancel

- Internal movement fills from shelf stock before stock still arriving (a pending PO dated at
midnight ranked ahead of same-day receipts, pricing movements from units that never shipped).
- A quantity spanning stock at different costs is raised as one PO per cost at once instead of
being refused (first PO takes every item's oldest cost, the next the following cost).
- Refuse a movement from a warehouse to itself.
- Cancelling a movement's invoice/DC takes the order's qty off its PO and pre-closes it when
nothing is left open, as refunds already did.
 
37816 9 h 58 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ fix(einvoice): save the e-way bill whenever NIC returns EwbNo, not only with the EWBPPD note

GstProService saved EWB details only when InfoDtls held EWBPPD. NIC sends that
note (its pin-to-pin distance) only when we pass Distance=0, and the DUPIRN
get-by-IRN response carries no InfoDtls at all. So every partner with a
warehouse_partner_distance_mapping row, and every IRN recovered after a
timeout, lost its EWB although NIC had filed it (13 + 2 invoices in 30 days,
backfilled 2026-09-30), and a false "EWB Not Generated" mail was sent.

- Key on EwbNo; distance from EWBPPD, else the distance we sent, else none.
- Invoice PDF prints the "[distance]" suffix only when a distance is known
(was "[null]").
 
37815 10 h 25 m amit /trunk/profitmandi-fofo/src/main/ feat(loi): allow Finance L1 (Accounts) to download Pending LOI Forms report  
37814 1 d 7 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ revert(samsung-rebilling): drop TODO, keep ritesh.chauhan1 on the mail

Removes the TODO(amit.gupta) comment added in r37812. The only change left from
r37812 is ritesh.chauhan1 on To alongside kamini.sharma; tarun.verma stays on CC.
 
37813 1 d 7 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/warehouse/ revert(samsung-rebilling): restore original PCM filter, drop TODO

Reverts r37811: findByBillingDateBrand goes back to spcm.pcmDate > wsi.invoiceDate
(stores with no samsung_pcm row are no longer listed). File is identical to r37810.
 
37812 1 d 9 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ fix(samsung-rebilling): send rebilling mail to kamini.sharma and ritesh.chauhan1

praveen.sharma was dropped in r37631 (inactive auth user); ritesh.chauhan1 now joins
kamini.sharma on To, tarun.verma stays on CC. TODO(amit.gupta) records the open
points: recipients cannot open Manage PCM (menu 208 is Financial Services L1/L2),
and the CSV omits the invoice and PCM dates the query already returns.

Requires profitmandi-dao r37811 (missing-PCM rows); deploy dao and cron together.
 
37811 1 d 9 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/warehouse/ fix(samsung-rebilling): list IMEIs of stores with no PCM date

findByBillingDateBrand required spcm.pcmDate > wsi.invoiceDate in the WHERE, so the
left join to SamsungPCM behaved as an inner join and the "PCM date Missing" label in
the cron mail could never appear. No PCM date has been entered since 2025-10-26, so
the query has returned nothing on almost every run and the daily mail went silent.

Stores with no samsung_pcm row now come through with a null PCM date (interim),
alongside the existing PCM-date-after-invoice rows. Internal-movement stock is still
dropped by s.internal=false - TODO(amit.gupta) left on the query.

Deploy with the matching profitmandi-cron commit.
 
37810 1 d 10 h amit /trunk/profitmandi-fofo/src/main/ fix(irn-reset): allow reset of failed invoices and show the real rejection reason

A failed IRN filing leaves an einvoice_details row with irn NULL and only
irn_error_message set, but the reset panel treated any row as "IRN already
generated" and refused every failed invoice (e.g. NSLCK38227, GSP032 timeout,
billed same day) with the message "older than five days".

- Block only when einvoice_details.irn is set.
- Report a reason per invoice: not found / IRN already generated / already
queued / billed more than five days ago.
- Trim invoice numbers: the panel joins with ", ", so resetOrdersIrn matched
only the first invoice and silently skipped the rest.
 
37809 1 d 10 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/integrations/gstpro/ fix(einvoice): keep waiting for a fresh NIC auth token instead of giving up after one wait

getUsableAuthToken waited out an expiring token once and failed if NIC still
handed back one with under 60s of life. NSNOI14473 (2026-09-10) waited out a
token expiring 17:12:53, got one expiring 17:13:00 (6s left) and was parked at
irn_generated=0; the next invoice 5s later filed fine. Now waits up to 3 times,
each bounded by the remaining life of the token in hand.
 
37808 1 d 11 h ranu /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/ offer-radar notification commit  
37807 1 d 12 h amit /trunk/profitmandi-fofo/src/test/java/com/spice/profitmandi/service/inventory/ test(returns): B2C settlement after a GSTIN refusal, end to end

ReturnB2cRefundTest (Spring context, local dev DB, invoice NSNOI5746) covers
the r37790 flow: the quote is the value net of GST (33,439 -> 28,338); a
refused approval refunds nothing and records the attempt in its own
transaction; a wrongly typed amount and a missing remark or consent are
refused; settling as B2C refunds net of GST and issues a local credit note.
Seeded data rolls back; the refusal row it must commit is cleaned up by the
test. 5/5 pass.
 
37806 1 d 12 h amit /trunk/profitmandi-dao/src/test/java/com/spice/profitmandi/service/integrations/gstpro/ test(gstpro): classify NIC refusals - buyer GSTIN vs own seller vs state code

IrnRefusalClassificationTest covers GstProService.isInvalidBuyerGstin, which
decides whether a NIC refusal opens the Finance B2C settlement: a cancelled or
invalid BUYER GSTIN qualifies; a state-code mismatch or a message naming our
own seller GSTIN does not. 9/9 pass.
 
37805 1 d 21 h amit /trunk/profitmandi-dao/src/main/ fix(catalog): trim f_ colour prefix space; age delisted listings from last activation

- Item.normalizeColor drops the space after f_ on every write (upload sheets typed
'f_ Black', which read ' Black' everywhere); ItemLoaderService uses it so the
duplicate-colour check compares the clean value
- tag_listing.last_activated, stamped by TagListing.setActive on off->on;
updateActiveById now goes through the entity (+flush) so the toggle stamps it
- delist cron + SQL script age a listing from GREATEST(start_date, last_activated),
so a re-activated listing is not delisted again the next morning
- migrations: add_tag_listing_last_activated_20260929.sql, fix_item_color_prefix_space_20260929.sql
(both applied on hadb1 2026-09-29; 174 items trimmed, 36830 excluded - clashes with 37089)
 
37804 2 d 1 h amit /trunk/profitmandi-dao/src/main/ fix(fofo-store): store every GSTIN in upper case at the entity setter

FofoStore.setGstNumber now normalises through StringUtils.normalizeGstNumber,
so no write path can store a mixed-case GSTIN. Only the partner-update path
normalised before; the LOI and trial-form paths wrote the field directly,
which is how 06bmlpk3545g1z0 and 03AAccn9802g1zp reached the table. NIC
expects upper case, and case-sensitive comparisons (including the own-seller
GSTIN check behind a NIC refusal) silently failed to match.

uppercase_fofo_store_gstin_20260928.sql corrects the four rows already on
record; it is already applied on hadb1 (0 mixed-case GSTINs remain).
 
37803 2 d 1 h amit /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/ feat(scheme): offer only serialized Ear Buds models in the scheme picker

Scheme payouts are IMEI-driven, so a non-serialized earbud can never earn one.
For category 10024 the scheme-creation brand list and model list now ask the
inventory service for serialized items only (the dao side is already in
trunk); LED TV and the other categories are unchanged.
 
37802 2 d 4 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/user/ remove tarun sir email from some storetimline tat email  
37801 2 d 5 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/integrations/pinelabs/ Disable Pine Labs offer discovery behind a config switch (default off)

Turns off the live Pine Labs per-item offer discovery on the user's
instruction. New pinelabs.offer.discovery.enabled, default FALSE, so the
integration is off in every environment unless a properties file opts in.

Gated at the single point all discovery funnels through
(PinelabsAffordabilityServiceImpl.discoverOffers), so one switch stops the
nightly cache loop, a single-item refresh and the /pinelabs/offers endpoint
without editing the six call sites. discoverOffersRawJson gated too.
cacheAllItemOffers returns before its listing query, since the loop costs
4,507 items and ~12 minutes of a cron thread even when every call is a no-op.

Degrades gracefully rather than breaking the product surface: an empty
OfferDiscoveryResponse is exactly what the existing catch block returns, and
getGroupedCachedOffersForItems already drops an entry with an empty issuer
map. The Redis cache is a 24h TTL, so live badges drain within a day rather
than vanishing mid-request.

The @Value carries a default deliberately — pinelabs.api.base.url and the
credentials carry none, so a missing key stops the whole context (the r37495
class of outage). A kill switch must never be able to do that.

SCOPE: offer discovery ONLY. Payment-gateway traffic (orders, refunds,
callbacks, webhooks) and offer create/validate/downpayment are untouched,
so no live money path changes behaviour.

@Scheduled on ScheduledSkeleton.fetchOffersByItem is intentionally left in
place — with the flag off it is one log line, and re-enabling stays a config
change rather than a code change.

Build: dao + web + cron + fofo compile, BUILD SUCCESSFUL.
 
37800 2 d 7 h ranu /trunk/profitmandi-common/src/main/java/com/spice/profitmandi/common/model/ offer-radar notification commit  

Show All