屏蔽自采购清空
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user