Merge branch 'develop' into feature/flag_scan_art
This commit is contained in:
commit
f1b4ce469e
@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 259
|
def appVersionCode = 263
|
||||||
def appVersionName = '1.23.4'
|
def appVersionName = '1.23.8'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
|
|||||||
@ -19,7 +19,8 @@
|
|||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
android:fullBackupContent="@xml/backup_descriptor">
|
android:fullBackupContent="@xml/backup_descriptor"
|
||||||
|
android:requestLegacyExternalStorage="true">
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.spedizione.SpedizioneActivity"
|
android:name=".gest.spedizione.SpedizioneActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
|
|||||||
@ -5,6 +5,10 @@ import javax.inject.Singleton;
|
|||||||
import dagger.Component;
|
import dagger.Component;
|
||||||
import it.integry.integrywmsnative.core.context.AppContext;
|
import it.integry.integrywmsnative.core.context.AppContext;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseActivityComponent;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseActivityModule;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseFragmentComponent;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseFragmentModule;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneModule;
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneModule;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
||||||
@ -15,6 +19,8 @@ import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDo
|
|||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoModule;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoModule;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormComponent;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormComponent;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormModule;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormModule;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsModule;
|
||||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleComponent;
|
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleComponent;
|
||||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
||||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliComponent;
|
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliComponent;
|
||||||
@ -59,6 +65,8 @@ import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviForn
|
|||||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreModule;
|
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreModule;
|
||||||
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceComponent;
|
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceComponent;
|
||||||
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceModule;
|
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceModule;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteComponent;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsComponent;
|
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsModule;
|
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
|
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
|
||||||
@ -79,6 +87,8 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
RoomModule.class,
|
RoomModule.class,
|
||||||
SplashActivityModule.class,
|
SplashActivityModule.class,
|
||||||
MainApplicationModule.class,
|
MainApplicationModule.class,
|
||||||
|
BaseActivityModule.class,
|
||||||
|
BaseFragmentModule.class,
|
||||||
LoginModule.class,
|
LoginModule.class,
|
||||||
MainActivityModule.class,
|
MainActivityModule.class,
|
||||||
MainFragmentModule.class,
|
MainFragmentModule.class,
|
||||||
@ -110,10 +120,16 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
DialogChooseArtsFromListaArtsModule.class,
|
DialogChooseArtsFromListaArtsModule.class,
|
||||||
DocInterniModule.class,
|
DocInterniModule.class,
|
||||||
DialogSelectDocInfoModule.class,
|
DialogSelectDocInfoModule.class,
|
||||||
DocInterniEditFormModule.class
|
DocInterniEditFormModule.class,
|
||||||
|
DialogSelectDocRowsModule.class,
|
||||||
|
DialogAskClienteModule.class
|
||||||
})
|
})
|
||||||
public interface MainApplicationComponent {
|
public interface MainApplicationComponent {
|
||||||
|
|
||||||
|
BaseActivityComponent.Factory baseActivityComponent();
|
||||||
|
|
||||||
|
BaseFragmentComponent.Factory baseFragmentComponent();
|
||||||
|
|
||||||
SplashActivityComponent.Factory splashActivityComponent();
|
SplashActivityComponent.Factory splashActivityComponent();
|
||||||
|
|
||||||
LoginComponent.Factory loginActivityComponent();
|
LoginComponent.Factory loginActivityComponent();
|
||||||
@ -148,6 +164,8 @@ public interface MainApplicationComponent {
|
|||||||
|
|
||||||
OrdiniUscitaElencoComponent.Factory prodOrdineLavorazioneElencoComponent();
|
OrdiniUscitaElencoComponent.Factory prodOrdineLavorazioneElencoComponent();
|
||||||
|
|
||||||
|
DialogAskClienteComponent.Factory dialogAskClienteComponent();
|
||||||
|
|
||||||
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
||||||
|
|
||||||
DialogInputLUProdComponent.Factory dialogInputLUProdComponent();
|
DialogInputLUProdComponent.Factory dialogInputLUProdComponent();
|
||||||
@ -182,6 +200,8 @@ public interface MainApplicationComponent {
|
|||||||
|
|
||||||
DialogSelectDocInfoComponent.Factory dialogSelectMgrpDtipPairComponent();
|
DialogSelectDocInfoComponent.Factory dialogSelectMgrpDtipPairComponent();
|
||||||
|
|
||||||
|
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsComponent();
|
||||||
|
|
||||||
DocInterniEditFormComponent.Factory docInterniEditFormComponent();
|
DocInterniEditFormComponent.Factory docInterniEditFormComponent();
|
||||||
|
|
||||||
InfoAggiuntiveLUDialogComponent.Factory infoAggiuntiveLUDialogComponent();
|
InfoAggiuntiveLUDialogComponent.Factory infoAggiuntiveLUDialogComponent();
|
||||||
|
|||||||
@ -27,8 +27,11 @@ import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
|||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||||
|
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
public class MainApplicationModule {
|
public class MainApplicationModule {
|
||||||
@ -71,6 +74,24 @@ public class MainApplicationModule {
|
|||||||
return new MenuService(menuRESTConsumer);
|
return new MenuService(menuRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
UpdatesManager provideUpdatesManager() {
|
||||||
|
return new UpdatesManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
DialogProgressView providesDialogProgressView() {
|
||||||
|
return DialogProgressView.newInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
DialogInputQuantityV2View providesDialogInputQuantityV2View() {
|
||||||
|
return new DialogInputQuantityV2View();
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
OrdiniRESTConsumer provideOrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
OrdiniRESTConsumer provideOrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
||||||
|
|||||||
@ -242,4 +242,8 @@ public class ArticoloOrdine {
|
|||||||
public void setNewNoPromo(boolean newNoPromo) {
|
public void setNewNoPromo(boolean newNoPromo) {
|
||||||
this.newNoPromo = newNoPromo;
|
this.newNoPromo = newNoPromo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float getCnfDaRic() {
|
||||||
|
return qtaCnf > 0.f ? merceDaRic / qtaCnf : 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,21 +1,37 @@
|
|||||||
package it.integry.integrywmsnative.core.expansion;
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
|
||||||
public class BaseActivity extends AppCompatActivity {
|
public class BaseActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public DialogProgressView mCurrentProgress;
|
||||||
|
|
||||||
protected Dialog mCurrentProgress;
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@Nullable View parent, @NonNull String name, @NonNull Context context, @NonNull AttributeSet attrs) {
|
||||||
|
var v = super.onCreateView(parent, name, context, attrs);
|
||||||
|
|
||||||
public BaseActivity() {
|
MainApplication.appComponent
|
||||||
//Thread.setDefaultUncaughtExceptionHandler(new MyExceptionHandler(this, BaseActivity.class));
|
.baseActivityComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -42,8 +58,8 @@ public class BaseActivity extends AppCompatActivity {
|
|||||||
protected void openProgress() {
|
protected void openProgress() {
|
||||||
runOnUiThread(() -> {
|
runOnUiThread(() -> {
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
if (this.mCurrentProgress == null) {
|
if (!this.mCurrentProgress.isVisible() && !this.mCurrentProgress.isAdded()) {
|
||||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(this);
|
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -51,9 +67,8 @@ public class BaseActivity extends AppCompatActivity {
|
|||||||
protected void closeProgress() {
|
protected void closeProgress() {
|
||||||
runOnUiThread(() -> {
|
runOnUiThread(() -> {
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
if (mCurrentProgress != null) {
|
if (mCurrentProgress.isVisible()) {
|
||||||
mCurrentProgress.dismiss();
|
mCurrentProgress.dismiss();
|
||||||
mCurrentProgress = null;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface BaseActivityComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
BaseActivityComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(BaseActivity baseActivity);
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
|
||||||
|
@Module(subcomponents = BaseActivityComponent.class)
|
||||||
|
public class BaseActivityModule {
|
||||||
|
}
|
||||||
@ -1,6 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.core.expansion;
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
@ -15,11 +14,12 @@ import androidx.fragment.app.FragmentTransaction;
|
|||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
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.view.dialogs.DialogProgressView;
|
||||||
|
|
||||||
public class BaseDialogFragment extends DialogFragment {
|
public class BaseDialogFragment extends DialogFragment {
|
||||||
|
|
||||||
private boolean mBarcodeListener = false;
|
private boolean mBarcodeListener = false;
|
||||||
private Dialog mCurrentProgress;
|
private DialogProgressView mCurrentProgress;
|
||||||
|
|
||||||
public BaseDialogFragment() {
|
public BaseDialogFragment() {
|
||||||
super();
|
super();
|
||||||
@ -82,7 +82,7 @@ public class BaseDialogFragment extends DialogFragment {
|
|||||||
// new Thread(() -> {
|
// new Thread(() -> {
|
||||||
requireActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
if (this.mCurrentProgress == null) {
|
if (this.mCurrentProgress == null) {
|
||||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(requireActivity());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// }).start();
|
// }).start();
|
||||||
|
|||||||
@ -1,21 +1,30 @@
|
|||||||
package it.integry.integrywmsnative.core.expansion;
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
|
||||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
|
||||||
public abstract class BaseFragment extends Fragment {
|
public abstract class BaseFragment extends Fragment {
|
||||||
|
|
||||||
protected Dialog mCurrentProgress;
|
@Inject
|
||||||
|
public DialogProgressView mCurrentProgress;
|
||||||
|
|
||||||
protected ElevatedToolbar mToolbar;
|
protected ElevatedToolbar mToolbar;
|
||||||
|
|
||||||
@ -26,28 +35,35 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
mToolbar = toolbar;
|
mToolbar = toolbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void addOnPreDestroy(Runnable onPreDestroy) {
|
public void addOnPreDestroy(Runnable onPreDestroy) {
|
||||||
this.mOnPreDestroyList.add(onPreDestroy);
|
this.mOnPreDestroyList.add(onPreDestroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
View view = super.onCreateView(inflater, container, savedInstanceState);
|
||||||
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.baseFragmentComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
public void onLoadingStarted() {
|
public void onLoadingStarted() {
|
||||||
new Thread(() -> {
|
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
this.openProgress();
|
this.openProgress();
|
||||||
}).start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onLoadingEnded() {
|
public void onLoadingEnded() {
|
||||||
new Thread(() -> {
|
|
||||||
this.closeProgress();
|
this.closeProgress();
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
}).start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
this.getActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
this.closeProgress();
|
this.closeProgress();
|
||||||
UtilityExceptions.defaultException(getActivity(), ex, mCurrentProgress);
|
UtilityExceptions.defaultException(getActivity(), ex, mCurrentProgress);
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
@ -65,24 +81,23 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void openProgress() {
|
protected void openProgress() {
|
||||||
getActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
if (this.mCurrentProgress == null) {
|
if (!this.mCurrentProgress.isVisible() && !this.mCurrentProgress.isAdded()) {
|
||||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void closeProgress() {
|
protected void closeProgress() {
|
||||||
getActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
if (mCurrentProgress != null) {
|
if (mCurrentProgress.isVisible()) {
|
||||||
mCurrentProgress.dismiss();
|
mCurrentProgress.dismiss();
|
||||||
mCurrentProgress = null;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void popMe() {
|
protected void popMe() {
|
||||||
getActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
((IPoppableActivity) requireActivity()).pop();
|
((IPoppableActivity) requireActivity()).pop();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface BaseFragmentComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
BaseFragmentComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(BaseFragment baseFragment);
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
|
||||||
|
@Module(subcomponents = BaseFragmentComponent.class)
|
||||||
|
public class BaseFragmentModule {
|
||||||
|
}
|
||||||
@ -1,7 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.core.settings;
|
package it.integry.integrywmsnative.core.settings;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -39,10 +37,11 @@ public class DBSettingsModel {
|
|||||||
private List<String> notePerditaDocInterni = new ArrayList<>();
|
private List<String> notePerditaDocInterni = new ArrayList<>();
|
||||||
private boolean flagSpedizioneUseQtaOrd;
|
private boolean flagSpedizioneUseQtaOrd;
|
||||||
private boolean flagOrdinaNuoviArticoliInGriglia;
|
private boolean flagOrdinaNuoviArticoliInGriglia;
|
||||||
private JSONObject docInterniCheckFornitore;
|
private String docInterniCheckFornitore;
|
||||||
private String produzioneDefaultCodAnag;
|
private String produzioneDefaultCodAnag;
|
||||||
private String reportNameSpedizionChiudiOrdine;
|
private String reportNameSpedizionChiudiOrdine;
|
||||||
private int onNumCnfInputChanged = 1;
|
private int onNumCnfInputChanged = 1;
|
||||||
|
private boolean flagAccettazioneUseQtaOrd = false;
|
||||||
|
|
||||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||||
return flagSpedizioneEnableFakeGiacenza;
|
return flagSpedizioneEnableFakeGiacenza;
|
||||||
@ -296,12 +295,21 @@ public class DBSettingsModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public JSONObject getDocInterniCheckFornitore() {
|
public String getDocInterniCheckFornitore() {
|
||||||
return docInterniCheckFornitore;
|
return docInterniCheckFornitore;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DBSettingsModel setDocInterniCheckFornitore(JSONObject docInterniCheckFornitore) {
|
public DBSettingsModel setDocInterniCheckFornitore(String docInterniCheckFornitore) {
|
||||||
this.docInterniCheckFornitore = docInterniCheckFornitore;
|
this.docInterniCheckFornitore = docInterniCheckFornitore;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFlagAccettazioneUseQtaOrd() {
|
||||||
|
return flagAccettazioneUseQtaOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setFlagAccettazioneUseQtaOrd(boolean flagAccettazioneUseQtaOrd) {
|
||||||
|
this.flagAccettazioneUseQtaOrd = flagAccettazioneUseQtaOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,9 +5,6 @@ import android.content.Context;
|
|||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.firebase.perf.metrics.Trace;
|
import com.google.firebase.perf.metrics.Trace;
|
||||||
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.net.SocketTimeoutException;
|
import java.net.SocketTimeoutException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -281,6 +278,10 @@ public class SettingsManager {
|
|||||||
.setGestName("PVM")
|
.setGestName("PVM")
|
||||||
.setSection("DOC_INTERNI")
|
.setSection("DOC_INTERNI")
|
||||||
.setKeySection("CHECK_FORNITORE"));
|
.setKeySection("CHECK_FORNITORE"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("ACCETTAZIONE")
|
||||||
|
.setKeySection("FLAG_USE_QTA_ORD"));
|
||||||
|
|
||||||
|
|
||||||
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
||||||
@ -306,12 +307,9 @@ public class SettingsManager {
|
|||||||
dbSettingsModelIstance.setReportNameSpedizionChiudiOrdine(getValueFromList(list, "SPEDIZIONE", "REPORT_PACKING_LIST", String.class));
|
dbSettingsModelIstance.setReportNameSpedizionChiudiOrdine(getValueFromList(list, "SPEDIZIONE", "REPORT_PACKING_LIST", String.class));
|
||||||
dbSettingsModelIstance.setFlagSpedizioneUseQtaOrd(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneUseQtaOrd(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagOrdinaNuoviArticoliInGriglia(getValueFromList(list, "ORDINI_A", "ORDINA_NUOVI_ARTICOLI", Boolean.class));
|
dbSettingsModelIstance.setFlagOrdinaNuoviArticoliInGriglia(getValueFromList(list, "ORDINI_A", "ORDINA_NUOVI_ARTICOLI", Boolean.class));
|
||||||
String docTypeCheckFornitore = getValueFromList(list, "DOC_INTERNI", "CHECK_FORNITORE", String.class);
|
dbSettingsModelIstance.setDocInterniCheckFornitore(getValueFromList(list, "DOC_INTERNI", "CHECK_FORNITORE", String.class));
|
||||||
try {
|
dbSettingsModelIstance.setFlagAccettazioneUseQtaOrd(getValueFromList(list, "ACCETTAZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
||||||
dbSettingsModelIstance.setDocInterniCheckFornitore(new JSONObject(docTypeCheckFornitore));
|
|
||||||
} catch (JSONException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
|
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
|
||||||
if (notePerdita != null) {
|
if (notePerdita != null) {
|
||||||
dbSettingsModelIstance.setNotePerditaDocInterni(Arrays.asList(notePerdita.split("\\|")));
|
dbSettingsModelIstance.setNotePerditaDocInterni(Arrays.asList(notePerdita.split("\\|")));
|
||||||
|
|||||||
@ -1,60 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.update;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.os.Environment;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
|
||||||
|
|
||||||
public class UpdateApp extends AsyncTask<String,Void,Void> {
|
|
||||||
private Context context;
|
|
||||||
public void setContext(Context contextf){
|
|
||||||
context = contextf;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Void doInBackground(String... arg0) {
|
|
||||||
try {
|
|
||||||
URL url = new URL(arg0[0]);
|
|
||||||
HttpURLConnection c = (HttpURLConnection) url.openConnection();
|
|
||||||
c.setRequestMethod("GET");
|
|
||||||
c.setDoOutput(true);
|
|
||||||
c.connect();
|
|
||||||
|
|
||||||
File file = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
|
|
||||||
file.mkdirs();
|
|
||||||
File outputFile = new File(file, "update.apk");
|
|
||||||
if(outputFile.exists()){
|
|
||||||
outputFile.delete();
|
|
||||||
}
|
|
||||||
FileOutputStream fos = new FileOutputStream(outputFile);
|
|
||||||
|
|
||||||
InputStream is = c.getInputStream();
|
|
||||||
|
|
||||||
byte[] buffer = new byte[1024];
|
|
||||||
int len1 = 0;
|
|
||||||
while ((len1 = is.read(buffer)) != -1) {
|
|
||||||
fos.write(buffer, 0, len1);
|
|
||||||
}
|
|
||||||
fos.close();
|
|
||||||
is.close();
|
|
||||||
|
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
|
||||||
intent.setDataAndType(Uri.fromFile(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)), "application/vnd.android.package-archive");
|
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // without this flag android returned a intent error!
|
|
||||||
context.startActivity(intent);
|
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.e("UpdateAPP", "Update error! " + e.getMessage());
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,30 +1,35 @@
|
|||||||
package it.integry.integrywmsnative.core.update;
|
package it.integry.integrywmsnative.core.update;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.DownloadManager;
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.github.javiersantos.appupdater.AppUpdater;
|
import com.github.javiersantos.appupdater.AppUpdater;
|
||||||
import com.github.javiersantos.appupdater.enums.Display;
|
import com.github.javiersantos.appupdater.enums.Display;
|
||||||
import com.github.javiersantos.appupdater.enums.UpdateFrom;
|
import com.github.javiersantos.appupdater.enums.UpdateFrom;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.class_router.BaseCustomConfiguration;
|
import it.integry.integrywmsnative.core.class_router.BaseCustomConfiguration;
|
||||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||||
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.FileDownloader;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class UpdatesManager {
|
public class UpdatesManager {
|
||||||
|
|
||||||
public static void init(Activity context) {
|
private AppCompatActivity mContext;
|
||||||
|
|
||||||
|
public void init(AppCompatActivity activityContext) {
|
||||||
|
this.mContext = activityContext;
|
||||||
|
|
||||||
String suffix;
|
String suffix;
|
||||||
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
|
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
|
||||||
try {
|
try {
|
||||||
@ -40,64 +45,67 @@ public class UpdatesManager {
|
|||||||
String currentDownloadUrl = "http://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/android-release" + suffix + ".apk";
|
String currentDownloadUrl = "http://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/android-release" + suffix + ".apk";
|
||||||
|
|
||||||
|
|
||||||
AppUpdater appUpdater = new AppUpdater(context)
|
AppUpdater appUpdater = new AppUpdater(mContext)
|
||||||
.setDisplay(Display.DIALOG)
|
.setDisplay(Display.DIALOG)
|
||||||
.setUpdateFrom(UpdateFrom.JSON)
|
.setUpdateFrom(UpdateFrom.JSON)
|
||||||
.setUpdateJSON(currentVersionUrl)
|
.setUpdateJSON(currentVersionUrl)
|
||||||
.setButtonDoNotShowAgain(null)
|
.setButtonDoNotShowAgain(null)
|
||||||
.setButtonUpdateClickListener((dialog, which) -> {
|
.setButtonUpdateClickListener((dialog, which) -> {
|
||||||
installAPK(context, currentDownloadUrl);
|
installAPK(currentDownloadUrl);
|
||||||
});
|
});
|
||||||
appUpdater.start();
|
appUpdater.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void installAPK(Activity context, String downloadURL) {
|
private void installAPK(String downloadURL) {
|
||||||
|
|
||||||
String destination = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/";
|
String destination = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/";
|
||||||
String fileName = context.getResources().getString(R.string.app_name) + ".apk";
|
|
||||||
destination += fileName;
|
|
||||||
final Uri uri = Uri.parse("file://" + destination);
|
|
||||||
|
|
||||||
//Delete update file if exists
|
var progressDialog = DialogProgressView.newInstance("Download", null, false);
|
||||||
final File file = new File(destination);
|
progressDialog.show(mContext.getSupportFragmentManager(), "tag");
|
||||||
if (file.exists())
|
|
||||||
file.delete();
|
|
||||||
|
|
||||||
//set downloadmanager
|
|
||||||
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(downloadURL));
|
|
||||||
request.setDescription(context.getString(R.string.notification_update_download));
|
|
||||||
request.setTitle(context.getString(R.string.app_name));
|
|
||||||
|
|
||||||
//set destination
|
var fileDownloader = new FileDownloader()
|
||||||
request.setDestinationUri(uri);
|
.setDestFolder(destination)
|
||||||
|
.setUrlString(downloadURL)
|
||||||
|
.setOnProgressUpdate(progress -> {
|
||||||
|
mContext.runOnUiThread(() -> {
|
||||||
|
progressDialog.setProgress(progress);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.setOnDownloadCompleted(destPath -> {
|
||||||
|
|
||||||
// get download service and enqueue file
|
mContext.runOnUiThread(() -> {
|
||||||
final DownloadManager manager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
|
progressDialog.dismiss();
|
||||||
manager.enqueue(request);
|
|
||||||
|
|
||||||
//set BroadcastReceiver to install app when .apk is downloaded
|
|
||||||
BroadcastReceiver onComplete = new BroadcastReceiver() {
|
|
||||||
public void onReceive(Context ctxt, Intent i) {
|
|
||||||
|
|
||||||
Uri fileLoc;
|
Uri fileLoc;
|
||||||
Intent intent;
|
Intent intent;
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
intent = new Intent(Intent.ACTION_INSTALL_PACKAGE);
|
intent = new Intent(Intent.ACTION_INSTALL_PACKAGE);
|
||||||
fileLoc = GenericFileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".core.update.GenericFileProvider", file);
|
fileLoc = GenericFileProvider.getUriForFile(mContext,
|
||||||
|
mContext.getApplicationContext().getPackageName() + ".core.update.GenericFileProvider",
|
||||||
|
new File(destPath));
|
||||||
} else {
|
} else {
|
||||||
intent = new Intent(Intent.ACTION_VIEW);
|
intent = new Intent(Intent.ACTION_VIEW);
|
||||||
fileLoc = Uri.fromFile(file);
|
fileLoc = Uri.fromFile(new File(destPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
intent.setDataAndType(fileLoc, "application/vnd.android.package-archive");
|
intent.setDataAndType(fileLoc, "application/vnd.android.package-archive");
|
||||||
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
|
|
||||||
context.startActivity(intent);
|
mContext.startActivity(intent);
|
||||||
}
|
});
|
||||||
};
|
|
||||||
|
|
||||||
//register receiver for when .apk download is compete
|
});
|
||||||
context.registerReceiver(onComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
|
|
||||||
|
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
fileDownloader.download();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,113 @@
|
|||||||
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
|
import android.webkit.URLUtil;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
|
||||||
|
public class FileDownloader {
|
||||||
|
|
||||||
|
private String urlString;
|
||||||
|
private String destFolder;
|
||||||
|
|
||||||
|
private RunnableArgs<Integer> onProgressUpdate;
|
||||||
|
private RunnableArgs<String> onDownloadCompleted;
|
||||||
|
|
||||||
|
|
||||||
|
public void download() throws Exception {
|
||||||
|
InputStream input = null;
|
||||||
|
OutputStream output = null;
|
||||||
|
HttpURLConnection connection = null;
|
||||||
|
String destPathFile;
|
||||||
|
|
||||||
|
try {
|
||||||
|
File direct = new File(destFolder);
|
||||||
|
if (!direct.exists()) {
|
||||||
|
direct.mkdirs();
|
||||||
|
}
|
||||||
|
|
||||||
|
URL url = new URL(urlString);
|
||||||
|
connection = (HttpURLConnection) url.openConnection();
|
||||||
|
connection.connect();
|
||||||
|
connection.setConnectTimeout(120 * 1000);
|
||||||
|
|
||||||
|
if (connection.getResponseCode() != HttpURLConnection.HTTP_OK)
|
||||||
|
throw new Exception("Server returned HTTP " + connection.getResponseCode() + " " + connection.getResponseMessage());
|
||||||
|
|
||||||
|
input = connection.getInputStream();
|
||||||
|
int totalBytesToDownload = connection.getContentLength();
|
||||||
|
int downloadedBytes = 0;
|
||||||
|
|
||||||
|
String title = URLUtil.guessFileName(String.valueOf(url), null, null);
|
||||||
|
|
||||||
|
destPathFile = destFolder + title;
|
||||||
|
|
||||||
|
if (new File(destPathFile).exists())
|
||||||
|
new File(destPathFile).delete();
|
||||||
|
|
||||||
|
output = new FileOutputStream(destPathFile);
|
||||||
|
|
||||||
|
byte[] buf = new byte[1024];
|
||||||
|
int len;
|
||||||
|
while ((len = input.read(buf)) > 0) {
|
||||||
|
output.write(buf, 0, len);
|
||||||
|
|
||||||
|
downloadedBytes += len;
|
||||||
|
if (onProgressUpdate != null)
|
||||||
|
onProgressUpdate.run((downloadedBytes * 100) / totalBytesToDownload);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw e;
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (output != null)
|
||||||
|
output.close();
|
||||||
|
if (input != null)
|
||||||
|
input.close();
|
||||||
|
} catch (IOException ignored) {
|
||||||
|
}
|
||||||
|
if (connection != null)
|
||||||
|
connection.disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (onDownloadCompleted != null) onDownloadCompleted.run(destPathFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getUrlString() {
|
||||||
|
return urlString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FileDownloader setUrlString(String urlString) {
|
||||||
|
this.urlString = urlString;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDestFolder() {
|
||||||
|
return destFolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FileDownloader setDestFolder(String destFolder) {
|
||||||
|
this.destFolder = destFolder;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FileDownloader setOnProgressUpdate(RunnableArgs<Integer> onProgressUpdate) {
|
||||||
|
this.onProgressUpdate = onProgressUpdate;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FileDownloader setOnDownloadCompleted(RunnableArgs<String> onDownloadCompleted) {
|
||||||
|
this.onDownloadCompleted = onDownloadCompleted;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.core.utility;
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
|
|
||||||
@ -13,6 +12,7 @@ import com.orhanobut.logger.Logger;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.BuildConfig;
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class UtilityExceptions {
|
public class UtilityExceptions {
|
||||||
@ -21,9 +21,9 @@ public class UtilityExceptions {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public static void defaultException(Context context, Exception ex, Dialog progressDialog) {
|
public static void defaultException(Context context, Exception ex, DialogProgressView progressDialog) {
|
||||||
defaultException(context, ex);
|
defaultException(context, ex);
|
||||||
if (progressDialog != null) progressDialog.dismiss();
|
if (progressDialog != null && progressDialog.isVisible()) progressDialog.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void defaultException(Context context, Exception ex) {
|
public static void defaultException(Context context, Exception ex) {
|
||||||
|
|||||||
@ -31,10 +31,13 @@ public class UtilityPosizione {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static MtbDepoPosizione getFromCache(String posizione) {
|
public static MtbDepoPosizione getFromCache(String posizione) {
|
||||||
List<MtbDepoPosizione> tmpList = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
|
var availablePosizioni = SettingsManager.iDB().getAvailablePosizioni();
|
||||||
|
if(availablePosizioni == null) return null;
|
||||||
|
|
||||||
|
List<MtbDepoPosizione> tmpList = Stream.of(availablePosizioni)
|
||||||
.filter(x -> x.getPosizione().equalsIgnoreCase(posizione)).toList();
|
.filter(x -> x.getPosizione().equalsIgnoreCase(posizione)).toList();
|
||||||
|
|
||||||
if(tmpList != null && tmpList.size() > 0) return tmpList.get(0);
|
if(tmpList.size() > 0) return tmpList.get(0);
|
||||||
else return null;
|
else return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,25 +1,21 @@
|
|||||||
package it.integry.integrywmsnative.core.utility;
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import android.content.Context;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogProgress;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
|
||||||
public class UtilityProgress {
|
public class UtilityProgress {
|
||||||
|
|
||||||
public static Dialog createDefaultProgressDialog(Context mContext) {
|
public static DialogProgressView createDefaultProgressDialog(FragmentActivity mContext) {
|
||||||
// final ProgressDialog progress = ProgressDialog.show(mContext, mContext.getText(R.string.waiting),
|
var progress = DialogProgressView.newInstance();
|
||||||
// mContext.getText(R.string.loading) + " ...", true);
|
progress.show(mContext.getSupportFragmentManager(), "tag");
|
||||||
//
|
|
||||||
// return progress;
|
|
||||||
|
|
||||||
Dialog progress = DialogProgress.make(mContext);
|
|
||||||
progress.show();
|
|
||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
public static Dialog createDefaultProgressDialog(Context mContext,String subtitle) {
|
|
||||||
Dialog progress = DialogProgress.make(mContext,subtitle);
|
public static DialogProgressView createDefaultProgressDialog(AppCompatActivity mContext, String title, String subtitle) {
|
||||||
progress.show();
|
DialogProgressView progress = DialogProgressView.newInstance(title, subtitle, true);
|
||||||
|
progress.show(mContext.getSupportFragmentManager(), "tag");
|
||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -85,6 +85,9 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
@Inject
|
@Inject
|
||||||
AccettazionePickingViewModel mViewModel;
|
AccettazionePickingViewModel mViewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
private final AccettazionePickingFiltroOrdineViewModel mAppliedFilterViewModel = new AccettazionePickingFiltroOrdineViewModel();
|
private final AccettazionePickingFiltroOrdineViewModel mAppliedFilterViewModel = new AccettazionePickingFiltroOrdineViewModel();
|
||||||
|
|
||||||
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
||||||
@ -141,9 +144,14 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
this.initFilters();
|
this.initFilters();
|
||||||
|
|
||||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
|
boolean useQtaOrd = SettingsManager.iDB().isFlagAccettazioneUseQtaOrd();
|
||||||
|
|
||||||
mViewModel.setListeners(this);
|
mViewModel.setListeners(this);
|
||||||
mViewModel.init(mOrders, mSitArts, codMdep);
|
mViewModel.init(
|
||||||
|
mOrders,
|
||||||
|
mSitArts,
|
||||||
|
codMdep,
|
||||||
|
useQtaOrd);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initFilters() {
|
private void initFilters() {
|
||||||
@ -833,8 +841,9 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
.setCanLUBeClosed(true)
|
.setCanLUBeClosed(true)
|
||||||
.setCanOverflowOrderQuantity(canOverflowQuantity);
|
.setCanOverflowOrderQuantity(canOverflowQuantity);
|
||||||
|
|
||||||
DialogInputQuantityV2View
|
mDialogInputQuantityV2View
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
@ -842,9 +851,8 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
.setPartitaMag(resultDTO.getPartitaMag())
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
.setDataScad(resultDTO.getDataScad());
|
.setDataScad(resultDTO.getDataScad());
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
}, () -> {
|
|
||||||
this.mViewModel.resetMatchedRows();
|
|
||||||
})
|
})
|
||||||
|
.setOnAbort(() -> this.mViewModel.resetMatchedRows())
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -73,6 +73,7 @@ public class AccettazionePickingViewModel {
|
|||||||
|
|
||||||
private List<OrdineAccettazioneInevasoDTO> mOrders;
|
private List<OrdineAccettazioneInevasoDTO> mOrders;
|
||||||
private List<SitArtOrdDTO> mSitArts;
|
private List<SitArtOrdDTO> mSitArts;
|
||||||
|
private boolean mUseQtaOrd;
|
||||||
private final MutableLiveData<List<PickingObjectDTO>> mPickingList = new MutableLiveData<>();
|
private final MutableLiveData<List<PickingObjectDTO>> mPickingList = new MutableLiveData<>();
|
||||||
|
|
||||||
private MtbColt mCurrentMtbColt = null;
|
private MtbColt mCurrentMtbColt = null;
|
||||||
@ -97,9 +98,10 @@ public class AccettazionePickingViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void init(List<OrdineAccettazioneInevasoDTO> orders, List<SitArtOrdDTO> sitArts, String codMdep) {
|
public void init(List<OrdineAccettazioneInevasoDTO> orders, List<SitArtOrdDTO> sitArts, String codMdep, boolean useQtaOrd) {
|
||||||
this.mOrders = orders;
|
this.mOrders = orders;
|
||||||
this.mDefaultCodMdep = codMdep;
|
this.mDefaultCodMdep = codMdep;
|
||||||
|
this.mUseQtaOrd = useQtaOrd;
|
||||||
|
|
||||||
this.mSitArts = Stream.of(sitArts)
|
this.mSitArts = Stream.of(sitArts)
|
||||||
.filter(x -> UtilityBigDecimal.greaterThan(x.getNumCnfDaEvadere(), BigDecimal.ZERO) && UtilityBigDecimal.greaterThan(x.getQtaDaEvadere(), BigDecimal.ZERO))
|
.filter(x -> UtilityBigDecimal.greaterThan(x.getNumCnfDaEvadere(), BigDecimal.ZERO) && UtilityBigDecimal.greaterThan(x.getQtaDaEvadere(), BigDecimal.ZERO))
|
||||||
@ -536,7 +538,9 @@ public class AccettazionePickingViewModel {
|
|||||||
initialQtaTot = totalQtaOrd;
|
initialQtaTot = totalQtaOrd;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UtilityBigDecimal.greaterThan(pickingObjectDTO.getMtbAart().getColliPedana(), BigDecimal.ZERO) && UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
|
if (!this.mUseQtaOrd &&
|
||||||
|
UtilityBigDecimal.greaterThan(pickingObjectDTO.getMtbAart().getColliPedana(), BigDecimal.ZERO) &&
|
||||||
|
UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
|
||||||
initialNumCnf = pickingObjectDTO.getMtbAart().getColliPedana();
|
initialNumCnf = pickingObjectDTO.getMtbAart().getColliPedana();
|
||||||
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
|
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,85 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
|
||||||
|
public class DialogChooseRowFromListaDocRowsListModel {
|
||||||
|
|
||||||
|
private String codMart;
|
||||||
|
private String descrizione;
|
||||||
|
private String qtaOrdReadable;
|
||||||
|
private String barcode;
|
||||||
|
private boolean isNew;
|
||||||
|
private SqlMtbColr originalModel;
|
||||||
|
private BindableBoolean checked = new BindableBoolean(false);
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getChecked() {
|
||||||
|
return checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel setChecked(BindableBoolean checked) {
|
||||||
|
this.checked = checked;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void toggleCheck() {
|
||||||
|
this.checked.set(!this.checked.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMart() {
|
||||||
|
return codMart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel setCodMart(String codMart) {
|
||||||
|
this.codMart = codMart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQtaOrdReadable() {
|
||||||
|
return qtaOrdReadable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel setQtaOrdReadable(String qtaOrdReadable) {
|
||||||
|
this.qtaOrdReadable = qtaOrdReadable;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBarcode() {
|
||||||
|
return barcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel setBarcode(String barcode) {
|
||||||
|
this.barcode = barcode;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNew() {
|
||||||
|
return isNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel setNew(boolean aNew) {
|
||||||
|
isNew = aNew;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SqlMtbColr getOriginalModel() {
|
||||||
|
return originalModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel setOriginalModel(SqlMtbColr originalModel) {
|
||||||
|
this.originalModel = originalModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -39,6 +39,7 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
|
|||||||
import it.integry.integrywmsnative.databinding.ActivityContabDocInterniEditBinding;
|
import it.integry.integrywmsnative.databinding.ActivityContabDocInterniEditBinding;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiChildDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiChildDTO;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsView;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.ui.DocumentRowsListAdapter;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.ui.DocumentRowsListAdapter;
|
||||||
import it.integry.integrywmsnative.ui.FabMenuCustomAnimations;
|
import it.integry.integrywmsnative.ui.FabMenuCustomAnimations;
|
||||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView;
|
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView;
|
||||||
@ -54,9 +55,13 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
MtbColrRepository documentRowsRepository;
|
MtbColrRepository documentRowsRepository;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
DocInterniEditFormViewModel viewModel;
|
DocInterniEditFormViewModel viewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View dialogInputQuantityV2View;
|
||||||
|
|
||||||
|
|
||||||
private int mBarcodeScannerIstanceID;
|
private int mBarcodeScannerIstanceID;
|
||||||
private ActivityContabDocInterniEditBinding binding;
|
private ActivityContabDocInterniEditBinding binding;
|
||||||
@ -133,6 +138,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initViewModel(SqlMtbColt document, List<GrigliaAcquistiChildDTO> productList) {
|
private void initViewModel(SqlMtbColt document, List<GrigliaAcquistiChildDTO> productList) {
|
||||||
|
this.viewModel.init();
|
||||||
this.viewModel.setListeners(this);
|
this.viewModel.setListeners(this);
|
||||||
this.viewModel.setDocument(document);
|
this.viewModel.setDocument(document);
|
||||||
this.viewModel.setProductsList(productList);
|
this.viewModel.setProductsList(productList);
|
||||||
@ -209,6 +215,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEditRowRequest(SqlMtbColr row, boolean flagTracciabilita) {
|
public void onEditRowRequest(SqlMtbColr row, boolean flagTracciabilita) {
|
||||||
|
this.onLoadingStarted();
|
||||||
MtbAart mtbAart = new MtbAart();
|
MtbAart mtbAart = new MtbAart();
|
||||||
mtbAart.setBarCode(row.getCodBarre());
|
mtbAart.setBarCode(row.getCodBarre());
|
||||||
mtbAart.setDiacod(row.getCodBarre());
|
mtbAart.setDiacod(row.getCodBarre());
|
||||||
@ -242,12 +249,12 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
}
|
}
|
||||||
return partitaMag;
|
return partitaMag;
|
||||||
});
|
});
|
||||||
|
dialogInputQuantityV2View.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
DialogInputQuantityV2View
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
|
||||||
this.onLoadingStarted();
|
this.onLoadingStarted();
|
||||||
this.viewModel.saveRow(row, resultDTO);
|
this.viewModel.saveRow(row, resultDTO);
|
||||||
}, this::onLoadingEnded)
|
})
|
||||||
|
.setOnAbort(this::onLoadingEnded)
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,6 +287,16 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
this.viewModel.deleteRow(entityToSql(mtbColr));
|
this.viewModel.deleteRow(entityToSql(mtbColr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMultipleRowsFound(List<SqlMtbColr> rows, GrigliaAcquistiChildDTO articolo) {
|
||||||
|
DialogSelectDocRowsView.newInstance(rows, (row) -> {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
if (row != null) {
|
||||||
|
this.viewModel.editRow(row, (articolo.getFlagTracciabilita().equalsIgnoreCase("S")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
).show(this.getSupportFragmentManager(), "dialogSelectDocRows");
|
||||||
|
}
|
||||||
|
|
||||||
private MtbColr sqlToEntity(SqlMtbColr sqlMtbColr) {
|
private MtbColr sqlToEntity(SqlMtbColr sqlMtbColr) {
|
||||||
MtbColr entity = new MtbColr();
|
MtbColr entity = new MtbColr();
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import androidx.lifecycle.MutableLiveData;
|
|||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@ -47,10 +48,19 @@ public class DocInterniEditFormViewModel {
|
|||||||
this.docInterniRESTConsumer = docInterniRESTConsumer;
|
this.docInterniRESTConsumer = docInterniRESTConsumer;
|
||||||
this.mtbColrRepository = mtbColrRepository;
|
this.mtbColrRepository = mtbColrRepository;
|
||||||
this.mtbColtRepository = mtbColtRepository;
|
this.mtbColtRepository = mtbColtRepository;
|
||||||
this.checkFornitoreRules = SettingsManager.iDB().getDocInterniCheckFornitore();
|
|
||||||
this.docRows.setValue(new ArrayList<>());
|
this.docRows.setValue(new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
try {
|
||||||
|
var docInterniCheckFornitore = SettingsManager.iDB().getDocInterniCheckFornitore();
|
||||||
|
this.checkFornitoreRules = docInterniCheckFornitore != null ? new JSONObject(docInterniCheckFornitore) : null;
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void sendOnLoadingStarted() {
|
private void sendOnLoadingStarted() {
|
||||||
if (this.listener != null) listener.onLoadingStarted();
|
if (this.listener != null) listener.onLoadingStarted();
|
||||||
}
|
}
|
||||||
@ -75,7 +85,7 @@ public class DocInterniEditFormViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void editRow(SqlMtbColr row, boolean flagTracciabilita) {
|
public void editRow(SqlMtbColr row, boolean flagTracciabilita) {
|
||||||
this.listener.onEditRowRequest(row, flagTracciabilita);
|
this.listener.onEditRowRequest(row, flagTracciabilita && this.isCheckPartitaMag);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Integer getNextIdRiga() {
|
private Integer getNextIdRiga() {
|
||||||
@ -115,28 +125,30 @@ public class DocInterniEditFormViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onSearch(String search) {
|
public void onSearch(String search) {
|
||||||
this.sendOnLoadingStarted();
|
|
||||||
GrigliaAcquistiChildDTO articolo = this.searchArticolo(search);
|
GrigliaAcquistiChildDTO articolo = this.searchArticolo(search);
|
||||||
if (articolo == null) {
|
if (articolo == null) {
|
||||||
this.sendError(new Exception("Nessun articolo corrispondente al codice fornito!"));
|
this.sendError(new Exception("Nessun articolo corrispondente al codice fornito!"));
|
||||||
this.sendOnLoadingEnded();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SqlMtbColr row = this.getRowForArticolo(articolo);
|
List<SqlMtbColr> rows = this.getRowsForArticolo(articolo);
|
||||||
this.sendOnLoadingEnded();
|
if (rows.isEmpty()) {
|
||||||
this.editRow(row, (articolo.getFlagTracciabilita().equalsIgnoreCase("S") && this.isCheckPartitaMag));
|
this.sendError(new Exception("Nessun articolo corrispondente al codice fornito!"));
|
||||||
|
}
|
||||||
|
if (rows.size() > 1) {
|
||||||
|
this.listener.onMultipleRowsFound(rows, articolo);
|
||||||
|
} else {
|
||||||
|
this.editRow(rows.get(0), (articolo.getFlagTracciabilita().equalsIgnoreCase("S")));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private SqlMtbColr getRowForArticolo(GrigliaAcquistiChildDTO articolo) {
|
private List<SqlMtbColr> getRowsForArticolo(GrigliaAcquistiChildDTO articolo) {
|
||||||
List<SqlMtbColr> docRows = this.docRows.getValue();
|
List<SqlMtbColr> docRows = this.docRows.getValue();
|
||||||
if (docRows == null) {
|
if (docRows == null) {
|
||||||
docRows = new ArrayList<>();
|
docRows = new ArrayList<>();
|
||||||
}
|
}
|
||||||
SqlMtbColt document = this.document.getValue();
|
SqlMtbColt document = this.document.getValue();
|
||||||
SqlMtbColr row = Stream.of(docRows).filter(docRow -> docRow.getCodMart().equalsIgnoreCase(articolo.getCodMart())).findFirstOrElse(null);
|
SqlMtbColr row = new SqlMtbColr();
|
||||||
if (row == null) {
|
|
||||||
row = new SqlMtbColr();
|
|
||||||
row.setIdCollo(document.getId());
|
row.setIdCollo(document.getId());
|
||||||
row.setRiga(getNextIdRiga());
|
row.setRiga(getNextIdRiga());
|
||||||
row.setCodMart(articolo.getCodMart());
|
row.setCodMart(articolo.getCodMart());
|
||||||
@ -150,8 +162,9 @@ public class DocInterniEditFormViewModel {
|
|||||||
row.setQtaCnf(articolo.getQtaCnf().floatValue());
|
row.setQtaCnf(articolo.getQtaCnf().floatValue());
|
||||||
row.setNumCnf(0f);
|
row.setNumCnf(0f);
|
||||||
row.setQtaCol(0f);
|
row.setQtaCol(0f);
|
||||||
}
|
List<SqlMtbColr> rows = Stream.of(docRows).filter(docRow -> docRow.getCodMart().equalsIgnoreCase(articolo.getCodMart())).toList();
|
||||||
return row;
|
rows.add(row);
|
||||||
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
private GrigliaAcquistiChildDTO searchArticolo(String filter) {
|
private GrigliaAcquistiChildDTO searchArticolo(String filter) {
|
||||||
@ -294,6 +307,8 @@ public class DocInterniEditFormViewModel {
|
|||||||
|
|
||||||
void onEditRowRequest(SqlMtbColr row, boolean flagTracciabilita);
|
void onEditRowRequest(SqlMtbColr row, boolean flagTracciabilita);
|
||||||
|
|
||||||
|
void onMultipleRowsFound(List<SqlMtbColr> rows, GrigliaAcquistiChildDTO articolo);
|
||||||
|
|
||||||
void onDocumentHoldRequest();
|
void onDocumentHoldRequest();
|
||||||
|
|
||||||
void onDocExported();
|
void onDocExported();
|
||||||
|
|||||||
@ -0,0 +1,16 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface DialogSelectDocRowsComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
DialogSelectDocRowsComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void inject(DialogSelectDocRowsView dialogSelectDocInfoView);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
|
||||||
|
@Module(subcomponents = DialogSelectDocRowsComponent.class)
|
||||||
|
public class DialogSelectDocRowsModule {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,143 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows;
|
||||||
|
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.BR;
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.databinding.DialogChooseRowFromListaDocRowsLayoutBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DialogChooseRowFromListaDocRowsListModel;
|
||||||
|
import kotlin.Unit;
|
||||||
|
|
||||||
|
public class DialogSelectDocRowsView extends BaseDialogFragment {
|
||||||
|
|
||||||
|
private final RunnableArgs<SqlMtbColr> onRowSelected;
|
||||||
|
private final List<SqlMtbColr> listArts;
|
||||||
|
private final MutableLiveData<List<DialogChooseRowFromListaDocRowsListModel>> listModels = new MutableLiveData<>();
|
||||||
|
private DialogChooseRowFromListaDocRowsLayoutBinding binding;
|
||||||
|
public MutableLiveData<SqlMtbColr> selectedRow = new MutableLiveData<>();
|
||||||
|
|
||||||
|
public static DialogSelectDocRowsView newInstance(
|
||||||
|
List<SqlMtbColr> listArts,
|
||||||
|
RunnableArgs<SqlMtbColr> onDismiss
|
||||||
|
) {
|
||||||
|
return new DialogSelectDocRowsView(listArts, onDismiss);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private DialogSelectDocRowsView(List<SqlMtbColr> listArts, RunnableArgs<SqlMtbColr> onDismiss) {
|
||||||
|
super();
|
||||||
|
this.onRowSelected = onDismiss;
|
||||||
|
this.listArts = listArts;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||||
|
super.onDismiss(dialog);
|
||||||
|
if (onRowSelected != null) onRowSelected.run(this.selectedRow.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
binding = DataBindingUtil.inflate(inflater, R.layout.dialog_choose_row_from_lista_doc_rows_layout, container, false);
|
||||||
|
binding.setLifecycleOwner(this);
|
||||||
|
MainApplication
|
||||||
|
.appComponent
|
||||||
|
.dialogSelectDocRowsComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
binding.setView(this);
|
||||||
|
|
||||||
|
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||||
|
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
initView();
|
||||||
|
this.refreshList();
|
||||||
|
|
||||||
|
|
||||||
|
binding.positiveButton.setOnClickListener(view -> {
|
||||||
|
getDialog().dismiss();
|
||||||
|
});
|
||||||
|
|
||||||
|
binding.negativeButton.setOnClickListener(view -> {
|
||||||
|
this.selectedRow.setValue(null);
|
||||||
|
getDialog().dismiss();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
this.onLoadingEnded();
|
||||||
|
return binding.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshList() {
|
||||||
|
var list = Stream.of(this.listArts).map(row -> {
|
||||||
|
DialogChooseRowFromListaDocRowsListModel model = new DialogChooseRowFromListaDocRowsListModel();
|
||||||
|
model.setCodMart(row.getCodMart());
|
||||||
|
model.setBarcode(row.getCodMart());
|
||||||
|
model.setOriginalModel(row);
|
||||||
|
model.setNew(row.getId() < 1);
|
||||||
|
model.setDescrizione(row.getDescrizione());
|
||||||
|
model.setQtaOrdReadable(row.getQtaCol() + "\n" + row.getUntMis());
|
||||||
|
model.getChecked().addOnPropertyChangedCallback(() -> {
|
||||||
|
this.checkRow(row, model.getChecked().get());
|
||||||
|
});
|
||||||
|
return model;
|
||||||
|
}).toList();
|
||||||
|
this.listModels.postValue(list);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkRow(SqlMtbColr row, boolean checked) {
|
||||||
|
if (checked) {
|
||||||
|
this.selectedRow.setValue(row);
|
||||||
|
var models = this.listModels.getValue();
|
||||||
|
if (models != null && !models.isEmpty()) {
|
||||||
|
Stream.of(models).filter(model -> model.getOriginalModel().getId() != row.getId()).forEach(model -> {
|
||||||
|
model.getChecked().set(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var selectedRow = this.selectedRow.getValue();
|
||||||
|
if (selectedRow != null && selectedRow.getId() == row.getId()) {
|
||||||
|
this.selectedRow.setValue(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initView() {
|
||||||
|
initArrayAdapters();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initArrayAdapters() {
|
||||||
|
|
||||||
|
new LiveAdapter(listModels, getViewLifecycleOwner(), BR.row)
|
||||||
|
.map(DialogChooseRowFromListaDocRowsListModel.class, R.layout.dialog_choose_row_from_lista_doc_rows__item_model)
|
||||||
|
.onNoData(noData -> {
|
||||||
|
binding.emptyView.setVisibility(noData ? View.VISIBLE : View.GONE);
|
||||||
|
return Unit.INSTANCE;
|
||||||
|
}
|
||||||
|
).into(binding.listaDocRows);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -67,6 +67,9 @@ public class MainActivity extends BaseActivity
|
|||||||
@Inject
|
@Inject
|
||||||
MainContext mainContext;
|
MainContext mainContext;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
UpdatesManager updatesManager;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -79,7 +82,7 @@ public class MainActivity extends BaseActivity
|
|||||||
mBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.activity_main, null, false);
|
mBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.activity_main, null, false);
|
||||||
setContentView(mBinding.getRoot());
|
setContentView(mBinding.getRoot());
|
||||||
|
|
||||||
UpdatesManager.init(this);
|
updatesManager.init(this);
|
||||||
UtilityContext.initMainActivity(this);
|
UtilityContext.initMainActivity(this);
|
||||||
|
|
||||||
setSupportActionBar(mBinding.appBarMain.toolbar);
|
setSupportActionBar(mBinding.appBarMain.toolbar);
|
||||||
|
|||||||
@ -138,6 +138,7 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
|
super.onCreateView(inflater, container, savedInstanceState);
|
||||||
|
|
||||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.fragment_main_ordini_uscita, container, false);
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.fragment_main_ordini_uscita, container, false);
|
||||||
|
|
||||||
|
|||||||
@ -69,6 +69,9 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
@Inject
|
@Inject
|
||||||
PickingLiberoViewModel mViewModel;
|
PickingLiberoViewModel mViewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
public BindableBoolean thereIsAnOpenedUL = new BindableBoolean(false);
|
public BindableBoolean thereIsAnOpenedUL = new BindableBoolean(false);
|
||||||
public BindableBoolean thereIsntAnOpenedUL = new BindableBoolean(true);
|
public BindableBoolean thereIsntAnOpenedUL = new BindableBoolean(true);
|
||||||
public BindableBoolean thereIsAnyRowInUL = new BindableBoolean(false);
|
public BindableBoolean thereIsAnyRowInUL = new BindableBoolean(false);
|
||||||
@ -155,6 +158,8 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
.setOnScanSuccessfull(onScanSuccessful)
|
.setOnScanSuccessfull(onScanSuccessful)
|
||||||
.setOnScanFailed(ex -> UtilityExceptions.defaultException(getActivity(), ex, false)));
|
.setOnScanFailed(ex -> UtilityExceptions.defaultException(getActivity(), ex, false)));
|
||||||
|
|
||||||
|
BarcodeManager.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initBottomSheet() {
|
private void initBottomSheet() {
|
||||||
@ -199,10 +204,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
};
|
};
|
||||||
|
|
||||||
public void createNewLU() {
|
public void createNewLU() {
|
||||||
this.onLoadingStarted();
|
|
||||||
|
|
||||||
this.mViewModel.createNewLU(null, null, () -> {
|
this.mViewModel.createNewLU(null, null, () -> {
|
||||||
this.onLoadingEnded();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,7 +229,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUOpened(MtbColt mtbColt) {
|
public void onLUOpened(MtbColt mtbColt) {
|
||||||
getActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
mToolbarTitleText.setText(String.format(getActivity().getText(R.string.lu_number_text).toString(), mtbColt.getNumCollo()));
|
mToolbarTitleText.setText(String.format(getActivity().getText(R.string.lu_number_text).toString(), mtbColt.getNumCollo()));
|
||||||
|
|
||||||
initAdapter();
|
initAdapter();
|
||||||
@ -248,7 +250,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUClosed() {
|
public void onLUClosed() {
|
||||||
getActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
mToolbarTitleText.setText(getActivity().getText(R.string.free_picking_title_fragment).toString());
|
mToolbarTitleText.setText(getActivity().getText(R.string.free_picking_title_fragment).toString());
|
||||||
destroyAdapter();
|
destroyAdapter();
|
||||||
|
|
||||||
@ -335,8 +337,8 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||||
.setCanLUBeClosed(canLUBeClosed);
|
.setCanLUBeClosed(canLUBeClosed);
|
||||||
|
|
||||||
DialogInputQuantityV2View
|
mDialogInputQuantityV2View.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
@ -346,15 +348,14 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
|
|
||||||
this.openProgress();
|
this.openProgress();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
}, () -> {
|
|
||||||
this.closeProgress();
|
|
||||||
})
|
})
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.setOnAbort(this::closeProgress)
|
||||||
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRowSaved() {
|
public void onRowSaved() {
|
||||||
getActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
FBToast.successToast(getActivity(), getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
FBToast.successToast(getActivity(), getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -229,7 +229,6 @@ public class PickingLiberoViewModel {
|
|||||||
|
|
||||||
public void createNewLU(Integer customNumCollo, String customSerCollo, Runnable onComplete) {
|
public void createNewLU(Integer customNumCollo, String customSerCollo, Runnable onComplete) {
|
||||||
if (this.mFlagAskCliente) {
|
if (this.mFlagAskCliente) {
|
||||||
this.sendOnLoadingEnded();
|
|
||||||
this.sendLUClienteRequired((vtbDest, codJcom) -> {
|
this.sendLUClienteRequired((vtbDest, codJcom) -> {
|
||||||
createNewLU_PostClienteAsk(customNumCollo, customSerCollo, vtbDest, codJcom, onComplete);
|
createNewLU_PostClienteAsk(customNumCollo, customSerCollo, vtbDest, codJcom, onComplete);
|
||||||
}, () -> {
|
}, () -> {
|
||||||
@ -276,6 +275,8 @@ public class PickingLiberoViewModel {
|
|||||||
|
|
||||||
this.mCurrentMtbColt = mtbColt;
|
this.mCurrentMtbColt = mtbColt;
|
||||||
|
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
if (onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
this.sendLUOpened(mtbColt);
|
this.sendLUOpened(mtbColt);
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
|
|||||||
@ -64,6 +64,9 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
@Inject
|
@Inject
|
||||||
PickingResiViewModel mViewmodel;
|
PickingResiViewModel mViewmodel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
||||||
|
|
||||||
private ObservableArrayList<PickingResiListModel> mPickingResiMutableData = new ObservableArrayList<>();
|
private ObservableArrayList<PickingResiListModel> mPickingResiMutableData = new ObservableArrayList<>();
|
||||||
@ -319,8 +322,9 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
.setCanLUBeClosed(false)
|
.setCanLUBeClosed(false)
|
||||||
.setCanPartitaMagBeChanged(false);
|
.setCanPartitaMagBeChanged(false);
|
||||||
|
|
||||||
DialogInputQuantityV2View
|
mDialogInputQuantityV2View
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
@ -330,7 +334,8 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
|
|
||||||
this.openProgress();
|
this.openProgress();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
}, () -> {
|
})
|
||||||
|
.setOnAbort(() -> {
|
||||||
this.mViewmodel.resetMatchedRows();
|
this.mViewmodel.resetMatchedRows();
|
||||||
})
|
})
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
|
|||||||
@ -53,6 +53,9 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
@Inject
|
@Inject
|
||||||
ProdRecuperoMaterialeViewModel mViewModel;
|
ProdRecuperoMaterialeViewModel mViewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
private FragmentProdRecuperoMaterialeBinding mBinding;
|
private FragmentProdRecuperoMaterialeBinding mBinding;
|
||||||
|
|
||||||
private int barcodeScannerIstanceID = -1;
|
private int barcodeScannerIstanceID = -1;
|
||||||
@ -200,8 +203,9 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
||||||
.setCanLUBeClosed(canLUBeClosed);
|
.setCanLUBeClosed(canLUBeClosed);
|
||||||
|
|
||||||
DialogInputQuantityV2View
|
mDialogInputQuantityV2View
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
@ -210,7 +214,8 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
.setDataScad(resultDTO.getDataScad());
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
this.mViewModel.onItemDispatched(item, pickedQuantityDTO, sourceMtbColt);
|
this.mViewModel.onItemDispatched(item, pickedQuantityDTO, sourceMtbColt);
|
||||||
}, this::onLoadingEnded)
|
})
|
||||||
|
.setOnAbort(this::onLoadingEnded)
|
||||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -70,11 +70,11 @@ public class EditArticoloDialog extends BaseDialogFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||||
super.onDismiss(dialog);
|
super.onDismiss(dialog);
|
||||||
ArticoloOrdine articolo = mArticolo.getValue();
|
/*ArticoloOrdine articolo = mArticolo.getValue();
|
||||||
if (articolo != null && articolo.getQtaOrd() <= 0f) {
|
if (articolo != null && articolo.getQtaOrd() <= 0f) {
|
||||||
articolo = null;
|
articolo = null;
|
||||||
}
|
}
|
||||||
onDialogDismiss.run(articolo);
|
onDialogDismiss.run(articolo);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@ -155,17 +155,23 @@ public class EditArticoloDialog extends BaseDialogFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
articolo.setQtaOrd(qtaOrd.get().floatValue());
|
articolo.setQtaOrd(qtaOrd.get().floatValue());
|
||||||
mArticolo.postValue(articolo);
|
mArticolo.setValue(articolo);
|
||||||
|
mHelper.saveArticoloToOrdine(mArticolo.getValue(), () -> {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
onDialogDismiss.run(articolo);
|
||||||
|
});
|
||||||
|
this.dismiss();
|
||||||
|
}, e -> {
|
||||||
|
mContext.runOnUiThread(() -> UtilityExceptions.defaultException(mContext, e));
|
||||||
|
this.onLoadingEnded();
|
||||||
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
mContext.runOnUiThread(() -> UtilityExceptions.defaultException(mContext, e));
|
mContext.runOnUiThread(() -> UtilityExceptions.defaultException(mContext, e));
|
||||||
this.onLoadingEnded();
|
this.onLoadingEnded();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mHelper.saveArticoloToOrdine(mArticolo.getValue(), () -> {
|
;
|
||||||
this.onLoadingEnded();
|
|
||||||
this.dismiss();
|
|
||||||
}, e -> mContext.runOnUiThread(() -> UtilityExceptions.defaultException(mContext, e)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArticoloOrdine getArticolo() {
|
public ArticoloOrdine getArticolo() {
|
||||||
@ -174,6 +180,9 @@ public class EditArticoloDialog extends BaseDialogFragment {
|
|||||||
|
|
||||||
public void cancel() {
|
public void cancel() {
|
||||||
mArticolo.postValue(null);
|
mArticolo.postValue(null);
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
onDialogDismiss.run(null);
|
||||||
|
});
|
||||||
this.dismiss();
|
this.dismiss();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.gest.pv_ordini_acquisto;
|
package it.integry.integrywmsnative.gest.pv_ordini_acquisto;
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
@ -25,7 +23,6 @@ import javax.inject.Inject;
|
|||||||
import it.integry.integrywmsnative.MainApplication;
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
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_store.db.entity.Griglia;
|
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
|
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
|
||||||
@ -41,12 +38,13 @@ 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.databinding.FragmentPvOrdiniAcquistoBinding;
|
import it.integry.integrywmsnative.databinding.FragmentPvOrdiniAcquistoBinding;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity;
|
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.ui.OrdineAcquistoPvOpenListAdapter;
|
|
||||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.dialogs.DialogScanLisA;
|
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.dialogs.DialogScanLisA;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.helper.OrdineAcquistoPvHelper;
|
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.helper.OrdineAcquistoPvHelper;
|
||||||
|
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.ui.OrdineAcquistoPvOpenListAdapter;
|
||||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogAskAction;
|
import it.integry.integrywmsnative.view.dialogs.DialogAskAction;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitledFragment, IScrollableFragment {
|
public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitledFragment, IScrollableFragment {
|
||||||
@ -55,7 +53,7 @@ public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitled
|
|||||||
private OrdineAcquistoPvHelper mHelper;
|
private OrdineAcquistoPvHelper mHelper;
|
||||||
private Griglia mGriglia;
|
private Griglia mGriglia;
|
||||||
private OrdineAcquistoPvOpenListAdapter mAdapter;
|
private OrdineAcquistoPvOpenListAdapter mAdapter;
|
||||||
private Dialog mCurrentProgress;
|
private DialogProgressView mCurrentProgress;
|
||||||
private final List<OrdineWrapper> mRenderedOrderList = new ArrayList<>();
|
private final List<OrdineWrapper> mRenderedOrderList = new ArrayList<>();
|
||||||
private boolean mRedirectToNewOrder = true;
|
private boolean mRedirectToNewOrder = true;
|
||||||
|
|
||||||
@ -177,7 +175,7 @@ public class PVOrdiniAcquistoGrigliaFragment extends Fragment implements ITitled
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void editOrdine(Ordine ordine) {
|
private void editOrdine(Ordine ordine) {
|
||||||
requireActivity().startActivity(PVOrdineAcquistoEditActivity.newInstance(requireActivity(),ordine));
|
requireActivity().startActivity(PVOrdineAcquistoEditActivity.newInstance(requireActivity(), ordine));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.gest.pv_ordini_acquisto.dialogs;
|
package it.integry.integrywmsnative.gest.pv_ordini_acquisto.dialogs;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
@ -8,6 +7,7 @@ import android.graphics.drawable.ColorDrawable;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
@ -21,13 +21,14 @@ 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.databinding.DialogScanCodiceGrigliaBinding;
|
import it.integry.integrywmsnative.databinding.DialogScanCodiceGrigliaBinding;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.helper.OrdineAcquistoPvHelper;
|
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.helper.OrdineAcquistoPvHelper;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
|
||||||
public class DialogScanLisA {
|
public class DialogScanLisA {
|
||||||
|
|
||||||
private Activity mContext;
|
private FragmentActivity mContext;
|
||||||
|
|
||||||
private BaseDialog mDialog;
|
private BaseDialog mDialog;
|
||||||
private Dialog mCurrentProgress;
|
private DialogProgressView mCurrentProgress;
|
||||||
|
|
||||||
private final DialogScanCodiceGrigliaBinding mBinding;
|
private final DialogScanCodiceGrigliaBinding mBinding;
|
||||||
|
|
||||||
@ -38,7 +39,7 @@ public class DialogScanLisA {
|
|||||||
private GrigliaRepository mGrigliaRepository;
|
private GrigliaRepository mGrigliaRepository;
|
||||||
private Griglia mGriglia;
|
private Griglia mGriglia;
|
||||||
|
|
||||||
private DialogScanLisA(Activity context, GrigliaRepository grigliaRepository, OrdineAcquistoPvHelper helper, RunnableArgs<Griglia> onDialogDismiss) {
|
private DialogScanLisA(FragmentActivity context, GrigliaRepository grigliaRepository, OrdineAcquistoPvHelper helper, RunnableArgs<Griglia> onDialogDismiss) {
|
||||||
mOnDialogDismiss = null;
|
mOnDialogDismiss = null;
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mGrigliaRepository = grigliaRepository;
|
mGrigliaRepository = grigliaRepository;
|
||||||
@ -55,10 +56,9 @@ public class DialogScanLisA {
|
|||||||
mOnDialogDismiss = onDialogDismiss;
|
mOnDialogDismiss = onDialogDismiss;
|
||||||
initBarcode();
|
initBarcode();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dialog make(Activity context, GrigliaRepository grigliaRepository, OrdineAcquistoPvHelper helper, RunnableArgs<Griglia> onDialogDismiss) {
|
public static Dialog make(FragmentActivity context, GrigliaRepository grigliaRepository, OrdineAcquistoPvHelper helper, RunnableArgs<Griglia> onDialogDismiss) {
|
||||||
return new DialogScanLisA(context, grigliaRepository, helper, onDialogDismiss).mDialog;
|
return new DialogScanLisA(context, grigliaRepository, helper, onDialogDismiss).mDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +77,6 @@ public class DialogScanLisA {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.gest.rettifica_giacenze;
|
package it.integry.integrywmsnative.gest.rettifica_giacenze;
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
@ -58,6 +57,7 @@ import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
|||||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView;
|
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_position_of_lu.DialogAskPositionOfLU;
|
import it.integry.integrywmsnative.view.dialogs.ask_position_of_lu.DialogAskPositionOfLU;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts.DialogChooseArtFromListaArts;
|
import it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts.DialogChooseArtFromListaArts;
|
||||||
@ -73,6 +73,9 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
@Inject
|
@Inject
|
||||||
RettificaGiacenzeViewModel mViewModel;
|
RettificaGiacenzeViewModel mViewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
public BindableBoolean thereIsAnOpenedUL = new BindableBoolean(false);
|
public BindableBoolean thereIsAnOpenedUL = new BindableBoolean(false);
|
||||||
public BindableBoolean thereIsntAnOpenedUL = new BindableBoolean(false);
|
public BindableBoolean thereIsntAnOpenedUL = new BindableBoolean(false);
|
||||||
|
|
||||||
@ -82,7 +85,7 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
|
|
||||||
private int barcodeScannerIstanceID = -1;
|
private int barcodeScannerIstanceID = -1;
|
||||||
|
|
||||||
private Dialog mCurrentProgress;
|
private DialogProgressView mCurrentProgress;
|
||||||
|
|
||||||
public RettificaGiacenzeFragment() {
|
public RettificaGiacenzeFragment() {
|
||||||
// Required empty public constructor
|
// Required empty public constructor
|
||||||
@ -320,7 +323,7 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
thereIsAnOpenedUL.set(false);
|
thereIsAnOpenedUL.set(false);
|
||||||
|
|
||||||
|
|
||||||
if(getActivity() != null) ((IPoppableActivity) getActivity()).pop();
|
if (getActivity() != null) ((IPoppableActivity) getActivity()).pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -341,7 +344,7 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
if (ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
} else {
|
} else {
|
||||||
UtilityExceptions.defaultException(getActivity(), ex, mCurrentProgress);
|
UtilityExceptions.defaultException(requireActivity(), ex, mCurrentProgress);
|
||||||
}
|
}
|
||||||
|
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
@ -378,8 +381,9 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||||
.setCanLUBeClosed(canLUBeClosed);
|
.setCanLUBeClosed(canLUBeClosed);
|
||||||
|
|
||||||
DialogInputQuantityV2View
|
mDialogInputQuantityV2View
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
@ -389,15 +393,16 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
|
|
||||||
this.openProgress();
|
this.openProgress();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
}, () -> {
|
})
|
||||||
|
.setOnAbort(() -> {
|
||||||
this.closeProgress();
|
this.closeProgress();
|
||||||
})
|
})
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRowSaved() {
|
public void onRowSaved() {
|
||||||
FBToast.successToast(getActivity(), getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
FBToast.successToast(requireActivity(), getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -450,7 +455,8 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
null,
|
null,
|
||||||
() -> onComplete.run(true),
|
() -> onComplete.run(true),
|
||||||
() -> onComplete.run(false))
|
() -> onComplete.run(false))
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");;
|
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -83,6 +83,9 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
@Inject
|
@Inject
|
||||||
SpedizioneViewModel mViewmodel;
|
SpedizioneViewModel mViewmodel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
||||||
|
|
||||||
private final ObservableArrayList<SpedizioneListModel> mSpedizioneMutableData = new ObservableArrayList<>();
|
private final ObservableArrayList<SpedizioneListModel> mSpedizioneMutableData = new ObservableArrayList<>();
|
||||||
@ -821,8 +824,9 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
.setCanLUBeClosed(true)
|
.setCanLUBeClosed(true)
|
||||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged);
|
.setCanPartitaMagBeChanged(canPartitaMagBeChanged);
|
||||||
|
|
||||||
DialogInputQuantityV2View
|
mDialogInputQuantityV2View
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
@ -832,7 +836,8 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
|
|
||||||
this.openProgress();
|
this.openProgress();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
}, () -> {
|
})
|
||||||
|
.setOnAbort(() -> {
|
||||||
this.mViewmodel.resetMatchedRows();
|
this.mViewmodel.resetMatchedRows();
|
||||||
})
|
})
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
|
|||||||
@ -48,6 +48,9 @@ public class VersamentoMerceFragment extends BaseFragment implements ITitledFrag
|
|||||||
@Inject
|
@Inject
|
||||||
VersamentoMerceViewModel mViewModel;
|
VersamentoMerceViewModel mViewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
private FragmentMainVersamentoMerceBinding mBindings = null;
|
private FragmentMainVersamentoMerceBinding mBindings = null;
|
||||||
|
|
||||||
private final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
private final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||||
@ -202,9 +205,10 @@ public class VersamentoMerceFragment extends BaseFragment implements ITitledFrag
|
|||||||
.setCanPartitaMagBeChanged(canBatchLotBeChanged)
|
.setCanPartitaMagBeChanged(canBatchLotBeChanged)
|
||||||
.setCanLUBeClosed(false);
|
.setCanLUBeClosed(false);
|
||||||
|
|
||||||
this.getActivity().runOnUiThread(() -> {
|
this.requireActivity().runOnUiThread(() -> {
|
||||||
DialogInputQuantityV2View
|
mDialogInputQuantityV2View
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
|
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
@ -215,8 +219,9 @@ public class VersamentoMerceFragment extends BaseFragment implements ITitledFrag
|
|||||||
|
|
||||||
onComplete.run(pickedQuantityDTO);
|
onComplete.run(pickedQuantityDTO);
|
||||||
|
|
||||||
}, this::onLoadingEnded)
|
})
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.setOnAbort(this::onLoadingEnded)
|
||||||
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,61 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs;
|
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
|
||||||
import it.integry.integrywmsnative.databinding.DialogProgressBinding;
|
|
||||||
|
|
||||||
public class DialogProgress {
|
|
||||||
|
|
||||||
private Context mContext;
|
|
||||||
private DialogProgressBinding mBinding;
|
|
||||||
|
|
||||||
private Dialog mDialog;
|
|
||||||
|
|
||||||
public static Dialog make(Context context,String subtitle) {
|
|
||||||
DialogProgress progress = new DialogProgress(context);
|
|
||||||
progress.setSubtitle(subtitle);
|
|
||||||
return progress.mDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Dialog make(Context context) {
|
|
||||||
return new DialogProgress(context).mDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private DialogProgress(Context context) {
|
|
||||||
mContext = context;
|
|
||||||
|
|
||||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
|
||||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.dialog_progress, null, false);
|
|
||||||
|
|
||||||
// final Thread[] progressBarThread = new Thread[1];
|
|
||||||
|
|
||||||
mDialog = new Dialog(mContext);
|
|
||||||
mDialog.setContentView(mBinding.getRoot());
|
|
||||||
mDialog.setCanceledOnTouchOutside(false);
|
|
||||||
mDialog.setCancelable(false);
|
|
||||||
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
|
||||||
|
|
||||||
mDialog.setOnShowListener(dialog -> {
|
|
||||||
// ((ProgressBar) currentView.findViewById(R.id.progressBar)).setIndeterminate(true);
|
|
||||||
// progressBarThread[0] = UtilityProgress.makeProgressBarIndeterminate(mBinding.progressBar);
|
|
||||||
});
|
|
||||||
|
|
||||||
mDialog.setOnDismissListener(dialog -> {
|
|
||||||
// progressBarThread[0].interrupt();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setSubtitle(String subtitle){
|
|
||||||
mBinding.subtitleText.setText(subtitle);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs;
|
||||||
|
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.fragment.app.DialogFragment;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.databinding.DialogProgressBinding;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
public class DialogProgressView extends DialogFragment {
|
||||||
|
|
||||||
|
private DialogProgressBinding mBindings;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
private String subtitle;
|
||||||
|
private boolean indeterminateProgress;
|
||||||
|
|
||||||
|
public static DialogProgressView newInstance(String title, String subtitle, boolean indeterminate) {
|
||||||
|
return new DialogProgressView()
|
||||||
|
.setIndeterminateProgress(indeterminate)
|
||||||
|
.setTitle(title)
|
||||||
|
.setSubtitle(subtitle);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DialogProgressView newInstance() {
|
||||||
|
return newInstance(null, null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.dialog_progress, container, false);
|
||||||
|
|
||||||
|
setCancelable(false);
|
||||||
|
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
|
||||||
|
mBindings.setTitle(UtilityString.isNullOrEmpty(title) ? requireActivity().getString(R.string.loading) : title);
|
||||||
|
|
||||||
|
mBindings.setSubtitle(subtitle);
|
||||||
|
mBindings.progressBar.setIndeterminate(isIndeterminateProgress());
|
||||||
|
|
||||||
|
if(!isIndeterminateProgress()){
|
||||||
|
mBindings.progressBar.setMax(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isIndeterminateProgress() {
|
||||||
|
return indeterminateProgress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogProgressView setIndeterminateProgress(boolean indeterminateProgress) {
|
||||||
|
this.indeterminateProgress = indeterminateProgress;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public DialogProgressView setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogProgressView setSubtitle(String subtitle) {
|
||||||
|
this.subtitle = subtitle;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProgress(int progress) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
mBindings.progressBar.setProgress(progress, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -23,17 +23,31 @@ import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.IDialogAsk
|
|||||||
|
|
||||||
public class DialogAskClienteAdapter extends PagerAdapter implements ViewPager.OnPageChangeListener {
|
public class DialogAskClienteAdapter extends PagerAdapter implements ViewPager.OnPageChangeListener {
|
||||||
|
|
||||||
private Context mContext;
|
private final Context mContext;
|
||||||
|
|
||||||
private List<Map.Entry<Integer, Class>> mDatasetLayout;
|
private final List<Map.Entry<Integer, Class<? extends IDialogAskClienteViewModel>>> mDatasetLayout;
|
||||||
private List<Map.Entry<ViewDataBinding, IDialogAskClienteViewModel>> mDatasetViews;
|
private final List<Map.Entry<ViewDataBinding, IDialogAskClienteViewModel>> mDatasetViews;
|
||||||
|
private final List<IDialogAskClienteViewModel> mDatasetViewModels;
|
||||||
|
|
||||||
private DeactivatableViewPager viewPager;
|
private DeactivatableViewPager viewPager;
|
||||||
|
|
||||||
public DialogAskClienteAdapter(Context context, List<Map.Entry<Integer, Class>> datasetLayouts) {
|
public DialogAskClienteAdapter(Context context, List<Map.Entry<Integer, Class<? extends IDialogAskClienteViewModel>>> datasetLayouts) {
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
this.mDatasetLayout = datasetLayouts;
|
this.mDatasetLayout = datasetLayouts;
|
||||||
this.mDatasetViews = new ArrayList<>();
|
this.mDatasetViews = new ArrayList<>();
|
||||||
|
this.mDatasetViewModels = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
for (var viewModelEntry : mDatasetLayout) {
|
||||||
|
var viewModelClazz = viewModelEntry.getValue();
|
||||||
|
|
||||||
|
try {
|
||||||
|
IDialogAskClienteViewModel viewModel = viewModelClazz.newInstance();
|
||||||
|
mDatasetViewModels.add(viewModel);
|
||||||
|
} catch (IllegalAccessException | InstantiationException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -43,20 +57,13 @@ public class DialogAskClienteAdapter extends PagerAdapter implements ViewPager.O
|
|||||||
|
|
||||||
Integer viewId = mDatasetLayout.get(position).getKey();
|
Integer viewId = mDatasetLayout.get(position).getKey();
|
||||||
|
|
||||||
|
|
||||||
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
||||||
ViewDataBinding mBinding = DataBindingUtil.inflate(inflater, viewId, null, false);
|
ViewDataBinding mBinding = DataBindingUtil.inflate(inflater, viewId, container, false);
|
||||||
|
|
||||||
Class viewModelClass = mDatasetLayout.get(position).getValue();
|
|
||||||
IDialogAskClienteViewModel viewModel = null;
|
|
||||||
|
|
||||||
try {
|
var viewModel = this.mDatasetViewModels.get(position);
|
||||||
viewModel = (IDialogAskClienteViewModel) viewModelClass.newInstance();
|
|
||||||
viewModel.setBinding(mBinding);
|
viewModel.setBinding(mBinding);
|
||||||
viewModel.setContext(mContext);
|
viewModel.setContext(mContext);
|
||||||
} catch (IllegalAccessException | InstantiationException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
mBinding.setVariable(BR.viewmodel, viewModel);
|
mBinding.setVariable(BR.viewmodel, viewModel);
|
||||||
|
|
||||||
@ -82,10 +89,10 @@ public class DialogAskClienteAdapter extends PagerAdapter implements ViewPager.O
|
|||||||
return mDatasetLayout.size();
|
return mDatasetLayout.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IDialogAskClienteViewModel getViewModel(@NonNull int layoutID) {
|
public IDialogAskClienteViewModel getViewModel(int layoutID) {
|
||||||
for(int i = 0; i < mDatasetLayout.size(); i++) {
|
for(int i = 0; i < mDatasetLayout.size(); i++) {
|
||||||
if(mDatasetLayout.get(i).getKey() == layoutID) {
|
if(mDatasetLayout.get(i).getKey() == layoutID) {
|
||||||
return this.mDatasetViews.get(i).getValue();
|
return this.mDatasetViewModels.get(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.ask_cliente;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface DialogAskClienteComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
DialogAskClienteComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(DialogAskClienteView dialogAskClienteView);
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.ask_cliente;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
|
||||||
|
@Module(subcomponents = DialogAskClienteComponent.class)
|
||||||
|
public class DialogAskClienteModule {
|
||||||
|
}
|
||||||
@ -14,23 +14,36 @@ import androidx.annotation.Nullable;
|
|||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
import java.util.AbstractMap;
|
import java.util.AbstractMap;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
import it.integry.integrywmsnative.core.model.VtbDest;
|
import it.integry.integrywmsnative.core.model.VtbDest;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityHashMap;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.DialogAskClienteBinding;
|
import it.integry.integrywmsnative.databinding.DialogAskClienteBinding;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteClienteDTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteDestinatarioDTO;
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteDestinatarioDTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page1ViewModel;
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page1ViewModel;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page2ViewModel;
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page2ViewModel;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.IDialogAskClienteViewModel;
|
||||||
|
|
||||||
public class DialogAskClienteView extends BaseDialogFragment {
|
public class DialogAskClienteView extends BaseDialogFragment {
|
||||||
|
|
||||||
@ -44,8 +57,14 @@ public class DialogAskClienteView extends BaseDialogFragment {
|
|||||||
|
|
||||||
private boolean mIsClienteSelected = false;
|
private boolean mIsClienteSelected = false;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
SystemRESTConsumer systemRESTConsumer;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogProgressView dialogProgressView;
|
||||||
|
|
||||||
public static DialogAskClienteView newInstance(@NotNull RunnableArgss<VtbDest, String> onComplete, @NotNull Runnable onAbort) {
|
public static DialogAskClienteView newInstance(@NotNull RunnableArgss<VtbDest, String> onComplete, @NotNull Runnable onAbort) {
|
||||||
return new DialogAskClienteView( onComplete, onAbort);
|
return new DialogAskClienteView(onComplete, onAbort);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DialogAskClienteView(@NotNull RunnableArgss<VtbDest, String> onComplete, @NotNull Runnable onAbort) {
|
private DialogAskClienteView(@NotNull RunnableArgss<VtbDest, String> onComplete, @NotNull Runnable onAbort) {
|
||||||
@ -68,8 +87,13 @@ public class DialogAskClienteView extends BaseDialogFragment {
|
|||||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||||
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.dialogAskClienteComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
List<Map.Entry<Integer, Class>> views = new ArrayList<>();
|
|
||||||
|
List<Map.Entry<Integer, Class<? extends IDialogAskClienteViewModel>>> views = new ArrayList<>();
|
||||||
views.add(new AbstractMap.SimpleEntry<>(R.layout.dialog_ask_cliente__page1, DialogAskCliente_Page1ViewModel.class));
|
views.add(new AbstractMap.SimpleEntry<>(R.layout.dialog_ask_cliente__page1, DialogAskCliente_Page1ViewModel.class));
|
||||||
views.add(new AbstractMap.SimpleEntry<>(R.layout.dialog_ask_cliente__page2, DialogAskCliente_Page2ViewModel.class));
|
views.add(new AbstractMap.SimpleEntry<>(R.layout.dialog_ask_cliente__page2, DialogAskCliente_Page2ViewModel.class));
|
||||||
|
|
||||||
@ -79,9 +103,7 @@ public class DialogAskClienteView extends BaseDialogFragment {
|
|||||||
mBindings.viewpager.addOnPageChangeListener(mAdapter);
|
mBindings.viewpager.addOnPageChangeListener(mAdapter);
|
||||||
mBindings.viewpager.setCurrentItem(0, false);
|
mBindings.viewpager.setCurrentItem(0, false);
|
||||||
|
|
||||||
getDialog().setOnShowListener(d -> {
|
|
||||||
this.initView();
|
this.initView();
|
||||||
});
|
|
||||||
|
|
||||||
return mBindings.getRoot();
|
return mBindings.getRoot();
|
||||||
}
|
}
|
||||||
@ -93,20 +115,14 @@ public class DialogAskClienteView extends BaseDialogFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
|
||||||
super.onViewCreated(view, savedInstanceState);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initView() {
|
private void initView() {
|
||||||
DialogAskCliente_Page1ViewModel viewModel1 = (DialogAskCliente_Page1ViewModel) mAdapter.getViewModel(R.layout.dialog_ask_cliente__page1);
|
DialogAskCliente_Page1ViewModel viewModel1 = (DialogAskCliente_Page1ViewModel) mAdapter.getViewModel(R.layout.dialog_ask_cliente__page1);
|
||||||
DialogAskCliente_Page2ViewModel viewModel2 = (DialogAskCliente_Page2ViewModel) mAdapter.getViewModel(R.layout.dialog_ask_cliente__page2);
|
DialogAskCliente_Page2ViewModel viewModel2 = (DialogAskCliente_Page2ViewModel) mAdapter.getViewModel(R.layout.dialog_ask_cliente__page2);
|
||||||
|
|
||||||
viewModel1
|
viewModel1.setOnConfirmClickListener(() -> {
|
||||||
.setOnConfirmClickListener(() -> {
|
|
||||||
String codAnag = viewModel1.getCurrentCliente();
|
String codAnag = viewModel1.getCurrentCliente();
|
||||||
|
|
||||||
if(UtilityString.isNullOrEmpty(codAnag)) {
|
if (UtilityString.isNullOrEmpty(codAnag)) {
|
||||||
this.mIsClienteSelected = true;
|
this.mIsClienteSelected = true;
|
||||||
dismiss();
|
dismiss();
|
||||||
mOnComplete.run(null, null);
|
mOnComplete.run(null, null);
|
||||||
@ -116,7 +132,6 @@ public class DialogAskClienteView extends BaseDialogFragment {
|
|||||||
|
|
||||||
mBindings.viewpager.setCurrentItem(mBindings.viewpager.getCurrentItem() + 1, true);
|
mBindings.viewpager.setCurrentItem(mBindings.viewpager.getCurrentItem() + 1, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
viewModel2.setOnConfirmClickListener(() -> {
|
viewModel2.setOnConfirmClickListener(() -> {
|
||||||
DialogAskClienteDestinatarioDTO cliente = viewModel2.getCurrentDestinatario();
|
DialogAskClienteDestinatarioDTO cliente = viewModel2.getCurrentDestinatario();
|
||||||
|
|
||||||
@ -128,13 +143,88 @@ public class DialogAskClienteView extends BaseDialogFragment {
|
|||||||
|
|
||||||
viewModel1.setOnAbortClickListener(this::dismiss);
|
viewModel1.setOnAbortClickListener(this::dismiss);
|
||||||
viewModel2.setOnAbortClickListener(this::dismiss);
|
viewModel2.setOnAbortClickListener(this::dismiss);
|
||||||
|
|
||||||
|
|
||||||
|
this.dialogProgressView.show(this.getParentFragmentManager(), "tag");
|
||||||
|
|
||||||
|
this.initClienti(viewModel1, () -> {
|
||||||
|
this.initDestinatari(viewModel2, () -> {
|
||||||
|
this.dialogProgressView.dismiss();
|
||||||
|
}, () -> {
|
||||||
|
this.dialogProgressView.dismiss();
|
||||||
|
});
|
||||||
|
}, () -> {
|
||||||
|
this.dialogProgressView.dismiss();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initClienti(DialogAskCliente_Page1ViewModel viewModel, Runnable onComplete, Runnable onAbort) {
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<HashMap<String, Object>>>() {
|
||||||
|
}.getType();
|
||||||
|
|
||||||
|
String sqlClienti = "SELECT gtb_anag.cod_anag, rag_soc, jtb_comt.cod_jcom " +
|
||||||
|
"FROM gtb_anag " +
|
||||||
|
"LEFT OUTER JOIN jtb_comt ON gtb_anag.cod_anag = jtb_comt.cod_anag " +
|
||||||
|
"INNER JOIN vtb_clie ON gtb_anag.cod_anag = vtb_clie.cod_anag " +
|
||||||
|
"WHERE vtb_clie.flag_stato = 'A' " +
|
||||||
|
"ORDER BY rag_soc";
|
||||||
|
|
||||||
|
this.systemRESTConsumer.<ArrayList<HashMap<String, Object>>>processSql(sqlClienti, typeOfObjectsList, value -> {
|
||||||
|
var availableClienti = new ArrayList<DialogAskClienteClienteDTO>();
|
||||||
|
|
||||||
|
Stream.of(value)
|
||||||
|
.groupBy(x -> x.get("codAnag").toString() + " " + x.get("ragSoc").toString())
|
||||||
|
.forEach(x -> {
|
||||||
|
DialogAskClienteClienteDTO dialogAskClienteClienteDTO = new DialogAskClienteClienteDTO();
|
||||||
|
dialogAskClienteClienteDTO.setCodAnag(UtilityHashMap.getValueIfExists(x.getValue().get(0), "codAnag"));
|
||||||
|
dialogAskClienteClienteDTO.setRagSoc(UtilityHashMap.getValueIfExists(x.getValue().get(0), "ragSoc"));
|
||||||
|
|
||||||
|
for (HashMap<String, Object> group : x.getValue()) {
|
||||||
|
if (group.containsKey("codJcom")) {
|
||||||
|
dialogAskClienteClienteDTO.getCodJcoms().add(UtilityHashMap.getValueIfExists(group, "codJcom"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
availableClienti.add(dialogAskClienteClienteDTO);
|
||||||
|
});
|
||||||
|
|
||||||
|
viewModel.setAvailableClienti(availableClienti);
|
||||||
|
onComplete.run();
|
||||||
|
}, ex -> {
|
||||||
|
onAbort.run();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initDestinatari(DialogAskCliente_Page2ViewModel viewModel, Runnable onComplete, Runnable onAbort) {
|
||||||
|
String sql = "SELECT vtb_dest.cod_anag,\n" +
|
||||||
|
" cod_vdes,\n" +
|
||||||
|
" destinatario,\n" +
|
||||||
|
" indirizzo,\n" +
|
||||||
|
" cap,\n" +
|
||||||
|
" citta,\n" +
|
||||||
|
" prov,\n" +
|
||||||
|
" nazione\n" +
|
||||||
|
"FROM vtb_dest\n" +
|
||||||
|
"INNER JOIN vtb_clie ON vtb_clie.cod_anag = vtb_dest.cod_anag\n" +
|
||||||
|
"WHERE vtb_clie.flag_stato = 'A'";
|
||||||
|
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<DialogAskClienteDestinatarioDTO>>() {
|
||||||
|
}.getType();
|
||||||
|
this.systemRESTConsumer.<ArrayList<DialogAskClienteDestinatarioDTO>>processSql(sql, typeOfObjectsList, value -> {
|
||||||
|
viewModel.setAvailableDestinatari(value);
|
||||||
|
|
||||||
|
onComplete.run();
|
||||||
|
}, ex -> {
|
||||||
|
onAbort.run();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||||
mAdapter.onDismiss();
|
mAdapter.onDismiss();
|
||||||
if(!mIsClienteSelected) {
|
if (!mIsClienteSelected) {
|
||||||
this.mOnAbort.run();
|
this.mOnAbort.run();
|
||||||
}
|
}
|
||||||
super.onDismiss(dialog);
|
super.onDismiss(dialog);
|
||||||
|
|||||||
@ -10,12 +10,9 @@ import androidx.databinding.ViewDataBinding;
|
|||||||
|
|
||||||
import com.annimon.stream.Optional;
|
import com.annimon.stream.Optional;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.gson.reflect.TypeToken;
|
|
||||||
import com.tfb.fbtoast.FBToast;
|
import com.tfb.fbtoast.FBToast;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
@ -24,11 +21,8 @@ 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.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.rest.consumers.ISimpleOperationCallback;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityHashMap;
|
|
||||||
import it.integry.integrywmsnative.databinding.DialogAskClientePage1Binding;
|
import it.integry.integrywmsnative.databinding.DialogAskClientePage1Binding;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteClienteDTO;
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteClienteDTO;
|
||||||
|
|
||||||
@ -40,10 +34,12 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
private int mBarcodeScannerInstanceID;
|
private int mBarcodeScannerInstanceID;
|
||||||
|
|
||||||
private ArrayList<DialogAskClienteClienteDTO> availableClienti;
|
private ArrayList<DialogAskClienteClienteDTO> availableClienti;
|
||||||
private ObservableArrayList<String> codJcoms = new ObservableArrayList<>();
|
private final ObservableArrayList<String> codJcoms = new ObservableArrayList<>();
|
||||||
|
|
||||||
|
private Runnable onConfirmClickListener;
|
||||||
|
private Runnable onAbortClickListener;
|
||||||
|
|
||||||
public DialogAskCliente_Page1ViewModel() {
|
public DialogAskCliente_Page1ViewModel() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -56,54 +52,33 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
this.mBinding = (DialogAskClientePage1Binding) binding;
|
this.mBinding = (DialogAskClientePage1Binding) binding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAvailableClienti(ArrayList<DialogAskClienteClienteDTO> availableClienti) {
|
||||||
|
this.availableClienti = availableClienti;
|
||||||
|
initializeAdapter(availableClienti);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onShow() {
|
public void onShow() {
|
||||||
|
|
||||||
String sql = "SELECT gtb_anag.cod_anag, rag_soc, jtb_comt.cod_jcom " +
|
|
||||||
"FROM gtb_anag " +
|
|
||||||
"LEFT OUTER JOIN jtb_comt ON gtb_anag.cod_anag = jtb_comt.cod_anag " +
|
|
||||||
"INNER JOIN vtb_clie ON gtb_anag.cod_anag = vtb_clie.cod_anag " +
|
|
||||||
"WHERE vtb_clie.flag_stato = 'A' " +
|
|
||||||
"ORDER BY rag_soc";
|
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<HashMap<String, Object>>>() { }.getType();
|
|
||||||
|
|
||||||
SystemRESTConsumer.processSqlStatic(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<HashMap<String, Object>>>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(ArrayList<HashMap<String, Object>> value) {
|
|
||||||
|
|
||||||
availableClienti = new ArrayList<>();
|
|
||||||
|
|
||||||
Stream.of(value)
|
|
||||||
.groupBy(x -> x.get("codAnag").toString() + " " + x.get("ragSoc").toString())
|
|
||||||
.forEach(x -> {
|
|
||||||
DialogAskClienteClienteDTO dialogAskClienteClienteDTO = new DialogAskClienteClienteDTO();
|
|
||||||
dialogAskClienteClienteDTO.setCodAnag(UtilityHashMap.getValueIfExists(x.getValue().get(0), "codAnag"));
|
|
||||||
dialogAskClienteClienteDTO.setRagSoc(UtilityHashMap.getValueIfExists(x.getValue().get(0), "ragSoc"));
|
|
||||||
|
|
||||||
for (HashMap<String, Object> group : x.getValue()) {
|
|
||||||
if (group.containsKey("codJcom")) {
|
|
||||||
dialogAskClienteClienteDTO.getCodJcoms().add(UtilityHashMap.getValueIfExists(group, "codJcom"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
availableClienti.add(dialogAskClienteClienteDTO);
|
|
||||||
});
|
|
||||||
|
|
||||||
initializeAdapter(availableClienti);
|
|
||||||
|
|
||||||
mBarcodeScannerInstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
mBarcodeScannerInstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
.setOnScanSuccessfull(onScanSuccessful)
|
.setOnScanSuccessfull(onScanSuccessful)
|
||||||
.setOnScanFailed(ex -> UtilityExceptions.defaultException(mContext, ex, false)));
|
.setOnScanFailed(ex -> UtilityExceptions.defaultException(mContext, ex, false)));
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
|
|
||||||
|
this.mBinding.buttonYes.setOnClickListener(v -> {
|
||||||
|
if (validateCliente()) {
|
||||||
|
this.resetClienteError();
|
||||||
|
BarcodeManager.removeCallback(mBarcodeScannerInstanceID);
|
||||||
|
if (onConfirmClickListener != null) onConfirmClickListener.run();
|
||||||
|
} else {
|
||||||
|
this.setClienteError(mContext.getResources().getText(R.string.not_valid_customer_error).toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.mBinding.buttonNo.setOnClickListener(v -> {
|
||||||
|
if (onAbortClickListener != null) onAbortClickListener.run();
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -113,16 +88,7 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOnConfirmClickListener(Runnable onConfirm) {
|
public void setOnConfirmClickListener(Runnable onConfirm) {
|
||||||
this.mBinding.buttonYes.setOnClickListener(v -> {
|
this.onConfirmClickListener = onConfirm;
|
||||||
if (validateCliente()) {
|
|
||||||
this.resetClienteError();
|
|
||||||
BarcodeManager.removeCallback(mBarcodeScannerInstanceID);
|
|
||||||
if (onConfirm != null) onConfirm.run();
|
|
||||||
} else {
|
|
||||||
this.setClienteError(mContext.getResources().getText(R.string.not_valid_customer_error).toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -139,7 +105,7 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
} else {
|
} else {
|
||||||
DialogAskClienteClienteDTO resultCodJcom = searchBarcodeInCodJcom(barcode);
|
DialogAskClienteClienteDTO resultCodJcom = searchBarcodeInCodJcom(barcode);
|
||||||
|
|
||||||
if(resultCodJcom != null) {
|
if (resultCodJcom != null) {
|
||||||
mBinding.dropdownCliente.setText(resultCodJcom.toString());
|
mBinding.dropdownCliente.setText(resultCodJcom.toString());
|
||||||
refreshCodJcoms(resultCodJcom);
|
refreshCodJcoms(resultCodJcom);
|
||||||
mBinding.dropdownCommessa.setText(barcode);
|
mBinding.dropdownCommessa.setText(barcode);
|
||||||
@ -174,9 +140,7 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOnAbortClickListener(Runnable onAbort) {
|
public void setOnAbortClickListener(Runnable onAbort) {
|
||||||
this.mBinding.buttonNo.setOnClickListener(v -> {
|
this.onAbortClickListener = onAbort;
|
||||||
if (onAbort != null) onAbort.run();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -213,7 +177,7 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
|
|
||||||
|
|
||||||
private boolean validateCliente() {
|
private boolean validateCliente() {
|
||||||
if(SettingsManager.iDB().isFlagAllowEmptyClienteInPickingLibero() && mBinding.inputCliente.getEditText().getText().toString().trim().length() == 0) {
|
if (SettingsManager.iDB().isFlagAllowEmptyClienteInPickingLibero() && mBinding.inputCliente.getEditText().getText().toString().trim().length() == 0) {
|
||||||
return true;
|
return true;
|
||||||
} else return getCurrentCliente() != null;
|
} else return getCurrentCliente() != null;
|
||||||
}
|
}
|
||||||
@ -223,7 +187,7 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
.filter(x -> x.getRagSoc().equalsIgnoreCase(mBinding.inputCliente.getEditText().getText().toString()))
|
.filter(x -> x.getRagSoc().equalsIgnoreCase(mBinding.inputCliente.getEditText().getText().toString()))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if(result.isPresent()) return result.get().getCodAnag();
|
if (result.isPresent()) return result.get().getCodAnag();
|
||||||
else return null;
|
else return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,7 +198,7 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
.map(DialogAskClienteClienteDTO::getCodJcoms)
|
.map(DialogAskClienteClienteDTO::getCodJcoms)
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if(result.isPresent() && Stream.of(result.get()).anyMatch(x -> x.equalsIgnoreCase(mBinding.inputCommessa.getEditText().getText().toString()))) {
|
if (result.isPresent() && Stream.of(result.get()).anyMatch(x -> x.equalsIgnoreCase(mBinding.inputCommessa.getEditText().getText().toString()))) {
|
||||||
return mBinding.inputCommessa.getEditText().getText().toString();
|
return mBinding.inputCommessa.getEditText().getText().toString();
|
||||||
} else return null;
|
} else return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,28 +5,24 @@ import android.widget.AutoCompleteTextView;
|
|||||||
|
|
||||||
import androidx.databinding.ViewDataBinding;
|
import androidx.databinding.ViewDataBinding;
|
||||||
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
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.consumers.ISimpleOperationCallback;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
|
||||||
import it.integry.integrywmsnative.databinding.DialogAskClientePage2Binding;
|
import it.integry.integrywmsnative.databinding.DialogAskClientePage2Binding;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteDestinatarioDTO;
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteDestinatarioDTO;
|
||||||
|
|
||||||
public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewModel {
|
public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewModel {
|
||||||
|
|
||||||
|
|
||||||
private DialogAskClientePage2Binding mBinding;
|
private DialogAskClientePage2Binding mBinding;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
|
||||||
private Runnable mOnConfirm;
|
private Runnable mOnConfirm;
|
||||||
|
private Runnable mOnAbort;
|
||||||
|
|
||||||
private List<DialogAskClienteDestinatarioDTO> availableDestinatari;
|
private ArrayList<DialogAskClienteDestinatarioDTO> availableDestinatari;
|
||||||
|
|
||||||
private String mCodAnag;
|
private String mCodAnag;
|
||||||
|
|
||||||
@ -39,6 +35,10 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
|||||||
this.mBinding = (DialogAskClientePage2Binding) binding;
|
this.mBinding = (DialogAskClientePage2Binding) binding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAvailableDestinatari(ArrayList<DialogAskClienteDestinatarioDTO> availableDestinatari) {
|
||||||
|
this.availableDestinatari = availableDestinatari;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setContext(Context context) {
|
public void setContext(Context context) {
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
@ -46,29 +46,33 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onShow() {
|
public void onShow() {
|
||||||
String sql = "SELECT cod_anag, cod_vdes, destinatario, indirizzo, cap, citta, prov, nazione " +
|
var filteredDestinatari = availableDestinatari != null ? Stream.of(availableDestinatari)
|
||||||
"FROM vtb_dest " +
|
.filter(x -> x.getCodAnag().equalsIgnoreCase(mCodAnag))
|
||||||
"WHERE cod_anag = " + UtilityDB.valueToString(mCodAnag);
|
.toList()
|
||||||
|
: null;
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<DialogAskClienteDestinatarioDTO>>() {
|
|
||||||
}.getType();
|
|
||||||
SystemRESTConsumer.processSqlStatic(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<DialogAskClienteDestinatarioDTO>>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(ArrayList<DialogAskClienteDestinatarioDTO> value) {
|
|
||||||
availableDestinatari = value;
|
|
||||||
initializeAdapter(value);
|
|
||||||
|
|
||||||
if(value == null || value.size() == 0) {
|
if (filteredDestinatari == null || filteredDestinatari.size() == 0) {
|
||||||
mOnConfirm.run();
|
mOnConfirm.run();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
initializeAdapter(filteredDestinatari);
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
|
|
||||||
|
|
||||||
|
this.mBinding.buttonYes.setOnClickListener(v -> {
|
||||||
|
if (validateDestinatario()) {
|
||||||
|
this.resetClienteError();
|
||||||
|
if (mOnConfirm != null) mOnConfirm.run();
|
||||||
|
} else {
|
||||||
|
this.setClienteError(mContext.getResources().getText(R.string.not_valid_recipient_error).toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
this.mBinding.buttonNo.setOnClickListener(v -> {
|
||||||
|
if (mOnAbort != null) mOnAbort.run();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -78,22 +82,11 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
|||||||
@Override
|
@Override
|
||||||
public void setOnConfirmClickListener(Runnable onConfirm) {
|
public void setOnConfirmClickListener(Runnable onConfirm) {
|
||||||
this.mOnConfirm = onConfirm;
|
this.mOnConfirm = onConfirm;
|
||||||
this.mBinding.buttonYes.setOnClickListener(v -> {
|
|
||||||
if (validateDestinatario()) {
|
|
||||||
this.resetClienteError();
|
|
||||||
if (onConfirm != null) onConfirm.run();
|
|
||||||
} else {
|
|
||||||
this.setClienteError(mContext.getResources().getText(R.string.not_valid_recipient_error).toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOnAbortClickListener(Runnable onAbort) {
|
public void setOnAbortClickListener(Runnable onAbort) {
|
||||||
this.mBinding.buttonNo.setOnClickListener(v -> {
|
this.mOnAbort = onAbort;
|
||||||
if (onAbort != null) onAbort.run();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCodAnag(String codAnag) {
|
public void setCodAnag(String codAnag) {
|
||||||
@ -101,8 +94,7 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initializeAdapter(ArrayList<DialogAskClienteDestinatarioDTO> items) {
|
private void initializeAdapter(List<DialogAskClienteDestinatarioDTO> items) {
|
||||||
|
|
||||||
DialogAskCliente_Page2_ArrayAdapter adapter = new DialogAskCliente_Page2_ArrayAdapter(mContext, items);
|
DialogAskCliente_Page2_ArrayAdapter adapter = new DialogAskCliente_Page2_ArrayAdapter(mContext, items);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ public class DialogAskCliente_Page2_ArrayAdapter extends ArrayAdapter<DialogAskC
|
|||||||
|
|
||||||
private ListFilter listFilter = new ListFilter();
|
private ListFilter listFilter = new ListFilter();
|
||||||
|
|
||||||
public DialogAskCliente_Page2_ArrayAdapter(@NonNull Context context, @NonNull ArrayList<DialogAskClienteDestinatarioDTO> list) {
|
public DialogAskCliente_Page2_ArrayAdapter(@NonNull Context context, @NonNull List<DialogAskClienteDestinatarioDTO> list) {
|
||||||
super(context, 0 , list);
|
super(context, 0 , list);
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mDataset = list;
|
mDataset = list;
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts;
|
package it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts;
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
@ -42,6 +41,7 @@ import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.DialogChooseArtsFromListaArtsLayoutBinding;
|
import it.integry.integrywmsnative.databinding.DialogChooseArtsFromListaArtsLayoutBinding;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
|
||||||
public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
private final List<DialogChooseArtsFromListaArtsItemModel> mDataset;
|
private final List<DialogChooseArtsFromListaArtsItemModel> mDataset;
|
||||||
|
|
||||||
private int mBarcodeScannerIstanceID;
|
private int mBarcodeScannerIstanceID;
|
||||||
private Dialog mCurrentProgress;
|
private DialogProgressView mCurrentProgress;
|
||||||
private MtbAart selectedArt;
|
private MtbAart selectedArt;
|
||||||
|
|
||||||
public static DialogChooseArtsFromListaArts newInstance(List<MtbColr> listaMtbColr, RunnableArgs<List<MtbColr>> onItemsChoosed, Runnable onAbort) {
|
public static DialogChooseArtsFromListaArts newInstance(List<MtbColr> listaMtbColr, RunnableArgs<List<MtbColr>> onItemsChoosed, Runnable onAbort) {
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import android.view.LayoutInflater;
|
|||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import com.annimon.stream.Optional;
|
import com.annimon.stream.Optional;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
@ -24,24 +25,25 @@ import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
import it.integry.integrywmsnative.databinding.DialogInputPesoLuBinding;
|
import it.integry.integrywmsnative.databinding.DialogInputPesoLuBinding;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
|
||||||
public class DialogInputPeso {
|
public class DialogInputPeso {
|
||||||
|
|
||||||
|
|
||||||
private Context mContext;
|
private final FragmentActivity mContext;
|
||||||
private DialogInputPesoLuBinding mBindings;
|
private final DialogInputPesoLuBinding mBindings;
|
||||||
private DialogInputPesoViewModel mViewModel;
|
private final DialogInputPesoViewModel mViewModel;
|
||||||
private Dialog currentDialog;
|
private final Dialog currentDialog;
|
||||||
|
|
||||||
private List<MtbTCol> codTcolList = null;
|
private List<MtbTCol> codTcolList = null;
|
||||||
private ArrayAdapter<String> codTcolArrayAdapter = null;
|
private ArrayAdapter<String> codTcolArrayAdapter = null;
|
||||||
|
|
||||||
public static Dialog make(final Context context, String codTcol, BigDecimal netWeight, BigDecimal grossWeight, RunnableArgsss<String, BigDecimal, BigDecimal> onDialogDismiss) {
|
public static Dialog make(final FragmentActivity context, String codTcol, BigDecimal netWeight, BigDecimal grossWeight, RunnableArgsss<String, BigDecimal, BigDecimal> onDialogDismiss) {
|
||||||
return new DialogInputPeso(context, codTcol, netWeight, grossWeight, onDialogDismiss).currentDialog;
|
return new DialogInputPeso(context, codTcol, netWeight, grossWeight, onDialogDismiss).currentDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private DialogInputPeso(final Context context, String codTcol, BigDecimal netWeight, BigDecimal grossWeight, RunnableArgsss<String, BigDecimal, BigDecimal> onDialogDismiss) {
|
private DialogInputPeso(final FragmentActivity context, String codTcol, BigDecimal netWeight, BigDecimal grossWeight, RunnableArgsss<String, BigDecimal, BigDecimal> onDialogDismiss) {
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
|
|
||||||
|
|
||||||
@ -91,7 +93,7 @@ public class DialogInputPeso {
|
|||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
|
|
||||||
final Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
final DialogProgressView progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
MagazzinoRESTConsumer.getTipiColloStatic(codTcols -> {
|
MagazzinoRESTConsumer.getTipiColloStatic(codTcols -> {
|
||||||
this.codTcolList = codTcols;
|
this.codTcolList = codTcols;
|
||||||
|
|||||||
@ -23,13 +23,12 @@ import com.google.android.material.textfield.TextInputLayout;
|
|||||||
import com.pedromassango.doubleclick.DoubleClick;
|
import com.pedromassango.doubleclick.DoubleClick;
|
||||||
import com.pedromassango.doubleclick.DoubleClickListener;
|
import com.pedromassango.doubleclick.DoubleClickListener;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
import it.integry.integrywmsnative.MainApplication;
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
@ -47,14 +46,15 @@ import it.integry.integrywmsnative.core.utility.UtilityObservable;
|
|||||||
import it.integry.integrywmsnative.databinding.DialogInputQuantityV2Binding;
|
import it.integry.integrywmsnative.databinding.DialogInputQuantityV2Binding;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class DialogInputQuantityV2View extends BaseDialogFragment implements DialogInputQuantityV2ViewModel.Listener {
|
public class DialogInputQuantityV2View extends BaseDialogFragment implements DialogInputQuantityV2ViewModel.Listener {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
DialogInputQuantityV2ViewModel mViewModel;
|
DialogInputQuantityV2ViewModel mViewModel;
|
||||||
|
|
||||||
private final DialogInputQuantityV2DTO mDialogInputQuantityV2DTO;
|
private DialogInputQuantityV2DTO mDialogInputQuantityV2DTO;
|
||||||
private final RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> mOnComplete;
|
private RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> mOnComplete;
|
||||||
private final Runnable mOnAbort;
|
private Runnable mOnAbort;
|
||||||
|
|
||||||
public ObservableField<Integer> currentTextNumCnfToTake = new ObservableField<>(0);
|
public ObservableField<Integer> currentTextNumCnfToTake = new ObservableField<>(0);
|
||||||
public ObservableField<Integer> currentTextNumPezziToTake = new ObservableField<>(0);
|
public ObservableField<Integer> currentTextNumPezziToTake = new ObservableField<>(0);
|
||||||
@ -86,17 +86,22 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
private boolean mEnableDataCallback = true;
|
private boolean mEnableDataCallback = true;
|
||||||
|
|
||||||
private int mBarcodeScannerIstanceID;
|
private int mBarcodeScannerIstanceID;
|
||||||
|
private boolean mFirstStart = true;
|
||||||
|
|
||||||
public static DialogInputQuantityV2View newInstance(@NotNull DialogInputQuantityV2DTO dialogInputQuantityV2DTO, @NotNull RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> onComplete, @NotNull Runnable onAbort) {
|
|
||||||
return new DialogInputQuantityV2View(dialogInputQuantityV2DTO, onComplete, onAbort);
|
public DialogInputQuantityV2View setDialogInputQuantityV2DTO(DialogInputQuantityV2DTO mDialogInputQuantityV2DTO) {
|
||||||
|
this.mDialogInputQuantityV2DTO = mDialogInputQuantityV2DTO;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DialogInputQuantityV2View(@NotNull DialogInputQuantityV2DTO dialogInputQuantityV2DTO, @NotNull RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> onComplete, @NotNull Runnable onAbort) {
|
public DialogInputQuantityV2View setOnComplete(RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> mOnComplete) {
|
||||||
super();
|
this.mOnComplete = mOnComplete;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
this.mDialogInputQuantityV2DTO = dialogInputQuantityV2DTO;
|
public DialogInputQuantityV2View setOnAbort(Runnable mOnAbort) {
|
||||||
this.mOnComplete = onComplete;
|
this.mOnAbort = mOnAbort;
|
||||||
this.mOnAbort = onAbort;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -159,6 +164,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
this.onLoadingEnded();
|
||||||
return mBindings.getRoot();
|
return mBindings.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,7 +208,11 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
|
|
||||||
|
// if(!mFirstStart) {
|
||||||
this.init();
|
this.init();
|
||||||
|
// mFirstStart = false;
|
||||||
|
// }
|
||||||
|
|
||||||
int onNumCnfInputChanged = SettingsManager.iDB().getOnNumCnfInputChanged();
|
int onNumCnfInputChanged = SettingsManager.iDB().getOnNumCnfInputChanged();
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:fab="http://schemas.android.com/apk/res-auto">
|
xmlns:fab="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<import type="android.view.View" />
|
<import type="android.view.View" />
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="viewModel"
|
name="viewModel"
|
||||||
type="it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity" />
|
type="it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity" />
|
||||||
@ -18,64 +20,61 @@
|
|||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/linearLayout2"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/full_white"
|
android:background="@color/full_white"
|
||||||
android:orientation="vertical"
|
android:descendantFocusability="blocksDescendants">
|
||||||
android:descendantFocusability="blocksDescendants"
|
|
||||||
>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/full_white"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingTop="8dp"
|
|
||||||
tools:context=".gest.contenuto_bancale.ContenutoBancaleActivity">
|
|
||||||
|
|
||||||
<it.integry.integrywmsnative.ui.ElevatedToolbar
|
<it.integry.integrywmsnative.ui.ElevatedToolbar
|
||||||
android:id="@+id/elevated_toolbar"
|
android:id="@+id/elevated_toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?actionBarSize">
|
android:layout_height="?actionBarSize">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/toolbar_title"
|
android:id="@+id/toolbar_title"
|
||||||
|
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:text="modifica ordine"
|
android:layout_gravity="start"
|
||||||
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
|
tools:text="modifica ordine" />
|
||||||
android:layout_gravity="start" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/add_extra_items_toolbar"
|
android:id="@+id/add_extra_items_toolbar"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_gravity="end"
|
android:layout_gravity="end"
|
||||||
android:background="@drawable/ripple_effect"
|
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:src="@drawable/ic_search_black_24dp"
|
android:background="@drawable/ripple_effect"
|
||||||
android:onClick="@{()->viewModel.manualSearch()}"
|
android:onClick="@{()->viewModel.manualSearch()}"
|
||||||
android:tint="@color/colorPrimaryGray"/>
|
android:src="@drawable/ic_search_black_24dp"
|
||||||
|
android:tint="@color/colorPrimaryGray" />
|
||||||
</androidx.appcompat.widget.Toolbar>
|
</androidx.appcompat.widget.Toolbar>
|
||||||
|
|
||||||
</it.integry.integrywmsnative.ui.ElevatedToolbar>
|
</it.integry.integrywmsnative.ui.ElevatedToolbar>
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/header_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:background="@drawable/gray_detail_background_round8"
|
android:background="@drawable/gray_detail_background_round8"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/elevated_toolbar"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:padding="16dp">
|
android:padding="16dp">
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
@ -84,7 +83,7 @@
|
|||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="ordine: "
|
android:text="ordine:"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
|
|
||||||
@ -93,13 +92,14 @@
|
|||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tools:text="22 ottobre 2018" />
|
tools:text="22 ottobre 2018" />
|
||||||
</LinearLayout>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
@ -108,7 +108,7 @@
|
|||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Griglia "
|
android:text="Griglia"
|
||||||
android:textColor="@android:color/black" />
|
android:textColor="@android:color/black" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
@ -116,13 +116,14 @@
|
|||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:paddingEnd="2dp"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
android:textStyle="italic"
|
android:textStyle="italic"
|
||||||
tools:text="4SECCO" />
|
tools:text="4SAPORIV" />
|
||||||
</LinearLayout>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
@ -143,58 +144,63 @@
|
|||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tools:text="10" />
|
tools:text="10" />
|
||||||
</LinearLayout>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/articoli_ordine_list"
|
android:id="@+id/articoli_ordine_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:layout_marginBottom="92dp"
|
android:layout_marginBottom="92dp"
|
||||||
android:paddingStart="2dp"
|
android:paddingStart="2dp"
|
||||||
android:paddingEnd="2dp" />
|
android:paddingEnd="2dp"
|
||||||
<LinearLayout
|
android:clipToPadding="false"
|
||||||
|
android:paddingBottom="72dp"
|
||||||
|
android:scrollbars="vertical"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/header_content"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:id="@+id/scan_art_spinner"
|
android:id="@+id/scan_art_spinner"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="24dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
android:orientation="horizontal">
|
app:layout_constraintTop_toBottomOf="@id/header_content"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/progressBar"
|
android:id="@+id/progressBar"
|
||||||
style="?android:attr/progressBarStyle"
|
style="?android:attr/progressBarStyle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="16sp"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginEnd="12dp"
|
android:layout_marginEnd="12dp"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
style="@style/AppTheme.NewMaterial.Text"
|
android:text="@string/scan_item"
|
||||||
android:text="@string/scan_item"/>
|
android:textSize="16sp" />
|
||||||
</LinearLayout>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<com.github.clans.fab.FloatingActionMenu
|
<com.github.clans.fab.FloatingActionMenu
|
||||||
android:id="@+id/close_activity_fab"
|
android:id="@+id/close_activity_fab"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
app:layout_anchor="@+id/linearLayout2"
|
android:layout_alignParentBottom="true"
|
||||||
app:layout_anchorGravity="center"
|
app:layout_anchorGravity="center"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@ -254,5 +260,12 @@
|
|||||||
|
|
||||||
|
|
||||||
</com.github.clans.fab.FloatingActionMenu>
|
</com.github.clans.fab.FloatingActionMenu>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
||||||
|
|
||||||
</layout>
|
</layout>
|
||||||
@ -1,63 +1,24 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
<data>
|
|
||||||
<import type="android.text.Html" />
|
|
||||||
<import type="it.integry.integrywmsnative.R" />
|
|
||||||
<variable
|
|
||||||
name="mContext"
|
|
||||||
type="android.content.Context" />
|
|
||||||
</data>
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical" android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
app:cardCornerRadius="12dp"
|
app:cardCornerRadius="12dp"
|
||||||
app:cardElevation="0dp">
|
app:cardElevation="0dp">
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<!--<RelativeLayout-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:background="@color/light_blue_300"-->
|
|
||||||
<!--android:gravity="center_horizontal">-->
|
|
||||||
|
|
||||||
<!--<ImageView-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:src="@drawable/ic_error_white_24dp"-->
|
|
||||||
<!--android:layout_margin="24dp"/>-->
|
|
||||||
|
|
||||||
<!--</RelativeLayout>-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingTop="24dp"
|
|
||||||
android:paddingLeft="24dp"
|
|
||||||
android:paddingRight="24dp">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<it.integry.integrywmsnative.ui.DeactivatableViewPager
|
<it.integry.integrywmsnative.ui.DeactivatableViewPager
|
||||||
android:id="@+id/viewpager"
|
android:id="@+id/viewpager"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="0dp"
|
||||||
|
android:layout_margin="24dp" />
|
||||||
|
|
||||||
</it.integry.integrywmsnative.ui.DeactivatableViewPager>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
</layout>
|
</layout>
|
||||||
@ -3,55 +3,59 @@
|
|||||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="viewmodel"
|
name="viewmodel"
|
||||||
type="it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page1ViewModel" />
|
type="it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page1ViewModel" />
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center"
|
|
||||||
android:layout_margin="16dp">
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/title_text"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
|
||||||
android:text="@string/customer"
|
|
||||||
android:gravity="center_horizontal"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/description_text"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/TextViewMaterial"
|
|
||||||
android:text="@string/select_a_customer_message"
|
|
||||||
android:gravity="left"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:layout_marginBottom="8dp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/title_text"
|
||||||
|
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text="@string/customer"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/description_text"
|
||||||
|
style="@style/TextViewMaterial"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="@string/select_a_customer_message"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/title_text" />
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/input_cliente"
|
android:id="@+id/input_cliente"
|
||||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/customer">
|
android:hint="@string/customer"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/description_text">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||||
android:id="@+id/dropdown_cliente"
|
android:id="@+id/dropdown_cliente"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:ellipsize="end"
|
||||||
android:ellipsize="end"/>
|
android:singleLine="true" />
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
@ -60,64 +64,55 @@
|
|||||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/job">
|
android:hint="@string/job"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/input_cliente">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||||
android:id="@+id/dropdown_commessa"
|
android:id="@+id/dropdown_commessa"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:ellipsize="end"
|
||||||
android:ellipsize="end"/>
|
android:singleLine="true" />
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:layout_marginBottom="8dp">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
<androidx.constraintlayout.widget.Guideline
|
||||||
android:id="@+id/center_buttons_guideline"
|
android:id="@+id/center_buttons_guideline"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintGuide_percent="0.5"/>
|
app:layout_constraintGuide_percent="0.5" />
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/button_no"
|
android:id="@+id/button_no"
|
||||||
|
style="@style/Button.PrimaryOutline"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/Button.PrimaryOutline"
|
android:layout_margin="8dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:text="@string/abort"
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
app:strokeColor="@color/colorPrimary"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/center_buttons_guideline"
|
app:layout_constraintEnd_toStartOf="@id/center_buttons_guideline"
|
||||||
android:text="@string/abort"/>
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/input_commessa"
|
||||||
|
app:strokeColor="@color/colorPrimary" />
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/button_yes"
|
android:id="@+id/button_yes"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/Button.PrimaryFull"
|
android:layout_margin="8dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:text="@string/confirm"
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/center_buttons_guideline"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:text="@string/confirm"/>
|
app:layout_constraintStart_toStartOf="@id/center_buttons_guideline"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/input_commessa" />
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</layout>
|
</layout>
|
||||||
@ -3,104 +3,97 @@
|
|||||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="viewmodel"
|
name="viewmodel"
|
||||||
type="it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page2ViewModel" />
|
type="it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page2ViewModel" />
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:orientation="vertical">
|
||||||
android:layout_margin="16dp">
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/title_text"
|
android:id="@+id/title_text"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
||||||
android:text="@string/recipient"
|
|
||||||
android:gravity="center_horizontal"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/description_text"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/TextViewMaterial"
|
android:gravity="center_horizontal"
|
||||||
android:text="@string/select_a_recipient_message"
|
android:text="@string/recipient"
|
||||||
android:gravity="left"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:layout_marginTop="16dp"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:layout_marginBottom="8dp" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<RelativeLayout
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/description_text"
|
||||||
|
style="@style/TextViewMaterial"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:gravity="start"
|
||||||
|
android:text="@string/select_a_recipient_message"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/title_text" />
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/input_destinatario"
|
android:id="@+id/input_destinatario"
|
||||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/recipient">
|
android:hint="@string/recipient"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/description_text">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||||
android:id="@+id/dropdown_destinatario"
|
android:id="@+id/dropdown_destinatario"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:ellipsize="end"
|
||||||
android:ellipsize="end"/>
|
android:singleLine="true" />
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:layout_marginBottom="8dp">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
<androidx.constraintlayout.widget.Guideline
|
||||||
android:id="@+id/center_buttons_guideline"
|
android:id="@+id/center_buttons_guideline"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintGuide_percent="0.5"/>
|
app:layout_constraintGuide_percent="0.5" />
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/button_no"
|
android:id="@+id/button_no"
|
||||||
|
style="@style/Button.PrimaryOutline"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/Button.PrimaryOutline"
|
android:layout_margin="8dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:text="@string/abort"
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
app:strokeColor="@color/colorPrimary"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/center_buttons_guideline"
|
app:layout_constraintEnd_toStartOf="@id/center_buttons_guideline"
|
||||||
android:text="@string/abort"/>
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/input_destinatario"
|
||||||
|
app:strokeColor="@color/colorPrimary" />
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/button_yes"
|
android:id="@+id/button_yes"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/Button.PrimaryFull"
|
android:layout_margin="8dp"
|
||||||
android:layout_marginLeft="8dp"
|
android:text="@string/confirm"
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/center_buttons_guideline"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:text="@string/confirm"/>
|
app:layout_constraintStart_toStartOf="@id/center_buttons_guideline"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/input_destinatario" />
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</layout>
|
</layout>
|
||||||
@ -0,0 +1,138 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<import type="it.integry.integrywmsnative.R" />
|
||||||
|
|
||||||
|
<import type="android.view.View" />
|
||||||
|
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||||
|
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="row"
|
||||||
|
type="it.integry.integrywmsnative.gest.contab_doc_interni.dto.DialogChooseRowFromListaDocRowsListModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:background="@drawable/bg_checked_layout"
|
||||||
|
app:backgroundTintResID="@{row.checked.get() ? R.color.bg_checked_layout : android.R.color.transparent}"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginBottom="2dp"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:onClick="@{() -> row.toggleCheck()}">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatCheckBox
|
||||||
|
android:id="@+id/checkbox"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
app:checked="@{row.checked}" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/linearLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_toEndOf="@id/checkbox"
|
||||||
|
android:layout_toStartOf="@id/qta_box">
|
||||||
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/bottom_sheet_actions_delete_btn"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:background="@android:color/white"
|
||||||
|
android:paddingStart="6dp"
|
||||||
|
android:paddingEnd="6dp"
|
||||||
|
android:src="@drawable/ic_baseline_new_24"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:tint="@color/orange_600"
|
||||||
|
android:visibility="@{row.isNew ? View.VISIBLE : View.GONE}" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{row.codMart}"
|
||||||
|
android:textColor="@color/colorPrimary"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="COD MART" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{row.barcode}"
|
||||||
|
android:textColor="@color/red_600"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="0000000000000" />
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:text="@{row.descrizione}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="16sp"
|
||||||
|
tools:text="Descrizione lunga articolo" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/qta_box"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="12dp"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/qta_textview"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/badge_round_corner"
|
||||||
|
android:backgroundTint="@color/colorPrimary"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:paddingBottom="2dp"
|
||||||
|
android:textAllCaps="true"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="@{row.qtaOrdReadable}"
|
||||||
|
tools:text="280.45\nCONF" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</layout>
|
||||||
@ -0,0 +1,141 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<import type="android.view.View" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="view"
|
||||||
|
type="it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsView" />
|
||||||
|
|
||||||
|
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/base_root"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:cardCornerRadius="12dp"
|
||||||
|
app:cardElevation="0dp">
|
||||||
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingTop="24dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_above="@id/buttons"
|
||||||
|
android:layout_below="@id/title_container"
|
||||||
|
android:paddingTop="8dp">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/empty_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/no_item_to_pick_text"
|
||||||
|
android:textColor="@color/empty_view_gray"
|
||||||
|
android:textSize="20sp" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/lista_doc_rows"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/title_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title_text"
|
||||||
|
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text="@string/doc_interni_select_row_to_edit" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/buttons"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:paddingBottom="8dp">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline
|
||||||
|
android:id="@+id/center_guideline"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintGuide_percent="0.5" />
|
||||||
|
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/negative_button"
|
||||||
|
style="@style/Button.PrimaryOutline"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:text="@string/abort"
|
||||||
|
app:layout_constrainedHeight="true"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/center_guideline"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/positive_button"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
app:layout_constrainedHeight="true"
|
||||||
|
android:enabled="@{view.selectedRow != null}"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/center_guideline"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
</layout>
|
||||||
@ -6,6 +6,11 @@
|
|||||||
<data>
|
<data>
|
||||||
<import type="android.view.View" />
|
<import type="android.view.View" />
|
||||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="title"
|
||||||
|
type="String" />
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="subtitle"
|
name="subtitle"
|
||||||
type="String" />
|
type="String" />
|
||||||
@ -28,15 +33,13 @@
|
|||||||
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/title_text"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
||||||
android:text="@string/loading"
|
android:text="@{title}"
|
||||||
android:gravity="center_horizontal"/>
|
android:gravity="center_horizontal"/>
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:id="@+id/subtitle_text"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
|||||||
@ -224,6 +224,91 @@
|
|||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_toStartOf="@id/incoming_cnf"
|
||||||
|
android:text="@string/incoming_cnf"
|
||||||
|
android:textColor="@android:color/black" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/incoming_cnf"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{UtilityNumber.decimalToString(view.articolo.getCnfDaRic())}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="1" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:text="@string/unt_mis_col"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:text="("
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="0dp"
|
||||||
|
android:text="@{UtilityNumber.decimalToString(view.articolo.merceDaRic)}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
android:text="@{view.articolo.untMis}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_marginStart="0dp"
|
||||||
|
android:text=")"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -32,19 +32,9 @@
|
|||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/bottom_sheet_actions_delete_btn"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@android:color/white"
|
|
||||||
android:scaleX="1"
|
|
||||||
android:scaleY="1"
|
|
||||||
android:visibility="@{articolo.newNoPromo ? View.VISIBLE : View.GONE}"
|
|
||||||
android:src="@drawable/ic_baseline_new_24"
|
|
||||||
android:tint="@color/orange_600" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -53,6 +43,18 @@
|
|||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tools:text="COD MART" />
|
tools:text="COD MART" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/bottom_sheet_actions_delete_btn"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/white"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:visibility="@{articolo.newNoPromo ? View.VISIBLE : View.GONE}"
|
||||||
|
android:src="@drawable/ic_baseline_new_24"
|
||||||
|
android:tint="@color/orange_600" />
|
||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -377,4 +377,6 @@
|
|||||||
<string name="order_suggestion">Qtà proposta</string>
|
<string name="order_suggestion">Qtà proposta</string>
|
||||||
<string name="days">giorni</string>
|
<string name="days">giorni</string>
|
||||||
<string name="newly_inserted_prod">Nuovo articolo in griglia</string>
|
<string name="newly_inserted_prod">Nuovo articolo in griglia</string>
|
||||||
|
<string name="doc_interni_select_row_to_edit">Seleziona la riga da modificare</string>
|
||||||
|
<string name="incoming_cnf">Colli in arrivo</string>
|
||||||
</resources>
|
</resources>
|
||||||
@ -386,4 +386,6 @@
|
|||||||
<string name="order_suggestion">Suggested Qty</string>
|
<string name="order_suggestion">Suggested Qty</string>
|
||||||
<string name="days">days</string>
|
<string name="days">days</string>
|
||||||
<string name="newly_inserted_prod">Newly added product</string>
|
<string name="newly_inserted_prod">Newly added product</string>
|
||||||
|
<string name="doc_interni_select_row_to_edit">Select document row to edit</string>
|
||||||
|
<string name="incoming_cnf">Incoming packages</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@ -10,7 +10,7 @@ buildscript {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.1.1'
|
classpath 'com.android.tools.build:gradle:7.1.2'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath 'com.google.gms:google-services:4.3.10'
|
classpath 'com.google.gms:google-services:4.3.10'
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user