do not erase barcode on 'no barcode present' checkbox

This commit is contained in:
leca 2024-11-11 17:06:40 +03:00
parent c6def13eb4
commit ec7062602d
1 changed files with 2 additions and 4 deletions

View File

@ -98,9 +98,7 @@ class AddAbstractProductActivity : AppCompatActivity() {
fillupUnitsSpinner() fillupUnitsSpinner()
noBarcodeCheckBox.setOnClickListener { noBarcodeCheckBox.setOnClickListener {
if (noBarcodeCheckBox.isChecked) { barcodeText.isEnabled = !noBarcodeCheckBox.isChecked
barcodeText.setText("")
}
} }
barcodeText.addTextChangedListener { barcodeText.addTextChangedListener {
@ -165,7 +163,7 @@ class AddAbstractProductActivity : AppCompatActivity() {
abstractProduct = AbstractProduct( abstractProduct = AbstractProduct(
if(abstractProduct == null) 0 else abstractProduct!!.id, if(abstractProduct == null) 0 else abstractProduct!!.id,
barcode, if (noBarcodeCheckBox.isChecked) "" else barcode,
productName, productName,
netWeight.toString().toDouble(), netWeight.toString().toDouble(),
pictureFile.nameWithoutExtension, pictureFile.nameWithoutExtension,