Fix vari
This commit is contained in:
parent
584a4d93e2
commit
7d62adc51e
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
116
.idea/codeStyles/Project.xml
generated
Normal file
116
.idea/codeStyles/Project.xml
generated
Normal file
@ -0,0 +1,116 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<codeStyleSettings language="XML">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
2
.idea/runConfigurations/app.xml
generated
2
.idea/runConfigurations/app.xml
generated
@ -6,7 +6,7 @@
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
<option name="ARTIFACT_NAME" value="" />
|
||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="dynamic_ime,dynamic_vgalimenti" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="dynamic__base,dynamic_vgalimenti" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="CLEAR_LOGCAT" value="true" />
|
||||
|
||||
@ -335,7 +335,7 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
}, ex -> {
|
||||
//mNoConnectionLayout.expand(true);
|
||||
if(!mIsOnline) mIsOnline = false;
|
||||
if(mIsOnline) mIsOnline = false;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
||||
public void onFailed(Exception ex) {
|
||||
if(onFailed != null) onFailed.run(ex);
|
||||
}
|
||||
}, true);
|
||||
}, true, MtbColt.class);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ public class EntityRESTConsumer {
|
||||
|
||||
}
|
||||
|
||||
public static <T extends EntityBase> void processEntityList(List<T> entitiesToSave, final ISimpleOperationCallback<List<T>> callback, boolean singleTransaction){
|
||||
public static <T extends EntityBase> void processEntityList(List<T> entitiesToSave, final ISimpleOperationCallback<List<T>> callback, boolean singleTransaction, Class<T> type){
|
||||
|
||||
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
||||
Call<List<ServiceRESTResponse<JsonObject>>> request = service.processEntityList(singleTransaction, entitiesToSave);
|
||||
@ -71,12 +71,13 @@ public class EntityRESTConsumer {
|
||||
|
||||
ArrayList<T> responseList = new ArrayList<>();
|
||||
Gson gson = new Gson();
|
||||
Type typeOfObjectsList = new TypeToken<T>() {}.getType();
|
||||
// Type typeOfObjectsList = new TypeToken<T>() {}.getType();
|
||||
|
||||
for(ServiceRESTResponse<JsonObject> jsonSingleObject : response.body()) {
|
||||
|
||||
if (jsonSingleObject.getEsito() == EsitoType.OK) {
|
||||
responseList.add(gson.fromJson(jsonSingleObject.getEntity(), typeOfObjectsList));
|
||||
String jsonText = gson.toJson(jsonSingleObject.getEntity());
|
||||
responseList.add(gson.fromJson(jsonText, type));
|
||||
} else {
|
||||
Log.e("EntityRESTConsumer", jsonSingleObject.getErrorMessage());
|
||||
callback.onFailed(new Exception(jsonSingleObject.getErrorMessage()));
|
||||
|
||||
@ -4,6 +4,7 @@ import android.util.Log;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.BuildConfig;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.exception.printer.PrinterNotFoundException;
|
||||
@ -92,6 +93,11 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public static void printCollo(String printerName, MtbColt testataColloToPrint, int quantity, String reportName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
if(BuildConfig.DEBUG) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
if(UtilityString.isNullOrEmpty(printerName)) {
|
||||
onFailed.run(new Exception("Nessuna stampante configurata: valore null"));
|
||||
return;
|
||||
|
||||
@ -39,8 +39,6 @@ public class SettingsManager {
|
||||
//settingsModelIstance.user = new SettingsModel.User();
|
||||
//settingsModelIstance.userSession = new SettingsModel.UserSession();
|
||||
|
||||
dbSettingsModelIstance = new DBSettingsModel();
|
||||
|
||||
firstStart = true;
|
||||
}
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@ public class SettingsModel {
|
||||
public static class UserSession {
|
||||
public String profileDB;
|
||||
public AvailableCodMdepsDTO depo;
|
||||
public Integer defaultOrdinamentoPickingAccettazione = 0;
|
||||
// public String codMdep;
|
||||
}
|
||||
|
||||
|
||||
@ -20,8 +20,8 @@ public class UtilityDate {
|
||||
public static final String DMY_SLASH = "dd/MM/yyyy";
|
||||
public static final String YMD_SLASH = "yyyy/MM/dd";
|
||||
public static final String YMD_DASH = "yyyy-MM-dd";
|
||||
public static final String DMY_TIME_SLASH = DMY_SLASH + " hh:mm:ss";
|
||||
public static final String YMD_TIME_SLASH = YMD_SLASH + " hh:mm:ss";
|
||||
public static final String DMY_TIME_SLASH = DMY_SLASH + " HH:mm:ss";
|
||||
public static final String YMD_TIME_SLASH = YMD_SLASH + " HH:mm:ss";
|
||||
|
||||
|
||||
public static final String DM_HUMAN = "dd MMM";
|
||||
@ -78,7 +78,7 @@ public class UtilityDate {
|
||||
format = new SimpleDateFormat(dateFormatString);
|
||||
}
|
||||
|
||||
format.setTimeZone(TimeZone.getTimeZone("Europe/Rome"));
|
||||
//format.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
|
||||
return format.parse(dateString);
|
||||
}
|
||||
@ -87,7 +87,7 @@ public class UtilityDate {
|
||||
public static String formatDate(Date dateToFormat, String format) {
|
||||
if(dateToFormat != null) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(format);
|
||||
sdf.setTimeZone(TimeZone.getTimeZone("Europe/Rome"));
|
||||
//sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
return sdf.format(dateToFormat);
|
||||
}
|
||||
else return null;
|
||||
@ -99,6 +99,6 @@ public class UtilityDate {
|
||||
}
|
||||
|
||||
public static Calendar getCalendarInstance() {
|
||||
return Calendar.getInstance(TimeZone.getTimeZone("Europe/Rome"));
|
||||
return Calendar.getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,6 +90,9 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
}
|
||||
|
||||
private void init(){
|
||||
|
||||
currentOrderBy = AccettazioneOrdineInevasoOrderBy.Enum.fromInt(SettingsManager.i().userSession.defaultOrdinamentoPickingAccettazione);
|
||||
|
||||
mArticoliInColloBottomSheetViewModel.setOnCloseColloCallbackListener(this);
|
||||
mArticoliInColloBottomSheetViewModel.setOnItemDeletedCallback(this::onRowDeleted);
|
||||
mArticoliInColloBottomSheetViewModel.setOnItemEditedCallback(this::onRowEdited);
|
||||
@ -413,7 +416,10 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
AlertDialog dialog = new AlertDialog.Builder(mActivity)
|
||||
.setTitle(mActivity.getText(R.string.action_orderBy))
|
||||
.setSingleChoiceItems(AccettazioneOrdineInevasoOrderBy.descriptions, currentOrderBy.getVal(), (dialog12, which) -> currentOrderBy = AccettazioneOrdineInevasoOrderBy.Enum.fromInt(which))
|
||||
.setSingleChoiceItems(AccettazioneOrdineInevasoOrderBy.descriptions, currentOrderBy.getVal(), (dialog12, which) -> {
|
||||
currentOrderBy = AccettazioneOrdineInevasoOrderBy.Enum.fromInt(which);
|
||||
SettingsManager.i().userSession.defaultOrdinamentoPickingAccettazione = which;
|
||||
})
|
||||
.setPositiveButton("Ok", (dialog1, which) -> refreshOrderBy(false))
|
||||
.create();
|
||||
dialog.show();
|
||||
@ -766,7 +772,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
private void postCloseOperations(Runnable onComplete) {
|
||||
|
||||
MtbColt mtbColt = (MtbColt) mtbColtOfAccettazione.clone();
|
||||
MtbColt mtbColt = (MtbColt) getColloRef().clone();
|
||||
|
||||
resetUL();
|
||||
|
||||
@ -779,16 +785,35 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
|
||||
if(currentRow.getRigaOrd() != null) {
|
||||
|
||||
Stream.of(this.groupedOrdini)
|
||||
.filter(x ->
|
||||
x.getQtaDaEvadere().floatValue() > 0 &&
|
||||
for(int k = 0; k < this.groupedOrdini.size(); k++) {
|
||||
|
||||
OrdineAccettazioneDTO.Riga x = this.groupedOrdini.get(k);
|
||||
|
||||
if(x.getQtaDaEvadere().floatValue() > 0 &&
|
||||
x.getMtbAart().getCodMart().equalsIgnoreCase(currentRow.getCodMart()) &&
|
||||
x.getCodJcom().equalsIgnoreCase(currentRow.getCodJcom()) &&
|
||||
x.getRigaOrd() == currentRow.getRigaOrd() &&
|
||||
x.getDataOrdD().equals(currentRow.getDataOrdD()) &&
|
||||
x.getNumOrd() == currentRow.getNumOrd()
|
||||
)
|
||||
.forEach(x -> x.setQtaRiservate(x.getQtaRiservate().add(currentRow.getQtaCol())));
|
||||
x.getNumOrd() == currentRow.getNumOrd()) {
|
||||
|
||||
x.setQtaRiservate(x.getQtaRiservate().add(currentRow.getQtaCol()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Stream.of(this.groupedOrdini)
|
||||
// .filter(x ->
|
||||
// x.getQtaDaEvadere().floatValue() > 0 &&
|
||||
// x.getMtbAart().getCodMart().equalsIgnoreCase(currentRow.getCodMart()) &&
|
||||
// x.getCodJcom().equalsIgnoreCase(currentRow.getCodJcom()) &&
|
||||
// x.getRigaOrd() == currentRow.getRigaOrd() &&
|
||||
// x.getDataOrdD().equals(currentRow.getDataOrdD()) &&
|
||||
// x.getNumOrd() == currentRow.getNumOrd()
|
||||
// )
|
||||
// .forEach(x -> {
|
||||
// x.setQtaRiservate(x.getQtaRiservate().add(currentRow.getQtaCol()));
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -67,7 +67,6 @@ public class HistoryULsListAdapter extends SectionedRecyclerViewAdapter<HistoryU
|
||||
public void updateItems(List<HistoryVersamentoProdUL> updatedDataset) {
|
||||
mDataset.clear();
|
||||
mDataset.addAll(orderItems(updatedDataset));
|
||||
notifyDataSetChanged();
|
||||
notifyDataChanged();
|
||||
}
|
||||
|
||||
@ -143,5 +142,4 @@ public class HistoryULsListAdapter extends SectionedRecyclerViewAdapter<HistoryU
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -33,6 +33,7 @@ public class ProdRecuperoMaterialeHelper {
|
||||
"mtb_colr.gestione, " +
|
||||
"mtb_colr.data_collo, " +
|
||||
"mtb_colr.num_collo, " +
|
||||
"mtb_colr.ser_collo, " +
|
||||
"mtb_colr.cod_mart, " +
|
||||
"mtb_colr.cod_col, " +
|
||||
"mtb_colr.cod_tagl, " +
|
||||
@ -61,6 +62,7 @@ public class ProdRecuperoMaterialeHelper {
|
||||
"mtb_colr.gestione, " +
|
||||
"mtb_colr.data_collo, " +
|
||||
"mtb_colr.num_collo, " +
|
||||
"mtb_colr.ser_collo, " +
|
||||
"mtb_colr.cod_mart, " +
|
||||
"mtb_colr.cod_col, " +
|
||||
"mtb_colr.cod_tagl, " +
|
||||
|
||||
@ -9,6 +9,7 @@ public class HistoryVersamentoProdUL {
|
||||
|
||||
private String gestione;
|
||||
private String dataCollo;
|
||||
private String serCollo;
|
||||
private Integer numCollo;
|
||||
private String segno;
|
||||
private String codMart;
|
||||
@ -44,6 +45,15 @@ public class HistoryVersamentoProdUL {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSerCollo() {
|
||||
return serCollo;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setSerCollo(String serCollo) {
|
||||
this.serCollo = serCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumCollo() {
|
||||
return numCollo;
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import com.tfb.fbtoast.FBToast;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
@ -56,6 +57,7 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
|
||||
|
||||
private HistoryULsListAdapter mAdapter;
|
||||
private List<HistoryVersamentoProdUL> mDataset;
|
||||
|
||||
public ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
||||
|
||||
@ -66,15 +68,8 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
mHelper = helper;
|
||||
mOnRecuperoCompleted = onRecuperoCompleted;
|
||||
|
||||
ProgressDialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
mHelper.loadLastULVersate(historyULs -> {
|
||||
progressDialog.dismiss();
|
||||
initRecyclerView(historyULs);
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
initRecyclerView();
|
||||
refreshAdapter();
|
||||
}
|
||||
|
||||
public void openLU() {
|
||||
@ -92,7 +87,7 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
|
||||
} else {
|
||||
setMtbColt(mtbColt);
|
||||
chooseQuantityToReturn();
|
||||
// chooseQuantityToReturn();
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -110,10 +105,8 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
|
||||
|
||||
private void chooseQuantityToReturn() {
|
||||
InputQuantityToReturnDialog.make(mContext, mtbColt.get().getMtbColr().get(0).getMtbAart(), BigDecimal.ZERO, BigDecimal.ONE, data -> {
|
||||
private void chooseQuantityToReturn(MtbAart mtbAart, BigDecimal min, BigDecimal max) {
|
||||
|
||||
}).show();
|
||||
}
|
||||
|
||||
|
||||
@ -122,26 +115,11 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
this.mtbColt.set(mtbColt);
|
||||
}
|
||||
|
||||
public void resetMtbColt() {
|
||||
this.mtbColt.set(null);
|
||||
openLU();
|
||||
}
|
||||
|
||||
|
||||
private void showDataSavedDialog(Runnable onPositiveClick) {
|
||||
|
||||
DialogSimpleMessageHelper.makeSuccessDialog(
|
||||
mContext,
|
||||
mContext.getResources().getString(R.string.completed),
|
||||
new SpannableString(mContext.getResources().getString(R.string.data_saved)),
|
||||
null, onPositiveClick).show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initRecyclerView(List<HistoryVersamentoProdUL> historyULs) {
|
||||
mAdapter = new HistoryULsListAdapter(mContext, historyULs);
|
||||
private void initRecyclerView() {
|
||||
mAdapter = new HistoryULsListAdapter(mContext, new ArrayList<>());
|
||||
mAdapter.setOnItemClicked(this::onListItemClicked);
|
||||
|
||||
mBinding.prodRecuperoMaterialeMainList.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
@ -153,53 +131,69 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
|
||||
qtaDaEvadere = qtaDaEvadere.add(item.getQtaCol());
|
||||
|
||||
DialogInputQuantity.DTO dto = new DialogInputQuantity.DTO()
|
||||
.setBatchLot(item.getPartitaMag())
|
||||
.setMtbAart(item.getMtbAart())
|
||||
.setQtaDisponibile(qtaDaEvadere)
|
||||
.setQtaTot(qtaDaEvadere)
|
||||
.setCanPartitaMagBeChanged(false)
|
||||
.setMaxQta(qtaDaEvadere);
|
||||
|
||||
|
||||
DialogInputQuantity.makeBase(mContext, dto, false, (quantityDTO) -> {
|
||||
onItemDispatched(item, quantityDTO);
|
||||
}, () -> {
|
||||
BarcodeManager.enable();
|
||||
InputQuantityToReturnDialog.make(mContext, item.getMtbAart(), BigDecimal.ONE, qtaDaEvadere, quantity -> {
|
||||
onItemDispatched(item, quantity);
|
||||
}).show();
|
||||
|
||||
}
|
||||
|
||||
private void onItemDispatched(HistoryVersamentoProdUL item, QuantityDTO quantityDTO) {
|
||||
private void onItemDispatched(HistoryVersamentoProdUL item, BigDecimal quantity) {
|
||||
|
||||
final ProgressDialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
final MtbColt mtbColt = new MtbColt()
|
||||
final MtbColt mtbColtCarico = new MtbColt()
|
||||
.initDefaultFields()
|
||||
.setGestione(GestioneEnum.LAVORAZIONE)
|
||||
.setSegno(+1)
|
||||
.setMtbColr(new ObservableArrayList<>());
|
||||
mtbColt
|
||||
mtbColtCarico
|
||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
final MtbColr mtbColr = new MtbColr()
|
||||
final MtbColr mtbColrCarico = new MtbColr()
|
||||
.setCodMart(item.getCodMart())
|
||||
.setPartitaMag(UtilityString.empty2null(quantityDTO.batchLot.get()))
|
||||
.setQtaCol(quantityDTO.qtaTot.getBigDecimal())
|
||||
.setQtaCnf(quantityDTO.qtaCnf.getBigDecimal())
|
||||
.setNumCnf(quantityDTO.numCnf.getBigDecimal())
|
||||
.setPartitaMag(UtilityString.empty2null(item.getPartitaMag()))
|
||||
.setQtaCol(quantity)
|
||||
.setDescrizione(UtilityString.isNullOrEmpty(item.getMtbAart().getDescrizioneEstesa()) ? item.getMtbAart().getDescrizione() : item.getMtbAart().getDescrizioneEstesa())
|
||||
.setDatetimeRow(UtilityDate.getDateInstance());
|
||||
|
||||
|
||||
mtbColtCarico.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
mtbColtCarico.getMtbColr().add(mtbColrCarico);
|
||||
|
||||
|
||||
|
||||
final MtbColt mtbColtScarico = new MtbColt()
|
||||
.setDataCollo(item.getDataCollo())
|
||||
.setSerCollo(item.getSerCollo())
|
||||
.setNumCollo(item.getNumCollo())
|
||||
.setGestione(item.getGestione())
|
||||
.setMtbColr(new ObservableArrayList<>());
|
||||
mtbColtScarico
|
||||
.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||
|
||||
final MtbColr mtbColrScarico = new MtbColr()
|
||||
.setCodMart(item.getCodMart())
|
||||
.setPartitaMag(UtilityString.empty2null(item.getPartitaMag()))
|
||||
.setQtaCol(quantity.multiply(new BigDecimal(-1)))
|
||||
.setDescrizione(UtilityString.isNullOrEmpty(item.getMtbAart().getDescrizioneEstesa()) ? item.getMtbAart().getDescrizione() : item.getMtbAart().getDescrizioneEstesa())
|
||||
.setDatetimeRow(UtilityDate.getDateInstance());
|
||||
|
||||
|
||||
|
||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
mtbColt.getMtbColr().add(mtbColr);
|
||||
mtbColtScarico.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
mtbColtScarico.getMtbColr().add(mtbColrScarico);
|
||||
|
||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, value -> {
|
||||
List<MtbColt> colliToSave = new ArrayList<>();
|
||||
colliToSave.add(mtbColtCarico);
|
||||
colliToSave.add(mtbColtScarico);
|
||||
|
||||
ColliMagazzinoRESTConsumer.saveColli(colliToSave, value -> {
|
||||
|
||||
FBToast.successToast(mContext, mContext.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||
|
||||
printCollo(progress, value, () -> {
|
||||
printCollo(progress, value.get(0), () -> {
|
||||
this.refreshAdapter();
|
||||
mOnRecuperoCompleted.run();
|
||||
});
|
||||
|
||||
@ -265,4 +259,21 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
|
||||
}, onAbort);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void refreshAdapter() {
|
||||
ProgressDialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
mHelper.loadLastULVersate(historyULs -> {
|
||||
this.mDataset = historyULs;
|
||||
progressDialog.dismiss();
|
||||
|
||||
this.mAdapter.updateItems(this.mDataset);
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package it.integry.integrywmsnative.gest.vendita.core;
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
@ -20,6 +21,7 @@ import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.VenditaMainListGroupModelBinding;
|
||||
import it.integry.integrywmsnative.databinding.VenditaMainListModelBinding;
|
||||
import it.integry.integrywmsnative.gest.vendita.dto.OrdineVenditaInevasoDTO;
|
||||
@ -71,7 +73,7 @@ public class MainListVenditaAdapter extends SectionedRecyclerViewAdapter<MainLis
|
||||
|
||||
private List<OrdineVenditaInevasoDTO> orderItems(List<OrdineVenditaInevasoDTO> dataset) {
|
||||
return Stream.of(dataset)
|
||||
.sortBy(OrdineVenditaInevasoDTO::getRagSocOrd)
|
||||
.sortBy(x -> x.getRagSocOrd() + " - " + x.getDestinatario())
|
||||
.toList();
|
||||
|
||||
}
|
||||
@ -95,6 +97,14 @@ public class MainListVenditaAdapter extends SectionedRecyclerViewAdapter<MainLis
|
||||
public void onBindSubheaderViewHolder(SubheaderHolder subheaderHolder, int nextItemPosition) {
|
||||
subheaderHolder.binding.venditaMainListGroupHeader.setText(mDataset.get(nextItemPosition).getRagSocOrd());
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(mDataset.get(nextItemPosition).getDestinatario())) {
|
||||
subheaderHolder.binding.venditaMainListGroupSubheader.setVisibility(View.VISIBLE);
|
||||
subheaderHolder.binding.venditaMainListGroupSubheader.setText(mDataset.get(nextItemPosition).getDestinatario());
|
||||
} else {
|
||||
subheaderHolder.binding.venditaMainListGroupSubheader.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
subheaderHolder.binding.getRoot().setOnClickListener(v -> {
|
||||
|
||||
boolean anySelected = Stream.of(mDataset)
|
||||
@ -159,7 +169,8 @@ public class MainListVenditaAdapter extends SectionedRecyclerViewAdapter<MainLis
|
||||
|
||||
@Override
|
||||
public boolean onPlaceSubheaderBetweenItems(int position) {
|
||||
return !this.mDataset.get(position).getRagSocOrd().equalsIgnoreCase(this.mDataset.get(position + 1).getRagSocOrd());
|
||||
return !this.mDataset.get(position).getRagSocOrd().equalsIgnoreCase(this.mDataset.get(position + 1).getRagSocOrd()) &&
|
||||
!this.mDataset.get(position).getDestinatario().equalsIgnoreCase(this.mDataset.get(position + 1).getDestinatario());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
@ -43,21 +44,29 @@
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingRight="24dp">
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp">
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextViewMaterial.DialogTitle"
|
||||
android:text="Title here"
|
||||
tools:text="Title here"
|
||||
android:gravity="center_horizontal"/>
|
||||
|
||||
<TextView
|
||||
@ -65,7 +74,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextViewMaterial"
|
||||
android:text="Description here"
|
||||
tools:text="Description here"
|
||||
android:gravity="left"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp" />
|
||||
@ -88,68 +97,6 @@
|
||||
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:visibility="@{viewmodel.neutralVisible ? View.VISIBLE : View.GONE}">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/left_buttons_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.33"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/right_buttons_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.66"/>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.DangerFull"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/left_buttons_guideline"
|
||||
android:onClick="@{() -> viewmodel.onNegativeClick()}"
|
||||
android:text="@string/no"/>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryOutline"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/left_buttons_guideline"
|
||||
app:layout_constraintEnd_toStartOf="@id/right_buttons_guideline"
|
||||
app:strokeColor="@color/colorPrimary"
|
||||
android:onClick="@{() -> viewmodel.onNeutralClick()}"
|
||||
android:text="@string/abort"/>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/right_buttons_guideline"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:onClick="@{() -> viewmodel.onPositiveClick()}"
|
||||
android:text="@string/yes"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -232,6 +179,72 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:visibility="@{viewmodel.neutralVisible ? View.VISIBLE : View.GONE}">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/left_buttons_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.33"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/right_buttons_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.66"/>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.DangerFull"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/left_buttons_guideline"
|
||||
android:onClick="@{() -> viewmodel.onNegativeClick()}"
|
||||
android:text="@string/no"/>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryOutline"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/left_buttons_guideline"
|
||||
app:layout_constraintEnd_toStartOf="@id/right_buttons_guideline"
|
||||
app:strokeColor="@color/colorPrimary"
|
||||
android:onClick="@{() -> viewmodel.onNeutralClick()}"
|
||||
android:text="@string/abort"/>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/right_buttons_guideline"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:onClick="@{() -> viewmodel.onPositiveClick()}"
|
||||
android:text="@string/yes"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@ -33,18 +33,33 @@
|
||||
<CheckBox
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:checked="true"
|
||||
android:enabled="false" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/vendita_main_list_group_header"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
style="@android:style/TextAppearance.Medium"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
tools:text="NOME GRUPPO"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/vendita_main_list_group_subheader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
tools:text="SOTTO GRUPPO"/>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ buildscript {
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.4.2'
|
||||
classpath 'com.android.tools.build:gradle:3.5.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.google.gms:google-services:4.2.0'
|
||||
classpath 'com.google.firebase:perf-plugin:1.2.1'
|
||||
|
||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
||||
#Thu Apr 18 18:31:44 CEST 2019
|
||||
#Mon Aug 26 11:42:29 CEST 2019
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user