diff --git a/.idea/assetWizardSettings.xml b/.idea/assetWizardSettings.xml index 2a93dbf5..57990cbb 100644 --- a/.idea/assetWizardSettings.xml +++ b/.idea/assetWizardSettings.xml @@ -147,11 +147,8 @@ diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 8b39ee13..a47f1fc2 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/app/build.gradle b/app/build.gradle index 5e7bd8cd..e075b143 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ apply plugin: 'com.google.gms.google-services' android { - def appVersionCode = 51 - def appVersionName = '1.1.0' + def appVersionCode = 52 + def appVersionName = '1.1.1' signingConfigs { release { diff --git a/app/src/main/java/it/integry/integrywmsnative/MainActivity.java b/app/src/main/java/it/integry/integrywmsnative/MainActivity.java index 773db451..6ad12301 100644 --- a/app/src/main/java/it/integry/integrywmsnative/MainActivity.java +++ b/app/src/main/java/it/integry/integrywmsnative/MainActivity.java @@ -35,6 +35,7 @@ import it.integry.integrywmsnative.core.interfaces.ITitledFragment; import it.integry.integrywmsnative.gest.login.LoginActivity; import it.integry.integrywmsnative.gest.main.MainFragment; import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoFragment; +import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment; import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment; import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeFragment; import it.integry.integrywmsnative.gest.settings.MainSettingsFragment; @@ -74,7 +75,7 @@ public class MainActivity extends AppCompatActivity mBinding.navView.setNavigationItemSelectedListener(this); mBinding.appBarMain.mainSearch.setVisibility(View.GONE); - pop(); + openMain(); init(); } @@ -99,8 +100,8 @@ public class MainActivity extends AppCompatActivity if (count == 0) { super.onBackPressed(); } else { - //pop(); - getSupportFragmentManager().popBackStack(); + pop(); + // getSupportFragmentManager().popBackStack(); } } @@ -156,6 +157,9 @@ public class MainActivity extends AppCompatActivity else if (id == R.id.nav_prod_versamento_materiale) { fragment = ProdVersamentoMaterialeFragment.newInstance(); this.adaptViewToFragment(fragment); + } else if (id == R.id.nav_prod_recupero_materiale) { + fragment = ProdRecuperoMaterialeFragment.newInstance(); + this.adaptViewToFragment(fragment); } else if(id == R.id.nav_settings){ @@ -177,8 +181,8 @@ public class MainActivity extends AppCompatActivity return true; } - @Override - public void pop() { + + private void openMain() { MainFragment mainFragment = MainFragment.newInstance(); adaptViewToFragment(mainFragment); @@ -187,6 +191,18 @@ public class MainActivity extends AppCompatActivity mBinding.navView.setCheckedItem(R.id.nav_home); } + @Override + public void pop() { + + int count = getSupportFragmentManager().getBackStackEntryCount(); + for(int i = 0; i < count; i++) { + getSupportFragmentManager().popBackStack(); + } + + openMain(); + + } + private void adaptViewToFragment(Fragment fragment){ if(fragment instanceof ISearcableFragment) { mBinding.appBarMain.mainSearch.setOnQueryTextListener((SearchView.OnQueryTextListener) fragment); diff --git a/app/src/main/java/it/integry/integrywmsnative/core/REST/consumers/ColliMagazzinoRESTConsumer.java b/app/src/main/java/it/integry/integrywmsnative/core/REST/consumers/ColliMagazzinoRESTConsumer.java index ae6a22ed..c47cd018 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/REST/consumers/ColliMagazzinoRESTConsumer.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/REST/consumers/ColliMagazzinoRESTConsumer.java @@ -140,6 +140,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{ .setDataCollo((String) null) .setSegno(-1) .setGestione(GestioneEnum.LAVORAZIONE) + .setDataVers(null) .setOperation(CommonModelConsts.OPERATION.INSERT); if(posizione != null) { diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/main/MainFragment.java b/app/src/main/java/it/integry/integrywmsnative/gest/main/MainFragment.java index f7be412d..fb983b44 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/main/MainFragment.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/main/MainFragment.java @@ -229,6 +229,11 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab ((MainActivity) getActivity()).setItem(R.id.nav_prod_versamento_materiale); } +// @OnClick(R.id.fast_button_prod_recupero_materiale) +// public void onClickProdRecuperoMateriale(View view) { +// ((MainActivity) getActivity()).setItem(R.id.nav_prod_recupero_materiale); +// } + @Override public void setScrollToolbar(ElevatedToolbar toolbar) { mToolbar = toolbar; diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/prod_recupero_materiale/ProdRecuperoMaterialeFragment.java b/app/src/main/java/it/integry/integrywmsnative/gest/prod_recupero_materiale/ProdRecuperoMaterialeFragment.java new file mode 100644 index 00000000..ad57f139 --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/gest/prod_recupero_materiale/ProdRecuperoMaterialeFragment.java @@ -0,0 +1,91 @@ +package it.integry.integrywmsnative.gest.prod_recupero_materiale; + + +import android.content.Context; +import android.os.Bundle; + +import androidx.appcompat.widget.AppCompatTextView; +import androidx.databinding.DataBindingUtil; +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import it.integry.integrywmsnative.R; +import it.integry.integrywmsnative.core.interfaces.IPoppableActivity; +import it.integry.integrywmsnative.core.interfaces.ITitledFragment; +import it.integry.integrywmsnative.databinding.FragmentProdRecuperoMaterialeBinding; +import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.ProdRecuperoMaterialeHelper; +import it.integry.integrywmsnative.gest.prod_recupero_materiale.viewmodel.ProdRecuperoMaterialeViewModel; +import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment; +import it.integry.integrywmsnative.gest.prod_versamento_materiale.core.ProdVersamentoMaterialHelper; +import it.integry.integrywmsnative.gest.prod_versamento_materiale.viewmodel.ProdVersamentoMaterialViewModel; + +/** + * A simple {@link Fragment} subclass. + */ +public class ProdRecuperoMaterialeFragment extends Fragment implements ITitledFragment { + private FragmentProdRecuperoMaterialeBinding mBinding; + private ProdRecuperoMaterialeViewModel mViewmodel; + private ProdRecuperoMaterialeHelper mHelper; + + + public ProdRecuperoMaterialeFragment() { + // Required empty public constructor + } + + public static ProdRecuperoMaterialeFragment newInstance() { + ProdRecuperoMaterialeFragment fragment = new ProdRecuperoMaterialeFragment(); + Bundle args = new Bundle(); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + mViewmodel = new ProdRecuperoMaterialeViewModel(); + } + + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_prod_recupero_materiale, container, false); + + + init(); + return mBinding.getRoot(); + } + + @Override + public void onAttach(Context context) { + super.onAttach(context); + + } + + @Override + public void onDetach() { + super.onDetach(); + + } + + private void init() { + mHelper = new ProdRecuperoMaterialeHelper(getActivity()); + mViewmodel.init(getActivity(), mBinding, mHelper, () -> { + ((IPoppableActivity) getActivity()).pop(); + }); + + mViewmodel.openLU(); + + } + + + @Override + public void onCreateActionBar(AppCompatTextView titleText, Context context) { + titleText.setText(context.getText(R.string.prod_recupero_materiale_title_fragment).toString()); + } + +} diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/prod_recupero_materiale/core/ProdRecuperoMaterialeHelper.java b/app/src/main/java/it/integry/integrywmsnative/gest/prod_recupero_materiale/core/ProdRecuperoMaterialeHelper.java new file mode 100644 index 00000000..63537308 --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/gest/prod_recupero_materiale/core/ProdRecuperoMaterialeHelper.java @@ -0,0 +1,13 @@ +package it.integry.integrywmsnative.gest.prod_recupero_materiale.core; + +import android.content.Context; + +public class ProdRecuperoMaterialeHelper { + + + private Context mContext; + + public ProdRecuperoMaterialeHelper(Context context) { + this.mContext = context; + } +} diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/prod_recupero_materiale/viewmodel/ProdRecuperoMaterialeViewModel.java b/app/src/main/java/it/integry/integrywmsnative/gest/prod_recupero_materiale/viewmodel/ProdRecuperoMaterialeViewModel.java new file mode 100644 index 00000000..270e6002 --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/gest/prod_recupero_materiale/viewmodel/ProdRecuperoMaterialeViewModel.java @@ -0,0 +1,86 @@ +package it.integry.integrywmsnative.gest.prod_recupero_materiale.viewmodel; + +import android.app.Activity; +import android.content.Context; +import android.text.Html; +import android.text.SpannableString; + +import androidx.databinding.ObservableField; + +import it.integry.integrywmsnative.R; +import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager; +import it.integry.integrywmsnative.core.interfaces.IPoppableActivity; +import it.integry.integrywmsnative.core.model.MtbColt; +import it.integry.integrywmsnative.core.model.secondary.GestioneEnum; +import it.integry.integrywmsnative.databinding.FragmentProdRecuperoMaterialeBinding; +import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.ProdRecuperoMaterialeHelper; +import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper; +import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLU; + +public class ProdRecuperoMaterialeViewModel { + + private Context mContext; + + private FragmentProdRecuperoMaterialeBinding mBinding; + private ProdRecuperoMaterialeHelper mHelper; + private Runnable mOnRecuperoCompleted; + + public ObservableField mtbColt = new ObservableField<>(); + + + public void init(Activity context, FragmentProdRecuperoMaterialeBinding binding, ProdRecuperoMaterialeHelper helper, Runnable onRecuperoCompleted) { + mContext = context; + mBinding = binding; + mHelper = helper; + mOnRecuperoCompleted = onRecuperoCompleted; + + BarcodeManager.enable(); + } + + public void openLU() { + DialogScanOrCreateLU.make(mContext, true, mtbColt -> { + if(mtbColt == null) { + ((IPoppableActivity)mContext).pop(); + } else if((mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && mtbColt.getSegno().equals(-1)){ + + if(mtbColt.getMtbColr() == null || mtbColt.getMtbColr().size() == 0) { + DialogSimpleMessageHelper.makeWarningDialog(mContext, + new SpannableString(Html.fromHtml("E' stata scansionata una UL giĆ  vuota")), + null, this::openLU).show(); + + } else { + setMtbColt(mtbColt); +// choosePosition(); + } + } else { + DialogSimpleMessageHelper.makeWarningDialog(mContext, + new SpannableString(Html.fromHtml("Sono accettate solamente UL di Lavorazione di SCARICO")), + null, this::openLU).show(); + } + }).show(); + } + + + + + public void setMtbColt(MtbColt mtbColt) { + this.mtbColt.set(mtbColt); + } + + public void resetMtbColt() { + this.mtbColt.set(null); + openLU(); + } + + + private void showDataSavedDialog(Runnable onPositiveClick) { + + DialogSimpleMessageHelper.makeSuccessDialog( + mContext, + mContext.getResources().getString(R.string.completed), + new SpannableString(mContext.getResources().getString(R.string.data_saved)), + null, onPositiveClick).show(); + + } + +} diff --git a/app/src/main/res/drawable/ic_accettazione_96.png b/app/src/main/res/drawable/ic_accettazione_96.png deleted file mode 100644 index 6822976f..00000000 Binary files a/app/src/main/res/drawable/ic_accettazione_96.png and /dev/null differ diff --git a/app/src/main/res/drawable/ic_dashboard_accettazione.xml b/app/src/main/res/drawable/ic_dashboard_accettazione.xml new file mode 100644 index 00000000..b49b78bb --- /dev/null +++ b/app/src/main/res/drawable/ic_dashboard_accettazione.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_dashboard_picking_libero.xml b/app/src/main/res/drawable/ic_dashboard_picking_libero.xml new file mode 100644 index 00000000..1ab3dffc --- /dev/null +++ b/app/src/main/res/drawable/ic_dashboard_picking_libero.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_dashboard_prod_recupero_materiale.xml b/app/src/main/res/drawable/ic_dashboard_prod_recupero_materiale.xml new file mode 100644 index 00000000..ccc70759 --- /dev/null +++ b/app/src/main/res/drawable/ic_dashboard_prod_recupero_materiale.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_dashboard_prod_versamento_materiale.xml b/app/src/main/res/drawable/ic_dashboard_prod_versamento_materiale.xml new file mode 100644 index 00000000..f9922b4d --- /dev/null +++ b/app/src/main/res/drawable/ic_dashboard_prod_versamento_materiale.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_dashboard_rettifica_giacenze.xml b/app/src/main/res/drawable/ic_dashboard_rettifica_giacenze.xml new file mode 100644 index 00000000..09d26b2e --- /dev/null +++ b/app/src/main/res/drawable/ic_dashboard_rettifica_giacenze.xml @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_dashboard_spedizione.xml b/app/src/main/res/drawable/ic_dashboard_spedizione.xml new file mode 100644 index 00000000..3d7bac79 --- /dev/null +++ b/app/src/main/res/drawable/ic_dashboard_spedizione.xml @@ -0,0 +1,8 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_dashboard_versamento_merce.xml b/app/src/main/res/drawable/ic_dashboard_versamento_merce.xml new file mode 100644 index 00000000..682e4b58 --- /dev/null +++ b/app/src/main/res/drawable/ic_dashboard_versamento_merce.xml @@ -0,0 +1,8 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_picking_libero_96.png b/app/src/main/res/drawable/ic_picking_libero_96.png deleted file mode 100644 index 7ba95e88..00000000 Binary files a/app/src/main/res/drawable/ic_picking_libero_96.png and /dev/null differ diff --git a/app/src/main/res/drawable/ic_prod_recupero_materiale.png b/app/src/main/res/drawable/ic_prod_recupero_materiale.png deleted file mode 100644 index bff9fac7..00000000 Binary files a/app/src/main/res/drawable/ic_prod_recupero_materiale.png and /dev/null differ diff --git a/app/src/main/res/drawable/ic_prod_versamento_materiale.png b/app/src/main/res/drawable/ic_prod_versamento_materiale.png deleted file mode 100644 index a134cc64..00000000 Binary files a/app/src/main/res/drawable/ic_prod_versamento_materiale.png and /dev/null differ diff --git a/app/src/main/res/drawable/ic_rettifica_giacenze_96.png b/app/src/main/res/drawable/ic_rettifica_giacenze_96.png deleted file mode 100644 index 9b08416e..00000000 Binary files a/app/src/main/res/drawable/ic_rettifica_giacenze_96.png and /dev/null differ diff --git a/app/src/main/res/drawable/ic_spedizione_96.png b/app/src/main/res/drawable/ic_spedizione_96.png deleted file mode 100644 index 79cb16a8..00000000 Binary files a/app/src/main/res/drawable/ic_spedizione_96.png and /dev/null differ diff --git a/app/src/main/res/drawable/ic_versamento_merce_96.png b/app/src/main/res/drawable/ic_versamento_merce_96.png deleted file mode 100644 index 097d8715..00000000 Binary files a/app/src/main/res/drawable/ic_versamento_merce_96.png and /dev/null differ diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml index 92a2390f..b6334cfa 100644 --- a/app/src/main/res/layout/fragment_main.xml +++ b/app/src/main/res/layout/fragment_main.xml @@ -207,206 +207,227 @@ app:layout_constraintTop_toTopOf="parent" android:text="@string/general" /> - + app:layout_constraintEnd_toStartOf="@id/guide_1"> - - + android:layout_margin="8dp" + app:cardBackgroundColor="@android:color/white" + app:cardCornerRadius="4dp"> - + android:gravity="center_horizontal" + android:orientation="vertical" + android:padding="8dp"> - + - - + + + + - + app:layout_constraintEnd_toEndOf="parent"> - - + android:layout_margin="8dp" + app:cardBackgroundColor="@android:color/white" + app:cardCornerRadius="4dp"> - + android:gravity="center_horizontal" + android:orientation="vertical" + android:padding="8dp"> - + - - + + + + - + app:layout_constraintEnd_toStartOf="@id/guide_1"> - - + android:layout_margin="8dp" + app:cardBackgroundColor="@android:color/white" + app:cardCornerRadius="4dp"> - - + android:orientation="vertical" + android:padding="8dp"> - - + + - + + + + + app:layout_constraintEnd_toEndOf="parent"> - - + android:layout_margin="8dp" + app:cardBackgroundColor="@android:color/white" + app:cardCornerRadius="4dp"> - - - - + android:orientation="vertical" + android:padding="8dp"> - - + - + + + + + + + + app:layout_constraintEnd_toStartOf="@id/guide_1"> - - + android:layout_margin="8dp" + app:cardBackgroundColor="@android:color/white" + app:cardCornerRadius="4dp"> - - - - + android:orientation="vertical" + android:padding="8dp"> - - + + + + + + + @@ -449,7 +470,6 @@ - @@ -474,85 +494,96 @@ app:layout_constraintTop_toTopOf="parent" android:text="@string/production" /> - + app:layout_constraintEnd_toStartOf="@id/guide_2"> - - + android:layout_margin="8dp" + app:cardBackgroundColor="@android:color/white" + app:cardCornerRadius="4dp"> - - + android:orientation="vertical" + android:padding="8dp"> - - + + + + + + + - + - - - + - - - + - - + + - - - + + + - - + + + - - + + + - - - - - - - - + + + + + - - + + + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_prod_recupero_materiale.xml b/app/src/main/res/layout/fragment_prod_recupero_materiale.xml new file mode 100644 index 00000000..19f84442 --- /dev/null +++ b/app/src/main/res/layout/fragment_prod_recupero_materiale.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/activity_main_drawer.xml b/app/src/main/res/menu/activity_main_drawer.xml index 659d4cd5..3da1e78a 100644 --- a/app/src/main/res/menu/activity_main_drawer.xml +++ b/app/src/main/res/menu/activity_main_drawer.xml @@ -40,10 +40,10 @@ android:id="@+id/nav_prod_versamento_materiale" android:icon="@drawable/ic_settings_24dp" android:title="@string/prod_versamento_materiale_title_fragment" /> - - - - + diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 6bb5fe76..f7239101 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -205,4 +205,5 @@ Generale Produzione Versamento materiale + Recupero materiale \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 55abeb8e..4be0075b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -208,7 +208,8 @@ General Production - Deposit material + Deposit raw material + Recover raw material diff --git a/ext_sources/ICONS/ic_dashboard_accettazione.svg b/ext_sources/ICONS/ic_dashboard_accettazione.svg new file mode 100644 index 00000000..1159b373 --- /dev/null +++ b/ext_sources/ICONS/ic_dashboard_accettazione.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/ext_sources/ICONS/ic_dashboard_picking_libero.svg b/ext_sources/ICONS/ic_dashboard_picking_libero.svg new file mode 100644 index 00000000..840697f1 --- /dev/null +++ b/ext_sources/ICONS/ic_dashboard_picking_libero.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/ext_sources/ICONS/ic_dashboard_prod_recupero_materiale.svg b/ext_sources/ICONS/ic_dashboard_prod_recupero_materiale.svg new file mode 100644 index 00000000..b610fc6f --- /dev/null +++ b/ext_sources/ICONS/ic_dashboard_prod_recupero_materiale.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/ext_sources/ICONS/ic_dashboard_prod_versamento_materiale.svg b/ext_sources/ICONS/ic_dashboard_prod_versamento_materiale.svg new file mode 100644 index 00000000..50529701 --- /dev/null +++ b/ext_sources/ICONS/ic_dashboard_prod_versamento_materiale.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/ext_sources/ICONS/ic_dashboard_rettifica_giacenze.svg b/ext_sources/ICONS/ic_dashboard_rettifica_giacenze.svg new file mode 100644 index 00000000..f6a067eb --- /dev/null +++ b/ext_sources/ICONS/ic_dashboard_rettifica_giacenze.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/ext_sources/ICONS/ic_dashboard_spedizione.svg b/ext_sources/ICONS/ic_dashboard_spedizione.svg new file mode 100644 index 00000000..7cc8feed --- /dev/null +++ b/ext_sources/ICONS/ic_dashboard_spedizione.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/ext_sources/ICONS/ic_dashboard_versamento_merce.svg b/ext_sources/ICONS/ic_dashboard_versamento_merce.svg new file mode 100644 index 00000000..e3ad4f0e --- /dev/null +++ b/ext_sources/ICONS/ic_dashboard_versamento_merce.svg @@ -0,0 +1,10 @@ + + + + + + + + + +