Fix modal stato inventario
This commit is contained in:
parent
66e0ce15cb
commit
3041498ff1
@ -97,8 +97,8 @@ public class DialogInfoGiacenzaView extends BaseDialogFragment {
|
|||||||
if (statoArtInventario != null) {
|
if (statoArtInventario != null) {
|
||||||
statoArticolo = Stream.of(statoArtInventario).toList();
|
statoArticolo = Stream.of(statoArtInventario).toList();
|
||||||
|
|
||||||
if ((statoArtInventario.pedArrivoIsLessThenZero() || statoArtInventario.colliArrivoIsLessThenZero()) &&
|
if (statoArtInventario.colliArrivoIsLessThenZero() &&
|
||||||
(statoArtInventario.pedMagIsLessThenZero() || statoArtInventario.colliMagIsLessThenZero())) {
|
statoArtInventario.colliMagIsLessThenZero()) {
|
||||||
this.mBindings.situazioneArticolo.setVisibility(View.GONE);
|
this.mBindings.situazioneArticolo.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -94,7 +94,10 @@ public class StatoArtInventarioDTO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getPedArrivo() {
|
public BigDecimal getPedArrivo() {
|
||||||
return pedArrivo;
|
if (pedArrivo.compareTo(BigDecimal.ZERO) < 0)
|
||||||
|
return BigDecimal.ZERO;
|
||||||
|
else
|
||||||
|
return pedArrivo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StatoArtInventarioDTO setPedArrivo(BigDecimal pedArrivo) {
|
public StatoArtInventarioDTO setPedArrivo(BigDecimal pedArrivo) {
|
||||||
@ -148,7 +151,10 @@ public class StatoArtInventarioDTO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Integer getPedMag() {
|
public Integer getPedMag() {
|
||||||
return pedMag;
|
if (pedMag < 0)
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return pedMag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StatoArtInventarioDTO setPedMag(Integer pedMag) {
|
public StatoArtInventarioDTO setPedMag(Integer pedMag) {
|
||||||
@ -165,18 +171,10 @@ public class StatoArtInventarioDTO {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean pedArrivoIsLessThenZero(){
|
|
||||||
return this.pedArrivo.compareTo(BigDecimal.ZERO) < 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean colliArrivoIsLessThenZero(){
|
public boolean colliArrivoIsLessThenZero(){
|
||||||
return this.colliArrivo.compareTo(BigDecimal.ZERO) <= 0;
|
return this.colliArrivo.compareTo(BigDecimal.ZERO) <= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean pedMagIsLessThenZero(){
|
|
||||||
return this.pedMag < 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean colliMagIsLessThenZero(){
|
public boolean colliMagIsLessThenZero(){
|
||||||
return this.colliMag.compareTo(BigDecimal.ZERO) <= 0;
|
return this.colliMag.compareTo(BigDecimal.ZERO) <= 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,7 +49,7 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingHorizontal="8dp"
|
android:paddingHorizontal="8dp"
|
||||||
android:paddingVertical="4dp"
|
android:paddingVertical="4dp"
|
||||||
android:visibility="@{item.pedArrivoIsLessThenZero() || item.colliArrivoIsLessThenZero() ? View.GONE : View.VISIBLE}">
|
android:visibility="@{item.colliArrivoIsLessThenZero() ? View.GONE : View.VISIBLE}">
|
||||||
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
@ -151,7 +151,7 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingHorizontal="8dp"
|
android:paddingHorizontal="8dp"
|
||||||
android:paddingVertical="4dp"
|
android:paddingVertical="4dp"
|
||||||
android:visibility="@{item.pedMagIsLessThenZero() || item.colliMagIsLessThenZero() ? View.GONE : View.VISIBLE}">
|
android:visibility="@{item.colliMagIsLessThenZero() ? View.GONE : View.VISIBLE}">
|
||||||
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user