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.Stream;
|
||||
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -116,7 +117,9 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||
private List<ProdRientroMerceOrderListModel> convertDataModelToListModel(List<OrdineLavorazioneDTO> dataList) {
|
||||
|
||||
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::getNumOrd));
|
||||
|
||||
@ -140,7 +143,7 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||
break;
|
||||
}
|
||||
|
||||
listModel.setGroupTitle(x.getCodJfas());
|
||||
listModel.setGroupTitle(x.getRagSocAnag());
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(x.getDataConsCommessa())) {
|
||||
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.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 {
|
||||
listModel.setRightSubDescription(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
} catch (Exception ex) {
|
||||
|
||||
@ -412,10 +412,10 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
this.enabledLUCloseButton.set(this.mDialogInputQuantityV2DTO.isCanLUBeClosed());
|
||||
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();
|
||||
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);
|
||||
} else {
|
||||
this.currentTextNumCnfToTake.set(0);
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
android:src="@drawable/ic_erase_96"
|
||||
android:backgroundTint="@android:color/transparent"
|
||||
android:onClick="@{() -> view.resetValues()}"
|
||||
android:tint="@android:color/white"/>
|
||||
android:tint="@android:color/white" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/read_weight_form_device"
|
||||
@ -329,9 +329,8 @@
|
||||
style="@style/Button.DangerFull"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_weight="0.4"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_weight="0.5"
|
||||
android:onClick="@{() -> view.dismiss()}"
|
||||
android:paddingEnd="3dp"
|
||||
android:text="@string/abort"
|
||||
@ -345,9 +344,8 @@
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_weight="0.45"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="0.5"
|
||||
android:onClick="@{() -> view.save()}"
|
||||
android:paddingEnd="3dp"
|
||||
android:text="@string/confirm"
|
||||
|
||||
@ -41,27 +41,13 @@
|
||||
android:layout_toEndOf="@id/ordine_state_icon"
|
||||
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
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/right_descrizione"
|
||||
android:id="@+id/pre_first_row"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@ -70,7 +56,7 @@
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:textColor="#000"
|
||||
tools:text="EUROGROUP ITALIA SRL" />
|
||||
tools:text="Cons 07 nov 2018" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/descrizione"
|
||||
@ -85,28 +71,30 @@
|
||||
tools:text="N° 39" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/right_descrizione"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
tools:text="CLIENTE (COMMESSA)" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/right_sub_descrizione"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
tools:text="150KG" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/sub_descrizione"
|
||||
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/sub_descrizione"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toStartOf="@id/right_sub_descrizione"
|
||||
android:paddingEnd="6dp"
|
||||
tools:text="Descr articolo estesa" />
|
||||
</RelativeLayout>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/right_sub_descrizione"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
tools:text="2 UL x 10 COL" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/order_progress"
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -24,15 +23,15 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/group_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.ListDivider"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AppTheme.NewMaterial.Text.ListDivider"
|
||||
android:textAllCaps="true"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textStyle="bold"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/black"
|
||||
tools:text="NOME GRUPPO"/>
|
||||
android:textStyle="bold"
|
||||
tools:text="NOME GRUPPO" />
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user