Subversion Repositories SmartDukaan

Rev

Show changed files | Directory listing | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
37792 10 d 9 h amit /trunk/profitmandi-dao/src/ feat(cart): carry bag at Rs 1 per smartphone over Rs 12,000, extras at listing price

One carry bag (item 32046) is priced at Rs 1 for each smartphone (category
10006) in the cart selling above Rs 12,000; bags beyond that count are priced
at the carry bag's listing price, and Bronze partners pay listing for all.
Closes the leak where bag-only carts of hundreds of bags at Rs 1 were placed
from the old app. CarryBagQuote (via CartService.getCarryBagQuote) is the
single rule; the cart carries it as one line at a blended price.

- CartService/CartServiceImpl, CartResponse, OpenCartValidationResult: expose
the quote on the cart.
- OrderLineAllocator: an item may now have more than one cart line (the flat
and listing-priced parts); its units fill the lines in order.
- TransactionServiceImpl: item quantities merge instead of failing on a
duplicate item id.
- PurchaseServiceImpl: partner GRN creates one stock record per billed price;
the GRN screen shows the blended unit price; dead
createScannedNonSerializedItem removed.
- PurchaseReturnServiceImpl: debit-note PDF picks the order billed at the
returned stock's price; refundOrder spreads a non-serialized return over the
item's orders with room left (same price first) instead of loading it all
on the first order.

Tests: CarryBagQuoteTest 6/6, OrderLineAllocatorTest 13/13.
Deploy with profitmandi-web (same change) and the partner apps.
 
37767 14 d 6 h amit /trunk/profitmandi-dao/src/ fix(orders): movements ship from their source only; a row reserved beyond its stock gives nothing

Internal movement orders were allocated by the partner allocator, which spills a source
shortfall to every warehouse the brand mapping links to the destination - stock billed
there has no PO to be received against (PO 54279: 3 units put on Jaipur for a UP->Delhi
movement). createTransactionInternally now keeps the source's own rows only; a shortfall
still parks on the source's Dummy.

getItemQty took min(qty, netAvailability) on a row reserved beyond its stock - always the
case on a Dummy holding an open order - so a -1 row added a unit to the shortfall, which
then parked on the Dummy as an extra order (24 Sep: 9 units raised for a movement of 8,
refused by the cart-value guard). Rows with nothing free are now skipped and no longer
offset another row's free stock in the warehouse total.

Removes the empty, uncalled markOrdersAsGrnCompleted.
 
37721 20 d 8 h amit /trunk/profitmandi-dao/src/ fix(orders): price each order by the cart line that asked for it, not the first line of its model

Orders were priced from one cart line per catalog, so colours of one model at different
prices all took an arbitrary one. Internal movements (cost layers) failed with WLT_1000
when the dearer line won and were silently under-billed when the cheaper one did.
fulfillQty now prices from the item's own line, newColorQty from the model's any-colour
line; same-price output is unchanged. Refuse the transaction if orders do not total the cart.
 
35766 236 d 6 h amit /trunk/profitmandi-dao/src/ Fix fresh money calculation to use per-day paired approach instead of pooled 7-day window. Orders from earlier days no longer consume deposits from later days.