体重使用稳定值,移除金额校验
This commit is contained in:
@@ -283,7 +283,7 @@ fun UnadjustedView(purchaseOrderList: List<GoodsInfo>, viewModel: ReceiptViewMod
|
||||
productList = purchaseOrderList,
|
||||
checkedItem = checkedItem,
|
||||
onItemCheckedClick = {
|
||||
viewModel.updateSelectedItem(it)
|
||||
viewModel.updateSelectedItemWithSwitch(it)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -638,11 +638,12 @@ private fun ReceiptProductEditView(
|
||||
}
|
||||
val expectAmount =
|
||||
selectedItem!!.receivedNum!!.times(selectedItem!!.recUnitPriceTaxIn!!)
|
||||
.toSafeFloat()
|
||||
Timber.d("金额判断:期望金额 = $expectAmount, 实际金额 = ${selectedItem!!.recPriceExItem}")
|
||||
if (expectAmount != selectedItem!!.recPriceExItem) {
|
||||
ToastUtils.showToast("数量和金额不符,请检查后再试")
|
||||
return@clickable
|
||||
}
|
||||
// if (expectAmount != selectedItem!!.recPriceExItem) {
|
||||
// ToastUtils.showToast("数量和金额不符,请检查后再试")
|
||||
// return@clickable
|
||||
// }
|
||||
viewModel.updatePurchaseItem(purchaseOrder = selectedItem!!.copy(isAdjusted = true))
|
||||
viewModel.updateSelectedItem(null)
|
||||
}, painter = painterResource(R.mipmap.ic_btn_confirm), contentDescription = "确定")
|
||||
|
||||
@@ -776,12 +776,13 @@ private fun SelfProductEditView(
|
||||
ToastUtils.showToast(errInfo)
|
||||
return@CustomButton
|
||||
}
|
||||
val expectAmount = selectedItem!!.goodsCount * selectedItem!!.goodsUnitPrice
|
||||
val expectAmount =
|
||||
(selectedItem!!.goodsCount.times(selectedItem!!.goodsUnitPrice)).toSafeDouble()
|
||||
Timber.d("金额判断:期望金额 = $expectAmount, 实际金额 = ${selectedItem!!.goodsPrice}")
|
||||
if (expectAmount != selectedItem!!.goodsPrice) {
|
||||
ToastUtils.showToast("数量和金额不符,请检查后再试")
|
||||
return@CustomButton
|
||||
}
|
||||
// if (expectAmount != selectedItem!!.goodsPrice) {
|
||||
// ToastUtils.showToast("数量和金额不符,请检查后再试")
|
||||
// return@CustomButton
|
||||
// }
|
||||
viewModel.addPurchaseItem(selectedItem!!)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -57,19 +57,19 @@ fun ReceiptUnadjustedListView(
|
||||
)
|
||||
Spacer(modifier = Modifier.width(10.dp))
|
||||
CustomSingleRightText(
|
||||
modifier = Modifier.width(100.dp),
|
||||
modifier = Modifier.width(120.dp),
|
||||
text = "单价(元)",
|
||||
style = AppTypography.gray96a0aaTextStyle.bold()
|
||||
)
|
||||
Spacer(modifier = Modifier.width(20.dp))
|
||||
CustomSingleRightText(
|
||||
modifier = Modifier.width(100.dp),
|
||||
modifier = Modifier.width(140.dp),
|
||||
text = "数量",
|
||||
style = AppTypography.gray96a0aaTextStyle.bold()
|
||||
)
|
||||
Spacer(modifier = Modifier.width(20.dp))
|
||||
CustomSingleRightText(
|
||||
modifier = Modifier.width(110.dp),
|
||||
modifier = Modifier.width(120.dp),
|
||||
text = "金额(元)",
|
||||
style = AppTypography.gray96a0aaTextStyle.bold()
|
||||
)
|
||||
@@ -101,19 +101,19 @@ fun ReceiptUnadjustedListView(
|
||||
)
|
||||
Spacer(modifier = Modifier.width(10.dp))
|
||||
CustomSingleRightText(
|
||||
modifier = Modifier.width(100.dp),
|
||||
modifier = Modifier.width(120.dp),
|
||||
text = it.recUnitPriceTaxInStr,
|
||||
style = AppTypography.blackTextStyle
|
||||
)
|
||||
Spacer(modifier = Modifier.width(20.dp))
|
||||
CustomSingleRightText(
|
||||
modifier = Modifier.width(100.dp),
|
||||
modifier = Modifier.width(140.dp),
|
||||
text = "${it.receiveCountStr}${it.unitNameStr}",
|
||||
style = AppTypography.blackTextStyle
|
||||
)
|
||||
Spacer(modifier = Modifier.width(20.dp))
|
||||
CustomSingleRightText(
|
||||
modifier = Modifier.width(110.dp),
|
||||
modifier = Modifier.width(120.dp),
|
||||
text = it.recPriceExItemStr,
|
||||
style = AppTypography.blackTextStyle
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user