Fix vari
This commit is contained in:
parent
83a6dd29f2
commit
879cfc5f7e
@ -238,8 +238,11 @@ public class Converters {
|
|||||||
@Override
|
@Override
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
BigDecimal value = null;
|
BigDecimal value = null;
|
||||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
String newValueString = s.toString().trim();
|
||||||
value = new BigDecimal(s.toString());
|
|
||||||
|
if (!UtilityString.isNullOrEmpty(newValueString))
|
||||||
|
value = new BigDecimal(newValueString);
|
||||||
|
|
||||||
observableBigDecimal.set(value);
|
observableBigDecimal.set(value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -247,7 +250,7 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
BigDecimal newValue = observableBigDecimal.get();
|
BigDecimal newValue = observableBigDecimal.get();
|
||||||
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
|
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
|
||||||
|
|
||||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||||
view.setText(UtilityNumber.decimalToString(newValue));
|
view.setText(UtilityNumber.decimalToString(newValue));
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import java.util.regex.Pattern;
|
|||||||
public class UtilityString {
|
public class UtilityString {
|
||||||
|
|
||||||
public static boolean isNullOrEmpty(String stringToCheck){
|
public static boolean isNullOrEmpty(String stringToCheck){
|
||||||
return stringToCheck == null || stringToCheck.trim().length() == 0;
|
return stringToCheck == null || stringToCheck.trim().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String isNull(String stringToCheck, String alternativeString){
|
public static String isNull(String stringToCheck, String alternativeString){
|
||||||
@ -23,7 +23,7 @@ public class UtilityString {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String empty2null(String stringToCheck) {
|
public static String empty2null(String stringToCheck) {
|
||||||
return (stringToCheck == null || stringToCheck.trim().length() == 0) ? null : stringToCheck.trim();
|
return (stringToCheck == null || stringToCheck.trim().isEmpty()) ? null : stringToCheck.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String capitalizeWords(String capString){
|
public static String capitalizeWords(String capString){
|
||||||
|
|||||||
@ -125,7 +125,12 @@ public class DocInterniEditFormViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void loadArticoloByCodMartOrBarcode(String codMart) {
|
public void loadArticoloByCodMartOrBarcode(String codMart) {
|
||||||
var matchedArt = Stream.of(productsList)
|
if(productsList == null) {
|
||||||
|
this.sendError(new NoResultFromCodMartException(codMart));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var matchedArt = productsList.stream()
|
||||||
.filter(x -> x.getCodMart().equalsIgnoreCase(codMart) ||
|
.filter(x -> x.getCodMart().equalsIgnoreCase(codMart) ||
|
||||||
x.getBarcode().contains(codMart))
|
x.getBarcode().contains(codMart))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user