Merge remote-tracking branch 'origin/develop' into develop
# Conflicts: # app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/_BaseRESTConsumer.java
This commit is contained in:
commit
21cf03a50b
17
.idea/deploymentTargetDropDown.xml
generated
Normal file
17
.idea/deploymentTargetDropDown.xml
generated
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<runningDeviceTargetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="SERIAL_NUMBER" />
|
||||
<value value="20119B1E55" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2022-12-12T15:40:54.351888Z" />
|
||||
</component>
|
||||
</project>
|
||||
@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 317
|
||||
def appVersionName = '1.29.13'
|
||||
def appVersionCode = 320
|
||||
def appVersionName = '1.30.02'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -83,12 +83,13 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener
|
||||
|
||||
private void initPermissions(Runnable onComplete) {
|
||||
PermissionsHelper.askPermissions(this, onComplete, permanentlyDenied -> {
|
||||
if (permanentlyDenied) {
|
||||
if (permanentlyDenied)
|
||||
onError(new SpannableString(getText(R.string.permissions_permanently_denied)));
|
||||
|
||||
} else {
|
||||
initPermissions(onComplete);
|
||||
}
|
||||
|
||||
// else {
|
||||
// initPermissions(onComplete);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.data_store.db;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.Database;
|
||||
import androidx.room.Room;
|
||||
import androidx.room.RoomDatabase;
|
||||
@ -39,7 +40,7 @@ import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
InventarioRoomDTO.class,
|
||||
InventarioRowRoomDTO.class
|
||||
},
|
||||
version = 12,
|
||||
version = 13,
|
||||
exportSchema = true)
|
||||
@TypeConverters({
|
||||
DateConverter.class,
|
||||
@ -64,7 +65,8 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
var builder = Room.databaseBuilder(applicationContext,
|
||||
AppDatabase.class, "integry_wms")
|
||||
.addMigrations(MIGRATION_10_11)
|
||||
.addMigrations(MIGRATION_11_12);
|
||||
.addMigrations(MIGRATION_11_12)
|
||||
.addMigrations(MIGRATION_12_13);
|
||||
|
||||
sInstance = builder.build();
|
||||
}
|
||||
@ -101,6 +103,7 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventario_rows__parent_id ON inventario_rows (parent_id)");
|
||||
}
|
||||
};
|
||||
|
||||
static final Migration MIGRATION_11_12 = new Migration(11, 12) {
|
||||
@Override
|
||||
public void migrate(SupportSQLiteDatabase database) {
|
||||
@ -111,4 +114,16 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
database.execSQL("ALTER TABLE ordini_tmp RENAME TO ordini;");
|
||||
}
|
||||
};
|
||||
|
||||
static final Migration MIGRATION_12_13 = new Migration(12, 13) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("CREATE TABLE IF NOT EXISTS inventario_rows_tmp (_id INTEGER PRIMARY KEY AUTOINCREMENT, parent_id INTEGER, cod_mart TEXT, descrizione TEXT, partita_mag 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 NO ACTION )");
|
||||
database.execSQL("INSERT INTO inventario_rows_tmp SELECT * FROM inventario_rows");
|
||||
database.execSQL("DROP TABLE inventario_rows;");
|
||||
database.execSQL("ALTER TABLE inventario_rows_tmp RENAME TO inventario_rows;");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventario_rows__id ON inventario_rows (_id)");
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventario_rows__parent_id ON inventario_rows (parent_id)");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -49,7 +49,6 @@ public class InventarioRowRoomDTO extends BaseSyncDTO implements EntityModelInte
|
||||
@ColumnInfo(index = true, name = Columns.PARENT_ID)
|
||||
private Long parentId;
|
||||
|
||||
@NonNull
|
||||
@ColumnInfo(name = Columns.COD_MART)
|
||||
private String codMart;
|
||||
|
||||
@ -93,7 +92,6 @@ public class InventarioRowRoomDTO extends BaseSyncDTO implements EntityModelInte
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
@ -177,4 +175,48 @@ public class InventarioRowRoomDTO extends BaseSyncDTO implements EntityModelInte
|
||||
public void setZona(String zona) {
|
||||
this.zona = zona;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
InventarioRowRoomDTO that = (InventarioRowRoomDTO) o;
|
||||
|
||||
if (getId() != null ? !getId().equals(that.getId()) : that.getId() != null) return false;
|
||||
if (getParentId() != null ? !getParentId().equals(that.getParentId()) : that.getParentId() != null)
|
||||
return false;
|
||||
if (getCodMart() != null ? !getCodMart().equals(that.getCodMart()) : that.getCodMart() != null)
|
||||
return false;
|
||||
if (getPartitaMag() != null ? !getPartitaMag().equals(that.getPartitaMag()) : that.getPartitaMag() != null)
|
||||
return false;
|
||||
if (getDescrizione() != null ? !getDescrizione().equals(that.getDescrizione()) : that.getDescrizione() != null)
|
||||
return false;
|
||||
if (!getQta().equals(that.getQta())) return false;
|
||||
if (!getNumConf().equals(that.getNumConf())) return false;
|
||||
if (!getQtaConf().equals(that.getQtaConf())) return false;
|
||||
if (!getUntMis().equals(that.getUntMis())) return false;
|
||||
if (getDataOraInv() != null ? !getDataOraInv().equals(that.getDataOraInv()) : that.getDataOraInv() != null)
|
||||
return false;
|
||||
if (getScanCodBarre() != null ? !getScanCodBarre().equals(that.getScanCodBarre()) : that.getScanCodBarre() != null)
|
||||
return false;
|
||||
return getZona() != null ? getZona().equals(that.getZona()) : that.getZona() == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = getId() != null ? getId().hashCode() : 0;
|
||||
result = 31 * result + (getParentId() != null ? getParentId().hashCode() : 0);
|
||||
result = 31 * result + (getCodMart() != null ? getCodMart().hashCode() : 0);
|
||||
result = 31 * result + (getPartitaMag() != null ? getPartitaMag().hashCode() : 0);
|
||||
result = 31 * result + (getDescrizione() != null ? getDescrizione().hashCode() : 0);
|
||||
result = 31 * result + getQta().hashCode();
|
||||
result = 31 * result + getNumConf().hashCode();
|
||||
result = 31 * result + getQtaConf().hashCode();
|
||||
result = 31 * result + getUntMis().hashCode();
|
||||
result = 31 * result + (getDataOraInv() != null ? getDataOraInv().hashCode() : 0);
|
||||
result = 31 * result + (getScanCodBarre() != null ? getScanCodBarre().hashCode() : 0);
|
||||
result = 31 * result + (getZona() != null ? getZona().hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import android.util.Log;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.exception.InvalidLicenseException;
|
||||
import it.integry.integrywmsnative.core.exception.NotValidLicenseException;
|
||||
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
||||
import it.integry.integrywmsnative.core.rest.model.EsitoType;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
@ -77,7 +77,7 @@ public abstract class _BaseRESTConsumer {
|
||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata");
|
||||
onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")"));
|
||||
} else if (response.code() == 550)
|
||||
onFailed.run(new InvalidLicenseException());
|
||||
onFailed.run(new NotValidLicenseException());
|
||||
else {
|
||||
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||
onFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
|
||||
@ -116,7 +116,7 @@ public abstract class _BaseRESTConsumer {
|
||||
Log.e(logTitle, "Errore " + responseList.code() + ": risorsa non trovata");
|
||||
onFailed.run(new Exception("Errore " + responseList.code() + ": risorsa non trovata (" + logTitle + ")"));
|
||||
} else if (responseList.code() == 550)
|
||||
onFailed.run(new InvalidLicenseException());
|
||||
onFailed.run(new NotValidLicenseException());
|
||||
else {
|
||||
Log.e(logTitle, "Status " + responseList.code() + ": " + responseList.message());
|
||||
onFailed.run(new Exception("Status " + responseList.code() + ": " + responseList.message()));
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.inventario;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
@ -11,7 +12,7 @@ public class InventarioArtDTO {
|
||||
private String descrizione;
|
||||
private String untMis;
|
||||
private BigDecimal qtaCnf;
|
||||
private List<String> barcode;
|
||||
private ArrayList<String> barcode;
|
||||
private boolean flagTracciabilita;
|
||||
private boolean flagQtaCnfFissa;
|
||||
private BigDecimal giacenza;
|
||||
@ -58,7 +59,7 @@ public class InventarioArtDTO {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public InventarioArtDTO setBarcode(List<String> barcode) {
|
||||
public InventarioArtDTO setBarcode(ArrayList<String> barcode) {
|
||||
this.barcode = barcode;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -12,7 +12,6 @@ import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
import com.ravikoradiya.liveadapter.Type;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -133,7 +132,7 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn
|
||||
|
||||
var itemType = new Type<InventarioRowRoomDTO, ActivityPickingInventarioListItemBinding>(R.layout.activity_picking_inventario__list_item, BR.item);
|
||||
itemType.areItemSame((oldItem, newItem) -> Objects.equals(oldItem.getId(), newItem.getId()));
|
||||
itemType.areContentsTheSame((oldItem, newItem) -> Objects.equals(oldItem.getId(), newItem.getId()));
|
||||
itemType.areContentsTheSame(InventarioRowRoomDTO::equals);
|
||||
itemType.onClick(x -> {
|
||||
new BottomSheetInventarioRowActionsView(x.getBinding().getItem())
|
||||
.setListener(new BottomSheetInventarioRowActionsView.Listener() {
|
||||
@ -190,7 +189,7 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemDispatched(PickingObjectDTO pickingObjectDTO, MtbAart mtbAart, BigDecimal initialNumCnf, BigDecimal initialQtaCnf, BigDecimal initialQtaTot, BigDecimal totalQtaAvailable, BigDecimal totalNumCnfAvailable, BigDecimal qtaCnfAvailable, BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, String partitaMag, Date dataScad, boolean canOverflowOrderQuantity, boolean canPartitaMagBeChanged, boolean canLUBeClosed, RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
||||
public 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) {
|
||||
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||
.setMtbAart(mtbAart)
|
||||
.setInitialNumCnf(initialNumCnf)
|
||||
@ -202,11 +201,10 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn
|
||||
.setTotalQtaToBeTaken(totalQtaToBeTaken)
|
||||
.setTotalNumCnfToBeTaken(totalNumCnfToBeTaken)
|
||||
.setQtaCnfToBeTaken(qtaCnfToBeTaken)
|
||||
.setPartitaMag(partitaMag)
|
||||
.setDataScad(dataScad)
|
||||
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||
.setCanLUBeClosed(canLUBeClosed);
|
||||
.setCanLUBeClosed(canLUBeClosed)
|
||||
.setNumCnfEditable(false);
|
||||
|
||||
if (!mDialogInputQuantityV2View.isVisible())
|
||||
mDialogInputQuantityV2View.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||
|
||||
@ -7,10 +7,7 @@ import androidx.lifecycle.ViewModel;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRoomDTO;
|
||||
@ -66,27 +63,6 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
this.sendOnLoadingEnded();
|
||||
}
|
||||
|
||||
private void generateRandomItems() {
|
||||
for (int i = 0; i < 500; i++) {
|
||||
Random r = new Random();
|
||||
int randomIndex = r.nextInt(availableInventarioArts.size());
|
||||
|
||||
|
||||
var item = getAvailableArts().get(randomIndex);
|
||||
var itemMtbAart = item.toMtbAart();
|
||||
|
||||
var fakePickingObjectDto = new PickingObjectDTO()
|
||||
.setMtbAart(itemMtbAart);
|
||||
|
||||
var qta = BigDecimal.valueOf(r.nextInt(50));
|
||||
var numCnf = UtilityBigDecimal.multiply(qta, itemMtbAart.getQtaCnf());
|
||||
|
||||
saveNewRow(fakePickingObjectDto, qta, itemMtbAart.getQtaCnf(), numCnf, null, null);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public LiveData<InventarioRoomDTO> getCurrentInventario() {
|
||||
return currentInventario;
|
||||
}
|
||||
@ -110,10 +86,18 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
}
|
||||
|
||||
public void updateRow(InventarioRowRoomDTO itemToUpdate) {
|
||||
var barcodeList = new ArrayList<String>();
|
||||
barcodeList.add(itemToUpdate.getScanCodBarre());
|
||||
|
||||
var matchedArt = availableInventarioArts.stream()
|
||||
.filter(x -> x.getCodMart().contains(itemToUpdate.getCodMart()))
|
||||
.filter(x -> itemToUpdate.getCodMart() != null && x.getCodMart().contains(itemToUpdate.getCodMart()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
.orElse(new InventarioArtDTO()
|
||||
.setBarcode(barcodeList)
|
||||
.setFlagQtaCnfFissa(true)
|
||||
.setPlu(false)
|
||||
.setUntMis(itemToUpdate.getUntMis())
|
||||
.setQtaCnf(itemToUpdate.getQtaConf()));
|
||||
|
||||
var articolo = matchedArt.toMtbAart();
|
||||
articolo.setFlagTracciabilita("N");
|
||||
@ -147,21 +131,29 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
}
|
||||
|
||||
private void loadArticolo(String barcodeProd, Ean128Model ean128Model, Runnable onComplete) {
|
||||
var matchedArts = availableInventarioArts.stream()
|
||||
var barcodeList = new ArrayList<String>();
|
||||
barcodeList.add(barcodeProd);
|
||||
|
||||
var matchedArt = availableInventarioArts.stream()
|
||||
.filter(x -> x.getBarcode().contains(barcodeProd))
|
||||
.collect(Collectors.toList());
|
||||
.findFirst()
|
||||
.orElse(new InventarioArtDTO()
|
||||
.setBarcode(barcodeList)
|
||||
.setFlagQtaCnfFissa(true)
|
||||
.setPlu(false)
|
||||
.setUntMis("PZ")
|
||||
.setQtaCnf(BigDecimal.ONE));
|
||||
|
||||
if (matchedArts.size() > 0) {
|
||||
this.dispatchRowInsert(matchedArts.get(0), ean128Model);
|
||||
if (matchedArt != null) {
|
||||
this.dispatchRowInsert(barcodeProd, matchedArt, ean128Model);
|
||||
onComplete.run();
|
||||
|
||||
} else {
|
||||
} else
|
||||
this.sendError(new NoResultFromBarcodeException(barcodeProd));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void dispatchRowInsert(InventarioArtDTO inventarioArtDTO, Ean128Model ean128Model) {
|
||||
private void dispatchRowInsert(String barcode, InventarioArtDTO inventarioArtDTO, Ean128Model ean128Model) {
|
||||
var mtbAart = inventarioArtDTO.toMtbAart();
|
||||
mtbAart.setFlagTracciabilita("N");
|
||||
|
||||
@ -177,9 +169,6 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
BigDecimal initialQtaCnf;
|
||||
BigDecimal initialQtaTot;
|
||||
|
||||
String partitaMag = null;
|
||||
Date dataScad = null;
|
||||
|
||||
if (pickingObjectDTO.getTempPickData() != null && pickingObjectDTO.getTempPickData().getManualPickDTO() != null) {
|
||||
//Oppure le info del barcode scansionato
|
||||
PickDataDTO.ManualPickDTO manualPickDTO = pickingObjectDTO.getTempPickData().getManualPickDTO();
|
||||
@ -228,11 +217,6 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
qtaColDaPrelevare = UtilityBigDecimal.multiply(numCnfDaPrelevare, qtaCnfDaPrelevare);
|
||||
}
|
||||
|
||||
if (manualPickDTO.getMtbPartitaMag() != null) {
|
||||
partitaMag = manualPickDTO.getMtbPartitaMag().getPartitaMag();
|
||||
dataScad = manualPickDTO.getMtbPartitaMag().getDataScadD();
|
||||
}
|
||||
|
||||
initialNumCnf = numCnfDaPrelevare;
|
||||
initialQtaCnf = qtaCnfDaPrelevare;
|
||||
initialQtaTot = qtaColDaPrelevare;
|
||||
@ -248,32 +232,39 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
initialQtaTot = UtilityBigDecimal.multiply(initialNumCnf, initialQtaCnf);
|
||||
}
|
||||
|
||||
if (inventarioArtDTO.isPlu()) {
|
||||
this.saveNewRow(pickingObjectDTO,
|
||||
initialNumCnf,
|
||||
initialQtaCnf,
|
||||
initialQtaTot,
|
||||
null,
|
||||
barcode);
|
||||
} else {
|
||||
|
||||
this.sendOnItemDispatched(
|
||||
pickingObjectDTO,
|
||||
pickingObjectDTO.getMtbAart(),
|
||||
initialNumCnf,
|
||||
initialQtaCnf,
|
||||
initialQtaTot,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
partitaMag,
|
||||
dataScad,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
(pickedQuantityDTO, shouldCloseLU) -> {
|
||||
this.saveNewRow(pickingObjectDTO,
|
||||
pickedQuantityDTO.getNumCnf(),
|
||||
pickedQuantityDTO.getQtaCnf(),
|
||||
pickedQuantityDTO.getQtaTot(),
|
||||
pickedQuantityDTO.getPartitaMag(),
|
||||
pickedQuantityDTO.getDataScad());
|
||||
});
|
||||
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) {
|
||||
@ -290,8 +281,6 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
inventarioRowRoomDTO.getQta(),
|
||||
null, null, null,
|
||||
null, null, null,
|
||||
inventarioRowRoomDTO.getPartitaMag(),
|
||||
null,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
@ -301,14 +290,13 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
pickedQuantityDTO.getNumCnf(),
|
||||
pickedQuantityDTO.getQtaCnf(),
|
||||
pickedQuantityDTO.getQtaTot(),
|
||||
pickedQuantityDTO.getPartitaMag(),
|
||||
pickedQuantityDTO.getDataScad());
|
||||
pickedQuantityDTO.getPartitaMag());
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad) {
|
||||
private void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, String scanCodBarre) {
|
||||
final InventarioRowRoomDTO inventarioRow = new InventarioRowRoomDTO();
|
||||
inventarioRow.setCodMart(pickingObjectDTO.getMtbAart().getCodMart());
|
||||
inventarioRow.setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa());
|
||||
@ -320,12 +308,13 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
inventarioRow.setDataOraInv(UtilityDate.getNowTime());
|
||||
inventarioRow.setZona(currentInventario.getValue().getZona());
|
||||
inventarioRow.setParentId(currentInventario.getValue().getId());
|
||||
inventarioRow.setScanCodBarre(scanCodBarre);
|
||||
|
||||
inventarioRowRepository.insert(inventarioRow, () -> {
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void saveEditedRow(InventarioRowRoomDTO inventarioRowRoomDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad) {
|
||||
private void saveEditedRow(InventarioRowRoomDTO inventarioRowRoomDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag) {
|
||||
inventarioRowRoomDTO.setPartitaMag(partitaMag);
|
||||
inventarioRowRoomDTO.setQta(qtaTot);
|
||||
inventarioRowRoomDTO.setNumConf(numCnf);
|
||||
@ -360,8 +349,6 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
BigDecimal totalQtaToBeTaken,
|
||||
BigDecimal totalNumCnfToBeTaken,
|
||||
BigDecimal qtaCnfToBeTaken,
|
||||
String partitaMag,
|
||||
Date dataScad,
|
||||
boolean canOverflowOrderQuantity,
|
||||
boolean canPartitaMagBeChanged,
|
||||
boolean canLUBeClosed,
|
||||
@ -377,8 +364,6 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
totalQtaToBeTaken,
|
||||
totalNumCnfToBeTaken,
|
||||
qtaCnfToBeTaken,
|
||||
partitaMag,
|
||||
dataScad,
|
||||
canOverflowOrderQuantity,
|
||||
canPartitaMagBeChanged,
|
||||
canLUBeClosed,
|
||||
@ -405,8 +390,6 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
BigDecimal totalQtaToBeTaken,
|
||||
BigDecimal totalNumCnfToBeTaken,
|
||||
BigDecimal qtaCnfToBeTaken,
|
||||
String partitaMag,
|
||||
Date dataScad,
|
||||
boolean canOverflowOrderQuantity,
|
||||
boolean canPartitaMagBeChanged,
|
||||
boolean canLUBeClosed,
|
||||
|
||||
@ -1652,11 +1652,12 @@ public class SpedizioneViewModel {
|
||||
onOrderClosedPrintingDone();
|
||||
return;
|
||||
}
|
||||
List<DtbOrdt> closedOrders = Stream.of(this.mTestateOrdini).map(ord -> {
|
||||
DtbOrdt ordV = new DtbOrdt();
|
||||
ordV.setDataOrd(ord.getDataOrdS()).setNumOrd(ord.getNumOrd()).setGestione(ord.getGestione()).setCodAnag(ord.getCodAnagOrd());
|
||||
return ordV;
|
||||
}).toList();
|
||||
List<DtbOrdt> closedOrders = Stream.of(this.mTestateOrdini)
|
||||
.map(ord -> {
|
||||
DtbOrdt ordV = new DtbOrdt();
|
||||
ordV.setDataOrd(ord.getDataOrdS()).setNumOrd(ord.getNumOrd()).setGestione(ord.getGestione()).setCodAnag(ord.getCodAnagOrd());
|
||||
return ordV;
|
||||
}).toList();
|
||||
|
||||
dto.setPrintList(closedOrders);
|
||||
printClosedOrders(dto, this::onOrderClosedPrintingDone, ex -> this.sendLUPrintError(ex, this::sendOnLoadingEnded));
|
||||
|
||||
@ -107,7 +107,7 @@ public class DialogInputQuantityV2ViewModel {
|
||||
|
||||
} else {
|
||||
this.internalNumCnf = totalNumCnfOrd;
|
||||
this.internalQtaCnf = qtaCnfOrd;
|
||||
this.internalQtaCnf = qtaCnfOrd != null ? qtaCnfOrd : initialQtaCnf;
|
||||
this.internalQtaTot = totalQtaOrd;
|
||||
}
|
||||
|
||||
|
||||
@ -72,16 +72,29 @@
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:text="@{item.descrizione}"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(item.descrizione) ? View.GONE : View.VISIBLE}"
|
||||
tools:text="Descrizione lunga articolo" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:enabled="false"
|
||||
android:text="@{`Barcode: ` + item.scanCodBarre}"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(item.descrizione) ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{`Lotto: ` + item.getPartitaMag()}"
|
||||
android:text="@{`Lotto: ` + item.partitaMag}"
|
||||
android:enabled="false"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(item.getPartitaMag()) ? View.GONE : View.VISIBLE}"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(item.partitaMag) ? View.GONE : View.VISIBLE}"
|
||||
tools:text="Lotto: ABCDE" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
@ -89,7 +89,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="16dp"
|
||||
android:onClick="@{() -> view.dispatchOrders()}"
|
||||
app:srcCompat="@drawable/ic_check_black_24dp"
|
||||
app:visibility="@{view.fabVisible}"
|
||||
style="?attr/floatingActionButtonPrimaryStyle" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user