Compare commits
94 Commits
v1.32.21(3
...
v1.33.10(3
| Author | SHA1 | Date | |
|---|---|---|---|
| 04720c1d97 | |||
| 0826aa0445 | |||
| 7ceb51a54b | |||
| e8351ca75b | |||
| 4ef49f3523 | |||
| f8ceb1fb2d | |||
| 21ed15a2ea | |||
| aacec1dfde | |||
| ac7e0443a6 | |||
| 4bbb0d5cbb | |||
| 05c28d62d8 | |||
| bf2ac81ab8 | |||
| 17a78ef044 | |||
| 3c78c2787a | |||
| c7358b536e | |||
| 4f9fe14f7e | |||
| 0934765176 | |||
| b7d3cb18b9 | |||
| 227c67dc23 | |||
| da3c9eae6e | |||
| bf37a1acaf | |||
| 2a8974e9c6 | |||
| c34d7dc777 | |||
| 461a2f705e | |||
| 705dd96a0e | |||
| 10128a1bae | |||
| 54d40ca06e | |||
| e4aa2d19d9 | |||
| 6251c0f1ac | |||
| 3caed63b7f | |||
| 75bc046cf5 | |||
| 97d27b047d | |||
| 44e00f4f98 | |||
| 81b053ee06 | |||
| f1b5a7ec1b | |||
| 2d4211d329 | |||
| c5ba78eeda | |||
| 1faaef7062 | |||
| 762c5fd5b5 | |||
| 9af5970ec7 | |||
| 3a5836ba4b | |||
| 72b0e29ae6 | |||
| e0cc802b62 | |||
| 2d4d9cef4e | |||
| 4a8a21b970 | |||
| 5103a53c11 | |||
| 11c4cba70c | |||
| b1dba20973 | |||
| 920c22083b | |||
| f9230ac341 | |||
| 6344c4b77d | |||
| d4c111dedc | |||
| 65dda1d5c0 | |||
| 4a7406fda1 | |||
| ef17e7a0c7 | |||
| c45850555e | |||
| 303690eed2 | |||
| ae62b26edf | |||
| 2e39754c20 | |||
| 0ae6bbcd96 | |||
| 529455931d | |||
| 46d0510ed8 | |||
| b02e12d76e | |||
| c6bbde2b67 | |||
| cfbb27a67b | |||
| 35283fc11b | |||
| c3d62f88b4 | |||
| fc8469bf07 | |||
| 400f1440db | |||
| ad12e7e65b | |||
| a63e3817b5 | |||
| cbd772bf7e | |||
| e90bd46a42 | |||
| 96bd5d516c | |||
| d9306e13c2 | |||
| fc80baeaee | |||
| c0b49b68f7 | |||
| 73242bc208 | |||
| d4b60a51bd | |||
| 1bc687c79a | |||
| 3a6b0949d4 | |||
| bfc03a4ef9 | |||
| 4dfa796790 | |||
| f0db805c84 | |||
| 0cc742e103 | |||
| d01319c417 | |||
| c0b9496041 | |||
| d4e7832f80 | |||
| cb4f9e68f5 | |||
| ac4a5b1d34 | |||
| 39ebc9d367 | |||
| 7ef0299282 | |||
| 6a998d6605 | |||
| 9eb4b0a621 |
@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 361
|
||||
def appVersionName = '1.32.21'
|
||||
def appVersionCode = 381
|
||||
def appVersionName = '1.33.10'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -31,8 +31,6 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
compileSdkVersion 33
|
||||
|
||||
defaultConfig {
|
||||
applicationId "it.integry.integrywmsnative"
|
||||
minSdkVersion 21
|
||||
@@ -65,8 +63,8 @@ android {
|
||||
android.buildFeatures.buildConfig true
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
coreLibraryDesugaringEnabled true
|
||||
}
|
||||
|
||||
@@ -90,8 +88,7 @@ android {
|
||||
abortOnError false
|
||||
}
|
||||
namespace 'it.integry.integrywmsnative'
|
||||
|
||||
|
||||
compileSdk 33
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -89,8 +89,8 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MainContext providesMainContextNew(MenuService menuService, AppDatabase appDatabase) {
|
||||
return new MainContext(mApplication.getApplicationContext(), menuService, appDatabase);
|
||||
MainContext providesMainContextNew(MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new MainContext(mApplication.getApplicationContext(), menuService, appDatabase, systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
||||
@@ -201,7 +201,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_pv_doc_interni)
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.doc_interni)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_contab_doc_interni)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_contab_doc_interni)
|
||||
.setDrawerIcon(R.drawable.ic_documents_outline)
|
||||
.setFragmentFactory(DocInterniFragment::newInstance))
|
||||
|
||||
// .addItem(new MenuItem()
|
||||
|
||||
@@ -6,6 +6,8 @@ import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.SpannedString;
|
||||
|
||||
import com.google.firebase.installations.FirebaseInstallations;
|
||||
|
||||
import java.net.ConnectException;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
@@ -13,6 +15,7 @@ import javax.inject.Singleton;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
||||
import it.integry.integrywmsnative.core.menu.MenuService;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityThread;
|
||||
@@ -23,13 +26,15 @@ public class MainContext {
|
||||
private final Context applicationContext;
|
||||
private final MenuService menuService;
|
||||
private final AppDatabase appDatabase;
|
||||
private final SystemRESTConsumer systemRESTConsumer;
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
public MainContext(Context applicationContext, MenuService menuService, AppDatabase appDatabase) {
|
||||
public MainContext(Context applicationContext, MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer) {
|
||||
this.applicationContext = applicationContext;
|
||||
this.menuService = menuService;
|
||||
this.appDatabase = appDatabase;
|
||||
this.systemRESTConsumer = systemRESTConsumer;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
@@ -40,10 +45,13 @@ public class MainContext {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
|
||||
this.initDBData(() -> {
|
||||
this.initMenu(() -> {
|
||||
|
||||
if (mListener != null) mListener.onContextInitialized();
|
||||
|
||||
this.initDeviceId(() -> {
|
||||
this.initDBData(() -> {
|
||||
this.initMenu(() -> {
|
||||
|
||||
if (mListener != null) mListener.onContextInitialized();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -52,6 +60,25 @@ public class MainContext {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void initDeviceId(Runnable onComplete) {
|
||||
if (SettingsManager.i().getUserSession().getDeviceId() != null) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
FirebaseInstallations.getInstance().getId().addOnCompleteListener(fid -> {
|
||||
SettingsManager.i().getUserSession().setDeviceId(fid.getResult());
|
||||
SettingsManager.update();
|
||||
|
||||
systemRESTConsumer.registerDevice(onComplete, ex -> {
|
||||
if (mListener != null) mListener.onError(new SpannedString(ex.getMessage()));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void logout(Runnable onLoggedOut) {
|
||||
menuService.invalidateCache();
|
||||
UtilityThread.executeParallel(() -> {
|
||||
|
||||
@@ -21,6 +21,7 @@ import it.integry.integrywmsnative.core.data_store.db.dao.InventarioRowDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.RawDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
@@ -40,7 +41,7 @@ import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
InventarioRoomDTO.class,
|
||||
InventarioRowRoomDTO.class
|
||||
},
|
||||
version = 16)
|
||||
version = 17)
|
||||
@TypeConverters({
|
||||
DateConverter.class,
|
||||
BigDecimalConverter.class,
|
||||
@@ -68,13 +69,16 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
.addMigrations(MIGRATION_12_13)
|
||||
.addMigrations(MIGRATION_13_14)
|
||||
.addMigrations(MIGRATION_14_15)
|
||||
.addMigrations(MIGRATION_15_16);
|
||||
.addMigrations(MIGRATION_15_16)
|
||||
.addMigrations(MIGRATION_16_17);
|
||||
|
||||
sInstance = builder.build();
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public abstract RawDao rawDao();
|
||||
|
||||
public abstract ArticoloGrigliaDao articoloGrigliaDao();
|
||||
|
||||
public abstract GrigliaDao grigliaDao();
|
||||
@@ -92,6 +96,7 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
public abstract InventarioRowDao inventarioRowDao();
|
||||
|
||||
|
||||
|
||||
static final Migration MIGRATION_10_11 = new Migration(10, 11) {
|
||||
@Override
|
||||
public void migrate(SupportSQLiteDatabase database) {
|
||||
@@ -161,4 +166,20 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
}
|
||||
};
|
||||
static final Migration MIGRATION_16_17 = new Migration(16, 17) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("ALTER TABLE inventario_rows RENAME TO _inventario_rows_old;");
|
||||
database.execSQL("DROP INDEX index_inventario_rows__id;");
|
||||
database.execSQL("DROP INDEX index_inventario_rows_parent_id;");
|
||||
|
||||
database.execSQL("CREATE TABLE inventario_rows (_id INTEGER PRIMARY KEY AUTOINCREMENT, parent_id INTEGER, cod_mart TEXT, partita_mag TEXT, descrizione TEXT, qta REAL NOT NULL DEFAULT 0, num_cnf REAL NOT NULL DEFAULT 0, qta_cnf REAL NOT NULL DEFAULT 0, unt_mis TEXT NOT NULL DEFAULT '0', data_ora_inv INTEGER, scan_cod_barre TEXT, zona TEXT, remote_sync_date INTEGER, FOREIGN KEY(parent_id) REFERENCES inventari(_id) ON UPDATE NO ACTION ON DELETE CASCADE);");
|
||||
|
||||
database.execSQL("INSERT INTO inventario_rows SELECT * FROM _inventario_rows_old;");
|
||||
|
||||
database.execSQL("CREATE INDEX index_inventario_rows__id ON inventario_rows (_id);");
|
||||
database.execSQL("CREATE INDEX index_inventario_rows_parent_id ON inventario_rows (parent_id)");
|
||||
database.execSQL("DROP TABLE _inventario_rows_old;");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import it.integry.integrywmsnative.core.data_store.db.dao.InventarioRowDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.RawDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoloGrigliaRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.GrigliaRepository;
|
||||
@@ -55,6 +56,11 @@ public class RoomModule {
|
||||
|
||||
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
RawDao providesRawDao(AppDatabase appDatabase) {
|
||||
return appDatabase.rawDao();
|
||||
}
|
||||
@Singleton
|
||||
@Provides
|
||||
ArticoloGrigliaDao providesArticoloGrigliaDao(AppDatabase appDatabase) {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.dao;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.RawQuery;
|
||||
import androidx.sqlite.db.SupportSQLiteQuery;
|
||||
|
||||
@Dao
|
||||
public interface RawDao {
|
||||
|
||||
@RawQuery
|
||||
int vacuumDb(SupportSQLiteQuery supportSQLiteQuery);
|
||||
|
||||
}
|
||||
@@ -239,15 +239,15 @@ public class ArticoloOrdine {
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnfPrevistaVendita() {
|
||||
return qtaPrevistaVendita.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaPrevistaVendita.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
return qtaPrevistaVendita == null || qtaPrevistaVendita.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaPrevistaVendita.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnfProposta() {
|
||||
return qtaProposta.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaProposta.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
return qtaProposta == null || qtaProposta.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaProposta.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnfGiacenza() {
|
||||
return giacenza.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : giacenza.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
return giacenza == null || giacenza.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : giacenza.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
}
|
||||
|
||||
public boolean isNewNoPromo() {
|
||||
@@ -259,7 +259,7 @@ public class ArticoloOrdine {
|
||||
}
|
||||
|
||||
public float getCnfDaRic() {
|
||||
return qtaCnf > 0.f ? merceDaRic * qtaCnf : 0;
|
||||
return qtaCnf > 0.f ? merceDaRic / qtaCnf : 0;
|
||||
}
|
||||
|
||||
public int checkQtaProposta() {
|
||||
|
||||
@@ -17,7 +17,8 @@ import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityModelInte
|
||||
@ForeignKey(
|
||||
entity = InventarioRoomDTO.class,
|
||||
parentColumns = {BaseSyncDTO.Columns.ID},
|
||||
childColumns = {InventarioRowRoomDTO.Columns.PARENT_ID}
|
||||
childColumns = {InventarioRowRoomDTO.Columns.PARENT_ID},
|
||||
onDelete = ForeignKey.CASCADE
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public class GridNotSelectedException extends Exception {
|
||||
|
||||
public GridNotSelectedException() {
|
||||
super(UtilityResources.getString(R.string.grid_not_selected));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -39,7 +39,6 @@ public class MvwSitArtUdcDetInventario {
|
||||
private String codJfas;
|
||||
private MtbAart mtbAart;
|
||||
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
@@ -283,7 +282,6 @@ public class MvwSitArtUdcDetInventario {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public MtbColr toMtbColr() {
|
||||
return new MtbColr()
|
||||
.setCodJcom(getCodJcom())
|
||||
|
||||
@@ -22,6 +22,7 @@ public class HttpInterceptor implements Interceptor {
|
||||
final String PROFILE_DB = SettingsManager.i().getUserSession() == null ? null : SettingsManager.i().getUserSession().getProfileDB();
|
||||
final String USERNAME = SettingsManager.i().getUser().getUsername();
|
||||
final String PASSWORD = SettingsManager.i().getUser().getPassword();
|
||||
final String DEVICE_ID = SettingsManager.i().getUserSession().getDeviceId();
|
||||
|
||||
final Request request = chain.request();
|
||||
final HttpUrl url = request.url().newBuilder()
|
||||
@@ -36,6 +37,7 @@ public class HttpInterceptor implements Interceptor {
|
||||
.addHeader("Accept", "*/*")
|
||||
.addHeader("username", USERNAME != null ? USERNAME : "")
|
||||
.addHeader("password", PASSWORD != null ? PASSWORD : "")
|
||||
.addHeader("device_id", DEVICE_ID != null ? DEVICE_ID : "")
|
||||
.url(url).build();
|
||||
|
||||
return chain.proceed(newRequest);
|
||||
|
||||
@@ -63,7 +63,7 @@ public class RESTBuilder {
|
||||
|
||||
OkHttpClient client = clientBuilder.build();
|
||||
|
||||
String endpoint = protocol + "://" + host + ":" + port + "/" + (addEmsApi ? "ems-api/" : "");
|
||||
String endpoint = protocol + "://" + host + (port > 0 ? ":" + port : "") + "/" + (addEmsApi ? "ems-api/" : "");
|
||||
|
||||
|
||||
Gson gson = new GsonBuilder()
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@@ -14,6 +15,7 @@ import javax.inject.Singleton;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||
import it.integry.integrywmsnative.core.model.MtbUntMis;
|
||||
import it.integry.integrywmsnative.core.model.dto.StatoArticoloDTO;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
@@ -58,6 +60,8 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
public static void getByCodMartsStatic(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
String joinedCods = Stream.of(codMartToFind)
|
||||
.withoutNulls()
|
||||
.distinct()
|
||||
.collect(Collectors.joining(","));
|
||||
|
||||
|
||||
@@ -131,8 +135,55 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbGrup>>() {
|
||||
}.getType();
|
||||
this.systemRESTConsumer.processSql("SELECT * FROM mtb_grup " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
||||
|
||||
this.systemRESTConsumer.processSql("SELECT * FROM mtb_grup " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
||||
}
|
||||
|
||||
|
||||
public void getUntMisArts(List<String> inputUntMis, RunnableArgs<List<MtbUntMis>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
List<HashMap<String, Object>> whereCondList = Stream.of(inputUntMis)
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.map(x -> {
|
||||
HashMap<String, Object> data = new HashMap<>();
|
||||
data.put("unt_mis", x);
|
||||
return data;
|
||||
})
|
||||
.toList();
|
||||
|
||||
var whereCond = whereCondList.isEmpty() ? "" : " WHERE " + UtilityQuery.concatFieldListInWhereCond(whereCondList);
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbUntMis>>() {
|
||||
}.getType();
|
||||
this.systemRESTConsumer.processSql("SELECT * FROM mtb_unt_mis " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
||||
}
|
||||
|
||||
public void fillMtbAartsWithMtbUntMis(List<MtbAart> inputMtbAart, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
var inputUntMis = new ArrayList<String>();
|
||||
|
||||
if (inputMtbAart != null && !inputMtbAart.isEmpty()) {
|
||||
inputUntMis.addAll(Stream.of(inputMtbAart)
|
||||
.map(MtbAart::getUntMis)
|
||||
.withoutNulls()
|
||||
.distinct()
|
||||
.toList());
|
||||
}
|
||||
|
||||
if (inputUntMis.isEmpty()) {
|
||||
onComplete.run(inputMtbAart);
|
||||
return;
|
||||
}
|
||||
|
||||
getUntMisArts(inputUntMis, mtbUntMiss -> {
|
||||
for (var item : inputMtbAart) {
|
||||
var mtbUntMis = Stream.of(mtbUntMiss).filter(x -> x.getUntMis().equalsIgnoreCase(item.getUntMis()))
|
||||
.findFirstOrElse(null);
|
||||
|
||||
if (mtbUntMis != null)
|
||||
item.setMtbUntMis(Collections.singletonList(mtbUntMis));
|
||||
}
|
||||
|
||||
onComplete.run(inputMtbAart);
|
||||
}, onFailed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
@@ -13,6 +14,7 @@ import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationIncomingItemDto;
|
||||
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationResponseDto;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import retrofit2.Call;
|
||||
@@ -120,7 +122,10 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<InstantItemSituationResponseDto>> call, Response<ServiceRESTResponse<InstantItemSituationResponseDto>> response) {
|
||||
analyzeAnswer(response, "getInstantItemSituation", onComplete, onFailed);
|
||||
analyzeAnswer(response, "getInstantItemSituation", data -> {
|
||||
|
||||
fillInstantItemSituationWithMtbAarts(data, onComplete, onFailed);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -130,5 +135,54 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
private void fillInstantItemSituationWithMtbAarts(InstantItemSituationResponseDto data, RunnableArgs<InstantItemSituationResponseDto> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
var inputCodMarts = new ArrayList<String>();
|
||||
|
||||
if (data.getIncomingItems() != null && !data.getIncomingItems().isEmpty()) {
|
||||
inputCodMarts.addAll(Stream.of(data.getIncomingItems())
|
||||
.map(InstantItemSituationIncomingItemDto::getCodMart)
|
||||
.toList());
|
||||
}
|
||||
|
||||
if (data.getAvailableItems() != null && !data.getAvailableItems().isEmpty()) {
|
||||
inputCodMarts.addAll(Stream.of(data.getAvailableItems())
|
||||
.map(MvwSitArtUdcDetInventario::getCodMart)
|
||||
.toList());
|
||||
}
|
||||
|
||||
if (inputCodMarts.isEmpty()) {
|
||||
onComplete.run(data);
|
||||
return;
|
||||
}
|
||||
|
||||
mArticoloRESTConsumer.getByCodMarts(inputCodMarts, mtbAarts -> {
|
||||
|
||||
mArticoloRESTConsumer.fillMtbAartsWithMtbUntMis(mtbAarts, newMtbAarts -> {
|
||||
if (data.getIncomingItems() != null && !data.getIncomingItems().isEmpty()) {
|
||||
for (var item : data.getIncomingItems()) {
|
||||
var mtbAart = Stream.of(newMtbAarts).filter(x -> x.getCodMart().equalsIgnoreCase(item.getCodMart()))
|
||||
.findFirstOrElse(null);
|
||||
|
||||
if (mtbAart != null)
|
||||
item.setMtbAart(mtbAart);
|
||||
}
|
||||
}
|
||||
|
||||
if (data.getAvailableItems() != null && !data.getAvailableItems().isEmpty()) {
|
||||
for (var item : data.getAvailableItems()) {
|
||||
var mtbAart = Stream.of(newMtbAarts).filter(x -> x.getCodMart().equalsIgnoreCase(item.getCodMart()))
|
||||
.findFirstOrElse(null);
|
||||
|
||||
if (mtbAart != null)
|
||||
item.setMtbAart(mtbAart);
|
||||
}
|
||||
}
|
||||
|
||||
onComplete.run(data);
|
||||
}, onFailed);
|
||||
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -61,7 +61,10 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
||||
.filter(x -> !UtilityString.isNullOrEmpty(x.getPartitaMag()))
|
||||
.forEach(x -> {
|
||||
|
||||
if (!Stream.of(batchLotsToSearch).anyMatch(batchLotToSearch -> batchLotToSearch.getCodMart().equalsIgnoreCase(x.getCodMart()) && batchLotToSearch.getPartitaMag().equalsIgnoreCase(x.getPartitaMag()))) {
|
||||
if (!Stream.of(batchLotsToSearch)
|
||||
.anyMatch(batchLotToSearch ->
|
||||
batchLotToSearch.getCodMart().equalsIgnoreCase(x.getCodMart()) &&
|
||||
batchLotToSearch.getPartitaMag().equalsIgnoreCase(x.getPartitaMag()))) {
|
||||
MtbPartitaMag mtbPartitaMag = new MtbPartitaMag()
|
||||
.setCodMart(x.getCodMart())
|
||||
.setPartitaMag(x.getPartitaMag());
|
||||
|
||||
@@ -29,6 +29,7 @@ import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.system.RegisterDeviceRequestDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
@@ -39,6 +40,27 @@ import retrofit2.Response;
|
||||
@Singleton
|
||||
public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
public void registerDevice(final Runnable onSuccess, final RunnableArgs<Exception> onFailed) {
|
||||
RegisterDeviceRequestDTO registerDeviceRequestDTO = new RegisterDeviceRequestDTO()
|
||||
.setApp("WMS");
|
||||
|
||||
SystemRESTConsumerService systemRESTConsumerService = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||
systemRESTConsumerService.registerDevice(registerDeviceRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "device/register", Void -> onSuccess.run(), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public <T> void processSql(String nativeSql, final Type clazz, final RunnableArgs<T> onComplete, final RunnableArgs<Exception> onFailed) {
|
||||
NativeSqlRequestDTO nativeSqlDTO = new NativeSqlRequestDTO();
|
||||
nativeSqlDTO.nativeSql = nativeSql;
|
||||
|
||||
@@ -6,6 +6,7 @@ import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.system.RegisterDeviceRequestDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
@@ -14,6 +15,9 @@ import retrofit2.http.Query;
|
||||
|
||||
public interface SystemRESTConsumerService {
|
||||
|
||||
@POST("device/register")
|
||||
Call<ServiceRESTResponse<Void>> registerDevice(@Body RegisterDeviceRequestDTO registerDeviceRequestDTO);
|
||||
|
||||
@POST("processSql")
|
||||
Call<ServiceRESTResponse<Object>> processSql(@Body NativeSqlRequestDTO nativeSqlDTO);
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ public class SitArtOrdDTO {
|
||||
private String descrizioneMsfa;
|
||||
private String untord;
|
||||
private BigDecimal qtaOmg;
|
||||
private BigDecimal qtaArrivo;
|
||||
|
||||
private final HashMap<String, Object> extraInfo = new HashMap<>();
|
||||
|
||||
@@ -232,4 +233,13 @@ public class SitArtOrdDTO {
|
||||
this.qtaOmg = qtaOmg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaArrivo() {
|
||||
return qtaArrivo;
|
||||
}
|
||||
|
||||
public SitArtOrdDTO setQtaArrivo(BigDecimal qtaArrivo) {
|
||||
this.qtaArrivo = qtaArrivo;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package it.integry.integrywmsnative.core.rest.model.giacenza;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
|
||||
public class InstantItemSituationIncomingItemDto {
|
||||
|
||||
private BigDecimal qtaOrd;
|
||||
@@ -21,6 +23,7 @@ public class InstantItemSituationIncomingItemDto {
|
||||
private String codJcom;
|
||||
private String codMdep;
|
||||
private String untMis;
|
||||
private MtbAart mtbAart;
|
||||
|
||||
public BigDecimal getQtaOrd() {
|
||||
return qtaOrd;
|
||||
@@ -85,4 +88,13 @@ public class InstantItemSituationIncomingItemDto {
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public MtbAart getMtbAart() {
|
||||
return mtbAart;
|
||||
}
|
||||
|
||||
public InstantItemSituationIncomingItemDto setMtbAart(MtbAart mtbAart) {
|
||||
this.mtbAart = mtbAart;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.system;
|
||||
|
||||
public class RegisterDeviceRequestDTO {
|
||||
|
||||
private String app;
|
||||
|
||||
public String getApp() {
|
||||
return app;
|
||||
}
|
||||
|
||||
public RegisterDeviceRequestDTO setApp(String app) {
|
||||
this.app = app;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -39,10 +39,12 @@ public class DBSettingsModel {
|
||||
private boolean flagOrdinaNuoviArticoliInGriglia;
|
||||
private boolean flagOrdinaArticoliOnScan;
|
||||
private boolean flagConsentiFuoriPianoLogistico;
|
||||
private boolean flagConsentiOrdineSenzaGriglia;
|
||||
private String docInterniCheckFornitore;
|
||||
private String produzioneDefaultCodAnag;
|
||||
private boolean flagPrintPackingListOnOrderClose;
|
||||
private boolean flagPrintEtichetteOnOrderClose;
|
||||
private boolean flagPrintEtichetteOnLUClose;
|
||||
private int onNumCnfInputChanged = 1;
|
||||
private int onQtaTotInputChanged = 1;
|
||||
private boolean flagAccettazioneUseQtaOrd = false;
|
||||
@@ -56,6 +58,9 @@ public class DBSettingsModel {
|
||||
private boolean showCodFornSpedizione = true;
|
||||
private boolean flagCanCreateInventario = true;
|
||||
private boolean flagCanAddUnknownItemsInventario = true;
|
||||
private boolean flagShouldAskToCreateOrUpdateRowInventario = false;
|
||||
private String commessaMagazzino;
|
||||
private boolean flagGeneraDocumentoSpedizione = false;
|
||||
|
||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||
return flagSpedizioneEnableFakeGiacenza;
|
||||
@@ -282,6 +287,15 @@ public class DBSettingsModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagPrintEtichetteOnLUClose() {
|
||||
return flagPrintEtichetteOnLUClose;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagPrintEtichetteOnLUClose(boolean flagPrintEtichetteOnLUClose) {
|
||||
this.flagPrintEtichetteOnLUClose = flagPrintEtichetteOnLUClose;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getOnNumCnfInputChanged() {
|
||||
return onNumCnfInputChanged;
|
||||
}
|
||||
@@ -418,6 +432,15 @@ public class DBSettingsModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagShouldAskToCreateOrUpdateRowInventario() {
|
||||
return flagShouldAskToCreateOrUpdateRowInventario;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagShouldAskToCreateOrUpdateRowInventario(boolean flagShouldAskToCreateOrUpdateRowInventario) {
|
||||
this.flagShouldAskToCreateOrUpdateRowInventario = flagShouldAskToCreateOrUpdateRowInventario;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagConsentiFuoriPianoLogistico() {
|
||||
return flagConsentiFuoriPianoLogistico;
|
||||
}
|
||||
@@ -426,4 +449,31 @@ public class DBSettingsModel {
|
||||
this.flagConsentiFuoriPianoLogistico = flagConsentiFuoriPianoLogistico;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagConsentiOrdineSenzaGriglia() {
|
||||
return flagConsentiOrdineSenzaGriglia;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagConsentiOrdineSenzaGriglia(boolean flagConsentiOrdineSenzaGriglia) {
|
||||
this.flagConsentiOrdineSenzaGriglia = flagConsentiOrdineSenzaGriglia;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCommessaMagazzino() {
|
||||
return commessaMagazzino;
|
||||
}
|
||||
|
||||
public DBSettingsModel setCommessaMagazzino(String commessaMagazzino) {
|
||||
this.commessaMagazzino = commessaMagazzino;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagGeneraDocumentoSpedizione() {
|
||||
return flagGeneraDocumentoSpedizione;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagGeneraDocumentoSpedizione(boolean flagGeneraDocumentoSpedizione) {
|
||||
this.flagGeneraDocumentoSpedizione = flagGeneraDocumentoSpedizione;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.List;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.StbGestSetup;
|
||||
import it.integry.integrywmsnative.core.model.dto.InternalCodAnagsDTO;
|
||||
@@ -310,7 +311,11 @@ public class SettingsManager {
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PVM")
|
||||
.setSection("ORDINI_A")
|
||||
.setKeySection("FLAG_CONSENTI_ORIDNE_DA_GRIGLIA"));
|
||||
.setKeySection("FLAG_CONSENTI_ORDINE_DA_GRIGLIA"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PVM")
|
||||
.setSection("ORDINI_A")
|
||||
.setKeySection("FLAG_CONSENTI_ORDINE_SENZA_GRIGLIA"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PVM")
|
||||
.setSection("DOC_INTERNI")
|
||||
@@ -331,6 +336,10 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_PRINT_ETICHETTE_ON_CLOSE"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_PRINT_ETICHETTE_ON_LU_CLOSE"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
@@ -363,6 +372,18 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("INVENTARIO")
|
||||
.setKeySection("FLAG_CAN_ADD_UNKNOWN_ITEMS"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("INVENTARIO")
|
||||
.setKeySection("FLAG_SHOULD_ASK_TO_CREATE_OR_UPDATE_ROW"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SETUP")
|
||||
.setKeySection("COMMESSA_MAGAZZINO"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("GENERA_DOC"));
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
mGestSetupRESTConsumer.getValues(codMdep, stbGestSetupList, list -> {
|
||||
@@ -387,9 +408,11 @@ public class SettingsManager {
|
||||
dbSettingsModelIstance.setFlagAccettazioneUseQtaOrd(getValueFromList(list, "ACCETTAZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagPickLiberoAllowEmptyDest(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_DEST", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagOrdinaArticoliOnScan(getValueFromList(list, "ORDINI_A", "ORDINA_ARTICOLI_ON_SCAN", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagConsentiFuoriPianoLogistico(getValueFromList(list, "ORDINI_A", "FLAG_CONSENTI_ORIDNE_DA_GRIGLIA", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagConsentiFuoriPianoLogistico(getValueFromList(list, "ORDINI_A", "FLAG_CONSENTI_ORDINE_DA_GRIGLIA", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagConsentiOrdineSenzaGriglia(getValueFromList(list, "ORDINI_A", "FLAG_CONSENTI_ORDINE_SENZA_GRIGLIA", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagPrintPackingListOnOrderClose(getValueFromList(list, "SPEDIZIONE", "FLAG_PRINT_PACKING_LIST_ON_CLOSE", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagPrintEtichetteOnOrderClose(getValueFromList(list, "SPEDIZIONE", "FLAG_PRINT_ETICHETTE_ON_CLOSE", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagPrintEtichetteOnLUClose(getValueFromList(list, "SPEDIZIONE", "FLAG_PRINT_ETICHETTE_ON_LU_CLOSE", Boolean.class, true));
|
||||
dbSettingsModelIstance.setFlagAskInfoAggiuntiveSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_ASK_INFO_AGGIUNTIVE", Boolean.class));
|
||||
dbSettingsModelIstance.setFilterFornitoreProd(getValueFromList(list, "PRODUZIONE", "FILTER_FORNTIORE_PROD", String.class));
|
||||
dbSettingsModelIstance.setCodDtipOrdTrasfV(getValueFromList(list, "SPEDIZIONE", "COD_DTIP_ORD_TRASF", String.class));
|
||||
@@ -398,6 +421,9 @@ public class SettingsManager {
|
||||
dbSettingsModelIstance.setGroupShippingByCommodityGroup(getValueFromList(list, "SPEDIZIONE", "FLAG_GROUP_BY_GRP_MERC", Boolean.class, Boolean.FALSE));
|
||||
dbSettingsModelIstance.setFlagCanCreateInventario(getValueFromList(list, "INVENTARIO", "FLAG_CAN_CREATE_INVENTARIO", Boolean.class, Boolean.TRUE));
|
||||
dbSettingsModelIstance.setFlagCanAddUnknownItemsInventario(getValueFromList(list, "INVENTARIO", "FLAG_CAN_ADD_UNKNOWN_ITEMS", Boolean.class, Boolean.TRUE));
|
||||
dbSettingsModelIstance.setFlagShouldAskToCreateOrUpdateRowInventario(getValueFromList(list, "INVENTARIO", "FLAG_SHOULD_ASK_TO_CREATE_OR_UPDATE_ROW", Boolean.class, Boolean.FALSE));
|
||||
dbSettingsModelIstance.setCommessaMagazzino(getValueFromList(list, "SETUP", "COMMESSA_MAGAZZINO", String.class, CommonConst.Config.COMMESSA_MAG));
|
||||
dbSettingsModelIstance.setFlagGeneraDocumentoSpedizione(getValueFromList(list, "SPEDIZIONE", "GENERA_DOC", Boolean.class, Boolean.FALSE));
|
||||
|
||||
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
|
||||
if (notePerdita != null)
|
||||
@@ -435,7 +461,7 @@ public class SettingsManager {
|
||||
} else if (clazz == Integer.class && value.getValue() != null) {
|
||||
return clazz.cast(Integer.parseInt(value.getValue()));
|
||||
}
|
||||
} else {
|
||||
} else if (defaultValue == null) {
|
||||
if (clazz == Boolean.class) {
|
||||
return clazz.cast(Boolean.FALSE);
|
||||
} else if (clazz == Integer.class) {
|
||||
|
||||
@@ -95,10 +95,19 @@ public class SettingsModel {
|
||||
}
|
||||
|
||||
public static class UserSession {
|
||||
private String deviceId;
|
||||
private String profileDB;
|
||||
private AvailableCodMdepsDTO depo;
|
||||
private Integer defaultOrdinamentoPickingAccettazione = 0;
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getProfileDB() {
|
||||
return profileDB;
|
||||
}
|
||||
|
||||
@@ -27,9 +27,11 @@ public class UpdatesManager {
|
||||
public void init(AppCompatActivity activityContext) {
|
||||
this.mContext = activityContext;
|
||||
|
||||
final String baseEndpoint = SettingsManager.i().getServer().getProtocol() + "://" + SettingsManager.i().getServer().getHost() +
|
||||
(SettingsManager.i().getServer().getPort() > 0 ? ":" + SettingsManager.i().getServer().getPort() : "");
|
||||
|
||||
String currentVersionUrl = SettingsManager.i().getServer().getProtocol() + "://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/currentVersion";
|
||||
String currentDownloadUrl = SettingsManager.i().getServer().getProtocol() + "://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/android-release.apk";
|
||||
final String currentVersionUrl = baseEndpoint + "/ems-api/wms/currentVersion";
|
||||
final String currentDownloadUrl = baseEndpoint + "/ems-api/wms/android-release.apk";
|
||||
|
||||
|
||||
AppUpdater appUpdater = new AppUpdater(mContext)
|
||||
|
||||
@@ -40,7 +40,6 @@ public class PermissionsHelper {
|
||||
}
|
||||
|
||||
|
||||
|
||||
String[] permissionArray = new String[permissionsToAsk.size()];
|
||||
permissionsToAsk.toArray(permissionArray);
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
|
||||
public class UntMisUtils {
|
||||
|
||||
public static boolean shouldBeShowInColli(MtbAart mtbAart) {
|
||||
return SettingsManager.iDB().isFlagForceAllToColli() || (mtbAart == null || !mtbAart.isFlagQtaCnfFissaBoolean());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -41,9 +41,15 @@ public class UtilityServer {
|
||||
public static void isEmsApiAvailable(final String protocol, final String serverAddress, final int serverTCPport, final Runnable onComplete, final RunnableArgs<Exception> onFailed) {
|
||||
new Thread(() -> {
|
||||
|
||||
String url = null;
|
||||
|
||||
if(serverTCPport > 0)
|
||||
url = String.format("%s://%s:%d/ems-api/system/ok", protocol, serverAddress, serverTCPport);
|
||||
else
|
||||
url = String.format("%s://%s/ems-api/system/ok", protocol, serverAddress);
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(String.format("%s://%s:%d/ems-api/system/ok", protocol, serverAddress, serverTCPport))
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try {
|
||||
|
||||
@@ -290,7 +290,7 @@ public class MainAccettazioneFragment extends BaseFragment implements ISearchabl
|
||||
DialogSimpleMessageView.makeInfoDialog(getText(R.string.orders).toString(),
|
||||
Html.fromHtml(String.format(getActivity().getResources().getQuantityString(R.plurals.loaded_orders_message, (int) ordsCounter), ordsCounter)
|
||||
+ "<br /><br />" +
|
||||
"<b>" + artsCounter + "</b> " + getActivity().getResources().getQuantityString(R.plurals.available_articles, (int) artsCounter)),
|
||||
"<b>" + artsCounter + "</b> " + getActivity().getResources().getQuantityString(R.plurals.ordered_articles, (int) artsCounter)),
|
||||
null,
|
||||
() -> {
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package it.integry.integrywmsnative.gest.contab_doc_interni;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -30,7 +29,6 @@ import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.rest.model.documento.DocumentoArtDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.databinding.FragmentDocInterniBinding;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoResponseDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoView;
|
||||
@@ -125,26 +123,7 @@ public class DocInterniFragment extends BaseFragment implements ITitledFragment,
|
||||
@Override
|
||||
public void onDocDetailsChanged(DialogSelectDocInfoResponseDTO selection) {
|
||||
mViewModel.setSelectedDocDetails(selection);
|
||||
|
||||
if (selection.isFornitoreRequired()) {
|
||||
mBinding.codAnagContainer.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mBinding.codAnagContainer.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
// if (selection.getGruppoArt() != null) {
|
||||
// mBinding.mtbGrpContainer.setVisibility(View.VISIBLE);
|
||||
// } else {
|
||||
// mBinding.mtbGrpContainer.setVisibility(View.GONE);
|
||||
// }
|
||||
|
||||
if (selection.isDocumentRequired()) {
|
||||
mBinding.docContainer.setVisibility(View.VISIBLE);
|
||||
mBinding.document.setText(Html.fromHtml(getString(R.string.doc_testata, String.valueOf(selection.getNumDoc()), UtilityDate.formatDate(selection.getDataDoc(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN))));
|
||||
} else {
|
||||
mBinding.docContainer.setVisibility(View.GONE);
|
||||
}
|
||||
mBinding.invalidateAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,7 +35,7 @@ public class DocInterniViewModel {
|
||||
private boolean docsFetched = true;
|
||||
private int nextNumCollo = 0;
|
||||
private List<DocumentoArtDTO> availableArts;
|
||||
private MutableLiveData<List<DocInternoWrapper>> mDocsList = new MutableLiveData<>();
|
||||
private final MutableLiveData<List<DocInternoWrapper>> mDocsList = new MutableLiveData<>();
|
||||
|
||||
public TipoDocDTO dtbTipi;
|
||||
public GruppoArticoloDTO mtbGrup;
|
||||
|
||||
@@ -9,7 +9,6 @@ import org.json.JSONObject;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -37,18 +36,17 @@ import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQua
|
||||
|
||||
public class DocInterniEditFormViewModel {
|
||||
|
||||
@Inject
|
||||
MtbColrDataSource mtbColrRepository;
|
||||
@Inject
|
||||
MtbColtRepository mtbColtRepository;
|
||||
private final MtbColrDataSource mtbColrRepository;
|
||||
private final MtbColtRepository mtbColtRepository;
|
||||
private final DocInterniRESTConsumer docInterniRESTConsumer;
|
||||
private DocInterniEditFormViewModel.Listener listener;
|
||||
private Listener listener;
|
||||
private List<DocumentoArtDTO> productsList;
|
||||
private HashMap<String, String> flattedBarcodesCodMarts;
|
||||
private TipoDocDTO tipoDoc;
|
||||
|
||||
private boolean isCheckPartitaMag = false;
|
||||
private JSONObject checkFornitoreRules = null;
|
||||
|
||||
|
||||
public MutableLiveData<SqlMtbColt> document = new MutableLiveData<>();
|
||||
public MutableLiveData<List<SqlMtbColr>> docRows = new MutableLiveData<>();
|
||||
|
||||
@@ -300,13 +298,6 @@ public class DocInterniEditFormViewModel {
|
||||
|
||||
public void setProductsList(List<DocumentoArtDTO> productsList) {
|
||||
this.productsList = productsList;
|
||||
this.flattedBarcodesCodMarts = new HashMap<>();
|
||||
|
||||
for (DocumentoArtDTO documentArt : productsList) {
|
||||
for (String barcode : documentArt.getBarcode()) {
|
||||
this.flattedBarcodesCodMarts.put(barcode, documentArt.getCodMart());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void processBarcode(BarcodeScanDTO dto) {
|
||||
|
||||
@@ -36,6 +36,8 @@ import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.databinding.ActivityPickingInventarioBinding;
|
||||
import it.integry.integrywmsnative.databinding.ActivityPickingInventarioListItemBinding;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsItemListModel;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsView;
|
||||
import it.integry.integrywmsnative.gest.inventario.bottom_sheet__inventario_row_actions.BottomSheetInventarioRowActionsView;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||
@@ -99,7 +101,8 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn
|
||||
mViewModel.init(
|
||||
DataCache.retrieveItem(getIntent().getStringExtra(KEY_INVENTARIO)),
|
||||
DataCache.retrieveItem(getIntent().getStringExtra(KEY_INVENTARIO_ARTS)),
|
||||
SettingsManager.iDB().isFlagCanAddUnknownItemsInventario());
|
||||
SettingsManager.iDB().isFlagCanAddUnknownItemsInventario(),
|
||||
SettingsManager.iDB().isFlagShouldAskToCreateOrUpdateRowInventario());
|
||||
|
||||
initToolbar();
|
||||
initBarcodeReader();
|
||||
@@ -176,8 +179,7 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn
|
||||
}
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||
});
|
||||
this.mViewModel.processBarcodeDTO(data, this::onLoadingEnded);
|
||||
};
|
||||
|
||||
|
||||
@@ -236,6 +238,36 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemAlreadyFound(InventarioArtDTO matchedArt, List<InventarioRowRoomDTO> alreadyScannedItems) {
|
||||
final List<DialogSelectDocRowsItemListModel<Object>> dialogSelectDocRowsItemListModels = Stream.of(alreadyScannedItems)
|
||||
.map(x -> new DialogSelectDocRowsItemListModel<>()
|
||||
.setBarcode(x.getScanCodBarre())
|
||||
.setCodMart(x.getCodMart())
|
||||
.setDescrizione(x.getDescrizione())
|
||||
.setQtaOrd(x.getQta())
|
||||
.setUntMisOrd(x.getUntMis())
|
||||
.setNew(false)
|
||||
.setOriginalModel(x))
|
||||
.toList();
|
||||
|
||||
dialogSelectDocRowsItemListModels.add(new DialogSelectDocRowsItemListModel<>()
|
||||
.setCodMart(matchedArt.getCodMart())
|
||||
.setDescrizione(matchedArt.getDescrizione())
|
||||
.setQtaOrd(BigDecimal.ZERO)
|
||||
.setUntMisOrd(matchedArt.getUntMis())
|
||||
.setNew(true));
|
||||
|
||||
DialogSelectDocRowsView.newInstance(dialogSelectDocRowsItemListModels, data -> {
|
||||
if (data.isNew())
|
||||
this.mViewModel.dispatchRowInsert(null, matchedArt, null);
|
||||
else
|
||||
this.mViewModel.dispatchRowEdit(matchedArt.toMtbAart(), (InventarioRowRoomDTO) data.getOriginalModel());
|
||||
}, () -> {
|
||||
|
||||
}).show(this.getSupportFragmentManager(), "DialogSelectDocRowsView");
|
||||
}
|
||||
|
||||
public void showAvailableArts() {
|
||||
var listaMtbAart = Stream.of(this.mViewModel.getAvailableArts())
|
||||
.map(InventarioArtDTO::toMtbAart)
|
||||
|
||||
@@ -4,6 +4,8 @@ import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
@@ -37,6 +39,7 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
private final InventarioRowRepository inventarioRowRepository;
|
||||
|
||||
private boolean canAddUnknownItems;
|
||||
private boolean flagShouldAskToCreateOrUpdateRowInventario;
|
||||
|
||||
public MutableLiveData<InventarioRoomDTO> currentInventario = new MutableLiveData<>();
|
||||
public LiveData<List<InventarioRowRoomDTO>> currentInventarioRows = new MutableLiveData<>();
|
||||
@@ -44,15 +47,14 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
private List<InventarioArtDTO> availableInventarioArts;
|
||||
private Listener mListener;
|
||||
|
||||
public PickingInventarioViewModel(
|
||||
InventarioRepository inventarioRepository,
|
||||
InventarioRowRepository inventarioRowRepository) {
|
||||
public PickingInventarioViewModel(InventarioRepository inventarioRepository, InventarioRowRepository inventarioRowRepository) {
|
||||
this.inventarioRepository = inventarioRepository;
|
||||
this.inventarioRowRepository = inventarioRowRepository;
|
||||
}
|
||||
|
||||
public void init(InventarioRoomDTO inventarioRoomDTO, List<InventarioArtDTO> inventarioArts, boolean canAddUnknownItems) {
|
||||
public void init(InventarioRoomDTO inventarioRoomDTO, List<InventarioArtDTO> inventarioArts, boolean canAddUnknownItems, boolean flagShouldAskToCreateOrUpdateRowInventario) {
|
||||
this.canAddUnknownItems = canAddUnknownItems;
|
||||
this.flagShouldAskToCreateOrUpdateRowInventario = flagShouldAskToCreateOrUpdateRowInventario;
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
@@ -80,6 +82,7 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
}
|
||||
|
||||
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
this.sendOnLoadingStarted();
|
||||
if (UtilityBarcode.isEanPeso(barcodeScanDTO)) {
|
||||
//Cerco tramite etichetta ean peso
|
||||
this.executeEtichettaEanPeso(barcodeScanDTO, onComplete);
|
||||
@@ -93,27 +96,17 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
var barcodeList = new ArrayList<String>();
|
||||
barcodeList.add(itemToUpdate.getScanCodBarre());
|
||||
|
||||
var matchedArt = availableInventarioArts.stream()
|
||||
.filter(x -> itemToUpdate.getCodMart() != null && x.getCodMart().contains(itemToUpdate.getCodMart()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
var matchedArt = availableInventarioArts.stream().filter(x -> itemToUpdate.getCodMart() != null && x.getCodMart().contains(itemToUpdate.getCodMart())).findFirst().orElse(null);
|
||||
|
||||
MtbAart articolo;
|
||||
|
||||
if (canAddUnknownItems && matchedArt == null) {
|
||||
matchedArt = new InventarioArtDTO()
|
||||
.setBarcode(barcodeList)
|
||||
.setFlagQtaCnfFissa(true)
|
||||
.setPlu(false)
|
||||
.setUntMis(itemToUpdate.getUntMis())
|
||||
.setQtaCnf(itemToUpdate.getQtaConf());
|
||||
matchedArt = new InventarioArtDTO().setBarcode(barcodeList).setFlagQtaCnfFissa(true).setPlu(false).setUntMis(itemToUpdate.getUntMis()).setQtaCnf(itemToUpdate.getQtaConf());
|
||||
}
|
||||
if (matchedArt != null) {
|
||||
articolo = matchedArt.toMtbAart()
|
||||
.setFlagTracciabilita("N");
|
||||
articolo = matchedArt.toMtbAart().setFlagTracciabilita("N");
|
||||
dispatchRowEdit(articolo, itemToUpdate);
|
||||
} else
|
||||
this.sendError(new NoResultFromBarcodeException(itemToUpdate.getScanCodBarre()));
|
||||
} else this.sendError(new NoResultFromBarcodeException(itemToUpdate.getScanCodBarre()));
|
||||
}
|
||||
|
||||
public void deleteRow(InventarioRowRoomDTO itemToDelete) {
|
||||
@@ -151,38 +144,42 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
var barcodeList = new ArrayList<String>();
|
||||
barcodeList.add(barcodeProd);
|
||||
|
||||
var matchedArt = availableInventarioArts.stream()
|
||||
.filter(x -> x.getBarcode().contains(barcodeProd))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
var matchedArt = availableInventarioArts.stream().filter(x -> x.getBarcode().contains(barcodeProd)).findFirst().orElse(null);
|
||||
|
||||
|
||||
if (canAddUnknownItems && matchedArt == null) {
|
||||
matchedArt = new InventarioArtDTO()
|
||||
.setBarcode(barcodeList)
|
||||
.setFlagQtaCnfFissa(true)
|
||||
.setPlu(false)
|
||||
.setUntMis("PZ")
|
||||
.setQtaCnf(BigDecimal.ONE);
|
||||
matchedArt = new InventarioArtDTO().setBarcode(barcodeList).setFlagQtaCnfFissa(true).setPlu(false).setUntMis("PZ").setQtaCnf(BigDecimal.ONE);
|
||||
|
||||
}
|
||||
|
||||
if (matchedArt != null) {
|
||||
this.dispatchRowInsert(barcodeProd, matchedArt, ean128Model);
|
||||
onComplete.run();
|
||||
} else
|
||||
this.sendError(new NoResultFromBarcodeException(barcodeProd));
|
||||
var alreadyScannedItems = searchArtInAlreadyScannedItems(matchedArt);
|
||||
|
||||
if (alreadyScannedItems == null || alreadyScannedItems.isEmpty() || !flagShouldAskToCreateOrUpdateRowInventario)
|
||||
this.dispatchRowInsert(barcodeProd, matchedArt, ean128Model);
|
||||
|
||||
else {
|
||||
this.sendOnItemAlreadyFound(matchedArt, alreadyScannedItems);
|
||||
|
||||
}
|
||||
onComplete.run();
|
||||
} else this.sendError(new NoResultFromBarcodeException(barcodeProd));
|
||||
}
|
||||
|
||||
private List<InventarioRowRoomDTO> searchArtInAlreadyScannedItems(InventarioArtDTO inventarioArtDTO) {
|
||||
final List<InventarioRowRoomDTO> inventarioRows = this.currentInventarioRows.getValue();
|
||||
|
||||
if (inventarioRows == null) return null;
|
||||
|
||||
return Stream.of(inventarioRows).filter(x -> x.getCodMart() != null ? x.getCodMart().equalsIgnoreCase(inventarioArtDTO.getCodMart()) : inventarioArtDTO.getBarcode().contains(x.getScanCodBarre())).toList();
|
||||
}
|
||||
|
||||
|
||||
private void dispatchRowInsert(String barcode, InventarioArtDTO inventarioArtDTO, Ean128Model ean128Model) {
|
||||
public void dispatchRowInsert(String barcode, InventarioArtDTO inventarioArtDTO, Ean128Model ean128Model) {
|
||||
var mtbAart = inventarioArtDTO.toMtbAart();
|
||||
mtbAart.setFlagTracciabilita("N");
|
||||
|
||||
PickingObjectDTO pickingObjectDTO = new PickingObjectDTO()
|
||||
.setMtbAart(mtbAart)
|
||||
.setTempPickData(PickDataDTO.fromEan128(ean128Model));
|
||||
PickingObjectDTO pickingObjectDTO = new PickingObjectDTO().setMtbAart(mtbAart).setTempPickData(PickDataDTO.fromEan128(ean128Model));
|
||||
|
||||
BigDecimal numCnfDaPrelevare = null;
|
||||
BigDecimal qtaColDaPrelevare = null;
|
||||
@@ -256,65 +253,26 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
}
|
||||
|
||||
if (inventarioArtDTO.isPlu()) {
|
||||
this.saveNewRow(pickingObjectDTO,
|
||||
initialNumCnf,
|
||||
initialQtaCnf,
|
||||
initialQtaTot,
|
||||
null,
|
||||
barcode);
|
||||
this.saveNewRow(pickingObjectDTO, initialNumCnf, initialQtaCnf, initialQtaTot, null, barcode);
|
||||
} else {
|
||||
|
||||
this.sendOnItemDispatched(
|
||||
pickingObjectDTO,
|
||||
pickingObjectDTO.getMtbAart(),
|
||||
null, //initialNumCnf,
|
||||
initialQtaCnf,
|
||||
null, //initialQtaTot,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
(pickedQuantityDTO, shouldCloseLU) -> {
|
||||
this.saveNewRow(pickingObjectDTO,
|
||||
pickedQuantityDTO.getNumCnf(),
|
||||
pickedQuantityDTO.getQtaCnf(),
|
||||
pickedQuantityDTO.getQtaTot(),
|
||||
pickedQuantityDTO.getPartitaMag(),
|
||||
barcode);
|
||||
this.sendOnItemDispatched(pickingObjectDTO, pickingObjectDTO.getMtbAart(), null, //initialNumCnf,
|
||||
initialQtaCnf, null, //initialQtaTot,
|
||||
null, null, null, null, null, null, false, true, false, (pickedQuantityDTO, shouldCloseLU) -> {
|
||||
this.saveNewRow(pickingObjectDTO, pickedQuantityDTO.getNumCnf(), pickedQuantityDTO.getQtaCnf(), pickedQuantityDTO.getQtaTot(), pickedQuantityDTO.getPartitaMag(), barcode);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void dispatchRowEdit(MtbAart mtbAart, InventarioRowRoomDTO inventarioRowRoomDTO) {
|
||||
public void dispatchRowEdit(MtbAart mtbAart, InventarioRowRoomDTO inventarioRowRoomDTO) {
|
||||
|
||||
final PickingObjectDTO pickingObjectDTO = new PickingObjectDTO()
|
||||
.setMtbAart(mtbAart);
|
||||
final PickingObjectDTO pickingObjectDTO = new PickingObjectDTO().setMtbAart(mtbAart);
|
||||
|
||||
|
||||
this.sendOnItemDispatched(
|
||||
pickingObjectDTO,
|
||||
pickingObjectDTO.getMtbAart(),
|
||||
inventarioRowRoomDTO.getNumConf(),
|
||||
inventarioRowRoomDTO.getQtaConf(),
|
||||
inventarioRowRoomDTO.getQta(),
|
||||
null, null, null,
|
||||
null, null, null,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
(pickedQuantityDTO, shouldCloseLU) -> {
|
||||
this.sendOnItemDispatched(pickingObjectDTO, pickingObjectDTO.getMtbAart(), inventarioRowRoomDTO.getNumConf(), inventarioRowRoomDTO.getQtaConf(), inventarioRowRoomDTO.getQta(), null, null, null, null, null, null, false, false, false, (pickedQuantityDTO, shouldCloseLU) -> {
|
||||
|
||||
this.saveEditedRow(inventarioRowRoomDTO,
|
||||
pickedQuantityDTO.getNumCnf(),
|
||||
pickedQuantityDTO.getQtaCnf(),
|
||||
pickedQuantityDTO.getQtaTot(),
|
||||
pickedQuantityDTO.getPartitaMag());
|
||||
});
|
||||
this.saveEditedRow(inventarioRowRoomDTO, pickedQuantityDTO.getNumCnf(), pickedQuantityDTO.getQtaCnf(), pickedQuantityDTO.getQtaTot(), pickedQuantityDTO.getPartitaMag());
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -361,36 +319,14 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
if (this.mListener != null) mListener.onError(ex);
|
||||
}
|
||||
|
||||
private void sendOnItemDispatched(PickingObjectDTO pickingObjectDTO,
|
||||
MtbAart mtbAart,
|
||||
BigDecimal initialNumCnf,
|
||||
BigDecimal initialQtaCnf,
|
||||
BigDecimal initialQtaTot,
|
||||
BigDecimal totalQtaAvailable,
|
||||
BigDecimal totalNumCnfAvailable,
|
||||
BigDecimal qtaCnfAvailable,
|
||||
BigDecimal totalQtaToBeTaken,
|
||||
BigDecimal totalNumCnfToBeTaken,
|
||||
BigDecimal qtaCnfToBeTaken,
|
||||
boolean canOverflowOrderQuantity,
|
||||
boolean canPartitaMagBeChanged,
|
||||
boolean canLUBeClosed,
|
||||
RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
||||
if (this.mListener != null) mListener.onItemDispatched(pickingObjectDTO,
|
||||
mtbAart,
|
||||
initialNumCnf,
|
||||
initialQtaCnf,
|
||||
initialQtaTot,
|
||||
totalQtaAvailable,
|
||||
totalNumCnfAvailable,
|
||||
qtaCnfAvailable,
|
||||
totalQtaToBeTaken,
|
||||
totalNumCnfToBeTaken,
|
||||
qtaCnfToBeTaken,
|
||||
canOverflowOrderQuantity,
|
||||
canPartitaMagBeChanged,
|
||||
canLUBeClosed,
|
||||
onComplete);
|
||||
private void sendOnItemDispatched(PickingObjectDTO pickingObjectDTO, MtbAart mtbAart, BigDecimal initialNumCnf, BigDecimal initialQtaCnf, BigDecimal initialQtaTot, BigDecimal totalQtaAvailable, BigDecimal totalNumCnfAvailable, BigDecimal qtaCnfAvailable, BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, boolean canOverflowOrderQuantity, boolean canPartitaMagBeChanged, boolean canLUBeClosed, RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
||||
if (this.mListener != null)
|
||||
mListener.onItemDispatched(pickingObjectDTO, mtbAart, initialNumCnf, initialQtaCnf, initialQtaTot, totalQtaAvailable, totalNumCnfAvailable, qtaCnfAvailable, totalQtaToBeTaken, totalNumCnfToBeTaken, qtaCnfToBeTaken, canOverflowOrderQuantity, canPartitaMagBeChanged, canLUBeClosed, onComplete);
|
||||
}
|
||||
|
||||
private void sendOnItemAlreadyFound(InventarioArtDTO matchedArt, List<InventarioRowRoomDTO> alreadyScannedItems) {
|
||||
if (this.mListener != null)
|
||||
this.mListener.onItemAlreadyFound(matchedArt, alreadyScannedItems);
|
||||
}
|
||||
|
||||
public PickingInventarioViewModel setListener(Listener listener) {
|
||||
@@ -402,22 +338,10 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
|
||||
void onError(Exception ex);
|
||||
|
||||
void onItemDispatched(PickingObjectDTO pickingObjectDTO,
|
||||
MtbAart mtbAart,
|
||||
BigDecimal initialNumCnf,
|
||||
BigDecimal initialQtaCnf,
|
||||
BigDecimal initialQtaTot,
|
||||
BigDecimal totalQtaAvailable,
|
||||
BigDecimal totalNumCnfAvailable,
|
||||
BigDecimal qtaCnfAvailable,
|
||||
BigDecimal totalQtaToBeTaken,
|
||||
BigDecimal totalNumCnfToBeTaken,
|
||||
BigDecimal qtaCnfToBeTaken,
|
||||
boolean canOverflowOrderQuantity,
|
||||
boolean canPartitaMagBeChanged,
|
||||
boolean canLUBeClosed,
|
||||
RunnableArgss<PickedQuantityDTO, Boolean> onComplete);
|
||||
void onItemDispatched(PickingObjectDTO pickingObjectDTO, MtbAart mtbAart, BigDecimal initialNumCnf, BigDecimal initialQtaCnf, BigDecimal initialQtaTot, BigDecimal totalQtaAvailable, BigDecimal totalNumCnfAvailable, BigDecimal qtaCnfAvailable, BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, boolean canOverflowOrderQuantity, boolean canPartitaMagBeChanged, boolean canLUBeClosed, RunnableArgss<PickedQuantityDTO, Boolean> onComplete);
|
||||
|
||||
|
||||
void onItemAlreadyFound(InventarioArtDTO matchedArt, List<InventarioRowRoomDTO> alreadyScannedItems);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,8 @@ import android.text.Html;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.google.firebase.installations.FirebaseInstallations;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -16,6 +18,7 @@ import it.integry.integrywmsnative.SplashActivity;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityWindow;
|
||||
import it.integry.integrywmsnative.databinding.ActivityLoginBinding;
|
||||
@@ -29,6 +32,9 @@ public class LoginActivity extends BaseActivity implements LoginViewModel.Listen
|
||||
@Inject
|
||||
LoginViewModel mViewmodel;
|
||||
|
||||
@Inject
|
||||
SystemRESTConsumer systemRESTConsumer;
|
||||
|
||||
|
||||
public BindableString username = new BindableString();
|
||||
public BindableString password = new BindableString();
|
||||
@@ -119,9 +125,13 @@ public class LoginActivity extends BaseActivity implements LoginViewModel.Listen
|
||||
|
||||
private void showProfileDBSelectionDialog(final String protocol, final String host, final int port, final List<String> availableProfiles) {
|
||||
Runnable onComplete = () -> {
|
||||
SettingsManager.update();
|
||||
|
||||
startSplashActivity();
|
||||
FirebaseInstallations.getInstance().getId().addOnCompleteListener(fid -> {
|
||||
SettingsManager.i().getUserSession().setDeviceId(fid.getResult());
|
||||
SettingsManager.update();
|
||||
|
||||
systemRESTConsumer.registerDevice(this::startSplashActivity, this::onError);
|
||||
});
|
||||
};
|
||||
|
||||
loginButtonEnabled.set(true);
|
||||
|
||||
@@ -797,7 +797,7 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
|
||||
listModel.setSubDescription(x.getRifOrd());
|
||||
|
||||
if(x.getDataConsD() != null) {
|
||||
if (x.getDataConsD() != null) {
|
||||
String testataDataConsString = String.format(getString(R.string.ord_ven_testata_data_cons), UtilityDate.formatDate(x.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
listModel.setRightDescription(testataDataConsString);
|
||||
}
|
||||
@@ -861,7 +861,7 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
DialogSimpleMessageView.makeInfoDialog(getText(R.string.orders).toString(),
|
||||
Html.fromHtml(String.format(getActivity().getResources().getQuantityString(R.plurals.loaded_orders_message, orders.size()), orders.size())
|
||||
+ "<br />" +
|
||||
"<b>" + codMarts.size() + "</b> " + getActivity().getResources().getQuantityString(R.plurals.available_articles, codMarts.size())
|
||||
"<b>" + codMarts.size() + "</b> " + getActivity().getResources().getQuantityString(R.plurals.ordered_articles, codMarts.size())
|
||||
+ "<br />" +
|
||||
"<b>" + alreadyRegisteredUL + "</b> " + getActivity().getResources().getQuantityString(R.plurals.already_registered_lu, alreadyRegisteredUL)),
|
||||
null,
|
||||
|
||||
@@ -356,7 +356,7 @@ public class ProdOrdineProduzioneElencoFragment extends BaseFragment implements
|
||||
DialogSimpleMessageView.makeInfoDialog(getText(R.string.orders).toString(),
|
||||
Html.fromHtml(String.format(getActivity().getResources().getQuantityString(R.plurals.loaded_orders_message, (int) ordsCounter), ordsCounter)
|
||||
+ "<br /><br />" +
|
||||
"<b>" + artsCounter + "</b> " + getActivity().getResources().getQuantityString(R.plurals.available_articles, (int) artsCounter)),
|
||||
"<b>" + artsCounter + "</b> " + getActivity().getResources().getQuantityString(R.plurals.ordered_articles, (int) artsCounter)),
|
||||
null,
|
||||
() -> {
|
||||
|
||||
|
||||
@@ -28,8 +28,9 @@ public class ProdRientroMerceViewModel {
|
||||
}
|
||||
|
||||
public void refreshOrderList() {
|
||||
new Thread(this::sendOnOrdersLoadingStarted).start();
|
||||
this.sendOnOrdersLoadingStarted();
|
||||
String codAnag = SettingsManager.iDB().getFilterFornitoreProd();
|
||||
|
||||
this.mMesRESTConsumer.getOrdiniLavorazione("I", null, codAnag, ordiniLavorazioneList -> {
|
||||
this.mOrdiniLavorazioneAperti.postValue(ordiniLavorazioneList);
|
||||
this.sendOnOrdersLoadingEnded();
|
||||
|
||||
@@ -195,7 +195,7 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity implements PVOrdi
|
||||
Toast.makeText(this, "Articolo aggiunto all'ordine!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
this.mViewModel.refreshListArticoli(onSuccess);
|
||||
}, null).show(this.getSupportFragmentManager(), "DialogEditArticoloView");
|
||||
}, this::onLoadingEnded).show(this.getSupportFragmentManager(), "DialogEditArticoloView");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,7 +10,6 @@ import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -217,6 +216,7 @@ public class PVOrdineAcquistoEditViewModel {
|
||||
saveAction.run();
|
||||
}
|
||||
} else {
|
||||
articolo.setQtaOrd(articolo.getQtaOrd() > 0f ? articolo.getQtaOrd() : articolo.getQtaCnf());
|
||||
this.sendOnItemDispatched(articolo, onSuccess);
|
||||
}
|
||||
|
||||
@@ -240,7 +240,6 @@ public class PVOrdineAcquistoEditViewModel {
|
||||
articolo.setFlagQtaMultipla(art.getFlagQtaMultipla());
|
||||
articolo.setQtaMinOrdinabile(art.getQtaMinOrdinabile());
|
||||
articolo.setMerceDaRic(art.getMerceDaRic());
|
||||
articolo.setQtaCnf(art.getQtaCnf());
|
||||
articolo.setUntMis(art.getUntMis());
|
||||
articolo.setDescrizione(art.getDescrizione());
|
||||
articolo.setDataIns(UtilityDate.getDateInstance());
|
||||
@@ -250,7 +249,7 @@ public class PVOrdineAcquistoEditViewModel {
|
||||
articolo.setQtaProposta(art.getQtaProposta());
|
||||
articolo.setNewNoPromo(art.isNewNoPromo());
|
||||
articolo.setSystemNote(art.generateSystemNote());
|
||||
articolo.setQtaOrd(art.getQtaOrd());
|
||||
articolo.setQtaCnf(art.getQtaCnf() > 0f ? art.getQtaCnf() : 1);
|
||||
articolo.setCodAlis(art.getCodAlis());
|
||||
articolo.setCtMaxOrd(BigDecimal.valueOf(art.getCtMaxOrd()));
|
||||
|
||||
@@ -279,9 +278,9 @@ public class PVOrdineAcquistoEditViewModel {
|
||||
}
|
||||
|
||||
private List<ArticoloOrdinabileDTO> getNewArticoli() {
|
||||
return mArticoliGriglia.stream()
|
||||
return Stream.of(mArticoliGriglia)
|
||||
.filter(x -> x.getQtaOrd() > 0f)
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
}
|
||||
|
||||
public void orderNewProducts() {
|
||||
|
||||
@@ -85,7 +85,7 @@ public class DialogEditArticoloView extends BaseDialogFragment implements Dialog
|
||||
this.mViewModel
|
||||
.setListener(this)
|
||||
.setCurrentArticolo(this.mArticolo)
|
||||
.setInitialQtaCnf(BigDecimal.valueOf(mArticolo.getQtaCnf()))
|
||||
.setInitialQtaCnf(BigDecimal.valueOf(mArticolo.getQtaCnf()).setScale(5, RoundingMode.HALF_UP))
|
||||
.setInitialNumCnf(UtilityBigDecimal.divide(BigDecimal.valueOf(mArticolo.getQtaOrd()), BigDecimal.valueOf(mArticolo.getQtaCnf())).setScale(0, RoundingMode.CEILING))
|
||||
.setInitialQtaTot(BigDecimal.valueOf(mArticolo.getQtaOrd()));
|
||||
|
||||
|
||||
@@ -14,9 +14,15 @@ import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.annimon.stream.Collectors;
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -109,6 +115,7 @@ public class PVOrdiniAcquistoGrigliaFragment extends BaseFragment implements ITi
|
||||
} else {
|
||||
setGriglia(griglia);
|
||||
setListaArticoli(listArticoli);
|
||||
this.onGrigliaRetrieved();
|
||||
}
|
||||
}).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
|
||||
@@ -119,6 +126,33 @@ public class PVOrdiniAcquistoGrigliaFragment extends BaseFragment implements ITi
|
||||
titleText.setText(context.getText(R.string.pv_elenco_ordiniA_title_fragment).toString());
|
||||
}
|
||||
|
||||
private void onGrigliaRetrieved() {
|
||||
if (UtilityString.isNullOrEmpty(mGriglia.getCodAlis())) {
|
||||
|
||||
Map<String, Long> downloadedGrids = Stream.of(mListArticoli).collect(Collectors.groupingBy(ArticoloOrdinabileDTO::getCodAlis, Collectors.counting()));
|
||||
if (downloadedGrids != null && !downloadedGrids.isEmpty()) {
|
||||
|
||||
List<String> gridsDetails = Stream.of(downloadedGrids)
|
||||
.map((el) -> "<b>" + el.getKey() + ":</b> " + el.getValue() + " " + getResources().getQuantityString(R.plurals.available_articles, el.getValue().intValue()))
|
||||
.toList();
|
||||
|
||||
|
||||
DialogSimpleMessageView.makeInfoDialog(getText(R.string.grid_details).toString(),
|
||||
Html.fromHtml(
|
||||
String.format(getResources().getQuantityString(R.plurals.loaded_grids_message, (int) downloadedGrids.size()), downloadedGrids.size())
|
||||
+ "<br /><br />" +
|
||||
StringUtils.join(gridsDetails, "<br/>")),
|
||||
null,
|
||||
this::fetchOrders)
|
||||
.show(requireActivity().getSupportFragmentManager(), "downloadedGridDetails");
|
||||
} else {
|
||||
fetchOrders();
|
||||
}
|
||||
} else {
|
||||
fetchOrders();
|
||||
}
|
||||
}
|
||||
|
||||
private void setGriglia(Griglia griglia) {
|
||||
mGriglia = griglia;
|
||||
mBinding.fabNewOrder.setVisibility(View.VISIBLE);
|
||||
@@ -129,7 +163,6 @@ public class PVOrdiniAcquistoGrigliaFragment extends BaseFragment implements ITi
|
||||
mBinding.descrLis.setText(griglia.getDescrLisa());
|
||||
}
|
||||
mBinding.descrDepo.setText(griglia.getDescrDepo());
|
||||
fetchOrders();
|
||||
}
|
||||
|
||||
private void setListaArticoli(List<ArticoloOrdinabileDTO> listArticoli) {
|
||||
@@ -161,7 +194,7 @@ public class PVOrdiniAcquistoGrigliaFragment extends BaseFragment implements ITi
|
||||
mBinding.ordiniAEmptyView.setVisibility(ordini == null || ordini.size() <= 0 ? View.VISIBLE : View.GONE);
|
||||
refreshRenderedOrdini(ordini);
|
||||
mAdapter.updateItems(mRenderedOrderList);
|
||||
if (mRenderedOrderList.size() <= 0 && mRedirectToNewOrder) {
|
||||
if (mRenderedOrderList.isEmpty() && mRedirectToNewOrder) {
|
||||
createNewOrder();
|
||||
} else {
|
||||
mRedirectToNewOrder = false;
|
||||
|
||||
@@ -23,6 +23,7 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.view_model.ArticoloOrdinabileDTO;
|
||||
import it.integry.integrywmsnative.core.exception.GridNotFoundException;
|
||||
import it.integry.integrywmsnative.core.exception.GridNotSelectedException;
|
||||
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
@@ -36,6 +37,7 @@ public class DialogScanGrigliaAcquistoView extends BaseDialogFragment {
|
||||
|
||||
private DialogScanCodiceGrigliaBinding mBinding;
|
||||
private int mBarcodeScannerIstanceID;
|
||||
public boolean canIgnoreGrid;
|
||||
|
||||
private final RunnableArgss<Griglia, List<ArticoloOrdinabileDTO>> mOnDialogDismiss;
|
||||
|
||||
@@ -53,6 +55,7 @@ public class DialogScanGrigliaAcquistoView extends BaseDialogFragment {
|
||||
private DialogScanGrigliaAcquistoView(RunnableArgss<Griglia, List<ArticoloOrdinabileDTO>> onDialogDismiss) {
|
||||
super();
|
||||
mOnDialogDismiss = onDialogDismiss;
|
||||
canIgnoreGrid = SettingsManager.iDB().isFlagConsentiOrdineSenzaGriglia();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -80,6 +83,12 @@ public class DialogScanGrigliaAcquistoView extends BaseDialogFragment {
|
||||
}
|
||||
|
||||
public void ignore() {
|
||||
|
||||
if (!this.canIgnoreGrid) {
|
||||
this.onError(new GridNotSelectedException());
|
||||
return;
|
||||
}
|
||||
|
||||
BarcodeManager.disable();
|
||||
|
||||
RunnableArgs<Exception> mOnError = exception -> {
|
||||
|
||||
@@ -217,7 +217,8 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
mViewModel.init(
|
||||
SettingsManager.i().getUser().getFullname(),
|
||||
SettingsManager.i().getUserSession().getDepo().getCodMdep(),
|
||||
mCurrentGestione);
|
||||
mCurrentGestione,
|
||||
SettingsManager.iDB().isFlagGeneraDocumentoSpedizione());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -57,6 +57,7 @@ public class RettificaGiacenzeViewModel {
|
||||
private String mCurrentUser;
|
||||
private String mCurrentCodMdep;
|
||||
private boolean mIsCreatedLU;
|
||||
private boolean generaDocIfVendita;
|
||||
|
||||
private boolean mAnyEditDone = false;
|
||||
|
||||
@@ -74,10 +75,11 @@ public class RettificaGiacenzeViewModel {
|
||||
}
|
||||
|
||||
|
||||
public void init(String currentUser, String currentCodMdep, GestioneEnum defaultGestione) {
|
||||
public void init(String currentUser, String currentCodMdep, GestioneEnum defaultGestione, boolean generaDocIfVendita) {
|
||||
this.mCurrentUser = currentUser;
|
||||
this.mCurrentCodMdep = currentCodMdep;
|
||||
this.mDefaultGestione = defaultGestione;
|
||||
this.generaDocIfVendita = generaDocIfVendita;
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
@@ -352,7 +354,6 @@ public class RettificaGiacenzeViewModel {
|
||||
|
||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
// if (!mIsCreatedLU && mCurrentMtbColt.isDocumentPresent()) {
|
||||
mtbColr
|
||||
.setQtaCol(BigDecimal.ZERO)
|
||||
.setNumCnf(BigDecimal.ZERO)
|
||||
@@ -382,39 +383,6 @@ public class RettificaGiacenzeViewModel {
|
||||
|
||||
if (shouldCloseLU) closeLU(true, null);
|
||||
}, this::sendError);
|
||||
// } else {
|
||||
// mtbColr
|
||||
// .setQtaCol(qtaTot)
|
||||
// .setQtaCnf(qtaCnf)
|
||||
// .setNumCnf(numCnf);
|
||||
//
|
||||
// MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||
// cloneMtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||
//
|
||||
// cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
||||
//
|
||||
// cloneMtbColt.getMtbColr().add(mtbColr);
|
||||
//
|
||||
// mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
||||
// mtbColr
|
||||
// .setDataCollo(value.getDataColloS())
|
||||
// .setNumCollo(value.getNumCollo())
|
||||
// .setGestione(value.getGestione())
|
||||
// .setSerCollo(value.getSerCollo())
|
||||
// .setRiga(value.getMtbColr().get(0).getRiga())
|
||||
// .setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||
// .setMtbAart(pickingObjectDTO.getMtbAart());
|
||||
//
|
||||
// mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||
//
|
||||
// this.mAnyEditDone = true;
|
||||
//
|
||||
// this.sendOnRowSaved();
|
||||
// this.sendOnLoadingEnded();
|
||||
//
|
||||
// if (shouldCloseLU) closeLU(true, null);
|
||||
// }, this::sendError);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -482,7 +450,7 @@ public class RettificaGiacenzeViewModel {
|
||||
}
|
||||
|
||||
private void createDoc(MtbColt mtbColt, Runnable onComplete) {
|
||||
if (!(mtbColt.getGestioneEnum() == GestioneEnum.VENDITA && mtbColt.getSegno() == -1)) {
|
||||
if (!(mtbColt.getGestioneEnum() == GestioneEnum.VENDITA && mtbColt.getSegno() == -1) || !generaDocIfVendita) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15,16 +15,19 @@ import androidx.preference.EditTextPreference;
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
import androidx.sqlite.db.SimpleSQLiteQuery;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.harrysoft.androidbluetoothserial.BluetoothManager;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -34,6 +37,7 @@ import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.context.AppContext;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.RawDao;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.MailAttachmentDTO;
|
||||
@@ -47,10 +51,16 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
||||
|
||||
@Inject
|
||||
public AppContext appContext;
|
||||
|
||||
@Inject
|
||||
public RawDao rawDao;
|
||||
|
||||
@Inject
|
||||
public SystemRESTConsumer systemRESTConsumer;
|
||||
|
||||
@Inject
|
||||
public DialogProgressView mCurrentProgress;
|
||||
|
||||
@Inject
|
||||
public ExecutorService executorService;
|
||||
|
||||
@@ -223,29 +233,52 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
||||
executorService.execute(() -> {
|
||||
|
||||
|
||||
File yourFile = appContext.getLogFilePath();
|
||||
var files = yourFile.listFiles();
|
||||
File logFilePath = appContext.getLogFilePath();
|
||||
var files = logFilePath.listFiles();
|
||||
|
||||
var fileToShare = Stream.of(files)
|
||||
.sortBy(x -> -1 * x.lastModified())
|
||||
.findFirstOrElse(null);
|
||||
try {
|
||||
var htmlContent = createAppLogAttachment(fileToShare);
|
||||
List<MailAttachmentDTO> attachmentDTOList = new ArrayList<>();
|
||||
|
||||
byte[] buffer = htmlContent.getBytes();//specify the size to allow.
|
||||
String base64 = Base64.encodeToString(buffer, Base64.NO_WRAP);
|
||||
if(fileToShare != null) {
|
||||
var htmlContent = createAppLogAttachment(fileToShare);
|
||||
|
||||
var attachment = new MailAttachmentDTO()
|
||||
.setFileName("wms_log.html")
|
||||
.setFileb64Content(base64);
|
||||
byte[] buffer = htmlContent.getBytes();//specify the size to allow.
|
||||
String base64 = Base64.encodeToString(buffer, Base64.NO_WRAP);
|
||||
|
||||
var logAttachment = new MailAttachmentDTO()
|
||||
.setFileName("wms_log.html")
|
||||
.setFileb64Content(base64);
|
||||
attachmentDTOList.add(logAttachment);
|
||||
}
|
||||
|
||||
|
||||
rawDao.vacuumDb(new SimpleSQLiteQuery("pragma wal_checkpoint(full)"));
|
||||
File[] dbFiles = new File[3];
|
||||
dbFiles[0] = requireContext().getDatabasePath("integry_wms");
|
||||
dbFiles[1] = requireContext().getDatabasePath("integry_wms-shm");
|
||||
dbFiles[2] = requireContext().getDatabasePath("integry_wms-wal");
|
||||
|
||||
for(int i = 0; i < dbFiles.length; i++){
|
||||
byte[] dbFileBytes = new byte[(int) dbFiles[i].length()];
|
||||
FileInputStream inputStream = new FileInputStream(dbFiles[i]);
|
||||
final int read = inputStream.read(dbFileBytes);
|
||||
inputStream.close();
|
||||
|
||||
var dbAttachment = new MailAttachmentDTO()
|
||||
.setFileName(dbFiles[i].getName())
|
||||
.setFileb64Content(Base64.encodeToString(dbFileBytes, Base64.NO_WRAP));
|
||||
attachmentDTOList.add(dbAttachment);
|
||||
}
|
||||
|
||||
var mailRequest = new MailRequestDTO()
|
||||
.setTo("developer@integry.it")
|
||||
.setMsgText("Questo è una mail che contiene il log del WMS")
|
||||
.setSubject("U vuemmeess")
|
||||
.setAttachments(new ArrayList<>());
|
||||
.setAttachments(attachmentDTOList);
|
||||
|
||||
mailRequest.getAttachments().add(attachment);
|
||||
|
||||
systemRESTConsumer.sendMail(mailRequest, this::closeProgress, ex -> {
|
||||
this.closeProgress();
|
||||
@@ -367,7 +400,13 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
||||
htmlContent.append("<hr/>");
|
||||
}
|
||||
|
||||
htmlContent.append("\n" + "<script type=\"text/javascript\">\n" + " document.querySelectorAll(\".message\").forEach(el => el.innerHTML = el.innerHTML.replaceAll(/at it\\.integry.*?(?:<br>)/g, '<b>$&</b>'));\n" + "</script>\n" + "</body>\n" + "</html>");
|
||||
htmlContent.append("""
|
||||
|
||||
<script type="text/javascript">
|
||||
document.querySelectorAll(".message").forEach(el => el.innerHTML = el.innerHTML.replaceAll(/at it\\.integry.*?(?:<br>)/g, '<b>$&</b>'));
|
||||
</script>
|
||||
</body>
|
||||
</html>""");
|
||||
|
||||
return htmlContent.toString();
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UntMisUtils;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
@@ -175,7 +176,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
setSupportActionBar(mBindings.toolbar);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
|
||||
mFlagShowCodForn = SettingsManager.iDB().isShowCodFornSpedizione();
|
||||
mDivideByGrpMerc = SettingsManager.iDB().isGroupShippingByCommodityGroup();
|
||||
|
||||
@@ -337,12 +338,11 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
||||
});
|
||||
|
||||
spedizioneListModel.setBadge2(x.getSitArtOrdDTO().getCodJcom());
|
||||
|
||||
if (!anyLUPresent) {
|
||||
spedizioneListModel.setGroupTitle(!mEnableFakeGiacenza ? getString(R.string.picking_not_available) : "");
|
||||
spedizioneListModel.setBadge2(getCommessa(x.getSitArtOrdDTO().getCodJcom()));
|
||||
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
if (UntMisUtils.shouldBeShowInColli(x.getMtbAart())) {
|
||||
spedizioneListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
spedizioneListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfOrd());
|
||||
spedizioneListModel.setQtaEvasa(numCnfWithdrawRows.getBigDecimalValue());
|
||||
@@ -378,15 +378,19 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
cloneModel.setGroupTitle(String.format("%s: %s", getString(R.string.position_text), UtilityString.isNullOrEmpty(mtbColtToPick.getPosizione()) ? "N.A." : mtbColtToPick.getPosizione()));
|
||||
|
||||
MtbColr mtbColrToDispatch = mtbColtToPick.getMtbColr() != null && mtbColtToPick.getMtbColr().size() > 0 ? mtbColtToPick.getMtbColr().get(0) : null;
|
||||
if (mtbColrToDispatch != null && !UtilityString.isNullOrEmpty(mtbColrToDispatch.getPartitaMag())) {
|
||||
cloneModel.setSubDescrizione1(String.format(getString(R.string.batch_lot_text), mtbColrToDispatch.getPartitaMag()));
|
||||
cloneModel.setBadge2(mtbColrToDispatch.getCodJcom());
|
||||
if (mtbColrToDispatch != null) {
|
||||
if(!UtilityString.isNullOrEmpty(mtbColrToDispatch.getPartitaMag()))
|
||||
cloneModel.setSubDescrizione1(String.format(getString(R.string.batch_lot_text), mtbColrToDispatch.getPartitaMag()));
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getCodJcom())) {
|
||||
cloneModel.setBadge2(getCommessa(mtbColrToDispatch.getCodJcom()));
|
||||
}
|
||||
}
|
||||
cloneModel.setSourceMtbColr(mtbColrToDispatch);
|
||||
|
||||
cloneModel.setSubDescrizione2(String.format(getString(R.string.lu_number_data_text), mtbColtToPick.getNumCollo(), UtilityDate.formatDate(mtbColtToPick.getDataColloD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN)));
|
||||
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
|
||||
if (UntMisUtils.shouldBeShowInColli(x.getMtbAart())) {
|
||||
cloneModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
|
||||
BigDecimal numCnfOrdToSubstract = UtilityBigDecimal.getLowerBetween(mtbColrToDispatch.getNumCnf(), numCnfOrdCounter);
|
||||
@@ -514,9 +518,9 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
spedizioneListModel.setGroupTitle(groupTitle);
|
||||
|
||||
if (!anyLUPresent) {
|
||||
spedizioneListModel.setBadge2(x.getSitArtOrdDTO().getCodJcom());
|
||||
spedizioneListModel.setBadge2(getCommessa(x.getSitArtOrdDTO().getCodJcom()));
|
||||
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
if (UntMisUtils.shouldBeShowInColli(x.getMtbAart())) {
|
||||
spedizioneListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
spedizioneListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfOrd());
|
||||
spedizioneListModel.setQtaEvasa(numCnfWithdrawRows.getBigDecimalValue());
|
||||
@@ -547,9 +551,11 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
|
||||
MtbColr mtbColrToDispatch = mtbColtToPick.getMtbColr() != null && mtbColtToPick.getMtbColr().size() > 0 ? mtbColtToPick.getMtbColr().get(0) : null;
|
||||
if (mtbColrToDispatch != null && !UtilityString.isNullOrEmpty(mtbColrToDispatch.getPartitaMag())) {
|
||||
cloneModel.setSubDescrizione1(String.format(getString(R.string.batch_lot_text), mtbColrToDispatch.getPartitaMag()));
|
||||
cloneModel.setBadge2(mtbColrToDispatch.getCodJcom());
|
||||
if (mtbColrToDispatch != null) {
|
||||
if (!UtilityString.isNullOrEmpty(mtbColrToDispatch.getPartitaMag()))
|
||||
cloneModel.setSubDescrizione1(String.format(getString(R.string.batch_lot_text), mtbColrToDispatch.getPartitaMag()));
|
||||
|
||||
cloneModel.setBadge2(getCommessa(mtbColrToDispatch.getCodJcom()));
|
||||
}
|
||||
cloneModel.setSourceMtbColr(mtbColrToDispatch);
|
||||
|
||||
@@ -632,6 +638,19 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
return sortedList;
|
||||
}
|
||||
|
||||
private String getCommessa(String codJcom) {
|
||||
var commessaMagazzino = SettingsManager.iDB().getCommessaMagazzino();
|
||||
|
||||
if(UtilityString.isNullOrEmpty(commessaMagazzino)) {
|
||||
return UtilityString.isNull(codJcom, "Magazzino").toUpperCase();
|
||||
} else {
|
||||
if(commessaMagazzino.equalsIgnoreCase(codJcom) || codJcom == null)
|
||||
return "Magazzino".toUpperCase();
|
||||
else
|
||||
return codJcom.toUpperCase();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isThereAnyItemToPick(List<PickingObjectDTO> dataList) {
|
||||
return Stream.of(dataList)
|
||||
.anyMatch(x -> !x.isHidden());
|
||||
|
||||
@@ -588,7 +588,9 @@ public class SpedizioneViewModel {
|
||||
|
||||
private void executeMagazzinoAutomatico(MtbDepoPosizione mtbDepoPosizione, Runnable onComplete) {
|
||||
var magazzinoAutomaticoPickableArts = Stream.of(Objects.requireNonNull(this.mPickingList.getValue()))
|
||||
.filter(x -> Stream.of(x.getMtbColts()).anyMatch(y -> y.getPosizione() != null && y.getPosizione().equalsIgnoreCase(mtbDepoPosizione.getPosizione())))
|
||||
.filter(x -> Stream.of(x.getMtbColts()).anyMatch(y -> y.getPosizione() != null && y.getPosizione().equalsIgnoreCase(mtbDepoPosizione.getPosizione())) &&
|
||||
x.getSitArtOrdDTO() != null &&
|
||||
UtilityBigDecimal.greaterThan(x.getSitArtOrdDTO().getQtaOrd(), BigDecimal.ZERO))
|
||||
.toList();
|
||||
|
||||
var mtbAarts = Stream.of(magazzinoAutomaticoPickableArts)
|
||||
@@ -609,6 +611,10 @@ public class SpedizioneViewModel {
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
if (pickingObjectDTO == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
MagazzinoAutomaticoPickItemRequestDTO itemDto = new MagazzinoAutomaticoPickItemRequestDTO(selectedArt.getCodMart())
|
||||
.setQtaTot(pickingObjectDTO.getSitArtOrdDTO().getQtaOrd())
|
||||
.setNumCnf(pickingObjectDTO.getSitArtOrdDTO().getNumCnfOrd())
|
||||
@@ -652,7 +658,12 @@ public class SpedizioneViewModel {
|
||||
if (mEnableGiacenza) {
|
||||
|
||||
Stream.of(pickingList).forEach(pickingObjectDTO -> {
|
||||
if (Stream.of(pickingObjectDTO.getMtbColts()).anyMatch(x -> Objects.equals(x.getNumCollo(), scannedUL.getNumCollo()) && x.getDataColloS().equals(scannedUL.getDataColloS()) && x.getSerCollo().equalsIgnoreCase(scannedUL.getSerCollo()) && (scannedUL.getGestioneEnum() == GestioneEnum.ACQUISTO || scannedUL.getGestioneEnum() == GestioneEnum.LAVORAZIONE))) {
|
||||
if (Stream.of(pickingObjectDTO.getMtbColts())
|
||||
.anyMatch(x ->
|
||||
Objects.equals(x.getNumCollo(), scannedUL.getNumCollo()) &&
|
||||
x.getDataColloS().equals(scannedUL.getDataColloS()) &&
|
||||
x.getSerCollo().equalsIgnoreCase(scannedUL.getSerCollo()) &&
|
||||
(scannedUL.getGestioneEnum() == GestioneEnum.ACQUISTO || scannedUL.getGestioneEnum() == GestioneEnum.LAVORAZIONE))) {
|
||||
|
||||
matchPickingObject.add(pickingObjectDTO);
|
||||
}
|
||||
@@ -679,7 +690,13 @@ public class SpedizioneViewModel {
|
||||
ObservableArrayList<MtbColr> cloneMtbColrs = (ObservableArrayList<MtbColr>) cloneMtbColt.getMtbColr().clone();
|
||||
|
||||
|
||||
Stream.of(cloneMtbColt.getMtbColr()).filter(x -> !(UtilityString.equalsIgnoreCase(x.getCodMart(), matchedObject.getSitArtOrdDTO().getCodMart()) && UtilityString.equalsIgnoreCase(x.getCodTagl(), matchedObject.getSitArtOrdDTO().getCodTagl()) && UtilityString.equalsIgnoreCase(x.getCodCol(), matchedObject.getSitArtOrdDTO().getCodCol()) && (!mEnableCheckPartitaMag || UtilityString.equalsIgnoreCase(x.getPartitaMag(), matchedObject.getSitArtOrdDTO().getPartitaMag()) || UtilityString.isNullOrEmpty(matchedObject.getSitArtOrdDTO().getPartitaMag())))).forEach(cloneMtbColrs::remove);
|
||||
Stream.of(cloneMtbColt.getMtbColr())
|
||||
.filter(x -> !(UtilityString.equalsIgnoreCase(x.getCodMart(), matchedObject.getSitArtOrdDTO().getCodMart()) &&
|
||||
UtilityString.equalsIgnoreCase(x.getCodTagl(), matchedObject.getSitArtOrdDTO().getCodTagl()) &&
|
||||
UtilityString.equalsIgnoreCase(x.getCodCol(), matchedObject.getSitArtOrdDTO().getCodCol()) &&
|
||||
(!mEnableCheckPartitaMag || UtilityString.equalsIgnoreCase(x.getPartitaMag(), matchedObject.getSitArtOrdDTO().getPartitaMag()) ||
|
||||
UtilityString.isNullOrEmpty(matchedObject.getSitArtOrdDTO().getPartitaMag()))))
|
||||
.forEach(cloneMtbColrs::remove);
|
||||
|
||||
cloneMtbColt.setMtbColr(cloneMtbColrs);
|
||||
|
||||
@@ -1404,7 +1421,7 @@ public class SpedizioneViewModel {
|
||||
filledMtbColts,
|
||||
positionedMtbColts -> {
|
||||
|
||||
this.askPrint(shouldPrint, positionedMtbColts, () -> {
|
||||
this.askPrint((shouldPrint && SettingsManager.iDB().isFlagPrintEtichetteOnLUClose()), positionedMtbColts, () -> {
|
||||
Stream.of(positionedMtbColts)
|
||||
.filter(x -> !this.mColliRegistrati.contains(x))
|
||||
.forEach(x -> this.mColliRegistrati.add(x));
|
||||
|
||||
@@ -119,7 +119,7 @@ public class DialogInfoSituazioneArticoloView extends BaseDialogRowInfoView {
|
||||
availableItems = new ArrayList<>();
|
||||
|
||||
availableItems = Stream.of(availableItems)
|
||||
.filter(x -> UtilityDate.isAfterToday(x.getDataScad()))
|
||||
.filter(x -> x.getDataScad() == null || UtilityDate.isAfterToday(x.getDataScad()))
|
||||
.toList();
|
||||
|
||||
if(availableItems.isEmpty())
|
||||
@@ -141,7 +141,7 @@ public class DialogInfoSituazioneArticoloView extends BaseDialogRowInfoView {
|
||||
|
||||
var itemListCommessaNotMatchMatch = Stream.of(itemList)
|
||||
.filter(dialogInfoSituazioneArticoloAvailableListItem -> !dialogInfoSituazioneArticoloAvailableListItem.isCommessaMatch())
|
||||
.sortBy(x -> x.getDataScad())
|
||||
.sortBy(x -> x.getDataScad() == null ? UtilityDate.getNow() : x.getDataScad())
|
||||
.toList();
|
||||
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
||||
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgsss;
|
||||
@@ -150,8 +151,18 @@ public class SpedizioneListAdapter extends SectionedRecyclerViewAdapter<Spedizio
|
||||
holder.mBinding.freeQty.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
holder.mBinding.qtaEvasa.setText(UtilityNumber.decimalToString(pickingObjectDTO.getQtaEvasa()));
|
||||
holder.mBinding.qtaTot.setText(UtilityNumber.decimalToString(pickingObjectDTO.getQtaTot()));
|
||||
int cifreDec = CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS;
|
||||
if (pickingObjectDTO.getOriginalModel().getMtbAart() != null &&
|
||||
pickingObjectDTO.getOriginalModel().getMtbAart().getMtbUntMis() != null &&
|
||||
!pickingObjectDTO.getOriginalModel().getMtbAart().getMtbUntMis().isEmpty()) {
|
||||
|
||||
var mtbUntMis = pickingObjectDTO.getOriginalModel().getMtbAart().getMtbUntMis().get(0);
|
||||
if (mtbUntMis.isFlagDig()) cifreDec = 0;
|
||||
else cifreDec = Math.min(mtbUntMis.getCifreDec().intValue(), CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS);
|
||||
}
|
||||
|
||||
holder.mBinding.qtaEvasa.setText(UtilityNumber.decimalToString(pickingObjectDTO.getQtaEvasa(), cifreDec));
|
||||
holder.mBinding.qtaTot.setText(UtilityNumber.decimalToString(pickingObjectDTO.getQtaTot(), cifreDec));
|
||||
|
||||
holder.mBinding.untMis.setText(pickingObjectDTO.getUntMis());
|
||||
holder.mBinding.untMis.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getUntMis()) ? View.GONE : View.VISIBLE);
|
||||
|
||||
@@ -158,8 +158,11 @@ public class DialogChooseArtsFromMtbColrList extends BaseDialogFragment implemen
|
||||
mBindings.listaArts.setHasFixedSize(true);
|
||||
|
||||
this.mtbColrItemModels = Stream.of(this.inputMtbColrList)
|
||||
.map(x -> new DialogChooseArtsFromMtbColrListItemModel()
|
||||
.setMtbColr(x))
|
||||
.map(x -> {
|
||||
x.setUntMis(x.getMtbAart() != null && x.getMtbAart().getFirstUntMis() != null ? x.getMtbAart().getFirstUntMis().getUntMis() : null);
|
||||
return new DialogChooseArtsFromMtbColrListItemModel()
|
||||
.setMtbColr(x);
|
||||
})
|
||||
.toList();
|
||||
|
||||
this.hiddenMtbColrItemModels.setValue(this.mtbColrItemModels);
|
||||
@@ -294,12 +297,12 @@ public class DialogChooseArtsFromMtbColrList extends BaseDialogFragment implemen
|
||||
this.articoloRESTConsumer.getByBarcodeProd(barcodeProd, mtbAartList -> {
|
||||
|
||||
if (mtbAartList != null && mtbAartList.size() > 0) {
|
||||
this.mBindings.mainSearch.setQuery(barcodeProd, false);
|
||||
MtbAart articolo = mtbAartList.get(0);
|
||||
this.mBindings.mainSearch.setQuery(articolo.getCodMart(), false);
|
||||
|
||||
this.searchArtInList(mtbAartList.get(0), ean128Model);
|
||||
|
||||
onLoadingEnded();
|
||||
|
||||
} else {
|
||||
|
||||
DialogCommon.showNoArtFoundDialog(mContext, this::onLoadingEnded);
|
||||
|
||||
@@ -44,6 +44,7 @@ import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbUntMis;
|
||||
import it.integry.integrywmsnative.core.model.secondary.StatoPartitaMag;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityFocus;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityObservable;
|
||||
@@ -513,7 +514,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
BigDecimal taraTot = articolo.getTaraKg() != null ? this.mViewModel.getNumCnf().multiply(articolo.getTaraKg()) : BigDecimal.ZERO;
|
||||
|
||||
this.currentTaraTot.set(taraTot);
|
||||
this.currentPesoLordo.set(this.mViewModel.getQtaTot().add(taraTot));
|
||||
this.currentPesoLordo.set(UtilityBigDecimal.getGreaterBetween(this.mViewModel.getQtaTot(), BigDecimal.ZERO).add(taraTot));
|
||||
this.flagShowCnfToTakeLabel.set(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -483,7 +483,8 @@ public class DialogInputQuantityV2ViewModel {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.canOverflowOrderQuantity && UtilityBigDecimal.greaterThan(this.internalNumCnf, this.totalNumCnfOrd)) {
|
||||
if (!this.canOverflowOrderQuantity && UtilityBigDecimal.greaterThan(this.internalNumCnf, this.totalNumCnfOrd) &&
|
||||
!this.mtbAart.get().isFlagQtaCnfFissaBoolean()) {
|
||||
|
||||
this.mListener.onError(new OverflowNumCnfOrderedQuantityException());
|
||||
return false;
|
||||
@@ -495,7 +496,8 @@ public class DialogInputQuantityV2ViewModel {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (UtilityBigDecimal.greaterThan(this.internalNumCnf, this.totalNumCnfAvailable)) {
|
||||
if (UtilityBigDecimal.greaterThan(this.internalNumCnf, this.totalNumCnfAvailable) &&
|
||||
!this.mtbAart.get().isFlagQtaCnfFissaBoolean()) {
|
||||
|
||||
this.mListener.onError(new OverflowNumCnfAvailableQuantityException());
|
||||
return false;
|
||||
|
||||
9
app/src/main/res/drawable/ic_documents_outline.xml
Normal file
9
app/src/main/res/drawable/ic_documents_outline.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M5,1C3.9,1 3,1.9 3,3L3,17L5,17L5,3L17,3L17,1L5,1zM9,5C7.9,5 7,5.9 7,7L7,21C7,22.1 7.9,23 9,23L20,23C21.1,23 22,22.1 22,21L22,10L17,5L9,5zM9,7L16,7L16,11L20,11L20,21L9,21L9,7zM11,13L11,15L18,15L18,13L11,13zM11,17L11,19L18,19L18,17L11,17z"
|
||||
android:fillColor="#5B5B5B"/>
|
||||
</vector>
|
||||
@@ -79,7 +79,6 @@
|
||||
app:cardElevation="4dp">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/profile_root_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/colorPrimary"
|
||||
@@ -93,7 +92,7 @@
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_doc_interni_outline"
|
||||
android:src="@drawable/ic_document_outline"
|
||||
android:tint="@color/white" />
|
||||
|
||||
|
||||
@@ -114,18 +113,10 @@
|
||||
android:layout_toStartOf="@id/loaded_arts_info_layout"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.TextBoxDashboard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="ID:"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.TextBoxDashboard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
app:binding="@{view.documentHeader}"
|
||||
android:textColor="@android:color/white"
|
||||
tools:text="670" />
|
||||
@@ -186,7 +177,7 @@
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="Non definito"
|
||||
android:textStyle="italic"
|
||||
app:visibility="@{view.documentRifHeader.get() == null}" />
|
||||
app:visibility="@{view.documentRifHeader.get().empty}" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
|
||||
@@ -194,7 +185,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
app:binding="@{view.documentRifHeader}"
|
||||
app:visibility="@{view.documentRifHeader.get() != null}" />
|
||||
app:reverse_visibility="@{view.documentRifHeader.get().empty}" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
@@ -216,7 +207,7 @@
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="Non definito"
|
||||
android:textStyle="italic"
|
||||
app:visibility="@{view.codAnag.get() == null}" />
|
||||
app:visibility="@{view.codAnag.get().empty}" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
|
||||
@@ -224,7 +215,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
app:binding="@{view.codAnag}"
|
||||
app:visibility="@{view.codAnag.get() != null}" />
|
||||
app:reverse_visibility="@{view.codAnag.get().empty}" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
@@ -163,7 +163,8 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/header_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:listitem="@layout/fragment_pv_articoli_ordine_acquisto__list_single_item" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/scan_art_spinner"
|
||||
@@ -266,7 +267,6 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
<import type="androidx.core.content.ContextCompat" />
|
||||
<import type="it.integry.integrywmsnative.R" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UntMisUtils" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
@@ -206,6 +207,34 @@
|
||||
android:visibility="@{item.qtaCol != null ? View.VISIBLE : View.GONE}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
android:gravity="center"
|
||||
android:text="@{UtilityNumber.decimalToString(item.numCnf, 0)}"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
app:visibility="@{UntMisUtils.shouldBeShowInColli(item.mtbAart)}"
|
||||
tools:text="280"
|
||||
tools:visibility="gone"/>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/unt_mis_col"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
app:visibility="@{UntMisUtils.shouldBeShowInColli(item.mtbAart)}"
|
||||
tools:text="CONF"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -216,6 +245,7 @@
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
app:reverse_visibility="@{UntMisUtils.shouldBeShowInColli(item.mtbAart)}"
|
||||
tools:text="280.45" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
@@ -227,6 +257,7 @@
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
app:reverse_visibility="@{UntMisUtils.shouldBeShowInColli(item.mtbAart)}"
|
||||
tools:text="CONF" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
@@ -7,10 +7,15 @@
|
||||
<data>
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityDate" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UntMisUtils" />
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationIncomingItemDto" />
|
||||
@@ -21,16 +26,16 @@
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="8dp"
|
||||
android:gravity="center_vertical">
|
||||
android:paddingVertical="8dp">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/qta_box"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_toStartOf="@id/qta_box">
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
@@ -53,7 +58,6 @@
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/qta_box"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -61,27 +65,58 @@
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="8dp"
|
||||
android:padding="6dp"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:padding="6dp"
|
||||
android:visibility="@{item.qtaOrd != null ? View.VISIBLE : View.GONE}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
android:gravity="center"
|
||||
android:text="@{UtilityNumber.decimalToString(item.qtaOrd, 2)}"
|
||||
android:text="@{UtilityNumber.decimalToString(item.numCnf, 0)}"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
app:visibility="@{UntMisUtils.shouldBeShowInColli(item.mtbAart)}"
|
||||
tools:text="280"
|
||||
tools:visibility="gone"/>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/unt_mis_col"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
app:visibility="@{UntMisUtils.shouldBeShowInColli(item.mtbAart)}"
|
||||
tools:text="CONF"
|
||||
tools:visibility="gone" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
android:gravity="center"
|
||||
android:text="@{UtilityNumber.decimalToString(item.qtaOrd, item.mtbAart.firstUntMis.cifreDec.intValue())}"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
app:reverse_visibility="@{UntMisUtils.shouldBeShowInColli(item.mtbAart)}"
|
||||
tools:text="280.45" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
@@ -89,7 +124,7 @@
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
app:reverse_visibility="@{UntMisUtils.shouldBeShowInColli(item.mtbAart)}"
|
||||
tools:text="CONF" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{UtilityNumber.decimalToString(view.articolo.merceDaRic)}"
|
||||
android:text="@{UtilityNumber.decimalToString(view.articolo.getCnfDaRic())}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold"
|
||||
tools:text="1" />
|
||||
@@ -285,7 +285,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text="@{UtilityNumber.decimalToString(view.articolo.getCnfDaRic())}"
|
||||
android:text="@{UtilityNumber.decimalToString(view.articolo.merceDaRic)}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.pv_ordini_acquisto.dialogs.DialogScanGrigliaAcquistoView" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
</data>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
@@ -95,6 +97,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryOutline"
|
||||
android:visibility="@{view.canIgnoreGrid ? View.VISIBLE : View.GONE}"
|
||||
android:onClick="@{() -> view.ignore()}"
|
||||
app:strokeColor="@color/blue_600"
|
||||
app:icon="@drawable/baseline_skip_next_24"
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
<data>
|
||||
|
||||
<import type="androidx.databinding.ObservableList" />
|
||||
<import type="it.integry.integrywmsnative.R" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityDate" />
|
||||
<import type="android.text.Html" />
|
||||
<import type="androidx.core.content.ContextCompat" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
@@ -31,216 +35,203 @@
|
||||
android:background="@color/full_white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<RelativeLayout
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="12dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="4dp">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:background="@drawable/gray_detail_background_round16"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@color/colorPrimary"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_documents_outline"
|
||||
android:tint="@color/white" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/cod_dtip_name"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp" />
|
||||
android:text="Tipo doc:" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_dtip"
|
||||
style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="Non definito"
|
||||
android:textStyle="italic"
|
||||
app:visibility="@{viewModel.dtbTipi.codDtip.empty}"
|
||||
tools:visibility="gone"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@{viewModel.dtbTipi.codDtip}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:reverse_visibility="@{viewModel.dtbTipi.codDtip.empty}"
|
||||
tools:text="114" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/desc_tipo_doc"
|
||||
style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@{viewModel.dtbTipi.descrizione}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:reverse_visibility="@{viewModel.dtbTipi.codDtip.empty}"
|
||||
tools:text="PERDITA" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/cod_anag_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:layout_marginTop="2dp"
|
||||
android:orientation="horizontal"
|
||||
app:reverse_visibility="@{viewModel.fornitore == null}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/cod_anag_name"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp" />
|
||||
android:text="Fornitore:" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_anag"
|
||||
style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@{viewModel.fornitore.label}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="F0000 - CARELLI" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/doc_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/document_label"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/document"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="n. 123 del 12/11/2021" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:layout_marginTop="2dp"
|
||||
android:orientation="horizontal"
|
||||
app:reverse_visibility="@{UtilityString.isNullOrEmpty(viewModel.numDoc)}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/articoli_disponibili"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
android:text="Documento:" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/count_arts"
|
||||
style="@style/AppTheme.NewMaterial.Text.TextBoxLittleDashboard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:binding="@{viewModel.artsSize}"
|
||||
tools:text="0" />
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@{Html.fromHtml(context.getString(R.string.doc_testata, viewModel.numDoc, UtilityDate.formatDate(viewModel.dataDoc, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN)))}"
|
||||
tools:text="n. 123 del 29/03/2023" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<RelativeLayout
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/doc_interni_main_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@color/full_white"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingEnd="2dp"
|
||||
tools:itemCount="5"
|
||||
tools:listitem="@layout/doc_interni_list_model" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/doc_interni_main_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@color/full_white"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingEnd="2dp" />
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/doc_interni_empty_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0.3">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/doc_interni_empty_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0.3">
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.2" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_top"
|
||||
android:layout_width="wrap_content"
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.15" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.85" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.2" />
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_playlist_add_check_24dp" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_left"
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.15" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.85" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:text="@string/no_doc_found_message"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_playlist_add_check_24dp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/no_doc_found_message"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</RelativeLayout>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
|
||||
@@ -108,7 +108,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@{articolo.bgTint}"
|
||||
android:visibility="@{articolo.invalid ? View.GONE : View.VISIBLE}"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingTop="2dp"
|
||||
|
||||
@@ -91,6 +91,10 @@
|
||||
<item quantity="other">articoli</item>
|
||||
</plurals>
|
||||
<plurals name="available_articles">
|
||||
<item quantity="one">articolo disponibile</item>
|
||||
<item quantity="other">articoli disponibili</item>
|
||||
</plurals>
|
||||
<plurals name="ordered_articles">
|
||||
<item quantity="one">articolo ordinato</item>
|
||||
<item quantity="other">articoli ordinati</item>
|
||||
</plurals>
|
||||
@@ -102,6 +106,10 @@
|
||||
<item quantity="one"><![CDATA[È stato selezionato <b>%d</b> ordine]]></item>
|
||||
<item quantity="other"><![CDATA[Sono stati selezionati <b>%d</b> ordini]]></item>
|
||||
</plurals>
|
||||
<plurals name="loaded_grids_message">
|
||||
<item quantity="one"><![CDATA[È stata scaricata <b>%d</b> griglia]]></item>
|
||||
<item quantity="other"><![CDATA[Sono state scaricate <b>%d</b> griglie]]></item>
|
||||
</plurals>
|
||||
<plurals name="pieces">
|
||||
<item quantity="one">@string/piece</item>
|
||||
<item quantity="other">pezzi</item>
|
||||
@@ -442,6 +450,7 @@
|
||||
<string name="no_arts_in_grid">Nessun articolo presente in griglia</string>
|
||||
<string name="invalid_quantity_ordered">La quantità ordinata non è valida</string>
|
||||
<string name="grid_not_found">La griglia selezionata non esiste o non presenta articoli</string>
|
||||
<string name="grid_not_selected">Nessuna griglia selezionata!</string>
|
||||
<string name="ignore">Ignora</string>
|
||||
<string name="max_orderable_qty">Qta massima ordinabile</string>
|
||||
<string name="max_qty_exceeded">Quantità massima superata</string>
|
||||
@@ -450,4 +459,5 @@
|
||||
<string name="invalid_product_ordered">L\'ordine presenta uno o più articoli non validi per la lista selezionata!</string>
|
||||
<string name="confirm_export_invalid_product"><![CDATA[Uno o più articoli ordinati non sono presenti nella lista selezionata! <br>Sei sicuro di voler continuare?]]></string>
|
||||
<string name="expired_list_session"><![CDATA[La lista di prodotti è stata caricata troppo tempo fa!]]></string>
|
||||
<string name="grid_details">Griglie disponibili</string>
|
||||
</resources>
|
||||
@@ -9,9 +9,15 @@
|
||||
</plurals>
|
||||
|
||||
<plurals name="available_articles">
|
||||
<item quantity="one">item available</item>
|
||||
<item quantity="other">items available</item>
|
||||
</plurals>
|
||||
|
||||
<plurals name="ordered_articles">
|
||||
<item quantity="one">ordered item</item>
|
||||
<item quantity="other">ordered items</item>
|
||||
</plurals>
|
||||
|
||||
<plurals name="already_registered_lu">
|
||||
<item quantity="one">already registered LU</item>
|
||||
<item quantity="other">already registered LUs</item>
|
||||
@@ -21,6 +27,10 @@
|
||||
<item quantity="one"><![CDATA[<b>%d</b> order selected]]></item>
|
||||
<item quantity="other"><![CDATA[<b>%d</b> orders selected]]></item>
|
||||
</plurals>
|
||||
<plurals name="loaded_grids_message">
|
||||
<item quantity="one"><![CDATA[<b>%d</b> grid downloaded]]></item>
|
||||
<item quantity="other"><![CDATA[<b>%d</b> grids downloaded]]></item>
|
||||
</plurals>
|
||||
<plurals name="pieces">
|
||||
<item quantity="one">@string/piece</item>
|
||||
<item quantity="other">pieces</item>
|
||||
@@ -449,6 +459,7 @@
|
||||
<string name="no_arts_in_grid">No product found in grid</string>
|
||||
<string name="invalid_quantity_ordered">Invalid quantity ordered</string>
|
||||
<string name="grid_not_found">The selected grid was not found or is empty</string>
|
||||
<string name="grid_not_selected">No grid was selected</string>
|
||||
<string name="ignore">Ignore</string>
|
||||
<string name="max_orderable_qty">Max orderable qty</string>
|
||||
<string name="max_qty_exceeded">Max quantity exceeded</string>
|
||||
@@ -457,4 +468,5 @@
|
||||
<string name="invalid_product_ordered">One or more ordered products are not available in the selected list!</string>
|
||||
<string name="confirm_export_invalid_product"><![CDATA[One or more ordered products are not available in the selected list! <br> Do you wish to continue?]]></string>
|
||||
<string name="expired_list_session"><![CDATA[The product list was loaded too much time ago!]]></string>
|
||||
<string name="grid_details">Available grids</string>
|
||||
</resources>
|
||||
|
||||
@@ -19,8 +19,8 @@ android {
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
lint {
|
||||
abortOnError false
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
buildscript {
|
||||
ext {
|
||||
kotlin_version = '1.8.0'
|
||||
agp_version = '8.1.0-alpha10'
|
||||
agp_version = '8.0.1'
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
@@ -19,8 +19,8 @@ android {
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
lint {
|
||||
abortOnError false
|
||||
|
||||
@@ -19,8 +19,8 @@ android {
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
lint {
|
||||
abortOnError false
|
||||
|
||||
@@ -18,8 +18,8 @@ android {
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
lint {
|
||||
abortOnError false
|
||||
|
||||
@@ -18,8 +18,8 @@ android {
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
lint {
|
||||
abortOnError false
|
||||
|
||||
Reference in New Issue
Block a user