Aggiunto dialog note aggiuntive nei resi da cliente
This commit is contained in:
parent
7b10a60a6b
commit
057e61289e
@ -54,6 +54,8 @@ public class MtbColr extends EntityBase {
|
||||
private String serDoc;
|
||||
private Integer numDoc;
|
||||
private Integer idRigaDoc;
|
||||
private BigDecimal pesoNettoKg;
|
||||
private BigDecimal pesoLordoKg;
|
||||
|
||||
private MtbAart mtbAart;
|
||||
|
||||
@ -489,4 +491,22 @@ public class MtbColr extends EntityBase {
|
||||
this.idRigaDoc = idRigaDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getPesoNettoKg() {
|
||||
return pesoNettoKg;
|
||||
}
|
||||
|
||||
public MtbColr setPesoNettoKg(BigDecimal pesoNettoKg) {
|
||||
this.pesoNettoKg = pesoNettoKg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getPesoLordoKg() {
|
||||
return pesoLordoKg;
|
||||
}
|
||||
|
||||
public MtbColr setPesoLordoKg(BigDecimal pesoLordoKg) {
|
||||
this.pesoLordoKg = pesoLordoKg;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,6 +61,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public static void saveCollo(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MtbColt mtbColtToSaveClone = (MtbColt) mtbColtToSave.clone();
|
||||
mtbColtToSave.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
mtbColtToSaveClone.setMtbColr(new ObservableArrayList<>());
|
||||
|
||||
@ -590,7 +591,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
public static void updateDataFine(Context context, Dialog progress, MtbColt mtbColt, Runnable onComplete) {
|
||||
public static void updateDataFine(Context context, Dialog progress, MtbColt mtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
MtbColt cloneMtbColt = (MtbColt) mtbColt.clone();
|
||||
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||
@ -601,6 +602,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
onComplete.run();
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(context, ex, progress);
|
||||
if(onFailed != null) onFailed.run(ex);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@ -10,10 +10,12 @@ import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.EsitoType;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.model.EntityBase;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
@ -22,6 +24,11 @@ public class EntityRESTConsumer {
|
||||
|
||||
public static <T extends EntityBase> void processEntity(T entityToSave, final ISimpleOperationCallback<T> callback, Class<T> type){
|
||||
|
||||
RunnableArgs<Exception> tmpFailed = ex -> {
|
||||
// UtilityExceptions.defaultException(null, ex);
|
||||
if(callback != null) callback.onFailed(ex);
|
||||
};
|
||||
|
||||
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
||||
Call<ServiceRESTResponse<JsonObject>> request = service.processEntity(entityToSave);
|
||||
request.enqueue(new Callback<ServiceRESTResponse<JsonObject>>() {
|
||||
@ -37,22 +44,22 @@ public class EntityRESTConsumer {
|
||||
callback.onSuccess(object);
|
||||
} else {
|
||||
Log.e("EntityRESTConsumer", response.body().getErrorMessage());
|
||||
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
||||
tmpFailed.run(new Exception(response.body().getErrorMessage()));
|
||||
}
|
||||
} else {
|
||||
Log.e("EntityRESTConsumer", response.message());
|
||||
callback.onFailed(new Exception(response.message()));
|
||||
tmpFailed.run(new Exception(response.message()));
|
||||
}
|
||||
} else {
|
||||
Log.e("EntityRESTConsumer", "Status " + response.code() + ": " + response.message());
|
||||
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
|
||||
tmpFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
||||
Log.e("EntityRESTConsumer", t.toString());
|
||||
callback.onFailed(new Exception(t));
|
||||
tmpFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
@ -60,6 +67,11 @@ public class EntityRESTConsumer {
|
||||
|
||||
public static <T extends EntityBase> void processEntityList(List<T> entitiesToSave, final ISimpleOperationCallback<List<T>> callback, boolean singleTransaction, Class<T> type){
|
||||
|
||||
RunnableArgs<Exception> tmpFailed = ex -> {
|
||||
// UtilityExceptions.defaultException(null, ex);
|
||||
if(callback != null) callback.onFailed(ex);
|
||||
};
|
||||
|
||||
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
||||
Call<List<ServiceRESTResponse<JsonObject>>> request = service.processEntityList(singleTransaction, entitiesToSave);
|
||||
request.enqueue(new Callback<List<ServiceRESTResponse<JsonObject>>>() {
|
||||
@ -80,7 +92,7 @@ public class EntityRESTConsumer {
|
||||
responseList.add(gson.fromJson(jsonText, type));
|
||||
} else {
|
||||
Log.e("EntityRESTConsumer", jsonSingleObject.getErrorMessage());
|
||||
callback.onFailed(new Exception(jsonSingleObject.getErrorMessage()));
|
||||
tmpFailed.run(new Exception(jsonSingleObject.getErrorMessage()));
|
||||
|
||||
return;
|
||||
}
|
||||
@ -89,18 +101,18 @@ public class EntityRESTConsumer {
|
||||
callback.onSuccess(responseList);
|
||||
} else {
|
||||
Log.e("EntityRESTConsumer", response.message());
|
||||
callback.onFailed(new Exception(response.message()));
|
||||
tmpFailed.run(new Exception(response.message()));
|
||||
}
|
||||
} else {
|
||||
Log.e("EntityRESTConsumer", "Status " + response.code() + ": " + response.message());
|
||||
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
|
||||
tmpFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<List<ServiceRESTResponse<JsonObject>>> call, Throwable t) {
|
||||
Log.e("EntityRESTConsumer", t.toString());
|
||||
callback.onFailed(new Exception(t));
|
||||
tmpFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.viewmodel;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.app.ProgressDialog;
|
||||
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.databinding.ObservableField;
|
||||
@ -10,7 +9,6 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import android.text.SpannableString;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.tfb.fbtoast.FBToast;
|
||||
|
||||
@ -39,7 +37,6 @@ import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
@ -52,7 +49,7 @@ import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.core.IOnOrdi
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.core.MainListOrdineAccettazioneAdapter;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.dto.AccettazioneOrdineInevasoOrderBy;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.rest.OrdineAccettazioneInevasoRESTConsumerService;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.views.NoteAggiuntiveNuovaULDialog;
|
||||
import it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu.NoteAggiuntiveLUDialog;
|
||||
import it.integry.integrywmsnative.view.bottomsheet.interfaces.IOnColloClosedCallback;
|
||||
import it.integry.integrywmsnative.view.bottomsheet.viewmodel.ArticoliInColloBottomSheetViewModel;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||
@ -439,10 +436,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
}
|
||||
|
||||
Dialog finalProgress = progress;
|
||||
NoteAggiuntiveNuovaULDialog.make(mActivity, new NoteAggiuntiveNuovaULDialog.Callback() {
|
||||
@Override
|
||||
public void onSuccess(String noteString) {
|
||||
|
||||
NoteAggiuntiveLUDialog.make(mActivity, noteString -> {
|
||||
//Add loading dialog here
|
||||
finalProgress.show();
|
||||
|
||||
@ -534,13 +528,6 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
|
||||
});
|
||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, finalProgress));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAbort() {
|
||||
BarcodeManager.enable();
|
||||
finalProgress.dismiss();
|
||||
}
|
||||
}).show();
|
||||
|
||||
|
||||
|
||||
@ -1,57 +0,0 @@
|
||||
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.views;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDimension;
|
||||
import it.integry.integrywmsnative.databinding.DialogNoteAggiuntiveNuovaUlBinding;
|
||||
|
||||
public class NoteAggiuntiveNuovaULDialog {
|
||||
|
||||
private Dialog currentDialog;
|
||||
|
||||
public interface Callback {
|
||||
void onSuccess(String noteString);
|
||||
void onAbort();
|
||||
}
|
||||
|
||||
public static Dialog make(Context context, final Callback callback) {
|
||||
return new NoteAggiuntiveNuovaULDialog(context, callback).currentDialog;
|
||||
}
|
||||
|
||||
private NoteAggiuntiveNuovaULDialog(Context context, final Callback callback){
|
||||
|
||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
||||
DialogNoteAggiuntiveNuovaUlBinding bindings = DataBindingUtil.inflate(inflater, R.layout.dialog_note_aggiuntive_nuova_ul, null, false);
|
||||
|
||||
currentDialog = new Dialog(context);
|
||||
currentDialog.setContentView(bindings.getRoot());
|
||||
|
||||
currentDialog.setCanceledOnTouchOutside(false);
|
||||
currentDialog.setCancelable(false);
|
||||
currentDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
bindings.buttonConfirm.setOnClickListener(v -> {
|
||||
currentDialog.dismiss();
|
||||
callback.onSuccess(bindings.additionalNotesText.getText().toString());
|
||||
});
|
||||
|
||||
bindings.buttonAbort.setOnClickListener(v -> {
|
||||
currentDialog.dismiss();
|
||||
callback.onAbort();
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -170,7 +170,7 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
||||
|
||||
cyclicRecover(sessionsIterator, onComplete, onFailed);
|
||||
});
|
||||
});
|
||||
}, onFailed);
|
||||
} else {
|
||||
ColliDataRecover.closeSession(recoveredMtbColtID);
|
||||
cyclicRecover(sessionsIterator, onComplete, onFailed);
|
||||
|
||||
@ -50,6 +50,7 @@ import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity.QuantityDTO;
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu.NoteAggiuntiveLUDialog;
|
||||
|
||||
public class PickingResiActivity extends BaseActivity implements IOnColloClosedCallback {
|
||||
|
||||
@ -362,11 +363,29 @@ public class PickingResiActivity extends BaseActivity implements IOnColloClosedC
|
||||
progress.show();
|
||||
|
||||
if(thereIsAnyRowInUL()) {
|
||||
NoteAggiuntiveLUDialog.make(this, noteString -> {
|
||||
|
||||
MtbColt currentLU = currentMtbColt.get();
|
||||
|
||||
Runnable postNoteSave = () -> {
|
||||
ColliMagazzinoRESTConsumer.updateDataFine(
|
||||
this,
|
||||
progress,
|
||||
currentMtbColt.get(),
|
||||
() -> printCollo(progress, currentMtbColt.get(), onComplete));
|
||||
currentLU,
|
||||
() -> printCollo(progress, currentMtbColt.get(), onComplete),
|
||||
ex -> UtilityExceptions.defaultException(this, ex, progress));
|
||||
};
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(noteString)) {
|
||||
currentLU.setAnnotazioni(noteString);
|
||||
|
||||
ColliMagazzinoRESTConsumer.saveCollo(currentLU, mtbColt -> {
|
||||
postNoteSave.run();
|
||||
}, ex -> UtilityExceptions.defaultException(this, ex, progress));
|
||||
} else postNoteSave.run();
|
||||
|
||||
|
||||
}).show();
|
||||
} else {
|
||||
deleteCollo(progress, onComplete);
|
||||
}
|
||||
@ -523,21 +542,7 @@ public class PickingResiActivity extends BaseActivity implements IOnColloClosedC
|
||||
}
|
||||
|
||||
|
||||
public void applyFilter(String descriptionText) {
|
||||
|
||||
// this.mBindings.filteredArtsInListExpandableLayout.expand(true);
|
||||
//
|
||||
// this.mBindings.descriptionFilterText.setText(descriptionText);
|
||||
}
|
||||
|
||||
public void removeListFilter() {
|
||||
// for(int i = 0; i < mPickingList.size(); i++) {
|
||||
// mPickingList.get(i).setTempHidden(false);
|
||||
// mPickingList.get(i).setTempPickData(null);
|
||||
// }
|
||||
//
|
||||
// refreshOrderBy(false);
|
||||
// this.mBindings.filteredArtsInListExpandableLayout.collapse(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -879,7 +879,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
postCloseOperations(generatedMtbColts, onComplete);
|
||||
progress.dismiss();
|
||||
}
|
||||
}));
|
||||
}), ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
|
||||
};
|
||||
|
||||
if(SettingsManager.iDB().isFlagAskPesoColloSpedizione()) {
|
||||
|
||||
@ -0,0 +1,48 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.databinding.DialogNoteAggiuntiveNuovaUlBinding;
|
||||
|
||||
public class NoteAggiuntiveLUDialog {
|
||||
|
||||
private Dialog mDialog;
|
||||
|
||||
public static Dialog make(Context context, final RunnableArgs<String> onComplete) {
|
||||
return new NoteAggiuntiveLUDialog(context, onComplete).mDialog;
|
||||
}
|
||||
|
||||
private NoteAggiuntiveLUDialog(Context context, final RunnableArgs<String> onComplete){
|
||||
|
||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
||||
DialogNoteAggiuntiveNuovaUlBinding bindings = DataBindingUtil.inflate(inflater, R.layout.dialog_note_aggiuntive_nuova_ul, null, false);
|
||||
|
||||
mDialog = new Dialog(context);
|
||||
mDialog.setContentView(bindings.getRoot());
|
||||
|
||||
mDialog.setCanceledOnTouchOutside(false);
|
||||
mDialog.setCancelable(false);
|
||||
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
bindings.buttonConfirm.setOnClickListener(v -> {
|
||||
mDialog.dismiss();
|
||||
if(onComplete != null) onComplete.run(bindings.additionalNotesText.getText().toString());
|
||||
});
|
||||
|
||||
bindings.buttonAbort.setOnClickListener(v -> {
|
||||
mDialog.dismiss();
|
||||
if(onComplete != null) onComplete.run(null);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -50,7 +50,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextViewMaterial.DialogTitle"
|
||||
android:text="@string/action_create_ul"
|
||||
android:text="@string/lu_info"
|
||||
android:gravity="center_horizontal"/>
|
||||
|
||||
<!--<TextView-->
|
||||
@ -65,7 +65,6 @@
|
||||
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
<string name="scan_item">Scansiona il codice a barre di un <b>articolo</b></string>
|
||||
<string name="please_open_lu">Prima di procedere apri una <b>nuova UL</b></string>
|
||||
<string name="extra_item">Articolo extra</string>
|
||||
<string name="lu_info">Info UL</string>
|
||||
|
||||
|
||||
<string name="action_settings">Impostazioni</string>
|
||||
|
||||
@ -75,6 +75,7 @@
|
||||
<string name="action_insert_weight">Insert weight</string>
|
||||
<string name="action_show_created_ul">Show already created LU</string>
|
||||
<string name="dialog_input_peso_lu_description">Insert info about LU TYPE and NET / GROSS weight</string>
|
||||
<string name="lu_info">LU\'s info</string>
|
||||
|
||||
|
||||
<!-- SETTINGS -->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user