Compare commits
66 Commits
v1.13.19(1
...
v1.14.3(18
| Author | SHA1 | Date | |
|---|---|---|---|
| 65c0e520c5 | |||
| 062abb4ea3 | |||
| 1d759cdcbf | |||
| 15e1793962 | |||
| 55fee02f36 | |||
| 575ac2577f | |||
| 3fc5cd3660 | |||
| d77fbff509 | |||
| 58865ca34b | |||
| 23aa7f5261 | |||
| 65532a3185 | |||
| 1440c52322 | |||
| 4e36053ba6 | |||
| c7777b261d | |||
| 7b0a86bb81 | |||
| ebf2bd578e | |||
| f90e2acc3e | |||
| 035f058bc3 | |||
| 73e57e9430 | |||
| 13cc9f6053 | |||
| d9844315a3 | |||
| ade37f07d6 | |||
| f02e9921cb | |||
| e8ce7a9eeb | |||
| 61b0049a87 | |||
| 5c4d72dae2 | |||
| 39f52bf3dd | |||
| e50aa1f014 | |||
| b1d06605cd | |||
| ed55eb4279 | |||
| 9ac96ac8fd | |||
| 5be3fd9c25 | |||
| bab558252a | |||
| c256b39119 | |||
| af76627c50 | |||
| f9544566e9 | |||
| 4f02c3a4bc | |||
| ea8d8835cd | |||
| 61e07e8f76 | |||
| 962e1f7fa4 | |||
| 07d889bcd5 | |||
| 170db3eb0a | |||
| 856a807e3e | |||
| c56aa812ff | |||
| 770f014a70 | |||
| f6ff7aa80d | |||
| 4cd3e7e102 | |||
| 69bf5e319e | |||
| 88fe4d82cd | |||
| c8cd794cfc | |||
| 5dcc567eab | |||
| 89eafaf6ca | |||
| 6fc7f80ed4 | |||
| 2464d44222 | |||
| 96d544f2ad | |||
| e85ddc6580 | |||
| 89f6b9ce71 | |||
| c7d0ed1747 | |||
| b84b3c28f3 | |||
| 3a3bf4c2dd | |||
| 4809a96e5b | |||
| 5f206feb12 | |||
| 575762da2f | |||
| a96078c9e6 | |||
| b1941d5c34 | |||
| 6675757317 |
@@ -7,8 +7,8 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 165
|
def appVersionCode = 180
|
||||||
def appVersionName = '1.13.19'
|
def appVersionName = '1.14.3'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
@@ -91,7 +91,7 @@ dependencies {
|
|||||||
//Firebase
|
//Firebase
|
||||||
|
|
||||||
// Import the Firebase BoM
|
// Import the Firebase BoM
|
||||||
implementation platform('com.google.firebase:firebase-bom:26.0.0')
|
implementation platform('com.google.firebase:firebase-bom:26.3.0')
|
||||||
implementation 'com.google.firebase:firebase-analytics'
|
implementation 'com.google.firebase:firebase-analytics'
|
||||||
implementation 'com.google.firebase:firebase-core'
|
implementation 'com.google.firebase:firebase-core'
|
||||||
implementation 'com.google.firebase:firebase-crash'
|
implementation 'com.google.firebase:firebase-crash'
|
||||||
@@ -102,8 +102,8 @@ dependencies {
|
|||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.3.0-alpha03'
|
implementation 'com.google.android.material:material:1.3.0-rc01'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.3'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
||||||
implementation 'androidx.preference:preference-ktx:1.1.1'
|
implementation 'androidx.preference:preference-ktx:1.1.1'
|
||||||
|
|||||||
@@ -175,8 +175,8 @@ public class MainActivity extends BaseActivity
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.nav_logout:
|
case R.id.nav_logout:
|
||||||
UtilitySettings.logout(this.mAppDatabase);
|
|
||||||
ServerStatusChecker.dispose();
|
ServerStatusChecker.dispose();
|
||||||
|
UtilitySettings.logout();
|
||||||
|
|
||||||
startLoginActivity();
|
startLoginActivity();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ public class MainApplication extends Application {
|
|||||||
.roomModule(roomModule)
|
.roomModule(roomModule)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
appComponent.inject(appContext);
|
||||||
|
|
||||||
appContext.init();
|
appContext.init();
|
||||||
res = getResources();
|
res = getResources();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package it.integry.integrywmsnative;
|
|||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import dagger.Component;
|
import dagger.Component;
|
||||||
|
import it.integry.integrywmsnative.core.context.AppContext;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingModule;
|
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingModule;
|
||||||
@@ -47,4 +48,8 @@ public interface MainApplicationComponent {
|
|||||||
PickingResiComponent.Factory pickingResiComponent();
|
PickingResiComponent.Factory pickingResiComponent();
|
||||||
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void inject(AppContext appContext);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,16 @@ import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
|||||||
import com.orhanobut.logger.AndroidLogAdapter;
|
import com.orhanobut.logger.AndroidLogAdapter;
|
||||||
import com.orhanobut.logger.Logger;
|
import com.orhanobut.logger.Logger;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.BuildConfig;
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecover;
|
import it.integry.integrywmsnative.core.data_recover.ColliDataRecover;
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.settings.Stash;
|
import it.integry.integrywmsnative.core.settings.Stash;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityContext;
|
import it.integry.integrywmsnative.core.utility.UtilityContext;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilitySettings;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
||||||
|
|
||||||
@@ -20,6 +24,9 @@ public class AppContext {
|
|||||||
//Note: this is the Application Context NOT the Activity Context
|
//Note: this is the Application Context NOT the Activity Context
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
AppDatabase mAppDatabase;
|
||||||
|
|
||||||
public AppContext(Context context) {
|
public AppContext(Context context) {
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
}
|
}
|
||||||
@@ -63,6 +70,7 @@ public class AppContext {
|
|||||||
UtilityContext.initApplicationContext(mContext);
|
UtilityContext.initApplicationContext(mContext);
|
||||||
UtilityResources.init(mContext);
|
UtilityResources.init(mContext);
|
||||||
UtilityToast.init(mContext);
|
UtilityToast.init(mContext);
|
||||||
|
UtilitySettings.init(mAppDatabase);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initLogger() {
|
private void initLogger() {
|
||||||
|
|||||||
@@ -3,15 +3,18 @@ package it.integry.integrywmsnative.core.context;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||||
|
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilitySettings;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||||
|
|
||||||
public class MainContext {
|
public class MainContext {
|
||||||
@@ -44,7 +47,10 @@ public class MainContext {
|
|||||||
private void initDBData(Runnable onComplete) {
|
private void initDBData(Runnable onComplete) {
|
||||||
SettingsManager.loadDBVariables(onComplete, ex -> {
|
SettingsManager.loadDBVariables(onComplete, ex -> {
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(mContext,
|
DialogSimpleMessageHelper.makeErrorDialog(mContext,
|
||||||
new SpannableString(ex.getMessage()), null, mContext::finish).show();
|
new SpannableString(ex.getMessage()), null, mContext::finish, R.string.logout, () -> {
|
||||||
|
UtilitySettings.logout();
|
||||||
|
MainApplication.exit();
|
||||||
|
}).show();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
String newValue = observableString.get();
|
String newValue = observableString.get();
|
||||||
String viewValue = view.getText().toString().trim();
|
String viewValue = view.getText().toString();
|
||||||
|
|
||||||
if(!viewValue.equalsIgnoreCase(newValue)) {
|
if(!viewValue.equalsIgnoreCase(newValue)) {
|
||||||
view.setText(newValue);
|
view.setText(newValue);
|
||||||
|
|||||||
@@ -5,6 +5,6 @@ import it.integry.integrywmsnative.core.utility.UtilityResources;
|
|||||||
|
|
||||||
public class NoPrintersFoundException extends Exception {
|
public class NoPrintersFoundException extends Exception {
|
||||||
public NoPrintersFoundException() {
|
public NoPrintersFoundException() {
|
||||||
super(UtilityResources.getString(R.string.exception_printer_not_found));
|
super(UtilityResources.getString(R.string.exception_no_printer_found));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
public interface RunnableArgsWithReturn<T, R> {
|
||||||
|
|
||||||
|
R run(T data);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -54,6 +54,7 @@ public class MtbColt extends EntityBase {
|
|||||||
private BigDecimal lunghezzaCm;
|
private BigDecimal lunghezzaCm;
|
||||||
private BigDecimal larghezzaCm;
|
private BigDecimal larghezzaCm;
|
||||||
private BigDecimal altezzaCm;
|
private BigDecimal altezzaCm;
|
||||||
|
private String codJcom;
|
||||||
|
|
||||||
private List<MtbCols> mtbCols;
|
private List<MtbCols> mtbCols;
|
||||||
|
|
||||||
@@ -500,6 +501,15 @@ public class MtbColt extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCodJcom() {
|
||||||
|
return codJcom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodJcom(String codJcom) {
|
||||||
|
this.codJcom = codJcom;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
||||||
|
|
||||||
String xmlPrefix = "{\"whereCond\": \"";
|
String xmlPrefix = "{\"whereCond\": \"";
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import retrofit2.http.Query;
|
|||||||
public interface MesRESTConsumerService {
|
public interface MesRESTConsumerService {
|
||||||
|
|
||||||
|
|
||||||
@GET("mes/getOrdiniLavorazioneMateriale")
|
@GET("mes_v2/getOrdiniLavorazioneMateriale")
|
||||||
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazioneMateriale(@Query("codJfas") String codJfas, @Query("idMateriale") String idMateriale);
|
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazioneMateriale(@Query("codJfas") String codJfas, @Query("idMateriale") String idMateriale);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class PosizioniRESTConsumer extends _BaseRESTConsumer{
|
|||||||
public static void getBancaliInPosizione(MtbDepoPosizione mtbDepoPosizione, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void getBancaliInPosizione(MtbDepoPosizione mtbDepoPosizione, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
|
||||||
String sql = "SELECT * FROM mtb_colt WHERE cod_mdep = " + UtilityDB.valueToString(mtbDepoPosizione.getCodMdep()) + " AND posizione = " + UtilityDB.valueToString(mtbDepoPosizione.getPosizione());
|
String sql = "SELECT * FROM mtb_colt WHERE segno > 0 AND cod_mdep = " + UtilityDB.valueToString(mtbDepoPosizione.getCodMdep()) + " AND posizione = " + UtilityDB.valueToString(mtbDepoPosizione.getPosizione());
|
||||||
|
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {}.getType();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
@@ -11,6 +12,8 @@ import javax.inject.Singleton;
|
|||||||
import it.integry.integrywmsnative.BuildConfig;
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.JasperPairDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
@@ -89,7 +92,10 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
printerService.getAvailablePrinters(codMdep, printerTypeStr).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
printerService.getAvailablePrinters(codMdep, printerTypeStr).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
||||||
analyzeAnswer(response, "GetAvailablePrinters", onComplete, onFailed);
|
analyzeAnswer(response, "GetAvailablePrinters", printerList -> {
|
||||||
|
printerList = Stream.of(printerList).filter(x -> !UtilityString.isNullOrEmpty(x)).toList();
|
||||||
|
onComplete.run(printerList);
|
||||||
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -130,7 +136,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
analyzeAnswer(response, "PrintCollo", data -> {
|
analyzeAnswer(response, "printCollo", data -> {
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
@@ -142,7 +148,38 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
} else onFailed.run(new Exception(t));
|
} else onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printReport(String printerName, String reportName, HashMap<String, Object> params, int quantity, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
// if(BuildConfig.DEBUG) {
|
||||||
|
// onComplete.run();
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
JasperDTO jasperDTO = new JasperDTO();
|
||||||
|
jasperDTO.setReportName(reportName);
|
||||||
|
|
||||||
|
Stream.of(params)
|
||||||
|
.forEach(x -> jasperDTO.getParams().add(new JasperPairDTO(x.getKey(), x.getValue())));
|
||||||
|
|
||||||
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
|
printerService
|
||||||
|
.processPrintReport(printerName, quantity, jasperDTO)
|
||||||
|
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
|
analyzeAnswer(response, "printReport", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
|
if(t.getMessage().contains("Printer not found")) {
|
||||||
|
onFailed.run(new NoPrintersFoundException());
|
||||||
|
} else onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.Body;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
import retrofit2.http.FormUrlEncoded;
|
import retrofit2.http.FormUrlEncoded;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
@@ -34,4 +36,11 @@ public interface PrinterRESTConsumerService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@POST("processPrintReport")
|
||||||
|
Call<ServiceRESTResponse<Object>> processPrintReport(
|
||||||
|
@Query("printerName") String printerName,
|
||||||
|
@Query("numberOfCopies") int printQuantity,
|
||||||
|
@Body JasperDTO jasperDTO
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class JasperDTO {
|
||||||
|
|
||||||
|
private String reportName;
|
||||||
|
private List<JasperPairDTO> params = new ArrayList<>();
|
||||||
|
|
||||||
|
public String getReportName() {
|
||||||
|
return reportName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JasperDTO setReportName(String reportName) {
|
||||||
|
this.reportName = reportName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<JasperPairDTO> getParams() {
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JasperDTO setParams(List<JasperPairDTO> params) {
|
||||||
|
this.params = params;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model;
|
||||||
|
|
||||||
|
public class JasperPairDTO {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private Object value;
|
||||||
|
|
||||||
|
public JasperPairDTO(String name, Object value) {
|
||||||
|
this.name = name;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JasperPairDTO setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JasperPairDTO setValue(Object value) {
|
||||||
|
this.value = value;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@ public class DBSettingsModel {
|
|||||||
private String defaultCausaleRettificaGiacenze;
|
private String defaultCausaleRettificaGiacenze;
|
||||||
private DistribuzioneColloDTO.CriterioDistribuzione defaultCriterioDistribuzione;
|
private DistribuzioneColloDTO.CriterioDistribuzione defaultCriterioDistribuzione;
|
||||||
private boolean flagAskClienteInPickingLibero;
|
private boolean flagAskClienteInPickingLibero;
|
||||||
|
private boolean flagAllowEmptyClienteInPickingLibero;
|
||||||
|
|
||||||
private boolean flagCanAddExtraItemSpedizione;
|
private boolean flagCanAddExtraItemSpedizione;
|
||||||
private boolean flagCanAutoOpenNewULAccettazione;
|
private boolean flagCanAutoOpenNewULAccettazione;
|
||||||
@@ -33,6 +34,7 @@ public class DBSettingsModel {
|
|||||||
private boolean flagSpedizioneEnableManualPick;
|
private boolean flagSpedizioneEnableManualPick;
|
||||||
private boolean flagSpedizioneCanSelectMultipleOrders;
|
private boolean flagSpedizioneCanSelectMultipleOrders;
|
||||||
private String produzioneDefaultCodAnag;
|
private String produzioneDefaultCodAnag;
|
||||||
|
private String reportNameSpedizionChiudiOrdine;
|
||||||
|
|
||||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||||
return flagSpedizioneEnableFakeGiacenza;
|
return flagSpedizioneEnableFakeGiacenza;
|
||||||
@@ -132,6 +134,15 @@ public class DBSettingsModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFlagAllowEmptyClienteInPickingLibero() {
|
||||||
|
return flagAllowEmptyClienteInPickingLibero;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setFlagAllowEmptyClienteInPickingLibero(boolean flagAllowEmptyClienteInPickingLibero) {
|
||||||
|
this.flagAllowEmptyClienteInPickingLibero = flagAllowEmptyClienteInPickingLibero;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isFlagCanAddExtraItemSpedizione() {
|
public boolean isFlagCanAddExtraItemSpedizione() {
|
||||||
return flagCanAddExtraItemSpedizione;
|
return flagCanAddExtraItemSpedizione;
|
||||||
}
|
}
|
||||||
@@ -231,4 +242,13 @@ public class DBSettingsModel {
|
|||||||
this.produzioneDefaultCodAnag = produzioneDefaultCodAnag;
|
this.produzioneDefaultCodAnag = produzioneDefaultCodAnag;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getReportNameSpedizionChiudiOrdine() {
|
||||||
|
return reportNameSpedizionChiudiOrdine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setReportNameSpedizionChiudiOrdine(String reportNameSpedizionChiudiOrdine) {
|
||||||
|
this.reportNameSpedizionChiudiOrdine = reportNameSpedizionChiudiOrdine;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,6 +202,10 @@ public class SettingsManager {
|
|||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("PICKING_LIBERO")
|
.setSection("PICKING_LIBERO")
|
||||||
.setKeySection("FLAG_ASK_CLIENTE"));
|
.setKeySection("FLAG_ASK_CLIENTE"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("PICKING_LIBERO")
|
||||||
|
.setKeySection("FLAG_ALLOW_EMPTY_CLIENTE"));
|
||||||
stbGestSetupList.add(new StbGestSetup()
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("SPEDIZIONE")
|
.setSection("SPEDIZIONE")
|
||||||
@@ -250,6 +254,10 @@ public class SettingsManager {
|
|||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("SPEDIZIONE")
|
.setSection("SPEDIZIONE")
|
||||||
.setKeySection("FLAG_CAN_SELECT_MULTIPLE_ORDERS"));
|
.setKeySection("FLAG_CAN_SELECT_MULTIPLE_ORDERS"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("SPEDIZIONE")
|
||||||
|
.setKeySection("REPORT_PACKING_LIST"));
|
||||||
|
|
||||||
|
|
||||||
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
||||||
@@ -259,6 +267,7 @@ public class SettingsManager {
|
|||||||
dbSettingsModelIstance.setDefaultCodAnag(getValueFromList(list, "SETUP","COD_ANAG_DEFAULT", String.class));
|
dbSettingsModelIstance.setDefaultCodAnag(getValueFromList(list, "SETUP","COD_ANAG_DEFAULT", String.class));
|
||||||
dbSettingsModelIstance.setDefaultCriterioDistribuzione(getValueFromList(list, "SETUP","DEFAULT_CRITERIO_DISTRIBUZIONE", String.class));
|
dbSettingsModelIstance.setDefaultCriterioDistribuzione(getValueFromList(list, "SETUP","DEFAULT_CRITERIO_DISTRIBUZIONE", String.class));
|
||||||
dbSettingsModelIstance.setFlagAskClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ASK_CLIENTE", Boolean.class));
|
dbSettingsModelIstance.setFlagAskClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ASK_CLIENTE", Boolean.class));
|
||||||
|
dbSettingsModelIstance.setFlagAllowEmptyClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_CLIENTE", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagCanAddExtraItemSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_ITEMS", Boolean.class));
|
dbSettingsModelIstance.setFlagCanAddExtraItemSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_ITEMS", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagCanAutoOpenNewULAccettazione(getValueFromList(list, "ACCETTAZIONE", "FLAG_AUTO_OPEN_NEW_UL", Boolean.class));
|
dbSettingsModelIstance.setFlagCanAutoOpenNewULAccettazione(getValueFromList(list, "ACCETTAZIONE", "FLAG_AUTO_OPEN_NEW_UL", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagCanAddExtraQuantitySpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_QUANTITY", Boolean.class));
|
dbSettingsModelIstance.setFlagCanAddExtraQuantitySpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_QUANTITY", Boolean.class));
|
||||||
@@ -271,6 +280,7 @@ public class SettingsManager {
|
|||||||
dbSettingsModelIstance.setFlagSpedizioneEnableManualPick(getValueFromList(list, "SPEDIZIONE", "ENABLE_MANUAL_PICK", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneEnableManualPick(getValueFromList(list, "SPEDIZIONE", "ENABLE_MANUAL_PICK", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagSpedizioneEnableFakeGiacenza(getValueFromList(list, "SPEDIZIONE", "ENABLE_FAKE_GIACENZA", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneEnableFakeGiacenza(getValueFromList(list, "SPEDIZIONE", "ENABLE_FAKE_GIACENZA", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagSpedizioneCanSelectMultipleOrders(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_SELECT_MULTIPLE_ORDERS", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneCanSelectMultipleOrders(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_SELECT_MULTIPLE_ORDERS", Boolean.class));
|
||||||
|
dbSettingsModelIstance.setReportNameSpedizionChiudiOrdine(getValueFromList(list, "SPEDIZIONE", "REPORT_PACKING_LIST", String.class));
|
||||||
|
|
||||||
if(onComplete != null) onComplete.run();
|
if(onComplete != null) onComplete.run();
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
|
|||||||
@@ -6,10 +6,16 @@ import it.integry.integrywmsnative.core.settings.SettingsManager;
|
|||||||
public class UtilitySettings {
|
public class UtilitySettings {
|
||||||
|
|
||||||
|
|
||||||
public static void logout(AppDatabase appDatabase){
|
private static AppDatabase mAppDatabase;
|
||||||
|
|
||||||
|
public static void init(AppDatabase appDatabase) {
|
||||||
|
mAppDatabase = appDatabase;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void logout(){
|
||||||
SettingsManager.i().setUser(null);
|
SettingsManager.i().setUser(null);
|
||||||
SettingsManager.i().setUserSession(null);
|
SettingsManager.i().setUserSession(null);
|
||||||
UtilityThread.executeParallel(appDatabase::clearAllTables);
|
UtilityThread.executeParallel(mAppDatabase::clearAllTables);
|
||||||
SettingsManager.update();
|
SettingsManager.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ import it.integry.integrywmsnative.gest.accettazione_picking.core.AccettazioneLi
|
|||||||
import it.integry.integrywmsnative.gest.accettazione_picking.core.AccettazioneListModel;
|
import it.integry.integrywmsnative.gest.accettazione_picking.core.AccettazioneListModel;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.AccettazioneOrdineInevasoOrderBy;
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.AccettazioneOrdineInevasoOrderBy;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.rest.RecoverMtbColt;
|
||||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliActivity;
|
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliActivity;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
@@ -246,7 +247,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
}
|
}
|
||||||
|
|
||||||
accettazioneListModel.setQtaEvasa(numCnfEvasa);
|
accettazioneListModel.setQtaEvasa(numCnfEvasa);
|
||||||
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfOrd());
|
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||||
accettazioneListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
accettazioneListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||||
} else {
|
} else {
|
||||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||||
@@ -263,9 +264,6 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
accettazioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
accettazioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x.getMtbAart() != null)
|
|
||||||
accettazioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
|
||||||
|
|
||||||
accettazioneListModel.setOriginalModel(x);
|
accettazioneListModel.setOriginalModel(x);
|
||||||
|
|
||||||
list.add(accettazioneListModel);
|
list.add(accettazioneListModel);
|
||||||
@@ -458,8 +456,13 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void startListaBancaliRegistratiActivity(ArrayList<MtbColt> mtbColts){
|
public void startListaBancaliRegistratiActivity(ArrayList<RecoverMtbColt> mtbColts) {
|
||||||
Intent myIntent = ListaBancaliActivity.createIntent(this, mtbColts, false, PrinterRESTConsumer.Type.SECONDARIA, ReportManager.getReportNameLUFromGestione(GestioneEnum.ACQUISTO));
|
|
||||||
|
Intent myIntent = ListaBancaliActivity.createIntent(this,
|
||||||
|
Stream.of(mtbColts).map(x -> (MtbColt)x).toList(),
|
||||||
|
input -> ((RecoverMtbColt) input).isFlagCanBeRecovered(),
|
||||||
|
PrinterRESTConsumer.Type.SECONDARIA,
|
||||||
|
ReportManager.getReportNameLUFromGestione(GestioneEnum.ACQUISTO));
|
||||||
this.startActivityForResult(myIntent, PICK_UL_REQUEST);
|
this.startActivityForResult(myIntent, PICK_UL_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.gest.accettazione_picking;
|
package it.integry.integrywmsnative.gest.accettazione_picking;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
@@ -50,8 +51,10 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.HistoryMtbAartDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.rest.AccettazionePickingRESTConsumer;
|
import it.integry.integrywmsnative.gest.accettazione_picking.rest.AccettazionePickingRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.rest.RecoverMtbColt;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.NotCurrentYearLUException;
|
import it.integry.integrywmsnative.gest.spedizione.exceptions.NotCurrentYearLUException;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
@@ -69,12 +72,14 @@ public class AccettazionePickingViewModel {
|
|||||||
|
|
||||||
private List<OrdineAccettazioneInevasoDTO> mOrders;
|
private List<OrdineAccettazioneInevasoDTO> mOrders;
|
||||||
private List<SitArtOrdDTO> mSitArts;
|
private List<SitArtOrdDTO> mSitArts;
|
||||||
private MutableLiveData<List<PickingObjectDTO>> mPickingList = new MutableLiveData<>();
|
private final MutableLiveData<List<PickingObjectDTO>> mPickingList = new MutableLiveData<>();
|
||||||
|
|
||||||
private MtbColt mCurrentMtbColt = null;
|
private MtbColt mCurrentMtbColt = null;
|
||||||
private GestioneEnum defaultGestioneOfUL = null;
|
private GestioneEnum defaultGestioneOfUL = null;
|
||||||
private String mDefaultCodMdep = null;
|
private String mDefaultCodMdep = null;
|
||||||
|
|
||||||
|
private final List<HistoryMtbAartDTO> mHistoryUsedAarts = new ArrayList<>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public AccettazionePickingViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
public AccettazionePickingViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
||||||
BarcodeRESTConsumer barcodeRESTConsumer,
|
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||||
@@ -161,7 +166,7 @@ public class AccettazionePickingViewModel {
|
|||||||
return mPickingList;
|
return mPickingList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void retrieveExistentLU(RunnableArgs<ArrayList<MtbColt>> onComplete) {
|
public void retrieveExistentLU(RunnableArgs<ArrayList<RecoverMtbColt>> onComplete) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
this.mAccettazionePickingRESTConsumer.getBancaliGiaRegistrati(this.mSitArts, mtbColtList -> {
|
this.mAccettazionePickingRESTConsumer.getBancaliGiaRegistrati(this.mSitArts, mtbColtList -> {
|
||||||
@@ -421,7 +426,7 @@ public class AccettazionePickingViewModel {
|
|||||||
|
|
||||||
|
|
||||||
public void dispatchOrdineRow(final PickingObjectDTO pickingObjectDTO) {
|
public void dispatchOrdineRow(final PickingObjectDTO pickingObjectDTO) {
|
||||||
if(this.mCurrentMtbColt == null) return;
|
if (this.mCurrentMtbColt == null) return;
|
||||||
|
|
||||||
BigDecimal totalQtaOrd = pickingObjectDTO.getSitArtOrdDTO().getQtaOrd();
|
BigDecimal totalQtaOrd = pickingObjectDTO.getSitArtOrdDTO().getQtaOrd();
|
||||||
BigDecimal totalNumCnfOrd = pickingObjectDTO.getSitArtOrdDTO().getNumCnfOrd();
|
BigDecimal totalNumCnfOrd = pickingObjectDTO.getSitArtOrdDTO().getNumCnfOrd();
|
||||||
@@ -436,8 +441,8 @@ public class AccettazionePickingViewModel {
|
|||||||
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
||||||
});
|
});
|
||||||
|
|
||||||
BigDecimal numCnfDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getNumCnfOrd().subtract(numCnfWithdrawRows.getBigDecimalValue());
|
BigDecimal numCnfDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getNumCnfDaEvadere().subtract(numCnfWithdrawRows.getBigDecimalValue());
|
||||||
BigDecimal qtaDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getQtaOrd().subtract(qtaColWithdrawRows.getBigDecimalValue());
|
BigDecimal qtaDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getQtaDaEvadere().subtract(qtaColWithdrawRows.getBigDecimalValue());
|
||||||
BigDecimal qtaCnfDaEvadere = qtaCnfOrd;
|
BigDecimal qtaCnfDaEvadere = qtaCnfOrd;
|
||||||
|
|
||||||
numCnfDaEvadere = UtilityBigDecimal.getGreaterBetween(numCnfDaEvadere, BigDecimal.ZERO);
|
numCnfDaEvadere = UtilityBigDecimal.getGreaterBetween(numCnfDaEvadere, BigDecimal.ZERO);
|
||||||
@@ -510,12 +515,12 @@ public class AccettazionePickingViewModel {
|
|||||||
initialQtaTot = totalQtaOrd;
|
initialQtaTot = totalQtaOrd;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
|
if (UtilityBigDecimal.greaterThan(pickingObjectDTO.getMtbAart().getColliPedana(), BigDecimal.ZERO) && UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
|
||||||
initialNumCnf = pickingObjectDTO.getMtbAart().getColliPedana();
|
initialNumCnf = pickingObjectDTO.getMtbAart().getColliPedana();
|
||||||
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
|
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dataScad == null && pickingObjectDTO.getMtbAart().getGgScadPartita() != null && pickingObjectDTO.getMtbAart().getGgScadPartita() > 0) {
|
if (dataScad == null && pickingObjectDTO.getMtbAart().getGgScadPartita() != null && pickingObjectDTO.getMtbAart().getGgScadPartita() > 0) {
|
||||||
dataScad = UtilityDate.getDateInstance();
|
dataScad = UtilityDate.getDateInstance();
|
||||||
Calendar c = new GregorianCalendar();
|
Calendar c = new GregorianCalendar();
|
||||||
c.setTime(dataScad);
|
c.setTime(dataScad);
|
||||||
@@ -523,6 +528,15 @@ public class AccettazionePickingViewModel {
|
|||||||
dataScad = c.getTime();
|
dataScad = c.getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(partitaMag == null && dataScad == null) {
|
||||||
|
HistoryMtbAartDTO historyMtbAartDTO = this.getHistoryItemIfExists(pickingObjectDTO.getMtbAart().getCodMart());
|
||||||
|
|
||||||
|
if(historyMtbAartDTO != null) {
|
||||||
|
partitaMag = historyMtbAartDTO.getPartitaMag();
|
||||||
|
dataScad = historyMtbAartDTO.getDataScad();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.sendOnItemDispatched(
|
this.sendOnItemDispatched(
|
||||||
pickingObjectDTO,
|
pickingObjectDTO,
|
||||||
pickingObjectDTO.getMtbAart(),
|
pickingObjectDTO.getMtbAart(),
|
||||||
@@ -573,6 +587,8 @@ public class AccettazionePickingViewModel {
|
|||||||
.setRigaOrd(pickingObjectDTO.getSitArtOrdDTO().getRigaOrd());
|
.setRigaOrd(pickingObjectDTO.getSitArtOrdDTO().getRigaOrd());
|
||||||
|
|
||||||
|
|
||||||
|
this.addHistoryItem(mtbColr);
|
||||||
|
|
||||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||||
@@ -668,6 +684,8 @@ public class AccettazionePickingViewModel {
|
|||||||
|
|
||||||
mtbColt.getMtbColr().add(mtbColr);
|
mtbColt.getMtbColr().add(mtbColr);
|
||||||
|
|
||||||
|
this.addHistoryItem(mtbColr);
|
||||||
|
|
||||||
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
||||||
|
|
||||||
mtbColr.setNumCnf(numCnf)
|
mtbColr.setNumCnf(numCnf)
|
||||||
@@ -678,7 +696,7 @@ public class AccettazionePickingViewModel {
|
|||||||
.filter(x -> Stream.of(x.getWithdrawMtbColrs()).anyMatch(y -> y == mtbColrToUpdate))
|
.filter(x -> Stream.of(x.getWithdrawMtbColrs()).anyMatch(y -> y == mtbColrToUpdate))
|
||||||
.findSingle();
|
.findSingle();
|
||||||
|
|
||||||
if(pickingObjectDTO.isPresent()) {
|
if (pickingObjectDTO.isPresent()) {
|
||||||
pickingObjectDTO.get().getWithdrawMtbColrs().remove(mtbColrToUpdate);
|
pickingObjectDTO.get().getWithdrawMtbColrs().remove(mtbColrToUpdate);
|
||||||
pickingObjectDTO.get().getWithdrawMtbColrs().add(mtbColr);
|
pickingObjectDTO.get().getWithdrawMtbColrs().add(mtbColr);
|
||||||
}
|
}
|
||||||
@@ -813,6 +831,30 @@ public class AccettazionePickingViewModel {
|
|||||||
this.sendFilterRemoved();
|
this.sendFilterRemoved();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void addHistoryItem(@NonNull MtbColr mtbColr) {
|
||||||
|
Optional<HistoryMtbAartDTO> optional = Stream.of(this.mHistoryUsedAarts)
|
||||||
|
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart()))
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
if (optional.isPresent()) {
|
||||||
|
optional.get()
|
||||||
|
.setPartitaMag(mtbColr.getPartitaMag())
|
||||||
|
.setDataScad(mtbColr.getDataScadPartitaD());
|
||||||
|
} else {
|
||||||
|
this.mHistoryUsedAarts.add(new HistoryMtbAartDTO()
|
||||||
|
.setCodMart(mtbColr.getCodMart())
|
||||||
|
.setPartitaMag(mtbColr.getPartitaMag())
|
||||||
|
.setDataScad(mtbColr.getDataScadPartitaD()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private HistoryMtbAartDTO getHistoryItemIfExists(@NonNull String codMart) {
|
||||||
|
Optional<HistoryMtbAartDTO> optional = Stream.of(this.mHistoryUsedAarts)
|
||||||
|
.filter(x -> x.getCodMart().equalsIgnoreCase(codMart))
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
return optional.isPresent() ? optional.get() : null;
|
||||||
|
}
|
||||||
|
|
||||||
private void sendOnLoadingStarted() {
|
private void sendOnLoadingStarted() {
|
||||||
if (this.mListener != null) mListener.onLoadingStarted();
|
if (this.mListener != null) mListener.onLoadingStarted();
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking.dto;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class HistoryMtbAartDTO {
|
||||||
|
|
||||||
|
private String codMart;
|
||||||
|
private String partitaMag;
|
||||||
|
private Date dataScad;
|
||||||
|
|
||||||
|
public String getCodMart() {
|
||||||
|
return codMart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HistoryMtbAartDTO setCodMart(String codMart) {
|
||||||
|
this.codMart = codMart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartitaMag() {
|
||||||
|
return partitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HistoryMtbAartDTO setPartitaMag(String partitaMag) {
|
||||||
|
this.partitaMag = partitaMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataScad() {
|
||||||
|
return dataScad;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HistoryMtbAartDTO setDataScad(Date dataScad) {
|
||||||
|
this.dataScad = dataScad;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,18 +5,18 @@ import com.google.gson.reflect.TypeToken;
|
|||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ISimpleOperationCallback;
|
import it.integry.integrywmsnative.core.rest.consumers.ISimpleOperationCallback;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@@ -29,56 +29,87 @@ public class AccettazionePickingRESTConsumer {
|
|||||||
this.mSystemRestConsumer = systemRESTConsumer;
|
this.mSystemRestConsumer = systemRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getBancaliGiaRegistrati(List<SitArtOrdDTO> ordiniToShow, RunnableArgs<ArrayList<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getBancaliGiaRegistrati(List<SitArtOrdDTO> ordiniToShow, RunnableArgs<ArrayList<RecoverMtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
List<HashMap<String, Object>> whereCondListMap = new ArrayList<>();
|
||||||
|
|
||||||
List<String> colliWhereCond = new ArrayList<>();
|
Stream
|
||||||
|
.of(ordiniToShow)
|
||||||
|
.distinctBy(x -> x.getDataOrd() + " " + x.getGestione() + " " + x.getNumOrd())
|
||||||
|
.forEach(x -> {
|
||||||
|
try {
|
||||||
|
HashMap<String, Object> whereCondMap = new HashMap<>();
|
||||||
|
whereCondMap.put("mtb_colr.data_ord", UtilityDate.recognizeDate(x.getDataOrd()));
|
||||||
|
whereCondMap.put("mtb_colr.gestione", x.getGestione().equalsIgnoreCase("P") ? "L" : x.getGestione());
|
||||||
|
whereCondMap.put("mtb_colr.num_ord", x.getNumOrd());
|
||||||
|
|
||||||
|
whereCondListMap.add(whereCondMap);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
UtilityLogger.errorMe(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
Stream.of(ordiniToShow).forEach(x -> {
|
String sql = "SELECT DISTINCT CAST(CASE WHEN MAX(ISNULL(mtb_colr_scar.num_collo, 0)) = 0 THEN 1 ELSE 0 END AS BIT) AS flagCanBeRecovered, " +
|
||||||
try {
|
" mtb_colt.* " +
|
||||||
Date date = UtilityDate.recognizeDate(x.getDataOrd());
|
"FROM mtb_colt" +
|
||||||
String dateString = UtilityDate.formatDate(date, "yyyy/MM/dd");
|
" INNER JOIN mtb_colr ON " +
|
||||||
|
" mtb_colt.gestione = mtb_colr.gestione AND " +
|
||||||
if (!colliWhereCond.contains(x.getGestione() + " " + dateString + " " + x.getNumOrd())) {
|
" mtb_colt.ser_collo = mtb_colr.ser_collo AND " +
|
||||||
String gestione = x.getGestione().equalsIgnoreCase("P") ? "L" : x.getGestione();
|
" mtb_colt.data_collo = mtb_colr.data_collo AND " +
|
||||||
colliWhereCond.add(gestione + " " + dateString + " " + x.getNumOrd());
|
" mtb_colt.num_collo = mtb_colr.num_collo " +
|
||||||
}
|
" LEFT OUTER JOIN mtb_colr mtb_colr_scar ON mtb_colr_scar.num_collo_rif = mtb_colr.num_collo AND " +
|
||||||
} catch (Exception ex){
|
" mtb_colr_scar.gestione_rif = mtb_colr.gestione AND " +
|
||||||
UtilityLogger.errorMe(ex);
|
" mtb_colr_scar.ser_collo_rif = mtb_colr.ser_collo AND " +
|
||||||
}
|
" mtb_colr_scar.data_collo_rif = mtb_colr.data_collo " +
|
||||||
});
|
" WHERE (" + UtilityQuery.concatFieldListInWhereCond(whereCondListMap) + ") " +
|
||||||
|
" AND mtb_colt.data_doc IS NULL " +
|
||||||
|
" GROUP BY mtb_colt.gestione," +
|
||||||
|
" mtb_colt.data_collo," +
|
||||||
|
" mtb_colt.num_collo," +
|
||||||
|
" segno," +
|
||||||
|
" peso_kg," +
|
||||||
|
" lunghezza_cm," +
|
||||||
|
" larghezza_cm," +
|
||||||
|
" altezza_cm," +
|
||||||
|
" cod_anag," +
|
||||||
|
" cod_dtip," +
|
||||||
|
" mtb_colt.data_doc," +
|
||||||
|
" mtb_colt.ser_doc," +
|
||||||
|
" mtb_colt.num_doc," +
|
||||||
|
" rif_ord," +
|
||||||
|
" mtb_colt.ser_collo," +
|
||||||
|
" cod_tcol," +
|
||||||
|
" mtb_colt.data_ord," +
|
||||||
|
" mtb_colt.num_ord," +
|
||||||
|
" cod_vdes," +
|
||||||
|
" cod_mdep," +
|
||||||
|
" cod_vlis," +
|
||||||
|
" preparato_da," +
|
||||||
|
" ora_iniz_prep," +
|
||||||
|
" ora_fine_prep," +
|
||||||
|
" filtro_ordini," +
|
||||||
|
" annotazioni," +
|
||||||
|
" posizione," +
|
||||||
|
" cod_dtip_provv," +
|
||||||
|
" data_doc_provv," +
|
||||||
|
" ser_doc_provv," +
|
||||||
|
" num_doc_provv," +
|
||||||
|
" cod_jfas," +
|
||||||
|
" data_vers," +
|
||||||
|
" mtb_colt.peso_netto_kg";
|
||||||
|
|
||||||
|
|
||||||
StringBuilder colliINCondition = new StringBuilder();
|
Type typeOfObjectsList = new TypeToken<ArrayList<RecoverMtbColt>>() {
|
||||||
|
}.getType();
|
||||||
for(int i = 0; i < colliWhereCond.size(); i ++){
|
mSystemRestConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<RecoverMtbColt>>() {
|
||||||
colliINCondition.append("'").append(colliWhereCond.get(i)).append("'");
|
|
||||||
|
|
||||||
if(i < (colliWhereCond.size()-1)) colliINCondition.append(",");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String sql = "SELECT DISTINCT mtb_colt.* " +
|
|
||||||
"FROM mtb_colt, mtb_colr " +
|
|
||||||
"WHERE mtb_colt.gestione = mtb_colr.gestione AND " +
|
|
||||||
"mtb_colt.ser_collo = mtb_colr.ser_collo AND " +
|
|
||||||
"mtb_colt.data_collo = mtb_colr.data_collo AND " +
|
|
||||||
"mtb_colt.num_collo = mtb_colr.num_collo AND " +
|
|
||||||
"mtb_colt.gestione + ' ' + CONVERT(VARCHAR(15), mtb_colr.data_ord, 111) + ' ' + CONVERT(VARCHAR, mtb_colr.num_ord) IN (" + colliINCondition +
|
|
||||||
") AND mtb_colt.data_doc IS NULL ";
|
|
||||||
|
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {}.getType();
|
|
||||||
mSystemRestConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<MtbColt>>() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(ArrayList<MtbColt> value) {
|
public void onSuccess(ArrayList<RecoverMtbColt> value) {
|
||||||
if(onComplete != null) onComplete.run(value);
|
if (onComplete != null) onComplete.run(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Exception ex) {
|
public void onFailed(Exception ex) {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking.rest;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
|
||||||
|
public class RecoverMtbColt extends MtbColt {
|
||||||
|
|
||||||
|
private boolean flagCanBeRecovered;
|
||||||
|
|
||||||
|
public boolean isFlagCanBeRecovered() {
|
||||||
|
return flagCanBeRecovered;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecoverMtbColt setFlagCanBeRecovered(boolean flagCanBeRecovered) {
|
||||||
|
this.flagCanBeRecovered = flagCanBeRecovered;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,21 +3,22 @@ package it.integry.integrywmsnative.gest.contenuto_bancale.viewmodel;
|
|||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import androidx.databinding.ObservableField;
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||||
import it.integry.integrywmsnative.core.di.BindableString;
|
import it.integry.integrywmsnative.core.di.BindableString;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
@@ -42,7 +43,7 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
private PrinterRESTConsumer.Type mPrinterType;
|
private PrinterRESTConsumer.Type mPrinterType;
|
||||||
private String mReportName;
|
private String mReportName;
|
||||||
|
|
||||||
public ContenutoBancaleViewModel(ContenutoBancaleActivity context, MtbColt mtbColt, boolean canRecoverUL, PrinterRESTConsumer.Type printerType, String defaultReportName){
|
public ContenutoBancaleViewModel(ContenutoBancaleActivity context, MtbColt mtbColt, boolean canRecoverUL, PrinterRESTConsumer.Type printerType, String defaultReportName) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
this.mtbColt = new ObservableField<>(mtbColt);
|
this.mtbColt = new ObservableField<>(mtbColt);
|
||||||
this.isFabVisible.set(true);
|
this.isFabVisible.set(true);
|
||||||
@@ -85,8 +86,7 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void recoverUL() {
|
||||||
public void recoverUL(){
|
|
||||||
Intent data = new Intent();
|
Intent data = new Intent();
|
||||||
String key = DataCache.addItem(mtbColt.get());
|
String key = DataCache.addItem(mtbColt.get());
|
||||||
data.putExtra("key", key);
|
data.putExtra("key", key);
|
||||||
@@ -102,39 +102,37 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
|
|
||||||
PrinterRESTConsumer.getAvailablePrintersStatic(SettingsManager.i().getUserSession().getDepo().getCodMdep(), mPrinterType, value -> {
|
PrinterRESTConsumer.getAvailablePrintersStatic(SettingsManager.i().getUserSession().getDepo().getCodMdep(), mPrinterType, value -> {
|
||||||
|
|
||||||
if(value.size() > 0) {
|
if (value.size() > 0) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ReportManager.getReportNameLUFromGestione(mtbColt.get().getGestioneEnum(), reportName -> {
|
String reportName = ReportManager.getReportNameLUFromGestione(mtbColt.get().getGestioneEnum());
|
||||||
|
|
||||||
reportName = mReportName != null ? mReportName : reportName;
|
reportName = mReportName != null ? mReportName : reportName;
|
||||||
|
|
||||||
PrinterRESTConsumer.printColloStatic(value.get(0),
|
PrinterRESTConsumer.printColloStatic(value.get(0),
|
||||||
mtbColt.get(),
|
mtbColt.get(),
|
||||||
1,
|
1,
|
||||||
reportName,
|
reportName,
|
||||||
() -> {
|
() -> {
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
|
|
||||||
Resources res = mContext.getResources();
|
Resources res = mContext.getResources();
|
||||||
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||||
DialogSimpleMessageHelper.makeSuccessDialog(mContext, res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null).show();
|
DialogSimpleMessageHelper.makeSuccessDialog(mContext, res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null).show();
|
||||||
}, ex -> UtilityExceptions.defaultException(mContext,ex, progress));
|
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
||||||
|
|
||||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress)
|
} catch (Exception ex) {
|
||||||
);
|
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||||
} catch (Exception ex){
|
|
||||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
progress.dismiss();
|
|
||||||
String errorMessage = "Nessuna stampante configurata";
|
|
||||||
DialogSimpleMessageHelper.makeWarningDialog(mContext, new SpannableString(errorMessage), null, null).show();
|
|
||||||
}
|
}
|
||||||
}, ex -> {
|
|
||||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
} else {
|
||||||
});
|
progress.dismiss();
|
||||||
|
String errorMessage = "Nessuna stampante configurata";
|
||||||
|
DialogSimpleMessageHelper.makeWarningDialog(mContext, new SpannableString(errorMessage), null, null).show();
|
||||||
|
}
|
||||||
|
}, ex -> {
|
||||||
|
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import android.os.Bundle;
|
|||||||
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgsWithReturn;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.databinding.ActivityListaBancaliBinding;
|
import it.integry.integrywmsnative.databinding.ActivityListaBancaliBinding;
|
||||||
@@ -32,7 +32,7 @@ public class ListaBancaliActivity extends BaseActivity {
|
|||||||
|
|
||||||
private ListaBancaliViewModel mViewModel;
|
private ListaBancaliViewModel mViewModel;
|
||||||
|
|
||||||
private boolean mCanRecoverUl;
|
private RunnableArgsWithReturn<MtbColt, Boolean> mCanRecoverUl;
|
||||||
private PrinterRESTConsumer.Type mPrinterType;
|
private PrinterRESTConsumer.Type mPrinterType;
|
||||||
private String mReportName;
|
private String mReportName;
|
||||||
private boolean mFlagOnlyResiduo;
|
private boolean mFlagOnlyResiduo;
|
||||||
@@ -41,34 +41,25 @@ public class ListaBancaliActivity extends BaseActivity {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static Intent createIntent(Context context, ArrayList<MtbColt> items, boolean canRecoverUl, PrinterRESTConsumer.Type printerType, String reportName) {
|
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, PrinterRESTConsumer.Type printerType, String reportName) {
|
||||||
Intent myIntent = new Intent(context, ListaBancaliActivity.class);
|
return createIntent(context, items, canRecoverUlAction, printerType, true, reportName);
|
||||||
|
|
||||||
String mtbColtsKey = DataCache.addItem(items);
|
|
||||||
myIntent.putExtra(Key.MtbColtsKey, mtbColtsKey);
|
|
||||||
|
|
||||||
String canRecoverULKey = DataCache.addItem(canRecoverUl);
|
|
||||||
myIntent.putExtra(Key.CanRecoverUL, canRecoverULKey);
|
|
||||||
|
|
||||||
String printerTypeKey = DataCache.addItem(printerType);
|
|
||||||
myIntent.putExtra(Key.PrinterType, printerTypeKey);
|
|
||||||
|
|
||||||
String reportNameKey = DataCache.addItem(reportName);
|
|
||||||
myIntent.putExtra(Key.ReportName, reportNameKey);
|
|
||||||
|
|
||||||
String flagOnlyResiduoKey = DataCache.addItem(true);
|
|
||||||
myIntent.putExtra(Key.FlagOnlyResiduo, flagOnlyResiduoKey);
|
|
||||||
|
|
||||||
return myIntent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Intent createIntent(Context context, ArrayList<MtbColt> items, boolean canRecoverUl, PrinterRESTConsumer.Type printerType, boolean onlyResiduo) {
|
public static Intent createIntent(Context context, List<MtbColt> items, boolean canRecoverUl, PrinterRESTConsumer.Type printerType, boolean onlyResiduo) {
|
||||||
|
return createIntent(context, items, input -> canRecoverUl, printerType, onlyResiduo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, PrinterRESTConsumer.Type printerType, boolean onlyResiduo) {
|
||||||
|
return createIntent(context, items, canRecoverUlAction, printerType, onlyResiduo, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, PrinterRESTConsumer.Type printerType, boolean onlyResiduo, String reportName) {
|
||||||
Intent myIntent = new Intent(context, ListaBancaliActivity.class);
|
Intent myIntent = new Intent(context, ListaBancaliActivity.class);
|
||||||
|
|
||||||
String mtbColtsKey = DataCache.addItem(items);
|
String mtbColtsKey = DataCache.addItem(items);
|
||||||
myIntent.putExtra(Key.MtbColtsKey, mtbColtsKey);
|
myIntent.putExtra(Key.MtbColtsKey, mtbColtsKey);
|
||||||
|
|
||||||
String canRecoverULKey = DataCache.addItem(canRecoverUl);
|
String canRecoverULKey = DataCache.addItem(canRecoverUlAction);
|
||||||
myIntent.putExtra(Key.CanRecoverUL, canRecoverULKey);
|
myIntent.putExtra(Key.CanRecoverUL, canRecoverULKey);
|
||||||
|
|
||||||
String printerTypeKey = DataCache.addItem(printerType);
|
String printerTypeKey = DataCache.addItem(printerType);
|
||||||
@@ -77,9 +68,13 @@ public class ListaBancaliActivity extends BaseActivity {
|
|||||||
String flagOnlyResiduoKey = DataCache.addItem(onlyResiduo);
|
String flagOnlyResiduoKey = DataCache.addItem(onlyResiduo);
|
||||||
myIntent.putExtra(Key.FlagOnlyResiduo, flagOnlyResiduoKey);
|
myIntent.putExtra(Key.FlagOnlyResiduo, flagOnlyResiduoKey);
|
||||||
|
|
||||||
|
String reportNameKey = DataCache.addItem(reportName);
|
||||||
|
myIntent.putExtra(Key.ReportName, reportNameKey);
|
||||||
|
|
||||||
return myIntent;
|
return myIntent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -108,7 +103,7 @@ public class ListaBancaliActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void startContenutoBancaleActivity(MtbColt item){
|
public void startContenutoBancaleActivity(MtbColt item){
|
||||||
Intent myIntent = ContenutoBancaleActivity.createIntent(this, item, mCanRecoverUl, mPrinterType, mReportName);
|
Intent myIntent = ContenutoBancaleActivity.createIntent(this, item, mCanRecoverUl.run(item), mPrinterType, mReportName);
|
||||||
startActivityForResult(myIntent, PICK_UL_REQUEST);
|
startActivityForResult(myIntent, PICK_UL_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -309,10 +309,10 @@ public class PickingLiberoFragment extends Fragment implements ITitledFragment,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUClienteRequired(RunnableArgs<VtbDest> onComplete, Runnable onAbort) {
|
public void onLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort) {
|
||||||
DialogAskCliente.makeBase(getActivity(), (status, result) -> {
|
DialogAskCliente.makeBase(getActivity(), (status, result, codJcom) -> {
|
||||||
if (status == DialogConsts.Results.YES) {
|
if (status == DialogConsts.Results.YES) {
|
||||||
onComplete.run(result);
|
onComplete.run(result, codJcom);
|
||||||
} else {
|
} else {
|
||||||
onAbort.run();
|
onAbort.run();
|
||||||
}
|
}
|
||||||
@@ -401,7 +401,8 @@ public class PickingLiberoFragment extends Fragment implements ITitledFragment,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPreDestroy(Runnable onComplete) {
|
public void onPreDestroy(Runnable onComplete) {
|
||||||
if(thereIsAnOpenedUL.get()) mViewModel.closeLU(onComplete);
|
|
||||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||||
|
if(thereIsAnOpenedUL.get()) mViewModel.closeLU(onComplete);
|
||||||
|
else onComplete.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ import com.annimon.stream.Stream;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.GregorianCalendar;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -181,15 +179,15 @@ public class PickingLiberoViewModel {
|
|||||||
|
|
||||||
public void createNewLU(Integer customNumCollo, String customSerCollo, Runnable onComplete) {
|
public void createNewLU(Integer customNumCollo, String customSerCollo, Runnable onComplete) {
|
||||||
if (this.mFlagAskCliente) {
|
if (this.mFlagAskCliente) {
|
||||||
this.sendLUClienteRequired(vtbDest -> {
|
this.sendLUClienteRequired((vtbDest, codJcom) -> {
|
||||||
createNewLU_PostClienteAsk(customNumCollo, customSerCollo, vtbDest, onComplete);
|
createNewLU_PostClienteAsk(customNumCollo, customSerCollo, vtbDest, codJcom, onComplete);
|
||||||
}, onComplete);
|
}, onComplete);
|
||||||
} else {
|
} else {
|
||||||
createNewLU_PostClienteAsk(customNumCollo, customSerCollo, null, onComplete);
|
createNewLU_PostClienteAsk(customNumCollo, customSerCollo, null, null, onComplete);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createNewLU_PostClienteAsk(Integer customNumCollo, String customSerCollo, VtbDest vtbDest, Runnable onComplete) {
|
private void createNewLU_PostClienteAsk(Integer customNumCollo, String customSerCollo, VtbDest vtbDest, String codJcom, Runnable onComplete) {
|
||||||
MtbColt mtbColt = new MtbColt();
|
MtbColt mtbColt = new MtbColt();
|
||||||
mtbColt.initDefaultFields();
|
mtbColt.initDefaultFields();
|
||||||
mtbColt.setGestione(mDefaultGestione)
|
mtbColt.setGestione(mDefaultGestione)
|
||||||
@@ -211,6 +209,10 @@ public class PickingLiberoViewModel {
|
|||||||
mtbColt.setCodVdes(vtbDest.getCodVdes());
|
mtbColt.setCodVdes(vtbDest.getCodVdes());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!UtilityString.isNullOrEmpty(codJcom)) {
|
||||||
|
mtbColt.setCodJcom(codJcom);
|
||||||
|
}
|
||||||
|
|
||||||
mColliMagazzinoRESTConsumer.saveCollo(mtbColt, value -> {
|
mColliMagazzinoRESTConsumer.saveCollo(mtbColt, value -> {
|
||||||
mtbColt
|
mtbColt
|
||||||
.setNumCollo(value.getNumCollo())
|
.setNumCollo(value.getNumCollo())
|
||||||
@@ -233,9 +235,9 @@ public class PickingLiberoViewModel {
|
|||||||
BigDecimal qtaColDaPrelevare = null;
|
BigDecimal qtaColDaPrelevare = null;
|
||||||
BigDecimal qtaCnfDaPrelevare = null;
|
BigDecimal qtaCnfDaPrelevare = null;
|
||||||
|
|
||||||
BigDecimal initialNumCnf = null;
|
BigDecimal initialNumCnf;
|
||||||
BigDecimal initialQtaCnf = null;
|
BigDecimal initialQtaCnf;
|
||||||
BigDecimal initialQtaTot = null;
|
BigDecimal initialQtaTot;
|
||||||
|
|
||||||
String partitaMag = null;
|
String partitaMag = null;
|
||||||
Date dataScad = null;
|
Date dataScad = null;
|
||||||
@@ -758,7 +760,7 @@ public class PickingLiberoViewModel {
|
|||||||
if (this.mListener != null) mListener.onMtbColrDeleteRequest(onComplete);
|
if (this.mListener != null) mListener.onMtbColrDeleteRequest(onComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendLUClienteRequired(RunnableArgs<VtbDest> onComplete, Runnable onAbort) {
|
private void sendLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort) {
|
||||||
if (this.mListener != null) mListener.onLUClienteRequired(onComplete, onAbort);
|
if (this.mListener != null) mListener.onLUClienteRequired(onComplete, onAbort);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -816,7 +818,7 @@ public class PickingLiberoViewModel {
|
|||||||
|
|
||||||
void onError(Exception ex);
|
void onError(Exception ex);
|
||||||
|
|
||||||
void onLUClienteRequired(RunnableArgs<VtbDest> onComplete, Runnable onAbort);
|
void onLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort);
|
||||||
|
|
||||||
void onArtSelectionRequest(List<MtbColr> mtbColrsToPick, RunnableArgs<List<MtbColr>> onComplete, Runnable onAbort);
|
void onArtSelectionRequest(List<MtbColr> mtbColrsToPick, RunnableArgs<List<MtbColr>> onComplete, Runnable onAbort);
|
||||||
|
|
||||||
|
|||||||
@@ -216,15 +216,14 @@ public class PickingResiViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum(), reportName -> {
|
String reportName = ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum());
|
||||||
|
|
||||||
this.mPrinterRESTConsumer.printCollo(
|
this.mPrinterRESTConsumer.printCollo(
|
||||||
printerName,
|
printerName,
|
||||||
mtbColtToPrint,
|
mtbColtToPrint,
|
||||||
1,
|
1,
|
||||||
reportName, onComplete, onFailed);
|
reportName, onComplete, onFailed);
|
||||||
|
|
||||||
}, onFailed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void postCloseOperations(MtbColt mtbColt, Runnable onComplete) {
|
private void postCloseOperations(MtbColt mtbColt, Runnable onComplete) {
|
||||||
@@ -282,7 +281,6 @@ public class PickingResiViewModel {
|
|||||||
BigDecimal qtaCnfDoc = withdrawableDtbDocr.getQtaCnf();
|
BigDecimal qtaCnfDoc = withdrawableDtbDocr.getQtaCnf();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.sendOnItemDispatched(
|
this.sendOnItemDispatched(
|
||||||
withdrawableDtbDocr.getMtbAart(),
|
withdrawableDtbDocr.getMtbAart(),
|
||||||
totalNumCnfDoc,
|
totalNumCnfDoc,
|
||||||
@@ -376,13 +374,13 @@ public class PickingResiViewModel {
|
|||||||
this.mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
this.mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
||||||
|
|
||||||
mtbColr
|
mtbColr
|
||||||
.setDataCollo(value.getDataColloS())
|
.setDataCollo(value.getDataColloS())
|
||||||
.setNumCollo(value.getNumCollo())
|
.setNumCollo(value.getNumCollo())
|
||||||
.setGestione(value.getGestione())
|
.setGestione(value.getGestione())
|
||||||
.setSerCollo(value.getSerCollo())
|
.setSerCollo(value.getSerCollo())
|
||||||
.setRiga(value.getMtbColr().get(0).getRiga())
|
.setRiga(value.getMtbColr().get(0).getRiga())
|
||||||
.setUntMis(withdrawableDtbDocr.getMtbAart().getUntMis())
|
.setUntMis(withdrawableDtbDocr.getMtbAart().getUntMis())
|
||||||
.setMtbAart(withdrawableDtbDocr.getMtbAart());
|
.setMtbAart(withdrawableDtbDocr.getMtbAart());
|
||||||
|
|
||||||
withdrawableDtbDocr.getWithdrawRows().add(mtbColr);
|
withdrawableDtbDocr.getWithdrawRows().add(mtbColr);
|
||||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
|||||||
@@ -37,148 +37,18 @@ public class PickingResiRESTConsumer {
|
|||||||
for(int i = 0; i < documents.size(); i++) {
|
for(int i = 0; i < documents.size(); i++) {
|
||||||
HashMap<String, Object> filter = new HashMap<>();
|
HashMap<String, Object> filter = new HashMap<>();
|
||||||
|
|
||||||
filter.put("dtb_docr.data_doc", documents.get(i).getDataDocD());
|
filter.put("data_doc", documents.get(i).getDataDocD());
|
||||||
filter.put("dtb_docr.num_doc", documents.get(i).getNumDoc());
|
filter.put("num_doc", documents.get(i).getNumDoc());
|
||||||
filter.put("dtb_docr.ser_doc", documents.get(i).getSerDoc());
|
filter.put("ser_doc", documents.get(i).getSerDoc());
|
||||||
filter.put("dtb_docr.cod_anag", documents.get(i).getCodAnag());
|
filter.put("cod_anag", documents.get(i).getCodAnag());
|
||||||
filter.put("dtb_docr.cod_dtip", documents.get(i).getCodDtip());
|
filter.put("cod_dtip", documents.get(i).getCodDtip());
|
||||||
|
|
||||||
filterCond.add(filter);
|
filterCond.add(filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
String sql = "SELECT dtb_docr.[cod_anag]" +
|
String sql = "SELECT * FROM dvw_situazione_qta_docs " +
|
||||||
" ,dtb_docr.[cod_dtip]" +
|
|
||||||
" ,dtb_docr.[data_doc]" +
|
|
||||||
" ,dtb_docr.[ser_doc]" +
|
|
||||||
" ,dtb_docr.[num_doc]" +
|
|
||||||
" ,dtb_docr.[id_riga]" +
|
|
||||||
" ,dtb_docr.[cod_mart]" +
|
|
||||||
" ,dtb_docr.[descrizione]" +
|
|
||||||
" ,dtb_docr.[unt_doc]" +
|
|
||||||
" ,(dtb_docr.[rap_conv] / dtb_docr.[rap_conv]) as rap_conv" +
|
|
||||||
" ,(dtb_docr.[qta_doc] * dtb_docr.[rap_conv]) - ISNULL(mtb_colr.qta_col, 0) as qta_doc" +
|
|
||||||
" ,dtb_docr.[val_unt]" +
|
|
||||||
" ,dtb_docr.[sconto5]" +
|
|
||||||
" ,dtb_docr.[sconto6]" +
|
|
||||||
" ,dtb_docr.[sconto7]" +
|
|
||||||
" ,dtb_docr.[sconto8]" +
|
|
||||||
" ,dtb_docr.[cod_aliq]" +
|
|
||||||
" ,dtb_docr.[perc_prov]" +
|
|
||||||
" ,dtb_docr.[val_prov]" +
|
|
||||||
" ,dtb_docr.[data_ord]" +
|
|
||||||
" ,dtb_docr.[num_ord]" +
|
|
||||||
" ,dtb_docr.[riga_ord]" +
|
|
||||||
" ,dtb_docr.[importo_riga]" +
|
|
||||||
" ,dtb_docr.[cod_col]" +
|
|
||||||
" ,dtb_docr.[cod_tagl]" +
|
|
||||||
" ,dtb_docr.[cod_jcom]" +
|
|
||||||
" ,dtb_docr.[cod_mdep]" +
|
|
||||||
" ,dtb_docr.[perc_gest]" +
|
|
||||||
" ,dtb_docr.[val_gest]" +
|
|
||||||
" ,dtb_docr.[partita_mag]" +
|
|
||||||
" ,dtb_docr.[val_unt_iva]" +
|
|
||||||
" ,dtb_docr.[qta_cnf]" +
|
|
||||||
" ,dtb_docr.[descrizione_estesa]" +
|
|
||||||
" ,dtb_docr.[costo_unt]" +
|
|
||||||
" ,dtb_docr.[perc_ispe]" +
|
|
||||||
" ,dtb_docr.[val_ispe]" +
|
|
||||||
" ,dtb_docr.[perc_promo]" +
|
|
||||||
" ,dtb_docr.[val_promo]" +
|
|
||||||
" ,dtb_docr.[perc_oneri]" +
|
|
||||||
" ,dtb_docr.[val_oneri]" +
|
|
||||||
" ,dtb_docr.[flag_evaso_forzato]" +
|
|
||||||
" ,dtb_docr.[cod_dtip_comp]" +
|
|
||||||
" ,dtb_docr.[data_doc_comp]" +
|
|
||||||
" ,dtb_docr.[ser_doc_comp]" +
|
|
||||||
" ,dtb_docr.[num_doc_comp]" +
|
|
||||||
" ,dtb_docr.[cod_promo]" +
|
|
||||||
" ,dtb_docr.[perc_prov2]" +
|
|
||||||
" ,dtb_docr.[val_prov2]" +
|
|
||||||
" ,dtb_docr.[cod_art_for]" +
|
|
||||||
" ,dtb_docr.[unt_doc2]" +
|
|
||||||
" ,dtb_docr.[qta_doc2]" +
|
|
||||||
" ,dtb_docr.[unt_doc3]" +
|
|
||||||
" ,dtb_docr.[qta_doc3]" +
|
|
||||||
" ,dtb_docr.[num_cnf]" +
|
|
||||||
" ,dtb_docr.[peso_lordo]" +
|
|
||||||
" ,dtb_docr.[posizione]" +
|
|
||||||
" ,dtb_docr.[cod_anag_comp]" +
|
|
||||||
" ,dtb_docr.[cod_mtip]" +
|
|
||||||
" ,dtb_docr.[matricola]" +
|
|
||||||
" ,dtb_docr.[data_iniz_comp]" +
|
|
||||||
" ,dtb_docr.[data_fine_comp]" +
|
|
||||||
" ,dtb_docr.[cod_kit]" +
|
|
||||||
" ,dtb_docr.[cod_alis]" +
|
|
||||||
" ,dtb_docr.[data_ins_row]" +
|
|
||||||
" ,dtb_docr.[note] " +
|
|
||||||
" ,dtb_doct.[gestione] " +
|
|
||||||
" ,mtb_partita_mag.[data_scad] as data_scad_partita_mag " +
|
|
||||||
"FROM dtb_docr " +
|
|
||||||
"INNER JOIN dtb_doct ON dtb_docr.num_doc = dtb_doct.num_doc AND dtb_docr.data_doc = dtb_doct.data_doc AND dtb_docr.cod_anag = dtb_doct.cod_anag AND dtb_docr.cod_dtip = dtb_doct.cod_dtip AND dtb_docr.ser_doc = dtb_doct.ser_doc " +
|
|
||||||
"INNER JOIN mtb_aart ON dtb_docr.cod_mart = mtb_aart.cod_mart " +
|
|
||||||
"LEFT OUTER JOIN mtb_partita_mag ON dtb_docr.cod_mart = mtb_partita_mag.cod_mart " +
|
|
||||||
" AND dtb_docr.partita_mag = mtb_partita_mag.partita_mag " +
|
|
||||||
"LEFT OUTER JOIN ctb_cont ON mtb_aart.cod_ccon_ricavi = ctb_cont.cod_ccon " +
|
|
||||||
"LEFT OUTER JOIN ctb_grup ON ctb_cont.cod_cgrp = ctb_grup.cod_cgrp " +
|
|
||||||
"LEFT OUTER JOIN (" +
|
|
||||||
" SELECT gestione," +
|
|
||||||
" cod_mart," +
|
|
||||||
" cod_col," +
|
|
||||||
" cod_tagl," +
|
|
||||||
" SUM(qta_col) as qta_col," +
|
|
||||||
" data_ord," +
|
|
||||||
" num_ord," +
|
|
||||||
" riga_ord," +
|
|
||||||
" partita_mag," +
|
|
||||||
" qta_cnf," +
|
|
||||||
" gestione_rif," +
|
|
||||||
" data_collo_rif," +
|
|
||||||
" ser_collo_rif," +
|
|
||||||
" num_collo_rif," +
|
|
||||||
" cod_jcom," +
|
|
||||||
" SUM(num_cnf) as num_cnf," +
|
|
||||||
" cod_anag_doc," +
|
|
||||||
" cod_dtip_doc," +
|
|
||||||
" data_doc," +
|
|
||||||
" ser_doc," +
|
|
||||||
" num_doc," +
|
|
||||||
" id_riga_doc" +
|
|
||||||
" FROM mtb_colr" +
|
|
||||||
" GROUP BY gestione," +
|
|
||||||
" cod_barre," +
|
|
||||||
" cod_mart," +
|
|
||||||
" cod_col," +
|
|
||||||
" cod_tagl," +
|
|
||||||
" data_ord," +
|
|
||||||
" num_ord," +
|
|
||||||
" riga_ord," +
|
|
||||||
" partita_mag," +
|
|
||||||
" qta_cnf," +
|
|
||||||
" gestione_rif," +
|
|
||||||
" data_collo_rif," +
|
|
||||||
" ser_collo_rif," +
|
|
||||||
" num_collo_rif," +
|
|
||||||
" cod_jcom," +
|
|
||||||
" cod_anag_doc," +
|
|
||||||
" cod_dtip_doc," +
|
|
||||||
" data_doc," +
|
|
||||||
" ser_doc," +
|
|
||||||
" num_doc," +
|
|
||||||
" id_riga_doc" +
|
|
||||||
" ) mtb_colr" +
|
|
||||||
" ON " +
|
|
||||||
" dtb_docr.cod_anag = mtb_colr.cod_anag_doc AND " +
|
|
||||||
" dtb_docr.cod_dtip = mtb_colr.cod_dtip_doc AND " +
|
|
||||||
" dtb_docr.ser_doc = mtb_colr.ser_doc AND " +
|
|
||||||
" dtb_docr.data_doc = mtb_colr.data_doc AND " +
|
|
||||||
" dtb_docr.num_doc = mtb_colr.num_doc AND " +
|
|
||||||
" dtb_docr.id_riga = mtb_colr.id_riga_doc " +
|
|
||||||
"WHERE " +
|
"WHERE " +
|
||||||
" (ctb_grup.sezione <> 1 OR ctb_grup.sezione IS NULL) AND " +
|
|
||||||
" dtb_docr.[qta_doc] - ISNULL(mtb_colr.qta_col, 0) > 0 AND" +
|
|
||||||
" ( " +
|
|
||||||
UtilityQuery.concatFieldListInWhereCond(filterCond) +
|
UtilityQuery.concatFieldListInWhereCond(filterCond) +
|
||||||
" ) " +
|
|
||||||
"ORDER BY cod_mart";
|
"ORDER BY cod_mart";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
package it.integry.integrywmsnative.gest.prod_recupero_materiale.viewmodel;
|
package it.integry.integrywmsnative.gest.prod_recupero_materiale.viewmodel;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
import androidx.databinding.ObservableField;
|
import androidx.databinding.ObservableField;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
@@ -18,6 +17,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
@@ -31,6 +31,7 @@ import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsume
|
|||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
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.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
@@ -39,15 +40,16 @@ import it.integry.integrywmsnative.databinding.FragmentProdRecuperoMaterialeBind
|
|||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.HistoryULsListAdapter;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.HistoryULsListAdapter;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.ProdRecuperoMaterialeHelper;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.ProdRecuperoMaterialeHelper;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
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_v2.DialogInputQuantityV2;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLU;
|
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLU;
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
|
||||||
|
|
||||||
public class ProdRecuperoMaterialeViewModel {
|
public class ProdRecuperoMaterialeViewModel {
|
||||||
|
|
||||||
private Context mContext;
|
private FragmentActivity mContext;
|
||||||
|
|
||||||
private FragmentProdRecuperoMaterialeBinding mBinding;
|
private FragmentProdRecuperoMaterialeBinding mBinding;
|
||||||
private ProdRecuperoMaterialeHelper mHelper;
|
private ProdRecuperoMaterialeHelper mHelper;
|
||||||
@@ -61,7 +63,7 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
|
|
||||||
private int barcodeScannerIstanceID = -1;
|
private int barcodeScannerIstanceID = -1;
|
||||||
|
|
||||||
public void init(Activity context, FragmentProdRecuperoMaterialeBinding binding, ProdRecuperoMaterialeHelper helper, Runnable onRecuperoCompleted) {
|
public void init(FragmentActivity context, FragmentProdRecuperoMaterialeBinding binding, ProdRecuperoMaterialeHelper helper, Runnable onRecuperoCompleted) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mBinding = binding;
|
mBinding = binding;
|
||||||
mHelper = helper;
|
mHelper = helper;
|
||||||
@@ -79,7 +81,6 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void initBarcode() {
|
private void initBarcode() {
|
||||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
.setOnScanSuccessfull(onScanSuccessful)
|
.setOnScanSuccessfull(onScanSuccessful)
|
||||||
@@ -97,13 +98,12 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
|
|
||||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
if(UtilityBarcode.isEtichettaAnonima(data) || UtilityBarcode.isEtichetta128(data)){
|
if (UtilityBarcode.isEtichettaAnonima(data) || UtilityBarcode.isEtichetta128(data)) {
|
||||||
this.executeEtichettaUL(data, progressDialog);
|
this.executeEtichettaUL(data, progressDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,10 +112,10 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
private void executeEtichettaUL(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
private void executeEtichettaUL(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
||||||
ColliMagazzinoRESTConsumer.getBySSCCStatic(barcodeScanDTO.getStringValue(), true, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getBySSCCStatic(barcodeScanDTO.getStringValue(), true, false, mtbColt -> {
|
||||||
|
|
||||||
if(mtbColt != null) {
|
if (mtbColt != null) {
|
||||||
|
|
||||||
HistoryVersamentoProdULDTO historyVersamentoProdULRestDTO = this.getHistoryElementFromMtbColt(mtbColt);
|
HistoryVersamentoProdULDTO historyVersamentoProdULRestDTO = this.getHistoryElementFromMtbColt(mtbColt);
|
||||||
if(historyVersamentoProdULRestDTO != null) {
|
if (historyVersamentoProdULRestDTO != null) {
|
||||||
this.dispatchItem(historyVersamentoProdULRestDTO, mtbColt, progressDialog);
|
this.dispatchItem(historyVersamentoProdULRestDTO, mtbColt, progressDialog);
|
||||||
} else {
|
} else {
|
||||||
DialogCommon.showNoULFound(mContext, () -> {
|
DialogCommon.showNoULFound(mContext, () -> {
|
||||||
@@ -144,9 +144,9 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
x.getDataColloRif().equals(mtbColt.getDataColloS()) &&
|
x.getDataColloRif().equals(mtbColt.getDataColloS()) &&
|
||||||
x.getSerColloRif().equalsIgnoreCase(mtbColt.getSerCollo()) &&
|
x.getSerColloRif().equalsIgnoreCase(mtbColt.getSerCollo()) &&
|
||||||
x.getGestioneRif().equalsIgnoreCase(mtbColt.getGestione()))
|
x.getGestioneRif().equalsIgnoreCase(mtbColt.getGestione()))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
if(filteredItems != null && filteredItems.size() > 0) {
|
if (filteredItems != null && filteredItems.size() > 0) {
|
||||||
return filteredItems.get(0);
|
return filteredItems.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,38 +154,75 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// private void dispatchItem(HistoryVersamentoProdULDTO item, MtbColt sourceMtbColt, Dialog dialogProgress) {
|
||||||
|
// BigDecimal qtaDaEvadere = BigDecimal.ZERO;
|
||||||
|
//
|
||||||
|
// qtaDaEvadere = qtaDaEvadere.add(item.getQtaCol());
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// DialogInputQuantity.DTO dto = new DialogInputQuantity.DTO()
|
||||||
|
// .setBatchLot(item.getPartitaMag())
|
||||||
|
// .setQtaDaEvadere(null)
|
||||||
|
// .setQtaOrd(null)
|
||||||
|
// .setMtbAart(item.getMtbAart())
|
||||||
|
// .setCanPartitaMagBeChanged(false)
|
||||||
|
// .setNumCnf(1)
|
||||||
|
// .setQtaCnf(item.getQtaCnf())
|
||||||
|
// .setQtaTot(item.getQtaCnf())
|
||||||
|
// .setMaxQta(qtaDaEvadere)
|
||||||
|
// .setQtaDisponibile(qtaDaEvadere);
|
||||||
|
//
|
||||||
|
// DialogInputQuantity.makeBase(mContext, dto, false, quantity -> {
|
||||||
|
// onItemDispatched(item, quantity.qtaTot.getBigDecimal(), sourceMtbColt, dialogProgress);
|
||||||
|
// }, () -> {
|
||||||
|
// if (dialogProgress != null) dialogProgress.dismiss();
|
||||||
|
// }).show();
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
private void dispatchItem(HistoryVersamentoProdULDTO item, MtbColt sourceMtbColt, Dialog dialogProgress) {
|
private void dispatchItem(HistoryVersamentoProdULDTO item, MtbColt sourceMtbColt, Dialog dialogProgress) {
|
||||||
BigDecimal qtaDaEvadere = BigDecimal.ZERO;
|
BigDecimal qtaDaEvadere = BigDecimal.ZERO;
|
||||||
|
BigDecimal numCnfDaEvadere = BigDecimal.ZERO;
|
||||||
|
|
||||||
qtaDaEvadere = qtaDaEvadere.add(item.getQtaCol());
|
qtaDaEvadere = qtaDaEvadere.add(item.getQtaCol());
|
||||||
|
|
||||||
|
if(!UtilityBigDecimal.equalsTo(qtaDaEvadere, BigDecimal.ZERO)) {
|
||||||
|
numCnfDaEvadere = UtilityBigDecimal.divide(qtaDaEvadere, item.getQtaCnf());
|
||||||
|
}
|
||||||
|
|
||||||
DialogInputQuantity.DTO dto = new DialogInputQuantity.DTO()
|
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||||
.setBatchLot(item.getPartitaMag())
|
|
||||||
.setQtaDaEvadere(null)
|
|
||||||
.setQtaOrd(null)
|
|
||||||
.setMtbAart(item.getMtbAart())
|
.setMtbAart(item.getMtbAart())
|
||||||
.setCanPartitaMagBeChanged(false)
|
.setInitialNumCnf(BigDecimal.ONE)
|
||||||
.setNumCnf(1)
|
.setInitialQtaCnf(item.getQtaCnf())
|
||||||
.setQtaCnf(item.getQtaCnf())
|
.setInitialQtaTot(item.getQtaCnf())
|
||||||
.setQtaTot(item.getQtaCnf())
|
|
||||||
.setMaxQta(qtaDaEvadere)
|
|
||||||
.setQtaDisponibile(qtaDaEvadere);
|
|
||||||
|
|
||||||
DialogInputQuantity.makeBase(mContext, dto, false, quantity -> {
|
.setTotalQtaAvailable(qtaDaEvadere)
|
||||||
onItemDispatched(item, quantity.qtaTot.getBigDecimal(), sourceMtbColt, dialogProgress);
|
.setTotalNumCnfAvailable(numCnfDaEvadere)
|
||||||
}, () -> {
|
.setQtaCnfAvailable(item.getQtaCnf())
|
||||||
if(dialogProgress != null) dialogProgress.dismiss();
|
.setPartitaMag(item.getPartitaMag())
|
||||||
}).show();
|
// .setDataScad(item.getDa)
|
||||||
|
.setCanOverflowOrderQuantity(false)
|
||||||
|
.setCanLUBeClosed(false);
|
||||||
|
|
||||||
|
DialogInputQuantityV2
|
||||||
|
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
||||||
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
|
.setQtaTot(resultDTO.getQtaTot())
|
||||||
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
|
onItemDispatched(item, resultDTO.getQtaTot(), sourceMtbColt, dialogProgress);
|
||||||
|
}, () -> {
|
||||||
|
if (dialogProgress != null) dialogProgress.dismiss();
|
||||||
|
})
|
||||||
|
.show(mContext.getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void onItemDispatched(HistoryVersamentoProdULDTO item, BigDecimal quantity, MtbColt sourceMtbColt, Dialog progress) {
|
private void onItemDispatched(HistoryVersamentoProdULDTO item, BigDecimal quantity, MtbColt sourceMtbColt, Dialog progress) {
|
||||||
|
|
||||||
if(progress == null) {
|
if (progress == null) {
|
||||||
progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
}
|
}
|
||||||
Dialog finalProgress = progress;
|
Dialog finalProgress = progress;
|
||||||
@@ -197,7 +234,7 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
.setGestione(item.getGestione())
|
.setGestione(item.getGestione())
|
||||||
.setMtbColr(new ObservableArrayList<>());
|
.setMtbColr(new ObservableArrayList<>());
|
||||||
|
|
||||||
for(HistoryVersamentoProdULDTO.OrdineDto ordine : item.getOrdini()) {
|
for (HistoryVersamentoProdULDTO.OrdineDto ordine : item.getOrdini()) {
|
||||||
BigDecimal qtaCol = quantity.multiply(new BigDecimal(-1).multiply(new BigDecimal(ordine.getPercentageHr()))).divide(new BigDecimal(100), 3, RoundingMode.HALF_EVEN);
|
BigDecimal qtaCol = quantity.multiply(new BigDecimal(-1).multiply(new BigDecimal(ordine.getPercentageHr()))).divide(new BigDecimal(100), 3, RoundingMode.HALF_EVEN);
|
||||||
|
|
||||||
final MtbColr mtbColrScarico = new MtbColr()
|
final MtbColr mtbColrScarico = new MtbColr()
|
||||||
@@ -220,18 +257,17 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mtbColtScarico.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
mtbColtScarico.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
|
|
||||||
RunnableArgss<MtbColt, Boolean> saveRunnable = (mtbColt, createdLU) -> {
|
RunnableArgss<MtbColt, Boolean> saveRunnable = (mtbColt, createdLU) -> {
|
||||||
|
|
||||||
if(mtbColt != null) {
|
if (mtbColt != null) {
|
||||||
|
|
||||||
List<MtbColt> colliToSave = new ArrayList<>();
|
List<MtbColt> colliToSave = new ArrayList<>();
|
||||||
boolean shouldPrint = false;
|
boolean shouldPrint = false;
|
||||||
|
|
||||||
if(!Objects.equals(mtbColt.getNumCollo(), item.getNumColloRif()) ||
|
if (!Objects.equals(mtbColt.getNumCollo(), item.getNumColloRif()) ||
|
||||||
!Objects.equals(mtbColt.getSerCollo(), item.getSerColloRif()) ||
|
!Objects.equals(mtbColt.getSerCollo(), item.getSerColloRif()) ||
|
||||||
!Objects.equals(mtbColt.getDataColloS(), item.getDataColloRif()) ||
|
!Objects.equals(mtbColt.getDataColloS(), item.getDataColloRif()) ||
|
||||||
!Objects.equals(mtbColt.getGestione(), item.getGestioneRif())) {
|
!Objects.equals(mtbColt.getGestione(), item.getGestioneRif())) {
|
||||||
@@ -267,7 +303,7 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
|
|
||||||
FBToast.successToast(mContext, mContext.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
FBToast.successToast(mContext, mContext.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||||
|
|
||||||
if(finalShouldPrint) {
|
if (finalShouldPrint) {
|
||||||
printCollo(finalProgress, value.get(0), () -> {
|
printCollo(finalProgress, value.get(0), () -> {
|
||||||
this.refreshAdapter();
|
this.refreshAdapter();
|
||||||
mOnRecuperoCompleted.run();
|
mOnRecuperoCompleted.run();
|
||||||
@@ -287,7 +323,7 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if(sourceMtbColt != null) saveRunnable.run(sourceMtbColt, false);
|
if (sourceMtbColt != null) saveRunnable.run(sourceMtbColt, false);
|
||||||
else DialogScanOrCreateLU.make(mContext, true, false, saveRunnable).show();
|
else DialogScanOrCreateLU.make(mContext, true, false, saveRunnable).show();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -329,21 +365,18 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||||
ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum(), reportName -> {
|
String reportName = ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum());
|
||||||
|
|
||||||
PrinterRESTConsumer.printColloStatic(
|
PrinterRESTConsumer.printColloStatic(
|
||||||
printerName,
|
printerName,
|
||||||
mtbColtToPrint,
|
mtbColtToPrint,
|
||||||
1,
|
1,
|
||||||
reportName, onComplete, onAbort);
|
reportName, onComplete, onAbort);
|
||||||
|
|
||||||
}, onAbort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void refreshAdapter() {
|
private void refreshAdapter() {
|
||||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
@@ -360,5 +393,4 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.gest.rettifica_giacenze;
|
package it.integry.integrywmsnative.gest.rettifica_giacenze;
|
||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -27,12 +25,12 @@ import it.integry.integrywmsnative.core.model.MtbColr;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbCols;
|
import it.integry.integrywmsnative.core.model.MtbCols;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
|
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
@@ -40,7 +38,6 @@ import it.integry.integrywmsnative.core.utility.UtilityString;
|
|||||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.core.RettificaGiacenzeRESTConsumer;
|
import it.integry.integrywmsnative.gest.rettifica_giacenze.core.RettificaGiacenzeRESTConsumer;
|
||||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.dto.FornitoreDTO;
|
import it.integry.integrywmsnative.gest.rettifica_giacenze.dto.FornitoreDTO;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||||
|
|
||||||
@@ -61,6 +58,8 @@ public class RettificaGiacenzeViewModel {
|
|||||||
private String mCurrentCodMdep;
|
private String mCurrentCodMdep;
|
||||||
private boolean mIsCreatedLU;
|
private boolean mIsCreatedLU;
|
||||||
|
|
||||||
|
private boolean mAnyEditDone = false;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public RettificaGiacenzeViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
public RettificaGiacenzeViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
||||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||||
@@ -327,7 +326,7 @@ public class RettificaGiacenzeViewModel {
|
|||||||
|
|
||||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
if (!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
// if (!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
||||||
mtbColr
|
mtbColr
|
||||||
.setQtaCol(BigDecimal.ZERO)
|
.setQtaCol(BigDecimal.ZERO)
|
||||||
.setNumCnf(BigDecimal.ZERO)
|
.setNumCnf(BigDecimal.ZERO)
|
||||||
@@ -350,42 +349,46 @@ public class RettificaGiacenzeViewModel {
|
|||||||
|
|
||||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
|
||||||
|
this.mAnyEditDone = true;
|
||||||
|
|
||||||
this.sendOnRowSaved();
|
this.sendOnRowSaved();
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
if (shouldCloseLU) closeLU(false, null);
|
if (shouldCloseLU) closeLU(true, null);
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
} else {
|
// } else {
|
||||||
mtbColr
|
// mtbColr
|
||||||
.setQtaCol(qtaTot)
|
// .setQtaCol(qtaTot)
|
||||||
.setQtaCnf(qtaCnf)
|
// .setQtaCnf(qtaCnf)
|
||||||
.setNumCnf(numCnf);
|
// .setNumCnf(numCnf);
|
||||||
|
//
|
||||||
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
// MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||||
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
// cloneMtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||||
|
//
|
||||||
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
// cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
||||||
|
//
|
||||||
cloneMtbColt.getMtbColr().add(mtbColr);
|
// cloneMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
//
|
||||||
mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
// mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
||||||
mtbColr
|
// mtbColr
|
||||||
.setDataCollo(value.getDataColloS())
|
// .setDataCollo(value.getDataColloS())
|
||||||
.setNumCollo(value.getNumCollo())
|
// .setNumCollo(value.getNumCollo())
|
||||||
.setGestione(value.getGestione())
|
// .setGestione(value.getGestione())
|
||||||
.setSerCollo(value.getSerCollo())
|
// .setSerCollo(value.getSerCollo())
|
||||||
.setRiga(value.getMtbColr().get(0).getRiga())
|
// .setRiga(value.getMtbColr().get(0).getRiga())
|
||||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
// .setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
// .setMtbAart(pickingObjectDTO.getMtbAart());
|
||||||
|
//
|
||||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
// mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
//
|
||||||
this.sendOnRowSaved();
|
// this.mAnyEditDone = true;
|
||||||
this.sendOnLoadingEnded();
|
//
|
||||||
|
// this.sendOnRowSaved();
|
||||||
if (shouldCloseLU) closeLU(false, null);
|
// this.sendOnLoadingEnded();
|
||||||
}, this::sendError);
|
//
|
||||||
}
|
// if (shouldCloseLU) closeLU(true, null);
|
||||||
|
// }, this::sendError);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -417,9 +420,11 @@ public class RettificaGiacenzeViewModel {
|
|||||||
|
|
||||||
if(shouldChangePosition) {
|
if(shouldChangePosition) {
|
||||||
this.savePosizione(mtbDepoPosizione, () -> {
|
this.savePosizione(mtbDepoPosizione, () -> {
|
||||||
|
this.mAnyEditDone = false;
|
||||||
postSaveBehaviour(onComplete);
|
postSaveBehaviour(onComplete);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
this.mAnyEditDone = false;
|
||||||
postSaveBehaviour(onComplete);
|
postSaveBehaviour(onComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -427,7 +432,7 @@ public class RettificaGiacenzeViewModel {
|
|||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!UtilityString.isNullOrEmpty(mDefaultCausale) && saveCausale) {
|
if (!UtilityString.isNullOrEmpty(mDefaultCausale) && (saveCausale || mAnyEditDone)) {
|
||||||
this.saveCausaleRettificaGiacenze(saveAction);
|
this.saveCausaleRettificaGiacenze(saveAction);
|
||||||
} else {
|
} else {
|
||||||
saveAction.run();
|
saveAction.run();
|
||||||
@@ -548,7 +553,7 @@ public class RettificaGiacenzeViewModel {
|
|||||||
private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
if(!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
// if(!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
||||||
|
|
||||||
this.mColliMagazzinoRESTConsumer.creaRettificaCollo(
|
this.mColliMagazzinoRESTConsumer.creaRettificaCollo(
|
||||||
mtbColrToUpdate,
|
mtbColrToUpdate,
|
||||||
@@ -564,49 +569,53 @@ public class RettificaGiacenzeViewModel {
|
|||||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
|
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
|
||||||
this.mCurrentMtbColt.getMtbColr().add(mtbColrToUpdate);
|
this.mCurrentMtbColt.getMtbColr().add(mtbColrToUpdate);
|
||||||
|
|
||||||
|
this.mAnyEditDone = true;
|
||||||
|
|
||||||
this.sendOnRowSaved();
|
this.sendOnRowSaved();
|
||||||
},
|
},
|
||||||
this::sendError
|
this::sendError
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
// } else {
|
||||||
|
//
|
||||||
MtbColt mtbColt = new MtbColt()
|
// MtbColt mtbColt = new MtbColt()
|
||||||
.setNumCollo(mtbColrToUpdate.getNumCollo())
|
// .setNumCollo(mtbColrToUpdate.getNumCollo())
|
||||||
.setDataCollo(mtbColrToUpdate.getDataColloS())
|
// .setDataCollo(mtbColrToUpdate.getDataColloS())
|
||||||
.setSerCollo(mtbColrToUpdate.getSerCollo())
|
// .setSerCollo(mtbColrToUpdate.getSerCollo())
|
||||||
.setGestione(mtbColrToUpdate.getGestione())
|
// .setGestione(mtbColrToUpdate.getGestione())
|
||||||
.setMtbColr(new ObservableArrayList<>());
|
// .setMtbColr(new ObservableArrayList<>());
|
||||||
mtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
// mtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||||
|
//
|
||||||
final MtbColr mtbColr = (MtbColr) mtbColrToUpdate.clone();
|
// final MtbColr mtbColr = (MtbColr) mtbColrToUpdate.clone();
|
||||||
mtbColr
|
// mtbColr
|
||||||
.setNumCnf(numCnf.subtract(mtbColr.getNumCnf()))
|
// .setNumCnf(numCnf.subtract(mtbColr.getNumCnf()))
|
||||||
.setQtaCnf(qtaCnf)
|
// .setQtaCnf(qtaCnf)
|
||||||
.setQtaCol(qtaTot.subtract(mtbColr.getQtaCol()))
|
// .setQtaCol(qtaTot.subtract(mtbColr.getQtaCol()))
|
||||||
.setPartitaMag(partitaMag)
|
// .setPartitaMag(partitaMag)
|
||||||
.setDataScadPartita(dataScad)
|
// .setDataScadPartita(dataScad)
|
||||||
.setUtente(SettingsManager.i().getUser().getFullname())
|
// .setUtente(SettingsManager.i().getUser().getFullname())
|
||||||
.setCausale(MtbColr.Causale.RETTIFICA)
|
// .setCausale(MtbColr.Causale.RETTIFICA)
|
||||||
.setDatetimeRow(UtilityDate.getDateInstance())
|
// .setDatetimeRow(UtilityDate.getDateInstance())
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
// .setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
//
|
||||||
mtbColt.getMtbColr().add(mtbColr);
|
// mtbColt.getMtbColr().add(mtbColr);
|
||||||
|
//
|
||||||
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
// this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
||||||
|
//
|
||||||
mtbColr.setNumCnf(numCnf)
|
// mtbColr.setNumCnf(numCnf)
|
||||||
.setQtaCnf(qtaCnf)
|
// .setQtaCnf(qtaCnf)
|
||||||
.setQtaCol(qtaTot);
|
// .setQtaCol(qtaTot);
|
||||||
|
//
|
||||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
|
// this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
|
||||||
this.mCurrentMtbColt.getMtbColr().add(mtbColr);
|
// this.mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
//
|
||||||
this.sendOnRowSaved();
|
// this.mAnyEditDone = true;
|
||||||
this.sendOnLoadingEnded();
|
//
|
||||||
|
// this.sendOnRowSaved();
|
||||||
}, this::sendError);
|
// this.sendOnLoadingEnded();
|
||||||
}
|
//
|
||||||
|
// }, this::sendError);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteRow(MtbColr mtbColrToDelete) {
|
public void deleteRow(MtbColr mtbColrToDelete) {
|
||||||
@@ -614,7 +623,7 @@ public class RettificaGiacenzeViewModel {
|
|||||||
if (shouldDelete) {
|
if (shouldDelete) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
if(!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
// if(!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
||||||
this.mColliMagazzinoRESTConsumer.creaRettificaCollo(
|
this.mColliMagazzinoRESTConsumer.creaRettificaCollo(
|
||||||
mtbColrToDelete,
|
mtbColrToDelete,
|
||||||
BigDecimal.ZERO,
|
BigDecimal.ZERO,
|
||||||
@@ -626,37 +635,37 @@ public class RettificaGiacenzeViewModel {
|
|||||||
},
|
},
|
||||||
this::sendError
|
this::sendError
|
||||||
);
|
);
|
||||||
} else {
|
// } else {
|
||||||
MtbColt mtbColt = new MtbColt()
|
// MtbColt mtbColt = new MtbColt()
|
||||||
.setNumCollo(mtbColrToDelete.getNumCollo())
|
// .setNumCollo(mtbColrToDelete.getNumCollo())
|
||||||
.setDataCollo(mtbColrToDelete.getDataColloS())
|
// .setDataCollo(mtbColrToDelete.getDataColloS())
|
||||||
.setSerCollo(mtbColrToDelete.getSerCollo())
|
// .setSerCollo(mtbColrToDelete.getSerCollo())
|
||||||
.setGestione(mtbColrToDelete.getGestione())
|
// .setGestione(mtbColrToDelete.getGestione())
|
||||||
.setMtbColr(new ObservableArrayList<>());
|
// .setMtbColr(new ObservableArrayList<>());
|
||||||
mtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
// mtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||||
|
//
|
||||||
MtbColr mtbColr = (MtbColr) mtbColrToDelete.clone();
|
// MtbColr mtbColr = (MtbColr) mtbColrToDelete.clone();
|
||||||
mtbColr
|
// mtbColr
|
||||||
.setNumCnf(mtbColr.getNumCnf().multiply(new BigDecimal(-1)))
|
// .setNumCnf(mtbColr.getNumCnf().multiply(new BigDecimal(-1)))
|
||||||
.setQtaCnf(mtbColr.getQtaCnf())
|
// .setQtaCnf(mtbColr.getQtaCnf())
|
||||||
.setQtaCol(mtbColr.getQtaCol().multiply(new BigDecimal(-1)))
|
// .setQtaCol(mtbColr.getQtaCol().multiply(new BigDecimal(-1)))
|
||||||
.setPartitaMag(mtbColr.getPartitaMag())
|
// .setPartitaMag(mtbColr.getPartitaMag())
|
||||||
.setDataScadPartita(mtbColr.getDataScadPartitaD())
|
// .setDataScadPartita(mtbColr.getDataScadPartitaD())
|
||||||
.setUtente(SettingsManager.i().getUser().getFullname())
|
// .setUtente(SettingsManager.i().getUser().getFullname())
|
||||||
.setCausale(MtbColr.Causale.RETTIFICA)
|
// .setCausale(MtbColr.Causale.RETTIFICA)
|
||||||
.setDatetimeRow(UtilityDate.getDateInstance())
|
// .setDatetimeRow(UtilityDate.getDateInstance())
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
// .setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
//
|
||||||
mtbColt.getMtbColr().add(mtbColr);
|
// mtbColt.getMtbColr().add(mtbColr);
|
||||||
|
//
|
||||||
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
// this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
||||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToDelete);
|
// this.mCurrentMtbColt.getMtbColr().remove(mtbColrToDelete);
|
||||||
|
//
|
||||||
this.sendOnRowSaved();
|
// this.sendOnRowSaved();
|
||||||
this.sendOnLoadingEnded();
|
// this.sendOnLoadingEnded();
|
||||||
|
//
|
||||||
}, this::sendError);
|
// }, this::sendError);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
public BindableBoolean noItemsToPick = new BindableBoolean(false);
|
public BindableBoolean noItemsToPick = new BindableBoolean(false);
|
||||||
public BindableBoolean noLUPresent = new BindableBoolean(true);
|
public BindableBoolean noLUPresent = new BindableBoolean(true);
|
||||||
public BindableBoolean bottomSheetEnabled = new BindableBoolean(false);
|
public BindableBoolean bottomSheetEnabled = new BindableBoolean(false);
|
||||||
|
public BindableBoolean closeOrderButtonEnabled = new BindableBoolean(false);
|
||||||
|
|
||||||
private boolean mEnableGiacenza;
|
private boolean mEnableGiacenza;
|
||||||
private boolean mFlagShowCodForn;
|
private boolean mFlagShowCodForn;
|
||||||
@@ -150,6 +151,10 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
this.initRecyclerView();
|
this.initRecyclerView();
|
||||||
|
|
||||||
|
|
||||||
|
String reportNameSpedizioneChiudiOrdine = SettingsManager.iDB().getReportNameSpedizionChiudiOrdine();
|
||||||
|
closeOrderButtonEnabled.set(!UtilityString.isNullOrEmpty(reportNameSpedizioneChiudiOrdine));
|
||||||
|
|
||||||
|
|
||||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
mEnableGiacenza = !SettingsManager.iDB().isFlagSpedizioneEnableFakeGiacenza();
|
mEnableGiacenza = !SettingsManager.iDB().isFlagSpedizioneEnableFakeGiacenza();
|
||||||
boolean enableCheckPartitaMag = SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV();
|
boolean enableCheckPartitaMag = SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV();
|
||||||
@@ -157,7 +162,16 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
boolean shouldAskPesoLU = SettingsManager.iDB().isFlagAskPesoColloSpedizione();
|
boolean shouldAskPesoLU = SettingsManager.iDB().isFlagAskPesoColloSpedizione();
|
||||||
|
|
||||||
if (mEnableGiacenza) this.openProgress();
|
if (mEnableGiacenza) this.openProgress();
|
||||||
mViewmodel.init(codMdep, mEnableGiacenza, enableCheckPartitaMag, shouldAskPesoLU, canOverflowOrderQuantity, mSitArtOrd, mTestateOrdini, mColliRegistrati);
|
mViewmodel.init(
|
||||||
|
codMdep,
|
||||||
|
mEnableGiacenza,
|
||||||
|
enableCheckPartitaMag,
|
||||||
|
shouldAskPesoLU,
|
||||||
|
canOverflowOrderQuantity,
|
||||||
|
mSitArtOrd,
|
||||||
|
mTestateOrdini,
|
||||||
|
mColliRegistrati,
|
||||||
|
reportNameSpedizioneChiudiOrdine);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -204,9 +218,9 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
this.mBindings.spedizionePickingList.setAdapter(spedizioneListAdapter);
|
this.mBindings.spedizionePickingList.setAdapter(spedizioneListAdapter);
|
||||||
this.mBindings.spedizionePickingList.setLayoutManager(new LinearLayoutManager(this));
|
this.mBindings.spedizionePickingList.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
spedizioneListAdapter.setOnItemClicked((clickedItem) -> {
|
spedizioneListAdapter.setOnItemClicked((clickedItem, refMtbColt) -> {
|
||||||
if (!noLUPresent.get() && SettingsManager.iDB().isFlagSpedizioneEnableManualPick() && clickedItem.getSitArtOrdDTO().isFlagEnablePickManuale()) {
|
if (!noLUPresent.get() && SettingsManager.iDB().isFlagSpedizioneEnableManualPick() && clickedItem.getSitArtOrdDTO().isFlagEnablePickManuale()) {
|
||||||
this.mViewmodel.dispatchOrdineRow(clickedItem, clickedItem.getRefMtbColt());
|
this.mViewmodel.dispatchOrdineRow(clickedItem, refMtbColt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -606,6 +620,12 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void closeOrder() {
|
||||||
|
this.mBindings.spedizioneFab.close(true);
|
||||||
|
|
||||||
|
this.mViewmodel.closeOrder();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoadingStarted() {
|
public void onLoadingStarted() {
|
||||||
this.openProgress();
|
this.openProgress();
|
||||||
@@ -620,6 +640,8 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
public void onLUOpened(MtbColt mtbColt) {
|
public void onLUOpened(MtbColt mtbColt) {
|
||||||
this.addExtraItemsEnabled.set(SettingsManager.iDB().isFlagCanAddExtraItemSpedizione());
|
this.addExtraItemsEnabled.set(SettingsManager.iDB().isFlagCanAddExtraItemSpedizione());
|
||||||
noLUPresent.set(false);
|
noLUPresent.set(false);
|
||||||
|
closeOrderButtonEnabled.set(false);
|
||||||
|
|
||||||
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||||
|
|
||||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt);
|
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt);
|
||||||
@@ -630,6 +652,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
this.addExtraItemsEnabled.set(false);
|
this.addExtraItemsEnabled.set(false);
|
||||||
noLUPresent.set(true);
|
noLUPresent.set(true);
|
||||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
||||||
|
closeOrderButtonEnabled.set(!UtilityString.isNullOrEmpty(SettingsManager.iDB().getReportNameSpedizionChiudiOrdine()));
|
||||||
|
|
||||||
if (this.mShouldCloseActivity) super.onBackPressed();
|
if (this.mShouldCloseActivity) super.onBackPressed();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -91,6 +92,7 @@ public class SpedizioneViewModel {
|
|||||||
private boolean mEnableCheckPartitaMag;
|
private boolean mEnableCheckPartitaMag;
|
||||||
private boolean mCanOverflowOrderQuantity;
|
private boolean mCanOverflowOrderQuantity;
|
||||||
private boolean mShouldAskPesoLU;
|
private boolean mShouldAskPesoLU;
|
||||||
|
private String mReportNameSpedizioneChiudiOrdine;
|
||||||
|
|
||||||
private MtbColt mCurrentMtbColt = null;
|
private MtbColt mCurrentMtbColt = null;
|
||||||
|
|
||||||
@@ -125,7 +127,8 @@ public class SpedizioneViewModel {
|
|||||||
boolean canOverflowOrderQuantity,
|
boolean canOverflowOrderQuantity,
|
||||||
List<SitArtOrdDTO> pickingList,
|
List<SitArtOrdDTO> pickingList,
|
||||||
List<OrdineVenditaInevasoDTO> testateOrdini,
|
List<OrdineVenditaInevasoDTO> testateOrdini,
|
||||||
List<MtbColt> colliRegistrati) {
|
List<MtbColt> colliRegistrati,
|
||||||
|
String reportNameSpedizioneChiudiOrdine) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
this.mDefaultCodMdep = codMdep;
|
this.mDefaultCodMdep = codMdep;
|
||||||
@@ -135,6 +138,7 @@ public class SpedizioneViewModel {
|
|||||||
this.mEnableCheckPartitaMag = enableCheckPartitaMag;
|
this.mEnableCheckPartitaMag = enableCheckPartitaMag;
|
||||||
this.mCanOverflowOrderQuantity = canOverflowOrderQuantity;
|
this.mCanOverflowOrderQuantity = canOverflowOrderQuantity;
|
||||||
this.mShouldAskPesoLU = shouldAskPesoLU;
|
this.mShouldAskPesoLU = shouldAskPesoLU;
|
||||||
|
this.mReportNameSpedizioneChiudiOrdine = reportNameSpedizioneChiudiOrdine;
|
||||||
|
|
||||||
if (enableGiacenza) {
|
if (enableGiacenza) {
|
||||||
mOrdiniRestConsumerService.getSuggestedPickingList(this.mDefaultCodMdep, pickingList, pickingObjectList -> {
|
mOrdiniRestConsumerService.getSuggestedPickingList(this.mDefaultCodMdep, pickingList, pickingObjectList -> {
|
||||||
@@ -588,7 +592,7 @@ public class SpedizioneViewModel {
|
|||||||
if (UtilityString.equalsIgnoreCase(x.getCodMart(), pickingObject.getSitArtOrdDTO().getCodMart()) &&
|
if (UtilityString.equalsIgnoreCase(x.getCodMart(), pickingObject.getSitArtOrdDTO().getCodMart()) &&
|
||||||
UtilityString.equalsIgnoreCase(x.getCodTagl(), pickingObject.getSitArtOrdDTO().getCodTagl()) &&
|
UtilityString.equalsIgnoreCase(x.getCodTagl(), pickingObject.getSitArtOrdDTO().getCodTagl()) &&
|
||||||
UtilityString.equalsIgnoreCase(x.getCodCol(), pickingObject.getSitArtOrdDTO().getCodCol()) &&
|
UtilityString.equalsIgnoreCase(x.getCodCol(), pickingObject.getSitArtOrdDTO().getCodCol()) &&
|
||||||
(!mEnableCheckPartitaMag || UtilityString.equalsIgnoreCase(x.getPartitaMag(), pickingObject.getSitArtOrdDTO().getPartitaMag()))) {
|
(!mEnableCheckPartitaMag || UtilityString.equalsIgnoreCase(x.getPartitaMag(), pickingObject.getSitArtOrdDTO().getPartitaMag()) || UtilityString.isNullOrEmpty(pickingObject.getSitArtOrdDTO().getPartitaMag()))) {
|
||||||
|
|
||||||
if (!matchPickingObject.contains(pickingObject)) {
|
if (!matchPickingObject.contains(pickingObject)) {
|
||||||
matchPickingObject.add(pickingObject);
|
matchPickingObject.add(pickingObject);
|
||||||
@@ -648,7 +652,23 @@ public class SpedizioneViewModel {
|
|||||||
if (matchedRows == null || matchedRows.size() == 0) {
|
if (matchedRows == null || matchedRows.size() == 0) {
|
||||||
this.sendError(new NoArtsFoundException());
|
this.sendError(new NoArtsFoundException());
|
||||||
} else if (matchedRows.size() == 1) {
|
} else if (matchedRows.size() == 1) {
|
||||||
this.dispatchOrdineRow(matchedRows.get(0), matchedRows.get(0).getRefMtbColt());
|
PickingObjectDTO matchedItem = matchedRows.get(0);
|
||||||
|
|
||||||
|
|
||||||
|
if (matchedItem.getMtbColts() != null && matchedItem.getMtbColts().size() > 1) {
|
||||||
|
|
||||||
|
List<PickingObjectDTO> pickingList = mPickingList.getValue();
|
||||||
|
|
||||||
|
Stream.of(pickingList)
|
||||||
|
.filter(x -> x != matchedItem)
|
||||||
|
.forEach(x -> x.setHidden(true));
|
||||||
|
|
||||||
|
this.sendFilterApplied(null);
|
||||||
|
this.getPickingList().postValue(pickingList);
|
||||||
|
} else {
|
||||||
|
this.dispatchOrdineRow(matchedItem, matchedItem.getRefMtbColt());
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
List<PickingObjectDTO> pickingList = mPickingList.getValue();
|
List<PickingObjectDTO> pickingList = mPickingList.getValue();
|
||||||
|
|
||||||
@@ -701,28 +721,47 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
|
|
||||||
//TODO: Al posto di prelevare la prima riga bisognerebbe controllare se c'è ne una che corrisponde con la partita richiesta
|
//TODO: Al posto di prelevare la prima riga bisognerebbe controllare se c'è ne una che corrisponde con la partita richiesta
|
||||||
MtbColr mtbColrToDispatch = pickingObjectDTO.getTempPickData() != null &&
|
MtbColr scannedMtbColr = pickingObjectDTO.getTempPickData() != null &&
|
||||||
pickingObjectDTO.getTempPickData().getSourceMtbColt() != null &&
|
pickingObjectDTO.getTempPickData().getSourceMtbColt() != null &&
|
||||||
pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr() != null &&
|
pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr() != null &&
|
||||||
pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().size() > 0 ?
|
pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().size() > 0 ?
|
||||||
pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().get(0) : null;
|
pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().get(0) : null;
|
||||||
|
|
||||||
|
|
||||||
if (mtbColrToDispatch != null) {
|
if (refMtbColt == null && pickingObjectDTO.getMtbColts() != null && pickingObjectDTO.getMtbColts().size() == 1) {
|
||||||
if (UtilityBigDecimal.lowerThan(mtbColrToDispatch.getQtaCol(), qtaDaEvadere) || UtilityBigDecimal.equalsTo(mtbColrToDispatch.getQtaCol(), qtaDaEvadere)) {
|
refMtbColt = pickingObjectDTO.getMtbColts().get(0);
|
||||||
numCnfDaPrelevare = mtbColrToDispatch.getNumCnf();
|
}
|
||||||
qtaColDaPrelevare = mtbColrToDispatch.getQtaCol();
|
|
||||||
|
MtbColr refMtbColr = null;
|
||||||
|
|
||||||
|
if (scannedMtbColr != null && refMtbColt != null && refMtbColt.getMtbColr().size() > 0) {
|
||||||
|
Optional<MtbColr> optionalMtbColr = Stream.of(refMtbColt.getMtbColr())
|
||||||
|
.filter(y -> UtilityString.equalsIgnoreCase(y.getCodMart(), scannedMtbColr.getCodMart()) &&
|
||||||
|
UtilityString.equalsIgnoreCase(y.getCodTagl(), scannedMtbColr.getCodTagl()) &&
|
||||||
|
UtilityString.equalsIgnoreCase(y.getCodCol(), scannedMtbColr.getCodCol()) &&
|
||||||
|
(!mEnableCheckPartitaMag || UtilityString.equalsIgnoreCase(y.getPartitaMag(), scannedMtbColr.getPartitaMag()) || UtilityString.isNullOrEmpty(scannedMtbColr.getPartitaMag())))
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
if (optionalMtbColr.isPresent()) refMtbColr = optionalMtbColr.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
MtbColr mtbColrToUse = refMtbColr != null ? refMtbColr : scannedMtbColr;
|
||||||
|
|
||||||
|
if (mtbColrToUse != null) {
|
||||||
|
if (UtilityBigDecimal.equalsOrLowerThan(mtbColrToUse.getQtaCol(), qtaDaEvadere)) {
|
||||||
|
numCnfDaPrelevare = mtbColrToUse.getNumCnf();
|
||||||
|
qtaColDaPrelevare = mtbColrToUse.getQtaCol();
|
||||||
} else {
|
} else {
|
||||||
numCnfDaPrelevare = numCnfDaEvadere;
|
numCnfDaPrelevare = numCnfDaEvadere;
|
||||||
qtaColDaPrelevare = qtaDaEvadere;
|
qtaColDaPrelevare = qtaDaEvadere;
|
||||||
}
|
}
|
||||||
|
|
||||||
qtaCnfDaPrelevare = mtbColrToDispatch.getQtaCnf();
|
qtaCnfDaPrelevare = mtbColrToUse.getQtaCnf();
|
||||||
|
|
||||||
|
|
||||||
totalQtaAvailable = mtbColrToDispatch.getQtaCol();
|
totalQtaAvailable = mtbColrToUse.getQtaCol();
|
||||||
totalNumCnfAvailable = mtbColrToDispatch.getNumCnf();
|
totalNumCnfAvailable = mtbColrToUse.getNumCnf();
|
||||||
qtaCnfAvailable = mtbColrToDispatch.getQtaCnf();
|
qtaCnfAvailable = mtbColrToUse.getQtaCnf();
|
||||||
|
|
||||||
|
|
||||||
if (UtilityBigDecimal.lowerThan(numCnfDaPrelevare, BigDecimal.ZERO))
|
if (UtilityBigDecimal.lowerThan(numCnfDaPrelevare, BigDecimal.ZERO))
|
||||||
@@ -731,8 +770,8 @@ public class SpedizioneViewModel {
|
|||||||
if (UtilityBigDecimal.lowerThan(qtaColDaPrelevare, BigDecimal.ZERO))
|
if (UtilityBigDecimal.lowerThan(qtaColDaPrelevare, BigDecimal.ZERO))
|
||||||
qtaColDaPrelevare = BigDecimal.ZERO;
|
qtaColDaPrelevare = BigDecimal.ZERO;
|
||||||
|
|
||||||
partitaMag = mtbColrToDispatch.getPartitaMag();
|
partitaMag = scannedMtbColr.getPartitaMag();
|
||||||
dataScad = mtbColrToDispatch.getDataScadPartitaD();
|
dataScad = scannedMtbColr.getDataScadPartitaD();
|
||||||
|
|
||||||
} else if (pickingObjectDTO.getTempPickData() != null && pickingObjectDTO.getTempPickData().getManualPickDTO() != null) {
|
} else if (pickingObjectDTO.getTempPickData() != null && pickingObjectDTO.getTempPickData().getManualPickDTO() != null) {
|
||||||
//Oppure le info del barcode scansionato
|
//Oppure le info del barcode scansionato
|
||||||
@@ -779,10 +818,6 @@ public class SpedizioneViewModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(refMtbColt == null && pickingObjectDTO.getMtbColts().size() == 1) {
|
|
||||||
refMtbColt = pickingObjectDTO.getMtbColts().get(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
MtbColt finalRefMtbColt = refMtbColt;
|
MtbColt finalRefMtbColt = refMtbColt;
|
||||||
this.sendOnItemDispatched(
|
this.sendOnItemDispatched(
|
||||||
pickingObjectDTO,
|
pickingObjectDTO,
|
||||||
@@ -1185,7 +1220,23 @@ public class SpedizioneViewModel {
|
|||||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||||
|
|
||||||
mtbColr.setRefMtbColr(mtbColrToDispatch);
|
|
||||||
|
if (mEnableGiacenza) {
|
||||||
|
MtbColr refMtbColr = new MtbColr()
|
||||||
|
.setCodMart(mtbColr.getCodMart())
|
||||||
|
.setPartitaMag(mtbColr.getPartitaMag())
|
||||||
|
.setCodTagl(mtbColr.getCodTagl())
|
||||||
|
.setCodCol(mtbColr.getCodCol());
|
||||||
|
|
||||||
|
if(refMtbColt != null) {
|
||||||
|
refMtbColr
|
||||||
|
.setNumCollo(refMtbColt.getNumCollo())
|
||||||
|
.setDataCollo(refMtbColt.getDataColloS())
|
||||||
|
.setSerCollo(refMtbColt.getSerCollo())
|
||||||
|
.setGestione(refMtbColt.getGestione());
|
||||||
|
}
|
||||||
|
mtbColr.setRefMtbColr(refMtbColr);
|
||||||
|
}
|
||||||
|
|
||||||
pickingObjectDTO.getWithdrawMtbColrs().add(mtbColr);
|
pickingObjectDTO.getWithdrawMtbColrs().add(mtbColr);
|
||||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||||
@@ -1388,15 +1439,14 @@ public class SpedizioneViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum(), reportName -> {
|
String reportName = ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum());
|
||||||
|
|
||||||
this.mPrinterRESTConsumer.printCollo(
|
this.mPrinterRESTConsumer.printCollo(
|
||||||
printerName,
|
printerName,
|
||||||
mtbColtToPrint,
|
mtbColtToPrint,
|
||||||
1,
|
1,
|
||||||
reportName, onComplete, onFailed);
|
reportName, onComplete, onFailed);
|
||||||
|
|
||||||
}, onFailed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1404,6 +1454,8 @@ public class SpedizioneViewModel {
|
|||||||
this.mCurrentMtbColt = mtbColt;
|
this.mCurrentMtbColt = mtbColt;
|
||||||
mMtbColtSessionID = this.mColliDataRecoverService.startNewSession(mtbColt, mTestateOrdini);
|
mMtbColtSessionID = this.mColliDataRecoverService.startNewSession(mtbColt, mTestateOrdini);
|
||||||
|
|
||||||
|
this.mCurrentMtbColt.generaFiltroOrdineFromDTO(mDefaultFiltroOrdine);
|
||||||
|
|
||||||
this.resetMatchedRows();
|
this.resetMatchedRows();
|
||||||
this.sendLUOpened(this.mCurrentMtbColt);
|
this.sendLUOpened(this.mCurrentMtbColt);
|
||||||
}
|
}
|
||||||
@@ -1503,6 +1555,56 @@ public class SpedizioneViewModel {
|
|||||||
this.sendFilterRemoved();
|
this.sendFilterRemoved();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void closeOrder() {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
|
Runnable onComplete = () -> this.sendOnLoadingEnded();
|
||||||
|
|
||||||
|
this.mPrinterRESTConsumer.getAvailablePrinters(mDefaultCodMdep, PrinterRESTConsumer.Type.PRIMARIA, printerList -> {
|
||||||
|
|
||||||
|
if (printerList == null || printerList.size() == 0) {
|
||||||
|
this.sendError(new NoPrintersFoundException());
|
||||||
|
onComplete.run();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
cyclicPrintPackingList(
|
||||||
|
this.mTestateOrdini.iterator(),
|
||||||
|
printerList.get(0),
|
||||||
|
onComplete,
|
||||||
|
ex -> this.sendLUPrintError(ex, onComplete));
|
||||||
|
|
||||||
|
}, this::sendError);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cyclicPrintPackingList(@NotNull Iterator<OrdineVenditaInevasoDTO> sourceTestateOrdineVenditaIterator, String printerName, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||||
|
if (sourceTestateOrdineVenditaIterator.hasNext()) {
|
||||||
|
singlePrintPackingList(sourceTestateOrdineVenditaIterator.next(), printerName, () -> {
|
||||||
|
cyclicPrintPackingList(sourceTestateOrdineVenditaIterator, printerName, onComplete, onAbort);
|
||||||
|
}, onAbort);
|
||||||
|
} else {
|
||||||
|
onComplete.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void singlePrintPackingList(OrdineVenditaInevasoDTO ordineVenditaInevasoDTO, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
HashMap<String, Object> params = new HashMap<>();
|
||||||
|
params.put("gestione", ordineVenditaInevasoDTO.getGestione());
|
||||||
|
params.put("num_ord", ordineVenditaInevasoDTO.getNumOrd());
|
||||||
|
params.put("data_ord", UtilityDate.formatDate(ordineVenditaInevasoDTO.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_DASH));
|
||||||
|
|
||||||
|
this.mPrinterRESTConsumer.printReport(
|
||||||
|
printerName,
|
||||||
|
this.mReportNameSpedizioneChiudiOrdine,
|
||||||
|
params,
|
||||||
|
1,
|
||||||
|
onComplete,
|
||||||
|
onFailed);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public MutableLiveData<List<PickingObjectDTO>> getPickingList() {
|
public MutableLiveData<List<PickingObjectDTO>> getPickingList() {
|
||||||
return mPickingList;
|
return mPickingList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ import java.util.List;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.SpedizioneMainListGroupHeaderBinding;
|
import it.integry.integrywmsnative.databinding.SpedizioneMainListGroupHeaderBinding;
|
||||||
@@ -32,7 +33,7 @@ public class SpedizioneListAdapter extends SectionedRecyclerViewAdapter<Spedizio
|
|||||||
private Context mContext;
|
private Context mContext;
|
||||||
private final List<SpedizioneListModel> mDataset = new ArrayList<>();
|
private final List<SpedizioneListModel> mDataset = new ArrayList<>();
|
||||||
|
|
||||||
private RunnableArgs<PickingObjectDTO> mOnItemClicked;
|
private RunnableArgss<PickingObjectDTO, MtbColt> mOnItemClicked;
|
||||||
|
|
||||||
static class SubheaderHolder extends RecyclerView.ViewHolder {
|
static class SubheaderHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
@@ -70,7 +71,7 @@ public class SpedizioneListAdapter extends SectionedRecyclerViewAdapter<Spedizio
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOnItemClicked(RunnableArgs<PickingObjectDTO> onItemClicked) {
|
public void setOnItemClicked(RunnableArgss<PickingObjectDTO, MtbColt> onItemClicked) {
|
||||||
this.mOnItemClicked = onItemClicked;
|
this.mOnItemClicked = onItemClicked;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +139,7 @@ public class SpedizioneListAdapter extends SectionedRecyclerViewAdapter<Spedizio
|
|||||||
|
|
||||||
holder.mBinding.getRoot().setOnClickListener(v -> {
|
holder.mBinding.getRoot().setOnClickListener(v -> {
|
||||||
if (this.mOnItemClicked != null)
|
if (this.mOnItemClicked != null)
|
||||||
this.mOnItemClicked.run(pickingObjectDTO.getOriginalModel());
|
this.mOnItemClicked.run(pickingObjectDTO.getOriginalModel(), pickingObjectDTO.getSourceMtbColt());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,6 +137,10 @@ public class VersamentoMerceViewModel {
|
|||||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
progressDialog.dismiss();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
showTooMuchULFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
@@ -148,6 +152,12 @@ public class VersamentoMerceViewModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void showTooMuchULFound() {
|
||||||
|
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||||
|
new SpannableString(mContext.getResources().getText(R.string.too_much_lu_found_message_in_mono_lu)),
|
||||||
|
null, null).show();
|
||||||
|
}
|
||||||
|
|
||||||
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
||||||
BarcodeRESTConsumer.decodeEan128Static(barcodeScanDTO, ean128Model -> {
|
BarcodeRESTConsumer.decodeEan128Static(barcodeScanDTO, ean128Model -> {
|
||||||
|
|
||||||
|
|||||||
@@ -1,124 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.view.bottomsheet;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import com.google.android.material.appbar.AppBarLayout;
|
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.appcompat.widget.Toolbar;
|
|
||||||
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.RelativeLayout;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
|
||||||
import it.integry.integrywmsnative.databinding.FragmentArticoliInColloBottomSheetBinding;
|
|
||||||
|
|
||||||
|
|
||||||
public class ArticoliInColloBottomSheetHelper extends BottomSheetBehavior.BottomSheetCallback {
|
|
||||||
|
|
||||||
private AppCompatActivity mActivity;
|
|
||||||
private FragmentArticoliInColloBottomSheetBinding mBinding;
|
|
||||||
|
|
||||||
private BottomSheetBehavior mBottomSheetBehavior;
|
|
||||||
|
|
||||||
|
|
||||||
public ArticoliInColloBottomSheetHelper(AppCompatActivity context, FragmentArticoliInColloBottomSheetBinding binding){
|
|
||||||
mActivity = context;
|
|
||||||
mBinding = binding;
|
|
||||||
|
|
||||||
mBottomSheetBehavior = BottomSheetBehavior.from(mBinding.getRoot());
|
|
||||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
|
||||||
mBottomSheetBehavior.setBottomSheetCallback(this);
|
|
||||||
|
|
||||||
mBinding.appbarBottomSheet.setVisibility(View.INVISIBLE);
|
|
||||||
|
|
||||||
mBinding.toolbarBottomSheet.setNavigationIcon(R.drawable.ic_close_24dp);
|
|
||||||
mBinding.toolbarBottomSheet.setNavigationOnClickListener(view -> {
|
|
||||||
if(mBottomSheetBehavior.getState()==BottomSheetBehavior.STATE_EXPANDED) {
|
|
||||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mBinding.tapActionLayout.setOnClickListener(v -> {
|
|
||||||
if(mBottomSheetBehavior.getState()==BottomSheetBehavior.STATE_COLLAPSED) {
|
|
||||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
mBinding.articoliInColloCloseCollo.setText(mActivity.getText(R.string.action_close_ul));
|
|
||||||
updateRigheNumber(0);
|
|
||||||
|
|
||||||
mBinding.articoliInColloSheetButton.setOnClickListener(view -> {
|
|
||||||
if (mBottomSheetBehavior.getState() != BottomSheetBehavior.STATE_EXPANDED) {
|
|
||||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
|
||||||
} else {
|
|
||||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void initCollo(MtbColt mtbColt){
|
|
||||||
|
|
||||||
mBinding.articoliInColloTitle.setText(String.format(mActivity.getText(R.string.articoli_in_collo_sheet_title).toString(), mtbColt.getNumCollo()));
|
|
||||||
mBinding.articoliInColloDetailsDate.setText(mtbColt.getDataColloHumanLong());
|
|
||||||
|
|
||||||
|
|
||||||
mBinding.articoliInColloDetailsPosizione.setText(mtbColt.getPosizione() != null ? mtbColt.getPosizione() : "N/A");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateRigheNumber(int newRigheNumber){
|
|
||||||
mBinding.articoliInColloSheetButton.setText(newRigheNumber + " " + mActivity.getResources().getQuantityString(R.plurals.articles, newRigheNumber));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStateChanged(@NonNull View bottomSheet, int newState) {
|
|
||||||
switch (newState) {
|
|
||||||
case BottomSheetBehavior.STATE_HIDDEN:
|
|
||||||
// mRootView.scrollTo(0, 0);
|
|
||||||
break;
|
|
||||||
case BottomSheetBehavior.STATE_EXPANDED:
|
|
||||||
mBinding.appbarBottomSheet.setClickable(true);
|
|
||||||
mBinding.appbarBottomSheet.setFocusable(true);
|
|
||||||
mBinding.tapActionLayout.setClickable(false);
|
|
||||||
mBinding.tapActionLayout.setFocusable(false);
|
|
||||||
break;
|
|
||||||
case BottomSheetBehavior.STATE_COLLAPSED:
|
|
||||||
mBinding.appbarBottomSheet.setVisibility(View.INVISIBLE);
|
|
||||||
mBinding.appbarBottomSheet.setClickable(false);
|
|
||||||
mBinding.appbarBottomSheet.setFocusable(false);
|
|
||||||
mBinding.tapActionLayout.setClickable(true);
|
|
||||||
mBinding.tapActionLayout.setFocusable(true);
|
|
||||||
break;
|
|
||||||
case BottomSheetBehavior.STATE_DRAGGING:
|
|
||||||
mBinding.appbarBottomSheet.setVisibility(View.VISIBLE);
|
|
||||||
// mRootView.scrollTo(0, 0);
|
|
||||||
break;
|
|
||||||
case BottomSheetBehavior.STATE_SETTLING:
|
|
||||||
mBinding.appbarBottomSheet.setVisibility(View.VISIBLE);
|
|
||||||
// mRootView.scrollTo(0, 0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isExpanded() {
|
|
||||||
return mBottomSheetBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void expand() {
|
|
||||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void collapse() {
|
|
||||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
|
|
||||||
mBinding.appbarBottomSheet.setAlpha(slideOffset);
|
|
||||||
mBinding.tapActionLayout.setAlpha(1-slideOffset);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.view.bottomsheet.interfaces;
|
|
||||||
|
|
||||||
public interface IOnColloClosedCallback {
|
|
||||||
|
|
||||||
void onColloClosed(Runnable onComplete, boolean shouldPrint);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.view.bottomsheet.interfaces;
|
|
||||||
|
|
||||||
public interface IOnSimpleListChangedCallback {
|
|
||||||
|
|
||||||
void onChange();
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.view.bottomsheet.view;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.BaseAdapter;
|
|
||||||
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
|
||||||
import androidx.databinding.ObservableField;
|
|
||||||
import androidx.databinding.ObservableList;
|
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
|
||||||
import it.integry.integrywmsnative.core.expansion.WeakReferenceOnListChangedCallback;
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
|
||||||
import it.integry.integrywmsnative.databinding.FragmentArticoliInColloBottomSheetMtbcolrItemBinding;
|
|
||||||
|
|
||||||
public class ArticoliInColloBottomSheetMtbColrAdapter extends BaseAdapter {
|
|
||||||
|
|
||||||
|
|
||||||
private final WeakReferenceOnListChangedCallback onListChangedCallback;
|
|
||||||
private Context mContext;
|
|
||||||
private ObservableField<MtbColt> mtbColt;
|
|
||||||
|
|
||||||
|
|
||||||
public ArticoliInColloBottomSheetMtbColrAdapter(Context context, ObservableField<MtbColt> mtbColt) {
|
|
||||||
super();
|
|
||||||
this.mContext = context;
|
|
||||||
this.mtbColt = mtbColt;
|
|
||||||
this.onListChangedCallback = new WeakReferenceOnListChangedCallback(this);
|
|
||||||
|
|
||||||
this.mtbColt.get().getMtbColr().addOnListChangedCallback(onListChangedCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public View getView(int position, View convertView, ViewGroup parent) {
|
|
||||||
|
|
||||||
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
|
|
||||||
|
|
||||||
FragmentArticoliInColloBottomSheetMtbcolrItemBinding binding = DataBindingUtil.inflate(inflater, R.layout.fragment_articoli_in_collo_bottom_sheet__mtbcolr_item, parent, false);
|
|
||||||
|
|
||||||
final MtbColr mtbColr = mtbColt.get().getMtbColr().get(position);
|
|
||||||
binding.setMtbColr(mtbColr);
|
|
||||||
|
|
||||||
//Setting qty with unt_mis
|
|
||||||
if(!SettingsManager.iDB().isFlagForceAllToColli() && (mtbColr.getMtbAart() == null || mtbColr.getMtbAart().isFlagQtaCnfFissaBoolean())){
|
|
||||||
String text = UtilityNumber.decimalToString(mtbColr.getQtaCol());
|
|
||||||
|
|
||||||
|
|
||||||
if(mtbColr.getMtbAart() != null) {
|
|
||||||
text += !UtilityString.isNullOrEmpty(mtbColr.getMtbAart().getUntMis()) ? "\n" + mtbColr.getMtbAart().getUntMis() : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.qtaTextview.setText(text);
|
|
||||||
} else {
|
|
||||||
binding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getNumCnf()) + "\n" + UtilityResources.getString(R.string.unt_mis_col));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
binding.executePendingBindings();
|
|
||||||
|
|
||||||
if(position % 2 == 1) binding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBG));
|
|
||||||
|
|
||||||
return binding.getRoot();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getItemId(int position) {
|
|
||||||
return position;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object getItem(int position) {
|
|
||||||
return position;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getCount() {
|
|
||||||
if(mtbColt.get() != null && mtbColt.get().getMtbColr() != null) {
|
|
||||||
|
|
||||||
return mtbColt.get().getMtbColr().size();
|
|
||||||
} else return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,247 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.view.bottomsheet.viewmodel;
|
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import androidx.databinding.Observable;
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
|
||||||
import androidx.databinding.ObservableField;
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import android.text.SpannableString;
|
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
|
||||||
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
|
||||||
import it.integry.integrywmsnative.databinding.FragmentArticoliInColloBottomSheetBinding;
|
|
||||||
import it.integry.integrywmsnative.view.bottomsheet.ArticoliInColloBottomSheetHelper;
|
|
||||||
import it.integry.integrywmsnative.view.bottomsheet.interfaces.IOnColloClosedCallback;
|
|
||||||
import it.integry.integrywmsnative.view.bottomsheet.view.ArticoliInColloBottomSheetMtbColrAdapter;
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity;
|
|
||||||
|
|
||||||
public class ArticoliInColloBottomSheetViewModel {
|
|
||||||
|
|
||||||
public ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
|
||||||
|
|
||||||
private Context mContext;
|
|
||||||
private ArticoliInColloBottomSheetHelper mArticoliInColloBottomSheetHelper;
|
|
||||||
|
|
||||||
private IOnColloClosedCallback onCloseColloCallback;
|
|
||||||
|
|
||||||
|
|
||||||
private FragmentArticoliInColloBottomSheetBinding mBindings;
|
|
||||||
|
|
||||||
private BottomSheetBehavior mBottomSheetBehavior;
|
|
||||||
|
|
||||||
private RunnableArgs<MtbColr> mOnItemDeletedCallback;
|
|
||||||
private RunnableArgss<MtbColr, MtbColr> mOnItemEditedCallback;
|
|
||||||
|
|
||||||
|
|
||||||
public ArticoliInColloBottomSheetViewModel(AppCompatActivity context, final FragmentArticoliInColloBottomSheetBinding bindings){
|
|
||||||
mContext = context;
|
|
||||||
mBindings = bindings;
|
|
||||||
mArticoliInColloBottomSheetHelper = new ArticoliInColloBottomSheetHelper(context, mBindings);
|
|
||||||
|
|
||||||
mBindings.setViewModel(this);
|
|
||||||
|
|
||||||
mtbColt.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
|
||||||
@Override
|
|
||||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
|
||||||
|
|
||||||
if(mtbColt.get() != null) {
|
|
||||||
|
|
||||||
mBindings.linearListview.setAdapter(new ArticoliInColloBottomSheetMtbColrAdapter(mContext, mtbColt));
|
|
||||||
|
|
||||||
mBindings.linearListview.setOnItemClickListener((parent, view, position, id) -> {
|
|
||||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
|
||||||
|
|
||||||
onItemClicked.run(position);
|
|
||||||
});
|
|
||||||
|
|
||||||
mArticoliInColloBottomSheetHelper.updateRigheNumber(mtbColt.get().getMtbColr().size());
|
|
||||||
mArticoliInColloBottomSheetHelper.initCollo(mtbColt.get());
|
|
||||||
|
|
||||||
mtbColt.get().getMtbColr().addOnListChangedCallback(new SimpleListChangedCallback(() -> {
|
|
||||||
mArticoliInColloBottomSheetHelper.updateRigheNumber(mtbColt.get().getMtbColr().size());
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
initBottomSheetActions();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOnItemEditedCallback(RunnableArgss<MtbColr, MtbColr> onItemEditedCallback) {
|
|
||||||
this.mOnItemEditedCallback = onItemEditedCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOnItemDeletedCallback(RunnableArgs<MtbColr> onItemDeletedCallback) {
|
|
||||||
this.mOnItemDeletedCallback = onItemDeletedCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initBottomSheetActions() {
|
|
||||||
mBindings.bg.setOnClickListener(v -> mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED));
|
|
||||||
|
|
||||||
mBottomSheetBehavior = BottomSheetBehavior.from(mBindings.bottomSheetActions);
|
|
||||||
|
|
||||||
mBottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
|
|
||||||
@Override
|
|
||||||
public void onStateChanged(@NonNull View bottomSheet, int newState) {
|
|
||||||
if (newState == BottomSheetBehavior.STATE_COLLAPSED)
|
|
||||||
mBindings.bg.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
|
|
||||||
mBindings.bg.setVisibility(View.VISIBLE);
|
|
||||||
mBindings.bg.setAlpha(slideOffset);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOnCloseColloCallbackListener(final IOnColloClosedCallback onCloseColloCallback){
|
|
||||||
this.onCloseColloCallback = onCloseColloCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void closeCurrentUL(){
|
|
||||||
closeCurrentUL(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void closeCurrentUL(Runnable onComplete){
|
|
||||||
if(onCloseColloCallback != null) onCloseColloCallback.onColloClosed(onComplete, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isExpanded() {
|
|
||||||
return mArticoliInColloBottomSheetHelper.isExpanded();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void expand() {
|
|
||||||
mArticoliInColloBottomSheetHelper.expand();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void collapse() {
|
|
||||||
mArticoliInColloBottomSheetHelper.collapse();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private RunnableArgs<Integer> onItemClicked = (position) -> {
|
|
||||||
|
|
||||||
MtbColr clickedItem = mtbColt.get().getMtbColr().get(position);
|
|
||||||
|
|
||||||
mBindings.bottomSheetActionsTitle.setText(clickedItem.getDescrizione());
|
|
||||||
mBindings.bottomSheetActionsSubtitle.setText(clickedItem.getCodMart());
|
|
||||||
|
|
||||||
|
|
||||||
//Setting qty with unt_mis
|
|
||||||
if(clickedItem.getMtbAart() != null) {
|
|
||||||
if (clickedItem.getMtbAart().isFlagQtaCnfFissaBoolean()) {
|
|
||||||
mBindings.bottomSheetActionsQuantity.setText(UtilityNumber.decimalToString(clickedItem.getQtaCol()) + (!UtilityString.isNullOrEmpty(clickedItem.getMtbAart().getUntMis()) ? ("" + clickedItem.getMtbAart().getUntMis()) : ""));
|
|
||||||
} else {
|
|
||||||
mBindings.bottomSheetActionsQuantity.setText(UtilityNumber.decimalToString(clickedItem.getNumCnf()) + " " + mContext.getString(R.string.unt_mis_col));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
mBindings.bottomSheetActionsQuantity.setText(UtilityNumber.decimalToString(clickedItem.getQtaCol()));
|
|
||||||
}
|
|
||||||
|
|
||||||
mBindings.bottomSheetActionsEditBtn.setOnClickListener(v -> onItemEdit(position));
|
|
||||||
|
|
||||||
mBindings.bottomSheetActionsDeleteBtn.setOnClickListener(v -> onItemDelete(position));
|
|
||||||
};
|
|
||||||
|
|
||||||
private void onItemEdit(int position) {
|
|
||||||
|
|
||||||
MtbColr itemToEdit = mtbColt.get().getMtbColr().get(position);
|
|
||||||
MtbColr cloneItemToEdit = (MtbColr) itemToEdit.clone();
|
|
||||||
|
|
||||||
MtbColr originalItem = (MtbColr) itemToEdit.clone();
|
|
||||||
|
|
||||||
|
|
||||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
|
||||||
|
|
||||||
DialogInputQuantity.DTO dto = new DialogInputQuantity.DTO()
|
|
||||||
.setBatchLot(itemToEdit.getPartitaMag())
|
|
||||||
.setQtaDaEvadere(null)
|
|
||||||
.setQtaOrd(null)
|
|
||||||
.setMtbAart(itemToEdit.getMtbAart())
|
|
||||||
.setCanPartitaMagBeChanged(false)
|
|
||||||
.setQtaTot(itemToEdit.getQtaCol())
|
|
||||||
.setMaxQta(itemToEdit.getQtaCol());
|
|
||||||
|
|
||||||
DialogInputQuantity.makeBase(mContext, dto, false, quantityDTO -> {
|
|
||||||
|
|
||||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
|
||||||
|
|
||||||
|
|
||||||
cloneItemToEdit.setQtaCol(quantityDTO.qtaTot.getBigDecimal());
|
|
||||||
cloneItemToEdit.setNumCnf(quantityDTO.numCnf.getBigDecimal());
|
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.updateRigaStatic(cloneItemToEdit, () ->{
|
|
||||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
|
||||||
|
|
||||||
itemToEdit.setQtaCol(quantityDTO.qtaTot.getBigDecimal());
|
|
||||||
itemToEdit.setNumCnf(quantityDTO.numCnf.getBigDecimal());
|
|
||||||
|
|
||||||
progress.dismiss();
|
|
||||||
mtbColt.get().getMtbColr().set(position, itemToEdit);
|
|
||||||
|
|
||||||
if(mOnItemEditedCallback != null) mOnItemEditedCallback.run(originalItem, itemToEdit);
|
|
||||||
},
|
|
||||||
ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
|
||||||
|
|
||||||
}, null).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onItemDelete(int position) {
|
|
||||||
|
|
||||||
|
|
||||||
String text = mContext.getResources().getString(R.string.alert_delete_mtb_colr);
|
|
||||||
DialogSimpleMessageHelper.makeWarningDialog(mContext, new SpannableString(text), null, () -> {
|
|
||||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
|
||||||
|
|
||||||
MtbColt mtbColtClone = (MtbColt) mtbColt.get().clone();
|
|
||||||
mtbColtClone.setMtbColr(new ObservableArrayList<>());
|
|
||||||
mtbColtClone.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
|
||||||
|
|
||||||
MtbColr itemToDelete = (MtbColr) mtbColt.get().getMtbColr().get(position).clone();
|
|
||||||
itemToDelete.setQtaCol(itemToDelete.getQtaCol().multiply(new BigDecimal(-1)));
|
|
||||||
itemToDelete.setNumCnf(itemToDelete.getNumCnf().multiply(new BigDecimal(-1)));
|
|
||||||
itemToDelete.setRiga(null);
|
|
||||||
itemToDelete.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
|
||||||
|
|
||||||
mtbColtClone.getMtbColr().add(itemToDelete);
|
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColtClone, (newMtbColt) -> {
|
|
||||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
|
||||||
|
|
||||||
MtbColr deletedItem = mtbColt.get().getMtbColr().get(position);
|
|
||||||
mtbColt.get().getMtbColr().remove(deletedItem);
|
|
||||||
|
|
||||||
progress.dismiss();
|
|
||||||
|
|
||||||
if(this.mOnItemDeletedCallback != null) this.mOnItemDeletedCallback.run(deletedItem);
|
|
||||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
|
||||||
}, null).show();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.view.bottomsheet.viewmodel;
|
|
||||||
|
|
||||||
import androidx.databinding.ObservableList;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.view.bottomsheet.interfaces.IOnSimpleListChangedCallback;
|
|
||||||
|
|
||||||
public class SimpleListChangedCallback extends ObservableList.OnListChangedCallback {
|
|
||||||
|
|
||||||
private IOnSimpleListChangedCallback mOnSimpleListChangedCallback;
|
|
||||||
|
|
||||||
public SimpleListChangedCallback(IOnSimpleListChangedCallback onSimpleListChangedCallback) {
|
|
||||||
mOnSimpleListChangedCallback = onSimpleListChangedCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onChanged(ObservableList sender) {
|
|
||||||
mOnSimpleListChangedCallback.onChange();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemRangeChanged(ObservableList sender, int positionStart, int itemCount) {
|
|
||||||
mOnSimpleListChangedCallback.onChange();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemRangeInserted(ObservableList sender, int positionStart, int itemCount) {
|
|
||||||
mOnSimpleListChangedCallback.onChange();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemRangeMoved(ObservableList sender, int fromPosition, int toPosition, int itemCount) {
|
|
||||||
mOnSimpleListChangedCallback.onChange();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemRangeRemoved(ObservableList sender, int positionStart, int itemCount) {
|
|
||||||
mOnSimpleListChangedCallback.onChange();
|
|
||||||
mOnSimpleListChangedCallback.onChange();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -16,6 +16,7 @@ import com.google.android.material.textfield.TextInputLayout;
|
|||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityFocus;
|
import it.integry.integrywmsnative.core.utility.UtilityFocus;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityPosizione;
|
import it.integry.integrywmsnative.core.utility.UtilityPosizione;
|
||||||
|
|
||||||
@@ -55,6 +56,8 @@ public class DialogAskLivelloPosizione {
|
|||||||
mDialog.setCancelable(false);
|
mDialog.setCancelable(false);
|
||||||
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
|
||||||
|
UtilityDialog.setTo90PercentWidth(mContext, mDialog);
|
||||||
|
|
||||||
mDialog.setOnDismissListener(dialog -> {
|
mDialog.setOnDismissListener(dialog -> {
|
||||||
if(!completedFLow) onComplete.run(null);
|
if(!completedFLow) onComplete.run(null);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,11 +15,13 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgsss;
|
||||||
import it.integry.integrywmsnative.core.model.VtbDest;
|
import it.integry.integrywmsnative.core.model.VtbDest;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.DialogAskClienteBinding;
|
import it.integry.integrywmsnative.databinding.DialogAskClienteBinding;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteDestinatarioDTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page1ViewModel;
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page1ViewModel;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page2ViewModel;
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page2ViewModel;
|
||||||
|
|
||||||
@@ -32,11 +34,11 @@ public class DialogAskCliente {
|
|||||||
private DialogAskClienteBinding mBinding;
|
private DialogAskClienteBinding mBinding;
|
||||||
|
|
||||||
|
|
||||||
public static Dialog makeBase(final Context context, RunnableArgss<DialogConsts.Results, VtbDest> onComplete) {
|
public static Dialog makeBase(final Context context, RunnableArgsss<DialogConsts.Results, VtbDest, String> onComplete) {
|
||||||
return new DialogAskCliente(context, onComplete).mDialog;
|
return new DialogAskCliente(context, onComplete).mDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DialogAskCliente(Context context, RunnableArgss<DialogConsts.Results, VtbDest> onComplete) {
|
public DialogAskCliente(Context context, RunnableArgsss<DialogConsts.Results, VtbDest, String> onComplete) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
|
|
||||||
|
|
||||||
@@ -72,25 +74,33 @@ public class DialogAskCliente {
|
|||||||
|
|
||||||
viewModel1
|
viewModel1
|
||||||
.setOnConfirmClickListener(() -> {
|
.setOnConfirmClickListener(() -> {
|
||||||
|
String codAnag = viewModel1.getCurrentCliente();
|
||||||
|
|
||||||
viewModel2.setCodAnag(viewModel1.getCurrentCliente().getCodAnag());
|
if(UtilityString.isNullOrEmpty(codAnag)) {
|
||||||
|
mDialog.dismiss();
|
||||||
|
onComplete.run(DialogConsts.Results.YES, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
viewModel2.setCodAnag(codAnag);
|
||||||
|
|
||||||
mBinding.viewpager.setCurrentItem(mBinding.viewpager.getCurrentItem() + 1, true);
|
mBinding.viewpager.setCurrentItem(mBinding.viewpager.getCurrentItem() + 1, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
viewModel1.setOnAbortClickListener(() -> {
|
viewModel1.setOnAbortClickListener(() -> {
|
||||||
mDialog.dismiss();
|
mDialog.dismiss();
|
||||||
onComplete.run(DialogConsts.Results.ABORT, null);
|
onComplete.run(DialogConsts.Results.ABORT, null, null);
|
||||||
});
|
});
|
||||||
|
|
||||||
viewModel2.setOnConfirmClickListener(() -> {
|
viewModel2.setOnConfirmClickListener(() -> {
|
||||||
onComplete.run(DialogConsts.Results.YES, viewModel2.getCurrentDestinatario().toVtbDestModel());
|
DialogAskClienteDestinatarioDTO cliente = viewModel2.getCurrentDestinatario();
|
||||||
|
|
||||||
|
onComplete.run(DialogConsts.Results.YES, cliente != null ? cliente.toVtbDestModel() : null, viewModel1.getCurrentCommessa());
|
||||||
mDialog.dismiss();
|
mDialog.dismiss();
|
||||||
});
|
});
|
||||||
|
|
||||||
viewModel2.setOnAbortClickListener(() -> {
|
viewModel2.setOnAbortClickListener(() -> {
|
||||||
mDialog.dismiss();
|
mDialog.dismiss();
|
||||||
onComplete.run(DialogConsts.Results.ABORT, null);
|
onComplete.run(DialogConsts.Results.ABORT, null, null);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs.ask_cliente.dto;
|
package it.integry.integrywmsnative.view.dialogs.ask_cliente.dto;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class DialogAskClienteClienteDTO {
|
public class DialogAskClienteClienteDTO {
|
||||||
|
|
||||||
private String codAnag;
|
private String codAnag;
|
||||||
|
|
||||||
private String ragSoc;
|
private String ragSoc;
|
||||||
|
private ArrayList<String> codJcoms = new ArrayList<>();
|
||||||
|
|
||||||
public String getCodAnag() {
|
public String getCodAnag() {
|
||||||
return codAnag;
|
return codAnag;
|
||||||
@@ -24,6 +26,14 @@ public class DialogAskClienteClienteDTO {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getCodJcoms() {
|
||||||
|
return codJcoms;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogAskClienteClienteDTO setCodJcoms(ArrayList<String> codJcoms) {
|
||||||
|
this.codJcoms = codJcoms;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|||||||
@@ -2,18 +2,33 @@ package it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.widget.AutoCompleteTextView;
|
import android.widget.AutoCompleteTextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
import androidx.databinding.ObservableList;
|
||||||
import androidx.databinding.ViewDataBinding;
|
import androidx.databinding.ViewDataBinding;
|
||||||
|
|
||||||
|
import com.annimon.stream.Optional;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.tfb.fbtoast.FBToast;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ISimpleOperationCallback;
|
import it.integry.integrywmsnative.core.rest.consumers.ISimpleOperationCallback;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityHashMap;
|
||||||
import it.integry.integrywmsnative.databinding.DialogAskClientePage1Binding;
|
import it.integry.integrywmsnative.databinding.DialogAskClientePage1Binding;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteClienteDTO;
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteClienteDTO;
|
||||||
|
|
||||||
@@ -22,7 +37,10 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
private Context mContext;
|
private Context mContext;
|
||||||
private DialogAskClientePage1Binding mBinding;
|
private DialogAskClientePage1Binding mBinding;
|
||||||
|
|
||||||
private List<DialogAskClienteClienteDTO> availableClienti;
|
private int mBarcodeScannerInstanceID;
|
||||||
|
|
||||||
|
private ArrayList<DialogAskClienteClienteDTO> availableClienti;
|
||||||
|
private ObservableArrayList<String> codJcoms = new ObservableArrayList<>();
|
||||||
|
|
||||||
public DialogAskCliente_Page1ViewModel() {
|
public DialogAskCliente_Page1ViewModel() {
|
||||||
|
|
||||||
@@ -41,18 +59,43 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
@Override
|
@Override
|
||||||
public void onShow() {
|
public void onShow() {
|
||||||
|
|
||||||
String sql = "SELECT gtb_anag.cod_anag, rag_soc " +
|
String sql = "SELECT gtb_anag.cod_anag, rag_soc, jtb_comt.cod_jcom " +
|
||||||
"FROM gtb_anag " +
|
"FROM gtb_anag " +
|
||||||
|
"LEFT OUTER JOIN jtb_comt ON gtb_anag.cod_anag = jtb_comt.cod_anag " +
|
||||||
"INNER JOIN vtb_clie ON gtb_anag.cod_anag = vtb_clie.cod_anag " +
|
"INNER JOIN vtb_clie ON gtb_anag.cod_anag = vtb_clie.cod_anag " +
|
||||||
"WHERE vtb_clie.flag_stato = 'A' " +
|
"WHERE vtb_clie.flag_stato = 'A' " +
|
||||||
"ORDER BY rag_soc";
|
"ORDER BY rag_soc";
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<DialogAskClienteClienteDTO>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<HashMap<String, Object>>>() {
|
||||||
SystemRESTConsumer.processSqlStatic(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<DialogAskClienteClienteDTO>>() {
|
}.getType();
|
||||||
|
SystemRESTConsumer.processSqlStatic(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<HashMap<String, Object>>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(ArrayList<DialogAskClienteClienteDTO> value) {
|
public void onSuccess(ArrayList<HashMap<String, Object>> value) {
|
||||||
availableClienti = value;
|
|
||||||
initializeAdapter(value);
|
availableClienti = new ArrayList<>();
|
||||||
|
|
||||||
|
Stream.of(value)
|
||||||
|
.groupBy(x -> x.get("codAnag").toString() + " " + x.get("ragSoc").toString())
|
||||||
|
.forEach(x -> {
|
||||||
|
DialogAskClienteClienteDTO dialogAskClienteClienteDTO = new DialogAskClienteClienteDTO();
|
||||||
|
dialogAskClienteClienteDTO.setCodAnag(UtilityHashMap.getValueIfExists(x.getValue().get(0), "codAnag"));
|
||||||
|
dialogAskClienteClienteDTO.setRagSoc(UtilityHashMap.getValueIfExists(x.getValue().get(0), "ragSoc"));
|
||||||
|
|
||||||
|
for (HashMap<String, Object> group : x.getValue()) {
|
||||||
|
if (group.containsKey("codJcom")) {
|
||||||
|
dialogAskClienteClienteDTO.getCodJcoms().add(UtilityHashMap.getValueIfExists(group, "codJcom"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
availableClienti.add(dialogAskClienteClienteDTO);
|
||||||
|
});
|
||||||
|
|
||||||
|
initializeAdapter(availableClienti);
|
||||||
|
|
||||||
|
mBarcodeScannerInstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
|
.setOnScanSuccessfull(onScanSuccessful)
|
||||||
|
.setOnScanFailed(ex -> UtilityExceptions.defaultException(mContext, ex, false)));
|
||||||
|
BarcodeManager.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -66,9 +109,10 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
@Override
|
@Override
|
||||||
public void setOnConfirmClickListener(Runnable onConfirm) {
|
public void setOnConfirmClickListener(Runnable onConfirm) {
|
||||||
this.mBinding.buttonYes.setOnClickListener(v -> {
|
this.mBinding.buttonYes.setOnClickListener(v -> {
|
||||||
if(validateCliente()) {
|
if (validateCliente()) {
|
||||||
this.resetClienteError();
|
this.resetClienteError();
|
||||||
if(onConfirm != null) onConfirm.run();
|
BarcodeManager.removeCallback(mBarcodeScannerInstanceID);
|
||||||
|
if (onConfirm != null) onConfirm.run();
|
||||||
} else {
|
} else {
|
||||||
this.setClienteError(mContext.getResources().getText(R.string.not_valid_customer_error).toString());
|
this.setClienteError(mContext.getResources().getText(R.string.not_valid_customer_error).toString());
|
||||||
}
|
}
|
||||||
@@ -76,45 +120,127 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
|
||||||
|
String barcode = data.getStringValue();
|
||||||
|
|
||||||
|
DialogAskClienteClienteDTO resultCodAnag = searchBarcodeInCodAnag(barcode);
|
||||||
|
|
||||||
|
if (resultCodAnag != null) {
|
||||||
|
mBinding.dropdownCliente.setText(resultCodAnag.toString());
|
||||||
|
refreshCodJcoms(resultCodAnag);
|
||||||
|
} else {
|
||||||
|
DialogAskClienteClienteDTO resultCodJcom = searchBarcodeInCodJcom(barcode);
|
||||||
|
|
||||||
|
if(resultCodJcom != null) {
|
||||||
|
mBinding.dropdownCliente.setText(resultCodJcom.toString());
|
||||||
|
refreshCodJcoms(resultCodJcom);
|
||||||
|
mBinding.dropdownCommessa.setText(barcode);
|
||||||
|
} else {
|
||||||
|
FBToast.errorToast(mContext, "Nessun risultato trovato", Toast.LENGTH_LONG);
|
||||||
|
mBinding.dropdownCliente.setText("");
|
||||||
|
mBinding.dropdownCommessa.setText("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BarcodeManager.enable();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
private DialogAskClienteClienteDTO searchBarcodeInCodAnag(String barcode) {
|
||||||
|
List<DialogAskClienteClienteDTO> resultCodAnag = Stream.of(availableClienti)
|
||||||
|
.filter(x -> barcode.equalsIgnoreCase(x.getCodAnag()))
|
||||||
|
.toList();
|
||||||
|
if (resultCodAnag.size() > 0) {
|
||||||
|
return resultCodAnag.get(0);
|
||||||
|
} else return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private DialogAskClienteClienteDTO searchBarcodeInCodJcom(String barcode) {
|
||||||
|
List<DialogAskClienteClienteDTO> resultCodJcom = Stream.of(availableClienti)
|
||||||
|
.filter(x -> x.getCodJcoms().contains(barcode))
|
||||||
|
.toList();
|
||||||
|
if (resultCodJcom.size() > 0) {
|
||||||
|
return resultCodJcom.get(0);
|
||||||
|
} else return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOnAbortClickListener(Runnable onAbort) {
|
public void setOnAbortClickListener(Runnable onAbort) {
|
||||||
this.mBinding.buttonNo.setOnClickListener(v -> {
|
this.mBinding.buttonNo.setOnClickListener(v -> {
|
||||||
if(onAbort != null) onAbort.run();
|
if (onAbort != null) onAbort.run();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initializeAdapter(ArrayList<DialogAskClienteClienteDTO> items) {
|
private void initializeAdapter(ArrayList<DialogAskClienteClienteDTO> items) {
|
||||||
|
DialogAskCliente_Page1_Cliente_ArrayAdapter adapter = new DialogAskCliente_Page1_Cliente_ArrayAdapter(mContext, items);
|
||||||
|
|
||||||
DialogAskCliente_Page1_ArrayAdapter adapter = new DialogAskCliente_Page1_ArrayAdapter(mContext, items);
|
AutoCompleteTextView editTextDropdownCliente = mBinding.dropdownCliente;
|
||||||
|
editTextDropdownCliente.setThreshold(0);
|
||||||
|
editTextDropdownCliente.setAdapter(adapter);
|
||||||
|
editTextDropdownCliente.setOnItemClickListener((parent, view, position, id) -> {
|
||||||
|
refreshCodJcoms(items.get(position));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
AutoCompleteTextView editTextFilledExposedDropdown = mBinding.filledExposedDropdown;
|
DialogAskCliente_Page1_Commessa_ArrayAdapter commessaAdapter = new DialogAskCliente_Page1_Commessa_ArrayAdapter(mContext);
|
||||||
editTextFilledExposedDropdown.setThreshold(0);
|
|
||||||
editTextFilledExposedDropdown.setAdapter(adapter);
|
AutoCompleteTextView editTextDropdownCommessa = mBinding.dropdownCommessa;
|
||||||
|
editTextDropdownCommessa.setThreshold(0);
|
||||||
|
editTextDropdownCommessa.setAdapter(commessaAdapter);
|
||||||
|
|
||||||
|
codJcoms.addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onChanged(ObservableList sender) {
|
||||||
|
commessaAdapter.clear();
|
||||||
|
commessaAdapter.addAll(codJcoms);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshCodJcoms(DialogAskClienteClienteDTO item) {
|
||||||
|
codJcoms.clear();
|
||||||
|
codJcoms.addAll(item.getCodJcoms());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private boolean validateCliente() {
|
private boolean validateCliente() {
|
||||||
return getCurrentCliente() != null;
|
if(SettingsManager.iDB().isFlagAllowEmptyClienteInPickingLibero() && mBinding.inputCliente.getEditText().getText().toString().trim().length() == 0) {
|
||||||
|
return true;
|
||||||
|
} else return getCurrentCliente() != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DialogAskClienteClienteDTO getCurrentCliente() {
|
public String getCurrentCliente() {
|
||||||
for (DialogAskClienteClienteDTO cliente : availableClienti) {
|
Optional<DialogAskClienteClienteDTO> result = Stream.of(availableClienti)
|
||||||
if(cliente.getRagSoc().equalsIgnoreCase(mBinding.inputCliente.getEditText().getText().toString())) {
|
.filter(x -> x.getRagSoc().equalsIgnoreCase(mBinding.inputCliente.getEditText().getText().toString()))
|
||||||
return cliente;
|
.findFirst();
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
if(result.isPresent()) return result.get().getCodAnag();
|
||||||
|
else return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCurrentCommessa() {
|
||||||
|
String codAnag = getCurrentCliente();
|
||||||
|
Optional<ArrayList<String>> result = Stream.of(availableClienti)
|
||||||
|
.filter(x -> x.getCodAnag().equalsIgnoreCase(codAnag))
|
||||||
|
.map(DialogAskClienteClienteDTO::getCodJcoms)
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
if(result.isPresent() && Stream.of(result.get()).anyMatch(x -> x.equalsIgnoreCase(mBinding.inputCommessa.getEditText().getText().toString()))) {
|
||||||
|
return mBinding.inputCommessa.getEditText().getText().toString();
|
||||||
|
} else return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void setClienteError(String message){
|
private void setClienteError(String message) {
|
||||||
mBinding.inputCliente.setErrorEnabled(true);
|
mBinding.inputCliente.setErrorEnabled(true);
|
||||||
mBinding.inputCliente.setError(message);
|
mBinding.inputCliente.setError(message);
|
||||||
mBinding.inputCliente.setErrorIconDrawable(null);
|
mBinding.inputCliente.setErrorIconDrawable(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetClienteError() {
|
private void resetClienteError() {
|
||||||
mBinding.inputCliente.setError(null);
|
mBinding.inputCliente.setError(null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel;
|
package it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Movie;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -9,7 +8,6 @@ import android.widget.ArrayAdapter;
|
|||||||
import android.widget.Filter;
|
import android.widget.Filter;
|
||||||
import android.widget.Filterable;
|
import android.widget.Filterable;
|
||||||
|
|
||||||
import androidx.annotation.LayoutRes;
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.widget.AppCompatTextView;
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
@@ -20,7 +18,7 @@ import java.util.List;
|
|||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteClienteDTO;
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteClienteDTO;
|
||||||
|
|
||||||
public class DialogAskCliente_Page1_ArrayAdapter extends ArrayAdapter<DialogAskClienteClienteDTO> implements Filterable {
|
public class DialogAskCliente_Page1_Cliente_ArrayAdapter extends ArrayAdapter<DialogAskClienteClienteDTO> implements Filterable {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private List<DialogAskClienteClienteDTO> mDataset;
|
private List<DialogAskClienteClienteDTO> mDataset;
|
||||||
@@ -28,7 +26,7 @@ public class DialogAskCliente_Page1_ArrayAdapter extends ArrayAdapter<DialogAskC
|
|||||||
|
|
||||||
private ListFilter listFilter = new ListFilter();
|
private ListFilter listFilter = new ListFilter();
|
||||||
|
|
||||||
public DialogAskCliente_Page1_ArrayAdapter(@NonNull Context context, @NonNull ArrayList<DialogAskClienteClienteDTO> list) {
|
public DialogAskCliente_Page1_Cliente_ArrayAdapter(@NonNull Context context, @NonNull ArrayList<DialogAskClienteClienteDTO> list) {
|
||||||
super(context, 0 , list);
|
super(context, 0 , list);
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mDataset = list;
|
mDataset = list;
|
||||||
@@ -43,13 +41,13 @@ public class DialogAskCliente_Page1_ArrayAdapter extends ArrayAdapter<DialogAskC
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(position < mDataset.size()) {
|
if(position < mDataset.size()) {
|
||||||
|
|
||||||
AppCompatTextView textView = listItem.findViewById(R.id.text);
|
AppCompatTextView textView = listItem.findViewById(R.id.text);
|
||||||
|
|
||||||
textView.setText(mDataset.get(position).getRagSoc());
|
textView.setText(mDataset.get(position).getRagSoc());
|
||||||
|
|
||||||
return listItem;
|
return listItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Filter;
|
||||||
|
import android.widget.Filterable;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
|
||||||
|
public class DialogAskCliente_Page1_Commessa_ArrayAdapter extends ArrayAdapter<String> implements Filterable {
|
||||||
|
|
||||||
|
private Context mContext;
|
||||||
|
private List<String> mDataset = new ArrayList<>();
|
||||||
|
private List<String> mDatasetAllItems;
|
||||||
|
|
||||||
|
private DialogAskCliente_Page1_Commessa_ArrayAdapter.ListFilter listFilter = new DialogAskCliente_Page1_Commessa_ArrayAdapter.ListFilter();
|
||||||
|
|
||||||
|
public DialogAskCliente_Page1_Commessa_ArrayAdapter(@NonNull Context context) {
|
||||||
|
super(context, 0);
|
||||||
|
mContext = context;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||||
|
View listItem = convertView;
|
||||||
|
if(listItem == null) {
|
||||||
|
listItem = LayoutInflater.from(mContext).inflate(R.layout.dialog_ask_cliente__dropdown_item, parent, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(position < getCount()) {
|
||||||
|
AppCompatTextView textView = listItem.findViewById(R.id.text);
|
||||||
|
textView.setText(getItem(position));
|
||||||
|
return listItem;
|
||||||
|
}
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Filter getFilter() {
|
||||||
|
return listFilter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ListFilter extends Filter {
|
||||||
|
private Object lock = new Object();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected FilterResults performFiltering(CharSequence prefix) {
|
||||||
|
FilterResults results = new FilterResults();
|
||||||
|
if (mDatasetAllItems == null) {
|
||||||
|
synchronized (lock) {
|
||||||
|
mDatasetAllItems = new ArrayList<>(mDataset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prefix == null || prefix.length() == 0) {
|
||||||
|
synchronized (lock) {
|
||||||
|
results.values = mDatasetAllItems;
|
||||||
|
results.count = mDatasetAllItems.size();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
final String searchStrLowerCase = prefix.toString().toLowerCase();
|
||||||
|
|
||||||
|
ArrayList<String> matchValues = new ArrayList<>();
|
||||||
|
|
||||||
|
for (String dataItem : mDatasetAllItems) {
|
||||||
|
if (dataItem.toLowerCase().startsWith(searchStrLowerCase)) {
|
||||||
|
matchValues.add(dataItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
results.values = matchValues;
|
||||||
|
results.count = matchValues.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void publishResults(CharSequence constraint, FilterResults results) {
|
||||||
|
if (results.values != null) {
|
||||||
|
mDataset.clear();
|
||||||
|
mDataset.addAll((ArrayList<String>) results.values);
|
||||||
|
} else {
|
||||||
|
mDataset.clear();
|
||||||
|
}
|
||||||
|
if (results.count > 0) {
|
||||||
|
notifyDataSetChanged();
|
||||||
|
} else {
|
||||||
|
notifyDataSetInvalidated();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -24,6 +24,8 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
|||||||
private DialogAskClientePage2Binding mBinding;
|
private DialogAskClientePage2Binding mBinding;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
|
||||||
|
private Runnable mOnConfirm;
|
||||||
|
|
||||||
private List<DialogAskClienteDestinatarioDTO> availableDestinatari;
|
private List<DialogAskClienteDestinatarioDTO> availableDestinatari;
|
||||||
|
|
||||||
private String mCodAnag;
|
private String mCodAnag;
|
||||||
@@ -44,17 +46,22 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onShow() {
|
public void onShow() {
|
||||||
|
|
||||||
String sql = "SELECT cod_anag, cod_vdes, destinatario, indirizzo, cap, citta, prov, nazione " +
|
String sql = "SELECT cod_anag, cod_vdes, destinatario, indirizzo, cap, citta, prov, nazione " +
|
||||||
"FROM vtb_dest " +
|
"FROM vtb_dest " +
|
||||||
"WHERE cod_anag = " + UtilityDB.valueToString(mCodAnag);
|
"WHERE cod_anag = " + UtilityDB.valueToString(mCodAnag);
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<DialogAskClienteDestinatarioDTO>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<DialogAskClienteDestinatarioDTO>>() {
|
||||||
|
}.getType();
|
||||||
SystemRESTConsumer.processSqlStatic(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<DialogAskClienteDestinatarioDTO>>() {
|
SystemRESTConsumer.processSqlStatic(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<DialogAskClienteDestinatarioDTO>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(ArrayList<DialogAskClienteDestinatarioDTO> value) {
|
public void onSuccess(ArrayList<DialogAskClienteDestinatarioDTO> value) {
|
||||||
availableDestinatari = value;
|
availableDestinatari = value;
|
||||||
initializeAdapter(value);
|
initializeAdapter(value);
|
||||||
|
|
||||||
|
if(value == null || value.size() == 0) {
|
||||||
|
mOnConfirm.run();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -66,10 +73,11 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOnConfirmClickListener(Runnable onConfirm) {
|
public void setOnConfirmClickListener(Runnable onConfirm) {
|
||||||
|
this.mOnConfirm = onConfirm;
|
||||||
this.mBinding.buttonYes.setOnClickListener(v -> {
|
this.mBinding.buttonYes.setOnClickListener(v -> {
|
||||||
if(validateDestinatario()) {
|
if (validateDestinatario()) {
|
||||||
this.resetClienteError();
|
this.resetClienteError();
|
||||||
if(onConfirm != null) onConfirm.run();
|
if (onConfirm != null) onConfirm.run();
|
||||||
} else {
|
} else {
|
||||||
this.setClienteError(mContext.getResources().getText(R.string.not_valid_recipient_error).toString());
|
this.setClienteError(mContext.getResources().getText(R.string.not_valid_recipient_error).toString());
|
||||||
}
|
}
|
||||||
@@ -80,7 +88,7 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
|||||||
@Override
|
@Override
|
||||||
public void setOnAbortClickListener(Runnable onAbort) {
|
public void setOnAbortClickListener(Runnable onAbort) {
|
||||||
this.mBinding.buttonNo.setOnClickListener(v -> {
|
this.mBinding.buttonNo.setOnClickListener(v -> {
|
||||||
if(onAbort != null) onAbort.run();
|
if (onAbort != null) onAbort.run();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,12 +96,13 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
|||||||
this.mCodAnag = codAnag;
|
this.mCodAnag = codAnag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initializeAdapter(ArrayList<DialogAskClienteDestinatarioDTO> items) {
|
private void initializeAdapter(ArrayList<DialogAskClienteDestinatarioDTO> items) {
|
||||||
|
|
||||||
DialogAskCliente_Page2_ArrayAdapter adapter = new DialogAskCliente_Page2_ArrayAdapter(mContext, items);
|
DialogAskCliente_Page2_ArrayAdapter adapter = new DialogAskCliente_Page2_ArrayAdapter(mContext, items);
|
||||||
|
|
||||||
|
|
||||||
AutoCompleteTextView editTextFilledExposedDropdown = mBinding.filledExposedDropdown;
|
AutoCompleteTextView editTextFilledExposedDropdown = mBinding.dropdownDestinatario;
|
||||||
editTextFilledExposedDropdown.setThreshold(0);
|
editTextFilledExposedDropdown.setThreshold(0);
|
||||||
editTextFilledExposedDropdown.setAdapter(adapter);
|
editTextFilledExposedDropdown.setAdapter(adapter);
|
||||||
}
|
}
|
||||||
@@ -105,7 +114,7 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
|||||||
|
|
||||||
public DialogAskClienteDestinatarioDTO getCurrentDestinatario() {
|
public DialogAskClienteDestinatarioDTO getCurrentDestinatario() {
|
||||||
for (DialogAskClienteDestinatarioDTO destinatarioDTO : availableDestinatari) {
|
for (DialogAskClienteDestinatarioDTO destinatarioDTO : availableDestinatari) {
|
||||||
if(destinatarioDTO.toString().equalsIgnoreCase(mBinding.inputDestinatario.getEditText().getText().toString())) {
|
if (destinatarioDTO.toString().equalsIgnoreCase(mBinding.inputDestinatario.getEditText().getText().toString())) {
|
||||||
return destinatarioDTO;
|
return destinatarioDTO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -114,11 +123,12 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void setClienteError(String message){
|
private void setClienteError(String message) {
|
||||||
mBinding.inputDestinatario.setErrorEnabled(true);
|
mBinding.inputDestinatario.setErrorEnabled(true);
|
||||||
mBinding.inputDestinatario.setError(message);
|
mBinding.inputDestinatario.setError(message);
|
||||||
mBinding.inputDestinatario.setErrorIconDrawable(null);
|
mBinding.inputDestinatario.setErrorIconDrawable(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetClienteError() {
|
private void resetClienteError() {
|
||||||
mBinding.inputDestinatario.setError(null);
|
mBinding.inputDestinatario.setError(null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs.base;
|
package it.integry.integrywmsnative.view.dialogs.base;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
@@ -9,22 +8,20 @@ import android.graphics.Color;
|
|||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import androidx.annotation.StringRes;
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.appcompat.widget.AppCompatImageView;
|
|
||||||
|
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.StringRes;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.databinding.DialogBaseBinding;
|
import it.integry.integrywmsnative.databinding.DialogBaseBinding;
|
||||||
|
|
||||||
@@ -41,9 +38,11 @@ public class DialogSimpleMessageHelper {
|
|||||||
ERROR(4);
|
ERROR(4);
|
||||||
|
|
||||||
private int value;
|
private int value;
|
||||||
|
|
||||||
TYPE(int value) {
|
TYPE(int value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getValue() {
|
public int getValue() {
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
@@ -56,15 +55,15 @@ public class DialogSimpleMessageHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Dialog makeBase(TYPE type, Context mContext, String titleText, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick, Runnable onNegativeClick, @StringRes int rNeutralButtonString, Runnable onNeutralClick){
|
private static Dialog makeBase(TYPE type, Context mContext, String titleText, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick, Runnable onNegativeClick, @StringRes Integer rNeutralButtonString, Runnable onNeutralClick) {
|
||||||
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
|
||||||
int colorBackgroundTitle = -1;
|
int colorBackgroundTitle = -1;
|
||||||
Drawable titleIconRes = null;
|
Drawable titleIconRes = null;
|
||||||
|
|
||||||
Dialog dialog = new Dialog(mContext);
|
Dialog dialog = new Dialog(mContext);
|
||||||
|
|
||||||
switch (type){
|
switch (type) {
|
||||||
case INFO:
|
case INFO:
|
||||||
colorBackgroundTitle = ContextCompat.getColor(mContext, R.color.light_blue_300);
|
colorBackgroundTitle = ContextCompat.getColor(mContext, R.color.light_blue_300);
|
||||||
titleIconRes = mContext.getResources().getDrawable(R.drawable.ic_info_78dp);
|
titleIconRes = mContext.getResources().getDrawable(R.drawable.ic_info_78dp);
|
||||||
@@ -91,7 +90,11 @@ public class DialogSimpleMessageHelper {
|
|||||||
viewModel
|
viewModel
|
||||||
.setOnPositive(onPositiveClick)
|
.setOnPositive(onPositiveClick)
|
||||||
.setOnNeutral(onNeutralClick)
|
.setOnNeutral(onNeutralClick)
|
||||||
.setOnNegative(onNegativeClick);
|
.setOnNegative(onNegativeClick)
|
||||||
|
|
||||||
|
.setPositiveButtonText(mContext.getText(R.string.ok).toString())
|
||||||
|
.setNeutralButtonText(rNeutralButtonString != null && rNeutralButtonString != -1 ? mContext.getText(rNeutralButtonString).toString() : null)
|
||||||
|
.setNegativeButtonText(mContext.getText(R.string.no).toString());
|
||||||
|
|
||||||
|
|
||||||
DialogBaseBinding mBinding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.dialog_base, null, false);
|
DialogBaseBinding mBinding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.dialog_base, null, false);
|
||||||
@@ -99,12 +102,10 @@ public class DialogSimpleMessageHelper {
|
|||||||
mBinding.setViewmodel(viewModel);
|
mBinding.setViewmodel(viewModel);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Rect displayRectangle = new Rect();
|
Rect displayRectangle = new Rect();
|
||||||
Window window = ((Activity) mContext).getWindow();
|
Window window = ((Activity) mContext).getWindow();
|
||||||
window.getDecorView().getWindowVisibleDisplayFrame(displayRectangle);
|
window.getDecorView().getWindowVisibleDisplayFrame(displayRectangle);
|
||||||
mBinding.titleContainer.setMinimumWidth((int)(displayRectangle.width() * 0.8f));
|
mBinding.titleContainer.setMinimumWidth((int) (displayRectangle.width() * 0.8f));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Title VIEW
|
//Title VIEW
|
||||||
@@ -120,7 +121,7 @@ public class DialogSimpleMessageHelper {
|
|||||||
|
|
||||||
LinearLayout hashMapContainer = mBinding.dialogContentHashmap;
|
LinearLayout hashMapContainer = mBinding.dialogContentHashmap;
|
||||||
|
|
||||||
if(hashmapContent != null) {
|
if (hashmapContent != null) {
|
||||||
for (int i = 0; i < hashmapContent.keySet().size(); i++) {
|
for (int i = 0; i < hashmapContent.keySet().size(); i++) {
|
||||||
String currentKey = hashmapContent.keySet().toArray()[i].toString();
|
String currentKey = hashmapContent.keySet().toArray()[i].toString();
|
||||||
String currentValue = hashmapContent.get(currentKey);
|
String currentValue = hashmapContent.get(currentKey);
|
||||||
@@ -142,7 +143,7 @@ public class DialogSimpleMessageHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Dialog makeInfoDialog(Context mContext, String titleText, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick){
|
public static Dialog makeInfoDialog(Context mContext, String titleText, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick) {
|
||||||
return makeBase(TYPE.INFO,
|
return makeBase(TYPE.INFO,
|
||||||
mContext,
|
mContext,
|
||||||
titleText,
|
titleText,
|
||||||
@@ -153,7 +154,7 @@ public class DialogSimpleMessageHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Dialog makeInfoDialog(Context mContext, String titleText, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick, Runnable onNegativeClick){
|
public static Dialog makeInfoDialog(Context mContext, String titleText, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick, Runnable onNegativeClick) {
|
||||||
return makeBase(TYPE.INFO,
|
return makeBase(TYPE.INFO,
|
||||||
mContext,
|
mContext,
|
||||||
titleText,
|
titleText,
|
||||||
@@ -164,7 +165,7 @@ public class DialogSimpleMessageHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Dialog makeSuccessDialog(Context mContext, String titleText, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick){
|
public static Dialog makeSuccessDialog(Context mContext, String titleText, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick) {
|
||||||
return makeBase(TYPE.SUCCESS,
|
return makeBase(TYPE.SUCCESS,
|
||||||
mContext,
|
mContext,
|
||||||
titleText,
|
titleText,
|
||||||
@@ -175,18 +176,20 @@ public class DialogSimpleMessageHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Dialog makeWarningDialog(Context mContext, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick, Runnable onNegativeClick){
|
public static Dialog makeWarningDialog(Context mContext, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick, Runnable onNegativeClick) {
|
||||||
return makeBase(TYPE.WARNING,
|
return makeBase(TYPE.WARNING,
|
||||||
mContext,
|
mContext,
|
||||||
mContext.getText(R.string.warning).toString(),
|
mContext.getText(R.string.warning).toString(),
|
||||||
messageText,
|
messageText,
|
||||||
hashmapContent,
|
hashmapContent,
|
||||||
onPositiveClick,
|
onPositiveClick,
|
||||||
() -> { if(onNegativeClick != null) onNegativeClick.run(); }, -1, null);
|
() -> {
|
||||||
|
if (onNegativeClick != null) onNegativeClick.run();
|
||||||
|
}, -1, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Dialog makeWarningDialog(Context mContext, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick){
|
public static Dialog makeWarningDialog(Context mContext, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick) {
|
||||||
return makeBase(TYPE.WARNING,
|
return makeBase(TYPE.WARNING,
|
||||||
mContext,
|
mContext,
|
||||||
mContext.getText(R.string.warning).toString(),
|
mContext.getText(R.string.warning).toString(),
|
||||||
@@ -196,7 +199,7 @@ public class DialogSimpleMessageHelper {
|
|||||||
null, -1, null);
|
null, -1, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showSimpleWarningDialog(Context context, String message){
|
public static void showSimpleWarningDialog(Context context, String message) {
|
||||||
makeErrorDialog(
|
makeErrorDialog(
|
||||||
context,
|
context,
|
||||||
new SpannableString(message),
|
new SpannableString(message),
|
||||||
@@ -204,7 +207,7 @@ public class DialogSimpleMessageHelper {
|
|||||||
null).show();
|
null).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dialog makeErrorDialog(Context mContext, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick){
|
public static Dialog makeErrorDialog(Context mContext, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick) {
|
||||||
|
|
||||||
return makeBase(TYPE.ERROR,
|
return makeBase(TYPE.ERROR,
|
||||||
mContext,
|
mContext,
|
||||||
@@ -215,7 +218,7 @@ public class DialogSimpleMessageHelper {
|
|||||||
null, -1, null);
|
null, -1, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showSimpleErrorDialog(Context context, String message){
|
public static void showSimpleErrorDialog(Context context, String message) {
|
||||||
makeErrorDialog(
|
makeErrorDialog(
|
||||||
context,
|
context,
|
||||||
new SpannableString(message),
|
new SpannableString(message),
|
||||||
@@ -223,7 +226,7 @@ public class DialogSimpleMessageHelper {
|
|||||||
null).show();
|
null).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dialog makeErrorDialog(Context mContext, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick, @StringRes int rNeutralButtonString, Runnable onNeutralClick){
|
public static Dialog makeErrorDialog(Context mContext, Spanned messageText, HashMap<String, String> hashmapContent, Runnable onPositiveClick, @StringRes int rNeutralButtonString, Runnable onNeutralClick) {
|
||||||
|
|
||||||
return makeBase(TYPE.ERROR,
|
return makeBase(TYPE.ERROR,
|
||||||
mContext,
|
mContext,
|
||||||
@@ -236,5 +239,4 @@ public class DialogSimpleMessageHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ public class DialogSimpleMessageViewModel {
|
|||||||
private Runnable onNeutral;
|
private Runnable onNeutral;
|
||||||
private Runnable onNegative;
|
private Runnable onNegative;
|
||||||
|
|
||||||
|
private String positiveButtonText;
|
||||||
|
private String neutralButtonText;
|
||||||
|
private String negativeButtonText;
|
||||||
|
|
||||||
public DialogSimpleMessageViewModel(Dialog dialog) {
|
public DialogSimpleMessageViewModel(Dialog dialog) {
|
||||||
mDialog = dialog;
|
mDialog = dialog;
|
||||||
@@ -46,6 +49,33 @@ public class DialogSimpleMessageViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getPositiveButtonText() {
|
||||||
|
return positiveButtonText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogSimpleMessageViewModel setPositiveButtonText(String positiveButtonText) {
|
||||||
|
this.positiveButtonText = positiveButtonText;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNeutralButtonText() {
|
||||||
|
return neutralButtonText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogSimpleMessageViewModel setNeutralButtonText(String neutralButtonText) {
|
||||||
|
this.neutralButtonText = neutralButtonText;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNegativeButtonText() {
|
||||||
|
return negativeButtonText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogSimpleMessageViewModel setNegativeButtonText(String negativeButtonText) {
|
||||||
|
this.negativeButtonText = negativeButtonText;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public void onPositiveClick() {
|
public void onPositiveClick() {
|
||||||
mDialog.dismiss();
|
mDialog.dismiss();
|
||||||
if(onPositive != null) onPositive.run();
|
if(onPositive != null) onPositive.run();
|
||||||
|
|||||||
@@ -1,755 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs.input_quantity;
|
|
||||||
|
|
||||||
import android.app.DatePickerDialog;
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.res.ColorStateList;
|
|
||||||
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
|
||||||
import androidx.databinding.Observable;
|
|
||||||
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Handler;
|
|
||||||
import com.google.android.material.textfield.TextInputLayout;
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.appcompat.widget.AppCompatTextView;
|
|
||||||
import android.text.Html;
|
|
||||||
import android.text.SpannableString;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.inputmethod.InputMethodManager;
|
|
||||||
import android.widget.EditText;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.RoundingMode;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.GregorianCalendar;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
|
||||||
import it.integry.integrywmsnative.databinding.DialogInputQuantityArticoloBinding;
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
|
||||||
|
|
||||||
public class DialogInputQuantity {
|
|
||||||
|
|
||||||
public static class DTO {
|
|
||||||
private MtbAart mtbAart;
|
|
||||||
private String batchLot;
|
|
||||||
private BigDecimal qtaDaEvadere;
|
|
||||||
private BigDecimal qtaDisponibile;
|
|
||||||
private BigDecimal qtaEvasa;
|
|
||||||
private BigDecimal qtaOrd;
|
|
||||||
private BigDecimal qtaTot;
|
|
||||||
private BigDecimal qtaCnf;
|
|
||||||
private Integer numCnf;
|
|
||||||
private BigDecimal maxQta;
|
|
||||||
private String codArtFor;
|
|
||||||
private Date dataScad;
|
|
||||||
private boolean canPartitaMagBeChanged;
|
|
||||||
private Boolean canDataScadBeChanged;
|
|
||||||
private Boolean shouldAskDataScad;
|
|
||||||
|
|
||||||
public MtbAart getMtbAart() {
|
|
||||||
return mtbAart;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setMtbAart(MtbAart mtbAart) {
|
|
||||||
this.mtbAart = mtbAart;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBatchLot() {
|
|
||||||
return batchLot;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setBatchLot(String batchLot) {
|
|
||||||
this.batchLot = batchLot;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getQtaDaEvadere() {
|
|
||||||
return qtaDaEvadere;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setQtaDaEvadere(BigDecimal qtaDaEvadere) {
|
|
||||||
this.qtaDaEvadere = qtaDaEvadere;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getQtaDisponibile() {
|
|
||||||
return qtaDisponibile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setQtaDisponibile(BigDecimal qtaDisponibile) {
|
|
||||||
this.qtaDisponibile = qtaDisponibile;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getQtaOrd() {
|
|
||||||
return qtaOrd;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setQtaOrd(BigDecimal qtaOrd) {
|
|
||||||
this.qtaOrd = qtaOrd;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getQtaTot() {
|
|
||||||
return qtaTot;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setQtaTot(BigDecimal qtaTot) {
|
|
||||||
this.qtaTot = qtaTot;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getQtaCnf() {
|
|
||||||
return qtaCnf;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setQtaCnf(BigDecimal qtaCnf) {
|
|
||||||
this.qtaCnf = qtaCnf;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getNumCnf() {
|
|
||||||
return numCnf;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setNumCnf(Integer numCnf) {
|
|
||||||
this.numCnf = numCnf;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getQtaEvasa() {
|
|
||||||
return qtaEvasa;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setQtaEvasa(BigDecimal qtaEvasa) {
|
|
||||||
this.qtaEvasa = qtaEvasa;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getMaxQta() {
|
|
||||||
return maxQta;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setMaxQta(BigDecimal maxQta) {
|
|
||||||
this.maxQta = maxQta;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCodArtFor() {
|
|
||||||
return codArtFor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setCodArtFor(String codArtFor) {
|
|
||||||
this.codArtFor = codArtFor;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getDataScad() {
|
|
||||||
return dataScad;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setDataScad(Date dataScad) {
|
|
||||||
this.dataScad = dataScad;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getCanPartitaMagBeChanged() {
|
|
||||||
return canPartitaMagBeChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setCanPartitaMagBeChanged(boolean canPartitaMagBeChanged) {
|
|
||||||
this.canPartitaMagBeChanged = canPartitaMagBeChanged;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean isCanDataScadBeChanged() {
|
|
||||||
return canDataScadBeChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setCanDataScadBeChanged(boolean canDataScadBeChanged) {
|
|
||||||
this.canDataScadBeChanged = canDataScadBeChanged;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getShouldAskDataScad() {
|
|
||||||
return shouldAskDataScad;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DTO setShouldAskDataScad(Boolean shouldAskDataScad) {
|
|
||||||
this.shouldAskDataScad = shouldAskDataScad;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private ColorStateList originalColorStateList = null;
|
|
||||||
|
|
||||||
private String scadenzaString = "Scadenza";
|
|
||||||
|
|
||||||
private Dialog currentDialog;
|
|
||||||
private Context currentContext;
|
|
||||||
|
|
||||||
private DialogInputQuantityArticoloBinding currentBinding;
|
|
||||||
|
|
||||||
private MtbAart currentMtbAart;
|
|
||||||
private QuantityDTO currentQuantityDto;
|
|
||||||
private DTO currentDTO;
|
|
||||||
|
|
||||||
public static Dialog makeBase(final Context context, final DTO dto, boolean canOverflowQuantity, final RunnableArgs<QuantityDTO> dialogCallback, final Runnable onAbort) {
|
|
||||||
return new DialogInputQuantity(context, dto, canOverflowQuantity, false, (quantityDto, closeUL) -> {
|
|
||||||
dialogCallback.run(quantityDto);
|
|
||||||
}, onAbort).currentDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Dialog makeBase(final Context context, final DTO dto, boolean canOverflowQuantity, final RunnableArgss<QuantityDTO, Boolean> dialogCallback, final Runnable onAbort) {
|
|
||||||
return new DialogInputQuantity(context, dto, canOverflowQuantity, true, dialogCallback, onAbort).currentDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DialogInputQuantity(@NotNull Context context, @NotNull final DTO dto, boolean canOverflowQuantity, boolean showCloseUL, final RunnableArgss<QuantityDTO, Boolean> dialogCallback, final Runnable onAbort) {
|
|
||||||
currentContext = context;
|
|
||||||
currentMtbAart = dto.getMtbAart();
|
|
||||||
currentDTO = dto;
|
|
||||||
|
|
||||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
|
||||||
currentBinding = DataBindingUtil.inflate(inflater, R.layout.dialog_input_quantity_articolo, null, false);
|
|
||||||
|
|
||||||
final TextInputLayout txlInputBatchLot = currentBinding.inputPartitaMag;
|
|
||||||
|
|
||||||
final TextInputLayout txlInputNumDiCnf = currentBinding.inputNumCnf;
|
|
||||||
final TextInputLayout txlInputQtaPerCnf = currentBinding.inputQtaCnf;
|
|
||||||
final TextInputLayout txlInputQtaTot = currentBinding.inputQtaTot;
|
|
||||||
|
|
||||||
txlInputNumDiCnf.getEditText().setSelectAllOnFocus(true);
|
|
||||||
txlInputQtaPerCnf.getEditText().setSelectAllOnFocus(true);
|
|
||||||
txlInputQtaTot.getEditText().setSelectAllOnFocus(true);
|
|
||||||
|
|
||||||
|
|
||||||
originalColorStateList = txlInputNumDiCnf.getEditText().getTextColors();
|
|
||||||
|
|
||||||
currentQuantityDto = new QuantityDTO();
|
|
||||||
currentQuantityDto.canOverflowQuantity = canOverflowQuantity;
|
|
||||||
|
|
||||||
setupQuantities(dto, currentQuantityDto);
|
|
||||||
|
|
||||||
setupQuantityListener(currentQuantityDto, txlInputNumDiCnf, txlInputQtaPerCnf, txlInputQtaTot);
|
|
||||||
|
|
||||||
currentBinding.setViewmodel(dto);
|
|
||||||
currentBinding.setQuantityViewModel(currentQuantityDto);
|
|
||||||
|
|
||||||
|
|
||||||
currentDialog = new Dialog(context);
|
|
||||||
currentDialog.setContentView(currentBinding.getRoot());
|
|
||||||
|
|
||||||
currentDialog.setCanceledOnTouchOutside(false);
|
|
||||||
currentDialog.setCancelable(false);
|
|
||||||
currentDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
|
||||||
|
|
||||||
currentDialog.setCanceledOnTouchOutside(false);
|
|
||||||
|
|
||||||
currentDialog.setOnShowListener(dialogInterface -> {
|
|
||||||
|
|
||||||
final Handler handler = new Handler();
|
|
||||||
handler.postDelayed(() -> {
|
|
||||||
EditText editTextToFocus;
|
|
||||||
if(currentQuantityDto.canPartitaMagBeChanged.get()) {
|
|
||||||
editTextToFocus = txlInputBatchLot.getEditText();
|
|
||||||
} else {
|
|
||||||
editTextToFocus = txlInputNumDiCnf.getEditText();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
editTextToFocus.requestFocus();
|
|
||||||
|
|
||||||
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
||||||
imm.showSoftInput(editTextToFocus, InputMethodManager.SHOW_IMPLICIT);
|
|
||||||
|
|
||||||
}, 100);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
currentBinding.saveBtn.setOnClickListener(view -> {
|
|
||||||
onConfirm(context, currentQuantityDto, dialogCallback, false);
|
|
||||||
currentDialog.dismiss();
|
|
||||||
});
|
|
||||||
currentBinding.abortBtn.setOnClickListener(view -> {
|
|
||||||
if(onAbort != null) onAbort.run();
|
|
||||||
currentDialog.dismiss();
|
|
||||||
});
|
|
||||||
|
|
||||||
currentBinding.closeLuBtn.setVisibility(showCloseUL ? View.VISIBLE : View.INVISIBLE);
|
|
||||||
currentBinding.closeLuBtn.setOnClickListener(view -> {
|
|
||||||
onConfirm(context, currentQuantityDto, dialogCallback, true);
|
|
||||||
currentDialog.dismiss();
|
|
||||||
});
|
|
||||||
|
|
||||||
initDatePicker(context, currentQuantityDto, currentBinding.getRoot().findViewById(R.id.input_data_scad));
|
|
||||||
|
|
||||||
setupBarcode(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupQuantities(@NotNull DTO dto, QuantityDTO quantityDTO){
|
|
||||||
if(dto.getQtaTot() != null) quantityDTO.qtaTot.set(dto.getQtaTot().floatValue());
|
|
||||||
if(dto.getMaxQta() != null) quantityDTO.maxQta.set(dto.getMaxQta().floatValue());
|
|
||||||
|
|
||||||
float qtaDisponibile = dto.getQtaDisponibile() != null ? dto.getQtaDisponibile().floatValue() : 0f;
|
|
||||||
if (qtaDisponibile < 0) {
|
|
||||||
currentBinding.layoutQtaDisponibile.setVisibility(View.GONE);
|
|
||||||
qtaDisponibile = 0;
|
|
||||||
}
|
|
||||||
if(qtaDisponibile > 0) quantityDTO.qtaDisponibile.set(qtaDisponibile);
|
|
||||||
|
|
||||||
float qtaDaEvadere = dto.qtaDaEvadere != null ? dto.qtaDaEvadere.floatValue() : 0f;
|
|
||||||
if (qtaDaEvadere < 0) {
|
|
||||||
currentBinding.layoutQtaDaEvadere.setVisibility(View.GONE);
|
|
||||||
qtaDaEvadere = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(qtaDaEvadere > 0) quantityDTO.qtaDaEvadere.set(qtaDaEvadere);
|
|
||||||
quantityDTO.qtaEvasa.set(dto.qtaEvasa != null ? dto.qtaEvasa.floatValue() : null);
|
|
||||||
|
|
||||||
quantityDTO.batchLot.set(dto.batchLot);
|
|
||||||
if(quantityDTO.qtaCnf.get(false) == null) {
|
|
||||||
if(dto.getQtaCnf() != null) {
|
|
||||||
|
|
||||||
quantityDTO.qtaCnf.set(dto.getQtaCnf().floatValue());
|
|
||||||
|
|
||||||
} else if(dto.numCnf != null && dto.qtaTot != null &&
|
|
||||||
dto.numCnf > 0 && dto.qtaTot.compareTo(BigDecimal.ZERO) > 0) {
|
|
||||||
|
|
||||||
quantityDTO.qtaCnfNotificationEnabled = false;
|
|
||||||
quantityDTO.qtaCnf.set(dto.qtaTot.divide(new BigDecimal(dto.numCnf), RoundingMode.HALF_EVEN).floatValue());
|
|
||||||
quantityDTO.qtaCnfNotificationEnabled = true;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
quantityDTO.qtaCnf.set(dto.mtbAart.getQtaCnf().floatValue());
|
|
||||||
|
|
||||||
if(dto.getMtbAart().isFlagQtaCnfFissaBoolean()) {
|
|
||||||
quantityDTO.blockedQtaPerCnf.set(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(quantityDTO.qtaTot.get(false) == null) {
|
|
||||||
quantityDTO.qtaTot.set(qtaDaEvadere);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(dto.getNumCnf() != null) {
|
|
||||||
quantityDTO.numCnf.set(new BigDecimal(dto.getNumCnf()).floatValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(quantityDTO.numCnf.get(false) == null) {
|
|
||||||
float numCnf = (float) Math.ceil(UtilityNumber.truncateToDecimal(quantityDTO.qtaTot.get() / quantityDTO.qtaCnf.get(),3));
|
|
||||||
if(numCnf < 1) numCnf = 1;
|
|
||||||
quantityDTO.numCnf.set(numCnf);
|
|
||||||
}
|
|
||||||
|
|
||||||
quantityDTO.canPartitaMagBeChanged.set(dto.getCanPartitaMagBeChanged());
|
|
||||||
|
|
||||||
if(dto.isCanDataScadBeChanged() != null){
|
|
||||||
quantityDTO.canDataScadBeChanged.set(dto.isCanDataScadBeChanged());
|
|
||||||
}
|
|
||||||
|
|
||||||
quantityDTO.shouldAskDataScad.set(dto.mtbAart.isFlagTracciabilitaBoolean() && dto.mtbAart.getGgScadPartita() != null && dto.mtbAart.getGgScadPartita() > 0);
|
|
||||||
|
|
||||||
if(dto.getShouldAskDataScad() != null) {
|
|
||||||
quantityDTO.shouldAskDataScad.set(dto.getShouldAskDataScad());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(dto.getDataScad() != null) {
|
|
||||||
quantityDTO.expireDate = dto.getDataScad();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(quantityDTO.expireDate == null && dto.mtbAart.getGgScadPartita() != null && dto.mtbAart.getGgScadPartita() > 0) {
|
|
||||||
Calendar c = UtilityDate.getCalendarInstance();
|
|
||||||
c.add(Calendar.DATE, dto.mtbAart.getGgScadPartita()); // number of days to add
|
|
||||||
|
|
||||||
quantityDTO.expireDate = c.getTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
refreshQtaDescriptionText();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void setupBarcode(Context context) {
|
|
||||||
|
|
||||||
int barcodeIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
|
||||||
.setOnScanSuccessfull(onScanSuccessfull)
|
|
||||||
.setOnScanFailed(ex -> UtilityExceptions.defaultException(context, ex, false)));
|
|
||||||
|
|
||||||
currentDialog.setOnDismissListener(dialog -> {
|
|
||||||
BarcodeManager.removeCallback(barcodeIstanceID);
|
|
||||||
});
|
|
||||||
|
|
||||||
BarcodeManager.enable();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
|
||||||
BarcodeManager.disable();
|
|
||||||
|
|
||||||
if(UtilityBarcode.isEanPeso(data)){
|
|
||||||
|
|
||||||
try {
|
|
||||||
Ean13PesoModel ean13PesoModel = Ean13PesoModel.fromBarcode(data.getStringValue());
|
|
||||||
|
|
||||||
if(ean13PesoModel.getPrecode().contains(currentMtbAart.getBarCode())) {
|
|
||||||
|
|
||||||
currentQuantityDto.numCnf.set(1f);
|
|
||||||
currentQuantityDto.qtaCnf.set(ean13PesoModel.getPeso());
|
|
||||||
currentQuantityDto.qtaTot.set(ean13PesoModel.getPeso());
|
|
||||||
|
|
||||||
BarcodeManager.enable();
|
|
||||||
} else {
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
UtilityLogger.errorMe(e);
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if(UtilityBarcode.isEtichetta128(data)){
|
|
||||||
final Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(currentContext);
|
|
||||||
|
|
||||||
BarcodeRESTConsumer.decodeEan128Static(data, ean128Model -> {
|
|
||||||
progressDialog.dismiss();
|
|
||||||
BarcodeManager.enable();
|
|
||||||
|
|
||||||
if(ean128Model != null){
|
|
||||||
if(!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
|
|
||||||
currentQuantityDto.batchLot.set(ean128Model.BatchLot);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
if(!UtilityString.isNullOrEmpty(ean128Model.BestBefore)){
|
|
||||||
currentQuantityDto.expireDate = UtilityDate.recognizeDate(ean128Model.BestBefore);
|
|
||||||
} else if(!UtilityString.isNullOrEmpty(ean128Model.Expiry)) {
|
|
||||||
currentQuantityDto.expireDate = UtilityDate.recognizeDate(ean128Model.Expiry);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(currentQuantityDto.expireDate != null) {
|
|
||||||
currentQuantityDto.expireDateString.set(UtilityDate.formatDate(currentQuantityDto.expireDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
UtilityLogger.errorMe(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(ean128Model.Count != null && ean128Model.Count > 0) {
|
|
||||||
currentQuantityDto.numCnf.set((float) ean128Model.Count);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ean128Model.NetWeightKg != null && ean128Model.NetWeightKg > 0) {
|
|
||||||
currentQuantityDto.qtaTot.set(ean128Model.NetWeightKg);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(currentQuantityDto.qtaTot.get() > 0 && currentQuantityDto.numCnf.get() > 0) {
|
|
||||||
currentQuantityDto.qtaCnf.set(currentQuantityDto.qtaTot.get() / currentQuantityDto.numCnf.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}, ex -> {
|
|
||||||
UtilityExceptions.defaultException(currentContext, ex, progressDialog);
|
|
||||||
|
|
||||||
BarcodeManager.enable();
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
private void setupQuantityListener(final QuantityDTO quantityDTO, final TextInputLayout txlInputNumDiCnf, final TextInputLayout txlInputQtaPerCnf, final TextInputLayout txlInputQtaTot) {
|
|
||||||
|
|
||||||
quantityDTO.numCnf.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
|
||||||
@Override
|
|
||||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
|
||||||
|
|
||||||
if(quantityDTO.numCnfNotificationEnabled) {
|
|
||||||
|
|
||||||
quantityDTO.blockedNumDiCnf.set(!(quantityDTO.numCnf.get(true) == 0 || quantityDTO.numCnf.get().toString().equals("")));
|
|
||||||
|
|
||||||
toggleTextInputLayoutError(txlInputNumDiCnf, quantityDTO.blockedNumDiCnf.get());
|
|
||||||
|
|
||||||
if (!quantityDTO.blockedQtaTot.get()) {
|
|
||||||
|
|
||||||
quantityDTO.qtaTotNotificationEnabled = false;
|
|
||||||
quantityDTO.qtaTot.set((float) Math.round(quantityDTO.qtaCnf.get(true) * quantityDTO.numCnf.get(true) * 1000) / 1000);
|
|
||||||
quantityDTO.qtaTotNotificationEnabled = true;
|
|
||||||
|
|
||||||
|
|
||||||
} else if (!quantityDTO.blockedQtaPerCnf.get()) {
|
|
||||||
|
|
||||||
quantityDTO.qtaCnfNotificationEnabled = false;
|
|
||||||
if(quantityDTO.numCnf.get(true) != 0) {
|
|
||||||
quantityDTO.qtaCnf.set((float) Math.round(quantityDTO.qtaTot.get(true) / quantityDTO.numCnf.get(true) * 1000) / 1000);
|
|
||||||
} else {
|
|
||||||
quantityDTO.qtaCnf.set((float) Math.round(quantityDTO.qtaTot.get(true) / 1 * 1000) / 1000);
|
|
||||||
}
|
|
||||||
quantityDTO.qtaCnfNotificationEnabled = true;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Log.e("DialogInputQuantity", "Tutti i campi sono bloccati, non è possibile modificare il numero di confezioni");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// refreshQtaDescriptionText();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
quantityDTO.qtaCnf.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
|
||||||
@Override
|
|
||||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
|
||||||
|
|
||||||
if(quantityDTO.qtaCnfNotificationEnabled) {
|
|
||||||
|
|
||||||
quantityDTO.blockedQtaPerCnf.set(!(quantityDTO.qtaCnf.get(true) == 0 || quantityDTO.qtaCnf.get().toString().equals("")));
|
|
||||||
|
|
||||||
toggleTextInputLayoutError(txlInputQtaPerCnf, quantityDTO.blockedQtaPerCnf.get());
|
|
||||||
|
|
||||||
if (!quantityDTO.blockedQtaTot.get()) {
|
|
||||||
|
|
||||||
quantityDTO.qtaTotNotificationEnabled = false;
|
|
||||||
float qtaTot = (float) Math.round(quantityDTO.qtaCnf.get(true) * quantityDTO.numCnf.get(true) * 1000) / 1000;
|
|
||||||
if(qtaTot > quantityDTO.maxQta.get() && !quantityDTO.canOverflowQuantity) qtaTot = quantityDTO.maxQta.get();
|
|
||||||
quantityDTO.qtaTot.set(qtaTot);
|
|
||||||
quantityDTO.qtaTotNotificationEnabled = true;
|
|
||||||
|
|
||||||
} else if (!quantityDTO.blockedNumDiCnf.get()) {
|
|
||||||
|
|
||||||
quantityDTO.numCnfNotificationEnabled = false;
|
|
||||||
if(quantityDTO.qtaCnf.get(true) != 0){
|
|
||||||
quantityDTO.numCnf.set((float) Math.ceil(quantityDTO.qtaTot.get(true) / quantityDTO.qtaCnf.get(true)));
|
|
||||||
} else {
|
|
||||||
quantityDTO.numCnf.set((float) Math.ceil(quantityDTO.qtaTot.get(true)));
|
|
||||||
}
|
|
||||||
|
|
||||||
quantityDTO.numCnfNotificationEnabled = true;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Log.e("DialogInputQuantity", "Tutti i campi sono bloccati, non è possibile modificare la quantità per confezione");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// refreshQtaDescriptionText();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
quantityDTO.qtaTot.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
|
||||||
@Override
|
|
||||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
|
||||||
|
|
||||||
if (quantityDTO.qtaTotNotificationEnabled) {
|
|
||||||
|
|
||||||
quantityDTO.blockedQtaTot.set(!(quantityDTO.qtaTot.get(true) == 0 || quantityDTO.qtaTot.get().toString().equals("")));
|
|
||||||
|
|
||||||
toggleTextInputLayoutError(txlInputQtaTot, quantityDTO.blockedQtaTot.get());
|
|
||||||
|
|
||||||
if(!quantityDTO.blockedQtaPerCnf.get()){
|
|
||||||
|
|
||||||
quantityDTO.qtaCnfNotificationEnabled = false;
|
|
||||||
quantityDTO.qtaCnf.set((float) Math.round(quantityDTO.qtaTot.get(true) / quantityDTO.numCnf.get(true) *1000)/1000);
|
|
||||||
quantityDTO.qtaCnfNotificationEnabled = true;
|
|
||||||
|
|
||||||
} else if(!quantityDTO.blockedNumDiCnf.get()) {
|
|
||||||
|
|
||||||
quantityDTO.numCnfNotificationEnabled = false;
|
|
||||||
quantityDTO.numCnf.set((float) Math.ceil(quantityDTO.qtaTot.get(true) / quantityDTO.qtaCnf.get(true)));
|
|
||||||
quantityDTO.numCnfNotificationEnabled = true;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Log.e("DialogInputQuantity", "Tutti i campi sono bloccati, non è possibile modificare la quantità totale");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// refreshQtaDescriptionText();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void toggleTextInputLayoutError(TextInputLayout textInputLayout, boolean isError) {
|
|
||||||
if(isError){
|
|
||||||
textInputLayout.setErrorEnabled(true);
|
|
||||||
textInputLayout.setError(" ");
|
|
||||||
textInputLayout.getEditText().setTextColor(ContextCompat.getColor(currentContext, R.color.red_600));
|
|
||||||
textInputLayout.setHintTextAppearance(R.style.ErrorFloatingLabel);
|
|
||||||
textInputLayout.setErrorIconDrawable(null);
|
|
||||||
|
|
||||||
if (textInputLayout.getChildCount() == 2) {
|
|
||||||
textInputLayout.getChildAt(1).setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
textInputLayout.setErrorEnabled(false);
|
|
||||||
textInputLayout.setError(null);
|
|
||||||
textInputLayout.getEditText().setTextColor(originalColorStateList);
|
|
||||||
textInputLayout.setHintTextAppearance(R.style.NormalFloatingLabel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initDatePicker(Context context, QuantityDTO quantityDTO, AppCompatTextView textInputLayout) {
|
|
||||||
quantityDTO.expireDateString.set(scadenzaString);
|
|
||||||
|
|
||||||
if(quantityDTO.expireDate != null) {
|
|
||||||
quantityDTO.expireDateString.set(UtilityDate.formatDate(quantityDTO.expireDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Runnable onTextClicked = () -> {
|
|
||||||
// Get Current Date
|
|
||||||
Calendar c = UtilityDate.getCalendarInstance();
|
|
||||||
|
|
||||||
if(quantityDTO.expireDate != null) {
|
|
||||||
c.setTime(quantityDTO.expireDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
int mYear = c.get(Calendar.YEAR);
|
|
||||||
int mMonth = c.get(Calendar.MONTH);
|
|
||||||
int mDay = c.get(Calendar.DAY_OF_MONTH);
|
|
||||||
|
|
||||||
DatePickerDialog datePickerDialog = new DatePickerDialog(context,
|
|
||||||
(view, year, month, day) -> {
|
|
||||||
|
|
||||||
quantityDTO.expireDate = new GregorianCalendar(year, month, day).getTime();
|
|
||||||
quantityDTO.expireDateString.set(UtilityDate.formatDate(quantityDTO.expireDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
|
||||||
|
|
||||||
}, mYear, mMonth, mDay);
|
|
||||||
datePickerDialog.show();
|
|
||||||
};
|
|
||||||
|
|
||||||
textInputLayout.setOnClickListener(v -> onTextClicked.run());
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void refreshQtaDescriptionText() {
|
|
||||||
|
|
||||||
int numConf = (int) (currentQuantityDto.qtaDaEvadere.get() / currentQuantityDto.qtaCnf.get());
|
|
||||||
float qtaTot = currentQuantityDto.qtaDaEvadere.get();
|
|
||||||
|
|
||||||
float mod = qtaTot % numConf;
|
|
||||||
|
|
||||||
String text = "";
|
|
||||||
|
|
||||||
if(numConf > 0) {
|
|
||||||
text += "<b>" + numConf + " " + currentContext.getResources().getQuantityString(R.plurals.item_package, numConf).toUpperCase() + "</b>";
|
|
||||||
}
|
|
||||||
if(numConf > 0 && mod > 0) {
|
|
||||||
text += " e ";
|
|
||||||
}
|
|
||||||
if(mod > 0) {
|
|
||||||
|
|
||||||
text += "<b>" + UtilityNumber.decimalToString(mod) + " ";
|
|
||||||
if(mod == 1) {
|
|
||||||
text += currentContext.getResources().getQuantityString(R.plurals.pieces, (int) mod).toUpperCase();
|
|
||||||
} else {
|
|
||||||
text += currentContext.getString(R.string.piece).toUpperCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
text += "</b>";
|
|
||||||
}
|
|
||||||
|
|
||||||
currentBinding.qtaDescriptionText.setText(Html.fromHtml(text));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void onConfirm(Context context, QuantityDTO quantityDTO, RunnableArgss<QuantityDTO, Boolean> dialogCallback, boolean closeUL){
|
|
||||||
if(currentDTO.mtbAart.isFlagTracciabilitaBoolean() && (quantityDTO.batchLot == null || quantityDTO.batchLot.get().trim().length() == 0)){
|
|
||||||
|
|
||||||
showBatchLotErrorPrompt(context);
|
|
||||||
|
|
||||||
} else if(quantityDTO.shouldAskDataScad.get() && (quantityDTO.batchLot == null || quantityDTO.batchLot.get().trim().length() == 0)){
|
|
||||||
|
|
||||||
showBatchLotErrorPrompt(context);
|
|
||||||
|
|
||||||
} else if(quantityDTO.shouldAskDataScad.get() && quantityDTO.expireDate == null){
|
|
||||||
|
|
||||||
showExpireDateErrorPrompt(context);
|
|
||||||
|
|
||||||
} else if(!quantityDTO.canOverflowQuantity && quantityDTO.qtaTot.get() > quantityDTO.maxQta.get()) {
|
|
||||||
|
|
||||||
showQuantityOverflowErrorPrompt(context);
|
|
||||||
|
|
||||||
} else if(quantityDTO.qtaCnf.get() <= 0 || quantityDTO.numCnf.get() <= 0 || quantityDTO.qtaTot.get() <= 0) {
|
|
||||||
|
|
||||||
showQuantityErrorDialog(context);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if(quantityDTO.batchLot != null && !quantityDTO.batchLot.isEmpty()) {
|
|
||||||
quantityDTO.batchLot.set(quantityDTO.batchLot.get().toUpperCase());
|
|
||||||
}
|
|
||||||
|
|
||||||
dialogCallback.run(quantityDTO, closeUL);
|
|
||||||
currentDialog.dismiss();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void showQuantityErrorDialog(Context mContext){
|
|
||||||
|
|
||||||
String errorMessage = mContext.getText(R.string.wrong_quantity_input_message).toString();
|
|
||||||
|
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(mContext, new SpannableString(Html.fromHtml(errorMessage)), null, null).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void showQuantityOverflowErrorPrompt(Context mContext){
|
|
||||||
|
|
||||||
String errorMessage = mContext.getText(R.string.available_quantity_overflow_error_message).toString();
|
|
||||||
|
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(mContext, new SpannableString(Html.fromHtml(errorMessage)), null, null).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void showExpireDateErrorPrompt(Context mContext){
|
|
||||||
|
|
||||||
String errorMessage = mContext.getText(R.string.expire_date_error_message).toString();
|
|
||||||
|
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(mContext, new SpannableString(Html.fromHtml(errorMessage)), null, null).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void showBatchLotErrorPrompt(Context mContext){
|
|
||||||
|
|
||||||
String errorMessage = mContext.getText(R.string.batch_lot_error_message).toString();
|
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(mContext, new SpannableString(Html.fromHtml(errorMessage)), null, null).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs.input_quantity;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
|
||||||
import it.integry.integrywmsnative.core.di.BindableFloat;
|
|
||||||
import it.integry.integrywmsnative.core.di.BindableString;
|
|
||||||
|
|
||||||
public class QuantityDTO {
|
|
||||||
|
|
||||||
public BindableString batchLot = new BindableString();
|
|
||||||
public BindableString expireDateString = new BindableString();
|
|
||||||
|
|
||||||
public Date expireDate = null;
|
|
||||||
|
|
||||||
public BindableFloat numCnf = new BindableFloat();
|
|
||||||
public BindableFloat qtaCnf = new BindableFloat();
|
|
||||||
public BindableFloat qtaTot = new BindableFloat();
|
|
||||||
|
|
||||||
public BindableFloat qtaEvasa = new BindableFloat();
|
|
||||||
public BindableFloat qtaDaEvadere = new BindableFloat();
|
|
||||||
public BindableFloat qtaDisponibile = new BindableFloat();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public BindableBoolean blockedNumDiCnf = new BindableBoolean();
|
|
||||||
public BindableBoolean blockedQtaTot = new BindableBoolean();
|
|
||||||
public BindableBoolean blockedQtaPerCnf = new BindableBoolean();
|
|
||||||
|
|
||||||
public boolean numCnfNotificationEnabled = true;
|
|
||||||
public boolean qtaCnfNotificationEnabled = true;
|
|
||||||
public boolean qtaTotNotificationEnabled = true;
|
|
||||||
public boolean canOverflowQuantity = false;
|
|
||||||
public BindableFloat maxQta = new BindableFloat();
|
|
||||||
|
|
||||||
|
|
||||||
public BindableBoolean canPartitaMagBeChanged = new BindableBoolean(true);
|
|
||||||
public BindableBoolean canDataScadBeChanged = new BindableBoolean(true);
|
|
||||||
public BindableBoolean shouldAskDataScad = new BindableBoolean();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -288,7 +288,7 @@ public class DialogScanOrCreateLU {
|
|||||||
|
|
||||||
private void showTooMuchULFound() {
|
private void showTooMuchULFound() {
|
||||||
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||||
new SpannableString(mContext.getResources().getText(R.string.too_much_lu_found_message)),
|
new SpannableString(mContext.getResources().getText(R.string.too_much_lu_found_message_in_mono_lu)),
|
||||||
null, null).show();
|
null, null).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="@color/colorPrimary">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M19,3h-4.18C14.4,1.84 13.3,1 12,1c-1.3,0 -2.4,0.84 -2.82,2L5,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM12,3c0.55,0 1,0.45 1,1s-0.45,1 -1,1 -1,-0.45 -1,-1 0.45,-1 1,-1zM10,17l-4,-4 1.41,-1.41L10,14.17l6.59,-6.59L18,9l-8,8z"/>
|
||||||
|
</vector>
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/spedizione_empty_view"
|
android:id="@+id/accettazione_empty_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:alpha="0.3"
|
android:alpha="0.3"
|
||||||
|
|||||||
@@ -69,7 +69,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scrollbars="vertical"
|
android:scrollbars="vertical"
|
||||||
android:clipToPadding="false"/>
|
android:clipToPadding="false"
|
||||||
|
android:paddingBottom="72dp"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@@ -186,7 +187,7 @@
|
|||||||
<!-- android:id="@+id/empty_space_padding"-->
|
<!-- android:id="@+id/empty_space_padding"-->
|
||||||
<!-- android:layout_width="match_parent"-->
|
<!-- android:layout_width="match_parent"-->
|
||||||
<!-- android:layout_height="?attr/actionBarSize"-->
|
<!-- android:layout_height="?attr/actionBarSize"-->
|
||||||
<!-- android:visibility="@{viewmodel.currentMtbColt != null ? View.VISIBLE : View.GONE}"-->
|
<!-- android:visibility="@{pickingResiView.bottomSheetEnabled ? View.VISIBLE : View.GONE}"-->
|
||||||
<!-- android:layout_alignParentBottom="true">-->
|
<!-- android:layout_alignParentBottom="true">-->
|
||||||
|
|
||||||
<!-- </RelativeLayout>-->
|
<!-- </RelativeLayout>-->
|
||||||
|
|||||||
@@ -265,7 +265,17 @@
|
|||||||
app:visibility="@{spedizioneView.noLUPresent}">
|
app:visibility="@{spedizioneView.noLUPresent}">
|
||||||
|
|
||||||
<com.github.clans.fab.FloatingActionButton
|
<com.github.clans.fab.FloatingActionButton
|
||||||
android:id="@+id/spedizione_fab_item1"
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_baseline_assignment_turned_in_24"
|
||||||
|
app:visibility="@{spedizioneView.closeOrderButtonEnabled}"
|
||||||
|
app:fab_colorNormal="@color/white"
|
||||||
|
app:fab_colorPressed="@color/white_pressed"
|
||||||
|
app:fab_colorRipple="#66FFFFFF"
|
||||||
|
app:fab_label="@string/action_close_order"
|
||||||
|
app:onClick="@{() -> spedizioneView.closeOrder()}" />
|
||||||
|
|
||||||
|
<com.github.clans.fab.FloatingActionButton
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/ic_box"
|
android:src="@drawable/ic_box"
|
||||||
@@ -276,7 +286,6 @@
|
|||||||
app:onClick="@{() -> spedizioneView.showCreatedUL()}" />
|
app:onClick="@{() -> spedizioneView.showCreatedUL()}" />
|
||||||
|
|
||||||
<com.github.clans.fab.FloatingActionButton
|
<com.github.clans.fab.FloatingActionButton
|
||||||
android:id="@+id/spedizione_fab_item2"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/ic_add_24dp"
|
android:src="@drawable/ic_add_24dp"
|
||||||
|
|||||||
@@ -34,9 +34,10 @@
|
|||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:layout_marginBottom="8dp" />
|
android:layout_marginBottom="8dp" />
|
||||||
|
|
||||||
<RelativeLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/input_cliente"
|
android:id="@+id/input_cliente"
|
||||||
@@ -46,14 +47,30 @@
|
|||||||
android:hint="@string/customer">
|
android:hint="@string/customer">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||||
android:id="@+id/filled_exposed_dropdown"
|
android:id="@+id/dropdown_cliente"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="end"/>
|
android:ellipsize="end"/>
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
</RelativeLayout>
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/input_commessa"
|
||||||
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/job">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||||
|
android:id="@+id/dropdown_commessa"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"/>
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
android:hint="@string/recipient">
|
android:hint="@string/recipient">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||||
android:id="@+id/filled_exposed_dropdown"
|
android:id="@+id/dropdown_destinatario"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
|
|||||||
@@ -123,7 +123,7 @@
|
|||||||
app:layout_constraintEnd_toStartOf="@id/center_guideline"
|
app:layout_constraintEnd_toStartOf="@id/center_guideline"
|
||||||
app:strokeColor="@color/colorPrimary"
|
app:strokeColor="@color/colorPrimary"
|
||||||
android:onClick="@{() -> viewmodel.onNegativeClick()}"
|
android:onClick="@{() -> viewmodel.onNegativeClick()}"
|
||||||
android:text="@string/no"/>
|
android:text="@{viewmodel.negativeButtonText}"/>
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
app:layout_constraintStart_toStartOf="@id/center_guideline"
|
app:layout_constraintStart_toStartOf="@id/center_guideline"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:onClick="@{() -> viewmodel.onPositiveClick()}"
|
android:onClick="@{() -> viewmodel.onPositiveClick()}"
|
||||||
android:text="@string/yes"/>
|
android:text="@{viewmodel.positiveButtonText}"/>
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -173,7 +173,7 @@
|
|||||||
app:layout_constraintStart_toStartOf="@id/ok_left_buttons_guideline"
|
app:layout_constraintStart_toStartOf="@id/ok_left_buttons_guideline"
|
||||||
app:layout_constraintEnd_toEndOf="@id/ok_right_buttons_guideline"
|
app:layout_constraintEnd_toEndOf="@id/ok_right_buttons_guideline"
|
||||||
android:onClick="@{() -> viewmodel.onPositiveClick()}"
|
android:onClick="@{() -> viewmodel.onPositiveClick()}"
|
||||||
android:text="@string/ok"/>
|
android:text="@{viewmodel.positiveButtonText}"/>
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -184,7 +184,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:visibility="@{viewmodel.neutralVisible ? View.VISIBLE : View.GONE}">
|
android:visibility="@{viewmodel.negativeVisible && viewmodel.neutralVisible ? View.VISIBLE : View.GONE}">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
<androidx.constraintlayout.widget.Guideline
|
||||||
android:id="@+id/left_buttons_guideline"
|
android:id="@+id/left_buttons_guideline"
|
||||||
@@ -211,7 +211,7 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/left_buttons_guideline"
|
app:layout_constraintEnd_toStartOf="@id/left_buttons_guideline"
|
||||||
android:onClick="@{() -> viewmodel.onNegativeClick()}"
|
android:onClick="@{() -> viewmodel.onNegativeClick()}"
|
||||||
android:text="@string/no"/>
|
android:text="@{viewmodel.negativeButtonText}"/>
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
@@ -225,7 +225,7 @@
|
|||||||
app:layout_constraintEnd_toStartOf="@id/right_buttons_guideline"
|
app:layout_constraintEnd_toStartOf="@id/right_buttons_guideline"
|
||||||
app:strokeColor="@color/colorPrimary"
|
app:strokeColor="@color/colorPrimary"
|
||||||
android:onClick="@{() -> viewmodel.onNeutralClick()}"
|
android:onClick="@{() -> viewmodel.onNeutralClick()}"
|
||||||
android:text="@string/abort"/>
|
android:text="@{viewmodel.neutralButtonText}"/>
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
@@ -238,7 +238,50 @@
|
|||||||
app:layout_constraintStart_toStartOf="@id/right_buttons_guideline"
|
app:layout_constraintStart_toStartOf="@id/right_buttons_guideline"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:onClick="@{() -> viewmodel.onPositiveClick()}"
|
android:onClick="@{() -> viewmodel.onPositiveClick()}"
|
||||||
android:text="@string/yes"/>
|
android:text="@{viewmodel.positiveButtonText}"/>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:visibility="@{!viewmodel.negativeVisible && viewmodel.neutralVisible ? View.VISIBLE : View.GONE}">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline
|
||||||
|
android:id="@+id/center_guideline2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintGuide_percent="0.5"/>
|
||||||
|
|
||||||
|
|
||||||
|
<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="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/center_guideline2"
|
||||||
|
app:strokeColor="@color/colorPrimary"
|
||||||
|
android:onClick="@{() -> viewmodel.onNeutralClick()}"
|
||||||
|
android:text="@{viewmodel.neutralButtonText}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<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/center_guideline2"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:onClick="@{() -> viewmodel.onPositiveClick()}"
|
||||||
|
android:text="@{viewmodel.positiveButtonText}"/>
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|||||||
@@ -1,425 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
|
|
||||||
<data>
|
|
||||||
<import type="android.view.View" />
|
|
||||||
|
|
||||||
<variable
|
|
||||||
name="viewmodel"
|
|
||||||
type="it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity.DTO"/>
|
|
||||||
<variable
|
|
||||||
name="quantityViewModel"
|
|
||||||
type="it.integry.integrywmsnative.view.dialogs.input_quantity.QuantityDTO"/>
|
|
||||||
|
|
||||||
<import type="androidx.core.content.ContextCompat" />
|
|
||||||
|
|
||||||
<import type="it.integry.integrywmsnative.MainApplication" />
|
|
||||||
|
|
||||||
<import type="it.integry.integrywmsnative.R" />
|
|
||||||
|
|
||||||
<import type="androidx.databinding.adapters.Converters"/>
|
|
||||||
|
|
||||||
<import type="android.graphics.Color" />
|
|
||||||
|
|
||||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
|
||||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
|
||||||
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:cardCornerRadius="12dp"
|
|
||||||
app:cardElevation="0dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="16dp">
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/dialog_title"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/dialog_title_text"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:text='@{viewmodel.mtbAart.codMart + (!UtilityString.isNullOrEmpty(viewmodel.batchLot) ? " (" + viewmodel.batchLot + ")" : "") }'
|
|
||||||
android:textColor="@color/colorPrimary"
|
|
||||||
android:textStyle="bold"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
|
||||||
tools:text="AV25D200010B"/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_below="@id/dialog_title_text"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:text='@{!UtilityString.isNullOrEmpty(viewmodel.mtbAart.diacod) ? viewmodel.mtbAart.diacod : ""}'
|
|
||||||
android:textColor="@color/red_600"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:visibility="@{UtilityString.isNullOrEmpty(viewmodel.mtbAart.diacod) ? View.GONE : View.VISIBLE}"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
|
||||||
tools:text="DIACOD HERE"/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:paddingStart="8dp"
|
|
||||||
android:paddingEnd="0dp"
|
|
||||||
android:text='@{viewmodel.mtbAart.untMis != null ? "(" + viewmodel.mtbAart.untMis + ")" : ""}'
|
|
||||||
android:textColor="#000"
|
|
||||||
android:textStyle="bold"
|
|
||||||
tools:text="(PZ)"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
|
||||||
app:layout_constraintRight_toRightOf="parent" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/dialog_title"
|
|
||||||
android:layout_marginTop="6dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<!--<androidx.appcompat.widget.AppCompatTextView-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:text="@string/description"-->
|
|
||||||
<!--android:textSize="16sp"-->
|
|
||||||
<!--tools:text="Descrizione" />-->
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{viewmodel.mtbAart.descrizioneEstesa}"
|
|
||||||
android:textStyle="bold"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
tools:text="RAD 25 D H/L 200 - 10 EL B BIANCO" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="@{viewmodel.qtaOrd == null ? View.GONE : View.VISIBLE}"
|
|
||||||
android:text="@string/ordered_abbr"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="@{viewmodel.qtaOrd == null ? View.GONE : View.VISIBLE}"
|
|
||||||
android:text='@{UtilityNumber.decimalToString(viewmodel.qtaOrd)}'
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingStart="4dp"
|
|
||||||
tools:text="1200" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="12dp"
|
|
||||||
android:text="@string/dispatched_abbr"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:visibility="@{quantityViewModel.qtaEvasa.get() == 0 ? View.GONE : View.VISIBLE}" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text='@{UtilityNumber.decimalToString(quantityViewModel.qtaEvasa.get())}'
|
|
||||||
android:visibility="@{quantityViewModel.qtaEvasa.get() == 0 ? View.GONE : View.VISIBLE}"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingLeft="4dp"
|
|
||||||
tools:text="1200" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/layout_qta_da_evadere"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/to_dispatch_abbr"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text='@{UtilityNumber.decimalToString(quantityViewModel.qtaDaEvadere.get())}'
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingLeft="4dp"
|
|
||||||
tools:text="1200" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/layout_qta_disponibile"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="12dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="("
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/available_abbr"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text='@{UtilityNumber.decimalToString(quantityViewModel.qtaDisponibile.get())}'
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:paddingStart="4dp"
|
|
||||||
tools:text="1200" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text=")"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/qta_description_text"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:paddingTop="4dp"
|
|
||||||
tools:text="2 CARTONI e 3 PEZZI"/>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
|
||||||
android:id="@+id/guideline_partita_data"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layout_constraintGuide_percent='@{quantityViewModel.shouldAskDataScad.get() == false ? 1.0f : 0.5f}'/>
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
|
||||||
android:id="@+id/input_partita_mag"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:enabled="@{quantityViewModel.canPartitaMagBeChanged}"
|
|
||||||
app:hintTextAppearance="@style/hint_text"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/guideline_partita_data"
|
|
||||||
android:nextFocusRight="@+id/input_data_scad"
|
|
||||||
style="@style/TextInputLayout.NoLine">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:inputType="textNoSuggestions"
|
|
||||||
android:hint="@string/batch_lot"
|
|
||||||
android:textAllCaps="true"
|
|
||||||
app:binding="@{quantityViewModel.batchLot}"/>
|
|
||||||
|
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/input_data_scad"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="11 nov 2018"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:enabled="@{quantityViewModel.canDataScadBeChanged}"
|
|
||||||
android:visibility="@{quantityViewModel.shouldAskDataScad.get() == false ? View.GONE : View.VISIBLE}"
|
|
||||||
app:binding="@{quantityViewModel.expireDateString}"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/guideline_partita_data"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"/>
|
|
||||||
|
|
||||||
|
|
||||||
<!--<android.support.design.widget.TextInputLayout-->
|
|
||||||
<!--android:id="@+id/input_data_scad_layout"-->
|
|
||||||
<!--android:layout_width="0dp"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:enabled="@{quantityViewModel.shouldAskDataScad.get()}"-->
|
|
||||||
<!--app:hintTextAppearance="@style/hint_text"-->
|
|
||||||
<!--app:layout_constraintStart_toEndOf="@id/guideline_partita_data"-->
|
|
||||||
<!--app:layout_constraintEnd_toEndOf="parent">-->
|
|
||||||
|
|
||||||
<!--<android.support.design.widget.TextInputEditText-->
|
|
||||||
<!--android:id="@+id/input_data_scad"-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:inputType="textNoSuggestions"-->
|
|
||||||
<!--android:hint="@string/expire_date"-->
|
|
||||||
<!--app:binding="@{quantityViewModel.expireDate}"/>-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--</android.support.design.widget.TextInputLayout>-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:weightSum="3">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
|
||||||
android:id="@+id/input_num_cnf"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:enabled="@{!(quantityViewModel.blockedQtaTot.get() && quantityViewModel.blockedQtaPerCnf.get())}"
|
|
||||||
style="@style/TextInputLayout.NoLine">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:inputType="number"
|
|
||||||
android:hint="@string/num_pcks"
|
|
||||||
android:gravity="end"
|
|
||||||
app:binding="@{quantityViewModel.numCnf}" >
|
|
||||||
</com.google.android.material.textfield.TextInputEditText>
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:id="@+id/input_qta_cnf"
|
|
||||||
android:enabled="@{!(quantityViewModel.blockedQtaTot.get() && quantityViewModel.blockedNumDiCnf.get())}"
|
|
||||||
style="@style/TextInputLayout.NoLine">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:inputType="numberDecimal"
|
|
||||||
android:hint="@string/qty_x_pck"
|
|
||||||
android:gravity="end"
|
|
||||||
app:binding="@{quantityViewModel.qtaCnf}"/>
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:id="@+id/input_qta_tot"
|
|
||||||
android:enabled="@{!(quantityViewModel.blockedNumDiCnf.get() && quantityViewModel.blockedQtaPerCnf.get())}"
|
|
||||||
style="@style/TextInputLayout.NoLine">
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:inputType="numberDecimal"
|
|
||||||
android:hint="@string/tot_qty"
|
|
||||||
android:gravity="end"
|
|
||||||
app:binding="@{quantityViewModel.qtaTot}"/>
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:weightSum="1">
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/close_lu_btn"
|
|
||||||
android:layout_weight="0.4"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/Button.PrimaryOutline"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginEnd="4dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/left_buttons_guideline"
|
|
||||||
app:strokeColor="@color/colorPrimary"
|
|
||||||
android:text="@string/action_close_ul"/>
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/abort_btn"
|
|
||||||
android:layout_weight="0.3"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/Button.DangerFull"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:layout_marginEnd="4dp"
|
|
||||||
android:paddingEnd="3dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/left_buttons_guideline"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/right_buttons_guideline"
|
|
||||||
app:icon="@drawable/ic_close_24dp"
|
|
||||||
app:iconGravity="textStart"/>
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/save_btn"
|
|
||||||
android:layout_weight="0.3"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/Button.PrimaryFull"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:layout_marginEnd="0dp"
|
|
||||||
android:paddingEnd="3dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/right_buttons_guideline"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:icon="@drawable/ic_save_24"
|
|
||||||
app:iconGravity="textStart"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
</layout>
|
|
||||||
@@ -1,540 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<data>
|
|
||||||
<variable
|
|
||||||
name="viewModel"
|
|
||||||
type="it.integry.integrywmsnative.view.bottomsheet.viewmodel.ArticoliInColloBottomSheetViewModel"
|
|
||||||
/>
|
|
||||||
<import type="android.view.View" />
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
|
||||||
android:id="@+id/bottom_sheet1"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@android:color/white"
|
|
||||||
app:behavior_peekHeight="?attr/actionBarSize"
|
|
||||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
|
|
||||||
app:behavior_hideable="false">
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/tap_action_layout"
|
|
||||||
android:padding="4dp"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
android:minHeight="?attr/actionBarSize"
|
|
||||||
android:background="@android:color/white">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/articoli_in_collo_sheet_button"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:drawableStart="@drawable/ic_box"
|
|
||||||
tools:text="2 REFERENCES"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:drawablePadding="12dp"
|
|
||||||
android:textColor="@color/colorPrimary"
|
|
||||||
android:paddingTop="12dp"
|
|
||||||
android:paddingBottom="8dp"
|
|
||||||
android:paddingLeft="16dp"
|
|
||||||
android:paddingRight="16dp"
|
|
||||||
android:elevation="0dp"
|
|
||||||
android:textAllCaps="true"
|
|
||||||
android:textSize="16sp"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text"/>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
|
||||||
android:id="@+id/articoli_in_collo_close_collo"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/Button.DangerOutline"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
android:text="@string/action_close_ul"
|
|
||||||
android:onClick="@{() -> viewModel.closeCurrentUL()}"
|
|
||||||
app:strokeColor="@color/red_600"/>
|
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
app:cardBackgroundColor="@android:color/white"
|
|
||||||
app:cardCornerRadius="4dp"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/details_text"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text"
|
|
||||||
android:textAllCaps="true"
|
|
||||||
android:textStyle="bold"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:padding="15dp"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
|
||||||
android:id="@+id/guideline1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layout_constraintGuide_percent="0.40" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:text="@string/date_text"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/guideline1"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/articoli_in_collo_details_date"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/guideline1"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
tools:text="TextView" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
|
||||||
android:id="@+id/guideline2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layout_constraintGuide_percent="0.40" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/articoli_in_collo_details_posizione"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:text="@string/position_text"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/guideline2"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:text="@{viewModel.mtbColt.posizione}"
|
|
||||||
style="@style/AppTheme.NewMaterial"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/guideline2"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
tools:text="TextView" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
|
||||||
android:id="@+id/guideline3"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layout_constraintGuide_percent="0.40" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:text="@string/prepared_by_text"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/guideline3"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:text="@{viewModel.mtbColt.preparatoDa}"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/guideline3"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
tools:text="TextView" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
|
||||||
android:id="@+id/guideline4"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layout_constraintGuide_percent="0.40" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:text="@string/customer"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/guideline4"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:text="@{viewModel.mtbColt.ragSocCliente}"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/guideline4"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
tools:text="TextView" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
app:cardBackgroundColor="@android:color/white"
|
|
||||||
app:cardCornerRadius="4dp"
|
|
||||||
android:layout_margin="8dp"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/already_read_articles"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text"
|
|
||||||
android:textAllCaps="true"
|
|
||||||
android:textStyle="bold"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingTop="14dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="center"
|
|
||||||
android:padding="16dp"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:layout_marginBottom="16dp"
|
|
||||||
android:visibility="@{viewModel.mtbColt == null || viewModel.mtbColt.mtbColr.size() == 0 ? View.VISIBLE : View.GONE}">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:tint="@color/empty_view_gray"
|
|
||||||
android:src="@drawable/ic_info_78dp"/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/empty_rows_in_mtbcolt"
|
|
||||||
android:textSize="20sp"
|
|
||||||
android:gravity="center"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text"
|
|
||||||
android:textColor="@color/empty_view_gray"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<com.linearlistview.LinearListView
|
|
||||||
android:id="@+id/linear_listview"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:dividerThickness="0.5dp" />
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</androidx.core.widget.NestedScrollView>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
|
||||||
android:id="@+id/appbar_bottom_sheet"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:minHeight="?attr/actionBarSize"
|
|
||||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
|
||||||
android:background="?attr/colorPrimary"
|
|
||||||
android:alpha="0">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
|
||||||
android:id="@+id/toolbar_bottom_sheet"
|
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
android:minHeight="?attr/actionBarSize"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:background="?attr/colorPrimary"
|
|
||||||
app:titleTextColor="@android:color/white"
|
|
||||||
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
|
||||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/articoli_in_collo_title"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Material.Title"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.ToolbarTitle.DarkActionBar"
|
|
||||||
tools:text="Num UL"/>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
</androidx.appcompat.widget.Toolbar>
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
|
||||||
</RelativeLayout>
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:visibility="gone"
|
|
||||||
android:id="@+id/bg"
|
|
||||||
android:background="#99000000"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/bottom_sheet_actions"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="#fff"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="16dp"
|
|
||||||
app:behavior_hideable="true"
|
|
||||||
app:behavior_peekHeight="160dp"
|
|
||||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/bottom_sheet_actions_quantity"
|
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/bottom_sheet_actions_title"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="Descrizione articolo"
|
|
||||||
android:textColor="#444"
|
|
||||||
android:maxLines="2"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:paddingStart="0dp"
|
|
||||||
android:paddingEnd="8dp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Medium"/>
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/bottom_sheet_actions_subtitle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
tools:text="ABF52IL"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/bottom_sheet_actions_quantity"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:gravity="end"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textStyle="bold"
|
|
||||||
tools:text="250 PZ"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"/>
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
|
||||||
android:id="@+id/guideline_action"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layout_constraintGuide_percent="0.50" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/guideline_action"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
android:gravity="center">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
|
||||||
android:id="@+id/bottom_sheet_actions_edit_btn"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="16dp"
|
|
||||||
android:background="@android:color/white"
|
|
||||||
android:scaleX="1.5"
|
|
||||||
android:scaleY="1.5"
|
|
||||||
android:src="@drawable/ic_edit_24dp"
|
|
||||||
android:tint="@color/green_600" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
android:text="@string/edit"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/guideline_action"
|
|
||||||
android:gravity="center">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
|
||||||
android:id="@+id/bottom_sheet_actions_delete_btn"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="16dp"
|
|
||||||
android:background="@android:color/white"
|
|
||||||
android:scaleX="1.5"
|
|
||||||
android:scaleY="1.5"
|
|
||||||
android:src="@drawable/ic_delete_24dp"
|
|
||||||
android:tint="@color/red_600" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
android:text="@string/delete"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
||||||
</layout>
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
|
|
||||||
<data>
|
|
||||||
<import type="android.view.View" />
|
|
||||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
|
||||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
|
||||||
<import type="it.integry.integrywmsnative.core.settings.SettingsManager" />
|
|
||||||
<variable
|
|
||||||
name="mtbColr"
|
|
||||||
type="it.integry.integrywmsnative.core.model.MtbColr"/>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="8dp">
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/linearLayout"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/qta_box"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent">
|
|
||||||
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{mtbColr.codMart}"
|
|
||||||
android:textColor="@color/colorPrimary"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
tools:text="COD MART" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{UtilityNumber.decimalToString(mtbColr.qtaCol) + mtbColr.mtbAart.untMis}"
|
|
||||||
android:visibility="@{SettingsManager.iDB().isFlagForceAllToColli() || (mtbColr.mtbAart != null && !mtbColr.mtbAart.flagQtaCnfFissaBoolean) ? View.VISIBLE : View.GONE}"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:paddingStart="6dp"
|
|
||||||
android:paddingEnd="6dp"
|
|
||||||
android:background="@drawable/badge2_round_corner"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
tools:text="PESO KG" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:text="@{mtbColr.getDescrizione()}"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:paddingStart="0dp"
|
|
||||||
android:paddingEnd="8dp"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
tools:text="Descrizione lunga articolo" />
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{`Lotto: ` + mtbColr.getPartitaMag()}"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:visibility="@{UtilityString.isNullOrEmpty(mtbColr.getPartitaMag()) ? View.INVISIBLE : View.VISIBLE}"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
tools:text="Lotto: ABCDE" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/qta_box"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingStart="12dp"
|
|
||||||
android:paddingEnd="12dp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/qta_textview"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@drawable/badge1_round_corner"
|
|
||||||
android:gravity="center"
|
|
||||||
android:paddingLeft="6dp"
|
|
||||||
android:paddingTop="2dp"
|
|
||||||
android:paddingRight="6dp"
|
|
||||||
android:paddingBottom="2dp"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:textAllCaps="true"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
|
||||||
tools:text="280.45\nCONF" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
</layout>
|
|
||||||
@@ -317,7 +317,7 @@
|
|||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_gravity="bottom|end"
|
android:layout_gravity="bottom|end"
|
||||||
android:layout_margin="@dimen/fab_margin"
|
android:layout_margin="@dimen/fab_margin"
|
||||||
android:onClick="@{() -> viewmodel.closeLU(false)}"
|
android:onClick="@{() -> viewmodel.closeLU(true)}"
|
||||||
android:tint="@android:color/white"
|
android:tint="@android:color/white"
|
||||||
app:visibility="@{view.thereIsAnOpenedUL}"
|
app:visibility="@{view.thereIsAnOpenedUL}"
|
||||||
app:srcCompat="@drawable/ic_check_black_24dp" />
|
app:srcCompat="@drawable/ic_check_black_24dp" />
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
<string name="action_insert_quantity">Inserisci quantità</string>
|
<string name="action_insert_quantity">Inserisci quantità</string>
|
||||||
<string name="action_insert_weight">Inserisci peso</string>
|
<string name="action_insert_weight">Inserisci peso</string>
|
||||||
<string name="dialog_input_peso_lu_description">Inserisci le informazioni del TIPO UL e il peso NETTO e LORDO</string>
|
<string name="dialog_input_peso_lu_description">Inserisci le informazioni del TIPO UL e il peso NETTO e LORDO</string>
|
||||||
|
<string name="action_close_order">Chiudi ordine</string>
|
||||||
<string name="action_show_created_ul">Mostra UL già create</string>
|
<string name="action_show_created_ul">Mostra UL già create</string>
|
||||||
<string name="action_recover_ul">Recupera UL</string>
|
<string name="action_recover_ul">Recupera UL</string>
|
||||||
<string name="action_print_ul">Stampa UL</string>
|
<string name="action_print_ul">Stampa UL</string>
|
||||||
@@ -199,6 +200,7 @@
|
|||||||
<string name="num_ords">Numero ordine</string>
|
<string name="num_ords">Numero ordine</string>
|
||||||
<string name="order_cod_jcoms">Commessa</string>
|
<string name="order_cod_jcoms">Commessa</string>
|
||||||
<string name="customer">Cliente</string>
|
<string name="customer">Cliente</string>
|
||||||
|
<string name="job">Commessa</string>
|
||||||
<string name="recipient">Destinatario</string>
|
<string name="recipient">Destinatario</string>
|
||||||
<string name="ship_date">Data consegna</string>
|
<string name="ship_date">Data consegna</string>
|
||||||
<string name="document_date">Data documento</string>
|
<string name="document_date">Data documento</string>
|
||||||
@@ -216,7 +218,7 @@
|
|||||||
<string name="gestione_A_L_only_accepted_message">Sono ammesse solo UL di <b>Acquisto</b> o <b>Lavorazione</b> qui</string>
|
<string name="gestione_A_L_only_accepted_message">Sono ammesse solo UL di <b>Acquisto</b> o <b>Lavorazione</b> qui</string>
|
||||||
<string name="gestione_A_V_not_accepted_message"><![CDATA[Le UL di tipo <b>Acquisto</b> o <b>Vendita</b> non sono ammesse qui]]></string>
|
<string name="gestione_A_V_not_accepted_message"><![CDATA[Le UL di tipo <b>Acquisto</b> o <b>Vendita</b> non sono ammesse qui]]></string>
|
||||||
<string name="gestione_V_not_accepted_message"><![CDATA[Le UL di tipo <b>Vendita</b> non sono ammesse qui]]></string>
|
<string name="gestione_V_not_accepted_message"><![CDATA[Le UL di tipo <b>Vendita</b> non sono ammesse qui]]></string>
|
||||||
<string name="too_much_lu_found_message">E\' stata trovata più di una UL</string>
|
<string name="too_much_lu_found_message_in_mono_lu">E\' stata trovata più di una UL in una posizione MONO-UL</string>
|
||||||
<string name="ask_print_message"><![CDATA[Si vuole procedere con la stampa dell\'etichetta?]]></string>
|
<string name="ask_print_message"><![CDATA[Si vuole procedere con la stampa dell\'etichetta?]]></string>
|
||||||
<string name="ask_position_of_lu_message">Scansiona il codice a barre di una <b>Posizione</b></string>
|
<string name="ask_position_of_lu_message">Scansiona il codice a barre di una <b>Posizione</b></string>
|
||||||
<string name="ask_production_line_of_lu_message">Scansiona il codice a barre di una <b>Linea di Produzione</b></string>
|
<string name="ask_production_line_of_lu_message">Scansiona il codice a barre di una <b>Linea di Produzione</b></string>
|
||||||
@@ -257,6 +259,7 @@
|
|||||||
<string name="ultime_arrivi_fornitore_title">Ultimi arrivi</string>
|
<string name="ultime_arrivi_fornitore_title">Ultimi arrivi</string>
|
||||||
|
|
||||||
<string name="exception_printer_not_found">Stampante non trovata</string>
|
<string name="exception_printer_not_found">Stampante non trovata</string>
|
||||||
|
<string name="exception_no_printer_found">Nessuna stampante trovata</string>
|
||||||
|
|
||||||
<string name="action_select_all">Seleziona tutto</string>
|
<string name="action_select_all">Seleziona tutto</string>
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
<string name="action_create_ul">Create new LU</string>
|
<string name="action_create_ul">Create new LU</string>
|
||||||
<string name="action_insert_quantity">Insert quantity</string>
|
<string name="action_insert_quantity">Insert quantity</string>
|
||||||
<string name="action_insert_weight">Insert weight</string>
|
<string name="action_insert_weight">Insert weight</string>
|
||||||
|
<string name="action_close_order">Close order</string>
|
||||||
<string name="action_show_created_ul">Show already created LU</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="dialog_input_peso_lu_description">Insert info about LU TYPE and NET / GROSS weight</string>
|
||||||
<string name="lu_info">LU\'s info</string>
|
<string name="lu_info">LU\'s info</string>
|
||||||
@@ -202,6 +203,7 @@
|
|||||||
<string name="num_ords">Orders number</string>
|
<string name="num_ords">Orders number</string>
|
||||||
<string name="order_cod_jcoms">Orders job</string>
|
<string name="order_cod_jcoms">Orders job</string>
|
||||||
<string name="customer">Customer</string>
|
<string name="customer">Customer</string>
|
||||||
|
<string name="job">Job</string>
|
||||||
<string name="recipient">Recipient</string>
|
<string name="recipient">Recipient</string>
|
||||||
<string name="ship_date">Ship date</string>
|
<string name="ship_date">Ship date</string>
|
||||||
<string name="document_date">Document date</string>
|
<string name="document_date">Document date</string>
|
||||||
@@ -219,7 +221,7 @@
|
|||||||
<string name="gestione_A_L_only_accepted_message">Only <b>Purchase</b> or <b>Production\'s</b> LU are accepted here</string>
|
<string name="gestione_A_L_only_accepted_message">Only <b>Purchase</b> or <b>Production\'s</b> LU are accepted here</string>
|
||||||
<string name="gestione_A_V_not_accepted_message">The LU of type Purchase or Sale is not accepted here</string>
|
<string name="gestione_A_V_not_accepted_message">The LU of type Purchase or Sale is not accepted here</string>
|
||||||
<string name="gestione_V_not_accepted_message">The LU of type Sale is not accepted here</string>
|
<string name="gestione_V_not_accepted_message">The LU of type Sale is not accepted here</string>
|
||||||
<string name="too_much_lu_found_message">Multiple LU found</string>
|
<string name="too_much_lu_found_message_in_mono_lu">Multiple LU found in MONO-LU position</string>
|
||||||
<string name="ask_print_message">Do you want print the label?</string>
|
<string name="ask_print_message">Do you want print the label?</string>
|
||||||
<string name="ask_position_of_lu_message">Please scan a <b>Position</b> barcode</string>
|
<string name="ask_position_of_lu_message">Please scan a <b>Position</b> barcode</string>
|
||||||
<string name="ask_production_line_of_lu_message">Please scan a <b>Production Line</b> barcode</string>
|
<string name="ask_production_line_of_lu_message">Please scan a <b>Production Line</b> barcode</string>
|
||||||
@@ -262,6 +264,7 @@
|
|||||||
<string name="ultime_arrivi_fornitore_title">Latest arrivals</string>
|
<string name="ultime_arrivi_fornitore_title">Latest arrivals</string>
|
||||||
|
|
||||||
<string name="exception_printer_not_found">Printer not found</string>
|
<string name="exception_printer_not_found">Printer not found</string>
|
||||||
|
<string name="exception_no_printer_found">No printer found</string>
|
||||||
|
|
||||||
<string name="action_select_all">Select all</string>
|
<string name="action_select_all">Select all</string>
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ buildscript {
|
|||||||
google()
|
google()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:4.1.0'
|
classpath 'com.android.tools.build:gradle:4.1.2'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath 'com.google.gms:google-services:4.3.4'
|
classpath 'com.google.gms:google-services:4.3.4'
|
||||||
classpath 'com.google.firebase:perf-plugin:1.3.3'
|
classpath 'com.google.firebase:perf-plugin:1.3.3'
|
||||||
|
|||||||
Reference in New Issue
Block a user