Completate ultime modifiche inventario
This commit is contained in:
parent
5e5f2b7889
commit
c72037783f
File diff suppressed because it is too large
Load Diff
@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.data_store.db;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.room.Database;
|
import androidx.room.Database;
|
||||||
import androidx.room.Room;
|
import androidx.room.Room;
|
||||||
import androidx.room.RoomDatabase;
|
import androidx.room.RoomDatabase;
|
||||||
@ -39,7 +40,7 @@ import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
|||||||
InventarioRoomDTO.class,
|
InventarioRoomDTO.class,
|
||||||
InventarioRowRoomDTO.class
|
InventarioRowRoomDTO.class
|
||||||
},
|
},
|
||||||
version = 12,
|
version = 13,
|
||||||
exportSchema = true)
|
exportSchema = true)
|
||||||
@TypeConverters({
|
@TypeConverters({
|
||||||
DateConverter.class,
|
DateConverter.class,
|
||||||
@ -64,7 +65,8 @@ public abstract class AppDatabase extends RoomDatabase {
|
|||||||
var builder = Room.databaseBuilder(applicationContext,
|
var builder = Room.databaseBuilder(applicationContext,
|
||||||
AppDatabase.class, "integry_wms")
|
AppDatabase.class, "integry_wms")
|
||||||
.addMigrations(MIGRATION_10_11)
|
.addMigrations(MIGRATION_10_11)
|
||||||
.addMigrations(MIGRATION_11_12);
|
.addMigrations(MIGRATION_11_12)
|
||||||
|
.addMigrations(MIGRATION_12_13);
|
||||||
|
|
||||||
sInstance = builder.build();
|
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)");
|
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) {
|
static final Migration MIGRATION_11_12 = new Migration(11, 12) {
|
||||||
@Override
|
@Override
|
||||||
public void migrate(SupportSQLiteDatabase database) {
|
public void migrate(SupportSQLiteDatabase database) {
|
||||||
@ -111,4 +114,16 @@ public abstract class AppDatabase extends RoomDatabase {
|
|||||||
database.execSQL("ALTER TABLE ordini_tmp RENAME TO ordini;");
|
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)
|
@ColumnInfo(index = true, name = Columns.PARENT_ID)
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@ColumnInfo(name = Columns.COD_MART)
|
@ColumnInfo(name = Columns.COD_MART)
|
||||||
private String codMart;
|
private String codMart;
|
||||||
|
|
||||||
@ -93,7 +92,6 @@ public class InventarioRowRoomDTO extends BaseSyncDTO implements EntityModelInte
|
|||||||
this.parentId = parentId;
|
this.parentId = parentId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
|
||||||
public String getCodMart() {
|
public String getCodMart() {
|
||||||
return codMart;
|
return codMart;
|
||||||
}
|
}
|
||||||
@ -177,4 +175,48 @@ public class InventarioRowRoomDTO extends BaseSyncDTO implements EntityModelInte
|
|||||||
public void setZona(String zona) {
|
public void setZona(String zona) {
|
||||||
this.zona = 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.model.inventario;
|
package it.integry.integrywmsnative.core.rest.model.inventario;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
@ -11,7 +12,7 @@ public class InventarioArtDTO {
|
|||||||
private String descrizione;
|
private String descrizione;
|
||||||
private String untMis;
|
private String untMis;
|
||||||
private BigDecimal qtaCnf;
|
private BigDecimal qtaCnf;
|
||||||
private List<String> barcode;
|
private ArrayList<String> barcode;
|
||||||
private boolean flagTracciabilita;
|
private boolean flagTracciabilita;
|
||||||
private boolean flagQtaCnfFissa;
|
private boolean flagQtaCnfFissa;
|
||||||
private BigDecimal giacenza;
|
private BigDecimal giacenza;
|
||||||
@ -58,7 +59,7 @@ public class InventarioArtDTO {
|
|||||||
return barcode;
|
return barcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public InventarioArtDTO setBarcode(List<String> barcode) {
|
public InventarioArtDTO setBarcode(ArrayList<String> barcode) {
|
||||||
this.barcode = barcode;
|
this.barcode = barcode;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import com.ravikoradiya.liveadapter.LiveAdapter;
|
|||||||
import com.ravikoradiya.liveadapter.Type;
|
import com.ravikoradiya.liveadapter.Type;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
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);
|
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.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 -> {
|
itemType.onClick(x -> {
|
||||||
new BottomSheetInventarioRowActionsView(x.getBinding().getItem())
|
new BottomSheetInventarioRowActionsView(x.getBinding().getItem())
|
||||||
.setListener(new BottomSheetInventarioRowActionsView.Listener() {
|
.setListener(new BottomSheetInventarioRowActionsView.Listener() {
|
||||||
@ -190,7 +189,7 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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()
|
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||||
.setMtbAart(mtbAart)
|
.setMtbAart(mtbAart)
|
||||||
.setInitialNumCnf(initialNumCnf)
|
.setInitialNumCnf(initialNumCnf)
|
||||||
@ -202,8 +201,6 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn
|
|||||||
.setTotalQtaToBeTaken(totalQtaToBeTaken)
|
.setTotalQtaToBeTaken(totalQtaToBeTaken)
|
||||||
.setTotalNumCnfToBeTaken(totalNumCnfToBeTaken)
|
.setTotalNumCnfToBeTaken(totalNumCnfToBeTaken)
|
||||||
.setQtaCnfToBeTaken(qtaCnfToBeTaken)
|
.setQtaCnfToBeTaken(qtaCnfToBeTaken)
|
||||||
.setPartitaMag(partitaMag)
|
|
||||||
.setDataScad(dataScad)
|
|
||||||
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
||||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||||
.setCanLUBeClosed(canLUBeClosed)
|
.setCanLUBeClosed(canLUBeClosed)
|
||||||
|
|||||||
@ -7,10 +7,7 @@ import androidx.lifecycle.ViewModel;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
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.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRoomDTO;
|
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRoomDTO;
|
||||||
@ -66,27 +63,6 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
this.sendOnLoadingEnded();
|
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() {
|
public LiveData<InventarioRoomDTO> getCurrentInventario() {
|
||||||
return currentInventario;
|
return currentInventario;
|
||||||
}
|
}
|
||||||
@ -110,10 +86,18 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateRow(InventarioRowRoomDTO itemToUpdate) {
|
public void updateRow(InventarioRowRoomDTO itemToUpdate) {
|
||||||
|
var barcodeList = new ArrayList<String>();
|
||||||
|
barcodeList.add(itemToUpdate.getScanCodBarre());
|
||||||
|
|
||||||
var matchedArt = availableInventarioArts.stream()
|
var matchedArt = availableInventarioArts.stream()
|
||||||
.filter(x -> x.getCodMart().contains(itemToUpdate.getCodMart()))
|
.filter(x -> itemToUpdate.getCodMart() != null && x.getCodMart().contains(itemToUpdate.getCodMart()))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElse(null);
|
.orElse(new InventarioArtDTO()
|
||||||
|
.setBarcode(barcodeList)
|
||||||
|
.setFlagQtaCnfFissa(true)
|
||||||
|
.setPlu(false)
|
||||||
|
.setUntMis(itemToUpdate.getUntMis())
|
||||||
|
.setQtaCnf(itemToUpdate.getQtaConf()));
|
||||||
|
|
||||||
var articolo = matchedArt.toMtbAart();
|
var articolo = matchedArt.toMtbAart();
|
||||||
articolo.setFlagTracciabilita("N");
|
articolo.setFlagTracciabilita("N");
|
||||||
@ -147,21 +131,29 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadArticolo(String barcodeProd, Ean128Model ean128Model, Runnable onComplete) {
|
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))
|
.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) {
|
if (matchedArt != null) {
|
||||||
this.dispatchRowInsert(matchedArts.get(0), ean128Model);
|
this.dispatchRowInsert(barcodeProd, matchedArt, ean128Model);
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
|
} else
|
||||||
} else {
|
|
||||||
this.sendError(new NoResultFromBarcodeException(barcodeProd));
|
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();
|
var mtbAart = inventarioArtDTO.toMtbAart();
|
||||||
mtbAart.setFlagTracciabilita("N");
|
mtbAart.setFlagTracciabilita("N");
|
||||||
|
|
||||||
@ -177,9 +169,6 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
BigDecimal initialQtaCnf;
|
BigDecimal initialQtaCnf;
|
||||||
BigDecimal initialQtaTot;
|
BigDecimal initialQtaTot;
|
||||||
|
|
||||||
String partitaMag = null;
|
|
||||||
Date dataScad = null;
|
|
||||||
|
|
||||||
if (pickingObjectDTO.getTempPickData() != null && pickingObjectDTO.getTempPickData().getManualPickDTO() != null) {
|
if (pickingObjectDTO.getTempPickData() != null && pickingObjectDTO.getTempPickData().getManualPickDTO() != null) {
|
||||||
//Oppure le info del barcode scansionato
|
//Oppure le info del barcode scansionato
|
||||||
PickDataDTO.ManualPickDTO manualPickDTO = pickingObjectDTO.getTempPickData().getManualPickDTO();
|
PickDataDTO.ManualPickDTO manualPickDTO = pickingObjectDTO.getTempPickData().getManualPickDTO();
|
||||||
@ -228,11 +217,6 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
qtaColDaPrelevare = UtilityBigDecimal.multiply(numCnfDaPrelevare, qtaCnfDaPrelevare);
|
qtaColDaPrelevare = UtilityBigDecimal.multiply(numCnfDaPrelevare, qtaCnfDaPrelevare);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (manualPickDTO.getMtbPartitaMag() != null) {
|
|
||||||
partitaMag = manualPickDTO.getMtbPartitaMag().getPartitaMag();
|
|
||||||
dataScad = manualPickDTO.getMtbPartitaMag().getDataScadD();
|
|
||||||
}
|
|
||||||
|
|
||||||
initialNumCnf = numCnfDaPrelevare;
|
initialNumCnf = numCnfDaPrelevare;
|
||||||
initialQtaCnf = qtaCnfDaPrelevare;
|
initialQtaCnf = qtaCnfDaPrelevare;
|
||||||
initialQtaTot = qtaColDaPrelevare;
|
initialQtaTot = qtaColDaPrelevare;
|
||||||
@ -248,6 +232,14 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
initialQtaTot = UtilityBigDecimal.multiply(initialNumCnf, initialQtaCnf);
|
initialQtaTot = UtilityBigDecimal.multiply(initialNumCnf, initialQtaCnf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (inventarioArtDTO.isPlu()) {
|
||||||
|
this.saveNewRow(pickingObjectDTO,
|
||||||
|
initialNumCnf,
|
||||||
|
initialQtaCnf,
|
||||||
|
initialQtaTot,
|
||||||
|
null,
|
||||||
|
barcode);
|
||||||
|
} else {
|
||||||
|
|
||||||
this.sendOnItemDispatched(
|
this.sendOnItemDispatched(
|
||||||
pickingObjectDTO,
|
pickingObjectDTO,
|
||||||
@ -261,8 +253,6 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
partitaMag,
|
|
||||||
dataScad,
|
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
@ -272,9 +262,10 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
pickedQuantityDTO.getQtaCnf(),
|
pickedQuantityDTO.getQtaCnf(),
|
||||||
pickedQuantityDTO.getQtaTot(),
|
pickedQuantityDTO.getQtaTot(),
|
||||||
pickedQuantityDTO.getPartitaMag(),
|
pickedQuantityDTO.getPartitaMag(),
|
||||||
pickedQuantityDTO.getDataScad());
|
barcode);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void dispatchRowEdit(MtbAart mtbAart, InventarioRowRoomDTO inventarioRowRoomDTO) {
|
private void dispatchRowEdit(MtbAart mtbAart, InventarioRowRoomDTO inventarioRowRoomDTO) {
|
||||||
|
|
||||||
@ -290,8 +281,6 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
inventarioRowRoomDTO.getQta(),
|
inventarioRowRoomDTO.getQta(),
|
||||||
null, null, null,
|
null, null, null,
|
||||||
null, null, null,
|
null, null, null,
|
||||||
inventarioRowRoomDTO.getPartitaMag(),
|
|
||||||
null,
|
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@ -301,14 +290,13 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
pickedQuantityDTO.getNumCnf(),
|
pickedQuantityDTO.getNumCnf(),
|
||||||
pickedQuantityDTO.getQtaCnf(),
|
pickedQuantityDTO.getQtaCnf(),
|
||||||
pickedQuantityDTO.getQtaTot(),
|
pickedQuantityDTO.getQtaTot(),
|
||||||
pickedQuantityDTO.getPartitaMag(),
|
pickedQuantityDTO.getPartitaMag());
|
||||||
pickedQuantityDTO.getDataScad());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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();
|
final InventarioRowRoomDTO inventarioRow = new InventarioRowRoomDTO();
|
||||||
inventarioRow.setCodMart(pickingObjectDTO.getMtbAart().getCodMart());
|
inventarioRow.setCodMart(pickingObjectDTO.getMtbAart().getCodMart());
|
||||||
inventarioRow.setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa());
|
inventarioRow.setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa());
|
||||||
@ -320,12 +308,13 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
inventarioRow.setDataOraInv(UtilityDate.getNowTime());
|
inventarioRow.setDataOraInv(UtilityDate.getNowTime());
|
||||||
inventarioRow.setZona(currentInventario.getValue().getZona());
|
inventarioRow.setZona(currentInventario.getValue().getZona());
|
||||||
inventarioRow.setParentId(currentInventario.getValue().getId());
|
inventarioRow.setParentId(currentInventario.getValue().getId());
|
||||||
|
inventarioRow.setScanCodBarre(scanCodBarre);
|
||||||
|
|
||||||
inventarioRowRepository.insert(inventarioRow, () -> {
|
inventarioRowRepository.insert(inventarioRow, () -> {
|
||||||
}, this::sendError);
|
}, 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.setPartitaMag(partitaMag);
|
||||||
inventarioRowRoomDTO.setQta(qtaTot);
|
inventarioRowRoomDTO.setQta(qtaTot);
|
||||||
inventarioRowRoomDTO.setNumConf(numCnf);
|
inventarioRowRoomDTO.setNumConf(numCnf);
|
||||||
@ -360,8 +349,6 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
BigDecimal totalQtaToBeTaken,
|
BigDecimal totalQtaToBeTaken,
|
||||||
BigDecimal totalNumCnfToBeTaken,
|
BigDecimal totalNumCnfToBeTaken,
|
||||||
BigDecimal qtaCnfToBeTaken,
|
BigDecimal qtaCnfToBeTaken,
|
||||||
String partitaMag,
|
|
||||||
Date dataScad,
|
|
||||||
boolean canOverflowOrderQuantity,
|
boolean canOverflowOrderQuantity,
|
||||||
boolean canPartitaMagBeChanged,
|
boolean canPartitaMagBeChanged,
|
||||||
boolean canLUBeClosed,
|
boolean canLUBeClosed,
|
||||||
@ -377,8 +364,6 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
totalQtaToBeTaken,
|
totalQtaToBeTaken,
|
||||||
totalNumCnfToBeTaken,
|
totalNumCnfToBeTaken,
|
||||||
qtaCnfToBeTaken,
|
qtaCnfToBeTaken,
|
||||||
partitaMag,
|
|
||||||
dataScad,
|
|
||||||
canOverflowOrderQuantity,
|
canOverflowOrderQuantity,
|
||||||
canPartitaMagBeChanged,
|
canPartitaMagBeChanged,
|
||||||
canLUBeClosed,
|
canLUBeClosed,
|
||||||
@ -405,8 +390,6 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
BigDecimal totalQtaToBeTaken,
|
BigDecimal totalQtaToBeTaken,
|
||||||
BigDecimal totalNumCnfToBeTaken,
|
BigDecimal totalNumCnfToBeTaken,
|
||||||
BigDecimal qtaCnfToBeTaken,
|
BigDecimal qtaCnfToBeTaken,
|
||||||
String partitaMag,
|
|
||||||
Date dataScad,
|
|
||||||
boolean canOverflowOrderQuantity,
|
boolean canOverflowOrderQuantity,
|
||||||
boolean canPartitaMagBeChanged,
|
boolean canPartitaMagBeChanged,
|
||||||
boolean canLUBeClosed,
|
boolean canLUBeClosed,
|
||||||
|
|||||||
@ -107,7 +107,7 @@ public class DialogInputQuantityV2ViewModel {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.internalNumCnf = totalNumCnfOrd;
|
this.internalNumCnf = totalNumCnfOrd;
|
||||||
this.internalQtaCnf = qtaCnfOrd;
|
this.internalQtaCnf = qtaCnfOrd != null ? qtaCnfOrd : initialQtaCnf;
|
||||||
this.internalQtaTot = totalQtaOrd;
|
this.internalQtaTot = totalQtaOrd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -72,16 +72,29 @@
|
|||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
android:text="@{item.descrizione}"
|
android:text="@{item.descrizione}"
|
||||||
|
android:visibility="@{UtilityString.isNullOrEmpty(item.descrizione) ? View.GONE : View.VISIBLE}"
|
||||||
tools:text="Descrizione lunga articolo" />
|
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
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@{`Lotto: ` + item.getPartitaMag()}"
|
android:text="@{`Lotto: ` + item.partitaMag}"
|
||||||
android:enabled="false"
|
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" />
|
tools:text="Lotto: ABCDE" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user