Fix qta da evadere in spedizione
This commit is contained in:
10
.idea/jarRepositories.xml
generated
10
.idea/jarRepositories.xml
generated
@@ -31,5 +31,15 @@
|
|||||||
<option name="name" value="MavenRepo" />
|
<option name="name" value="MavenRepo" />
|
||||||
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
||||||
</remote-repository>
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="Google" />
|
||||||
|
<option name="name" value="Google" />
|
||||||
|
<option name="url" value="https://maven.google.com/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="maven2" />
|
||||||
|
<option name="name" value="maven2" />
|
||||||
|
<option name="url" value="https://maven.fabric.io/public" />
|
||||||
|
</remote-repository>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative;
|
|||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.KeyEvent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
@@ -33,6 +34,7 @@ import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
|||||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||||
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IFilterableFragment;
|
import it.integry.integrywmsnative.core.interfaces.IFilterableFragment;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.ILifecycleFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ISearcableFragment;
|
import it.integry.integrywmsnative.core.interfaces.ISearcableFragment;
|
||||||
@@ -97,6 +99,22 @@ public class MainActivity extends BaseActivity
|
|||||||
startActivity(myIntent);
|
startActivity(myIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
|
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||||
|
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||||
|
onBackPressed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onKeyUp(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -110,7 +128,10 @@ public class MainActivity extends BaseActivity
|
|||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
} else {
|
} else {
|
||||||
pop();
|
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.frame_container);
|
||||||
|
if (fragment instanceof ILifecycleFragment) {
|
||||||
|
((ILifecycleFragment) fragment).onPreDestroy(this::pop);
|
||||||
|
} else pop();
|
||||||
// getSupportFragmentManager().popBackStack();
|
// getSupportFragmentManager().popBackStack();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.interfaces;
|
||||||
|
|
||||||
|
public interface ILifecycleFragment {
|
||||||
|
|
||||||
|
void onPreDestroy(Runnable onComplete);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -50,9 +50,10 @@ public class MtbColr extends EntityBase {
|
|||||||
private BigDecimal pesoLordoKg;
|
private BigDecimal pesoLordoKg;
|
||||||
|
|
||||||
private MtbAart mtbAart;
|
private MtbAart mtbAart;
|
||||||
|
|
||||||
private MtbPartitaMag mtbPartitaMag;
|
private MtbPartitaMag mtbPartitaMag;
|
||||||
|
|
||||||
|
private transient MtbColr refMtbColr;
|
||||||
|
|
||||||
public MtbColr() {
|
public MtbColr() {
|
||||||
type = "mtb_colr";
|
type = "mtb_colr";
|
||||||
}
|
}
|
||||||
@@ -509,4 +510,13 @@ public class MtbColr extends EntityBase {
|
|||||||
this.pesoLordoKg = pesoLordoKg;
|
this.pesoLordoKg = pesoLordoKg;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MtbColr getRefMtbColr() {
|
||||||
|
return refMtbColr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setRefMtbColr(MtbColr refMtbColr) {
|
||||||
|
this.refMtbColr = refMtbColr;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import androidx.databinding.ObservableArrayList;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model.dto;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
|
|
||||||
|
public class WithdrawableMtbColr extends MtbColr {
|
||||||
|
|
||||||
|
private transient MtbColr withdrawRow;
|
||||||
|
|
||||||
|
public WithdrawableMtbColr() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr getWithdrawRow() {
|
||||||
|
return withdrawRow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WithdrawableMtbColr setWithdrawRow(MtbColr withdrawRow) {
|
||||||
|
this.withdrawRow = withdrawRow;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -649,7 +649,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new Callback<ServiceRESTResponse<List<MtbColt>>>() {
|
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new Callback<ServiceRESTResponse<List<MtbColt>>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<MtbColt>>> call, Response<ServiceRESTResponse<List<MtbColt>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<MtbColt>>> call, Response<ServiceRESTResponse<List<MtbColt>>> response) {
|
||||||
analyzeAnswer(response, "GetBySSCC", mtbColts -> {
|
analyzeAnswer(response, "getColliInBasket", mtbColts -> {
|
||||||
fillMtbAartsOfMtbColts(mtbColts, onComplete, onFailed);
|
fillMtbAartsOfMtbColts(mtbColts, onComplete, onFailed);
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
@@ -666,7 +666,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void creaRettificaColloStatic(MtbColr sourceMtbColrOriginal, BigDecimal newNumCnf, BigDecimal newQtaTot, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public static void creaRettificaColloStatic(MtbColr sourceMtbColrOriginal, BigDecimal newNumCnf, BigDecimal newQtaTot, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MtbColr sourceMtbColr = (MtbColr) sourceMtbColrOriginal.clone();
|
MtbColr sourceMtbColr = (MtbColr) sourceMtbColrOriginal.clone();
|
||||||
sourceMtbColr.setMtbPartitaMag(null);
|
sourceMtbColr.setMtbPartitaMag(null);
|
||||||
sourceMtbColr.setMtbAart(null);
|
sourceMtbColr.setMtbAart(null);
|
||||||
@@ -680,16 +680,16 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
colliMagazzinoRESTConsumerService.creaRettificaCollo(
|
colliMagazzinoRESTConsumerService.creaRettificaCollo(
|
||||||
SettingsManager.i().getUserSession().getDepo().getCodMdep(),
|
SettingsManager.i().getUserSession().getDepo().getCodMdep(),
|
||||||
rettificaULDTO
|
rettificaULDTO
|
||||||
).enqueue(new Callback<ServiceRESTResponse<JsonObject>>() {
|
).enqueue(new Callback<ServiceRESTResponse<MtbColr>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
public void onResponse(Call<ServiceRESTResponse<MtbColr>> call, Response<ServiceRESTResponse<MtbColr>> response) {
|
||||||
analyzeAnswer(response, "GetBySSCC", data -> {
|
analyzeAnswer(response, "creaRettificaCollo", data -> {
|
||||||
onComplete.run();
|
onComplete.run(data);
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<MtbColr>> call, Throwable t) {
|
||||||
if(onFailed != null) onFailed.run(new Exception(t));
|
if(onFailed != null) onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -697,7 +697,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void creaRettificaCollo(MtbColr sourceMtbColrOriginal, BigDecimal newNumCnf, BigDecimal newQtaTot, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void creaRettificaCollo(MtbColr sourceMtbColrOriginal, BigDecimal newNumCnf, BigDecimal newQtaTot, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
creaRettificaColloStatic(sourceMtbColrOriginal, newNumCnf, newQtaTot, onComplete, onFailed);
|
creaRettificaColloStatic(sourceMtbColrOriginal, newNumCnf, newQtaTot, onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,11 @@ import com.google.gson.JsonObject;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
@@ -26,6 +27,6 @@ public interface ColliMagazzinoRESTConsumerService {
|
|||||||
Call<ServiceRESTResponse<List<MtbColt>>> getColliInBasket(@Query("codMdep") String codMdep);
|
Call<ServiceRESTResponse<List<MtbColt>>> getColliInBasket(@Query("codMdep") String codMdep);
|
||||||
|
|
||||||
@POST("creaRettificaCollo")
|
@POST("creaRettificaCollo")
|
||||||
Call<ServiceRESTResponse<JsonObject>> creaRettificaCollo(@Query("codMdep") String codMdep, @Body RettificaULDTO rettificaULDTO);
|
Call<ServiceRESTResponse<MtbColr>> creaRettificaCollo(@Query("codMdep") String codMdep, @Body RettificaULDTO rettificaULDTO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import it.integry.integrywmsnative.core.di.BindableBoolean;
|
|||||||
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.ILifecycleFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
@@ -61,7 +62,7 @@ import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQua
|
|||||||
/**
|
/**
|
||||||
* A simple {@link Fragment} subclass.
|
* A simple {@link Fragment} subclass.
|
||||||
*/
|
*/
|
||||||
public class PickingLiberoFragment extends Fragment implements ITitledFragment, IScrollableFragment, PickingLiberoViewModel.Listener, BottomSheetMtbColrEditView.Listener {
|
public class PickingLiberoFragment extends Fragment implements ITitledFragment, IScrollableFragment, ILifecycleFragment, PickingLiberoViewModel.Listener, BottomSheetMtbColrEditView.Listener {
|
||||||
|
|
||||||
private FragmentPickingLiberoBinding mBindings;
|
private FragmentPickingLiberoBinding mBindings;
|
||||||
|
|
||||||
@@ -207,7 +208,7 @@ public class PickingLiberoFragment extends Fragment implements ITitledFragment,
|
|||||||
|
|
||||||
public void closeLU() {
|
public void closeLU() {
|
||||||
destroyAdapter();
|
destroyAdapter();
|
||||||
this.mViewModel.closeLU();
|
this.mViewModel.closeLU(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -226,8 +227,6 @@ public class PickingLiberoFragment extends Fragment implements ITitledFragment,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
if(thereIsAnOpenedUL.get()) mViewModel.closeLU();
|
|
||||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
|
||||||
if (mOnPreDestroy != null) mOnPreDestroy.run();
|
if (mOnPreDestroy != null) mOnPreDestroy.run();
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
}
|
}
|
||||||
@@ -392,4 +391,10 @@ public class PickingLiberoFragment extends Fragment implements ITitledFragment,
|
|||||||
public void onMtbColrDelete(MtbColr mtbColr) {
|
public void onMtbColrDelete(MtbColr mtbColr) {
|
||||||
this.mViewModel.deleteRow(mtbColr);
|
this.mViewModel.deleteRow(mtbColr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPreDestroy(Runnable onComplete) {
|
||||||
|
if(thereIsAnOpenedUL.get()) mViewModel.closeLU(onComplete);
|
||||||
|
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -514,7 +514,7 @@ public class PickingLiberoViewModel {
|
|||||||
this.sendOnRowSaved();
|
this.sendOnRowSaved();
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
if (shouldCloseLU) closeLU();
|
if (shouldCloseLU) closeLU(null);
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -692,8 +692,11 @@ public class PickingLiberoViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void closeLU() {
|
public void closeLU(Runnable onComplete) {
|
||||||
if (mCurrentMtbColt == null) return;
|
if (mCurrentMtbColt == null) {
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
@@ -704,6 +707,7 @@ public class PickingLiberoViewModel {
|
|||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
this.mCurrentMtbColt = null;
|
this.mCurrentMtbColt = null;
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> {
|
mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> {
|
||||||
@@ -711,6 +715,7 @@ public class PickingLiberoViewModel {
|
|||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
this.mCurrentMtbColt = null;
|
this.mCurrentMtbColt = null;
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
|||||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.ILifecycleFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
@@ -64,7 +65,7 @@ import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQua
|
|||||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLU;
|
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLU;
|
||||||
import it.integry.integrywmsnative.view.dialogs.yes_no.DialogYesNo;
|
import it.integry.integrywmsnative.view.dialogs.yes_no.DialogYesNo;
|
||||||
|
|
||||||
public class RettificaGiacenzeFragment extends Fragment implements ITitledFragment, RettificaGiacenzeViewModel.Listener, BottomSheetMtbColrEditView.Listener {
|
public class RettificaGiacenzeFragment extends Fragment implements ITitledFragment, ILifecycleFragment, RettificaGiacenzeViewModel.Listener, BottomSheetMtbColrEditView.Listener {
|
||||||
|
|
||||||
private FragmentMainRettificaGiacenzeBinding mBinding = null;
|
private FragmentMainRettificaGiacenzeBinding mBinding = null;
|
||||||
|
|
||||||
@@ -196,12 +197,6 @@ public class RettificaGiacenzeFragment extends Fragment implements ITitledFragme
|
|||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroyView() {
|
|
||||||
mViewModel.closeLU(false);
|
|
||||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
|
||||||
super.onDestroyView();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||||
@@ -512,4 +507,10 @@ public class RettificaGiacenzeFragment extends Fragment implements ITitledFragme
|
|||||||
}
|
}
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPreDestroy(Runnable onComplete) {
|
||||||
|
mViewModel.closeLU(false, onComplete);
|
||||||
|
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import java.util.List;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
import it.integry.integrywmsnative.core.exception.InvalidLUGestioneException;
|
|
||||||
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
|
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
|
||||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
||||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||||
@@ -26,7 +25,6 @@ import it.integry.integrywmsnative.core.model.MtbColr;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbCols;
|
import it.integry.integrywmsnative.core.model.MtbCols;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
|
||||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
@@ -89,14 +87,14 @@ public class RettificaGiacenzeViewModel {
|
|||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
this.sendOnLUOpenRequest((mtbColt, created) -> {
|
this.sendOnLUOpenRequest((mtbColt, created) -> {
|
||||||
if(mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO) {
|
//if(mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO) {
|
||||||
this.sendError(new InvalidLUGestioneException(GestioneEnum.ACQUISTO));
|
// this.sendError(new InvalidLUGestioneException(GestioneEnum.ACQUISTO));
|
||||||
} else {
|
//} else {
|
||||||
this.mCurrentMtbColt = mtbColt;
|
this.mCurrentMtbColt = mtbColt;
|
||||||
this.mIsCreatedLU = created;
|
this.mIsCreatedLU = created;
|
||||||
|
|
||||||
this.sendLUOpened(mtbColt);
|
this.sendLUOpened(mtbColt);
|
||||||
}
|
//}
|
||||||
});
|
});
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
@@ -321,6 +319,8 @@ public class RettificaGiacenzeViewModel {
|
|||||||
|
|
||||||
if (!mIsCreatedLU) {
|
if (!mIsCreatedLU) {
|
||||||
mtbColr
|
mtbColr
|
||||||
|
.setQtaCol(BigDecimal.ZERO)
|
||||||
|
.setNumCnf(BigDecimal.ZERO)
|
||||||
.setDataCollo(mCurrentMtbColt.getDataColloS())
|
.setDataCollo(mCurrentMtbColt.getDataColloS())
|
||||||
.setNumCollo(mCurrentMtbColt.getNumCollo())
|
.setNumCollo(mCurrentMtbColt.getNumCollo())
|
||||||
.setGestione(mCurrentMtbColt.getGestione())
|
.setGestione(mCurrentMtbColt.getGestione())
|
||||||
@@ -330,8 +330,11 @@ public class RettificaGiacenzeViewModel {
|
|||||||
mColliMagazzinoRESTConsumer.creaRettificaCollo(mtbColr,
|
mColliMagazzinoRESTConsumer.creaRettificaCollo(mtbColr,
|
||||||
numCnf,
|
numCnf,
|
||||||
qtaTot,
|
qtaTot,
|
||||||
() -> {
|
savedMtbColr -> {
|
||||||
mtbColr
|
mtbColr
|
||||||
|
.setQtaCol(savedMtbColr.getQtaCol())
|
||||||
|
.setQtaCnf(savedMtbColr.getQtaCnf())
|
||||||
|
.setNumCnf(savedMtbColr.getNumCnf())
|
||||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||||
|
|
||||||
@@ -340,7 +343,7 @@ public class RettificaGiacenzeViewModel {
|
|||||||
this.sendOnRowSaved();
|
this.sendOnRowSaved();
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
if (shouldCloseLU) closeLU(false);
|
if (shouldCloseLU) closeLU(false, null);
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
} else {
|
} else {
|
||||||
mtbColr
|
mtbColr
|
||||||
@@ -370,14 +373,21 @@ public class RettificaGiacenzeViewModel {
|
|||||||
this.sendOnRowSaved();
|
this.sendOnRowSaved();
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
if (shouldCloseLU) closeLU(false);
|
if (shouldCloseLU) closeLU(false, null);
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void closeLU(boolean saveCausale) {
|
public void closeLU(boolean saveCausale) {
|
||||||
if (mCurrentMtbColt == null) return;
|
closeLU(saveCausale, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void closeLU(boolean saveCausale, Runnable onComplete) {
|
||||||
|
if (mCurrentMtbColt == null) {
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
@@ -397,10 +407,10 @@ public class RettificaGiacenzeViewModel {
|
|||||||
|
|
||||||
if(shouldChangePosition) {
|
if(shouldChangePosition) {
|
||||||
this.savePosizione(mtbDepoPosizione, () -> {
|
this.savePosizione(mtbDepoPosizione, () -> {
|
||||||
postSaveBehaviour();
|
postSaveBehaviour(onComplete);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
postSaveBehaviour();
|
postSaveBehaviour(onComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -444,17 +454,19 @@ public class RettificaGiacenzeViewModel {
|
|||||||
this.mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, mtbColt -> onComplete.run(), this::sendError);
|
this.mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, mtbColt -> onComplete.run(), this::sendError);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void postSaveBehaviour() {
|
private void postSaveBehaviour(Runnable onComplete) {
|
||||||
if(!mCurrentMtbColt.getDisablePrint()) {
|
if(!mCurrentMtbColt.getDisablePrint()) {
|
||||||
printLU(() -> {
|
printLU(() -> {
|
||||||
this.mCurrentMtbColt = null;
|
this.mCurrentMtbColt = null;
|
||||||
this.sendLUClosed();
|
this.sendLUClosed();
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.mCurrentMtbColt = null;
|
this.mCurrentMtbColt = null;
|
||||||
this.sendLUClosed();
|
this.sendLUClosed();
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,7 +536,6 @@ public class RettificaGiacenzeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
||||||
|
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
if(!mIsCreatedLU) {
|
if(!mIsCreatedLU) {
|
||||||
@@ -533,13 +544,16 @@ public class RettificaGiacenzeViewModel {
|
|||||||
mtbColrToUpdate,
|
mtbColrToUpdate,
|
||||||
numCnf,
|
numCnf,
|
||||||
qtaTot,
|
qtaTot,
|
||||||
() -> {
|
savedMtbColr -> {
|
||||||
mtbColrToUpdate
|
mtbColrToUpdate
|
||||||
.setQtaCol(qtaTot)
|
.setQtaCol(savedMtbColr.getQtaCol())
|
||||||
.setQtaCnf(qtaCnf)
|
.setQtaCnf(savedMtbColr.getQtaCnf())
|
||||||
.setNumCnf(numCnf)
|
.setNumCnf(savedMtbColr.getNumCnf())
|
||||||
.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||||
|
|
||||||
|
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
|
||||||
|
this.mCurrentMtbColt.getMtbColr().add(mtbColrToUpdate);
|
||||||
|
|
||||||
this.sendOnRowSaved();
|
this.sendOnRowSaved();
|
||||||
},
|
},
|
||||||
this::sendError
|
this::sendError
|
||||||
@@ -616,8 +630,9 @@ public class RettificaGiacenzeViewModel {
|
|||||||
mtbColrToDelete,
|
mtbColrToDelete,
|
||||||
BigDecimal.ZERO,
|
BigDecimal.ZERO,
|
||||||
BigDecimal.ZERO,
|
BigDecimal.ZERO,
|
||||||
() -> {
|
savedMtbColr -> {
|
||||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToDelete);
|
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToDelete);
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
this.sendOnRowSaved();
|
this.sendOnRowSaved();
|
||||||
},
|
},
|
||||||
this::sendError
|
this::sendError
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
AtomicBigDecimal numCnfWithdrawRows = new AtomicBigDecimal();
|
AtomicBigDecimal numCnfWithdrawRows = new AtomicBigDecimal();
|
||||||
AtomicBigDecimal qtaColWithdrawRows = new AtomicBigDecimal();
|
AtomicBigDecimal qtaColWithdrawRows = new AtomicBigDecimal();
|
||||||
|
|
||||||
Stream.of(x.getWithdrawMtbColr())
|
Stream.of(x.getWithdrawMtbColrs())
|
||||||
.forEach(row -> {
|
.forEach(row -> {
|
||||||
numCnfWithdrawRows.addAndGet(row.getNumCnf());
|
numCnfWithdrawRows.addAndGet(row.getNumCnf());
|
||||||
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
||||||
@@ -267,8 +267,14 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
spedizioneListModels.add(spedizioneListModel);
|
spedizioneListModels.add(spedizioneListModel);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
BigDecimal qtaColOrdCounter = x.getSitArtOrdDTO().getQtaOrd();
|
||||||
|
// qtaColOrdCounter = qtaColOrdCounter.add(qtaColWithdrawRows.getBigDecimalValue());
|
||||||
|
|
||||||
for (MtbColt mtbColtToPick : x.getMtbColts()) {
|
for (MtbColt mtbColtToPick : x.getMtbColts()) {
|
||||||
|
|
||||||
|
if(UtilityBigDecimal.equalsTo(qtaColOrdCounter, BigDecimal.ZERO) || UtilityBigDecimal.lowerThan(qtaColOrdCounter, BigDecimal.ZERO))
|
||||||
|
break;
|
||||||
|
|
||||||
SpedizioneListModel cloneModel = (SpedizioneListModel) spedizioneListModel.clone();
|
SpedizioneListModel cloneModel = (SpedizioneListModel) spedizioneListModel.clone();
|
||||||
|
|
||||||
cloneModel.setGroupTitle(String.format("%s: %s", getString(R.string.position_text), UtilityString.isNullOrEmpty(mtbColtToPick.getPosizione()) ? "N.A." : mtbColtToPick.getPosizione()));
|
cloneModel.setGroupTitle(String.format("%s: %s", getString(R.string.position_text), UtilityString.isNullOrEmpty(mtbColtToPick.getPosizione()) ? "N.A." : mtbColtToPick.getPosizione()));
|
||||||
@@ -286,8 +292,25 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
cloneModel.setQtaTot(mtbColrToDispatch != null ? mtbColrToDispatch.getNumCnf() : x.getSitArtOrdDTO().getNumCnfOrd());
|
cloneModel.setQtaTot(mtbColrToDispatch != null ? mtbColrToDispatch.getNumCnf() : x.getSitArtOrdDTO().getNumCnfOrd());
|
||||||
cloneModel.setQtaEvasa(numCnfWithdrawRows.getBigDecimalValue());
|
cloneModel.setQtaEvasa(numCnfWithdrawRows.getBigDecimalValue());
|
||||||
} else {
|
} else {
|
||||||
cloneModel.setQtaTot(mtbColrToDispatch != null ? mtbColrToDispatch.getQtaCol() : x.getSitArtOrdDTO().getQtaOrd());
|
|
||||||
cloneModel.setQtaEvasa(qtaColWithdrawRows.getBigDecimalValue());
|
BigDecimal qtaOrdToSubstract = UtilityBigDecimal.getLowerBetween(mtbColrToDispatch.getQtaCol(), qtaColOrdCounter);
|
||||||
|
|
||||||
|
cloneModel.setQtaTot(UtilityBigDecimal.getLowerBetween(mtbColrToDispatch.getQtaCol(), qtaColOrdCounter));
|
||||||
|
qtaColOrdCounter = qtaColOrdCounter.subtract(qtaOrdToSubstract);
|
||||||
|
|
||||||
|
BigDecimal qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||||
|
.filter(y -> y.getRefMtbColr() != null &&
|
||||||
|
y.getRefMtbColr().getNumCollo().equals(mtbColrToDispatch.getNumCollo()) &&
|
||||||
|
y.getRefMtbColr().getDataColloD().equals(mtbColrToDispatch.getDataColloD()) &&
|
||||||
|
y.getRefMtbColr().getSerCollo().equals(mtbColrToDispatch.getSerCollo()) &&
|
||||||
|
y.getRefMtbColr().getGestioneEnum().equals(mtbColrToDispatch.getGestioneEnum()) &&
|
||||||
|
UtilityString.equalsIgnoreCase(y.getRefMtbColr().getCodMart(), mtbColrToDispatch.getCodMart()) &&
|
||||||
|
UtilityString.equalsIgnoreCase(y.getRefMtbColr().getCodTagl(), mtbColrToDispatch.getCodTagl()) &&
|
||||||
|
UtilityString.equalsIgnoreCase(y.getRefMtbColr().getCodCol(), mtbColrToDispatch.getCodCol()))
|
||||||
|
.map(MtbColr::getQtaCol)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
cloneModel.setQtaEvasa(qtaEvasa);
|
||||||
if (x.getMtbAart() != null)
|
if (x.getMtbAart() != null)
|
||||||
cloneModel.setUntMis(x.getMtbAart().getUntMis());
|
cloneModel.setUntMis(x.getMtbAart().getUntMis());
|
||||||
}
|
}
|
||||||
@@ -348,7 +371,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
AtomicBigDecimal numCnfWithdrawRows = new AtomicBigDecimal();
|
AtomicBigDecimal numCnfWithdrawRows = new AtomicBigDecimal();
|
||||||
AtomicBigDecimal qtaColWithdrawRows = new AtomicBigDecimal();
|
AtomicBigDecimal qtaColWithdrawRows = new AtomicBigDecimal();
|
||||||
|
|
||||||
Stream.of(x.getWithdrawMtbColr())
|
Stream.of(x.getWithdrawMtbColrs())
|
||||||
.forEach(row -> {
|
.forEach(row -> {
|
||||||
numCnfWithdrawRows.addAndGet(row.getNumCnf());
|
numCnfWithdrawRows.addAndGet(row.getNumCnf());
|
||||||
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
||||||
|
|||||||
@@ -677,7 +677,7 @@ public class SpedizioneViewModel {
|
|||||||
AtomicBigDecimal numCnfWithdrawRows = new AtomicBigDecimal();
|
AtomicBigDecimal numCnfWithdrawRows = new AtomicBigDecimal();
|
||||||
AtomicBigDecimal qtaColWithdrawRows = new AtomicBigDecimal();
|
AtomicBigDecimal qtaColWithdrawRows = new AtomicBigDecimal();
|
||||||
|
|
||||||
Stream.of(pickingObjectDTO.getWithdrawMtbColr())
|
Stream.of(pickingObjectDTO.getWithdrawMtbColrs())
|
||||||
.forEach(row -> {
|
.forEach(row -> {
|
||||||
numCnfWithdrawRows.addAndGet(row.getNumCnf());
|
numCnfWithdrawRows.addAndGet(row.getNumCnf());
|
||||||
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
||||||
@@ -898,7 +898,7 @@ public class SpedizioneViewModel {
|
|||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
Optional<PickingObjectDTO> optionalPickingObjectDTO = Stream.of(this.mPickingList.getValue())
|
Optional<PickingObjectDTO> optionalPickingObjectDTO = Stream.of(this.mPickingList.getValue())
|
||||||
.filter(x -> Stream.of(x.getWithdrawMtbColr()).anyMatch(y -> y == mtbColrToEdit))
|
.filter(x -> Stream.of(x.getWithdrawMtbColrs()).anyMatch(y -> y == mtbColrToEdit))
|
||||||
.findSingle();
|
.findSingle();
|
||||||
|
|
||||||
PickingObjectDTO pickingObjectDTO = null;
|
PickingObjectDTO pickingObjectDTO = null;
|
||||||
@@ -928,7 +928,7 @@ public class SpedizioneViewModel {
|
|||||||
AtomicBigDecimal numCnfWithdrawRows = new AtomicBigDecimal(0);
|
AtomicBigDecimal numCnfWithdrawRows = new AtomicBigDecimal(0);
|
||||||
AtomicBigDecimal qtaColWithdrawRows = new AtomicBigDecimal(0);
|
AtomicBigDecimal qtaColWithdrawRows = new AtomicBigDecimal(0);
|
||||||
|
|
||||||
Stream.of(finalPickingObjectDTO.getWithdrawMtbColr())
|
Stream.of(finalPickingObjectDTO.getWithdrawMtbColrs())
|
||||||
.forEach(row -> {
|
.forEach(row -> {
|
||||||
numCnfWithdrawRows.addAndGet(row.getNumCnf());
|
numCnfWithdrawRows.addAndGet(row.getNumCnf());
|
||||||
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
||||||
@@ -1180,7 +1180,9 @@ public class SpedizioneViewModel {
|
|||||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||||
|
|
||||||
pickingObjectDTO.getWithdrawMtbColr().add(mtbColr);
|
mtbColr.setRefMtbColr(mtbColrToDispatch);
|
||||||
|
|
||||||
|
pickingObjectDTO.getWithdrawMtbColrs().add(mtbColr);
|
||||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
|
||||||
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
||||||
@@ -1224,12 +1226,12 @@ public class SpedizioneViewModel {
|
|||||||
.setQtaCol(qtaTot);
|
.setQtaCol(qtaTot);
|
||||||
|
|
||||||
Optional<PickingObjectDTO> pickingObjectDTO = Stream.of(this.mPickingList.getValue())
|
Optional<PickingObjectDTO> pickingObjectDTO = Stream.of(this.mPickingList.getValue())
|
||||||
.filter(x -> Stream.of(x.getWithdrawMtbColr()).anyMatch(y -> y == mtbColrToUpdate))
|
.filter(x -> Stream.of(x.getWithdrawMtbColrs()).anyMatch(y -> y == mtbColrToUpdate))
|
||||||
.findSingle();
|
.findSingle();
|
||||||
|
|
||||||
if(pickingObjectDTO.isPresent()) {
|
if(pickingObjectDTO.isPresent()) {
|
||||||
pickingObjectDTO.get().getWithdrawMtbColr().remove(mtbColrToUpdate);
|
pickingObjectDTO.get().getWithdrawMtbColrs().remove(mtbColrToUpdate);
|
||||||
pickingObjectDTO.get().getWithdrawMtbColr().add(mtbColr);
|
pickingObjectDTO.get().getWithdrawMtbColrs().add(mtbColr);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
|
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
|
||||||
@@ -1268,10 +1270,10 @@ public class SpedizioneViewModel {
|
|||||||
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
||||||
|
|
||||||
PickingObjectDTO pickingObjectDTO = Stream.of(this.mPickingList.getValue())
|
PickingObjectDTO pickingObjectDTO = Stream.of(this.mPickingList.getValue())
|
||||||
.filter(x -> Stream.of(x.getWithdrawMtbColr()).anyMatch(y -> y == mtbColrToDelete))
|
.filter(x -> Stream.of(x.getWithdrawMtbColrs()).anyMatch(y -> y == mtbColrToDelete))
|
||||||
.single();
|
.single();
|
||||||
|
|
||||||
pickingObjectDTO.getWithdrawMtbColr().remove(mtbColrToDelete);
|
pickingObjectDTO.getWithdrawMtbColrs().remove(mtbColrToDelete);
|
||||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToDelete);
|
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToDelete);
|
||||||
|
|
||||||
this.resetMatchedRows();
|
this.resetMatchedRows();
|
||||||
@@ -1407,20 +1409,43 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
for (PickingObjectDTO pickingObjectDTO : mPickingList.getValue()) {
|
for (PickingObjectDTO pickingObjectDTO : mPickingList.getValue()) {
|
||||||
|
|
||||||
List<MtbColr> withdrawMtbColrList = pickingObjectDTO.getWithdrawMtbColr();
|
List<MtbColr> withdrawMtbColrList = pickingObjectDTO.getWithdrawMtbColrs();
|
||||||
|
|
||||||
for (MtbColr withdrawMtbColr : withdrawMtbColrList) {
|
for (MtbColr withdrawMtbColr : withdrawMtbColrList) {
|
||||||
pickingObjectDTO.getSitArtOrdDTO().setNumCnfOrd(pickingObjectDTO.getSitArtOrdDTO().getNumCnfOrd().subtract(withdrawMtbColr.getNumCnf()));
|
pickingObjectDTO.getSitArtOrdDTO().setNumCnfOrd(pickingObjectDTO.getSitArtOrdDTO().getNumCnfOrd().subtract(withdrawMtbColr.getNumCnf()));
|
||||||
pickingObjectDTO.getSitArtOrdDTO().setQtaOrd(pickingObjectDTO.getSitArtOrdDTO().getQtaOrd().subtract(withdrawMtbColr.getQtaCol()));
|
pickingObjectDTO.getSitArtOrdDTO().setQtaOrd(pickingObjectDTO.getSitArtOrdDTO().getQtaOrd().subtract(withdrawMtbColr.getQtaCol()));
|
||||||
|
|
||||||
|
|
||||||
if (pickingObjectDTO.getMtbColts() != null) {
|
if (pickingObjectDTO.getMtbColts() != null) {
|
||||||
Stream.of(pickingObjectDTO.getMtbColts())
|
|
||||||
.filter(x -> Objects.equals(x.getNumCollo(), withdrawMtbColr.getNumColloRif()) &&
|
Optional<MtbColr> optionalMtbColrReference = Stream.of(pickingObjectDTO.getMtbColts())
|
||||||
x.getDataColloS().equals(withdrawMtbColr.getDataColloRifS()) &&
|
.filter(y -> withdrawMtbColr.getRefMtbColr() != null &&
|
||||||
x.getSerCollo().equalsIgnoreCase(withdrawMtbColr.getSerColloRif()) &&
|
withdrawMtbColr.getRefMtbColr().getNumCollo().equals(y.getNumCollo()) &&
|
||||||
x.getGestione().equalsIgnoreCase(withdrawMtbColr.getGestioneRif()))
|
withdrawMtbColr.getRefMtbColr().getDataColloD().equals(y.getDataColloD()) &&
|
||||||
.forEach(x -> {
|
withdrawMtbColr.getRefMtbColr().getSerCollo().equals(y.getSerCollo()) &&
|
||||||
List<MtbColr> mtbColrList = x.getMtbColr();
|
withdrawMtbColr.getRefMtbColr().getGestioneEnum().equals(y.getGestioneEnum()) &&
|
||||||
|
UtilityString.equalsIgnoreCase(withdrawMtbColr.getRefMtbColr().getCodMart(), y.getMtbColr() != null && y.getMtbColr().size() > 0 ? y.getMtbColr().get(0).getCodMart() : null) &&
|
||||||
|
UtilityString.equalsIgnoreCase(withdrawMtbColr.getRefMtbColr().getCodTagl(), y.getMtbColr() != null && y.getMtbColr().size() > 0 ? y.getMtbColr().get(0).getCodTagl() : null) &&
|
||||||
|
UtilityString.equalsIgnoreCase(withdrawMtbColr.getRefMtbColr().getCodCol(), y.getMtbColr() != null && y.getMtbColr().size() > 0 ? y.getMtbColr().get(0).getCodCol() : null))
|
||||||
|
.map(y -> y.getMtbColr().get(0))
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
|
||||||
|
if(optionalMtbColrReference.isPresent()) {
|
||||||
|
//looking for real refMtbColr instance
|
||||||
|
MtbColr mtbColr = optionalMtbColrReference.get();
|
||||||
|
|
||||||
|
mtbColr.setNumCnf(mtbColr.getNumCnf().subtract(withdrawMtbColr.getNumCnf()));
|
||||||
|
mtbColr.setQtaCol(mtbColr.getQtaCol().subtract(withdrawMtbColr.getQtaCol()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stream.of(pickingObjectDTO.getMtbColts())
|
||||||
|
// .filter(x -> Objects.equals(x.getNumCollo(), withdrawMtbColr.getNumColloRif()) &&
|
||||||
|
// x.getDataColloS().equals(withdrawMtbColr.getDataColloRifS()) &&
|
||||||
|
// x.getSerCollo().equalsIgnoreCase(withdrawMtbColr.getSerColloRif()) &&
|
||||||
|
// x.getGestione().equalsIgnoreCase(withdrawMtbColr.getGestioneRif()))
|
||||||
|
// .forEach(x -> {
|
||||||
|
// List<MtbColr> mtbColrList = x.getMtbColr();
|
||||||
|
|
||||||
// Stream.of(mtbColrList)
|
// Stream.of(mtbColrList)
|
||||||
// .filter(y -> y.getCodMart().equalsIgnoreCase(withdrawMtbColr.getCodMart()) &&
|
// .filter(y -> y.getCodMart().equalsIgnoreCase(withdrawMtbColr.getCodMart()) &&
|
||||||
@@ -1430,11 +1455,11 @@ public class SpedizioneViewModel {
|
|||||||
// .for
|
// .for
|
||||||
|
|
||||||
|
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pickingObjectDTO.setWithdrawMtbColr(new ArrayList<>());
|
pickingObjectDTO.setWithdrawMtbColrs(new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.resetMatchedRows();
|
this.resetMatchedRows();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class PickingObjectDTO {
|
|||||||
private List<MtbColt> mtbColts;
|
private List<MtbColt> mtbColts;
|
||||||
|
|
||||||
private PickDataDTO tempPickData;
|
private PickDataDTO tempPickData;
|
||||||
private List<MtbColr> withdrawMtbColr = new ArrayList<>();
|
private List<MtbColr> withdrawMtbColrs = new ArrayList<>();
|
||||||
|
|
||||||
private boolean hidden = false;
|
private boolean hidden = false;
|
||||||
|
|
||||||
@@ -65,12 +65,12 @@ public class PickingObjectDTO {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MtbColr> getWithdrawMtbColr() {
|
public List<MtbColr> getWithdrawMtbColrs() {
|
||||||
return withdrawMtbColr;
|
return withdrawMtbColrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PickingObjectDTO setWithdrawMtbColr(List<MtbColr> withdrawMtbColr) {
|
public PickingObjectDTO setWithdrawMtbColrs(List<MtbColr> withdrawMtbColrs) {
|
||||||
this.withdrawMtbColr = withdrawMtbColr;
|
this.withdrawMtbColrs = withdrawMtbColrs;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,7 @@ package it.integry.integrywmsnative.gest.vendita;
|
|||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
|
||||||
import androidx.appcompat.widget.AppCompatTextView;
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -17,13 +12,17 @@ import android.view.MenuInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||||
@@ -31,8 +30,10 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|||||||
import it.integry.integrywmsnative.core.interfaces.IFilterableFragment;
|
import it.integry.integrywmsnative.core.interfaces.IFilterableFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ISelectAllFragment;
|
import it.integry.integrywmsnative.core.interfaces.ISelectAllFragment;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
@@ -40,7 +41,6 @@ import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
||||||
import it.integry.integrywmsnative.databinding.FragmentMainVenditaBinding;
|
import it.integry.integrywmsnative.databinding.FragmentMainVenditaBinding;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
|
||||||
import it.integry.integrywmsnative.gest.spedizione.SpedizioneActivity;
|
import it.integry.integrywmsnative.gest.spedizione.SpedizioneActivity;
|
||||||
import it.integry.integrywmsnative.gest.vendita.core.MainListVenditaAdapter;
|
import it.integry.integrywmsnative.gest.vendita.core.MainListVenditaAdapter;
|
||||||
import it.integry.integrywmsnative.gest.vendita.core.VenditaHelper;
|
import it.integry.integrywmsnative.gest.vendita.core.VenditaHelper;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs.input_quantity_v2;
|
package it.integry.integrywmsnative.view.dialogs.input_quantity_v2;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
@@ -113,10 +114,6 @@ public class DialogInputQuantityV2 extends DialogFragment implements DialogInput
|
|||||||
return mBindings.getRoot();
|
return mBindings.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dismiss() {
|
|
||||||
super.dismiss();
|
|
||||||
this.mOnAbort.run();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void save() {
|
public void save() {
|
||||||
if (this.mViewModel.validate()) {
|
if (this.mViewModel.validate()) {
|
||||||
@@ -132,6 +129,11 @@ public class DialogInputQuantityV2 extends DialogFragment implements DialogInput
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||||
|
this.mOnAbort.run();
|
||||||
|
super.onDismiss(dialog);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
|
|||||||
Reference in New Issue
Block a user