| 36958 |
18 d 18 h |
amit |
/trunk/profitmandi-dao/src/main/ |
Flagship credit: fire interest-free limits at billing + per-IMEI conversion
- createLoanForBilling now detects flagship lines inside the billing transaction (fixes the
REQUIRES_NEW visibility bug where flagship detection re-queried uncommitted invoice_number and
never fired). Creates one combined flagship limit (is_flagship=1, limit_block=1, 30-day deadline)
plus one transaction.loan_imei row per device.
- convertFlagshipOnSale / IMEI activation now convert only the sold device's slice (matched by IMEI),
so same-model siblings and other billing tranches keep their interest-free window; full convert at
30-day expiry. Lock order aligned (loan -> loan_imei) to avoid sale/expiry deadlock.
- New transaction.loan_imei table + LoanImei entity/repository (migration_loan_imei_table.sql).
- selectAllLoansByInvoice: PurchaseReturn now settles BOTH the real loan and the flagship limit on a
flagship-invoice return (prevents credit leak from a stranded limit).
- Cap guard (flagship credit never exceeds amount drawn) and robust limit settlement (paisa threshold
instead of exact float equality). |
|
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/transaction/LoanImei.java /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/LoanImeiRepository.java /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/LoanImeiRepositoryImpl.java /trunk/profitmandi-dao/src/main/resources/sql/migration_loan_imei_table.sql
/trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/LoanRepository.java /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/LoanRepositoryImpl.java /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/InventoryServiceImpl.java /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/inventory/PurchaseReturnServiceImpl.java /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/order/OrderServiceImpl.java /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/SDCreditService.java /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/SDCreditServiceImpl.java /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/transaction/TransactionServiceImpl.java
|