Fix su Spedizione
This commit is contained in:
parent
af5ad5faa8
commit
ad82f4afc4
2
.idea/runConfigurations/app_base.xml
generated
2
.idea/runConfigurations/app_base.xml
generated
@ -40,7 +40,7 @@
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Native>
|
||||
<Profilers>
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="true" />
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Sample Java Methods" />
|
||||
</Profilers>
|
||||
|
||||
4
.idea/runConfigurations/app_ime.xml
generated
4
.idea/runConfigurations/app_ime.xml
generated
@ -11,7 +11,7 @@
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="CLEAR_LOGCAT" value="true" />
|
||||
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
|
||||
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
|
||||
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="false" />
|
||||
<option name="FORCE_STOP_RUNNING_APP" value="true" />
|
||||
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
||||
@ -40,7 +40,7 @@
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Native>
|
||||
<Profilers>
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="true" />
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Sample Java Methods" />
|
||||
</Profilers>
|
||||
|
||||
2
.idea/runConfigurations/app_saporiveri.xml
generated
2
.idea/runConfigurations/app_saporiveri.xml
generated
@ -40,7 +40,7 @@
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Native>
|
||||
<Profilers>
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="true" />
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Sample Java Methods" />
|
||||
</Profilers>
|
||||
|
||||
2
.idea/runConfigurations/app_saporiveri_pv.xml
generated
2
.idea/runConfigurations/app_saporiveri_pv.xml
generated
@ -40,7 +40,7 @@
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Native>
|
||||
<Profilers>
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="true" />
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Sample Java Methods" />
|
||||
</Profilers>
|
||||
|
||||
2
.idea/runConfigurations/app_vglimenti.xml
generated
2
.idea/runConfigurations/app_vglimenti.xml
generated
@ -40,7 +40,7 @@
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Native>
|
||||
<Profilers>
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="true" />
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Sample Java Methods" />
|
||||
</Profilers>
|
||||
|
||||
@ -5,6 +5,7 @@ import android.app.Dialog;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import android.text.SpannableString;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
@ -121,7 +122,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
this.initDatiPicking();
|
||||
}
|
||||
|
||||
private void init(){
|
||||
private void init() {
|
||||
mArticoliInColloBottomSheetViewModel.setOnCloseColloCallbackListener(this);
|
||||
|
||||
mArticoliInColloBottomSheetViewModel.setOnItemDeletedCallback((deletedItem) -> {
|
||||
@ -143,7 +144,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
initRecyclerView();
|
||||
}
|
||||
|
||||
private void initRecyclerView(){
|
||||
private void initRecyclerView() {
|
||||
//RecyclerView setup
|
||||
this.mBindings.venditaOrdineMainList.setHasFixedSize(true);
|
||||
|
||||
@ -163,7 +164,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
|
||||
private void initDatiPicking() {
|
||||
if(this.mTestateOrdini != null && this.mTestateOrdini.size() > 0){
|
||||
if (this.mTestateOrdini != null && this.mTestateOrdini.size() > 0) {
|
||||
|
||||
//Definizione della gestione collo di default
|
||||
List<GestioneEnum> foundGestioni = Stream.of(mTestateOrdini)
|
||||
@ -172,12 +173,12 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.distinctBy(x -> x)
|
||||
.toList();
|
||||
|
||||
if(foundGestioni != null && foundGestioni.size() > 1){
|
||||
if (foundGestioni != null && foundGestioni.size() > 1) {
|
||||
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString(mActivity.getString(R.string.error_multiple_gest)), null, () -> {
|
||||
mActivity.finish();
|
||||
}).show();
|
||||
return;
|
||||
} else if(foundGestioni != null && foundGestioni.size() == 1){
|
||||
} else if (foundGestioni != null && foundGestioni.size() == 1) {
|
||||
defaultGestioneOfUL = foundGestioni.get(0);
|
||||
} else {
|
||||
defaultGestioneOfUL = GestioneEnum.VENDITA;
|
||||
@ -187,7 +188,6 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
defaultCodMdepOfUL = SettingsManager.i().userSession.depo.getCodMdep();
|
||||
|
||||
|
||||
|
||||
//Definizione del filtro ordine da applicare a tutti i colli generati
|
||||
Stream.of(mTestateOrdini).forEach(x -> {
|
||||
FiltroOrdineDTO filtro = new FiltroOrdineDTO()
|
||||
@ -196,11 +196,10 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.setGestioneOrd(x.getGestione())
|
||||
.setDataCons(x.getDataConsD());
|
||||
|
||||
if(!defaultFiltroOrdine.contains(filtro)) defaultFiltroOrdine.add(filtro);
|
||||
if (!defaultFiltroOrdine.contains(filtro)) defaultFiltroOrdine.add(filtro);
|
||||
});
|
||||
|
||||
|
||||
|
||||
//Definizione del codAnag
|
||||
List<String> foundCodAnag = Stream.of(mTestateOrdini)
|
||||
.map(OrdineVenditaInevasoDTO::getCodAnagOrd)
|
||||
@ -208,12 +207,11 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.distinctBy(x -> x)
|
||||
.toList();
|
||||
|
||||
if(foundCodAnag != null && foundCodAnag.size() == 1){
|
||||
if (foundCodAnag != null && foundCodAnag.size() == 1) {
|
||||
defaultCodAnagOfUL = foundCodAnag.get(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Definizione del codAnag
|
||||
List<String> foundRagSoc = Stream.of(mTestateOrdini)
|
||||
.map(OrdineVenditaInevasoDTO::getRagSocOrd)
|
||||
@ -221,7 +219,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.distinctBy(x -> x)
|
||||
.toList();
|
||||
|
||||
if(foundRagSoc != null && foundRagSoc.size() == 1){
|
||||
if (foundRagSoc != null && foundRagSoc.size() == 1) {
|
||||
defaultRagSocOfUL = foundRagSoc.get(0);
|
||||
}
|
||||
|
||||
@ -233,7 +231,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.distinctBy(x -> x)
|
||||
.toList();
|
||||
|
||||
if(foundRifOrd != null && foundRifOrd.size() == 1){
|
||||
if (foundRifOrd != null && foundRifOrd.size() == 1) {
|
||||
defaultRifOrdOfUL = foundRifOrd.get(0);
|
||||
}
|
||||
|
||||
@ -245,7 +243,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.distinctBy(x -> x)
|
||||
.toList();
|
||||
|
||||
if(foundNumOrd != null && foundNumOrd.size() == 1){
|
||||
if (foundNumOrd != null && foundNumOrd.size() == 1) {
|
||||
defaultNumOrdOfUL = foundNumOrd.get(0);
|
||||
}
|
||||
|
||||
@ -257,7 +255,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.distinctBy(x -> x)
|
||||
.toList();
|
||||
|
||||
if(foundDataOrd != null && foundDataOrd.size() == 1){
|
||||
if (foundDataOrd != null && foundDataOrd.size() == 1) {
|
||||
defaultDataOrdOfUL = foundDataOrd.get(0);
|
||||
}
|
||||
|
||||
@ -269,7 +267,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.distinctBy(x -> x)
|
||||
.toList();
|
||||
|
||||
if(foundCodJfas != null && foundCodJfas.size() == 1){
|
||||
if (foundCodJfas != null && foundCodJfas.size() == 1) {
|
||||
defaultCodJFasOfUL = foundCodJfas.get(0);
|
||||
}
|
||||
|
||||
@ -279,11 +277,11 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
private void onRowItemEdited(MtbColr originalItem, MtbColr editedItem) {
|
||||
|
||||
for(int i = 0; i < mPickingList.size(); i++) {
|
||||
for (int i = 0; i < mPickingList.size(); i++) {
|
||||
|
||||
int foundIndex = mPickingList.get(i).getWithdrawRows().indexOf(originalItem);
|
||||
|
||||
if(foundIndex >= 0){
|
||||
if (foundIndex >= 0) {
|
||||
mPickingList.get(i).getWithdrawRows().set(foundIndex, editedItem);
|
||||
|
||||
break;
|
||||
@ -294,11 +292,11 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
private void onRowItemDeleted(MtbColr deletedItem) {
|
||||
|
||||
for(int i = 0; i < mPickingList.size(); i++) {
|
||||
for (int i = 0; i < mPickingList.size(); i++) {
|
||||
|
||||
int foundIndex = mPickingList.get(i).getWithdrawRows().indexOf(deletedItem);
|
||||
|
||||
if(foundIndex >= 0){
|
||||
if (foundIndex >= 0) {
|
||||
mPickingList.get(i).getWithdrawRows().remove(foundIndex);
|
||||
|
||||
break;
|
||||
@ -307,7 +305,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshOrderBy(boolean forceHiddenCheck){
|
||||
private void refreshOrderBy(boolean forceHiddenCheck) {
|
||||
|
||||
try {
|
||||
List<MtbColr> mtbColrs = mArticoliInColloBottomSheetViewModel.mtbColt.get() != null ? mArticoliInColloBottomSheetViewModel.mtbColt.get().getMtbColr() : null;
|
||||
@ -327,7 +325,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
|
||||
public void removeListFilter() {
|
||||
for(int i = 0; i < mPickingList.size(); i++) {
|
||||
for (int i = 0; i < mPickingList.size(); i++) {
|
||||
mPickingList.get(i).setTempHidden(false);
|
||||
mPickingList.get(i).setTempPickData(null);
|
||||
}
|
||||
@ -336,7 +334,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
this.mBindings.filteredArtsInListExpandableLayout.collapse(true);
|
||||
}
|
||||
|
||||
public void recoverUL(MtbColt recoveredMtbColt){
|
||||
public void recoverUL(MtbColt recoveredMtbColt) {
|
||||
mtbColtSessionID = ColliDataRecover.startNewSession(recoveredMtbColt, mTestateOrdini);
|
||||
setULToCurrentContext(recoveredMtbColt);
|
||||
refreshOrderBy(false);
|
||||
@ -349,22 +347,22 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
BarcodeManager.disable();
|
||||
|
||||
//Se non c'è una UL aperta
|
||||
if(!thereIsAnOpenedUL()){
|
||||
if (!thereIsAnOpenedUL()) {
|
||||
|
||||
//Se è un'etichetta anonima
|
||||
if(UtilityBarcode.isEtichettaAnonima(data)){
|
||||
if (UtilityBarcode.isEtichettaAnonima(data)) {
|
||||
|
||||
//Se il collo non esiste allora lo creo associandolo a questa etichetta anonima
|
||||
//invece se esiste apro un collo nuovo e cerco gli articoli presenti nell'ul
|
||||
//dell'etichetta anonima
|
||||
this.executeEtichettaAnonimaNotOpenedLU(data, progressDialog);
|
||||
} else if(UtilityBarcode.isEanPeso(data)) {
|
||||
} else if (UtilityBarcode.isEanPeso(data)) {
|
||||
|
||||
//Creo una nuova ul e cerco tramite etichetta ean 128 (che può indicarmi un articolo o una UL)
|
||||
this.createNewUL(null, null, progressDialog, false, false, () -> {
|
||||
this.executeEtichettaEanPeso(data, progressDialog);
|
||||
});
|
||||
} else if(UtilityBarcode.isEtichetta128(data)) {
|
||||
} else if (UtilityBarcode.isEtichetta128(data)) {
|
||||
|
||||
//Creo una nuova ul e cerco tramite etichetta ean 128 (che può indicarmi un articolo o una UL)
|
||||
this.createNewUL(null, null, progressDialog, false, false, () -> {
|
||||
@ -376,22 +374,22 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if(UtilityBarcode.isEtichettaAnonima(data)){
|
||||
if (UtilityBarcode.isEtichettaAnonima(data)) {
|
||||
//Cerco gli articoli presenti nell'ul dell'etichetta anonima
|
||||
this.executeEtichettaLU(data.getStringValue(), progressDialog);
|
||||
|
||||
|
||||
} else if(UtilityBarcode.isEanPeso(data)) {
|
||||
} else if (UtilityBarcode.isEanPeso(data)) {
|
||||
//Cerco tramite etichetta ean 128 (che può indicarmi un articolo o una UL)
|
||||
this.executeEtichettaEanPeso(data, progressDialog);
|
||||
|
||||
|
||||
} else if(UtilityBarcode.isEtichetta128(data)) {
|
||||
} else if (UtilityBarcode.isEtichetta128(data)) {
|
||||
//Cerco tramite etichetta ean 128 (che può indicarmi un articolo o una UL)
|
||||
this.executeEtichettaEan128(data, progressDialog);
|
||||
|
||||
|
||||
} else if(UtilityBarcode.isEtichettaPosizione(data)) {
|
||||
} else if (UtilityBarcode.isEtichettaPosizione(data)) {
|
||||
//Cerco l'UL presente all'interno della posizione
|
||||
this.executeEtichettaPosizione(data.getStringValue(), progressDialog);
|
||||
|
||||
@ -406,9 +404,9 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
private void executeEtichettaAnonimaNotOpenedLU(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
||||
ColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), true, false, mtbColt -> {
|
||||
|
||||
if(mtbColt == null) {
|
||||
if (mtbColt == null) {
|
||||
|
||||
if(!UtilityBarcode.isEtichettaAnonimaOfCurrentYear(barcodeScanDTO.getStringValue())) {
|
||||
if (!UtilityBarcode.isEtichettaAnonimaOfCurrentYear(barcodeScanDTO.getStringValue())) {
|
||||
UtilityExceptions.defaultException(mActivity, new Exception("Per continuare scansiona un'etichetta dell'anno corrente"), progressDialog, false);
|
||||
BarcodeManager.enable();
|
||||
} else {
|
||||
@ -443,13 +441,13 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
MtbDepoPosizione foundPosizione = UtilityPosizione.getFromCache(posizione);
|
||||
|
||||
|
||||
if(foundPosizione != null) {
|
||||
if (foundPosizione != null) {
|
||||
|
||||
if(foundPosizione.isFlagMonoCollo()) {
|
||||
if (foundPosizione.isFlagMonoCollo()) {
|
||||
|
||||
PosizioniRESTConsumer.getBancaliInPosizione(foundPosizione, mtbColtList -> {
|
||||
|
||||
if(mtbColtList == null || mtbColtList.size() == 0 || mtbColtList.size() > 1) {
|
||||
if (mtbColtList == null || mtbColtList.size() == 0 || mtbColtList.size() > 1) {
|
||||
|
||||
progressDialog.dismiss();
|
||||
//Nessuna UL trovata oppure più UL nella stessa posizione
|
||||
@ -491,9 +489,6 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -501,7 +496,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
ColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
||||
|
||||
|
||||
if(mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||
searchArtFromUL(mtbColt, progressDialog);
|
||||
} else {
|
||||
progressDialog.dismiss();
|
||||
@ -523,14 +518,15 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
String barcodeProd = null;
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Content)) barcodeProd = ean128Model.Content;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Content))
|
||||
barcodeProd = ean128Model.Content;
|
||||
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)){
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
||||
this.executeEtichettaLU(ean128Model.Sscc, progressDialog);
|
||||
} else {
|
||||
|
||||
@ -548,7 +544,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
progressDialog.dismiss();
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
}, ex-> {
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mActivity, ex, progressDialog);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
@ -568,14 +564,14 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
|
||||
private void loadArticolo(String barcodeProd, PickingObjectDTO.PickData pickData, Dialog progressDialog) {
|
||||
if(barcodeProd.length() == 14) {
|
||||
if (barcodeProd.length() == 14) {
|
||||
barcodeProd = UtilityBarcode.convertITF14toEAN13(barcodeProd);
|
||||
}
|
||||
|
||||
|
||||
ArticoloRESTConsumer.getByBarcodeProd(barcodeProd, mtbAartList -> {
|
||||
|
||||
if(mtbAartList != null && mtbAartList.size() > 0) {
|
||||
if (mtbAartList != null && mtbAartList.size() > 0) {
|
||||
|
||||
// if(!thereIsAnOpenedUL()){
|
||||
//
|
||||
@ -631,31 +627,29 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.toList();
|
||||
|
||||
|
||||
|
||||
List<PickingObjectDTO> matchPickingObjectByArt = Stream.of(pickingList)
|
||||
.filter(x -> //x.getNumCollo() == null &&
|
||||
(listOfCodMartsInRowCollo.contains(x.getCodMart()) && !alreadyMatchedArts.contains(x.getCodMart())))
|
||||
.toList();
|
||||
|
||||
|
||||
if(SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV()) {
|
||||
if (SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV()) {
|
||||
for (int i = 0; i < matchPickingObjectByArt.size(); i++) {
|
||||
PickingObjectDTO tmpPickObj = matchPickingObjectByArt.get(i);
|
||||
|
||||
|
||||
|
||||
List<MtbColr> matchWithPartitaMag = Stream.of(scannedUL.getMtbColr())
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(tmpPickObj.getCodMart()) &&
|
||||
Objects.equals(x.getPartitaMag(), tmpPickObj.getPartitaMag())).toList();
|
||||
|
||||
boolean anyMatch = matchWithPartitaMag.size() > 0;
|
||||
|
||||
if(!anyMatch) {
|
||||
if (!anyMatch) {
|
||||
matchPickingObjectByArt.remove(i);
|
||||
i--;
|
||||
} else {
|
||||
|
||||
for(int k = 0; k < matchWithPartitaMag.size(); k++) {
|
||||
for (int k = 0; k < matchWithPartitaMag.size(); k++) {
|
||||
|
||||
|
||||
MtbColr matchRow = matchWithPartitaMag.get(k);
|
||||
@ -679,7 +673,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
List<MtbColr> matchWithColloRow = Stream.of(scannedUL.getMtbColr())
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(tmpPickObj.getCodMart())).toList();
|
||||
|
||||
for(int k = 0; k < matchWithColloRow.size(); k++) {
|
||||
for (int k = 0; k < matchWithColloRow.size(); k++) {
|
||||
|
||||
|
||||
MtbColr matchRow = matchWithColloRow.get(k);
|
||||
@ -697,8 +691,6 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//}
|
||||
matchPickingObject.addAll(matchPickingObjectByArt);
|
||||
|
||||
@ -720,7 +712,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.toList();
|
||||
|
||||
|
||||
if(SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV()) {
|
||||
if (SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV()) {
|
||||
List<PickingObjectDTO> matchWithPartitaMag = Stream.of(matchPickingObject)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbAart.getCodMart()) &&
|
||||
(pickData != null && pickData.getMtbPartitaMag() != null && Objects.equals(x.getPartitaMag(), pickData.getMtbPartitaMag().getPartitaMag()))).toList();
|
||||
@ -729,7 +721,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
}
|
||||
|
||||
if(matchPickingObject.size() == 1){
|
||||
if (matchPickingObject.size() == 1) {
|
||||
matchPickingObject.get(0).setTempPickData(pickData);
|
||||
}
|
||||
|
||||
@ -738,19 +730,19 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
|
||||
private void loadMatchedRows(List<PickingObjectDTO> matchedRows) {
|
||||
if(matchedRows == null || matchedRows.size() == 0) {
|
||||
if (matchedRows == null || matchedRows.size() == 0) {
|
||||
DialogCommon.showNoArtFoundDialog(mActivity, null);
|
||||
} else {
|
||||
for(int i = 0; i < mPickingList.size(); i++) {
|
||||
if(!matchedRows.contains(mPickingList.get(i))) {
|
||||
for (int i = 0; i < mPickingList.size(); i++) {
|
||||
if (!matchedRows.contains(mPickingList.get(i))) {
|
||||
mPickingList.get(i).setTempHidden(true);
|
||||
}
|
||||
}
|
||||
|
||||
if(matchedRows.size() == 1 ) {
|
||||
if (matchedRows.size() == 1) {
|
||||
|
||||
if (matchedRows.get(0).getTempPickData() != null &&
|
||||
matchedRows.get(0).getTempPickData().getSourceMtbColt() != null ) {
|
||||
matchedRows.get(0).getTempPickData().getSourceMtbColt() != null) {
|
||||
|
||||
// MtbColt tempSourceMtbColt = matchedRows.get(0).getTempPickData().getSourceMtbColt();
|
||||
|
||||
@ -767,7 +759,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
// refreshOrderBy(false);
|
||||
// }
|
||||
|
||||
} else if(matchedRows.get(0).isDeactivated()) {
|
||||
} else if (matchedRows.get(0).isDeactivated()) {
|
||||
applyFilter("");
|
||||
refreshOrderBy(false);
|
||||
} else {
|
||||
@ -789,14 +781,14 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
public void createNewUL(Integer customNumCollo, String customSerCollo, Dialog progress, boolean disablePrint, boolean closeProgress, Runnable onComplete) {
|
||||
this.mBindings.venditaOrdineInevasoFab.close(true);
|
||||
|
||||
if (progress == null){
|
||||
if (progress == null) {
|
||||
progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
}
|
||||
progress.show();
|
||||
|
||||
MtbColt mtbColt = new MtbColt();
|
||||
mtbColt.initDefaultFields();
|
||||
mtbColt .setGestione(defaultGestioneOfUL)
|
||||
mtbColt.setGestione(defaultGestioneOfUL)
|
||||
.setSegno(-1)
|
||||
.setRifOrd(defaultRifOrdOfUL)
|
||||
.setNumOrd(defaultNumOrdOfUL)
|
||||
@ -805,15 +797,15 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.setCodMdep(defaultCodMdepOfUL)
|
||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
if(defaultGestioneOfUL == GestioneEnum.LAVORAZIONE) {
|
||||
if (defaultGestioneOfUL == GestioneEnum.LAVORAZIONE) {
|
||||
mtbColt.setPosizione(defaultCodJFasOfUL);
|
||||
}
|
||||
|
||||
if(customNumCollo != null) {
|
||||
if (customNumCollo != null) {
|
||||
mtbColt.setNumCollo(customNumCollo);
|
||||
}
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(customSerCollo)) {
|
||||
if (!UtilityString.isNullOrEmpty(customSerCollo)) {
|
||||
mtbColt.setSerCollo(customSerCollo);
|
||||
}
|
||||
|
||||
@ -834,18 +826,18 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
setULToCurrentContext(value);
|
||||
|
||||
if(closeProgress) finalProgress.dismiss();
|
||||
if (closeProgress) finalProgress.dismiss();
|
||||
|
||||
FBToast.successToast(mActivity, mActivity.getResources().getString(R.string.data_saved) ,FBToast.LENGTH_SHORT);
|
||||
FBToast.successToast(mActivity, mActivity.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||
|
||||
if(onComplete != null) onComplete.run();
|
||||
}, ex ->{
|
||||
if (onComplete != null) onComplete.run();
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mActivity, ex, finalProgress);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void setULToCurrentContext(MtbColt mtbColt){
|
||||
private void setULToCurrentContext(MtbColt mtbColt) {
|
||||
isFabVisible.set(false);
|
||||
shouldShowAddExtraItems.set(SettingsManager.iDB().isFlagCanAddExtraItemSpedizione());
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(mtbColt);
|
||||
@ -859,7 +851,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
@Override
|
||||
public void onColloClosed(Runnable onComplete, boolean shouldPrint) {
|
||||
if(thereIsAnOpenedUL()) {
|
||||
if (thereIsAnOpenedUL()) {
|
||||
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
|
||||
@ -867,14 +859,15 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
ColliMagazzinoRESTConsumer.canLUBeDeleted(currentMtbColt, canBeDeleted -> {
|
||||
|
||||
if(!canBeDeleted) {
|
||||
if (!canBeDeleted) {
|
||||
Runnable saveAction = () -> {
|
||||
ColliMagazzinoRESTConsumer.updateDataFine(
|
||||
mActivity,
|
||||
progress,
|
||||
currentMtbColt,
|
||||
() -> distribuisciCollo(progress, (generatedMtbColts) -> {
|
||||
if(shouldPrint) printCollo(progress, generatedMtbColts, onComplete);
|
||||
if (shouldPrint)
|
||||
printCollo(progress, generatedMtbColts, onComplete);
|
||||
else {
|
||||
postCloseOperations(generatedMtbColts, onComplete);
|
||||
progress.dismiss();
|
||||
@ -882,7 +875,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}), ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
|
||||
};
|
||||
|
||||
if(SettingsManager.iDB().isFlagAskPesoColloSpedizione()) {
|
||||
if (SettingsManager.iDB().isFlagAskPesoColloSpedizione()) {
|
||||
|
||||
DialogInputPeso.make(mActivity, currentMtbColt.getCodTcol(), currentMtbColt.getPesoNettoKg(), currentMtbColt.getPesoKg(), (newCodTcol, newNetWeight, newGrossWeight) -> {
|
||||
|
||||
@ -896,7 +889,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
saveAction.run();
|
||||
}
|
||||
} else {
|
||||
if(mtbColtSessionID != null) ColliDataRecover.closeSession(mtbColtSessionID);
|
||||
if (mtbColtSessionID != null) ColliDataRecover.closeSession(mtbColtSessionID);
|
||||
deleteCollo(progress, onComplete);
|
||||
}
|
||||
|
||||
@ -906,7 +899,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
});
|
||||
|
||||
} else {
|
||||
if(onComplete != null) onComplete.run();
|
||||
if (onComplete != null) onComplete.run();
|
||||
}
|
||||
|
||||
}
|
||||
@ -920,7 +913,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
ordiniVendita.distribuisciCollo(progress, cloneMtbColt, mTestateOrdini, mtbColts -> {
|
||||
|
||||
if(mtbColtSessionID != null) ColliDataRecover.closeSession(mtbColtSessionID);
|
||||
if (mtbColtSessionID != null) ColliDataRecover.closeSession(mtbColtSessionID);
|
||||
|
||||
ColliMagazzinoRESTConsumer.getMultipleByTestate(mtbColts, true, mtbColtsReloaded -> {
|
||||
onComplete.run(mtbColtsReloaded);
|
||||
@ -936,7 +929,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
private void printCollo(Dialog progress, List<MtbColt> mtbColtsToPrint, Runnable onComplete) {
|
||||
DialogAskShouldPrint.make(mActivity, "Packing List", shouldPrint -> {
|
||||
|
||||
if(shouldPrint) {
|
||||
if (shouldPrint) {
|
||||
PrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().userSession.depo.getCodMdep(), PrinterRESTConsumer.Type.PRIMARIA, value -> {
|
||||
|
||||
if (value.size() > 0) {
|
||||
@ -977,7 +970,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
|
||||
private void cyclicPrint(@NotNull Iterator<MtbColt> sourceMtbColts, String printerName, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||
if(sourceMtbColts.hasNext()){
|
||||
if (sourceMtbColts.hasNext()) {
|
||||
singlePrint(sourceMtbColts.next(), printerName, () -> {
|
||||
cyclicPrint(sourceMtbColts, printerName, onComplete, onAbort);
|
||||
}, onAbort);
|
||||
@ -1010,7 +1003,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
progress.dismiss();
|
||||
|
||||
|
||||
if(onComplete != null) onComplete.run();
|
||||
if (onComplete != null) onComplete.run();
|
||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress)
|
||||
);
|
||||
}
|
||||
@ -1035,9 +1028,9 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
shouldShowAddExtraItems.set(false);
|
||||
|
||||
|
||||
for(int i = 0; i < this.mPickingList.size(); i++) {
|
||||
for (int i = 0; i < this.mPickingList.size(); i++) {
|
||||
|
||||
for(int k = 0; k < this.mPickingList.get(i).getWithdrawRows().size(); k++) {
|
||||
for (int k = 0; k < this.mPickingList.get(i).getWithdrawRows().size(); k++) {
|
||||
|
||||
MtbColr withdrawRow = this.mPickingList.get(i).getWithdrawRows().get(k);
|
||||
|
||||
@ -1054,13 +1047,13 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
removeListFilter();
|
||||
refreshOrderBy(true);
|
||||
|
||||
if(onComplete != null) onComplete.run();
|
||||
if (onComplete != null) onComplete.run();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onOrdineRowDispatch(final PickingObjectDTO item) {
|
||||
if(mArticoliInColloBottomSheetViewModel.mtbColt.get() != null){
|
||||
if (mArticoliInColloBottomSheetViewModel.mtbColt.get() != null) {
|
||||
|
||||
|
||||
List<MtbColr> currentMtbColrs = mArticoliInColloBottomSheetViewModel.mtbColt.get().getMtbColr();
|
||||
@ -1080,11 +1073,10 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
|
||||
BigDecimal qtaDaEvadere = item.getQtaOrd().subtract(qtaEvasaTotaleInMtbColr);
|
||||
if(qtaDaEvadere.floatValue() < 0) qtaDaEvadere = BigDecimal.ZERO;
|
||||
if (qtaDaEvadere.floatValue() < 0) qtaDaEvadere = BigDecimal.ZERO;
|
||||
|
||||
int numCnfDaEvadere = item.getNumCnfOrd().intValue() - numCnfTotaleInMtbColr;
|
||||
if(numCnfDaEvadere < 0) numCnfDaEvadere = 0;
|
||||
|
||||
if (numCnfDaEvadere < 0) numCnfDaEvadere = 0;
|
||||
|
||||
|
||||
AtomicBigDecimal qtaColEvasaInCurrentUL = new AtomicBigDecimal();
|
||||
@ -1106,11 +1098,11 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
BigDecimal numCnfDisponibile = (item.isDeactivated() ? item.getNumCnfOrd() : item.getNumCnfDisponibileCollo()).subtract(numCnfEvasaInCurrentUL.get());
|
||||
BigDecimal numCnfTot = (item.isDeactivated() ? item.getNumCnfOrd() : item.getNumCnfCollo()).subtract(numCnfEvasaInCurrentUL.get());
|
||||
|
||||
if(qtaDisponibile.floatValue() < 0) qtaDisponibile = BigDecimal.ZERO;
|
||||
if(qtaTot.floatValue() < 0) qtaTot = BigDecimal.ZERO;
|
||||
if (qtaDisponibile.floatValue() < 0) qtaDisponibile = BigDecimal.ZERO;
|
||||
if (qtaTot.floatValue() < 0) qtaTot = BigDecimal.ZERO;
|
||||
|
||||
if(numCnfDisponibile.floatValue() < 0) numCnfDisponibile = BigDecimal.ZERO;
|
||||
if(numCnfTot.floatValue() < 0) numCnfTot = BigDecimal.ZERO;
|
||||
if (numCnfDisponibile.floatValue() < 0) numCnfDisponibile = BigDecimal.ZERO;
|
||||
if (numCnfTot.floatValue() < 0) numCnfTot = BigDecimal.ZERO;
|
||||
|
||||
DialogInputQuantity.DTO dto = new DialogInputQuantity.DTO()
|
||||
.setBatchLot(item.getPartitaMag())
|
||||
@ -1126,16 +1118,16 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
boolean batchLotEnabled = true;
|
||||
|
||||
if(item.getTempPickData() != null) {
|
||||
if (item.getTempPickData() != null) {
|
||||
PickingObjectDTO.PickData tmpPickData = item.getTempPickData();
|
||||
|
||||
if(tmpPickData.getQtaCnf() == null && tmpPickData.getNumCnf() != null && tmpPickData.getQtaTot() != null) {
|
||||
if (tmpPickData.getQtaCnf() == null && tmpPickData.getNumCnf() != null && tmpPickData.getQtaTot() != null) {
|
||||
tmpPickData.setQtaCnf(tmpPickData.getQtaTot().divide(tmpPickData.getNumCnf(), 3, RoundingMode.HALF_EVEN));
|
||||
}
|
||||
|
||||
boolean isTakenFromUL = tmpPickData.getSourceMtbColt() != null;
|
||||
|
||||
if(tmpPickData.getMtbPartitaMag() != null) {
|
||||
if (tmpPickData.getMtbPartitaMag() != null) {
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(tmpPickData.getMtbPartitaMag().getPartitaMag())) {
|
||||
dto.setBatchLot(tmpPickData.getMtbPartitaMag().getPartitaMag());
|
||||
@ -1151,7 +1143,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
boolean useQtaDaEvadere = false;
|
||||
|
||||
if(tmpPickData.getQtaTot() != null) {
|
||||
if (tmpPickData.getQtaTot() != null) {
|
||||
useQtaDaEvadere = qtaDaEvadere.floatValue() < tmpPickData.getQtaTot().floatValue() && item.getMtbAart().isFlagQtaCnfFissa();
|
||||
if (useQtaDaEvadere && !isTakenFromUL) {
|
||||
dto.setQtaTot(qtaDaEvadere);
|
||||
@ -1162,7 +1154,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
// }
|
||||
|
||||
} else {
|
||||
if(SettingsManager.iDB().isFlagForceAllToColli()) {
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli()) {
|
||||
|
||||
int numCnfColDaEvadere = numCnfDaEvadere < tmpPickData.getNumCnf().intValue() ? numCnfDaEvadere : tmpPickData.getNumCnf().intValue();
|
||||
dto.setNumCnf(numCnfColDaEvadere);
|
||||
@ -1174,7 +1166,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
dto.setQtaTot(qtaDaEvadere.compareTo(tmpPickData.getQtaTot()) < 0 && !tmpPickData.isEanPeso() ? qtaDaEvadere : tmpPickData.getQtaTot());
|
||||
dto.setMaxQta(tmpPickData.getQtaTot());
|
||||
|
||||
if(tmpPickData.getNumCnf() != null) {
|
||||
if (tmpPickData.getNumCnf() != null) {
|
||||
dto.setQtaCnf(tmpPickData.getQtaTot().divide(tmpPickData.getNumCnf(), 3, RoundingMode.HALF_UP));
|
||||
} else {
|
||||
dto.setQtaCnf(tmpPickData.getQtaTot());
|
||||
@ -1182,8 +1174,6 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (tmpPickData.getQtaCnf() != null && useQtaDaEvadere) {
|
||||
@ -1192,12 +1182,12 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
|
||||
|
||||
if(dto.getQtaDaEvadere() != null && dto.getQtaDaEvadere().floatValue() > 0 && dto.getQtaCnf() != null && dto.getQtaCnf().floatValue() > 0) {
|
||||
if(useQtaDaEvadere && (dto.getQtaDaEvadere() != null && dto.getQtaDaEvadere().floatValue() > 0)) {
|
||||
if (dto.getQtaDaEvadere() != null && dto.getQtaDaEvadere().floatValue() > 0 && dto.getQtaCnf() != null && dto.getQtaCnf().floatValue() > 0) {
|
||||
if (useQtaDaEvadere && (dto.getQtaDaEvadere() != null && dto.getQtaDaEvadere().floatValue() > 0)) {
|
||||
dto.setNumCnf(dto.getQtaDaEvadere().divide(dto.getQtaCnf(), 3, RoundingMode.HALF_EVEN).intValue());
|
||||
} else {
|
||||
dto.setNumCnf((dto.getQtaTot().compareTo(dto.getQtaDaEvadere()) < 0 ? dto.getQtaTot() : dto.getQtaDaEvadere()).divide(dto.getQtaCnf(), RoundingMode.HALF_UP).intValue());
|
||||
if(dto.getNumCnf() == 0) dto.setNumCnf(1);
|
||||
if (dto.getNumCnf() == 0) dto.setNumCnf(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1207,15 +1197,18 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
BigDecimal qtaCnf = null;
|
||||
|
||||
if(item.getQtaCnfOrd() != null) {
|
||||
if (item.getQtaCnfOrd() != null) {
|
||||
qtaCnf = item.getQtaCnfOrd();
|
||||
} else if(item.getQtaCnfCollo() != null) {
|
||||
} else if (item.getQtaCnfCollo() != null) {
|
||||
qtaCnf = item.getQtaCnfCollo();
|
||||
} else if(item.getMtbAart() != null){
|
||||
} else if (item.getMtbAart() != null) {
|
||||
qtaCnf = item.getMtbAart().getQtaCnf();
|
||||
}
|
||||
|
||||
if(qtaDaEvadere.compareTo(BigDecimal.ZERO) > 0) {
|
||||
|
||||
if (qtaDisponibile != null && qtaDisponibile.compareTo(BigDecimal.ZERO) > 0) {
|
||||
dto.setNumCnf(qtaDisponibile.divide(qtaCnf, 3, RoundingMode.HALF_EVEN).setScale(0, RoundingMode.UP).intValue());
|
||||
} else if (qtaDaEvadere.compareTo(BigDecimal.ZERO) > 0) {
|
||||
dto.setNumCnf(qtaDaEvadere.divide(qtaCnf, 3, RoundingMode.HALF_EVEN).setScale(0, RoundingMode.UP).intValue());
|
||||
}
|
||||
|
||||
@ -1224,7 +1217,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
boolean canOverflowQuantity = SettingsManager.iDB().isFlagCanAddExtraQuantitySpedizione();
|
||||
|
||||
if(!batchLotEnabled) {
|
||||
if (!batchLotEnabled) {
|
||||
this.showBatchLotDisabledWarning(dto.getBatchLot(), () -> {
|
||||
DialogInputQuantity.makeBase(mActivity, dto, canOverflowQuantity, (quantityDTO, closeUL) -> onOrdineRowDispatched(item, quantityDTO, closeUL), null).show();
|
||||
}, null);
|
||||
@ -1234,7 +1227,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
}
|
||||
|
||||
private void onOrdineRowDispatched(PickingObjectDTO item, QuantityDTO quantityDTO, boolean closeUL){
|
||||
private void onOrdineRowDispatched(PickingObjectDTO item, QuantityDTO quantityDTO, boolean closeUL) {
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
|
||||
final MtbColr mtbColr = new MtbColr()
|
||||
@ -1246,7 +1239,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.setDescrizione(item.getDescrizioneEstesa())
|
||||
.setDatetimeRow(UtilityDate.getDateInstance());
|
||||
|
||||
if(item.getTempPickData() != null && item.getTempPickData().getSourceMtbColt() != null) {
|
||||
if (item.getTempPickData() != null && item.getTempPickData().getSourceMtbColt() != null) {
|
||||
MtbColt sourceMtbColt = item.getTempPickData().getSourceMtbColt();
|
||||
|
||||
mtbColr
|
||||
@ -1258,7 +1251,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
MtbColt currentOpenedMtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||
|
||||
if( currentOpenedMtbColt.getCodTcol() == null &&
|
||||
if (currentOpenedMtbColt.getCodTcol() == null &&
|
||||
currentOpenedMtbColt.getPesoKg() == null &&
|
||||
currentOpenedMtbColt.getPesoNettoKg() == null) {
|
||||
|
||||
@ -1267,7 +1260,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
currentOpenedMtbColt.setPesoNettoKg(sourceMtbColt.getPesoNettoKg());
|
||||
}
|
||||
|
||||
} else if(item.getNumCollo() != null) {
|
||||
} else if (item.getNumCollo() != null) {
|
||||
mtbColr
|
||||
.setCodJcom(UtilityString.empty2null(item.getCodJcom()))
|
||||
.setSerColloRif(UtilityString.empty2null(item.getSerCollo()))
|
||||
@ -1288,10 +1281,10 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
boolean shouldPrint = true;
|
||||
//Se è l'unico articolo del collo
|
||||
if(closeUL && mArticoliInColloBottomSheetViewModel.mtbColt.get().getMtbColr().size() == 0) {
|
||||
if (closeUL && mArticoliInColloBottomSheetViewModel.mtbColt.get().getMtbColr().size() == 0) {
|
||||
// this.addTipoPedanaFromArt(item, cloneMtbColt, closeUL, progress);
|
||||
shouldPrint = false;
|
||||
if(UtilityString.isNullOrEmpty(cloneMtbColt.getCodTcol())) {
|
||||
if (UtilityString.isNullOrEmpty(cloneMtbColt.getCodTcol())) {
|
||||
cloneMtbColt.setCodTcol(item.getCodTcol());
|
||||
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
}
|
||||
@ -1301,13 +1294,12 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
onOrdineRowSave(item, cloneMtbColt, closeUL, !shouldPrint, progress);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void addTipoPedanaFromArt(PickingObjectDTO item, MtbColt cloneMtbColt, boolean closeUL, Dialog progress) {
|
||||
|
||||
String codTcol = item.getCodTcol();
|
||||
if(codTcol != null) {
|
||||
if (codTcol != null) {
|
||||
MagazzinoRESTConsumer.getTipoCollo(codTcol, mtbTcol -> {
|
||||
if (mtbTcol != null) {
|
||||
final MtbColr mtbColr = new MtbColr()
|
||||
@ -1354,11 +1346,11 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
removeListFilter();
|
||||
|
||||
|
||||
FBToast.successToast(mActivity,mActivity.getResources().getString(R.string.data_saved) ,FBToast.LENGTH_SHORT);
|
||||
FBToast.successToast(mActivity, mActivity.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||
|
||||
progress.dismiss();
|
||||
|
||||
if(closeUL) onColloClosed(null, !hasTipoCollo);
|
||||
if (closeUL) onColloClosed(null, !hasTipoCollo);
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||
});
|
||||
@ -1367,14 +1359,14 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
private void addExtraItem() {
|
||||
DialogScanArt.make(mActivity, (status, mtbAart, ean128Model) -> {
|
||||
if(status == DialogConsts.Results.YES) {
|
||||
if (status == DialogConsts.Results.YES) {
|
||||
this.dispatchExtraItem(mtbAart, ean128Model);
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
|
||||
|
||||
private void dispatchExtraItem(MtbAart mtbAart, Ean128Model ean128Model){
|
||||
private void dispatchExtraItem(MtbAart mtbAart, Ean128Model ean128Model) {
|
||||
DialogInputQuantity.DTO qtaDto = new DialogInputQuantity.DTO();
|
||||
|
||||
qtaDto.setMtbAart(mtbAart);
|
||||
@ -1390,17 +1382,17 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
qtaDto.setCanDataScadBeChanged(true);
|
||||
|
||||
|
||||
if(ean128Model != null){
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
|
||||
if (ean128Model != null) {
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.BatchLot)) {
|
||||
qtaDto.setBatchLot(ean128Model.BatchLot);
|
||||
qtaDto.setCanPartitaMagBeChanged(false);
|
||||
}
|
||||
|
||||
try {
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.BestBefore)){
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.BestBefore)) {
|
||||
qtaDto.setDataScad(UtilityDate.recognizeDate(ean128Model.BestBefore));
|
||||
qtaDto.setCanDataScadBeChanged(false);
|
||||
} else if(!UtilityString.isNullOrEmpty(ean128Model.Expiry)) {
|
||||
} else if (!UtilityString.isNullOrEmpty(ean128Model.Expiry)) {
|
||||
qtaDto.setDataScad(UtilityDate.recognizeDate(ean128Model.Expiry));
|
||||
qtaDto.setCanDataScadBeChanged(false);
|
||||
}
|
||||
@ -1410,7 +1402,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
|
||||
|
||||
if(ean128Model.Count != null && ean128Model.Count > 0) {
|
||||
if (ean128Model.Count != null && ean128Model.Count > 0) {
|
||||
qtaDto.setNumCnf(ean128Model.Count);
|
||||
}
|
||||
|
||||
@ -1432,7 +1424,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}).show();
|
||||
}
|
||||
|
||||
private void onExtraItemDispatched(MtbAart item, QuantityDTO quantityDTO, boolean closeUL){
|
||||
private void onExtraItemDispatched(MtbAart item, QuantityDTO quantityDTO, boolean closeUL) {
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
|
||||
final MtbColr mtbColr = new MtbColr()
|
||||
@ -1471,23 +1463,20 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
removeListFilter();
|
||||
|
||||
|
||||
FBToast.successToast(mActivity,mActivity.getResources().getString(R.string.data_saved) ,FBToast.LENGTH_SHORT);
|
||||
FBToast.successToast(mActivity, mActivity.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||
|
||||
progress.dismiss();
|
||||
|
||||
if(closeUL) onColloClosed(null, true);
|
||||
if (closeUL) onColloClosed(null, true);
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void manualSearch() {
|
||||
BarcodeManager.disable();
|
||||
DialogSimpleInputHelper.makeInputDialog(mActivity,"Inserisci il codice a barre", codice->{
|
||||
DialogSimpleInputHelper.makeInputDialog(mActivity, "Inserisci il codice a barre", codice -> {
|
||||
|
||||
this.onScanSuccessfull.run(new BarcodeScanDTO().setStringValue(codice).setType(BarcodeType.CODE128));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user