屏蔽自采购清空

This commit is contained in:
zxj
2025-07-11 13:37:53 +08:00
parent a88321b7b6
commit 7459bd205a
3 changed files with 16 additions and 10 deletions
@@ -258,24 +258,24 @@ class ReceiptViewModel @Inject constructor(
Timber.d("startSensorScale weight = $weight, count = $count, finalCount = $finalCount, consumeValue = $consumeValue, purchaseValue = $purchaseValue")
// 计算单价
val finalPrice = when {
count == 0.0 -> {
finalCount == 0f -> {
0f
}
_amountUserInput.value && !_priceUserInput.value -> {
info.recPriceExItem!!.div(count).toSafeFloat()
info.recPriceExItem!!.div(finalCount).toSafeFloat()
}
else -> 0f
}
// 计算金额
val finalAmount = when {
count == 0.0 -> {
finalCount == 0f -> {
0f
}
_priceUserInput.value && !_amountUserInput.value -> {
count.times(info.recUnitPriceTaxIn!!).toSafeFloat()
finalCount.times(info.recUnitPriceTaxIn!!).toSafeFloat()
}
else -> 0f
@@ -284,7 +284,7 @@ class ReceiptViewModel @Inject constructor(
_selectedItem.value = info.copy(
goodsWeight = weight.toSafeBigDecimal(),
// 收货数量
receivedNumTemp = count.toFormattedString(),
receivedNumTemp = finalCount.toFormattedString(),
receivedNum = finalCount,
// 单价
recUnitPriceTaxIn = if (_priceUserInput.value) info.recUnitPriceTaxIn else finalPrice,