Compare commits
75 Commits
v1.27.2(28
...
v1.29.1(30
| Author | SHA1 | Date | |
|---|---|---|---|
| 6fa80a5485 | |||
| e0ea6b17a1 | |||
| 60978167c2 | |||
| 6a848e081a | |||
| 2960d0d4b4 | |||
| 6b01861a26 | |||
| 5889942ff9 | |||
| 0359ddcc90 | |||
| 8409507dab | |||
| 208653223c | |||
| 62f6e12a86 | |||
| b662929c19 | |||
| 40895eac2f | |||
| dc7e90b2fe | |||
| 5d1f275ebc | |||
| 79192ce337 | |||
| 7f0f6c969a | |||
| e23beddf65 | |||
| 1fd51a4097 | |||
| 5ea124bcf6 | |||
| fa6ab9f58f | |||
| f7806103fb | |||
| 87acc5a4e3 | |||
| 7c49af085d | |||
| 0c3d5bd0f1 | |||
| 37d956bb5c | |||
| fef564b090 | |||
| d1c491ee80 | |||
| 0cd8a3b41f | |||
| f7e4a3d005 | |||
| a22ecb9620 | |||
| 57c22b617e | |||
| 84876bf7c1 | |||
| 2718f0ff2b | |||
| fca325855e | |||
| c6fc287a3f | |||
| 29fd0292e7 | |||
| 90cf83e3cd | |||
| f4c1f1fe34 | |||
| 9e85b9f828 | |||
| a9fd55c01f | |||
| 506a56a1a2 | |||
| c93e29606c | |||
| 4adc40aa90 | |||
| 4842a6091b | |||
| 9faf4123ef | |||
| cdf5b413a2 | |||
| 4dd2ccdb13 | |||
| 56c54d3cde | |||
| 19e2d5b869 | |||
| 0acf023556 | |||
| 71f6dc83fb | |||
| 3479ee2b87 | |||
| 609b9f1852 | |||
| 23c98d9218 | |||
| 57900a9617 | |||
| c3274a4311 | |||
| 356e2562da | |||
| 46c0078331 | |||
| bbc81f3d99 | |||
| 0dd662518e | |||
| 08d332e2c6 | |||
| b9001790be | |||
| d43bd8e659 | |||
| ef2886c963 | |||
| 7a6097fa69 | |||
| 9c45cebf51 | |||
| 344fc42d03 | |||
| 33a01b2c15 | |||
| d165174345 | |||
| 05314803bc | |||
| 9db8337f9b | |||
| abfd92ce07 | |||
| c11858aea2 | |||
| b9f5baae5f |
16
.idea/deploymentTargetDropDown.xml
generated
16
.idea/deploymentTargetDropDown.xml
generated
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<runningDeviceTargetsSelectedWithDialog>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="SERIAL_NUMBER" />
|
||||
<value value="20119B1E55" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetsSelectedWithDialog>
|
||||
</component>
|
||||
</project>
|
||||
@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 289
|
||||
def appVersionName = '1.7.2'
|
||||
def appVersionCode = 305
|
||||
def appVersionName = '1.29.1'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -31,12 +31,12 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
compileSdkVersion 31
|
||||
compileSdkVersion 32
|
||||
|
||||
defaultConfig {
|
||||
applicationId "it.integry.integrywmsnative"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 31
|
||||
targetSdkVersion 32
|
||||
versionCode appVersionCode
|
||||
versionName appVersionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -27,11 +27,18 @@
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing" />
|
||||
<activity android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity"
|
||||
<activity
|
||||
android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing" />
|
||||
<activity android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
||||
<activity
|
||||
android:name=".gest.prod_dettaglio_linea.ProdDettaglioLineaActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing" />
|
||||
<activity
|
||||
android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing" />
|
||||
|
||||
@@ -41,6 +41,8 @@ import it.integry.integrywmsnative.gest.picking_resi.PickingResiComponent;
|
||||
import it.integry.integrywmsnative.gest.picking_resi.PickingResiModule;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoModule;
|
||||
import it.integry.integrywmsnative.gest.prod_dettaglio_linea.ProdDettaglioLineaComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_dettaglio_linea.ProdDettaglioLineaModule;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdModule;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaComponent;
|
||||
@@ -84,6 +86,8 @@ import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdC
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Component;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Module;
|
||||
import it.integry.integrywmsnative.view.dialogs.printSsccUl.DialogPrintUlSSCCComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.printSsccUl.DialogPrintUlSSCCModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUComponent;
|
||||
@@ -134,7 +138,9 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
DialogAskClienteModule.class,
|
||||
DialogEditArticoloModule.class,
|
||||
DialogPrintOrderSSCCListModule.class,
|
||||
ProdLineeProduzioneModule.class
|
||||
ProdLineeProduzioneModule.class,
|
||||
ProdDettaglioLineaModule.class,
|
||||
DialogPrintUlSSCCModule.class
|
||||
})
|
||||
public interface MainApplicationComponent {
|
||||
|
||||
@@ -226,6 +232,10 @@ public interface MainApplicationComponent {
|
||||
|
||||
ProdLineeProduzioneComponent.Factory prodLineeProduzioneComponent();
|
||||
|
||||
ProdDettaglioLineaComponent.Factory prodDettaglioLineaComponent();
|
||||
|
||||
DialogPrintUlSSCCComponent.Factory dialogPrintUlSSCCComponent();
|
||||
|
||||
void inject(MainApplication mainApplication);
|
||||
|
||||
void inject(AppContext mainApplication);
|
||||
|
||||
@@ -25,6 +25,7 @@ import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
||||
@@ -200,4 +201,10 @@ public class MainApplicationModule {
|
||||
return new InventarioService(giacenzaRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ProductionLinesRESTConsumer provideProductionLinesRESTConsumer() {
|
||||
return new ProductionLinesRESTConsumer();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.UUID;
|
||||
|
||||
public class DataCache {
|
||||
|
||||
private static List<DataCacheDTO> dataCacheList = new ArrayList<>();
|
||||
private static final List<DataCacheDTO> dataCacheList = new ArrayList<>();
|
||||
|
||||
|
||||
public static String addItem(Object item) {
|
||||
|
||||
@@ -19,7 +19,7 @@ import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
|
||||
@Database(entities = {ArticoloGriglia.class, Griglia.class, Ordine.class, ArticoloOrdine.class, SqlMtbColt.class, SqlMtbColr.class}, version = 9, exportSchema = false)
|
||||
@Database(entities = {ArticoloGriglia.class, Griglia.class, Ordine.class, ArticoloOrdine.class, SqlMtbColt.class, SqlMtbColr.class}, version = 10, exportSchema = false)
|
||||
@TypeConverters({
|
||||
DateConverter.class,
|
||||
BigDecimalConverter.class
|
||||
|
||||
@@ -53,6 +53,6 @@ public interface ArticoloGrigliaDao {
|
||||
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId")
|
||||
List<ArticoloGriglia> getArticoliFromGriglia(int grigliaId);
|
||||
|
||||
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId AND new_no_promo = 1")
|
||||
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId AND qta_ord >= 1")
|
||||
List<ArticoloGriglia> getNewArticoliInGriglia(int grigliaId);
|
||||
}
|
||||
|
||||
@@ -71,6 +71,9 @@ public class ArticoloGriglia {
|
||||
@ColumnInfo(name = "qta_proposta")
|
||||
private float qtaProposta;
|
||||
|
||||
@ColumnInfo(name = "qta_ord")
|
||||
private float qtaOrd;
|
||||
|
||||
@ColumnInfo(name = "id_griglia")
|
||||
private int idGriglia;
|
||||
|
||||
@@ -205,6 +208,14 @@ public class ArticoloGriglia {
|
||||
this.newNoPromo = newNoPromo;
|
||||
}
|
||||
|
||||
public float getQtaOrd() {
|
||||
return qtaOrd;
|
||||
}
|
||||
|
||||
public void setQtaOrd(float qtaOrd) {
|
||||
this.qtaOrd = qtaOrd;
|
||||
}
|
||||
|
||||
public String generateSystemNote() {
|
||||
HashMap<String, String> pairs = new HashMap<>();
|
||||
pairs.put("qta_proposta", String.valueOf(qtaProposta));
|
||||
@@ -234,8 +245,7 @@ public class ArticoloGriglia {
|
||||
articolo.setQtaProposta(BigDecimal.valueOf(this.getQtaProposta()));
|
||||
articolo.setNewNoPromo(this.isNewNoPromo());
|
||||
articolo.setSystemNote(generateSystemNote());
|
||||
|
||||
articolo.setQtaOrd(0);
|
||||
articolo.setQtaOrd(this.getQtaOrd());
|
||||
|
||||
return articolo;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,9 @@ public class Ordine {
|
||||
@Ignore
|
||||
private int countArticoli = 0;
|
||||
|
||||
@Ignore
|
||||
private boolean orderNewProducts = false;
|
||||
|
||||
@ColumnInfo(name = "id_griglia")
|
||||
private int idGriglia;
|
||||
|
||||
@@ -149,4 +152,13 @@ public class Ordine {
|
||||
public void setDataOrdS(String dataOrd) {
|
||||
setDataOrd(UtilityDate.recognizeDateWithExceptionHandler(dataOrd));
|
||||
}
|
||||
|
||||
public boolean isOrderNewProducts() {
|
||||
return orderNewProducts;
|
||||
}
|
||||
|
||||
public Ordine setOrderNewProducts(boolean orderNewProducts) {
|
||||
this.orderNewProducts = orderNewProducts;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ public class ArticoloDTO {
|
||||
private float giacenza;
|
||||
private float qtaPrevistaVendita;
|
||||
private float qtaProposta;
|
||||
private float qtaOrd;
|
||||
|
||||
|
||||
public String getCodMart() {
|
||||
@@ -151,6 +152,15 @@ public class ArticoloDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public float getQtaOrd() {
|
||||
return qtaOrd;
|
||||
}
|
||||
|
||||
public ArticoloDTO setQtaOrd(float qtaOrd) {
|
||||
this.qtaOrd = qtaOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArticoloGriglia toArticoloGriglia() {
|
||||
ArticoloGriglia result = new ArticoloGriglia();
|
||||
result.setBarCode(this.getBarCode());
|
||||
@@ -164,6 +174,7 @@ public class ArticoloDTO {
|
||||
result.setQtaMinOrdinabile(this.getQtaMinOrdinabile());
|
||||
result.setGgScadenza(this.ggScadenza);
|
||||
result.setNewNoPromo(this.newNoPromo);
|
||||
result.setQtaOrd(this.getQtaOrd());
|
||||
result.setGiacenza(this.giacenza);
|
||||
result.setQtaPrevistaVendita(this.qtaPrevistaVendita);
|
||||
result.setQtaProposta(this.qtaProposta);
|
||||
|
||||
@@ -27,7 +27,6 @@ public class BaseDialogFragment extends DialogFragment {
|
||||
private boolean mBarcodeListener = false;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void show(FragmentManager manager, String tag) {
|
||||
try {
|
||||
|
||||
@@ -99,9 +99,17 @@ public abstract class BaseFragment extends Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onBackPressed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void popMe() {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
((IPoppableActivity) requireActivity()).pop();
|
||||
});
|
||||
if (requireActivity() instanceof IPoppableActivity) {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
((IPoppableActivity) requireActivity()).pop();
|
||||
});
|
||||
} else {
|
||||
requireActivity().getSupportFragmentManager().popBackStack();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.interfaces.viewmodel_listeners;
|
||||
|
||||
public interface IOrdersLoadingListener {
|
||||
|
||||
void onOrderLoadingStarted();
|
||||
|
||||
void onOrderLoadingEnded();
|
||||
|
||||
}
|
||||
@@ -88,6 +88,11 @@ public class MtbAart extends EntityBase {
|
||||
private String marchio;
|
||||
private Integer sezione;
|
||||
private UntMisRifPesoEnum untMisRifPeso;
|
||||
|
||||
private BigDecimal qtaEsistente;
|
||||
private BigDecimal qtaImpegnata;
|
||||
private BigDecimal numCnfEsistente;
|
||||
private BigDecimal numCnfImpegnata;
|
||||
|
||||
private List<MtbUntMis> mtbUntMis;
|
||||
|
||||
@@ -819,4 +824,40 @@ public class MtbAart extends EntityBase {
|
||||
this.untMisRifPeso = untMisRifPeso;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaEsistente() {
|
||||
return qtaEsistente;
|
||||
}
|
||||
|
||||
public MtbAart setQtaEsistente(BigDecimal qtaEsistente) {
|
||||
this.qtaEsistente = qtaEsistente;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaImpegnata() {
|
||||
return qtaImpegnata;
|
||||
}
|
||||
|
||||
public MtbAart setQtaImpegnata(BigDecimal qtaImpegnata) {
|
||||
this.qtaImpegnata = qtaImpegnata;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNumCnfEsistente() {
|
||||
return numCnfEsistente;
|
||||
}
|
||||
|
||||
public MtbAart setNumCnfEsistente(BigDecimal numCnfEsistente) {
|
||||
this.numCnfEsistente = numCnfEsistente;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNumCnfImpegnata() {
|
||||
return numCnfImpegnata;
|
||||
}
|
||||
|
||||
public MtbAart setNumCnfImpegnata(BigDecimal numCnfImpegnata) {
|
||||
this.numCnfImpegnata = numCnfImpegnata;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@ public class CommonRESTException {
|
||||
put(MESSAGE_KEY, "Barcode non letto correttamente");
|
||||
put(EXCEPTION_KEY, NoResultFromBarcodeException.class);
|
||||
}});
|
||||
|
||||
|
||||
}};
|
||||
|
||||
|
||||
|
||||
@@ -28,11 +28,11 @@ public class RESTBuilder {
|
||||
}
|
||||
|
||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors) {
|
||||
return getService(service, host, port, addInterceptors, true, 30);
|
||||
return getService(service, host, port, addInterceptors, true, 60);
|
||||
}
|
||||
|
||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, boolean addEmsApi) {
|
||||
return getService(service, host, port, addInterceptors, addEmsApi, 30);
|
||||
return getService(service, host, port, addInterceptors, addEmsApi, 60);
|
||||
}
|
||||
|
||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, boolean addEmsApi, int timeout) {
|
||||
|
||||
@@ -36,7 +36,9 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||
analyzeAnswer(response, "getByBarcodeProd", (m) -> {
|
||||
onComplete.run(response.body().getEntityList());
|
||||
List<MtbAart> aartList = response.body().getEntityList();
|
||||
aartList = aartList != null ? Stream.of(aartList).filter(x -> x.getFlagStato().equalsIgnoreCase("A")).toList() : null;
|
||||
onComplete.run(aartList);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
|
||||
@@ -326,7 +326,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
||||
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||
analyzeAnswer(response, "GetBySSCC", mtbColt -> {
|
||||
@@ -700,4 +700,29 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public void loadShipmentUlFromProductionUL(MtbColt mtbColt, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
params.put("mtb_colr.gestione_rif", mtbColt.getGestione());
|
||||
params.put("mtb_colr.ser_collo_rif", mtbColt.getSerCollo());
|
||||
params.put("mtb_colr.num_collo_rif", mtbColt.getNumCollo());
|
||||
params.put("mtb_colr.data_collo_rif", mtbColt.getDataColloD());
|
||||
|
||||
String whereCond = UtilityQuery.concatFieldsInWhereCond(params);
|
||||
|
||||
|
||||
String query = "select distinct mtb_colt.*\n" +
|
||||
"from mtb_colt\n" +
|
||||
" left join mtb_colr on mtb_colt.gestione = mtb_colr.gestione and mtb_colt.data_collo = mtb_colr.data_collo and\n" +
|
||||
" mtb_colt.ser_collo = mtb_colr.ser_collo and mtb_colt.num_collo = mtb_colr.num_collo\n" +
|
||||
"where mtb_colt.gestione = 'V'" +
|
||||
" AND " + whereCond;
|
||||
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {
|
||||
}.getType();
|
||||
this.mSystemRESTConsumer.<ArrayList<MtbColt>>processSql(query, typeOfObjectsList, data -> {
|
||||
onComplete.run(data.get(0));
|
||||
}, onFailed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,9 +78,9 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
public static void getValues(List<StbGestSetup> stbGestSetupList, RunnableArgs<List<StbGestSetup>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public static void getValues(String codMdep, List<StbGestSetup> stbGestSetupList, RunnableArgs<List<StbGestSetup>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
||||
service.getGestSetupValues(stbGestSetupList).enqueue(new Callback<>() {
|
||||
service.getGestSetupValues(codMdep, stbGestSetupList).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Response<ServiceRESTResponse<List<StbGestSetup>>> response) {
|
||||
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
||||
|
||||
@@ -28,6 +28,7 @@ public interface GestSetupRESTConsumerService {
|
||||
|
||||
@POST("gestSetupList")
|
||||
Call<ServiceRESTResponse<List<StbGestSetup>>> getGestSetupValues(
|
||||
@Query("codMdep") String codMdep,
|
||||
@Body List<StbGestSetup> stbGestSetupList);
|
||||
|
||||
}
|
||||
|
||||
@@ -46,11 +46,11 @@ public class MesRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public void getOrdiniLavorazione(String flagEvaso, String codJfas, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public void getOrdiniLavorazione(String flagEvaso, String codJfas, String codAnag, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
||||
|
||||
mesRESTConsumerService.getOrdiniLavorazione(flagEvaso, codJfas)
|
||||
.enqueue(new Callback<ServiceRESTResponse<List<OrdineLavorazioneDTO>>>() {
|
||||
mesRESTConsumerService.getOrdiniLavorazione(null, flagEvaso, codJfas, codAnag)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
||||
analyzeAnswer(response, "getOrdiniLavorazione", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
||||
@@ -63,6 +63,7 @@ public class MesRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void getOrdiniLavorazione(Date dateStart, String flagEvaso, String codJfas, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
||||
|
||||
@@ -82,7 +83,8 @@ public class MesRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public void getLineeProduzione(String codJfasParent, RunnableArgs<List<JtbFasi>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<JtbFasi>>() {}.getType();
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<JtbFasi>>() {
|
||||
}.getType();
|
||||
this.mSystemRESTConsumer.processSql(
|
||||
"SELECT * FROM jtb_fasi WHERE cod_jfas_parent = " + UtilityDB.valueToString(codJfasParent),
|
||||
typeOfObjectsList,
|
||||
|
||||
@@ -22,4 +22,7 @@ public interface MesRESTConsumerService {
|
||||
@GET("mes_v2/getOrdiniLavorazione")
|
||||
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazione(@Query("startDate") String startDate, @Query("flagEvaso") String flagEvaso, @Query("codJfas") String codJfas);
|
||||
|
||||
@GET("mes_v2/getOrdiniLavorazione")
|
||||
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazione(@Query("startDate") String startDate, @Query("flagEvaso") String flagEvaso, @Query("codJfas") String codJfas, @Query("codAnag") String codAnag);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import java.util.List;
|
||||
@@ -88,4 +89,24 @@ public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
public void getLineDetails(ProdLineStatusDTO lineaProd, RunnableArgs<ProdLineStatusDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
|
||||
Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> callable = restService.getStatoLinee(lineaProd.getCodMdepLav());
|
||||
callable.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Response<ServiceRESTResponse<List<ProdLineStatusDTO>>> response) {
|
||||
analyzeAnswer(response, "getLineDetails", (lines) -> {
|
||||
ProdLineStatusDTO newLine = Stream.of(lines).filter(dto -> dto.getCodJfas().equalsIgnoreCase(lineaProd.getCodJfas())).findFirstOrElse(null);
|
||||
onComplete.run(newLine);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ public class SitArtOrdDTO {
|
||||
private String descrizioneMsgr;
|
||||
private String codMsfa;
|
||||
private String descrizioneMsfa;
|
||||
private String untord;
|
||||
|
||||
private final HashMap<String, Object> extraInfo = new HashMap<>();
|
||||
|
||||
@@ -212,4 +213,13 @@ public class SitArtOrdDTO {
|
||||
public HashMap<String, Object> getExtraInfo() {
|
||||
return extraInfo;
|
||||
}
|
||||
|
||||
public String getUntord() {
|
||||
return untord;
|
||||
}
|
||||
|
||||
public SitArtOrdDTO setUntord(String untord) {
|
||||
this.untord = untord;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,8 +45,11 @@ public class DBSettingsModel {
|
||||
private boolean flagPrintPackingListOnOrderClose;
|
||||
private boolean flagPrintEtichetteOnOrderClose;
|
||||
private int onNumCnfInputChanged = 1;
|
||||
private int onQtaTotInputChanged = 1;
|
||||
private boolean flagAccettazioneUseQtaOrd = false;
|
||||
private boolean flagPickLiberoAllowEmptyDest = false;
|
||||
private boolean flagAskInfoAggiuntiveSpedizione = false;
|
||||
private String filterFornitoreProd;
|
||||
|
||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||
return flagSpedizioneEnableFakeGiacenza;
|
||||
@@ -309,6 +312,15 @@ public class DBSettingsModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getOnQtaTotInputChanged() {
|
||||
return onQtaTotInputChanged;
|
||||
}
|
||||
|
||||
public DBSettingsModel setOnQtaTotInputChanged(int onQtaTotInputChanged) {
|
||||
this.onQtaTotInputChanged = onQtaTotInputChanged;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getNotePerditaDocInterni() {
|
||||
return notePerditaDocInterni;
|
||||
}
|
||||
@@ -354,4 +366,22 @@ public class DBSettingsModel {
|
||||
this.flagOrdinaArticoliOnScan = flagOrdinaArticoliOnScan;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAskInfoAggiuntiveSpedizione() {
|
||||
return flagAskInfoAggiuntiveSpedizione;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAskInfoAggiuntiveSpedizione(boolean flagAskInfoAggiuntiveSpedizione) {
|
||||
this.flagAskInfoAggiuntiveSpedizione = flagAskInfoAggiuntiveSpedizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFilterFornitoreProd() {
|
||||
return filterFornitoreProd;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFilterFornitoreProd(String filterFornitoreProd) {
|
||||
this.filterFornitoreProd = filterFornitoreProd;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,6 +258,10 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("PRODUZIONE")
|
||||
.setKeySection("FLAG_VERSAMENTO_DIRETTO"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("PRODUZIONE")
|
||||
.setKeySection("FILTER_FORNTIORE_PROD"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
@@ -278,6 +282,10 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("SETUP")
|
||||
.setKeySection("ON_NUM_CNF_INPUT_CHANGED"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SETUP")
|
||||
.setKeySection("ON_QTA_TOT_INPUT_CHANGED"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PVM")
|
||||
.setSection("DOC_INTERNI")
|
||||
@@ -302,9 +310,25 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("PICKING_LIBERO")
|
||||
.setKeySection("FLAG_ALLOW_EMPTY_DEST"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_PRINT_PACKING_LIST_ON_CLOSE"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_PRINT_ETICHETTE_ON_CLOSE"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_ALLOW_EMPTY_DEST"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_ASK_INFO_AGGIUNTIVE"));
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
|
||||
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
||||
GestSetupRESTConsumer.getValues(codMdep, stbGestSetupList, list -> {
|
||||
dbSettingsModelIstance.setDefaultCausaleRettificaGiacenze(getValueFromList(list, "SETUP", "DEFAULT_CAUSALE_RETTIFICA_GIACENZE", String.class));
|
||||
dbSettingsModelIstance.setEnableCheckPartitaMagCheckPickingV(getValueFromList(list, "SETUP", "ENABLE_CHECK_PARTITA_MAG_PICKING_V", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagMultiClienteOrdV(getValueFromList(list, "SETUP", "FLAG_MULTI_CLIENTE_ORD_VENDITA", Boolean.class));
|
||||
@@ -329,24 +353,24 @@ public class SettingsManager {
|
||||
dbSettingsModelIstance.setFlagAccettazioneUseQtaOrd(getValueFromList(list, "ACCETTAZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagPickLiberoAllowEmptyDest(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_DEST", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagOrdinaArticoliOnScan(getValueFromList(list, "ORDINI_A", "ORDINA_ARTICOLI_ON_SCAN", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagPrintPackingListOnOrderClose(getValueFromList(list, "SPEDIZIONE", "FLAG_PRINT_PACKING_LIST_ON_CLOSE", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagPrintEtichetteOnOrderClose(getValueFromList(list, "SPEDIZIONE", "FLAG_PRINT_ETICHETTE_ON_CLOSE", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagAskInfoAggiuntiveSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_ASK_INFO_AGGIUNTIVE", Boolean.class));
|
||||
dbSettingsModelIstance.setFilterFornitoreProd(getValueFromList(list, "PRODUZIONE", "FILTER_FORNTIORE_PROD", String.class));
|
||||
|
||||
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
|
||||
if (notePerdita != null) {
|
||||
if (notePerdita != null)
|
||||
dbSettingsModelIstance.setNotePerditaDocInterni(Arrays.asList(notePerdita.split("\\|")));
|
||||
}
|
||||
|
||||
Integer onNumCnfInputChanged = getValueFromList(list, "SETUP", "ON_NUM_CNF_INPUT_CHANGED", Integer.class);
|
||||
if (onNumCnfInputChanged != null) {
|
||||
if (onNumCnfInputChanged != null)
|
||||
dbSettingsModelIstance.setOnNumCnfInputChanged(onNumCnfInputChanged);
|
||||
}
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
GestSetupRESTConsumer.getBooleanValue("PICKING", "SPEDIZIONE", "FLAG_PRINT_PACKING_LIST_ON_CLOSE", codMdep, (value) -> {
|
||||
dbSettingsModelIstance.setFlagPrintPackingListOnOrderClose(value);
|
||||
GestSetupRESTConsumer.getBooleanValue("PICKING", "SPEDIZIONE", "FLAG_PRINT_ETICHETTE_ON_CLOSE", codMdep, (gestSetupDTO) -> {
|
||||
dbSettingsModelIstance.setFlagPrintEtichetteOnOrderClose(value);
|
||||
if (onComplete != null) onComplete.run();
|
||||
}, onFailed);
|
||||
}, onFailed);
|
||||
|
||||
Integer onQtaTotInputChanged = getValueFromList(list, "SETUP", "ON_QTA_TOT_INPUT_CHANGED", Integer.class);
|
||||
if (onQtaTotInputChanged != null)
|
||||
dbSettingsModelIstance.setOnQtaTotInputChanged(onQtaTotInputChanged);
|
||||
|
||||
if (onComplete != null) onComplete.run();
|
||||
}, onFailed);
|
||||
|
||||
}
|
||||
@@ -356,7 +380,7 @@ public class SettingsManager {
|
||||
|
||||
StbGestSetup value = Stream.of(stbGestSetupList)
|
||||
.filter(x -> x.getSection().equalsIgnoreCase(section) && x.getKeySection().equalsIgnoreCase(keySectionName))
|
||||
.findFirst().get();
|
||||
.findFirstOrElse(new StbGestSetup());
|
||||
|
||||
if (clazz == String.class) {
|
||||
return clazz.cast(value.getValue());
|
||||
|
||||
@@ -99,7 +99,21 @@ public class UtilityDate {
|
||||
|
||||
|
||||
public static Date getDateInstance() {
|
||||
return getCalendarInstance().getTime();
|
||||
return getDateInstance(false);
|
||||
}
|
||||
|
||||
|
||||
public static Date getDateInstance(boolean removeTime) {
|
||||
var calendar = getCalendarInstance();
|
||||
|
||||
if(removeTime) {
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
}
|
||||
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Calendar getCalendarInstance() {
|
||||
|
||||
@@ -35,6 +35,7 @@ public class UtilityNumber {
|
||||
decimalFormat.setMaximumFractionDigits(decimal);
|
||||
decimalFormat.setDecimalFormatSymbols(otherSymbols);
|
||||
decimalFormat.setGroupingUsed(false);
|
||||
decimalFormat.setMinimumFractionDigits(2);
|
||||
|
||||
return decimalFormat.format(floatValue);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,13 @@ public class DialogSelectDocInfoViewModel {
|
||||
|
||||
public void init(DocInterniSetupDTO initialList) {
|
||||
this.mDocInterniSetupDTO = initialList;
|
||||
this.mTipoDoc = null;
|
||||
this.mGruppoArt = null;
|
||||
this.mFornitore = null;
|
||||
this.mDataDoc = null;
|
||||
this.mNumDoc = null;
|
||||
this.mNote = null;
|
||||
this.mListener = null;
|
||||
}
|
||||
|
||||
public String getCodDtip() {
|
||||
|
||||
@@ -19,6 +19,8 @@ public class GrigliaAcquistiChildDTO {
|
||||
private float giacenza;
|
||||
private float qtaPrevistaVendita;
|
||||
private float qtaProposta;
|
||||
private BigDecimal qtaOrd;
|
||||
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
@@ -154,4 +156,13 @@ public class GrigliaAcquistiChildDTO {
|
||||
this.newNoPromo = newNoPromo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaOrd() {
|
||||
return qtaOrd;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setQtaOrd(BigDecimal qtaOrd) {
|
||||
this.qtaOrd = qtaOrd;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,6 +250,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
.setNotesMandatory(this.viewModel.isNotesMandatory())
|
||||
.setDataScadMandatory(flagTracciabilita)
|
||||
.setCanPartitaMagBeChanged(flagTracciabilita)
|
||||
.setNumCnfEditable(false)
|
||||
.setSuggestPartitaMag(data -> {
|
||||
Date dataScad = data.getDataScad();
|
||||
String partitaMag = null;
|
||||
|
||||
@@ -49,6 +49,7 @@ import it.integry.integrywmsnative.core.utility.UtilityContext;
|
||||
import it.integry.integrywmsnative.databinding.ActivityMainBinding;
|
||||
import it.integry.integrywmsnative.gest.login.LoginActivity;
|
||||
import it.integry.integrywmsnative.gest.settings.MainSettingsFragment;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
|
||||
public class MainActivity extends BaseActivity
|
||||
implements NavigationView.OnNavigationItemSelectedListener, IPoppableActivity {
|
||||
@@ -70,6 +71,10 @@ public class MainActivity extends BaseActivity
|
||||
@Inject
|
||||
UpdatesManager updatesManager;
|
||||
|
||||
|
||||
@Inject
|
||||
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -103,6 +108,14 @@ public class MainActivity extends BaseActivity
|
||||
|
||||
init();
|
||||
|
||||
|
||||
// mDialogInputQuantityV2View
|
||||
// .setDialogInputQuantityV2DTO(new DialogInputQuantityV2DTO()
|
||||
// .setMtbAart(new MtbAart()
|
||||
// .setCodMart("AAAA")
|
||||
// .setFlagQtaCnfFissa("S")))
|
||||
// .show(getSupportFragmentManager(), "tag");
|
||||
|
||||
}
|
||||
|
||||
private void startLoginActivity() {
|
||||
|
||||
@@ -0,0 +1,356 @@
|
||||
package it.integry.integrywmsnative.gest.prod_dettaglio_linea;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.InputType;
|
||||
import android.text.SpannableString;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.databinding.Observable;
|
||||
import androidx.databinding.ObservableField;
|
||||
|
||||
import com.google.android.material.chip.Chip;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
||||
import it.integry.integrywmsnative.databinding.ActivityProdDettaglioLineaBinding;
|
||||
import it.integry.integrywmsnative.gest.prod_dettaglio_linea.dialogs.BottomSheetLineAction;
|
||||
import it.integry.integrywmsnative.gest.prod_dettaglio_linea.dialogs.DialogStartProduction;
|
||||
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleInputHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
|
||||
public class ProdDettaglioLineaActivity extends BaseActivity implements ProdDettaglioLineaViewModel.Listener {
|
||||
|
||||
private static final String DATA_KEY_LINE = "keyLinea";
|
||||
private static final String DATA_KEY_FRAGMENT_LISTENER = "onFragmentClose";
|
||||
|
||||
private ActivityProdDettaglioLineaBinding mBinding;
|
||||
public final ObservableField<String> listaOrd = new ObservableField<>();
|
||||
public final BindableString lineaLabel = new BindableString();
|
||||
public final BindableBoolean isStarted = new BindableBoolean(false);
|
||||
public final BindableBoolean isPaused = new BindableBoolean(false);
|
||||
public final BindableBoolean flagShowProdInfo = new BindableBoolean(false);
|
||||
public final BindableString hrNum = new BindableString();
|
||||
public final BindableString codMart = new BindableString();
|
||||
public final BindableString partitaMag = new BindableString();
|
||||
public final BindableString productDescription = new BindableString();
|
||||
private Runnable onResumeRunnable = null;
|
||||
|
||||
private int barcodeScannerIstanceID = -1;
|
||||
|
||||
@Inject
|
||||
ProdDettaglioLineaViewModel mViewModel;
|
||||
|
||||
@Inject
|
||||
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||
|
||||
|
||||
public static Intent newInstance(Context context, ProdLineStatusDTO prodLine) {
|
||||
Intent myIntent = new Intent(context, ProdDettaglioLineaActivity.class);
|
||||
String keyLine = DataCache.addItem(prodLine);
|
||||
myIntent.putExtra(DATA_KEY_LINE, keyLine);
|
||||
return myIntent;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
mBinding = ActivityProdDettaglioLineaBinding.inflate(getLayoutInflater());
|
||||
setContentView(mBinding.getRoot());
|
||||
setSupportActionBar(mBinding.toolbar);
|
||||
setTitle(R.string.line_details);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
ProdLineStatusDTO lineaProd = DataCache.retrieveItem(getIntent().getStringExtra(DATA_KEY_LINE));
|
||||
if (lineaProd == null) {
|
||||
Toast.makeText(this, "Selezionare una linea di produzione e riprovare", Toast.LENGTH_SHORT).show();
|
||||
close();
|
||||
return;
|
||||
}
|
||||
|
||||
MainApplication.appComponent
|
||||
.prodDettaglioLineaComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
|
||||
mViewModel.setListener(this);
|
||||
mBinding.setViewModel(mViewModel);
|
||||
mBinding.setView(this);
|
||||
this.init();
|
||||
mViewModel.init(lineaProd);
|
||||
|
||||
}
|
||||
|
||||
private void init() {
|
||||
initBarcodeReader();
|
||||
mViewModel.lineaProd.observe(this, lineaProd -> {
|
||||
this.listaOrd.set(lineaProd.getListaOrd());
|
||||
this.lineaLabel.set(lineaProd.getLabel());
|
||||
this.isStarted.set(lineaProd.isStarted());
|
||||
this.isPaused.set(lineaProd.isPaused());
|
||||
this.partitaMag.set(lineaProd.getPartitaMag());
|
||||
this.codMart.set(lineaProd.getCodMart());
|
||||
this.productDescription.set(lineaProd.getDescrizioneProd());
|
||||
this.flagShowProdInfo.set(lineaProd.isStarted() && !UtilityString.isNullOrEmpty(lineaProd.getCodMart()));
|
||||
this.hrNum.set(lineaProd.getQtaAllocate().toString());
|
||||
});
|
||||
listaOrd.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
renderOrdersChips();
|
||||
}
|
||||
});
|
||||
getSupportFragmentManager()
|
||||
.setFragmentResultListener(DATA_KEY_FRAGMENT_LISTENER, this, (requestKey, result) -> {
|
||||
if (onResumeRunnable != null) {
|
||||
onResumeRunnable.run();
|
||||
onResumeRunnable = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void renderOrdersChips() {
|
||||
mBinding.ordersList.removeAllViews();
|
||||
String listaOrdString = listaOrd.get();
|
||||
if (!UtilityString.isNullOrEmpty(listaOrdString)) {
|
||||
for (String ord : listaOrdString.split("\\|")) {
|
||||
Chip chip = new Chip(this);
|
||||
chip.setClickable(false);
|
||||
chip.setText(ord);
|
||||
mBinding.ordersList.addView(chip);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onSupportNavigateUp() {
|
||||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSettingsRequest(ProdLineStatusDTO lineaProd) {
|
||||
BottomSheetLineAction.newInstance(lineaProd, this::requestResources, this::requestOrderChange, this::requestProductionStop, this::requestMaterialRecover, BarcodeManager::enable).show(getSupportFragmentManager(), "BottomSheetLineAction");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void confirmInconsistentDeposit(Runnable onConfirm) {
|
||||
this.runOnUiThread(() -> {
|
||||
DialogSimpleMessageView.makeWarningDialog(
|
||||
Html.fromHtml("L'articolo che si vuole versare non è compatibile con nessun ordine presente sulla linea!"
|
||||
+ "<br /> <br/>" +
|
||||
"Vuoi versarlo comunque?"),
|
||||
null,
|
||||
onConfirm,
|
||||
() -> {
|
||||
onLoadingEnded();
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
).show(getSupportFragmentManager(), "confirmOrderClose");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestQtaVersamento(MtbColr mtbColr,
|
||||
RunnableArgs<PickedQuantityDTO> onComplete) {
|
||||
onLoadingStarted();
|
||||
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||
.setMtbAart(mtbColr.getMtbAart())
|
||||
.setInitialNumCnf(mtbColr.getNumCnf())
|
||||
.setInitialQtaCnf(mtbColr.getQtaCnf())
|
||||
.setInitialQtaTot(mtbColr.getQtaCol())
|
||||
.setTotalQtaAvailable(mtbColr.getQtaCol())
|
||||
.setTotalNumCnfAvailable(mtbColr.getNumCnf())
|
||||
.setQtaCnfAvailable(mtbColr.getQtaCnf())
|
||||
.setPartitaMag(mtbColr.getPartitaMag())
|
||||
.setDataScad(mtbColr.getDataScadPartitaD())
|
||||
.setCanOverflowOrderQuantity(false)
|
||||
.setCanPartitaMagBeChanged(false)
|
||||
.setCanLUBeClosed(false)
|
||||
.setFocusOnStart(false);
|
||||
|
||||
if (!mDialogInputQuantityV2View.isVisible())
|
||||
this.runOnUiThread(() -> {
|
||||
onLoadingEnded();
|
||||
mDialogInputQuantityV2View
|
||||
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||
|
||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||
.setNumCnf(resultDTO.getNumCnf())
|
||||
.setQtaCnf(resultDTO.getQtaCnf())
|
||||
.setQtaTot(resultDTO.getQtaTot())
|
||||
.setPartitaMag(resultDTO.getPartitaMag())
|
||||
.setDataScad(resultDTO.getDataScad());
|
||||
|
||||
onComplete.run(pickedQuantityDTO);
|
||||
|
||||
})
|
||||
.setOnAbort(this::onLoadingEnded)
|
||||
.show(this.getSupportFragmentManager(), "tag");
|
||||
});
|
||||
else this.onLoadingEnded();
|
||||
}
|
||||
|
||||
public void onLineStop() {
|
||||
onBackPressed();
|
||||
}
|
||||
|
||||
|
||||
private void initBarcodeReader() {
|
||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessful(onScanSuccessful)
|
||||
.setOnScanFailed(this::onError));
|
||||
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
|
||||
public void requestResources() {
|
||||
this.onLoadingEnded();
|
||||
BarcodeManager.disable();
|
||||
|
||||
this.runOnUiThread(() -> {
|
||||
|
||||
DialogSimpleInputHelper.makeInputDialog(this, "Inserisci il numero di risorse da allocare", this.hrNum.get(), "n. risorse", qta -> {
|
||||
this.onLoadingStarted();
|
||||
try {
|
||||
Integer hrNum = Integer.parseInt(qta);
|
||||
this.mViewModel.startProductionLine(hrNum);
|
||||
} catch (NumberFormatException ex) {
|
||||
this.onError(new Exception("Inserire un numero di risorse valido"));
|
||||
}
|
||||
}, BarcodeManager::enable, InputType.TYPE_CLASS_NUMBER).show();
|
||||
});
|
||||
}
|
||||
|
||||
public void requestOrderChange() {
|
||||
this.onLoadingEnded();
|
||||
this.runOnUiThread(() -> {
|
||||
DialogStartProduction.newInstance((dto) -> {
|
||||
this.mViewModel.checkBarcodeAndStartOrdine(dto);
|
||||
}).show(getSupportFragmentManager(), "DialogStartProduction");
|
||||
});
|
||||
}
|
||||
|
||||
public void requestProductionStop() {
|
||||
this.onLoadingEnded();
|
||||
BarcodeManager.disable();
|
||||
ProdLineStatusDTO lineaProd = mViewModel.getLineaProd();
|
||||
if (UtilityString.isNullOrEmpty(lineaProd.getListaOrd())) {
|
||||
mViewModel.stopProduction();
|
||||
} else {
|
||||
this.confirmOrderClose(() -> {
|
||||
mViewModel.stopProduction();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void requestMaterialRecover() {
|
||||
this.onLoadingEnded();
|
||||
BarcodeManager.disable();
|
||||
this.runOnUiThread(() -> {
|
||||
getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.add(R.id.frame_layout_container,
|
||||
ProdRecuperoMaterialeFragment.newInstance(null, DATA_KEY_FRAGMENT_LISTENER))
|
||||
.addToBackStack("ProdRecuperoMaterialeFragment")
|
||||
.commit();
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void successDialog(String message, Runnable onComplete) {
|
||||
BarcodeManager.disable();
|
||||
|
||||
this.runOnUiThread(() -> DialogSimpleMessageView.makeSuccessDialog(getResources().getString(R.string.success),
|
||||
new SpannableString(message), null, onComplete).show(getSupportFragmentManager(), "successDialog"));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showToast(String message, Runnable onComplete) {
|
||||
this.runOnUiThread(() -> {
|
||||
UtilityToast.showToast(message);
|
||||
onComplete.run();
|
||||
});
|
||||
}
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.processBarcodeDTO(data, this::onLoadingEnded);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@Override
|
||||
public void confirmOrderClose(Runnable onConfirm) {
|
||||
this.onLoadingEnded();
|
||||
this.runOnUiThread(() -> {
|
||||
DialogSimpleMessageView.makeWarningDialog(
|
||||
Html.fromHtml("Per completare l'operazione è necessario chiudere gli ordini attualmente aperti sulla linea."
|
||||
+ "<br /> <br/>" +
|
||||
"Continuare?"),
|
||||
null,
|
||||
() -> {
|
||||
DialogSimpleMessageView.makeInfoDialog(
|
||||
null,
|
||||
Html.fromHtml("Vuoi recuperare del materiale prima di chiudere gli ordini?"),
|
||||
null,
|
||||
() -> {
|
||||
onResumeRunnable = onConfirm;
|
||||
this.requestMaterialRecover();
|
||||
},
|
||||
onConfirm
|
||||
).show(getSupportFragmentManager(), "confirmOrderClose");
|
||||
},
|
||||
BarcodeManager::enable
|
||||
).show(getSupportFragmentManager(), "confirmOrderClose");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void close() {
|
||||
onBackPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
int count = getSupportFragmentManager().getBackStackEntryCount();
|
||||
if (count > 0) {
|
||||
getSupportFragmentManager().popBackStack();
|
||||
} else {
|
||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package it.integry.integrywmsnative.gest.prod_dettaglio_linea;
|
||||
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface ProdDettaglioLineaComponent {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
|
||||
ProdDettaglioLineaComponent create();
|
||||
}
|
||||
|
||||
void inject(ProdDettaglioLineaActivity prodDettaglioLineaActivity);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package it.integry.integrywmsnative.gest.prod_dettaglio_linea;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||
|
||||
@Module(subcomponents = ProdDettaglioLineaComponent.class)
|
||||
public class ProdDettaglioLineaModule {
|
||||
|
||||
|
||||
@Provides
|
||||
ProdDettaglioLineaViewModel providesProdDettaglioLineaViewModel(ProductionLinesRESTConsumer productionLinesRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, MesRESTConsumer mesRESTConsumer) {
|
||||
return new ProdDettaglioLineaViewModel(productionLinesRESTConsumer, barcodeRESTConsumer, colliMagazzinoRESTConsumer, mesRESTConsumer);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
package it.integry.integrywmsnative.gest.prod_dettaglio_linea;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
|
||||
public class ProdDettaglioLineaViewModel {
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
private final ProductionLinesRESTConsumer productionLinesRESTConsumer;
|
||||
private final ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer;
|
||||
private final MesRESTConsumer mesRESTConsumer;
|
||||
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
|
||||
public final MutableLiveData<ProdLineStatusDTO> lineaProd = new MutableLiveData<>();
|
||||
|
||||
|
||||
@Inject
|
||||
public ProdDettaglioLineaViewModel(ProductionLinesRESTConsumer productionLinesRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, ColliMagazzinoRESTConsumer magazzinoRESTConsumer, MesRESTConsumer mesRESTConsumer) {
|
||||
this.productionLinesRESTConsumer = productionLinesRESTConsumer;
|
||||
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||
this.colliMagazzinoRESTConsumer = magazzinoRESTConsumer;
|
||||
this.mesRESTConsumer = mesRESTConsumer;
|
||||
}
|
||||
|
||||
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||
this.executeEtichettaAnonima(barcodeScanDTO, onComplete);
|
||||
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||
this.executeEAN128(barcodeScanDTO, onComplete);
|
||||
} else {
|
||||
onComplete.run();
|
||||
}
|
||||
}
|
||||
|
||||
private void executeEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
handleSSCCBarcode(barcodeScanDTO.getStringValue(), onComplete);
|
||||
}
|
||||
|
||||
private void handleSSCCBarcode(String sscc, Runnable onComplete) {
|
||||
this.colliMagazzinoRESTConsumer.getBySSCC(sscc, true, false, mtbColt -> {
|
||||
|
||||
if (mtbColt == null) {
|
||||
this.sendError(new NoLUFoundException());
|
||||
} else {
|
||||
if (mtbColt.getMtbColr().size() <= 0) {
|
||||
this.sendError(new Exception("E' stata scansionata una UL già vuota"));
|
||||
} else {
|
||||
this.sendOnLUSelected(mtbColt);
|
||||
}
|
||||
}
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void sendOnLUSelected(MtbColt mtbColt) {
|
||||
this.sendOnLoadingStarted();
|
||||
this.checkOrdersCompatibility(mtbColt, () -> {
|
||||
MtbColr row = mtbColt.getMtbColr().get(0);
|
||||
mListener.requestQtaVersamento(
|
||||
row,
|
||||
dto -> {
|
||||
sendOnLoadingStarted();
|
||||
row.setQtaCnf(dto.getQtaCnf());
|
||||
row.setNumCnf(dto.getNumCnf());
|
||||
row.setQtaCol(dto.getQtaTot());
|
||||
row.setPesoLordoKg(null);
|
||||
row.setPesoNettoKg(null);
|
||||
ProdLineStatusDTO prodLine = lineaProd.getValue();
|
||||
MtbDepoPosizione posizione = new MtbDepoPosizione();
|
||||
posizione.setPosizione(prodLine.getCodJfas());
|
||||
posizione.setCodMdep(prodLine.getCodMdepLav());
|
||||
posizione.setFlagLineaProduzione("S");
|
||||
this.colliMagazzinoRESTConsumer.createColloScaricoDaCarico(mtbColt, posizione,
|
||||
generatedMtbColt -> {
|
||||
this.sendOnLoadingEnded();
|
||||
this.mListener.showToast("Versamento completato!", BarcodeManager::enable);
|
||||
}, this::sendError);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private void checkOrdersCompatibility(MtbColt mtbColt, Runnable onComplete) {
|
||||
mesRESTConsumer.getOrdiniLavorazioneMateriale(lineaProd.getValue().getCodJfas(), getIdMaterialeFromCollo(mtbColt), ordini -> {
|
||||
if (ordini != null && ordini.size() > 0) {
|
||||
onComplete.run();
|
||||
} else {
|
||||
this.mListener.confirmInconsistentDeposit(onComplete);
|
||||
}
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private String getIdMaterialeFromCollo(MtbColt mtbColt) {
|
||||
MtbAart articolo = mtbColt.getMtbColr().get(0).getMtbAart();
|
||||
return UtilityString.isNullOrEmpty(articolo.getIdArtEqui()) ? articolo.getCodMart() : articolo.getIdArtEqui();
|
||||
}
|
||||
|
||||
|
||||
private void executeEAN128(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
this.mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
||||
if (ean128Model != null && !UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
||||
handleSSCCBarcode(ean128Model.Sscc, onComplete);
|
||||
} else {
|
||||
this.sendError(new NoLUFoundException());
|
||||
}
|
||||
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
public void settings() {
|
||||
this.mListener.onSettingsRequest(lineaProd.getValue());
|
||||
}
|
||||
|
||||
private void sendOnLoadingStarted() {
|
||||
if (this.mListener != null) mListener.onLoadingStarted();
|
||||
}
|
||||
|
||||
private void sendOnLoadingEnded() {
|
||||
if (this.mListener != null) mListener.onLoadingEnded();
|
||||
}
|
||||
|
||||
private void sendError(Exception ex) {
|
||||
if (this.mListener != null) mListener.onError(ex);
|
||||
}
|
||||
|
||||
public void startProductionLine(Integer hrNum) {
|
||||
this.sendOnLoadingStarted();
|
||||
ProdLineStatusDTO prodLine = lineaProd.getValue();
|
||||
this.productionLinesRESTConsumer.avviaLineaDiProduzione(prodLine.getCodJfas(),
|
||||
hrNum,
|
||||
() -> this.mListener.successDialog("Operazione completata", this::loadLineDetails),
|
||||
this::sendError);
|
||||
}
|
||||
|
||||
|
||||
private void startProduction(String codMart, String partitaMag) {
|
||||
this.sendOnLoadingStarted();
|
||||
ProdLineStatusDTO prodLine = lineaProd.getValue();
|
||||
this.productionLinesRESTConsumer.avviaProduzioneArticoloSuLinea(prodLine.getCodJfas(), codMart, partitaMag,
|
||||
() -> this.mListener.successDialog("Operazione completata", this::loadLineDetails),
|
||||
this::sendError);
|
||||
}
|
||||
|
||||
public void stopProduction() {
|
||||
this.sendOnLoadingStarted();
|
||||
ProdLineStatusDTO prodLine = lineaProd.getValue();
|
||||
this.productionLinesRESTConsumer.arrestaLineaDiProduzione(prodLine.getCodJfas(),
|
||||
() -> this.mListener.successDialog("Operazione completata", this::onLineStop),
|
||||
this::sendError);
|
||||
}
|
||||
|
||||
private void onLineStop() {
|
||||
this.mListener.onLineStop();
|
||||
}
|
||||
|
||||
public void checkBarcodeAndStartOrdine(BarcodeScanDTO dto) {
|
||||
this.sendOnLoadingStarted();
|
||||
ProdLineStatusDTO prodLine = lineaProd.getValue();
|
||||
mBarcodeRESTConsumer.decodeEan128(dto, (ean128) -> {
|
||||
String codMart = ean128.Content;
|
||||
String partitaMag = ean128.BatchLot;
|
||||
if (!prodLine.isStarted()) {
|
||||
this.sendError(new Exception("Impossibile avviare una produzione su una linea ferma!"));
|
||||
} else if (UtilityString.isNullOrEmpty(prodLine.getListaOrd())) {
|
||||
this.startProduction(codMart, partitaMag);
|
||||
} else {
|
||||
this.mListener.confirmOrderClose(() -> {
|
||||
this.startProduction(codMart, partitaMag);
|
||||
});
|
||||
}
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
public void loadLineDetails() {
|
||||
sendOnLoadingStarted();
|
||||
if (lineaProd.getValue() == null) {
|
||||
this.sendError(new Exception("Nessuna linea selezionata!"));
|
||||
return;
|
||||
}
|
||||
productionLinesRESTConsumer.getLineDetails(lineaProd.getValue(), linea -> {
|
||||
this.lineaProd.postValue(linea);
|
||||
sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
public void init(ProdLineStatusDTO lineaProd) {
|
||||
this.lineaProd.setValue(lineaProd);
|
||||
this.loadLineDetails();
|
||||
}
|
||||
|
||||
public ProdLineStatusDTO getLineaProd() {
|
||||
return lineaProd.getValue();
|
||||
}
|
||||
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
void onError(Exception ex);
|
||||
|
||||
void successDialog(String message, Runnable onComplete);
|
||||
|
||||
void showToast(String message, Runnable onComplete);
|
||||
|
||||
void requestQtaVersamento(MtbColr mtbColr, RunnableArgs<PickedQuantityDTO> onComplete);
|
||||
|
||||
void onSettingsRequest(ProdLineStatusDTO lineaProd);
|
||||
|
||||
void confirmInconsistentDeposit(Runnable onConfirm);
|
||||
|
||||
void onLineStop();
|
||||
|
||||
void confirmOrderClose(Runnable onConfirm);
|
||||
}
|
||||
|
||||
public ProdDettaglioLineaViewModel setListener(Listener listener) {
|
||||
this.mListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.integry.integrywmsnative.gest.prod_linee_produzione.dialogs;
|
||||
package it.integry.integrywmsnative.gest.prod_dettaglio_linea.dialogs;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
@@ -11,7 +11,6 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.databinding.BottomSheetLineActionsBinding;
|
||||
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||
|
||||
@@ -20,17 +19,19 @@ public class BottomSheetLineAction extends BottomSheetDialogFragment {
|
||||
private BottomSheetLineActionsBinding mBinding;
|
||||
|
||||
private ProdLineStatusDTO prodLine;
|
||||
private RunnableArgs<ProdLineStatusDTO> onChangeResourcesRequest;
|
||||
private RunnableArgs<ProdLineStatusDTO> onChangeOrdersRequest;
|
||||
private RunnableArgs<ProdLineStatusDTO> onLineCloseRequest;
|
||||
private Runnable onChangeResourcesRequest;
|
||||
private Runnable onChangeOrdersRequest;
|
||||
private Runnable onLineCloseRequest;
|
||||
private Runnable onRecoverRequest;
|
||||
private Runnable onCancelAction;
|
||||
|
||||
public static BottomSheetLineAction newInstance(ProdLineStatusDTO dto, RunnableArgs<ProdLineStatusDTO> onChangeResourcesRequest, RunnableArgs<ProdLineStatusDTO> onChangeOrdersRequest, RunnableArgs<ProdLineStatusDTO> onLineCloseRequest, Runnable onCancel) {
|
||||
public static BottomSheetLineAction newInstance(ProdLineStatusDTO dto, Runnable onChangeResourcesRequest, Runnable onChangeOrdersRequest, Runnable onLineCloseRequest, Runnable onRecoverRequest, Runnable onCancel) {
|
||||
BottomSheetLineAction fragment = new BottomSheetLineAction();
|
||||
fragment
|
||||
.setProdLine(dto)
|
||||
.setOnChangeResourcesRequest(onChangeResourcesRequest)
|
||||
.setOnChangeOrdersRequest(onChangeOrdersRequest)
|
||||
.setOnRecoverRequest(onRecoverRequest)
|
||||
.setOnLineCloseRequest(onLineCloseRequest)
|
||||
.setOnCancelAction(onCancel);
|
||||
return fragment;
|
||||
@@ -53,19 +54,24 @@ public class BottomSheetLineAction extends BottomSheetDialogFragment {
|
||||
return this;
|
||||
}
|
||||
|
||||
public BottomSheetLineAction setOnChangeResourcesRequest(RunnableArgs<ProdLineStatusDTO> onChangeResourcesRequest) {
|
||||
public BottomSheetLineAction setOnChangeResourcesRequest(Runnable onChangeResourcesRequest) {
|
||||
this.onChangeResourcesRequest = onChangeResourcesRequest;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public BottomSheetLineAction setOnChangeOrdersRequest(RunnableArgs<ProdLineStatusDTO> onChangeOrdersRequest) {
|
||||
public BottomSheetLineAction setOnChangeOrdersRequest(Runnable onChangeOrdersRequest) {
|
||||
this.onChangeOrdersRequest = onChangeOrdersRequest;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BottomSheetLineAction setOnRecoverRequest(Runnable onRecoverRequest) {
|
||||
this.onRecoverRequest = onRecoverRequest;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BottomSheetLineAction setOnLineCloseRequest(RunnableArgs<ProdLineStatusDTO> onLineCloseRequest) {
|
||||
|
||||
public BottomSheetLineAction setOnLineCloseRequest(Runnable onLineCloseRequest) {
|
||||
this.onLineCloseRequest = onLineCloseRequest;
|
||||
return this;
|
||||
}
|
||||
@@ -81,7 +87,7 @@ public class BottomSheetLineAction extends BottomSheetDialogFragment {
|
||||
|
||||
public void onResourcesClicked() {
|
||||
if (this.onChangeResourcesRequest != null) {
|
||||
this.onChangeResourcesRequest.run(prodLine);
|
||||
this.onChangeResourcesRequest.run();
|
||||
}
|
||||
this.dismiss();
|
||||
|
||||
@@ -89,14 +95,21 @@ public class BottomSheetLineAction extends BottomSheetDialogFragment {
|
||||
|
||||
public void onPlayClicked() {
|
||||
if (this.onChangeOrdersRequest != null) {
|
||||
this.onChangeOrdersRequest.run(prodLine);
|
||||
this.onChangeOrdersRequest.run();
|
||||
}
|
||||
this.dismiss();
|
||||
}
|
||||
|
||||
public void onStopClicked() {
|
||||
if (this.onLineCloseRequest != null) {
|
||||
this.onLineCloseRequest.run(prodLine);
|
||||
this.onLineCloseRequest.run();
|
||||
}
|
||||
this.dismiss();
|
||||
}
|
||||
|
||||
public void onRecoverClicked() {
|
||||
if (this.onRecoverRequest != null) {
|
||||
this.onRecoverRequest.run();
|
||||
}
|
||||
this.dismiss();
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package it.integry.integrywmsnative.gest.prod_dettaglio_linea.dialogs;
|
||||
|
||||
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 androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.databinding.DialogStartProductionBinding;
|
||||
|
||||
public class DialogRecoverUl extends BaseDialogFragment {
|
||||
private int barcodeScannerIstanceID = -1;
|
||||
private RunnableArgs<BarcodeScanDTO> onScanSuccessful;
|
||||
private DialogStartProductionBinding mBinding;
|
||||
|
||||
public static DialogRecoverUl newInstance(RunnableArgs<BarcodeScanDTO> onScanSuccessful) {
|
||||
|
||||
Bundle args = new Bundle();
|
||||
|
||||
DialogRecoverUl fragment = new DialogRecoverUl();
|
||||
fragment.setArguments(args);
|
||||
fragment.setOnScanSuccessful(onScanSuccessful);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||
super.onDismiss(dialog);
|
||||
}
|
||||
|
||||
public DialogRecoverUl setOnScanSuccessful(RunnableArgs<BarcodeScanDTO> onScanSuccessful) {
|
||||
this.onScanSuccessful = onScanSuccessful;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBinding = DialogStartProductionBinding.inflate(inflater, container, false);
|
||||
mBinding.setLifecycleOwner(this);
|
||||
this.initBarcodeReader();
|
||||
setCancelable(true);
|
||||
getDialog().setCanceledOnTouchOutside(true);
|
||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
return mBinding.getRoot();
|
||||
}
|
||||
|
||||
|
||||
private void initBarcodeReader() {
|
||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessful(this::processBarcode)
|
||||
.setOnScanFailed(this::onError));
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
private void processBarcode(BarcodeScanDTO barcodeScanDTO) {
|
||||
if (UtilityBarcode.isEan128(barcodeScanDTO)) {
|
||||
this.onScanSuccessful.run(barcodeScanDTO);
|
||||
this.dismiss();
|
||||
} else {
|
||||
this.onError(new Exception("Il barcode scansionato non è valido!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package it.integry.integrywmsnative.gest.prod_linee_produzione.dialogs;
|
||||
package it.integry.integrywmsnative.gest.prod_dettaglio_linea.dialogs;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
@@ -17,12 +17,15 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.DialogStartProductionBinding;
|
||||
|
||||
public class DialogStartProduction extends BaseDialogFragment {
|
||||
private int barcodeScannerIstanceID = -1;
|
||||
private RunnableArgs<BarcodeScanDTO> onScanSuccessful;
|
||||
private DialogStartProductionBinding mBinding;
|
||||
private String title;
|
||||
private String label;
|
||||
|
||||
public static DialogStartProduction newInstance(RunnableArgs<BarcodeScanDTO> onScanSuccessful) {
|
||||
|
||||
@@ -34,6 +37,23 @@ public class DialogStartProduction extends BaseDialogFragment {
|
||||
return fragment;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public DialogStartProduction setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public DialogStartProduction setLabel(String label) {
|
||||
this.label = label;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
@@ -55,6 +75,14 @@ public class DialogStartProduction extends BaseDialogFragment {
|
||||
setCancelable(true);
|
||||
getDialog().setCanceledOnTouchOutside(true);
|
||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(title)) {
|
||||
mBinding.titleText.setText(title);
|
||||
}
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(label)) {
|
||||
mBinding.scanLabel.setText(label);
|
||||
}
|
||||
return mBinding.getRoot();
|
||||
}
|
||||
|
||||
@@ -68,8 +96,8 @@ public class DialogStartProduction extends BaseDialogFragment {
|
||||
|
||||
private void processBarcode(BarcodeScanDTO barcodeScanDTO) {
|
||||
if (UtilityBarcode.isEan128(barcodeScanDTO)) {
|
||||
this.onScanSuccessful.run(barcodeScanDTO);
|
||||
this.dismiss();
|
||||
this.onScanSuccessful.run(barcodeScanDTO);
|
||||
} else {
|
||||
this.onError(new Exception("Il barcode scansionato non è valido!"));
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package it.integry.integrywmsnative.gest.prod_linee_produzione;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.InputType;
|
||||
import android.text.SpannableString;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -10,9 +9,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -27,10 +24,8 @@ import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.FragmentLineeProdBinding;
|
||||
import it.integry.integrywmsnative.gest.prod_linee_produzione.dialogs.BottomSheetLineAction;
|
||||
import it.integry.integrywmsnative.gest.prod_linee_produzione.dialogs.DialogStartProduction;
|
||||
import it.integry.integrywmsnative.gest.prod_dettaglio_linea.ProdDettaglioLineaActivity;
|
||||
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||
import it.integry.integrywmsnative.gest.prod_linee_produzione.ui.LinesListAdapter;
|
||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||
@@ -47,11 +42,6 @@ public class ProdLineeProduzioneFragment extends BaseFragment implements ITitled
|
||||
private FragmentLineeProdBinding mBinding;
|
||||
private ElevatedToolbar mToolbar;
|
||||
private int barcodeScannerIstanceID = -1;
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.processBarcodeDTO(data);
|
||||
};
|
||||
|
||||
public static ProdLineeProduzioneFragment newInstance() {
|
||||
return new ProdLineeProduzioneFragment();
|
||||
@@ -60,8 +50,7 @@ public class ProdLineeProduzioneFragment extends BaseFragment implements ITitled
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
|
||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_linee_prod, container, false);
|
||||
mBinding = FragmentLineeProdBinding.inflate(inflater, container, false);
|
||||
MainApplication.appComponent
|
||||
.prodLineeProduzioneComponent()
|
||||
.create()
|
||||
@@ -71,17 +60,28 @@ public class ProdLineeProduzioneFragment extends BaseFragment implements ITitled
|
||||
mBinding.setLifecycleOwner(this);
|
||||
this.initRecyclerView();
|
||||
this.initBarcodeReader();
|
||||
mViewModel.init();
|
||||
|
||||
return mBinding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
mViewModel.init();
|
||||
}
|
||||
|
||||
|
||||
private void initBarcodeReader() {
|
||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessful(onScanSuccessful)
|
||||
.setOnScanFailed(this::onError));
|
||||
}
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
this.onLoadingStarted();
|
||||
this.mViewModel.processBarcodeDTO(data);
|
||||
};
|
||||
|
||||
@Override
|
||||
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||
mToolbar = toolbar;
|
||||
@@ -97,11 +97,14 @@ public class ProdLineeProduzioneFragment extends BaseFragment implements ITitled
|
||||
|
||||
private void initRecyclerView() {
|
||||
this.mViewModel.getProdLinesList().observe(getViewLifecycleOwner(), this::refreshLineeProd);
|
||||
LinesListAdapter prodLinesListAdapter = new LinesListAdapter(this.requireActivity(), this.mLinesObservableList);
|
||||
prodLinesListAdapter.setEmptyView(this.mBinding.linesListEmptyView);
|
||||
|
||||
LinesListAdapter prodLinesListAdapter = new LinesListAdapter(this.mLinesObservableList);
|
||||
this.mBinding.linesMainList.setAdapter(prodLinesListAdapter);
|
||||
this.mBinding.linesMainList.setLayoutManager(new LinearLayoutManager(this.requireActivity()));
|
||||
prodLinesListAdapter.setOnItemClicked(this.mViewModel::onLineSelected);
|
||||
|
||||
prodLinesListAdapter
|
||||
.setOnItemClicked(this::selectLine)
|
||||
.setEmptyView(this.mBinding.linesListEmptyView);
|
||||
|
||||
if (mToolbar != null)
|
||||
mToolbar.setRecyclerView(this.mBinding.linesMainList);
|
||||
}
|
||||
@@ -111,7 +114,7 @@ public class ProdLineeProduzioneFragment extends BaseFragment implements ITitled
|
||||
BarcodeManager.disable();
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
|
||||
DialogSimpleInputHelper.makeInputDialog(requireContext(), "Inserisci il numero di risorse da allocare", qta -> {
|
||||
DialogSimpleInputHelper.makeInputDialog(requireContext(), "Inserisci il numero di risorse da allocare", prodLine.getQtaAllocate().toString(), "n. risorse", qta -> {
|
||||
this.onLoadingStarted();
|
||||
try {
|
||||
Integer hrNum = Integer.parseInt(qta);
|
||||
@@ -123,28 +126,6 @@ public class ProdLineeProduzioneFragment extends BaseFragment implements ITitled
|
||||
});
|
||||
}
|
||||
|
||||
public void requestOrderChange(ProdLineStatusDTO prodLine) {
|
||||
this.onLoadingEnded();
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
DialogStartProduction.newInstance((dto) -> {
|
||||
this.mViewModel.checkBarcodeAndStartOrdine(prodLine, dto);
|
||||
}).show(getChildFragmentManager(), "DialogStartProduction");
|
||||
});
|
||||
}
|
||||
|
||||
public void requestProductionStop(ProdLineStatusDTO prodLine) {
|
||||
this.onLoadingEnded();
|
||||
BarcodeManager.disable();
|
||||
if (UtilityString.isNullOrEmpty(prodLine.getListaOrd())) {
|
||||
mViewModel.stopProduction(prodLine);
|
||||
} else {
|
||||
this.confirmOrderClose(() -> {
|
||||
mViewModel.stopProduction(prodLine);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void successDialog(String message, Runnable onComplete) {
|
||||
BarcodeManager.disable();
|
||||
@@ -157,28 +138,14 @@ public class ProdLineeProduzioneFragment extends BaseFragment implements ITitled
|
||||
public void selectLine(ProdLineStatusDTO dto) {
|
||||
this.onLoadingEnded();
|
||||
BarcodeManager.disable();
|
||||
|
||||
if (!dto.isStarted()) {
|
||||
this.requestResources(dto);
|
||||
} else {
|
||||
BottomSheetLineAction.newInstance(dto, this::requestResources, this::requestOrderChange, this::requestProductionStop, BarcodeManager::enable).show(getChildFragmentManager(), "BottomSheetLineAction");
|
||||
requireActivity().startActivity(ProdDettaglioLineaActivity.newInstance(requireActivity(), dto));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void confirmOrderClose(Runnable onConfirm) {
|
||||
this.onLoadingEnded();
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
DialogSimpleMessageView.makeWarningDialog(
|
||||
Html.fromHtml("Per completare l'operazione è necessario chiudere gli ordini attualmente aperti sulla linea."
|
||||
+ "<br /> <br/>" +
|
||||
"Continuare?"),
|
||||
null,
|
||||
onConfirm,
|
||||
BarcodeManager::enable
|
||||
).show(getChildFragmentManager(), "confirmOrderClose");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package it.integry.integrywmsnative.gest.prod_linee_produzione;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceComponent;
|
||||
|
||||
@@ -12,14 +9,8 @@ import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceCompo
|
||||
public class ProdLineeProduzioneModule {
|
||||
|
||||
@Provides
|
||||
ProdLineeProduzioneViewModel providesProdRientroMerceViewModel(ProductionLinesRESTConsumer productionLinesRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer) {
|
||||
return new ProdLineeProduzioneViewModel(productionLinesRESTConsumer, barcodeRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ProductionLinesRESTConsumer providesProductionLinesRESTConsumer() {
|
||||
return new ProductionLinesRESTConsumer();
|
||||
ProdLineeProduzioneViewModel providesProdRientroMerceViewModel(ProductionLinesRESTConsumer productionLinesRESTConsumer) {
|
||||
return new ProdLineeProduzioneViewModel(productionLinesRESTConsumer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,40 +11,34 @@ import javax.inject.Inject;
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||
|
||||
public class ProdLineeProduzioneViewModel {
|
||||
|
||||
|
||||
private final ProductionLinesRESTConsumer productionLinesRESTConsumer;
|
||||
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
|
||||
private final MutableLiveData<List<ProdLineStatusDTO>> prodLines = new MutableLiveData<>();
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
@Inject
|
||||
public ProdLineeProduzioneViewModel(ProductionLinesRESTConsumer productionLinesRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer) {
|
||||
public ProdLineeProduzioneViewModel(ProductionLinesRESTConsumer productionLinesRESTConsumer) {
|
||||
this.productionLinesRESTConsumer = productionLinesRESTConsumer;
|
||||
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
this.sendOnLoadingStarted();
|
||||
reloadLines();
|
||||
|
||||
}
|
||||
|
||||
private void reloadLines() {
|
||||
BarcodeManager.disable();
|
||||
sendOnLoadingStarted();
|
||||
BarcodeManager.disable();
|
||||
this.productionLinesRESTConsumer.getStatoLinee(SettingsManager.i().getUserSession().getDepo().getCodMdep(), lineeProdList -> {
|
||||
this.sendOnLoadingEnded();
|
||||
BarcodeManager.enable();
|
||||
prodLines.postValue(lineeProdList);
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
@@ -58,15 +52,12 @@ public class ProdLineeProduzioneViewModel {
|
||||
|
||||
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO) {
|
||||
String codJfas = barcodeScanDTO.getStringValue();
|
||||
|
||||
ProdLineStatusDTO prodLine = prodLines.getValue() != null ? Stream.of(prodLines.getValue()).filter(x -> x.getCodJfas().equalsIgnoreCase(codJfas)).findFirstOrElse(null) : null;
|
||||
if (prodLine != null) {
|
||||
this.onLineSelected(prodLine);
|
||||
} else {
|
||||
this.sendError(new Exception("Linea di produzione " + codJfas + " non trovata"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -94,37 +85,6 @@ public class ProdLineeProduzioneViewModel {
|
||||
mListener.selectLine(lineSelected);
|
||||
}
|
||||
|
||||
public void checkBarcodeAndStartOrdine(ProdLineStatusDTO prodLine, BarcodeScanDTO dto) {
|
||||
this.sendOnLoadingStarted();
|
||||
mBarcodeRESTConsumer.decodeEan128(dto, (ean128) -> {
|
||||
String codMart = ean128.Content;
|
||||
String partitaMag = ean128.BatchLot;
|
||||
if (!prodLine.isStarted()) {
|
||||
this.sendError(new Exception("Impossibile avviare una produzione su una linea ferma!"));
|
||||
} else if (UtilityString.isNullOrEmpty(prodLine.getListaOrd())) {
|
||||
this.startProduction(prodLine, codMart, partitaMag);
|
||||
} else {
|
||||
this.mListener.confirmOrderClose(() -> {
|
||||
this.startProduction(prodLine, codMart, partitaMag);
|
||||
});
|
||||
}
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void startProduction(ProdLineStatusDTO prodLine, String codMart, String partitaMag) {
|
||||
this.sendOnLoadingStarted();
|
||||
this.productionLinesRESTConsumer.avviaProduzioneArticoloSuLinea(prodLine.getCodJfas(), codMart, partitaMag,
|
||||
() -> this.mListener.successDialog("Operazione completata", this::reloadLines),
|
||||
this::sendError);
|
||||
}
|
||||
|
||||
public void stopProduction(ProdLineStatusDTO prodLine) {
|
||||
this.sendOnLoadingStarted();
|
||||
this.productionLinesRESTConsumer.arrestaLineaDiProduzione(prodLine.getCodJfas(),
|
||||
() -> this.mListener.successDialog("Operazione completata", this::reloadLines),
|
||||
this::sendError);
|
||||
}
|
||||
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
|
||||
@@ -134,8 +94,6 @@ public class ProdLineeProduzioneViewModel {
|
||||
|
||||
void selectLine(ProdLineStatusDTO prodLineStatusDTO);
|
||||
|
||||
void confirmOrderClose(Runnable onConfirm);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,12 +16,18 @@ public class ProdLineStatusDTO {
|
||||
|
||||
private Date datetimeEnd;
|
||||
|
||||
private String codMart;
|
||||
|
||||
private String partitaMag;
|
||||
|
||||
private BigDecimal maxAllocazione;
|
||||
|
||||
private Integer qtaAllocate;
|
||||
|
||||
private String listaOrd;
|
||||
|
||||
private String descrizioneProd;
|
||||
|
||||
|
||||
public String getCodJfas() {
|
||||
return codJfas;
|
||||
@@ -126,4 +132,31 @@ public class ProdLineStatusDTO {
|
||||
return qtaAllocate + (maxAllocazione != null && maxAllocazione.compareTo(BigDecimal.ZERO) > 0 ? "/" + maxAllocazione : "");
|
||||
}
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public ProdLineStatusDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public ProdLineStatusDTO setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public String getDescrizioneProd() {
|
||||
return descrizioneProd;
|
||||
}
|
||||
|
||||
public ProdLineStatusDTO setDescrizioneProd(String descrizioneProd) {
|
||||
this.descrizioneProd = descrizioneProd;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package it.integry.integrywmsnative.gest.prod_linee_produzione.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
@@ -16,13 +15,11 @@ import it.integry.integrywmsnative.databinding.FragmentLineeProdMainListModelBin
|
||||
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||
|
||||
public class LinesListAdapter extends ExtendedRecyclerView<ProdLineStatusDTO, LinesListAdapter.SingleItemViewHolder> {
|
||||
private Context mContext;
|
||||
|
||||
private RunnableArgs<ProdLineStatusDTO> mOnItemClicked;
|
||||
|
||||
public LinesListAdapter(Context context, ObservableArrayList<ProdLineStatusDTO> myDataset) {
|
||||
public LinesListAdapter(ObservableArrayList<ProdLineStatusDTO> myDataset) {
|
||||
super(myDataset);
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -38,6 +35,7 @@ public class LinesListAdapter extends ExtendedRecyclerView<ProdLineStatusDTO, Li
|
||||
|
||||
holder.binding.setListModel(line);
|
||||
holder.binding.executePendingBindings();
|
||||
|
||||
holder.binding.getRoot().setOnClickListener(v -> {
|
||||
if (this.mOnItemClicked != null)
|
||||
this.mOnItemClicked.run(line);
|
||||
@@ -45,8 +43,9 @@ public class LinesListAdapter extends ExtendedRecyclerView<ProdLineStatusDTO, Li
|
||||
}
|
||||
|
||||
|
||||
public void setOnItemClicked(RunnableArgs<ProdLineStatusDTO> onItemClicked) {
|
||||
public LinesListAdapter setOnItemClicked(RunnableArgs<ProdLineStatusDTO> onItemClicked) {
|
||||
this.mOnItemClicked = onItemClicked;
|
||||
return this;
|
||||
}
|
||||
|
||||
static class SingleItemViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
@@ -9,10 +9,8 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
@@ -59,6 +57,8 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
private FragmentProdRecuperoMaterialeBinding mBinding;
|
||||
|
||||
private int barcodeScannerIstanceID = -1;
|
||||
private String codJfas;
|
||||
private String fragmentResultKeyString;
|
||||
|
||||
private final ObservableArrayList<HistoryULsListModel> mHistoryULMutableData = new ObservableArrayList<>();
|
||||
|
||||
@@ -67,14 +67,26 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
}
|
||||
|
||||
public static ProdRecuperoMaterialeFragment newInstance() {
|
||||
return newInstance(null, null);
|
||||
}
|
||||
|
||||
public static ProdRecuperoMaterialeFragment newInstance(String codJfas, String keyString) {
|
||||
ProdRecuperoMaterialeFragment fragment = new ProdRecuperoMaterialeFragment();
|
||||
if (keyString != null) {
|
||||
fragment.setFragmentResultKeyString(keyString);
|
||||
}
|
||||
fragment.setCodJfas(codJfas);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
public static ProdRecuperoMaterialeFragment newInstance(String codJfas) {
|
||||
return newInstance(codJfas, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_prod_recupero_materiale, container, false);
|
||||
mBinding = FragmentProdRecuperoMaterialeBinding.inflate(inflater, container, false);
|
||||
|
||||
MainApplication.appComponent
|
||||
.prodRecuperoMaterialeComponent()
|
||||
@@ -89,6 +101,14 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
this.initBarcodeReader();
|
||||
this.initRecyclerView();
|
||||
|
||||
this.addOnPreDestroy(() -> {
|
||||
if (!UtilityString.isNullOrEmpty(fragmentResultKeyString)) {
|
||||
Bundle result = new Bundle();
|
||||
result.putString(fragmentResultKeyString, "result");
|
||||
getParentFragmentManager().setFragmentResult(fragmentResultKeyString, result);
|
||||
}
|
||||
});
|
||||
|
||||
return mBinding.getRoot();
|
||||
}
|
||||
|
||||
@@ -96,8 +116,12 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
|
||||
mViewModel.init();
|
||||
this.addOnPreDestroy(() -> {
|
||||
if (barcodeScannerIstanceID > -1) {
|
||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||
}
|
||||
});
|
||||
mViewModel.init(codJfas);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +139,24 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
public String getCodJfas() {
|
||||
return codJfas;
|
||||
}
|
||||
|
||||
public ProdRecuperoMaterialeFragment setCodJfas(String codJfas) {
|
||||
this.codJfas = codJfas;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFragmentResultKeyString() {
|
||||
return fragmentResultKeyString;
|
||||
}
|
||||
|
||||
public ProdRecuperoMaterialeFragment setFragmentResultKeyString(String fragmentResultKeyString) {
|
||||
this.fragmentResultKeyString = fragmentResultKeyString;
|
||||
return this;
|
||||
}
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
this.onLoadingStarted();
|
||||
|
||||
@@ -124,8 +166,6 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
private void initRecyclerView() {
|
||||
this.mViewModel.getOrderList().observe(getViewLifecycleOwner(), this::refreshList);
|
||||
|
||||
mBinding.prodRecuperoMaterialeMainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
|
||||
HistoryULsListAdapter adapter = new HistoryULsListAdapter(getActivity(), mHistoryULMutableData)
|
||||
.setOnItemClicked(data -> this.mViewModel.dispatchItem(data.getOriginalModel(), null));
|
||||
|
||||
@@ -133,7 +173,9 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
|
||||
mBinding.prodRecuperoMaterialeMainList.setAdapter(adapter);
|
||||
|
||||
mToolbar.setRecyclerView(mBinding.prodRecuperoMaterialeMainList);
|
||||
if (mToolbar != null)
|
||||
mToolbar.setRecyclerView(mBinding.prodRecuperoMaterialeMainList);
|
||||
|
||||
}
|
||||
|
||||
private void refreshList(List<HistoryVersamentoProdULDTO> filteredList) {
|
||||
@@ -230,11 +272,11 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||
this.onLoadingEnded();
|
||||
DialogSimpleMessageView.makeErrorDialog(
|
||||
new SpannableString(ex.getMessage()),
|
||||
null,
|
||||
null,
|
||||
R.string.button_ignore_print,
|
||||
onComplete)
|
||||
new SpannableString(ex.getMessage()),
|
||||
null,
|
||||
null,
|
||||
R.string.button_ignore_print,
|
||||
onComplete)
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
|
||||
@@ -51,11 +51,11 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
this.mPrinterRESTConsumer = printerRESTConsumer;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
public void init(String codJfas) {
|
||||
this.sendOnLoadingStarted();
|
||||
new Thread(() -> {
|
||||
|
||||
mProdRecuperMaterialeRESTConsumer.loadLastULVersate(ulList -> {
|
||||
mProdRecuperMaterialeRESTConsumer.loadLastULVersate(codJfas, ulList -> {
|
||||
this.mUlList.setValue(ulList);
|
||||
|
||||
this.sendOnLoadingEnded();
|
||||
@@ -115,7 +115,10 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
qtaDaEvadere = qtaDaEvadere.add(item.getQtaCol());
|
||||
|
||||
if (!UtilityBigDecimal.equalsTo(qtaDaEvadere, BigDecimal.ZERO)) {
|
||||
numCnfDaEvadere = UtilityBigDecimal.divide(qtaDaEvadere, item.getQtaCnf());
|
||||
|
||||
if(item.getMtbAart().isFlagQtaCnfFissaBoolean())
|
||||
numCnfDaEvadere = UtilityBigDecimal.divide(qtaDaEvadere, item.getQtaCnf());
|
||||
else numCnfDaEvadere = item.getNumCnf();
|
||||
}
|
||||
|
||||
this.sendOnItemDispatched(item,
|
||||
@@ -151,27 +154,64 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
BigDecimal totalSumOfQtaCol = BigDecimal.ZERO;
|
||||
BigDecimal totalSumOfNumCnf = BigDecimal.ZERO;
|
||||
|
||||
for (HistoryVersamentoProdULDTO.OrdineDto ordine : item.getOrdini()) {
|
||||
if (SettingsManager.iDB().isFlagVersamentoDirettoProduzione()) {
|
||||
for (HistoryVersamentoProdULDTO.OrdineDto ordine : item.getOrdini()) {
|
||||
|
||||
BigDecimal qtaColToSave;
|
||||
BigDecimal numCnfToSave;
|
||||
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (item.getMtbAart() != null && !item.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
numCnfToSave = UtilityBigDecimal.divideAndRoundToInteger(inputNumCnf.multiply(BigDecimal.valueOf(ordine.getPercentageHr())), BigDecimal.valueOf(100), RoundingMode.FLOOR);
|
||||
qtaColToSave = numCnfToSave.multiply(inputQtaCnf).setScale(0, BigDecimal.ROUND_FLOOR);
|
||||
} else {
|
||||
qtaColToSave = UtilityBigDecimal.divideAndRoundToInteger(inputQtaTot.multiply(BigDecimal.valueOf(ordine.getPercentageHr())), BigDecimal.valueOf(100), RoundingMode.FLOOR);
|
||||
numCnfToSave = UtilityBigDecimal.divide(qtaColToSave, item.getQtaCnf(), RoundingMode.FLOOR);
|
||||
}
|
||||
|
||||
|
||||
totalSumOfQtaCol = totalSumOfQtaCol.add(qtaColToSave);
|
||||
totalSumOfNumCnf = totalSumOfNumCnf.add(numCnfToSave);
|
||||
|
||||
numCnfToSave = numCnfToSave.multiply(BigDecimal.valueOf(-1));
|
||||
qtaColToSave = qtaColToSave.multiply(BigDecimal.valueOf(-1));
|
||||
|
||||
|
||||
final MtbColr mtbColrScarico = new MtbColr()
|
||||
.setCodMart(item.getCodMart())
|
||||
.setPartitaMag(UtilityString.empty2null(item.getPartitaMag()))
|
||||
.setQtaCol(qtaColToSave)
|
||||
.setQtaCnf(inputQtaCnf)
|
||||
.setNumCnf(numCnfToSave)
|
||||
.setDescrizione(UtilityString.isNullOrEmpty(item.getMtbAart().getDescrizioneEstesa()) ? item.getMtbAart().getDescrizione() : item.getMtbAart().getDescrizioneEstesa())
|
||||
.setDatetimeRow(UtilityDate.getDateInstance())
|
||||
.setNumColloRif(item.getNumColloRif())
|
||||
.setDataColloRif(item.getDataColloRif())
|
||||
.setGestioneRif(item.getGestioneRif())
|
||||
.setSerColloRif(item.getSerColloRif())
|
||||
.setDataOrd(ordine.getData())
|
||||
.setNumOrd(ordine.getNumero())
|
||||
.setRigaOrd(ordine.getRigaOrd());
|
||||
|
||||
mtbColrScarico.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||
mtbColtScarico.getMtbColr().add(mtbColrScarico);
|
||||
}
|
||||
} else {
|
||||
BigDecimal qtaColToSave;
|
||||
BigDecimal numCnfToSave;
|
||||
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (item.getMtbAart() != null && !item.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
numCnfToSave = UtilityBigDecimal.divideAndRoundToInteger(inputNumCnf.multiply(BigDecimal.valueOf(ordine.getPercentageHr())), BigDecimal.valueOf(100), RoundingMode.FLOOR);
|
||||
numCnfToSave = inputNumCnf;
|
||||
qtaColToSave = numCnfToSave.multiply(inputQtaCnf).setScale(0, BigDecimal.ROUND_FLOOR);
|
||||
} else {
|
||||
qtaColToSave = UtilityBigDecimal.divideAndRoundToInteger(inputQtaTot.multiply(BigDecimal.valueOf(ordine.getPercentageHr())), BigDecimal.valueOf(100), RoundingMode.FLOOR);
|
||||
qtaColToSave = inputQtaTot;
|
||||
numCnfToSave = UtilityBigDecimal.divide(qtaColToSave, item.getQtaCnf(), RoundingMode.FLOOR);
|
||||
}
|
||||
|
||||
|
||||
totalSumOfQtaCol = totalSumOfQtaCol.add(qtaColToSave);
|
||||
totalSumOfNumCnf = totalSumOfNumCnf.add(numCnfToSave);
|
||||
totalSumOfQtaCol = qtaColToSave;
|
||||
totalSumOfNumCnf = numCnfToSave;
|
||||
|
||||
numCnfToSave = numCnfToSave.multiply(BigDecimal.valueOf(-1));
|
||||
qtaColToSave = qtaColToSave.multiply(BigDecimal.valueOf(-1));
|
||||
|
||||
|
||||
final MtbColr mtbColrScarico = new MtbColr()
|
||||
.setCodMart(item.getCodMart())
|
||||
.setPartitaMag(UtilityString.empty2null(item.getPartitaMag()))
|
||||
@@ -183,10 +223,7 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
.setNumColloRif(item.getNumColloRif())
|
||||
.setDataColloRif(item.getDataColloRif())
|
||||
.setGestioneRif(item.getGestioneRif())
|
||||
.setSerColloRif(item.getSerColloRif())
|
||||
.setDataOrd(ordine.getData())
|
||||
.setNumOrd(ordine.getNumero())
|
||||
.setRigaOrd(ordine.getRigaOrd());
|
||||
.setSerColloRif(item.getSerColloRif());
|
||||
|
||||
mtbColrScarico.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||
mtbColtScarico.getMtbColr().add(mtbColrScarico);
|
||||
|
||||
@@ -16,6 +16,9 @@ import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULRestDTO;
|
||||
|
||||
@@ -32,6 +35,10 @@ public class ProdRecuperMaterialeRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
public void loadLastULVersate(RunnableArgs<List<HistoryVersamentoProdULDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
loadLastULVersate(null, onComplete, onFailed);
|
||||
}
|
||||
|
||||
public void loadLastULVersate(String codJfas, RunnableArgs<List<HistoryVersamentoProdULDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
String sql = "WITH ul_list AS ( " +
|
||||
" SELECT jtb_fasi.cod_jfas, " +
|
||||
@@ -68,7 +75,7 @@ public class ProdRecuperMaterialeRESTConsumer extends _BaseRESTConsumer {
|
||||
" AND mtb_colr.data_collo = mtb_colt.data_collo " +
|
||||
" AND mtb_colr.ser_collo = mtb_colt.ser_collo " +
|
||||
" AND mtb_colr.gestione = mtb_colt.gestione " +
|
||||
" INNER JOIN dtb_ord_steps ON dtb_ord_steps.data_ord = mtb_colr.data_ord " +
|
||||
" " + (SettingsManager.iDB().isFlagVersamentoDirettoProduzione() ? "INNER" : "LEFT OUTER") + " join dtb_ord_steps ON dtb_ord_steps.data_ord = mtb_colr.data_ord " +
|
||||
" AND dtb_ord_steps.gestione = mtb_colr.gestione " +
|
||||
" AND dtb_ord_steps.num_ord = mtb_colr.num_ord " +
|
||||
" AND dtb_ord_steps.data_iniz is not null " +
|
||||
@@ -76,6 +83,7 @@ public class ProdRecuperMaterialeRESTConsumer extends _BaseRESTConsumer {
|
||||
" INNER JOIN mtb_aart ON mtb_colr.cod_mart = mtb_aart.cod_mart " +
|
||||
" LEFT OUTER JOIN jtb_fasi ON mtb_colt.cod_jfas = jtb_fasi.cod_jfas " +
|
||||
" WHERE jtb_fasi.cod_jfas IS NOT NULL " +
|
||||
(UtilityString.isNullOrEmpty(codJfas) ? "" : " AND jtb_fasi.cod_jfas = " + UtilityDB.valueToString(codJfas)) +
|
||||
" AND segno = -1 " +
|
||||
" AND mtb_colr.data_collo > DATEADD(DAY, -5, GETDATE()) " +
|
||||
" GROUP BY jtb_fasi.cod_jfas, " +
|
||||
@@ -177,7 +185,8 @@ public class ProdRecuperMaterialeRESTConsumer extends _BaseRESTConsumer {
|
||||
" ISNULL(max_ul.hr, '') = ISNULL(ul_list.hr, '') AND " +
|
||||
" max_ul.max_datetime_row = ul_list.datetime_row";
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<HistoryVersamentoProdULRestDTO>>() {}.getType();
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<HistoryVersamentoProdULRestDTO>>() {
|
||||
}.getType();
|
||||
this.mSystemRESTConsumer.<ArrayList<HistoryVersamentoProdULRestDTO>>processSql(sql, typeOfObjectsList, ulList -> {
|
||||
|
||||
if (ulList == null) {
|
||||
@@ -238,6 +247,7 @@ public class ProdRecuperMaterialeRESTConsumer extends _BaseRESTConsumer {
|
||||
.setCodCol(restDTO.getCodCol())
|
||||
.setCodTagl(restDTO.getCodTagl())
|
||||
.setCodJfas(restDTO.getCodJfas())
|
||||
.setDescrizioneArt(restDTO.getDescrizioneArt())
|
||||
.setDescrizioneFase(restDTO.getDescrizioneFase())
|
||||
.setQtaCol(qtaColTot)
|
||||
.setNumCnf(numCnfColTot)
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.List;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.view.ExtendedSectionedRecyclerView;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.ProdRecuperoMaterialeListHeaderBinding;
|
||||
import it.integry.integrywmsnative.databinding.ProdRecuperoMaterialeListItemBinding;
|
||||
@@ -99,7 +100,7 @@ public class HistoryULsListAdapter extends ExtendedSectionedRecyclerView<History
|
||||
holder.binding.numCollo.setText(String.valueOf(ul.getNumCollo()));
|
||||
holder.binding.partitaMag.setText("(" + ul.getPartitaMag() + ")");
|
||||
|
||||
holder.binding.qtaVersata.setText(String.valueOf(ul.getQtaVersata()));
|
||||
holder.binding.qtaVersata.setText(UtilityNumber.decimalToString(ul.getQtaVersata(), 2));
|
||||
holder.binding.untMisQtaVersata.setText(String.valueOf(ul.getUntMisVersata()));
|
||||
|
||||
holder.binding.getRoot().setOnClickListener(v -> {
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableField;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -19,7 +20,9 @@ import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ILifecycleFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
@@ -32,9 +35,18 @@ import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFrag
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
|
||||
public class ProdRientroMerceFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, ProdRientroMerceViewModel.Listener, BottomSheetFragmentLUContentView.Listener, BottomSheetMtbColrEditView.Listener {
|
||||
public class ProdRientroMerceFragment extends BaseFragment implements
|
||||
ITitledFragment,
|
||||
IScrollableFragment,
|
||||
ILifecycleFragment,
|
||||
ProdRientroMerceViewModel.Listener,
|
||||
BottomSheetFragmentLUContentView.Listener,
|
||||
BottomSheetMtbColrEditView.Listener,
|
||||
ProdRientroMerceOrderListFragment.OnRefreshListener {
|
||||
|
||||
|
||||
public final ObservableField<Boolean> isLargeLayout = new ObservableField<>(false);
|
||||
|
||||
@Inject
|
||||
ProdRientroMerceViewModel mViewModel;
|
||||
|
||||
@@ -51,25 +63,54 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
||||
return new ProdRientroMerceFragment();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setRetainInstance(true);
|
||||
|
||||
boolean isLargeLayout = getResources().getBoolean(R.bool.large_layout);
|
||||
this.isLargeLayout.set(isLargeLayout);
|
||||
|
||||
mProdRientroMerceOrderListFragment = ProdRientroMerceOrderListFragment.newInstance(mToolbar);
|
||||
mProdRientroMerceOrderDetailFragment = ProdRientroMerceOrderDetailFragment.newInstance();
|
||||
|
||||
mProdRientroMerceOrderListFragment.setOnItemSelectedRunnable(mProdRientroMerceOrderDetailFragment::setOrder);
|
||||
|
||||
|
||||
mProdRientroMerceOrderListFragment
|
||||
.setOnItemSelectedRunnable(order -> {
|
||||
if (!isLargeLayout) {
|
||||
getChildFragmentManager()
|
||||
.beginTransaction()
|
||||
.show(mProdRientroMerceOrderDetailFragment)
|
||||
.addToBackStack(ProdRientroMerceOrderDetailFragment.class.getName())
|
||||
.commit();
|
||||
}
|
||||
|
||||
mProdRientroMerceOrderDetailFragment.setOrder(order);
|
||||
})
|
||||
.setOnRefreshListener(this);
|
||||
mProdRientroMerceOrderDetailFragment.setOnMtbColtClicked(item -> {
|
||||
mBindings.bottomSheetMtbColrEdit.setMtbColr(item.getMtbColr().get(0));
|
||||
mBindings.bottomSheetMtbColrEdit.expand();
|
||||
});
|
||||
|
||||
getChildFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.order_list_fragment, mProdRientroMerceOrderListFragment)
|
||||
.replace(R.id.order_detail_fragment, mProdRientroMerceOrderDetailFragment)
|
||||
.commit();
|
||||
if (isLargeLayout) {
|
||||
getChildFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.left_side_fragment_container, mProdRientroMerceOrderListFragment)
|
||||
.replace(R.id.right_side_fragment_container, mProdRientroMerceOrderDetailFragment)
|
||||
.commit();
|
||||
} else {
|
||||
getChildFragmentManager()
|
||||
.beginTransaction()
|
||||
.add(R.id.full_width_container, mProdRientroMerceOrderListFragment)
|
||||
.add(R.id.full_width_container, mProdRientroMerceOrderDetailFragment)
|
||||
.hide(mProdRientroMerceOrderDetailFragment)
|
||||
.commit();
|
||||
}
|
||||
|
||||
|
||||
MainApplication.appComponent
|
||||
.prodRientroMerceComponent()
|
||||
@@ -82,6 +123,8 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(LayoutInflater.from(getActivity()), R.layout.fragment_prod_rientro_merce, container, false);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
mBindings.setView(this);
|
||||
mBindings.setViewmodel(mViewModel);
|
||||
|
||||
mViewModel.setListener(this);
|
||||
|
||||
@@ -94,13 +137,13 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
||||
if(savedInstanceState == null) {
|
||||
if (savedInstanceState == null) {
|
||||
this.mViewModel.getOrdiniLavorazioneAperti().observe(this.getViewLifecycleOwner(), this::ordersUpdated);
|
||||
|
||||
mViewModel.init();
|
||||
mViewModel.refreshOrderList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||
mAppBarTitle = titleText;
|
||||
@@ -139,7 +182,6 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initBottomSheet() {
|
||||
mBindings.bottomSheetMtbColrEdit.setListener(this);
|
||||
mBindings.bottomSheetMtbColrEdit.disableEditButton();
|
||||
@@ -157,7 +199,33 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
|
||||
null,
|
||||
() -> mProdRientroMerceOrderDetailFragment.deleteMtbColr(mtbColr),
|
||||
() -> {}
|
||||
).show(getActivity().getSupportFragmentManager(), "tag");
|
||||
() -> {
|
||||
}
|
||||
).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOrderLoadingStarted() {
|
||||
BarcodeManager.disable();
|
||||
this.mProdRientroMerceOrderListFragment.onOrderLoadingStarted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOrderLoadingEnded() {
|
||||
BarcodeManager.enable();
|
||||
this.mProdRientroMerceOrderListFragment.onOrderLoadingEnded();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
this.mViewModel.refreshOrderList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreDestroy(Runnable onComplete) {
|
||||
if(getChildFragmentManager().getBackStackEntryCount() > 0)
|
||||
getChildFragmentManager().popBackStack();
|
||||
|
||||
else onComplete.run();
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,9 @@ import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.IOrdersLoadingListener;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.OrdersLoadException;
|
||||
|
||||
@@ -25,12 +27,12 @@ public class ProdRientroMerceViewModel {
|
||||
this.mMesRESTConsumer = mesRESTConsumer;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
new Thread(this::sendOnLoadingStarted).start();
|
||||
|
||||
this.mMesRESTConsumer.getOrdiniLavorazione("I", null, ordiniLavorazioneList -> {
|
||||
public void refreshOrderList() {
|
||||
new Thread(this::sendOnOrdersLoadingStarted).start();
|
||||
String codAnag = SettingsManager.iDB().getFilterFornitoreProd();
|
||||
this.mMesRESTConsumer.getOrdiniLavorazione("I", null, codAnag, ordiniLavorazioneList -> {
|
||||
this.mOrdiniLavorazioneAperti.postValue(ordiniLavorazioneList);
|
||||
this.sendOnLoadingEnded();
|
||||
this.sendOnOrdersLoadingEnded();
|
||||
}, ex -> this.sendError(new OrdersLoadException(ex)));
|
||||
}
|
||||
|
||||
@@ -51,12 +53,20 @@ public class ProdRientroMerceViewModel {
|
||||
if (this.mListener != null) mListener.onLoadingEnded();
|
||||
}
|
||||
|
||||
private void sendOnOrdersLoadingStarted() {
|
||||
if (this.mListener != null) mListener.onOrderLoadingStarted();
|
||||
}
|
||||
|
||||
private void sendOnOrdersLoadingEnded() {
|
||||
if (this.mListener != null) mListener.onOrderLoadingEnded();
|
||||
}
|
||||
|
||||
private void sendError(Exception ex) {
|
||||
if (this.mListener != null) mListener.onError(ex);
|
||||
}
|
||||
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
public interface Listener extends ILoadingListener, IOrdersLoadingListener {
|
||||
|
||||
void onDataSaved();
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.harrysoft.androidbluetoothserial.BluetoothManager;
|
||||
@@ -43,12 +44,14 @@ import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.FragmentProdRientroMerceOrderDetailBinding;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||
import it.integry.integrywmsnative.gest.settings.MainSettingsFragment;
|
||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdDTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdView;
|
||||
import it.integry.integrywmsnative.view.dialogs.printSsccUl.DialogPrintUlSSCCView;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
@@ -76,12 +79,15 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
|
||||
private BluetoothManager bluetoothManager;
|
||||
private BluetoothSerialDevice mConnectedBluetoothDevice;
|
||||
private String mLatestCodTcol;
|
||||
|
||||
|
||||
public ObservableField<BigDecimal> sumLUNumber = new ObservableField<>(BigDecimal.ZERO);
|
||||
public ObservableField<BigDecimal> sumColliNumber = new ObservableField<>(BigDecimal.ZERO);
|
||||
public ObservableField<BigDecimal> sumNetKG = new ObservableField<>(BigDecimal.ZERO);
|
||||
public ObservableField<BigDecimal> sumGrossKG = new ObservableField<>(BigDecimal.ZERO);
|
||||
public ObservableField<Integer> progress = new ObservableField<>(0);
|
||||
public boolean isOrderColli = false;
|
||||
|
||||
public ProdRientroMerceOrderDetailFragment() {
|
||||
// Required empty public constructor
|
||||
@@ -113,11 +119,16 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
|
||||
mViewModel.setListener(this);
|
||||
|
||||
if (currentOrder.getValue() != null) {
|
||||
refreshOrder();
|
||||
isOrderColli = currentOrder.getValue().getQtaCnf().compareTo(BigDecimal.ONE) == 0;
|
||||
}
|
||||
this.mViewModel.mtbColtsOfOrder.observe(getViewLifecycleOwner(), this::refreshList);
|
||||
|
||||
this.initRecyclerView();
|
||||
this.initULScaleBluetoothConnection();
|
||||
|
||||
mBindings.executePendingBindings();
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
@@ -175,6 +186,7 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
mLatestCodTcol = null;
|
||||
if (mConnectedBluetoothDevice != null)
|
||||
bluetoothManager.close();
|
||||
|
||||
@@ -182,11 +194,15 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
}
|
||||
|
||||
public void setOrder(OrdineLavorazioneDTO order) {
|
||||
currentOrder.postValue(order);
|
||||
mBindings.invalidateAll();
|
||||
mAdapter.clearDataset();
|
||||
currentOrder.setValue(order);
|
||||
|
||||
mViewModel.setOrder(order);
|
||||
refreshOrder();
|
||||
}
|
||||
|
||||
private void refreshOrder() {
|
||||
if (mBindings != null) mBindings.invalidateAll();
|
||||
if (mAdapter != null) mAdapter.clearDataset();
|
||||
if (mViewModel != null) mViewModel.setOrder(currentOrder.getValue());
|
||||
}
|
||||
|
||||
private void refreshList(List<MtbColt> mtbColts) {
|
||||
@@ -196,15 +212,31 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
AtomicBigDecimal sumColli = new AtomicBigDecimal(BigDecimal.ZERO);
|
||||
AtomicBigDecimal sumNet = new AtomicBigDecimal(BigDecimal.ZERO);
|
||||
AtomicBigDecimal sumGross = new AtomicBigDecimal(BigDecimal.ZERO);
|
||||
AtomicBigDecimal sumQtaCol = new AtomicBigDecimal(BigDecimal.ZERO);
|
||||
|
||||
Stream.of(mtbColts)
|
||||
.forEach(x -> Stream.of(x.getMtbColr()).forEach(y -> {
|
||||
sumColli.getAndAdd(y.getNumCnf());
|
||||
sumNet.getAndAdd(y.getPesoNettoKg());
|
||||
sumGross.getAndAdd(y.getPesoLordoKg());
|
||||
sumQtaCol.getAndAdd(y.getQtaCol());
|
||||
}));
|
||||
|
||||
ComparatorCompat<MtbColt> c = ComparatorCompat
|
||||
.chain(
|
||||
new ComparatorCompat<MtbColt>((x, y) -> x.getDataVersD().compareTo(y.getDataVersD()))
|
||||
)
|
||||
.reversed();
|
||||
MtbColt lastUl = Stream.of(mtbColts).sorted(c).findFirstOrElse(null);
|
||||
if (lastUl != null && !UtilityString.isNullOrEmpty(lastUl.getCodTcol())) {
|
||||
mLatestCodTcol = lastUl.getCodTcol();
|
||||
}
|
||||
|
||||
currentOrder.getValue().setQtaTrasferite(sumQtaCol.get());
|
||||
this.progress.set(currentOrder.getValue().getProgress());
|
||||
sumColliNumber.set(sumColli.get());
|
||||
sumGrossKG.set(sumGross.get());
|
||||
progress.set(currentOrder.getValue().getProgress());
|
||||
sumNetKG.set(sumNet.get());
|
||||
} else {
|
||||
sumLUNumber.set(BigDecimal.ZERO);
|
||||
@@ -217,7 +249,17 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataSaved() {
|
||||
public void onDataSaved(MtbColt mtbColt) {
|
||||
String codJcom = currentOrder.getValue().getCodJcom();
|
||||
|
||||
DialogPrintUlSSCCView.newInstance(codJcom, mtbColt, result -> {
|
||||
if (result.isFlagPrintShipmentLabel() || result.isFlagPrintProductionLabel()) {
|
||||
this.mViewModel.printSavedMtbColt(result);
|
||||
} else {
|
||||
this.mViewModel.refreshMtbColts();
|
||||
}
|
||||
})
|
||||
.show(requireActivity().getSupportFragmentManager(), "DialogPrintUlSSCC");
|
||||
|
||||
}
|
||||
|
||||
@@ -225,7 +267,12 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
public void addULButtonClick() {
|
||||
this.onLoadingStarted();
|
||||
|
||||
String codProd = this.currentOrder.getValue().getCodProd();
|
||||
OrdineLavorazioneDTO currentOrder = this.currentOrder.getValue();
|
||||
if (currentOrder == null) {
|
||||
this.onError(new Exception("Nessun ordine rilevato!"));
|
||||
return;
|
||||
}
|
||||
String codProd = currentOrder.getCodProd();
|
||||
mArticoloRESTConsumer.getByCodMart(codProd, mtbAart -> {
|
||||
|
||||
String sql = "SELECT TOP 1 * " +
|
||||
@@ -234,9 +281,9 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
" * " +
|
||||
" FROM dtb_ord_steps " +
|
||||
" WHERE cod_jfas IS NOT NULL " +
|
||||
" AND gestione = " + UtilityDB.valueToString(this.currentOrder.getValue().getGestione()) +
|
||||
" AND num_ord = " + UtilityDB.valueToString(this.currentOrder.getValue().getNumOrd()) +
|
||||
" AND data_ord = " + UtilityDB.valueToString(this.currentOrder.getValue().getDataOrdD()) +
|
||||
" AND gestione = " + UtilityDB.valueToString(currentOrder.getGestione()) +
|
||||
" AND num_ord = " + UtilityDB.valueToString(currentOrder.getNumOrd()) +
|
||||
" AND data_ord = " + UtilityDB.valueToString(currentOrder.getDataOrdD()) +
|
||||
" ) tmp " +
|
||||
"WHERE data_iniz IS NOT NULL " +
|
||||
" AND (data_fine IS NULL OR last_step = id_step) " +
|
||||
@@ -247,15 +294,24 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
|
||||
this.onLoadingEnded();
|
||||
|
||||
String codTcol = currentOrder.getCodTcolUl();
|
||||
if (UtilityString.isNullOrEmpty(codTcol)) {
|
||||
if (!UtilityString.isNullOrEmpty(mLatestCodTcol)) {
|
||||
codTcol = mLatestCodTcol;
|
||||
} else {
|
||||
codTcol = mtbAart.getCodTcolUl();
|
||||
}
|
||||
}
|
||||
|
||||
DialogInputLUProdDTO dialogInputLUProdDTO = new DialogInputLUProdDTO()
|
||||
.setMtbAart(mtbAart)
|
||||
.setNumCnf(this.currentOrder.getValue().getColliPedana())
|
||||
.setNumCnf(currentOrder.getColliPedana())
|
||||
.setQtaCnf(mtbAart.getQtaCnf())
|
||||
.setQtaTot(this.currentOrder.getValue().getColliPedana().multiply(mtbAart.getQtaCnf()))
|
||||
.setPartitaMag(this.currentOrder.getValue().getPartitaMag())
|
||||
.setDataScad(this.currentOrder.getValue().getDataScadD())
|
||||
.setCodJfasParent(this.currentOrder.getValue().getCodJfas())
|
||||
.setCodTcol(this.currentOrder.getValue().getCodTcolUl())
|
||||
.setQtaTot(currentOrder.getColliPedana().multiply(mtbAart.getQtaCnf()))
|
||||
.setPartitaMag(currentOrder.getPartitaMag())
|
||||
.setDataScad(currentOrder.getDataScadD())
|
||||
.setCodJfasParent(currentOrder.getCodJfas())
|
||||
.setCodTcol(codTcol)
|
||||
.setSuggestedCodJfas(dtbOrdStep != null && dtbOrdStep.size() > 0 ? dtbOrdStep.get(0).getCodJfas() : null);
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail.rest.ProdRientroMerceOrderDetailRESTConsumer;
|
||||
|
||||
@@ -17,8 +18,9 @@ public class ProdRientroMerceOrderDetailModule {
|
||||
@Provides
|
||||
ProdRientroMerceOrderDetailViewModel provideProdRientroMerceOrderDetailViewModel(
|
||||
ProdRientroMerceOrderDetailRESTConsumer prodRientroMerceOrderDetailRESTConsumer,
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer) {
|
||||
return new ProdRientroMerceOrderDetailViewModel(prodRientroMerceOrderDetailRESTConsumer, colliMagazzinoRESTConsumer);
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||
PrinterRESTConsumer printerRESTConsumer) {
|
||||
return new ProdRientroMerceOrderDetailViewModel(prodRientroMerceOrderDetailRESTConsumer, colliMagazzinoRESTConsumer, printerRESTConsumer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,32 +6,42 @@ import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.report.ReportType;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail.rest.ProdRientroMerceOrderDetailRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail.rest.dto.ImportColliDaProduzioneRequestDTO;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.printSsccUl.dto.PrintUlDTO;
|
||||
|
||||
public class ProdRientroMerceOrderDetailViewModel {
|
||||
|
||||
public MutableLiveData<List<MtbColt>> mtbColtsOfOrder = new MutableLiveData<>();
|
||||
public final MutableLiveData<List<MtbColt>> mtbColtsOfOrder = new MutableLiveData<>();
|
||||
private OrdineLavorazioneDTO currentOrder;
|
||||
|
||||
private final ProdRientroMerceOrderDetailRESTConsumer mProdRientroMerceOrderDetailRESTConsumer;
|
||||
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||
private final PrinterRESTConsumer mPrinterRESTConsumer;
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
@Inject
|
||||
public ProdRientroMerceOrderDetailViewModel(ProdRientroMerceOrderDetailRESTConsumer prodRientroMerceOrderDetailRESTConsumer,
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer) {
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||
PrinterRESTConsumer printerRESTConsumer) {
|
||||
this.mProdRientroMerceOrderDetailRESTConsumer = prodRientroMerceOrderDetailRESTConsumer;
|
||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||
this.mPrinterRESTConsumer = printerRESTConsumer;
|
||||
}
|
||||
|
||||
public void setOrder(OrdineLavorazioneDTO order) {
|
||||
@@ -40,7 +50,7 @@ public class ProdRientroMerceOrderDetailViewModel {
|
||||
refreshMtbColts();
|
||||
}
|
||||
|
||||
private void refreshMtbColts() {
|
||||
public void refreshMtbColts() {
|
||||
this.sendOnLoadingStarted();
|
||||
this.mtbColtsOfOrder.postValue(null);
|
||||
|
||||
@@ -70,7 +80,7 @@ public class ProdRientroMerceOrderDetailViewModel {
|
||||
.setCodJcom(currentOrder.getCodJcom())
|
||||
.setCodJfas(pickedQuantityDTO.getJtbFasi() != null ? pickedQuantityDTO.getJtbFasi().getCodJfas() : null)
|
||||
.setCodMart(currentOrder.getCodProd())
|
||||
.setCodTcol(pickedQuantityDTO.getMtbTCol().getCodTcol())
|
||||
.setCodTcol(pickedQuantityDTO.getMtbTCol() != null ? pickedQuantityDTO.getMtbTCol().getCodTcol() : null)
|
||||
.setDataCollo(new Date())
|
||||
.setDataOrd(currentOrder.getDataOrdD())
|
||||
.setNumOrd(currentOrder.getNumOrd())
|
||||
@@ -81,12 +91,9 @@ public class ProdRientroMerceOrderDetailViewModel {
|
||||
.setPesoNetto(pickedQuantityDTO.getPesoNetto());
|
||||
|
||||
this.mProdRientroMerceOrderDetailRESTConsumer.importColloDaProduzione(importColliDaProduzioneRequestDTO, mtbColtSaved -> {
|
||||
|
||||
synchronized (this.mtbColtsOfOrder) {
|
||||
refreshMtbColts();
|
||||
this.mListener.onDataSaved(mtbColtSaved);
|
||||
}
|
||||
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
|
||||
|
||||
@@ -136,9 +143,39 @@ public class ProdRientroMerceOrderDetailViewModel {
|
||||
if (this.mListener != null) mListener.onError(ex);
|
||||
}
|
||||
|
||||
public void printSavedMtbColt(PrintUlDTO result) {
|
||||
if (result.isFlagPrintProductionLabel()) {
|
||||
this.startPrint(result.getMtbColt(), ReportType.ETICHETTA_SSCC_LAVORAZIONE, currentOrder.getCodAnag());
|
||||
} else {
|
||||
this.loadShipmentUlFromProductionUL(result.getMtbColt(), mtbColt -> {
|
||||
this.startPrint(mtbColt, ReportType.ETICHETTA_SSCC_SPEDIZIONE, mtbColt.getCodAnag());
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void loadShipmentUlFromProductionUL(MtbColt productionUL, RunnableArgs<MtbColt> onLoad, RunnableArgs<Exception> onError) {
|
||||
this.mColliMagazzinoRESTConsumer.loadShipmentUlFromProductionUL(productionUL, onLoad, onError);
|
||||
}
|
||||
|
||||
private void startPrint(MtbColt mtbColt, ReportType reportType, String codAnag) {
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
params.put("gestione", mtbColt.getGestione());
|
||||
params.put("ser_collo", mtbColt.getSerCollo());
|
||||
params.put("num_collo", mtbColt.getNumCollo());
|
||||
params.put("data_collo", UtilityDate.formatDate(mtbColt.getDataColloD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_DASH));
|
||||
this.mPrinterRESTConsumer.printReportType(
|
||||
reportType,
|
||||
SettingsManager.i().getUserSession().getDepo().getCodMdep(),
|
||||
codAnag,
|
||||
params,
|
||||
this::refreshMtbColts,
|
||||
this::sendError);
|
||||
}
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
|
||||
void onDataSaved();
|
||||
void onDataSaved(MtbColt mtbColt);
|
||||
|
||||
void onError(Exception ex);
|
||||
|
||||
|
||||
@@ -129,15 +129,18 @@ public class ProdRientroMerceOrderListAdapter extends SectionedRecyclerViewAdapt
|
||||
case START:
|
||||
holder.mBinding.ordineStateIcon.setImageResource(R.drawable.ic_play_circle_filled_24dp);
|
||||
holder.mBinding.ordineStateIcon.setColorFilter(ContextCompat.getColor(mContext, R.color.green_800), android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
holder.mBinding.orderProgress.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case PAUSE:
|
||||
holder.mBinding.ordineStateIcon.setImageResource(R.drawable.ic_pause_circle_filled_24dp);
|
||||
holder.mBinding.ordineStateIcon.setColorFilter(ContextCompat.getColor(mContext, R.color.yellow_800), android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
holder.mBinding.orderProgress.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case SCHEDULED:
|
||||
default:
|
||||
holder.mBinding.ordineStateIcon.setImageResource(R.drawable.ic_clock_circle_outline_24dp);
|
||||
holder.mBinding.ordineStateIcon.setColorFilter(ContextCompat.getColor(mContext, R.color.blue_700), android.graphics.PorterDuff.Mode.SRC_IN);
|
||||
holder.mBinding.orderProgress.setVisibility(View.GONE);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -166,6 +169,8 @@ public class ProdRientroMerceOrderListAdapter extends SectionedRecyclerViewAdapt
|
||||
holder.mBinding.rightSubDescrizione.setVisibility(View.VISIBLE);
|
||||
} else holder.mBinding.rightSubDescrizione.setVisibility(View.GONE);
|
||||
|
||||
holder.mBinding.orderProgress.setProgress(listModel.getProgress());
|
||||
|
||||
holder.mBinding.executePendingBindings();
|
||||
|
||||
holder.mBinding.getRoot().setOnClickListener(v -> {
|
||||
|
||||
@@ -15,6 +15,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -36,12 +37,10 @@ import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||
public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||
|
||||
private final ObservableArrayList<ProdRientroMerceOrderListModel> mOrdiniApertiMutableData = new ObservableArrayList<>();
|
||||
|
||||
private FragmentProdRientroMerceOrderListBinding mBindings = null;
|
||||
|
||||
private RunnableArgs<OrdineLavorazioneDTO> mOnItemSelectedRunnable;
|
||||
|
||||
private ElevatedToolbar mToolbar;
|
||||
private OnRefreshListener onRefreshListener;
|
||||
|
||||
public ProdRientroMerceOrderListFragment() {
|
||||
// Required empty public constructor
|
||||
@@ -72,7 +71,7 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||
|
||||
mBindings.setLifecycleOwner(this);
|
||||
|
||||
if(savedInstanceState == null) this.initRecyclerView();
|
||||
if (savedInstanceState == null) this.initRecyclerView();
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
@@ -86,13 +85,18 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||
ProdRientroMerceOrderListAdapter prodRientroMerceOrderListAdapter = new ProdRientroMerceOrderListAdapter(getActivity(), mOrdiniApertiMutableData)
|
||||
.setEmptyView(this.mBindings.emptyView)
|
||||
.setOnItemChecked(x -> {
|
||||
if(mOnItemSelectedRunnable != null) mOnItemSelectedRunnable.run(x.getOriginalModel());
|
||||
if (mOnItemSelectedRunnable != null)
|
||||
mOnItemSelectedRunnable.run(x.getOriginalModel());
|
||||
});
|
||||
|
||||
this.mBindings.mainList.setAdapter(prodRientroMerceOrderListAdapter);
|
||||
this.mBindings.mainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
|
||||
this.mToolbar.setRecyclerView(mBindings.mainList);
|
||||
|
||||
this.mBindings.swiperefresh.setOnRefreshListener(() -> {
|
||||
if (onRefreshListener != null) onRefreshListener.onRefresh();
|
||||
});
|
||||
}
|
||||
|
||||
public void pushOrderList(List<OrdineLavorazioneDTO> orderList) {
|
||||
@@ -101,15 +105,25 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||
|
||||
}
|
||||
|
||||
public void onOrderLoadingStarted() {
|
||||
this.mBindings.swiperefresh.setRefreshing(true);
|
||||
}
|
||||
|
||||
public void onOrderLoadingEnded() {
|
||||
this.mBindings.swiperefresh.setRefreshing(false);
|
||||
}
|
||||
|
||||
|
||||
private List<ProdRientroMerceOrderListModel> convertDataModelToListModel(List<OrdineLavorazioneDTO> dataList) {
|
||||
|
||||
ComparatorCompat<OrdineLavorazioneDTO> comparator = ComparatorCompat
|
||||
.comparing(OrdineLavorazioneDTO::getCodJfas)
|
||||
.comparing(OrdineLavorazioneDTO::getCodAnag)
|
||||
.thenComparing(ComparatorCompat.comparing(ordineLavorazioneDTO -> ordineLavorazioneDTO.getDescCommessa() != null ? ordineLavorazioneDTO.getDescCommessa() : "zzzzzzzz"))
|
||||
.thenComparing(ComparatorCompat.comparing(ordineLavorazioneDTO -> ordineLavorazioneDTO.getDataConsCommessaD() != null ? String.valueOf(ordineLavorazioneDTO.getDataConsCommessaD().getTime()) : "999999999999")).reversed()
|
||||
.thenComparing(ComparatorCompat.comparing(ordineLavorazioneDTO -> ordineLavorazioneDTO.getDataOrd() != null ? ordineLavorazioneDTO.getDataOrd() : "zzzzzzzz")).reversed()
|
||||
.thenComparing(ComparatorCompat.comparing(OrdineLavorazioneDTO::getNumOrd));
|
||||
|
||||
if(dataList == null) return new ArrayList<>();
|
||||
if (dataList == null) return new ArrayList<>();
|
||||
|
||||
List<ProdRientroMerceOrderListModel> notHiddenElements = Stream.of(dataList)
|
||||
.sorted(comparator)
|
||||
@@ -129,10 +143,14 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||
break;
|
||||
}
|
||||
|
||||
listModel.setGroupTitle(x.getCodJfas());
|
||||
listModel.setGroupTitle(x.getRagSocAnag());
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(x.getRagSocAnag()))
|
||||
listModel.setPreDescription("Provenienza: " + x.getRagSocAnag());
|
||||
if (!UtilityString.isNullOrEmpty(x.getDataConsCommessa())) {
|
||||
listModel.setPreDescription("Consegna: " + UtilityDate.formatDate(x.getDataConsCommessaD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
} else {
|
||||
/* if (!UtilityString.isNullOrEmpty(x.getRagSocAnag()))
|
||||
listModel.setPreDescription("Provenienza: " + x.getRagSocAnag());*/
|
||||
}
|
||||
|
||||
String testataOrdString = "N° " + x.getNumOrd();
|
||||
listModel.setDescription(testataOrdString);
|
||||
@@ -141,11 +159,27 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||
|
||||
listModel.setRightDescription(x.getCodJcom() != null ? (x.getDescCommessa() + " (" + x.getCodJcom() + ")") : "");
|
||||
|
||||
try {
|
||||
listModel.setProgress(x.getProgress());
|
||||
int numPedane = x.getNumCnf().divide(x.getColliPedana(), 0, RoundingMode.DOWN).intValue();
|
||||
int numCnf = x.getNumCnf().remainder(x.getColliPedana()).intValue();
|
||||
String qtaOrdLabel = "";
|
||||
if (numPedane > 0) {
|
||||
qtaOrdLabel += numPedane + "UL x " + x.getColliPedana().stripTrailingZeros().toPlainString() + " COL";
|
||||
if (numCnf > 0) {
|
||||
qtaOrdLabel += " + ";
|
||||
}
|
||||
}
|
||||
if (numCnf > 0) {
|
||||
qtaOrdLabel += numCnf + " COL";
|
||||
}
|
||||
|
||||
// listModel.setRightSubDescription(x.getNumCnf().stripTrailingZeros().toPlainString() + " COL");
|
||||
listModel.setRightSubDescription(qtaOrdLabel);
|
||||
/*try {
|
||||
listModel.setRightSubDescription(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
listModel.setOriginalModel(x);
|
||||
|
||||
@@ -164,4 +198,13 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||
public RecyclerView getList() {
|
||||
return mBindings.mainList;
|
||||
}
|
||||
|
||||
public ProdRientroMerceOrderListFragment setOnRefreshListener(OnRefreshListener onRefreshListener) {
|
||||
this.onRefreshListener = onRefreshListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface OnRefreshListener {
|
||||
void onRefresh();
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ public class ProdRientroMerceOrderListModel implements Cloneable {
|
||||
private String subDescription;
|
||||
private String rightDescription;
|
||||
private String rightSubDescription;
|
||||
private int progress;
|
||||
|
||||
private boolean hidden;
|
||||
|
||||
@@ -105,4 +106,13 @@ public class ProdRientroMerceOrderListModel implements Cloneable {
|
||||
START,
|
||||
SCHEDULED
|
||||
}
|
||||
|
||||
public int getProgress() {
|
||||
return progress;
|
||||
}
|
||||
|
||||
public ProdRientroMerceOrderListModel setProgress(int progress) {
|
||||
this.progress = progress;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package it.integry.integrywmsnative.gest.prod_versamento_materiale.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Date;
|
||||
|
||||
import it.integry.integrywmsnative.core.di.BindableFloat;
|
||||
@@ -50,6 +51,7 @@ public class OrdineLavorazioneDTO {
|
||||
|
||||
private String dataScad;
|
||||
|
||||
|
||||
private String partitaMagSuggested;
|
||||
|
||||
private String dataScadSuggested;
|
||||
@@ -90,6 +92,8 @@ public class OrdineLavorazioneDTO {
|
||||
|
||||
private String descCommessa;
|
||||
|
||||
private String dataConsCommessa;
|
||||
|
||||
private BigDecimal prodStd;
|
||||
|
||||
private Object mtbColtToEdit;
|
||||
@@ -135,6 +139,7 @@ public class OrdineLavorazioneDTO {
|
||||
public String getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public Date getDataOrdD() {
|
||||
return UtilityDate.recognizeDateWithExceptionHandler(dataOrd);
|
||||
}
|
||||
@@ -490,4 +495,32 @@ public class OrdineLavorazioneDTO {
|
||||
public OrdineLavorazioneStatoEnum getStatoEnum() {
|
||||
return OrdineLavorazioneStatoEnum.fromString(getStato());
|
||||
}
|
||||
|
||||
public String getDataConsCommessa() {
|
||||
return dataConsCommessa;
|
||||
}
|
||||
|
||||
public Date getDataConsCommessaD() {
|
||||
return UtilityDate.recognizeDateWithExceptionHandler(getDataConsCommessa());
|
||||
}
|
||||
|
||||
public void setDataConsCommessa(String dataConsCommessa) {
|
||||
this.dataConsCommessa = dataConsCommessa;
|
||||
}
|
||||
|
||||
|
||||
public int getProgress() {
|
||||
|
||||
int progress = 0;
|
||||
if (this.getQtaProd().compareTo(BigDecimal.ZERO) > 0) {
|
||||
if (this.getQtaTrasferite().compareTo(this.getQtaProd()) > 0) {
|
||||
progress = 100;
|
||||
} else {
|
||||
progress = this.getQtaTrasferite().multiply(BigDecimal.valueOf(100)).divide(this.getQtaProd(), 0, RoundingMode.UP).intValue();
|
||||
}
|
||||
}
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -108,8 +108,9 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity implements PVOrdi
|
||||
mBinding.closeActivityFab.close(false);
|
||||
mBinding.scanArtSpinner.setVisibility(articoli.size() > 0 ? View.GONE : View.VISIBLE);
|
||||
|
||||
if (articoli.isEmpty() && isOrderNewProdsForced()) {
|
||||
if (mOrdine.isOrderNewProducts() && articoli.isEmpty() && isOrderNewProdsForced()) {
|
||||
this.mViewModel.orderNewProducts();
|
||||
mOrdine.setOrderNewProducts(false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -220,7 +220,6 @@ public class PVOrdineAcquistoEditViewModel {
|
||||
.isEmpty()
|
||||
) {
|
||||
ArticoloOrdine dto = articolo.convertToArticoloOrdine(mCurrentOrdine);
|
||||
dto.setQtaOrd(dto.getQtaCnf());
|
||||
articoliToSave.add(dto);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -75,6 +75,7 @@ public class OrdineAcquistoPvHelper {
|
||||
Ordine ordine = new Ordine();
|
||||
ordine.setDataIns(UtilityDate.getDateInstance());
|
||||
ordine.setIdGriglia(griglia.getGrigliaId());
|
||||
ordine.setOrderNewProducts(true);
|
||||
mOrdineRepository.insert(ordine, id -> {
|
||||
ordine.setOrdineId(id);
|
||||
onSuccess.run(ordine);
|
||||
|
||||
@@ -37,7 +37,6 @@ import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.interfaces.ILifecycleFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
@@ -289,8 +288,8 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArtListLoaded(ArrayList<MtbAart> artList) {
|
||||
DialogChooseArtFromListaArts.make(getActivity(), artList, mtbAart -> mViewModel.dispatchArt(mtbAart, null)).show();
|
||||
public void onArtListLoaded(ArrayList<MtbAart> artList, RunnableArgs<MtbAart> onArtChoosed) {
|
||||
DialogChooseArtFromListaArts.make(getActivity(), artList, onArtChoosed).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -319,32 +318,31 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
this.currentMtbColtObs.set(null);
|
||||
thereIsAnOpenedUL.set(false);
|
||||
|
||||
|
||||
if (getActivity() != null) ((IPoppableActivity) getActivity()).pop();
|
||||
this.mViewModel.requestLU();
|
||||
/*if (getActivity() != null) ((IPoppableActivity) getActivity()).pop();*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
|
||||
String text = getResources().getString(R.string.alert_delete_mtb_colr);
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
|
||||
null,
|
||||
() -> onComplete.run(true),
|
||||
() -> onComplete.run(false)
|
||||
)
|
||||
null,
|
||||
() -> onComplete.run(true),
|
||||
() -> onComplete.run(false)
|
||||
)
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
this.onLoadingEnded();
|
||||
BarcodeManager.enable();
|
||||
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
UtilityToast.showToast(ex.getMessage());
|
||||
} else {
|
||||
UtilityExceptions.defaultException(requireActivity(), ex, mCurrentProgress);
|
||||
}
|
||||
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -354,6 +352,10 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
BigDecimal initialNumCnf,
|
||||
BigDecimal initialQtaCnf,
|
||||
BigDecimal initialQtaTot,
|
||||
BigDecimal totalQtaInWarehouse,
|
||||
BigDecimal totalNumCnfInWarehouse,
|
||||
BigDecimal totalQtaCommitted,
|
||||
BigDecimal totalNumCnfCommitted,
|
||||
BigDecimal totalQtaToBeTaken,
|
||||
BigDecimal totalNumCnfToBeTaken,
|
||||
BigDecimal qtaCnfToBeTaken,
|
||||
@@ -369,6 +371,10 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
.setInitialNumCnf(initialNumCnf)
|
||||
.setInitialQtaCnf(initialQtaCnf)
|
||||
.setInitialQtaTot(initialQtaTot)
|
||||
.setTotalQtaInWarehouse(totalQtaInWarehouse)
|
||||
.setTotalNumCnfInWarehouse(totalNumCnfInWarehouse)
|
||||
.setTotalQtaCommitted(totalQtaCommitted)
|
||||
.setTotalNumCnfCommitted(totalNumCnfCommitted)
|
||||
.setTotalQtaToBeTaken(totalQtaToBeTaken)
|
||||
.setTotalNumCnfToBeTaken(totalNumCnfToBeTaken)
|
||||
.setQtaCnfToBeTaken(qtaCnfToBeTaken)
|
||||
@@ -448,11 +454,11 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
@Override
|
||||
public void onLUPrintRequest(RunnableArgs<Boolean> onComplete) {
|
||||
DialogSimpleMessageView.makeInfoDialog(
|
||||
getActivity().getResources().getString(R.string.action_print_ul),
|
||||
new SpannableString(getActivity().getResources().getString(R.string.ask_print_message)),
|
||||
null,
|
||||
() -> onComplete.run(true),
|
||||
() -> onComplete.run(false))
|
||||
getActivity().getResources().getString(R.string.action_print_ul),
|
||||
new SpannableString(getActivity().getResources().getString(R.string.ask_print_message)),
|
||||
null,
|
||||
() -> onComplete.run(true),
|
||||
() -> onComplete.run(false))
|
||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||
;
|
||||
}
|
||||
@@ -460,11 +466,11 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
@Override
|
||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||
DialogSimpleMessageView.makeErrorDialog(
|
||||
new SpannableString(ex.getMessage()),
|
||||
null,
|
||||
null,
|
||||
R.string.button_ignore_print,
|
||||
onComplete)
|
||||
new SpannableString(ex.getMessage()),
|
||||
null,
|
||||
null,
|
||||
R.string.button_ignore_print,
|
||||
onComplete)
|
||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@@ -495,7 +501,11 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
|
||||
@Override
|
||||
public void onPreDestroy(Runnable onComplete) {
|
||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||
mViewModel.closeLU(false, onComplete);
|
||||
if(mViewModel.getCurrentMtbColt() != null)
|
||||
mViewModel.closeLU(false);
|
||||
else {
|
||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||
onComplete.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,15 +85,18 @@ public class RettificaGiacenzeViewModel {
|
||||
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
this.sendOnLUOpenRequest((mtbColt, created) -> {
|
||||
this.mCurrentMtbColt = mtbColt;
|
||||
this.mIsCreatedLU = created;
|
||||
|
||||
this.sendLUOpened(mtbColt);
|
||||
});
|
||||
this.requestLU();
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
public void requestLU() {
|
||||
this.sendOnLUOpenRequest((mtbColt, created) -> {
|
||||
this.mCurrentMtbColt = mtbColt;
|
||||
this.mIsCreatedLU = created;
|
||||
|
||||
this.sendLUOpened(mtbColt);
|
||||
});
|
||||
}
|
||||
|
||||
public RettificaGiacenzeViewModel setListener(RettificaGiacenzeViewModel.Listener listener) {
|
||||
this.mListener = listener;
|
||||
@@ -193,10 +196,24 @@ public class RettificaGiacenzeViewModel {
|
||||
return;
|
||||
}
|
||||
|
||||
RunnableArgs<MtbAart> dispatchArtRunnable = mtbAart -> {
|
||||
|
||||
var matchRows = Stream.of(this.mCurrentMtbColt.getMtbColr())
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbAart.getCodMart()))
|
||||
.toList();
|
||||
|
||||
if (matchRows.size() != 1) {
|
||||
dispatchArt(mtbAart, null);
|
||||
} else {
|
||||
dispatchRowEdit(matchRows.get(0));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
if (artsList.size() == 1) {
|
||||
dispatchArt(artsList.get(0), null);
|
||||
dispatchArtRunnable.run(artsList.get(0));
|
||||
} else {
|
||||
this.sendOnArtListLoaded(new ArrayList<>(artsList));
|
||||
this.sendOnArtListLoaded(new ArrayList<>(artsList), dispatchArtRunnable);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,6 +305,10 @@ public class RettificaGiacenzeViewModel {
|
||||
initialNumCnf,
|
||||
initialQtaCnf,
|
||||
initialQtaTot,
|
||||
mtbAart.getQtaEsistente(),
|
||||
mtbAart.getNumCnfEsistente(),
|
||||
mtbAart.getQtaImpegnata(),
|
||||
mtbAart.getNumCnfImpegnata(),
|
||||
qtaColDaPrelevare,
|
||||
numCnfDaPrelevare,
|
||||
qtaCnfDaPrelevare,
|
||||
@@ -504,33 +525,41 @@ public class RettificaGiacenzeViewModel {
|
||||
|
||||
public void dispatchRowEdit(MtbColr mtbColrToUpdate) {
|
||||
|
||||
final PickingObjectDTO pickingObjectDTO = new PickingObjectDTO()
|
||||
.setMtbAart(mtbColrToUpdate.getMtbAart());
|
||||
this.mRettificaGiacenzeRESTConsumer.searchArtInt(mtbColrToUpdate.getMtbAart().getCodMart(), newMtbAartList -> {
|
||||
|
||||
this.sendOnItemDispatched(
|
||||
pickingObjectDTO,
|
||||
pickingObjectDTO.getMtbAart(),
|
||||
mtbColrToUpdate.getNumCnf(),
|
||||
mtbColrToUpdate.getQtaCnf(),
|
||||
mtbColrToUpdate.getQtaCol(),
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
mtbColrToUpdate.getPartitaMag(),
|
||||
mtbColrToUpdate.getDataScadPartitaD(),
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
(pickedQuantityDTO, shouldCloseLU) -> {
|
||||
var newMtbAart = newMtbAartList.get(0);
|
||||
|
||||
final PickingObjectDTO pickingObjectDTO = new PickingObjectDTO()
|
||||
.setMtbAart(newMtbAart);
|
||||
|
||||
this.sendOnItemDispatched(
|
||||
pickingObjectDTO,
|
||||
pickingObjectDTO.getMtbAart(),
|
||||
mtbColrToUpdate.getNumCnf(),
|
||||
mtbColrToUpdate.getQtaCnf(),
|
||||
mtbColrToUpdate.getQtaCol(),
|
||||
newMtbAart.getQtaEsistente(), newMtbAart.getNumCnfEsistente(),
|
||||
newMtbAart.getQtaImpegnata(), newMtbAart.getNumCnfImpegnata(),
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
mtbColrToUpdate.getPartitaMag(),
|
||||
mtbColrToUpdate.getDataScadPartitaD(),
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
(pickedQuantityDTO, shouldCloseLU) -> {
|
||||
|
||||
this.saveEditedRow(mtbColrToUpdate,
|
||||
pickedQuantityDTO.getNumCnf(),
|
||||
pickedQuantityDTO.getQtaCnf(),
|
||||
pickedQuantityDTO.getQtaTot(),
|
||||
pickedQuantityDTO.getPartitaMag(),
|
||||
pickedQuantityDTO.getDataScad(),
|
||||
shouldCloseLU);
|
||||
});
|
||||
}, this::sendError);
|
||||
|
||||
this.saveEditedRow(mtbColrToUpdate,
|
||||
pickedQuantityDTO.getNumCnf(),
|
||||
pickedQuantityDTO.getQtaCnf(),
|
||||
pickedQuantityDTO.getQtaTot(),
|
||||
pickedQuantityDTO.getPartitaMag(),
|
||||
pickedQuantityDTO.getDataScad(),
|
||||
shouldCloseLU);
|
||||
});
|
||||
}
|
||||
|
||||
private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
||||
@@ -667,8 +696,8 @@ public class RettificaGiacenzeViewModel {
|
||||
}
|
||||
|
||||
|
||||
private void sendOnArtListLoaded(ArrayList<MtbAart> artList) {
|
||||
if (this.mListener != null) mListener.onArtListLoaded(artList);
|
||||
private void sendOnArtListLoaded(ArrayList<MtbAart> artList, RunnableArgs<MtbAart> onArtChoosed) {
|
||||
if (this.mListener != null) mListener.onArtListLoaded(artList, onArtChoosed);
|
||||
}
|
||||
|
||||
private void sendOnLUOpenRequest(RunnableArgss<MtbColt, Boolean> onComplete) {
|
||||
@@ -696,6 +725,10 @@ public class RettificaGiacenzeViewModel {
|
||||
BigDecimal initialNumCnf,
|
||||
BigDecimal initialQtaCnf,
|
||||
BigDecimal initialQtaTot,
|
||||
BigDecimal totalQtaInWarehouse,
|
||||
BigDecimal totalNumCnfInWarehouse,
|
||||
BigDecimal totalQtaCommitted,
|
||||
BigDecimal totalNumCnfCommitted,
|
||||
BigDecimal totalQtaToBeTaken,
|
||||
BigDecimal totalNumCnfToBeTaken,
|
||||
BigDecimal qtaCnfToBeTaken,
|
||||
@@ -710,6 +743,10 @@ public class RettificaGiacenzeViewModel {
|
||||
initialNumCnf,
|
||||
initialQtaCnf,
|
||||
initialQtaTot,
|
||||
totalQtaInWarehouse,
|
||||
totalNumCnfInWarehouse,
|
||||
totalQtaCommitted,
|
||||
totalNumCnfCommitted,
|
||||
totalQtaToBeTaken,
|
||||
totalNumCnfToBeTaken,
|
||||
qtaCnfToBeTaken,
|
||||
@@ -748,7 +785,7 @@ public class RettificaGiacenzeViewModel {
|
||||
|
||||
void onFornitoriLoaded(ArrayList<FornitoreDTO> fornitoriList);
|
||||
|
||||
void onArtListLoaded(ArrayList<MtbAart> artList);
|
||||
void onArtListLoaded(ArrayList<MtbAart> artList, RunnableArgs<MtbAart> onArtChoosed);
|
||||
|
||||
void onLUOpenRequest(RunnableArgss<MtbColt, Boolean> onComplete);
|
||||
|
||||
@@ -765,6 +802,10 @@ public class RettificaGiacenzeViewModel {
|
||||
BigDecimal initialNumCnf,
|
||||
BigDecimal initialQtaCnf,
|
||||
BigDecimal initialQtaTot,
|
||||
BigDecimal totalQtaInWarehouse,
|
||||
BigDecimal totalNumCnfInWarehouse,
|
||||
BigDecimal totalQtaCommitted,
|
||||
BigDecimal totalNumCnfCommitted,
|
||||
BigDecimal totalQtaToBeTaken,
|
||||
BigDecimal totalNumCnfToBeTaken,
|
||||
BigDecimal qtaCnfToBeTaken,
|
||||
|
||||
@@ -12,6 +12,7 @@ import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbAartWithFornitore;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.dto.FornitoreDTO;
|
||||
|
||||
@@ -41,7 +42,7 @@ public class RettificaGiacenzeRESTConsumer extends _BaseRESTConsumer {
|
||||
" WHERE mtb_lisa.cod_alis = " + UtilityDB.valueToString(codAlis) +
|
||||
" AND mtb_lisa.cod_mart = mtb_aart.cod_mart " +
|
||||
" AND mtb_lisa.cod_mart = mtb_part.cod_mart " +
|
||||
" AND mtb_part.cod_mdep = '01' " +
|
||||
" AND mtb_part.cod_mdep = '" + SettingsManager.i().getUserSession().getDepo().getCodMdep() + "' " +
|
||||
" AND (mtb_aart.descrizione_estesa LIKE '%" + codArtForOrDescr + "%' OR cod_art_for LIKE '%" + codArtForOrDescr + "%') " +
|
||||
" ORDER BY ABS(mtb_part.qta_esistente) DESC, mtb_aart.descrizione_estesa";
|
||||
|
||||
@@ -55,13 +56,19 @@ public class RettificaGiacenzeRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
public void searchArtInt(String codMartOrBarcodeOrDescr, RunnableArgs<ArrayList<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
String sql = "SELECT DISTINCT mtb_aart.* " +
|
||||
"FROM mtb_aart " +
|
||||
"LEFT OUTER JOIN mvw_barcode on mtb_aart.cod_mart = mvw_barcode.cod_mart " +
|
||||
"WHERE CASE" +
|
||||
String sql = "SELECT DISTINCT mtb_aart.*," +
|
||||
" qta_esistente, " +
|
||||
" qta_imp_cli + qta_imp_lav AS qta_impegnata, " +
|
||||
" num_esistente AS num_cnf_esistente, " +
|
||||
" num_imp_cli + num_imp_lav AS num_cnf_impegnata " +
|
||||
" FROM mtb_aart " +
|
||||
" LEFT OUTER JOIN mvw_barcode on mtb_aart.cod_mart = mvw_barcode.cod_mart " +
|
||||
" LEFT OUTER JOIN mtb_part mp on mtb_aart.cod_mart = mp.cod_mart " +
|
||||
" AND mp.cod_mdep = '" + SettingsManager.i().getUserSession().getDepo().getCodMdep() + "'" +
|
||||
" WHERE CASE" +
|
||||
" WHEN LEN(mvw_barcode.cod_barre) > 13 THEN mvw_barcode.cod_barre " +
|
||||
" ELSE Replicate('0', 13 - len(mvw_barcode.cod_barre))+ mvw_barcode.cod_barre " +
|
||||
"END LIKE '%' + CASE " +
|
||||
" END LIKE '%' + CASE " +
|
||||
" WHEN LEN('" + codMartOrBarcodeOrDescr + "') > 13 THEN '" + codMartOrBarcodeOrDescr + "' " +
|
||||
" ELSE Replicate('0', 13 - len('" + codMartOrBarcodeOrDescr + "')) + '" + codMartOrBarcodeOrDescr + "'" +
|
||||
" END " +
|
||||
|
||||
@@ -44,6 +44,7 @@ import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||
@@ -72,6 +73,7 @@ import it.integry.integrywmsnative.view.dialogs.ask_should_print.DialogAskShould
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleInputHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotView;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialog;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_peso_lu.DialogInputPeso;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
@@ -176,8 +178,8 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
|
||||
mFlagShowCodForn = customConfiguration.getConfig(BaseCustomConfiguration.Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE);
|
||||
mDivideByGrpMerc = customConfiguration.getConfig(BaseCustomConfiguration.Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC);
|
||||
mFlagShowCodForn = customConfiguration != null ? customConfiguration.getConfig(BaseCustomConfiguration.Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE) : true;
|
||||
mDivideByGrpMerc = customConfiguration != null ? customConfiguration.getConfig(BaseCustomConfiguration.Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC) : false;
|
||||
|
||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
mEnableQuantityReset = sharedPreferences.getBoolean("picking_uscita_enable_quantity_reset", true);
|
||||
@@ -938,4 +940,9 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInfoAggiuntiveRequired(MtbColt mtbColt, RunnableArgss<String, MtbTCol> onComplete) {
|
||||
InfoAggiuntiveLUDialog.newInstance(mtbColt, onComplete).show(getSupportFragmentManager(), "InfoAggiuntiveLUDialog");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.report.ReportType;
|
||||
@@ -757,6 +758,9 @@ public class SpedizioneViewModel {
|
||||
this.getPickingList().postValue(pickingList);
|
||||
} else {
|
||||
MtbColt refMtbColt = matchedItem.getRefMtbColt();
|
||||
if (matchedItem.getMtbColts() != null && matchedItem.getMtbColts().size() == 1) {
|
||||
refMtbColt = matchedItem.getMtbColts().get(0);
|
||||
}
|
||||
MtbColr refMtbColr = refMtbColt != null ? refMtbColt.getMtbColr().get(0) : null;
|
||||
this.dispatchOrdineRow(matchedItem, refMtbColt, refMtbColr, refMtbColr == null);
|
||||
}
|
||||
@@ -1614,14 +1618,36 @@ public class SpedizioneViewModel {
|
||||
} else {
|
||||
if (mDefaultSegnoCol == -1) {
|
||||
Runnable saveAction = () -> {
|
||||
mColliMagazzinoRESTConsumer.updateDataFine(
|
||||
mCurrentMtbColt, () -> distribuisciLU((generatedMtbColts) -> {
|
||||
if (shouldPrint)
|
||||
printCollo(generatedMtbColts, () -> this.postCloseOperations(generatedMtbColts));
|
||||
else {
|
||||
postCloseOperations(generatedMtbColts);
|
||||
}
|
||||
}), this::sendError);
|
||||
if (SettingsManager.iDB().isFlagAskInfoAggiuntiveSpedizione()) {
|
||||
this.mListener.onInfoAggiuntiveRequired(mCurrentMtbColt, (note, mtbTcol) -> {
|
||||
mCurrentMtbColt.setAnnotazioni(note);
|
||||
if (mtbTcol != null) {
|
||||
mCurrentMtbColt.setMtbTCol(mtbTcol);
|
||||
mCurrentMtbColt.setCodTcol(mtbTcol.getCodTcol());
|
||||
} else {
|
||||
mCurrentMtbColt.setMtbTCol(null);
|
||||
mCurrentMtbColt.setCodTcol(null);
|
||||
}
|
||||
mColliMagazzinoRESTConsumer.updateDataFine(
|
||||
mCurrentMtbColt, () -> distribuisciLU((generatedMtbColts) -> {
|
||||
if (shouldPrint)
|
||||
printCollo(generatedMtbColts, () -> this.postCloseOperations(generatedMtbColts));
|
||||
else {
|
||||
postCloseOperations(generatedMtbColts);
|
||||
}
|
||||
}), this::sendError);
|
||||
});
|
||||
} else {
|
||||
|
||||
mColliMagazzinoRESTConsumer.updateDataFine(
|
||||
mCurrentMtbColt, () -> distribuisciLU((generatedMtbColts) -> {
|
||||
if (shouldPrint)
|
||||
printCollo(generatedMtbColts, () -> this.postCloseOperations(generatedMtbColts));
|
||||
else {
|
||||
postCloseOperations(generatedMtbColts);
|
||||
}
|
||||
}), this::sendError);
|
||||
}
|
||||
};
|
||||
|
||||
if (mShouldAskPesoLU) {
|
||||
@@ -1879,6 +1905,7 @@ public class SpedizioneViewModel {
|
||||
.setCodAnag(ord.getCodAnagOrd());
|
||||
return ordV;
|
||||
}).toList();
|
||||
|
||||
dto.setPrintList(closedOrders);
|
||||
printClosedOrders(dto, this::sendOnOrderClosed, ex -> this.sendLUPrintError(ex, this::sendOnLoadingEnded));
|
||||
}
|
||||
@@ -1988,6 +2015,7 @@ public class SpedizioneViewModel {
|
||||
boolean canBatchLotBeChanged,
|
||||
RunnableArgss<PickedQuantityDTO, Boolean> onComplete);
|
||||
|
||||
void onInfoAggiuntiveRequired(MtbColt currentMtbColt, RunnableArgss<String, MtbTCol> onComplete);
|
||||
|
||||
void onLUPositionChangeRequest(RunnableArgss<Boolean, MtbDepoPosizione> onComplete);
|
||||
|
||||
|
||||
@@ -1,68 +1,115 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.base;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.text.InputType;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.ObservableField;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.DialogInputGeneralBinding;
|
||||
import it.integry.integrywmsnative.databinding.DialogInputGeneralContentBinding;
|
||||
|
||||
/**
|
||||
* Created by GiuseppeS on 22/03/2018.
|
||||
*/
|
||||
|
||||
public class DialogSimpleInputHelper {
|
||||
public class DialogSimpleInputHelper extends MaterialAlertDialogBuilder {
|
||||
|
||||
|
||||
private static Dialog makeBase(Context mContext, String titleText, String defaultTextValue, String hintText, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick, Integer inputType) {
|
||||
Dialog dialog = new Dialog(mContext);
|
||||
DialogSimpleInputViewModel viewModel = new DialogSimpleInputViewModel(dialog);
|
||||
public final ObservableField<String> inputValue = new ObservableField<>();
|
||||
|
||||
public DialogSimpleInputHelper(@NonNull Context context, String titleText, String defaultTextValue, String hintText, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick, Integer inputType) {
|
||||
super(context);
|
||||
|
||||
DialogInputGeneralBinding mBinding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.dialog_input_general, null, false);
|
||||
viewModel
|
||||
.setOnPositive(() -> {
|
||||
var dialogBindings = DialogInputGeneralContentBinding.inflate(LayoutInflater.from(context));
|
||||
dialogBindings.setView(this);
|
||||
|
||||
onPositiveClick.run(mBinding.generalInput.getText().toString());
|
||||
})
|
||||
.setOnNegative(onNegativeClick);
|
||||
dialogBindings.executePendingBindings();
|
||||
|
||||
mBinding.setViewmodel(viewModel);
|
||||
|
||||
//Title VIEW
|
||||
|
||||
mBinding.titleText.setText(titleText);
|
||||
this.setTitle(titleText);
|
||||
// this.setMessage("Inserisci la nuova quantità residua dell'ordine");
|
||||
this.setView(dialogBindings.getRoot());
|
||||
this.setCancelable(true);
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(hintText)) {
|
||||
mBinding.generalInput.setHint(hintText);
|
||||
dialogBindings.generalInputText.setHint(hintText);
|
||||
}
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(defaultTextValue)) {
|
||||
mBinding.generalInput.setText(defaultTextValue);
|
||||
dialogBindings.generalInputText.setText(defaultTextValue);
|
||||
}
|
||||
if (inputType != null) {
|
||||
mBinding.generalInput.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
dialogBindings.generalInputText.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
}
|
||||
//Content View
|
||||
dialog.setCancelable(true);
|
||||
dialog.setCanceledOnTouchOutside(false);
|
||||
dialog.setContentView(mBinding.getRoot());
|
||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
UtilityDialog.setTo90PercentWidth(mContext, dialog);
|
||||
|
||||
return dialog;
|
||||
this.setPositiveButton("Ok", (dialog, which) -> {
|
||||
if(onPositiveClick != null) onPositiveClick.run(this.inputValue.get());
|
||||
});
|
||||
|
||||
this.setNegativeButton("Annulla", (dialog, which) -> {
|
||||
if(onNegativeClick != null) onNegativeClick.run();
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static Dialog makeInputDialog(Context mContext, String title, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick) {
|
||||
private static DialogSimpleInputHelper makeBase(Context mContext, String titleText, String defaultTextValue, String hintText, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick, Integer inputType) {
|
||||
DialogSimpleInputHelper dialogSimpleInputHelper = new DialogSimpleInputHelper(
|
||||
mContext,
|
||||
titleText,
|
||||
defaultTextValue,
|
||||
hintText,
|
||||
onPositiveClick,
|
||||
onNegativeClick,
|
||||
inputType
|
||||
);
|
||||
|
||||
return dialogSimpleInputHelper;
|
||||
|
||||
// Dialog dialog = new Dialog(mContext);
|
||||
// DialogSimpleInputViewModel viewModel = new DialogSimpleInputViewModel(dialog);
|
||||
//
|
||||
//
|
||||
// DialogInputGeneralBinding mBinding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.dialog_input_general, null, false);
|
||||
// viewModel
|
||||
// .setOnPositive(() -> {
|
||||
//
|
||||
// onPositiveClick.run(mBinding.generalInput.getText().toString());
|
||||
// })
|
||||
// .setOnNegative(onNegativeClick);
|
||||
//
|
||||
// mBinding.setViewmodel(viewModel);
|
||||
//
|
||||
// //Title VIEW
|
||||
// mBinding.titleText.setText(titleText);
|
||||
//
|
||||
// if (!UtilityString.isNullOrEmpty(hintText)) {
|
||||
// mBinding.generalInput.setHint(hintText);
|
||||
// }
|
||||
//
|
||||
// if (!UtilityString.isNullOrEmpty(defaultTextValue)) {
|
||||
// mBinding.generalInput.setText(defaultTextValue);
|
||||
// }
|
||||
// if (inputType != null) {
|
||||
// mBinding.generalInput.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||
// }
|
||||
// //Content View
|
||||
// dialog.setCancelable(true);
|
||||
// dialog.setCanceledOnTouchOutside(false);
|
||||
// dialog.setContentView(mBinding.getRoot());
|
||||
// dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
// UtilityDialog.setTo90PercentWidth(mContext, dialog);
|
||||
//
|
||||
// return dialog;
|
||||
}
|
||||
|
||||
|
||||
public static DialogSimpleInputHelper makeInputDialog(Context mContext, String title, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick) {
|
||||
|
||||
return makeBase(mContext,
|
||||
title,
|
||||
@@ -75,7 +122,7 @@ public class DialogSimpleInputHelper {
|
||||
}
|
||||
|
||||
|
||||
public static Dialog makeInputDialog(Context mContext, String title, String defaultTextValue, String hintText, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick) {
|
||||
public static DialogSimpleInputHelper makeInputDialog(Context mContext, String title, String defaultTextValue, String hintText, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick) {
|
||||
|
||||
return makeBase(mContext,
|
||||
title,
|
||||
@@ -87,7 +134,7 @@ public class DialogSimpleInputHelper {
|
||||
|
||||
}
|
||||
|
||||
public static Dialog makeInputDialog(Context mContext, String title, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick, Integer inputType) {
|
||||
public static DialogSimpleInputHelper makeInputDialog(Context mContext, String title, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick, Integer inputType) {
|
||||
|
||||
return makeBase(mContext,
|
||||
title,
|
||||
@@ -100,7 +147,7 @@ public class DialogSimpleInputHelper {
|
||||
}
|
||||
|
||||
|
||||
public static Dialog makeInputDialog(Context mContext, String title, String defaultTextValue, String hintText, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick, Integer inputType) {
|
||||
public static DialogSimpleInputHelper makeInputDialog(Context mContext, String title, String defaultTextValue, String hintText, RunnableArgs<String> onPositiveClick, Runnable onNegativeClick, Integer inputType) {
|
||||
|
||||
return makeBase(mContext,
|
||||
title,
|
||||
|
||||
@@ -26,9 +26,11 @@ import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityObservable;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.DialogNoteAggiuntiveNuovaUlBinding;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.adapter.DialogInputLUProdTipoColloAdapter;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.adapter.DialogInputLUProdTipoColloListModel;
|
||||
@@ -40,20 +42,24 @@ public class InfoAggiuntiveLUDialog extends BaseDialogFragment implements InfoAg
|
||||
|
||||
private DialogNoteAggiuntiveNuovaUlBinding mBindings;
|
||||
private final RunnableArgss<String, MtbTCol> mOnComplete;
|
||||
|
||||
private MtbColt currentMtbColt;
|
||||
private DialogInputLUProdTipoColloAdapter codTcolArrayAdapter = null;
|
||||
public ObservableField<String> additionalNotes = new ObservableField<>();
|
||||
public ObservableField<String> selectedMtbTcol = new ObservableField<>();
|
||||
public ObservableField<DialogInputLUProdTipoColloListModel> currentMtbTCol = new ObservableField<>();
|
||||
|
||||
public static InfoAggiuntiveLUDialog newInstance(@NotNull RunnableArgss<String, MtbTCol> onComplete) {
|
||||
return new InfoAggiuntiveLUDialog(onComplete);
|
||||
return new InfoAggiuntiveLUDialog(null, onComplete);
|
||||
}
|
||||
|
||||
private InfoAggiuntiveLUDialog(@NotNull RunnableArgss<String, MtbTCol> onComplete) {
|
||||
public static InfoAggiuntiveLUDialog newInstance(MtbColt mtbColt, @NotNull RunnableArgss<String, MtbTCol> onComplete) {
|
||||
return new InfoAggiuntiveLUDialog(mtbColt, onComplete);
|
||||
}
|
||||
|
||||
private InfoAggiuntiveLUDialog(MtbColt mtbColt, @NotNull RunnableArgss<String, MtbTCol> onComplete) {
|
||||
super();
|
||||
this.mOnComplete = onComplete;
|
||||
|
||||
this.currentMtbColt = mtbColt;
|
||||
}
|
||||
|
||||
|
||||
@@ -121,9 +127,17 @@ public class InfoAggiuntiveLUDialog extends BaseDialogFragment implements InfoAg
|
||||
|
||||
this.mViewModel.getTipiCollo().observe(getViewLifecycleOwner(), tipiCollo -> {
|
||||
|
||||
|
||||
codTcolArrayAdapter = new DialogInputLUProdTipoColloAdapter(getActivity(), R.layout.array_adapter_single_item, tipiCollo);
|
||||
mBindings.filledExposedDropdownCodTcol.setAdapter(codTcolArrayAdapter);
|
||||
|
||||
if (currentMtbColt != null && !UtilityString.isNullOrEmpty(currentMtbColt.getCodTcol()) && UtilityString.isNullOrEmpty(this.selectedMtbTcol.get())) {
|
||||
MtbTCol tipoPedana = Stream.of(tipiCollo).filter(x -> x.getCodTcol().equalsIgnoreCase(currentMtbColt.getCodTcol())).findFirstOrElse(null);
|
||||
if (tipoPedana != null) {
|
||||
this.selectedMtbTcol.set(tipoPedana.getCodTcol() + " - " + tipoPedana.getDescrizione());
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
this.mBindings.filledExposedDropdownCodTcol.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@@ -141,6 +155,9 @@ public class InfoAggiuntiveLUDialog extends BaseDialogFragment implements InfoAg
|
||||
mBindings.buttonConfirm.setOnClickListener(v -> {
|
||||
dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
if (this.currentMtbColt != null) {
|
||||
this.additionalNotes.set(currentMtbColt.getAnnotazioni());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -147,7 +148,7 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
this.init();
|
||||
|
||||
|
||||
if(mBluetoothDeviceInterface != null) {
|
||||
if (mBluetoothDeviceInterface != null) {
|
||||
// Listen to bluetooth events
|
||||
mBluetoothDeviceInterface.setListeners(this::onMessageReceived, this::onMessageSent, x -> this.onError(new Exception(x)));
|
||||
enabledBluetoothDevice.set(true);
|
||||
@@ -400,7 +401,11 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
// Toast.makeText(requireActivity(), "Leggo peso uaglio", Toast.LENGTH_SHORT).show();
|
||||
|
||||
// Let's send a message:
|
||||
mBluetoothDeviceInterface.sendMessage("GW\r");
|
||||
if (mBluetoothDeviceInterface != null) {
|
||||
mBluetoothDeviceInterface.sendMessage("GW\r");
|
||||
} else {
|
||||
Toast.makeText(requireActivity(), "Nessun dispositivo BLUETOOTH configurato nelle impostazioni.", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
private void onMessageSent(String request) {
|
||||
@@ -412,8 +417,8 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
|
||||
String tmpResp = response.replace(".", "");
|
||||
|
||||
BigDecimal grossWeight = new BigDecimal(tmpResp.substring(2,7));
|
||||
BigDecimal netWeight = new BigDecimal(tmpResp.substring(8,13));
|
||||
BigDecimal grossWeight = new BigDecimal(tmpResp.substring(2, 7));
|
||||
BigDecimal netWeight = new BigDecimal(tmpResp.substring(8, 13));
|
||||
|
||||
mViewModel.setPesoNetto(netWeight);
|
||||
mViewModel.setPesoLordo(grossWeight);
|
||||
@@ -424,7 +429,7 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
if (this.mViewModel.validate()) {
|
||||
this.mOnComplete.run(this.mViewModel.getResult());
|
||||
|
||||
if(mBluetoothDeviceInterface != null)
|
||||
if (mBluetoothDeviceInterface != null)
|
||||
mBluetoothDeviceInterface.setListeners(null, null, null);
|
||||
|
||||
dismiss();
|
||||
|
||||
@@ -19,6 +19,11 @@ public class DialogInputQuantityV2DTO {
|
||||
private BigDecimal totalNumCnfOrd;
|
||||
private BigDecimal qtaCnfOrd;
|
||||
|
||||
private BigDecimal totalQtaInWarehouse;
|
||||
private BigDecimal totalNumCnfInWarehouse;
|
||||
private BigDecimal totalQtaCommitted;
|
||||
private BigDecimal totalNumCnfCommitted;
|
||||
|
||||
private BigDecimal totalQtaToBeTaken;
|
||||
private BigDecimal totalNumCnfToBeTaken;
|
||||
private BigDecimal qtaCnfToBeTaken;
|
||||
@@ -31,6 +36,8 @@ public class DialogInputQuantityV2DTO {
|
||||
private boolean isDataScadMandatory = false;
|
||||
private boolean isNotesAllowed = false;
|
||||
private boolean isNotesMandatory = false;
|
||||
private boolean isNumCnfEditable = true;
|
||||
private boolean isFocusOnStart = true;
|
||||
private boolean canLUBeClosed;
|
||||
private boolean saveOnImeDone = false;
|
||||
|
||||
@@ -104,6 +111,42 @@ public class DialogInputQuantityV2DTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalQtaInWarehouse() {
|
||||
return totalQtaInWarehouse;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2DTO setTotalQtaInWarehouse(BigDecimal totalQtaInWarehouse) {
|
||||
this.totalQtaInWarehouse = totalQtaInWarehouse;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalNumCnfInWarehouse() {
|
||||
return totalNumCnfInWarehouse;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2DTO setTotalNumCnfInWarehouse(BigDecimal totalNumCnfInWarehouse) {
|
||||
this.totalNumCnfInWarehouse = totalNumCnfInWarehouse;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalQtaCommitted() {
|
||||
return totalQtaCommitted;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2DTO setTotalQtaCommitted(BigDecimal totalQtaCommitted) {
|
||||
this.totalQtaCommitted = totalQtaCommitted;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalNumCnfCommitted() {
|
||||
return totalNumCnfCommitted;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2DTO setTotalNumCnfCommitted(BigDecimal totalNumCnfCommitted) {
|
||||
this.totalNumCnfCommitted = totalNumCnfCommitted;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalQtaToBeTaken() {
|
||||
return UtilityBigDecimal.round(totalQtaToBeTaken);
|
||||
}
|
||||
@@ -131,6 +174,15 @@ public class DialogInputQuantityV2DTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFocusOnStart() {
|
||||
return isFocusOnStart;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2DTO setFocusOnStart(boolean focusOnStart) {
|
||||
isFocusOnStart = focusOnStart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalQtaAvailable() {
|
||||
return UtilityBigDecimal.round(totalQtaAvailable);
|
||||
}
|
||||
@@ -239,6 +291,15 @@ public class DialogInputQuantityV2DTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isNumCnfEditable() {
|
||||
return isNumCnfEditable;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2DTO setNumCnfEditable(boolean numCnfEditable) {
|
||||
isNumCnfEditable = numCnfEditable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgsWithReturn<DialogInputQuantityV2ViewModel, String> getSuggestPartitaMag() {
|
||||
return suggestPartitaMag;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.input_quantity_v2;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.text.Html;
|
||||
import android.text.InputType;
|
||||
import android.text.SpannableString;
|
||||
@@ -15,7 +15,6 @@ import android.view.inputmethod.EditorInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
@@ -24,6 +23,7 @@ import com.pedromassango.doubleclick.DoubleClick;
|
||||
import com.pedromassango.doubleclick.DoubleClickListener;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -42,6 +42,7 @@ import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbUntMis;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityFocus;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityObservable;
|
||||
import it.integry.integrywmsnative.databinding.DialogInputQuantityV2Binding;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
@@ -57,6 +58,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
private Runnable mOnAbort;
|
||||
|
||||
public ObservableField<Integer> currentTextNumCnfToTake = new ObservableField<>(0);
|
||||
public ObservableField<Boolean> flagShowCnfToTakeLabel = new ObservableField<>(true);
|
||||
public ObservableField<Integer> currentTextNumPezziToTake = new ObservableField<>(0);
|
||||
|
||||
public ObservableField<String> currentPartitaMag = new ObservableField<>();
|
||||
@@ -80,6 +82,8 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
public ObservableField<Boolean> enabledNotes = new ObservableField<>(false);
|
||||
public ObservableField<Boolean> enabledLUCloseButton = new ObservableField<>(true);
|
||||
|
||||
private final Handler mHandler = new Handler();
|
||||
|
||||
private Context context;
|
||||
|
||||
private DialogInputQuantityV2Binding mBindings;
|
||||
@@ -87,7 +91,6 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
private boolean mObservablesInitated = false;
|
||||
|
||||
private int mBarcodeScannerIstanceID;
|
||||
private boolean mFirstStart = true;
|
||||
private boolean mAbort = true;
|
||||
|
||||
|
||||
@@ -106,6 +109,11 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
return this;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2View() {
|
||||
super();
|
||||
// openInFullScreen();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -118,7 +126,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
this.context = getActivity();
|
||||
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.dialog_input_quantity_v2, container, false);
|
||||
mBindings = DialogInputQuantityV2Binding.inflate(inflater, container, false);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
mBindings.toolbar.setTitle("Inserimento articolo");
|
||||
|
||||
@@ -132,6 +140,10 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
.setInitialNumCnf(mDialogInputQuantityV2DTO.getInitialNumCnf())
|
||||
.setInitialQtaCnf(mDialogInputQuantityV2DTO.getInitialQtaCnf())
|
||||
.setInitialQtaTot(mDialogInputQuantityV2DTO.getInitialQtaTot())
|
||||
.setTotalQtaInWarehouse(mDialogInputQuantityV2DTO.getTotalQtaInWarehouse())
|
||||
.setTotalNumCnfInWarehouse(mDialogInputQuantityV2DTO.getTotalNumCnfInWarehouse())
|
||||
.setTotalQtaCommitted(mDialogInputQuantityV2DTO.getTotalQtaCommitted())
|
||||
.setTotalNumCnfCommitted(mDialogInputQuantityV2DTO.getTotalNumCnfCommitted())
|
||||
.setTotalNumCnfOrd(mDialogInputQuantityV2DTO.getTotalNumCnfOrd())
|
||||
.setTotalQtaOrd(mDialogInputQuantityV2DTO.getTotalQtaOrd())
|
||||
.setQtaCnfOrd(mDialogInputQuantityV2DTO.getQtaCnfOrd())
|
||||
@@ -168,10 +180,27 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
});
|
||||
}
|
||||
this.onLoadingEnded();
|
||||
mBindings.inputNumCnfText.requestFocus();
|
||||
if (mDialogInputQuantityV2DTO.isFocusOnStart()) {
|
||||
mHandler.postDelayed(() -> {
|
||||
|
||||
if (mDialogInputQuantityV2DTO.isNumCnfEditable()) {
|
||||
mBindings.inputNumCnfText.requestFocus();
|
||||
} else {
|
||||
UtilityFocus.focusTextBox(requireContext(), mBindings.inputQtaTotText);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
BarcodeManager.removeCallback(mBarcodeScannerIstanceID);
|
||||
if (mAbort) this.mOnAbort.run();
|
||||
}
|
||||
|
||||
private void initBarcode() {
|
||||
mBarcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessful(onScanSuccessful)
|
||||
@@ -181,9 +210,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
this.mViewModel.processBarcodeDTO(data, this::onLoadingEnded);
|
||||
};
|
||||
|
||||
public void save() {
|
||||
@@ -202,29 +229,27 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
BarcodeManager.removeCallback(mBarcodeScannerIstanceID);
|
||||
if (mAbort) this.mOnAbort.run();
|
||||
super.onDismiss(dialog);
|
||||
}
|
||||
// @Override
|
||||
// public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
// BarcodeManager.removeCallback(mBarcodeScannerIstanceID);
|
||||
// if (mAbort) this.mOnAbort.run();
|
||||
// super.onDismiss(dialog);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
|
||||
// if(!mFirstStart) {
|
||||
this.init();
|
||||
// mFirstStart = false;
|
||||
// }
|
||||
|
||||
int onNumCnfInputChanged = SettingsManager.iDB().getOnNumCnfInputChanged();
|
||||
int onQtaTotInputChanged = SettingsManager.iDB().getOnQtaTotInputChanged();
|
||||
|
||||
this.mViewModel.setListener(this);
|
||||
this.mViewModel.init(onNumCnfInputChanged);
|
||||
this.mViewModel.init(onNumCnfInputChanged, onQtaTotInputChanged);
|
||||
}
|
||||
|
||||
private void initObservables() {
|
||||
private void initViewObservables() {
|
||||
|
||||
UtilityObservable.addPropertyChanged(this.currentPartitaMag, (value) -> {
|
||||
if (this.mEnableDataCallback) {
|
||||
@@ -241,11 +266,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
Date minDataScad = calendar.getTime();
|
||||
if (minDataScad.after(value) && value.after(new Date())) {
|
||||
DialogSimpleMessageView
|
||||
.makeWarningDialog(new SpannableString("La data selezionata è precedente alla data di scadenza consigliata per l'articolo scelto ( " + mtbAart.getGgScadPartita() + " giorni) . Continuare?"), null, () -> {
|
||||
this.mViewModel.setDataScad(value);
|
||||
}, () -> {
|
||||
this.currentDataScad.set(null);
|
||||
})
|
||||
.makeWarningDialog(new SpannableString("La data selezionata è precedente alla data di scadenza consigliata per l'articolo scelto ( " + mtbAart.getGgScadPartita() + " giorni) . Continuare?"), null, () -> this.mViewModel.setDataScad(value), () -> this.currentDataScad.set(null))
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
} else {
|
||||
this.mViewModel.setDataScad(value);
|
||||
@@ -281,6 +302,12 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void initViewModelObservables() {
|
||||
|
||||
final ColorStateList textColorsNumCnf = this.mBindings.inputNumCnfLayout.getEditText().getTextColors();
|
||||
final ColorStateList textColorsQtaCnf = this.mBindings.inputQtaCnfLayout.getEditText().getTextColors();
|
||||
final ColorStateList textColorsQtaTot = this.mBindings.inputQtaTotLayout.getEditText().getTextColors();
|
||||
@@ -320,7 +347,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
if (!this.enabledQtaTot.get()) {
|
||||
this.enabledQtaTot.set(true);
|
||||
} else if (!this.enabledNumCnf.get()) {
|
||||
this.enabledNumCnf.set(true);
|
||||
this.enabledNumCnf.set(this.mDialogInputQuantityV2DTO.isNumCnfEditable());
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -329,7 +356,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
toggleTextInputLayoutError(textColorsQtaTot, this.mBindings.inputQtaTotLayout, value);
|
||||
|
||||
if (this.mViewModel.mtbAart.get().isFlagQtaCnfFissaBoolean()) {
|
||||
this.enabledNumCnf.set(!value);
|
||||
this.enabledNumCnf.set(this.mDialogInputQuantityV2DTO.isNumCnfEditable() && !value);
|
||||
} else {
|
||||
if (value) {
|
||||
if (this.mViewModel.blockedQtaCnf.get()) {
|
||||
@@ -341,20 +368,21 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
if (!this.enabledQtaCnf.get()) {
|
||||
this.enabledQtaCnf.set(true);
|
||||
} else if (!this.enabledNumCnf.get()) {
|
||||
this.enabledNumCnf.set(true);
|
||||
this.enabledNumCnf.set(this.mDialogInputQuantityV2DTO.isNumCnfEditable());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mObservablesInitated = true;
|
||||
}
|
||||
|
||||
private void init() {
|
||||
|
||||
if (!mObservablesInitated) {
|
||||
initObservables();
|
||||
initViewObservables();
|
||||
mObservablesInitated = true;
|
||||
}
|
||||
|
||||
initViewModelObservables();
|
||||
|
||||
//Init double taps
|
||||
this.mBindings.inputNumCnfText.setOnClickListener(new DoubleClick(new DoubleClickListener() {
|
||||
@Override
|
||||
@@ -400,9 +428,10 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
this.enabledLUCloseButton.set(this.mDialogInputQuantityV2DTO.isCanLUBeClosed());
|
||||
this.currentTaraArticolo.set(this.mViewModel.getMtbAart().getTaraKg());
|
||||
|
||||
if (this.mDialogInputQuantityV2DTO.getTotalNumCnfOrd() != null && !this.mDialogInputQuantityV2DTO.getTotalNumCnfOrd().equals(BigDecimal.ZERO) && !(this.mDialogInputQuantityV2DTO.getTotalNumCnfOrd().intValue() == 0)) {
|
||||
this.currentTextNumCnfToTake.set(this.mDialogInputQuantityV2DTO.getTotalNumCnfOrd().intValue());
|
||||
int qtaText = this.mDialogInputQuantityV2DTO.getTotalQtaOrd().intValue() % this.mDialogInputQuantityV2DTO.getTotalNumCnfOrd().intValue();
|
||||
if (this.mDialogInputQuantityV2DTO.getMtbAart().isFlagQtaCnfFissaBoolean() && this.mDialogInputQuantityV2DTO.getTotalQtaOrd() != null && !this.mDialogInputQuantityV2DTO.getTotalQtaOrd().equals(BigDecimal.ZERO) && !(this.mDialogInputQuantityV2DTO.getQtaCnfOrd().compareTo(BigDecimal.ZERO) == 0)) {
|
||||
int numCnftoTake = this.mDialogInputQuantityV2DTO.getTotalQtaOrd().divide(this.mDialogInputQuantityV2DTO.getQtaCnfOrd(), 0, RoundingMode.DOWN).intValue();
|
||||
this.currentTextNumCnfToTake.set(numCnftoTake);
|
||||
int qtaText = this.mDialogInputQuantityV2DTO.getTotalQtaOrd().remainder(this.mDialogInputQuantityV2DTO.getQtaCnfOrd()).intValue();
|
||||
this.currentTextNumPezziToTake.set(qtaText);
|
||||
} else {
|
||||
this.currentTextNumCnfToTake.set(0);
|
||||
@@ -444,6 +473,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
BigDecimal taraTot = this.mViewModel.getNumCnf().multiply(articolo.getTaraKg());
|
||||
this.currentTaraTot.set(taraTot);
|
||||
this.currentPesoLordo.set(this.mViewModel.getQtaTot().add(taraTot));
|
||||
this.flagShowCnfToTakeLabel.set(false);
|
||||
}
|
||||
|
||||
this.mBindings.executePendingBindings();
|
||||
|
||||
@@ -45,6 +45,11 @@ public class DialogInputQuantityV2ViewModel {
|
||||
public BigDecimal totalNumCnfToBeTaken;
|
||||
public BigDecimal qtaCnfToBeTaken;
|
||||
|
||||
public BigDecimal totalQtaInWarehouse;
|
||||
public BigDecimal totalNumCnfInWarehouse;
|
||||
public BigDecimal totalQtaCommitted;
|
||||
public BigDecimal totalNumCnfCommitted;
|
||||
|
||||
public BigDecimal totalQtaAvailable;
|
||||
public BigDecimal totalNumCnfAvailable;
|
||||
public BigDecimal qtaCnfAvailable;
|
||||
@@ -70,6 +75,7 @@ public class DialogInputQuantityV2ViewModel {
|
||||
private boolean canOverflowOrderQuantity;
|
||||
private boolean canPartitaMagBeChanged;
|
||||
private int onNumCnfInputChanged;
|
||||
private int onQtaTotInputChanged;
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
@@ -80,8 +86,9 @@ public class DialogInputQuantityV2ViewModel {
|
||||
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||
}
|
||||
|
||||
public void init(int onNumCnfInputChanged) {
|
||||
public void init(int onNumCnfInputChanged, int onQtaTotInputChanged) {
|
||||
this.onNumCnfInputChanged = onNumCnfInputChanged;
|
||||
this.onQtaTotInputChanged = onQtaTotInputChanged;
|
||||
|
||||
if (this.initialNumCnf != null && this.initialQtaTot != null && this.initialQtaCnf != null) {
|
||||
this.internalNumCnf = this.initialNumCnf;
|
||||
@@ -242,6 +249,26 @@ public class DialogInputQuantityV2ViewModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2ViewModel setTotalQtaInWarehouse(BigDecimal totalQtaInWarehouse) {
|
||||
this.totalQtaInWarehouse = totalQtaInWarehouse;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2ViewModel setTotalNumCnfInWarehouse(BigDecimal totalNumCnfInWarehouse) {
|
||||
this.totalNumCnfInWarehouse = totalNumCnfInWarehouse;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2ViewModel setTotalQtaCommitted(BigDecimal totalQtaCommitted) {
|
||||
this.totalQtaCommitted = totalQtaCommitted;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2ViewModel setTotalNumCnfCommitted(BigDecimal totalNumCnfCommitted) {
|
||||
this.totalNumCnfCommitted = totalNumCnfCommitted;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DialogInputQuantityV2ViewModel setTotalQtaOrd(BigDecimal totalQtaOrd) {
|
||||
this.totalQtaOrd = totalQtaOrd;
|
||||
return this;
|
||||
@@ -379,10 +406,22 @@ public class DialogInputQuantityV2ViewModel {
|
||||
}
|
||||
|
||||
|
||||
if (!this.blockedQtaCnf.get() && !this.mtbAart.get().isFlagQtaCnfFissaBoolean() && this.internalNumCnf != null)
|
||||
this.internalQtaCnf = UtilityBigDecimal.divide(newValue, internalNumCnf);
|
||||
else if (!this.blockedNumCnf.get() && this.internalQtaCnf != null)
|
||||
this.internalNumCnf = UtilityBigDecimal.divide(newValue, internalQtaCnf);
|
||||
switch (onNumCnfInputChanged) {
|
||||
case UPDATE_QTA_CNF:
|
||||
if (!this.blockedQtaCnf.get() && !this.mtbAart.get().isFlagQtaCnfFissaBoolean() && this.internalNumCnf != null)
|
||||
this.internalQtaCnf = UtilityBigDecimal.divide(newValue, internalNumCnf);
|
||||
else if (!this.blockedNumCnf.get() && this.internalQtaCnf != null)
|
||||
this.internalNumCnf = UtilityBigDecimal.divide(newValue, internalQtaCnf);
|
||||
break;
|
||||
|
||||
case UPDATE_QTA_TOT:
|
||||
if (!this.blockedNumCnf.get() && this.internalQtaCnf != null)
|
||||
this.internalNumCnf = UtilityBigDecimal.divide(newValue, internalQtaCnf);
|
||||
else if (!this.blockedQtaCnf.get() && !this.mtbAart.get().isFlagQtaCnfFissaBoolean() && this.internalNumCnf != null)
|
||||
this.internalQtaCnf = UtilityBigDecimal.divide(newValue, internalNumCnf);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
this.mListener.onDataChanged();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.printSsccUl;
|
||||
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface DialogPrintUlSSCCComponent {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
DialogPrintUlSSCCComponent create();
|
||||
}
|
||||
|
||||
void inject(DialogPrintUlSSCCView dialogPrintUlSSCCView);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.printSsccUl;
|
||||
|
||||
import dagger.Module;
|
||||
|
||||
@Module(subcomponents = DialogPrintUlSSCCComponent.class)
|
||||
public class DialogPrintUlSSCCModule {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.printSsccUl;
|
||||
|
||||
import android.content.Context;
|
||||
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.widget.RadioGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.DialogPrintUlSsccBinding;
|
||||
import it.integry.integrywmsnative.view.dialogs.printSsccUl.dto.PrintUlDTO;
|
||||
|
||||
public class DialogPrintUlSSCCView extends BaseDialogFragment {
|
||||
|
||||
|
||||
private Context mContext;
|
||||
private DialogPrintUlSsccBinding mBindings;
|
||||
private final PrintUlDTO printUlDTO;
|
||||
private final RunnableArgs<PrintUlDTO> onDialogClose;
|
||||
|
||||
|
||||
public static DialogPrintUlSSCCView newInstance(
|
||||
String codJcom, MtbColt mtbColt,
|
||||
RunnableArgs<PrintUlDTO> onDismiss
|
||||
) {
|
||||
return new DialogPrintUlSSCCView(codJcom, mtbColt, onDismiss);
|
||||
}
|
||||
|
||||
public DialogPrintUlSSCCView(@NotNull String codJcom, @NotNull MtbColt mtbColt, @NotNull RunnableArgs<PrintUlDTO> onDismiss) {
|
||||
this.onDialogClose = onDismiss;
|
||||
|
||||
this.printUlDTO = new PrintUlDTO()
|
||||
.setMtbColt(mtbColt)
|
||||
.setFlagPrintShipmentLabel(!UtilityString.isNullOrEmpty(codJcom))
|
||||
.setFlagPrintProductionLabel(UtilityString.isNullOrEmpty(codJcom));
|
||||
}
|
||||
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
this.mContext = getActivity();
|
||||
|
||||
mBindings = DialogPrintUlSsccBinding.inflate(inflater, container, false);
|
||||
|
||||
MainApplication.appComponent
|
||||
.dialogPrintUlSSCCComponent()
|
||||
.create();
|
||||
|
||||
mBindings.setView(this);
|
||||
setCancelable(true);
|
||||
getDialog().setCanceledOnTouchOutside(true);
|
||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
public void onCheckChange(RadioGroup radioGroup, int id) {
|
||||
this.printUlDTO.setFlagPrintProductionLabel(id == mBindings.printProductionLabel.getId());
|
||||
this.printUlDTO.setFlagPrintShipmentLabel(id == mBindings.printShippingLabel.getId());
|
||||
|
||||
}
|
||||
|
||||
public void onPositiveClick() {
|
||||
this.dismiss();
|
||||
}
|
||||
|
||||
public void onNegativeClick() {
|
||||
this.printUlDTO.setFlagPrintProductionLabel(false);
|
||||
this.printUlDTO.setFlagPrintShipmentLabel(false);
|
||||
this.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
this.onDialogClose.run(this.printUlDTO);
|
||||
super.onDismiss(dialog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(@NonNull DialogInterface dialog) {
|
||||
this.onNegativeClick();
|
||||
super.onCancel(dialog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
if (this.printUlDTO.isFlagPrintShipmentLabel()) {
|
||||
mBindings.printShippingLabel.setChecked(true);
|
||||
} else {
|
||||
mBindings.printProductionLabel.setChecked(true);
|
||||
}
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
UtilityExceptions.defaultException(this.mContext, ex);
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.printSsccUl.dto;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
|
||||
public class PrintUlDTO {
|
||||
|
||||
private boolean flagPrintShipmentLabel = false;
|
||||
private boolean flagPrintProductionLabel = false;
|
||||
private MtbColt mtbColt;
|
||||
|
||||
public boolean isFlagPrintShipmentLabel() {
|
||||
return flagPrintShipmentLabel;
|
||||
}
|
||||
|
||||
public PrintUlDTO setFlagPrintShipmentLabel(boolean flagPrintShipmentLabel) {
|
||||
this.flagPrintShipmentLabel = flagPrintShipmentLabel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagPrintProductionLabel() {
|
||||
return flagPrintProductionLabel;
|
||||
}
|
||||
|
||||
public PrintUlDTO setFlagPrintProductionLabel(boolean flagPrintProductionLabel) {
|
||||
this.flagPrintProductionLabel = flagPrintProductionLabel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbColt getMtbColt() {
|
||||
return mtbColt;
|
||||
}
|
||||
|
||||
public PrintUlDTO setMtbColt(MtbColt mtbColt) {
|
||||
this.mtbColt = mtbColt;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -98,7 +98,7 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
|
||||
mBarcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessful(onScanSuccessfull)
|
||||
.setOnScanFailed(this::onError));
|
||||
|
||||
BarcodeManager.enable();
|
||||
setBarcodeListener(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.scan_or_create_lu;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
@@ -92,8 +93,6 @@ public class DialogScanOrCreateLUView extends BaseDialogFragment implements Dial
|
||||
this.mViewModel
|
||||
.setListener(this);
|
||||
|
||||
getDialog().setCanceledOnTouchOutside(false);
|
||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
this.mViewModel.init(mShouldCheckResiduo, mShouldCheckIfExistDoc, mEnableCreation);
|
||||
|
||||
@@ -110,12 +109,22 @@ public class DialogScanOrCreateLUView extends BaseDialogFragment implements Dial
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
var dialog = super.onCreateDialog(savedInstanceState);
|
||||
|
||||
dialog.setCanceledOnTouchOutside(false);
|
||||
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
BarcodeManager.removeCallback(mBarcodeScannerIstanceID);
|
||||
BarcodeManager.enable();
|
||||
if(openedMtbColt == null) {
|
||||
if (openedMtbColt == null) {
|
||||
mOnComplete.run(null, false);
|
||||
}
|
||||
super.onDismiss(dialog);
|
||||
@@ -126,7 +135,7 @@ public class DialogScanOrCreateLUView extends BaseDialogFragment implements Dial
|
||||
mBarcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessful(onScanSuccessfull)
|
||||
.setOnScanFailed(this::onError));
|
||||
|
||||
BarcodeManager.enable();
|
||||
setBarcodeListener(true);
|
||||
}
|
||||
|
||||
@@ -150,11 +159,11 @@ public class DialogScanOrCreateLUView extends BaseDialogFragment implements Dial
|
||||
@Override
|
||||
public void onLUVenditaConfirmRequired(RunnableArgs<Boolean> onConfirm) {
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(getString(R.string.lu_gest_v_loading_alert)),
|
||||
null, () -> {
|
||||
onConfirm.run(true);
|
||||
}, () -> {
|
||||
onConfirm.run(false);
|
||||
})
|
||||
null, () -> {
|
||||
onConfirm.run(true);
|
||||
}, () -> {
|
||||
onConfirm.run(false);
|
||||
})
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/colorRipple"> <!-- ripple color -->
|
||||
|
||||
<!-- for Button -->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/full_white"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</ripple>
|
||||
@@ -193,7 +193,7 @@
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="2dp"
|
||||
android:gravity="center"
|
||||
android:visibility="@{view.currentTextNumCnfToTake > 0 || view.currentTextNumPezziToTake > 0 ? View.VISIBLE : View.GONE}">
|
||||
android:visibility="@{view.flagShowCnfToTakeLabel && (view.currentTextNumCnfToTake > 0 || view.currentTextNumPezziToTake > 0 )? View.VISIBLE : View.GONE}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
@@ -276,6 +276,215 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_weight="0.5"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@color/light_blue_100"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:visibility="@{viewmodel.totalNumCnfInWarehouse != null || viewmodel.totalQtaInWarehouse != null ? View.VISIBLE : View.GONE}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/in_warehouse"
|
||||
android:textColor="@color/gray_600" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
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(viewmodel.totalNumCnfInWarehouse, 1)}"
|
||||
android:textColor="@color/gray_600"
|
||||
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="@string/unt_mis_col"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="("
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text="@{UtilityNumber.decimalToString(viewmodel.totalQtaInWarehouse, 2)}"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="2dp"
|
||||
android:text="@{viewmodel.mtbAart.untMis}"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text=")"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_weight="0.5"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@color/light_blue_100"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:visibility="@{viewmodel.totalNumCnfCommitted != null || viewmodel.totalQtaCommitted != null ? View.VISIBLE : View.GONE}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/total_committed"
|
||||
android:textColor="@color/gray_600" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
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(viewmodel.totalNumCnfCommitted, 1)}"
|
||||
android:textColor="@color/gray_600"
|
||||
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="@string/unt_mis_col"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="("
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text="@{UtilityNumber.decimalToString(viewmodel.totalQtaCommitted, 2)}"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="2dp"
|
||||
android:text="@{viewmodel.mtbAart.untMis}"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text=")"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
150
app/src/main/res/layout-large/activity_login.xml
Normal file
150
app/src/main/res/layout-large/activity_login.xml
Normal file
@@ -0,0 +1,150 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.login.LoginActivity" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorPrimarySurface"
|
||||
android:gravity="center">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="32dp"
|
||||
app:cardCornerRadius="16dp">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingTop="56dp"
|
||||
android:paddingRight="24dp"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="72dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/logo_integry_testo" />
|
||||
|
||||
<!-- Username Label -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:errorText="@{view.usernameError}"
|
||||
app:hintTextAppearance="@style/hint_text">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="300dp"
|
||||
android:hint="Username"
|
||||
android:inputType="textEmailAddress"
|
||||
app:binding="@{view.username}" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- Password Label -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:errorText="@{view.passwordError}"
|
||||
app:hintTextAppearance="@style/hint_text"
|
||||
app:passwordToggleEnabled="true">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_password"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="300dp"
|
||||
android:hint="Password"
|
||||
android:inputType="textPassword"
|
||||
app:binding="@{view.password}" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
android:id="@+id/login_checkbox_custom_server"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{view.customSettingsCheckboxEnabled}"
|
||||
android:text="@string/action_customize_server_settings"
|
||||
app:checked="@{view.customSettingsCheckboxChecked}" />
|
||||
|
||||
<net.cachapa.expandablelayout.ExpandableLayout
|
||||
android:id="@+id/login_layout_server_details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="12dp"
|
||||
app:el_duration="400"
|
||||
app:el_expanded_bind="@{view.customSettingsCheckboxChecked}">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!--Host Label-->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:errorText="@{view.codAziendaError}"
|
||||
app:hintTextAppearance="@style/hint_text">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_cod_azienda"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Codice azienda"
|
||||
android:inputType="text"
|
||||
app:binding="@{view.codAzienda}" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</net.cachapa.expandablelayout.ExpandableLayout>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_login"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:minWidth="170dp"
|
||||
android:enabled="@{view.loginButtonEnabled}"
|
||||
android:text="@string/login"
|
||||
app:onClick="@{() -> view.login()}" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</ScrollView>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</layout>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -60,7 +60,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="end"
|
||||
android:background="@drawable/ripple_effect"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_search_black_24dp"
|
||||
android:onClick="@{()->view.manualSearch()}"
|
||||
|
||||
@@ -10,122 +10,124 @@
|
||||
</data>
|
||||
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
<ScrollView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingTop="56dp"
|
||||
android:paddingRight="24dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="72dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:src="@drawable/logo_integry_testo" />
|
||||
|
||||
<!-- Username Label -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:errorText="@{view.usernameError}"
|
||||
app:hintTextAppearance="@style/hint_text"
|
||||
style="@style/TextInputLayout.OutlinePrimary">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_username"
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Username"
|
||||
android:inputType="textEmailAddress"
|
||||
app:binding="@{view.username}" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingTop="56dp"
|
||||
android:paddingRight="24dp">
|
||||
|
||||
<!-- Password Label -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:errorText="@{view.passwordError}"
|
||||
app:hintTextAppearance="@style/hint_text"
|
||||
app:passwordToggleEnabled="true"
|
||||
style="@style/TextInputLayout.OutlinePrimary">
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="72dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:src="@drawable/logo_integry_testo" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Password"
|
||||
android:inputType="textPassword"
|
||||
app:binding="@{view.password}" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
android:id="@+id/login_checkbox_custom_server"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{view.customSettingsCheckboxEnabled}"
|
||||
android:text="@string/action_customize_server_settings"
|
||||
app:checked="@{view.customSettingsCheckboxChecked}" />
|
||||
|
||||
<net.cachapa.expandablelayout.ExpandableLayout
|
||||
android:id="@+id/login_layout_server_details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="12dp"
|
||||
app:el_duration="400"
|
||||
app:el_expanded_bind="@{view.customSettingsCheckboxChecked}">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!--Host Label-->
|
||||
<!-- Username Label -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:errorText="@{view.codAziendaError}"
|
||||
app:hintTextAppearance="@style/hint_text"
|
||||
style="@style/TextInputLayout.OutlinePrimary">
|
||||
android:layout_marginBottom="8dp"
|
||||
app:errorText="@{view.usernameError}"
|
||||
app:hintTextAppearance="@style/hint_text">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_cod_azienda"
|
||||
android:id="@+id/input_username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Codice azienda"
|
||||
android:inputType="text"
|
||||
app:binding="@{view.codAzienda}" />
|
||||
android:hint="Username"
|
||||
android:inputType="textEmailAddress"
|
||||
app:binding="@{view.username}" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<!-- Password Label -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:errorText="@{view.passwordError}"
|
||||
app:hintTextAppearance="@style/hint_text"
|
||||
app:passwordToggleEnabled="true">
|
||||
|
||||
</net.cachapa.expandablelayout.ExpandableLayout>
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Password"
|
||||
android:inputType="textPassword"
|
||||
app:binding="@{view.password}" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
android:id="@+id/login_checkbox_custom_server"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{view.customSettingsCheckboxEnabled}"
|
||||
android:text="@string/action_customize_server_settings"
|
||||
app:checked="@{view.customSettingsCheckboxChecked}" />
|
||||
|
||||
<net.cachapa.expandablelayout.ExpandableLayout
|
||||
android:id="@+id/login_layout_server_details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="12dp"
|
||||
app:el_duration="400"
|
||||
app:el_expanded_bind="@{view.customSettingsCheckboxChecked}">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!--Host Label-->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/TextInputLayout.OutlinePrimary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:errorText="@{view.codAziendaError}"
|
||||
app:hintTextAppearance="@style/hint_text">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input_cod_azienda"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Codice azienda"
|
||||
android:inputType="text"
|
||||
app:binding="@{view.codAzienda}" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</net.cachapa.expandablelayout.ExpandableLayout>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_login"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:enabled="@{view.loginButtonEnabled}"
|
||||
android:text="@string/login"
|
||||
app:onClick="@{() -> view.login()}" />
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_login"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:enabled="@{view.loginButtonEnabled}"
|
||||
android:text="@string/login"
|
||||
app:onClick="@{() -> view.login()}" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</ScrollView>
|
||||
</layout>
|
||||
341
app/src/main/res/layout/activity_prod_dettaglio_linea.xml
Normal file
341
app/src/main/res/layout/activity_prod_dettaglio_linea.xml
Normal file
@@ -0,0 +1,341 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.R" />
|
||||
|
||||
<import type="androidx.core.content.ContextCompat" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="it.integry.integrywmsnative.gest.prod_dettaglio_linea.ProdDettaglioLineaViewModel" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.prod_dettaglio_linea.ProdDettaglioLineaActivity" />
|
||||
</data>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/gray_detail_background_round8">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/header_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<it.integry.integrywmsnative.ui.ElevatedToolbar
|
||||
android:id="@+id/elevated_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?actionBarSize">
|
||||
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
</it.integry.integrywmsnative.ui.ElevatedToolbar>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/frame_layout_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/white"
|
||||
android:padding="16dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Headline"
|
||||
android:text="@{view.lineaLabel}"
|
||||
tools:text="L2 - Linea 2"
|
||||
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/add_extra_items_toolbar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:onClick="@{()->viewModel.settings()}"
|
||||
android:padding="6dp"
|
||||
android:src="@drawable/ic_settings_24dp"
|
||||
android:tint="@color/colorPrimaryGray" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:src="@{ContextCompat.getDrawable(context, view.isStarted.get() ? R.drawable.ic_baseline_play_arrow_24 : view.isPaused.get() ? R.drawable.ic_baseline_pause_24 : R.drawable.ic_baseline_stop_24)}"
|
||||
app:tint="@{ContextCompat.getColor(context, view.isStarted.get() ? R.color.green_600 : view.isPaused.get() ? R.color.orange_600 : R.color.red_600)}"
|
||||
tools:tint="@color/green_600"
|
||||
tools:src="@drawable/ic_baseline_play_arrow_24" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/peso_lordo_collo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:text="@{view.isStarted.get() ? R.string.in_progress : view.isPaused.get() ? R.string.stand_by : R.string.stopped}"
|
||||
android:textAppearance="@style/AppTheme.NewMaterial.Text.Small"
|
||||
app:textColor="@{ContextCompat.getColor(context, view.isStarted.get() ? R.color.green_600 : view.isPaused.get() ? R.color.orange_600 : R.color.red_600)}"
|
||||
tools:textColor="@color/green_600"
|
||||
android:textStyle="bold"
|
||||
tools:text="In lavorazione" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:visibility="@{view.isStarted}"
|
||||
android:layout_marginTop="16dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/risorse_impostate"
|
||||
android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
tools:text="Risorse assegnate" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
app:text="@{view.hrNum}"
|
||||
android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:textStyle="bold"
|
||||
tools:text="25" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical"
|
||||
app:visibility="@{view.flagShowProdInfo}"
|
||||
android:layout_marginTop="16dp"
|
||||
android:padding="16dp">
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/production_in_progress"
|
||||
tools:text="Lavorazione in corso"
|
||||
android:textAppearance="@style/AppTheme.NewMaterial.Text.TextBoxGroupTitleDashboard" />
|
||||
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/article"
|
||||
android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
tools:text="Articolo" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
app:text="@{view.codMart}"
|
||||
android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:textStyle="bold"
|
||||
tools:text="150150-09" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/batch_lot"
|
||||
android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
tools:text="Lotto" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
app:text="@{view.partitaMag}"
|
||||
android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:textStyle="bold"
|
||||
tools:text="20220530" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/label_descrizione"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/description"
|
||||
android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="Descrizione" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="end"
|
||||
android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/label_descrizione"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:text="@{view.productDescription}"
|
||||
tools:text="UVA VITTORIA IN CASSE " />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/orders_in_progress"
|
||||
tools:text="Ordini in lavorazione"
|
||||
android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium" />
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/orders_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
</HorizontalScrollView>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:padding="16dp"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/versamento_merce_fragment_title"
|
||||
android:textAppearance="@style/AppTheme.NewMaterial.Text.TextBoxGroupTitleDashboard" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/scan_art_spinner"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="24dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintTop_toBottomOf="@id/header_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/scan_lu_to_deposit"
|
||||
android:textSize="16sp" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
</layout>
|
||||
@@ -53,7 +53,7 @@
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="end"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@drawable/ripple_effect"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:onClick="@{()->viewModel.manualSearch()}"
|
||||
android:src="@drawable/ic_search_black_24dp"
|
||||
android:tint="@color/colorPrimaryGray" />
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="end"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@drawable/ripple_effect"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:src="@drawable/ic_add_24dp"
|
||||
android:tint="@color/colorPrimaryGray"
|
||||
app:visibility="@{spedizioneView.addExtraItemsEnabled}"
|
||||
@@ -73,7 +73,7 @@
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="end"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@drawable/ripple_effect"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
app:singleClick="@{() -> spedizioneView.startManualSearch()}"
|
||||
android:src="@drawable/ic_black_barcode"
|
||||
android:tint="@color/colorPrimaryGray"
|
||||
|
||||
@@ -8,18 +8,19 @@
|
||||
|
||||
<import type="it.integry.integrywmsnative.R" />
|
||||
|
||||
<import type="androidx.core.content.ContextCompat" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<import type="androidx.core.content.ContextCompat" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityDate" />
|
||||
|
||||
<variable
|
||||
type="it.integry.integrywmsnative.gest.prod_linee_produzione.dialogs.BottomSheetLineAction"
|
||||
type="it.integry.integrywmsnative.gest.prod_dettaglio_linea.dialogs.BottomSheetLineAction"
|
||||
name="view" />
|
||||
|
||||
<variable
|
||||
@@ -32,7 +33,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp">
|
||||
android:padding="16dp">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/descriptionLayout"
|
||||
@@ -202,6 +203,30 @@
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:onClick="@{()->view.onRecoverClicked()}"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_black_download" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/TextAppearance.Material3.BodyLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:text="@string/prod_recupero_materiale_title_fragment" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:clickable="true"
|
||||
android:background="@drawable/ripple_effect">
|
||||
android:background="?attr/selectableItemBackground">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
44
app/src/main/res/layout/dialog_input_general_content.xml
Normal file
44
app/src/main/res/layout/dialog_input_general_content.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.view.dialogs.base.DialogSimpleInputHelper" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="16dp">
|
||||
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/general_input_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:focusableInTouchMode="false"
|
||||
android:imeOptions="actionDone"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/general_input_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:selectAllOnFocus="true"
|
||||
app:binding="@{view.inputValue}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
@@ -50,7 +50,7 @@
|
||||
android:src="@drawable/ic_erase_96"
|
||||
android:backgroundTint="@android:color/transparent"
|
||||
android:onClick="@{() -> view.resetValues()}"
|
||||
android:tint="@android:color/white"/>
|
||||
android:tint="@android:color/white" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/read_weight_form_device"
|
||||
@@ -329,9 +329,8 @@
|
||||
style="@style/Button.DangerFull"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_weight="0.4"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_weight="0.5"
|
||||
android:onClick="@{() -> view.dismiss()}"
|
||||
android:paddingEnd="3dp"
|
||||
android:text="@string/abort"
|
||||
@@ -345,9 +344,8 @@
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_weight="0.45"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="0.5"
|
||||
android:onClick="@{() -> view.save()}"
|
||||
android:paddingEnd="3dp"
|
||||
android:text="@string/confirm"
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -203,7 +204,7 @@
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="2dp"
|
||||
android:gravity="center"
|
||||
android:visibility="@{view.currentTextNumCnfToTake > 0 || view.currentTextNumPezziToTake > 0 ? View.VISIBLE : View.GONE}">
|
||||
android:visibility="@{view.flagShowCnfToTakeLabel && (view.currentTextNumCnfToTake > 0 || view.currentTextNumPezziToTake > 0) ? View.VISIBLE : View.GONE}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
@@ -287,6 +288,214 @@
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_weight="0.5"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@color/light_blue_100"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:visibility="@{viewmodel.totalNumCnfInWarehouse != null || viewmodel.totalQtaInWarehouse != null ? View.VISIBLE : View.GONE}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/in_warehouse"
|
||||
android:textColor="@color/gray_600" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
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(viewmodel.totalNumCnfInWarehouse, 1)}"
|
||||
android:textColor="@color/gray_600"
|
||||
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="@string/unt_mis_col"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="("
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text="@{UtilityNumber.decimalToString(viewmodel.totalQtaInWarehouse, 2)}"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="2dp"
|
||||
android:text="@{viewmodel.mtbAart.untMis}"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text=")"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_weight="0.5"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@color/light_blue_100"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:visibility="@{viewmodel.totalNumCnfCommitted != null || viewmodel.totalQtaCommitted != null ? View.VISIBLE : View.GONE}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/total_committed"
|
||||
android:textColor="@color/gray_600" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
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(viewmodel.totalNumCnfCommitted, 1)}"
|
||||
android:textColor="@color/gray_600"
|
||||
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="@string/unt_mis_col"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="("
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text="@{UtilityNumber.decimalToString(viewmodel.totalQtaCommitted, 2)}"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="2dp"
|
||||
android:text="@{viewmodel.mtbAart.untMis}"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="0dp"
|
||||
android:text=")"
|
||||
android:textColor="@color/gray_600"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -624,7 +833,6 @@
|
||||
android:layout_weight="@{!viewmodel.mtbAart.flagQtaCnfFissaBoolean ? 1f : 1.5f}"
|
||||
android:enabled="@{view.enabledQtaTot}"
|
||||
android:focusableInTouchMode="false"
|
||||
android:imeOptions="actionDone"
|
||||
tools:layout_weight="1">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
@@ -636,6 +844,7 @@
|
||||
android:hint="@string/tot_qty"
|
||||
android:inputType="number"
|
||||
android:selectAllOnFocus="true"
|
||||
android:imeOptions="actionDone"
|
||||
app:binding="@{view.currentQtaTot}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
121
app/src/main/res/layout/dialog_print_ul_sscc.xml
Normal file
121
app/src/main/res/layout/dialog_print_ul_sscc.xml
Normal file
@@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.view.dialogs.printSsccUl.DialogPrintUlSSCCView" />
|
||||
</data>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:cardBackgroundColor="@android:color/transparent"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/base"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:cardBackgroundColor="@color/light_blue_300"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:background="@drawable/dialog_card_child_bg"
|
||||
android:padding="24dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:text="@string/action_close_order" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/description_text"
|
||||
style="@style/TextViewMaterial"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="left"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_text"
|
||||
android:text="@string/message_print_SSCC_list_on_close_order" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radioGroup"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:onCheckedChanged="@{view::onCheckChange}"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/description_text">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/print_shipping_label"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/action_print_shipping_SSCC" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/print_production_label"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/action_print_production_SSCC" />
|
||||
</RadioGroup>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonPositive"
|
||||
style="?attr/materialButtonOutlinedStyle"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="@{() -> view.onPositiveClick()}"
|
||||
android:text="@string/confirm"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/radioGroup" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/buttonNegative"
|
||||
style="@style/Button.DangerOutline"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="@{() -> view.onNegativeClick()}"
|
||||
android:text="@string/abort"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginStart="12dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/radioGroup"
|
||||
app:layout_constraintEnd_toStartOf="@id/buttonPositive"
|
||||
|
||||
/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</layout>
|
||||
@@ -59,6 +59,7 @@
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/scan_label"
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -1,86 +1,85 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout 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:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/full_white">
|
||||
|
||||
<RelativeLayout
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/lines_main_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:itemCount="5"
|
||||
tools:listitem="@layout/fragment_linee_prod_main_list_model" />
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/lines_main_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/lines_list_empty_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0.3">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_top"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.1" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/lines_list_empty_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0.3">
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.15" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_top"
|
||||
android:layout_width="wrap_content"
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.85" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.1" />
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_playlist_add_check_24dp" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_left"
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.15" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_empty_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.85" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
||||
android:text="@string/nessuna_linea_disponibile"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_playlist_add_check_24dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/nessuna_linea_disponibile"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@@ -25,204 +25,200 @@
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<RelativeLayout
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="0dp">
|
||||
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp"
|
||||
android:weightSum="2">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/mtb_grp_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp"
|
||||
android:weightSum="2">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/mtb_grp_container"
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Large"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{listModel.getLabel()}"
|
||||
android:textColor="@{ContextCompat.getColor(context,listModel.isStarted() ? R.color.green_600 : listModel.isPaused() ? R.color.orange_600 : R.color.red_600)}"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="L2 - Linea 2"
|
||||
tools:textColor="@color/green_600" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@{ContextCompat.getColor(context, listModel.isStarted() ? R.color.green_600 : listModel.isPaused() ? R.color.orange_600 : R.color.red_600)}"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2"
|
||||
tools:backgroundTint="@color/green_600">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="19dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:src="@{ContextCompat.getDrawable(context, listModel.isStarted() ? R.drawable.ic_baseline_play_arrow_24 : listModel.isPaused() ? R.drawable.ic_baseline_pause_24 : R.drawable.ic_baseline_stop_24)}"
|
||||
app:tint="@color/white"
|
||||
tools:src="@drawable/ic_baseline_play_arrow_24" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Large"
|
||||
android:id="@+id/peso_lordo_collo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{listModel.getLabel()}"
|
||||
android:textColor="@{ContextCompat.getColor(context,listModel.isStarted() ? R.color.green_600 : listModel.isPaused() ? R.color.orange_600 : R.color.red_600)}"
|
||||
android:textSize="16sp"
|
||||
android:text="@{listModel.isStarted() ? R.string.in_progress : listModel.isPaused() ? R.string.stand_by : R.string.stopped}"
|
||||
android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
tools:text="L2 - Linea 2"
|
||||
tools:textColor="@color/green_600" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@{ContextCompat.getColor(context, listModel.isStarted() ? R.color.green_600 : listModel.isPaused() ? R.color.orange_600 : R.color.red_600)}"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2"
|
||||
tools:backgroundTint="@color/green_600">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="19dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:src="@{ContextCompat.getDrawable(context, listModel.isStarted() ? R.drawable.ic_baseline_play_arrow_24 : listModel.isPaused() ? R.drawable.ic_baseline_pause_24 : R.drawable.ic_baseline_stop_24)}"
|
||||
app:tint="@color/white"
|
||||
tools:src="@drawable/ic_baseline_play_arrow_24" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/peso_lordo_collo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{listModel.isStarted() ? R.string.in_progress : listModel.isPaused() ? R.string.stand_by : R.string.stopped}"
|
||||
android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
tools:text="In lavorazione" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/resources_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="@{listModel.isStarted() ? View.VISIBLE : View.GONE}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/risorse_impostate"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/resources"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{listModel.getRisorseLabel()}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="5/25" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/lista_ords_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="@{listModel.isStarted() && !UtilityString.isNullOrEmpty(listModel.listaOrd) ? View.VISIBLE : View.GONE}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/orders_in_progress"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/lista_ords"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{listModel.listaOrd}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="125|255" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/production_start_cotnainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="@{listModel.isStarted() ? View.VISIBLE : View.GONE}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/inizio_produzione"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/production_start"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{UtilityDate.formatDate(listModel.datetimeStart, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH)}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="05/07/2022 14:00:00" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/production_stop_cotnainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="@{listModel.isStarted() ? View.GONE : View.VISIBLE}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/ultima_produzione"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/production_stop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{UtilityDate.formatDate(listModel.datetimeEnd, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH)}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="05/07/2022 23:59:59" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
tools:text="In lavorazione" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/resources_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="@{listModel.isStarted() ? View.VISIBLE : View.GONE}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/risorse_impostate"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/resources"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{listModel.getRisorseLabel()}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="5/25" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/lista_ords_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="@{listModel.isStarted() && !UtilityString.isNullOrEmpty(listModel.listaOrd) ? View.VISIBLE : View.GONE}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/orders_in_progress"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/lista_ords"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{listModel.listaOrd}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="125|255" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/production_start_cotnainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="@{listModel.isStarted() ? View.VISIBLE : View.GONE}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/inizio_produzione"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/production_start"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{UtilityDate.formatDate(listModel.datetimeStart, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH)}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="05/07/2022 14:00:00" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/production_stop_cotnainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="@{listModel.isStarted() ? View.GONE : View.VISIBLE}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/ultima_produzione"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/production_stop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{UtilityDate.formatDate(listModel.datetimeEnd, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH)}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="05/07/2022 23:59:59" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -3,12 +3,13 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/Widget.MaterialComponents.CardView"
|
||||
style="@style/Widget.Material3.CardView.Elevated"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="4dp">
|
||||
app:cardCornerRadius="4dp"
|
||||
app:cardElevation="4dp">
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +21,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/menu_icon"
|
||||
android:layout_width="64sp"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
android:background="@android:color/white"
|
||||
android:id="@+id/prod_recupero_materiale_main_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:listitem="@layout/prod_recupero_materiale_list_item"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/empty_view"
|
||||
@@ -54,25 +56,25 @@
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_playlist_add_check_24dp"
|
||||
android:adjustViewBounds="true"/>
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_playlist_add_check_24dp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/no_item_in_recupera_materiale"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="18sp"
|
||||
android:text="@string/no_item_in_recupera_materiale"/>
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -22,10 +22,11 @@
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
app:visibility="@{view.isLargeLayout}">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/order_list_fragment"
|
||||
android:id="@+id/left_side_fragment_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
@@ -36,7 +37,7 @@
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/order_detail_fragment"
|
||||
android:id="@+id/right_side_fragment_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
@@ -44,6 +45,15 @@
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/full_width_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:reverse_visibility="@{view.isLargeLayout}"
|
||||
tools:layout="@layout/fragment_prod_rientro_merce_order_list" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user