Compare commits
23 Commits
v1.32.22(3
...
v1.32.27(3
| Author | SHA1 | Date | |
|---|---|---|---|
| 35283fc11b | |||
| fc8469bf07 | |||
| 400f1440db | |||
| ad12e7e65b | |||
| a63e3817b5 | |||
| cbd772bf7e | |||
| e90bd46a42 | |||
| 96bd5d516c | |||
| d9306e13c2 | |||
| fc80baeaee | |||
| c0b49b68f7 | |||
| 73242bc208 | |||
| d4b60a51bd | |||
| 1bc687c79a | |||
| 3a6b0949d4 | |||
| bfc03a4ef9 | |||
| 4dfa796790 | |||
| f0db805c84 | |||
| 0cc742e103 | |||
| d01319c417 | |||
| c0b9496041 | |||
| d4e7832f80 | |||
| ac4a5b1d34 |
@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 362
|
||||
def appVersionName = '1.32.22'
|
||||
def appVersionCode = 367
|
||||
def appVersionName = '1.32.27'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -40,7 +40,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,7 +68,8 @@ 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();
|
||||
}
|
||||
@@ -161,4 +162,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;");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -58,7 +58,7 @@ public abstract class _BaseRepository<
|
||||
.collect(Collectors.toList());
|
||||
|
||||
var dataToDelete = finalLocalData.stream()
|
||||
.filter(x -> x.isSyncronized() && finalRemoteData.stream().noneMatch(y -> keyComparator.run(y, x)))
|
||||
.filter(x -> finalRemoteData.stream().noneMatch(y -> keyComparator.run(y, x)))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
var dataToInsert = finalRemoteData.stream()
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ public class DBSettingsModel {
|
||||
private boolean flagCanCreateInventario = true;
|
||||
private boolean flagCanAddUnknownItemsInventario = true;
|
||||
private boolean flagShouldAskToCreateOrUpdateRowInventario = false;
|
||||
private String commessaMagazzino;
|
||||
|
||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||
return flagSpedizioneEnableFakeGiacenza;
|
||||
@@ -436,4 +437,13 @@ public class DBSettingsModel {
|
||||
this.flagConsentiFuoriPianoLogistico = flagConsentiFuoriPianoLogistico;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCommessaMagazzino() {
|
||||
return commessaMagazzino;
|
||||
}
|
||||
|
||||
public DBSettingsModel setCommessaMagazzino(String commessaMagazzino) {
|
||||
this.commessaMagazzino = commessaMagazzino;
|
||||
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;
|
||||
@@ -367,6 +368,10 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("INVENTARIO")
|
||||
.setKeySection("FLAG_SHOULD_ASK_TO_CREATE_OR_UPDATE_ROW"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SETUP")
|
||||
.setKeySection("COMMESSA_MAGAZZINO"));
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
mGestSetupRESTConsumer.getValues(codMdep, stbGestSetupList, list -> {
|
||||
@@ -403,6 +408,7 @@ public class SettingsManager {
|
||||
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));
|
||||
|
||||
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
|
||||
if (notePerdita != null)
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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());
|
||||
|
||||
@@ -652,7 +652,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 +684,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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user