Piccole modifiche
This commit is contained in:
@@ -20,6 +20,7 @@ import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
@@ -248,7 +249,9 @@ public class MainAccettazioneFragment extends Fragment implements ICheckBoxCallb
|
||||
public void onLoadSuccess(final List<OrdineAccettazioneDTO> ordini) {
|
||||
progress.dismiss();
|
||||
|
||||
int artsCounter = ordini.size();
|
||||
|
||||
Arrays.stream(ordini).
|
||||
int artsCounter = Coollection.from(ordini).where("qtaDaEvadere", Coollection.greaterThan(0)).all().size();
|
||||
List<String> ordersKeys = new ArrayList<>();
|
||||
|
||||
for(OrdineAccettazioneDTO ordine : ordini){
|
||||
@@ -263,16 +266,13 @@ public class MainAccettazioneFragment extends Fragment implements ICheckBoxCallb
|
||||
+ "<br /><br />" +
|
||||
"<b>" + artsCounter + "</b> " + getActivity().getResources().getQuantityString(R.plurals.available_articles, artsCounter)),
|
||||
null,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
(dialogInterface, i) -> {
|
||||
|
||||
Intent myIntent = new Intent(getActivity(), AccettazioneOrdineInevasoActivity.class);
|
||||
myIntent.putExtra("key", (ArrayList<OrdineAccettazioneDTO>) ordini); //Optional parameters
|
||||
getActivity().startActivity(myIntent);
|
||||
Intent myIntent = new Intent(getActivity(), AccettazioneOrdineInevasoActivity.class);
|
||||
myIntent.putExtra("key", (ArrayList<OrdineAccettazioneDTO>) ordini); //Optional parameters
|
||||
getActivity().startActivity(myIntent);
|
||||
|
||||
}
|
||||
}).show();
|
||||
}).show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -116,25 +116,19 @@ public class MainListAccettazioneAdapter extends RecyclerView.Adapter<MainListAc
|
||||
|
||||
if (i % 2 == 1) {
|
||||
groupModelView.setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBG));
|
||||
} else {
|
||||
groupModelView.setBackgroundColor(mContext.getResources().getColor(R.color.white));
|
||||
}
|
||||
|
||||
final CheckBox checkBox = groupModelView.findViewById(R.id.accettazione_main_list_group_item_container_checkBox);
|
||||
checkBox.setChecked(ordine.checkBox);
|
||||
|
||||
ordine.checkBoxCallback.add(new ICheckBoxCallback() {
|
||||
@Override
|
||||
public void onToggle(boolean newValue) {
|
||||
checkBox.setChecked(newValue);
|
||||
}
|
||||
});
|
||||
ordine.checkBoxCallback.add(checkBox::setChecked);
|
||||
|
||||
groupModelView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
checkBox.toggle();
|
||||
ordine.checkBox = checkBox.isChecked();
|
||||
mCheckBoxCallback.onToggle(checkBox.isChecked());
|
||||
}
|
||||
groupModelView.setOnClickListener(view -> {
|
||||
checkBox.toggle();
|
||||
ordine.checkBox = checkBox.isChecked();
|
||||
mCheckBoxCallback.onToggle(checkBox.isChecked());
|
||||
});
|
||||
|
||||
TextView testataOrdTextView = groupModelView.findViewById(R.id.accettazione_main_list_group_item_container_testata_ord);
|
||||
|
||||
@@ -34,6 +34,8 @@ public class OrdineAccettazioneDTO implements Parcelable {
|
||||
public static class Riga implements Parcelable {
|
||||
public Float qtaOrd;
|
||||
public Float qtaRiservate;
|
||||
public Float qtaEvasa;
|
||||
public Float qtaDaEvadere;
|
||||
public int rigaOrd;
|
||||
public String codJcom;
|
||||
public String ragSocCom;
|
||||
@@ -52,8 +54,81 @@ public class OrdineAccettazioneDTO implements Parcelable {
|
||||
|
||||
public String dataCons;
|
||||
|
||||
//public Float getQtaDaEvadere() {
|
||||
// return this.qtaOrd - this.qtaRiservate;
|
||||
//}
|
||||
|
||||
|
||||
public Float getQtaOrd() {
|
||||
return qtaOrd;
|
||||
}
|
||||
|
||||
public Float getQtaRiservate() {
|
||||
return qtaRiservate;
|
||||
}
|
||||
|
||||
public Float getQtaEvasa() {
|
||||
return qtaEvasa;
|
||||
}
|
||||
|
||||
public Float getQtaDaEvadere() {
|
||||
return this.qtaOrd - this.qtaRiservate;
|
||||
return qtaDaEvadere;
|
||||
}
|
||||
|
||||
public int getRigaOrd() {
|
||||
return rigaOrd;
|
||||
}
|
||||
|
||||
public String getCodJcom() {
|
||||
return codJcom;
|
||||
}
|
||||
|
||||
public String getRagSocCom() {
|
||||
return ragSocCom;
|
||||
}
|
||||
|
||||
public String getDescrizioneCommessa() {
|
||||
return descrizioneCommessa;
|
||||
}
|
||||
|
||||
public MtbAart getMtbAart() {
|
||||
return mtbAart;
|
||||
}
|
||||
|
||||
public PickingObjectDTO[] getColliAssociati() {
|
||||
return colliAssociati;
|
||||
}
|
||||
|
||||
public boolean isHidden() {
|
||||
return hidden;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public String getCodArtFor() {
|
||||
return codArtFor;
|
||||
}
|
||||
|
||||
public String getDescrizioneEstesa() {
|
||||
return descrizioneEstesa;
|
||||
}
|
||||
|
||||
public String getCodAlis() {
|
||||
return codAlis;
|
||||
}
|
||||
|
||||
public int getNumOrd() {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public String getGestioneOrd() {
|
||||
return gestioneOrd;
|
||||
}
|
||||
|
||||
public String getDataCons() {
|
||||
return dataCons;
|
||||
}
|
||||
|
||||
public Date getDataOrd() {
|
||||
|
||||
Reference in New Issue
Block a user