apportate modifiche rientro merce richieste da Agricoper,
risolto bug divide by zero in spedizione quando qtaCmfOrd è decimale
This commit is contained in:
parent
2718f0ff2b
commit
57c22b617e
@ -15,6 +15,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
import com.annimon.stream.ComparatorCompat;
|
import com.annimon.stream.ComparatorCompat;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -116,7 +117,9 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
|||||||
private List<ProdRientroMerceOrderListModel> convertDataModelToListModel(List<OrdineLavorazioneDTO> dataList) {
|
private List<ProdRientroMerceOrderListModel> convertDataModelToListModel(List<OrdineLavorazioneDTO> dataList) {
|
||||||
|
|
||||||
ComparatorCompat<OrdineLavorazioneDTO> comparator = ComparatorCompat
|
ComparatorCompat<OrdineLavorazioneDTO> comparator = ComparatorCompat
|
||||||
.comparing(OrdineLavorazioneDTO::getCodJfas)
|
.comparing(OrdineLavorazioneDTO::getCodAnag)
|
||||||
|
.thenComparing(ComparatorCompat.comparing(ordineLavorazioneDTO -> ordineLavorazioneDTO.getDescCommessa() != null ? ordineLavorazioneDTO.getDescCommessa() : "zzzzzzzz"))
|
||||||
|
.thenComparing(ComparatorCompat.comparing(ordineLavorazioneDTO -> ordineLavorazioneDTO.getDataConsCommessaD() != null ? String.valueOf(ordineLavorazioneDTO.getDataConsCommessaD().getTime()) : "999999999999")).reversed()
|
||||||
.thenComparing(ComparatorCompat.comparing(ordineLavorazioneDTO -> ordineLavorazioneDTO.getDataOrd() != null ? ordineLavorazioneDTO.getDataOrd() : "zzzzzzzz")).reversed()
|
.thenComparing(ComparatorCompat.comparing(ordineLavorazioneDTO -> ordineLavorazioneDTO.getDataOrd() != null ? ordineLavorazioneDTO.getDataOrd() : "zzzzzzzz")).reversed()
|
||||||
.thenComparing(ComparatorCompat.comparing(OrdineLavorazioneDTO::getNumOrd));
|
.thenComparing(ComparatorCompat.comparing(OrdineLavorazioneDTO::getNumOrd));
|
||||||
|
|
||||||
@ -140,7 +143,7 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
listModel.setGroupTitle(x.getCodJfas());
|
listModel.setGroupTitle(x.getRagSocAnag());
|
||||||
|
|
||||||
if (!UtilityString.isNullOrEmpty(x.getDataConsCommessa())) {
|
if (!UtilityString.isNullOrEmpty(x.getDataConsCommessa())) {
|
||||||
listModel.setPreDescription("Consegna: " + UtilityDate.formatDate(x.getDataConsCommessaD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
listModel.setPreDescription("Consegna: " + UtilityDate.formatDate(x.getDataConsCommessaD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||||
@ -157,7 +160,21 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
|||||||
listModel.setRightDescription(x.getCodJcom() != null ? (x.getDescCommessa() + " (" + x.getCodJcom() + ")") : "");
|
listModel.setRightDescription(x.getCodJcom() != null ? (x.getDescCommessa() + " (" + x.getCodJcom() + ")") : "");
|
||||||
|
|
||||||
listModel.setProgress(x.getProgress());
|
listModel.setProgress(x.getProgress());
|
||||||
listModel.setRightSubDescription(x.getNumCnf().stripTrailingZeros().toPlainString() + " COL");
|
int numPedane = x.getNumCnf().divide(x.getColliPedana(), 0, RoundingMode.DOWN).intValue();
|
||||||
|
int numCnf = x.getNumCnf().remainder(x.getColliPedana()).intValue();
|
||||||
|
String qtaOrdLabel = "";
|
||||||
|
if (numPedane > 0) {
|
||||||
|
qtaOrdLabel += numPedane + "UL x " + x.getColliPedana().stripTrailingZeros().toPlainString() + " COL";
|
||||||
|
if (numCnf > 0) {
|
||||||
|
qtaOrdLabel += " + ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (numCnf > 0) {
|
||||||
|
qtaOrdLabel += numCnf + " COL";
|
||||||
|
}
|
||||||
|
|
||||||
|
// listModel.setRightSubDescription(x.getNumCnf().stripTrailingZeros().toPlainString() + " COL");
|
||||||
|
listModel.setRightSubDescription(qtaOrdLabel);
|
||||||
/*try {
|
/*try {
|
||||||
listModel.setRightSubDescription(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
listModel.setRightSubDescription(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|||||||
@ -412,10 +412,10 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
this.enabledLUCloseButton.set(this.mDialogInputQuantityV2DTO.isCanLUBeClosed());
|
this.enabledLUCloseButton.set(this.mDialogInputQuantityV2DTO.isCanLUBeClosed());
|
||||||
this.currentTaraArticolo.set(this.mViewModel.getMtbAart().getTaraKg());
|
this.currentTaraArticolo.set(this.mViewModel.getMtbAart().getTaraKg());
|
||||||
|
|
||||||
if (this.mDialogInputQuantityV2DTO.getMtbAart().isFlagQtaCnfFissaBoolean() && this.mDialogInputQuantityV2DTO.getTotalNumCnfOrd() != null && !this.mDialogInputQuantityV2DTO.getTotalNumCnfOrd().equals(BigDecimal.ZERO) && !(this.mDialogInputQuantityV2DTO.getTotalNumCnfOrd().intValue() == 0)) {
|
if (this.mDialogInputQuantityV2DTO.getMtbAart().isFlagQtaCnfFissaBoolean() && this.mDialogInputQuantityV2DTO.getTotalQtaOrd() != null && !this.mDialogInputQuantityV2DTO.getTotalQtaOrd().equals(BigDecimal.ZERO) && !(this.mDialogInputQuantityV2DTO.getQtaCnfOrd().compareTo(BigDecimal.ZERO) == 0)) {
|
||||||
int numCnftoTake = this.mDialogInputQuantityV2DTO.getTotalQtaOrd().divide(this.mDialogInputQuantityV2DTO.getQtaCnfOrd(), 0, RoundingMode.DOWN).intValue();
|
int numCnftoTake = this.mDialogInputQuantityV2DTO.getTotalQtaOrd().divide(this.mDialogInputQuantityV2DTO.getQtaCnfOrd(), 0, RoundingMode.DOWN).intValue();
|
||||||
this.currentTextNumCnfToTake.set(numCnftoTake);
|
this.currentTextNumCnfToTake.set(numCnftoTake);
|
||||||
int qtaText = this.mDialogInputQuantityV2DTO.getTotalQtaOrd().intValue() % this.mDialogInputQuantityV2DTO.getQtaCnfOrd().intValue();
|
int qtaText = this.mDialogInputQuantityV2DTO.getTotalQtaOrd().remainder(this.mDialogInputQuantityV2DTO.getQtaCnfOrd()).intValue();
|
||||||
this.currentTextNumPezziToTake.set(qtaText);
|
this.currentTextNumPezziToTake.set(qtaText);
|
||||||
} else {
|
} else {
|
||||||
this.currentTextNumCnfToTake.set(0);
|
this.currentTextNumCnfToTake.set(0);
|
||||||
|
|||||||
@ -329,9 +329,8 @@
|
|||||||
style="@style/Button.DangerFull"
|
style="@style/Button.DangerFull"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="4dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_weight="0.5"
|
||||||
android:layout_weight="0.4"
|
|
||||||
android:onClick="@{() -> view.dismiss()}"
|
android:onClick="@{() -> view.dismiss()}"
|
||||||
android:paddingEnd="3dp"
|
android:paddingEnd="3dp"
|
||||||
android:text="@string/abort"
|
android:text="@string/abort"
|
||||||
@ -345,9 +344,8 @@
|
|||||||
style="@style/Button.PrimaryFull"
|
style="@style/Button.PrimaryFull"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="4dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginEnd="0dp"
|
android:layout_weight="0.5"
|
||||||
android:layout_weight="0.45"
|
|
||||||
android:onClick="@{() -> view.save()}"
|
android:onClick="@{() -> view.save()}"
|
||||||
android:paddingEnd="3dp"
|
android:paddingEnd="3dp"
|
||||||
android:text="@string/confirm"
|
android:text="@string/confirm"
|
||||||
|
|||||||
@ -41,27 +41,13 @@
|
|||||||
android:layout_toEndOf="@id/ordine_state_icon"
|
android:layout_toEndOf="@id/ordine_state_icon"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/pre_first_row"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
tools:text="Cons 07 nov 2018" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical">
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/right_descrizione"
|
android:id="@+id/pre_first_row"
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -70,7 +56,7 @@
|
|||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textColor="#000"
|
android:textColor="#000"
|
||||||
tools:text="EUROGROUP ITALIA SRL" />
|
tools:text="Cons 07 nov 2018" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/descrizione"
|
android:id="@+id/descrizione"
|
||||||
@ -85,28 +71,30 @@
|
|||||||
tools:text="N° 39" />
|
tools:text="N° 39" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/right_sub_descrizione"
|
android:id="@+id/right_descrizione"
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_marginTop="8dp"
|
||||||
tools:text="150KG" />
|
tools:text="CLIENTE (COMMESSA)" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/sub_descrizione"
|
android:id="@+id/sub_descrizione"
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
tools:text="descrizione estesa articolo" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/right_sub_descrizione"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toStartOf="@id/right_sub_descrizione"
|
android:layout_marginTop="4dp"
|
||||||
android:paddingEnd="6dp"
|
android:layout_alignParentEnd="true"
|
||||||
tools:text="Descr articolo estesa" />
|
tools:text="2 UL x 10 COL" />
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||||
android:id="@+id/order_progress"
|
android:id="@+id/order_progress"
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -24,14 +23,14 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/group_title"
|
android:id="@+id/group_title"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.ListDivider"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/AppTheme.NewMaterial.Text.ListDivider"
|
|
||||||
android:textAllCaps="true"
|
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textStyle="bold"
|
android:textAllCaps="true"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
|
android:textStyle="bold"
|
||||||
tools:text="NOME GRUPPO" />
|
tools:text="NOME GRUPPO" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user