|
|
|
@@ -740,17 +740,12 @@ open class StockInLineService( |
|
|
|
) |
|
|
|
} |
|
|
|
@Transactional |
|
|
|
<<<<<<< Updated upstream |
|
|
|
private fun createStockLedgerForStockIn(stockInLine: StockInLine) { |
|
|
|
val item = stockInLine.item ?: return |
|
|
|
val inventory = inventoryRepository.findByItemId(item.id!!).orElse(null) ?: return |
|
|
|
|
|
|
|
val inQty = stockInLine.acceptedQty?.toDouble() ?: 0.0 |
|
|
|
======= |
|
|
|
private fun createStockLedgerForStockIn(stockInLine: StockInLine) { |
|
|
|
val item = stockInLine.item ?: return |
|
|
|
val inventory = inventoryRepository.findFirstByItemIdAndDeletedIsFalseOrderByIdAsc(item.id!!) ?: return |
|
|
|
>>>>>>> Stashed changes |
|
|
|
|
|
|
|
|
|
|
|
// ✅ 修复:查询最新的 stock_ledger 记录,基于前一笔 balance 计算 |
|
|
|
val latestLedger = stockLedgerRepository.findLatestByItemId(item.id!!).firstOrNull() |
|
|
|
|