Compare commits
33 Commits
v1.13.20(1
...
v1.13.28(1
| Author | SHA1 | Date | |
|---|---|---|---|
| e50aa1f014 | |||
| ed55eb4279 | |||
| 9ac96ac8fd | |||
| 5be3fd9c25 | |||
| bab558252a | |||
| c256b39119 | |||
| af76627c50 | |||
| f9544566e9 | |||
| 4f02c3a4bc | |||
| ea8d8835cd | |||
| 61e07e8f76 | |||
| 962e1f7fa4 | |||
| 07d889bcd5 | |||
| 170db3eb0a | |||
| 856a807e3e | |||
| c56aa812ff | |||
| 770f014a70 | |||
| f6ff7aa80d | |||
| 4cd3e7e102 | |||
| 69bf5e319e | |||
| 88fe4d82cd | |||
| c8cd794cfc | |||
| 5dcc567eab | |||
| 89eafaf6ca | |||
| 6fc7f80ed4 | |||
| 2464d44222 | |||
| 96d544f2ad | |||
| e85ddc6580 | |||
| 89f6b9ce71 | |||
| c7d0ed1747 | |||
| b84b3c28f3 | |||
| 3a3bf4c2dd | |||
| 4809a96e5b |
@@ -7,8 +7,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 166
|
||||
def appVersionName = '1.13.20'
|
||||
def appVersionCode = 174
|
||||
def appVersionName = '1.13.28'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -102,8 +102,8 @@ dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.3.0-alpha03'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.3'
|
||||
implementation 'com.google.android.material:material:1.3.0-alpha04'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
||||
implementation 'androidx.preference:preference-ktx:1.1.1'
|
||||
|
||||
@@ -171,7 +171,7 @@ public class Converters {
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
String newValue = observableString.get();
|
||||
String viewValue = view.getText().toString().trim();
|
||||
String viewValue = view.getText().toString();
|
||||
|
||||
if(!viewValue.equalsIgnoreCase(newValue)) {
|
||||
view.setText(newValue);
|
||||
|
||||
@@ -246,7 +246,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
}
|
||||
|
||||
accettazioneListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfOrd());
|
||||
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
} else {
|
||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||
@@ -263,9 +263,6 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
accettazioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
}
|
||||
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
|
||||
accettazioneListModel.setOriginalModel(x);
|
||||
|
||||
list.add(accettazioneListModel);
|
||||
|
||||
@@ -436,8 +436,8 @@ public class AccettazionePickingViewModel {
|
||||
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
||||
});
|
||||
|
||||
BigDecimal numCnfDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getNumCnfOrd().subtract(numCnfWithdrawRows.getBigDecimalValue());
|
||||
BigDecimal qtaDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getQtaOrd().subtract(qtaColWithdrawRows.getBigDecimalValue());
|
||||
BigDecimal numCnfDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getNumCnfDaEvadere().subtract(numCnfWithdrawRows.getBigDecimalValue());
|
||||
BigDecimal qtaDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getQtaDaEvadere().subtract(qtaColWithdrawRows.getBigDecimalValue());
|
||||
BigDecimal qtaCnfDaEvadere = qtaCnfOrd;
|
||||
|
||||
numCnfDaEvadere = UtilityBigDecimal.getGreaterBetween(numCnfDaEvadere, BigDecimal.ZERO);
|
||||
|
||||
@@ -3,21 +3,22 @@ package it.integry.integrywmsnative.gest.contenuto_bancale.viewmodel;
|
||||
import android.app.Dialog;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import android.text.SpannableString;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
@@ -42,7 +43,7 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
private PrinterRESTConsumer.Type mPrinterType;
|
||||
private String mReportName;
|
||||
|
||||
public ContenutoBancaleViewModel(ContenutoBancaleActivity context, MtbColt mtbColt, boolean canRecoverUL, PrinterRESTConsumer.Type printerType, String defaultReportName){
|
||||
public ContenutoBancaleViewModel(ContenutoBancaleActivity context, MtbColt mtbColt, boolean canRecoverUL, PrinterRESTConsumer.Type printerType, String defaultReportName) {
|
||||
mContext = context;
|
||||
this.mtbColt = new ObservableField<>(mtbColt);
|
||||
this.isFabVisible.set(true);
|
||||
@@ -85,8 +86,7 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void recoverUL(){
|
||||
public void recoverUL() {
|
||||
Intent data = new Intent();
|
||||
String key = DataCache.addItem(mtbColt.get());
|
||||
data.putExtra("key", key);
|
||||
@@ -102,39 +102,37 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
|
||||
PrinterRESTConsumer.getAvailablePrintersStatic(SettingsManager.i().getUserSession().getDepo().getCodMdep(), mPrinterType, value -> {
|
||||
|
||||
if(value.size() > 0) {
|
||||
if (value.size() > 0) {
|
||||
|
||||
try {
|
||||
ReportManager.getReportNameLUFromGestione(mtbColt.get().getGestioneEnum(), reportName -> {
|
||||
try {
|
||||
String reportName = ReportManager.getReportNameLUFromGestione(mtbColt.get().getGestioneEnum());
|
||||
|
||||
reportName = mReportName != null ? mReportName : reportName;
|
||||
reportName = mReportName != null ? mReportName : reportName;
|
||||
|
||||
PrinterRESTConsumer.printColloStatic(value.get(0),
|
||||
mtbColt.get(),
|
||||
1,
|
||||
reportName,
|
||||
() -> {
|
||||
progress.dismiss();
|
||||
PrinterRESTConsumer.printColloStatic(value.get(0),
|
||||
mtbColt.get(),
|
||||
1,
|
||||
reportName,
|
||||
() -> {
|
||||
progress.dismiss();
|
||||
|
||||
Resources res = mContext.getResources();
|
||||
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||
DialogSimpleMessageHelper.makeSuccessDialog(mContext, res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null).show();
|
||||
}, ex -> UtilityExceptions.defaultException(mContext,ex, progress));
|
||||
Resources res = mContext.getResources();
|
||||
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||
DialogSimpleMessageHelper.makeSuccessDialog(mContext, res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null).show();
|
||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
||||
|
||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress)
|
||||
);
|
||||
} catch (Exception ex){
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
}
|
||||
|
||||
} else {
|
||||
progress.dismiss();
|
||||
String errorMessage = "Nessuna stampante configurata";
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mContext, new SpannableString(errorMessage), null, null).show();
|
||||
} catch (Exception ex) {
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
}
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
});
|
||||
|
||||
} else {
|
||||
progress.dismiss();
|
||||
String errorMessage = "Nessuna stampante configurata";
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mContext, new SpannableString(errorMessage), null, null).show();
|
||||
}
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -216,15 +216,14 @@ public class PickingResiViewModel {
|
||||
}
|
||||
|
||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum(), reportName -> {
|
||||
String reportName = ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum());
|
||||
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
printerName,
|
||||
mtbColtToPrint,
|
||||
1,
|
||||
reportName, onComplete, onFailed);
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
printerName,
|
||||
mtbColtToPrint,
|
||||
1,
|
||||
reportName, onComplete, onFailed);
|
||||
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
private void postCloseOperations(MtbColt mtbColt, Runnable onComplete) {
|
||||
@@ -282,7 +281,6 @@ public class PickingResiViewModel {
|
||||
BigDecimal qtaCnfDoc = withdrawableDtbDocr.getQtaCnf();
|
||||
|
||||
|
||||
|
||||
this.sendOnItemDispatched(
|
||||
withdrawableDtbDocr.getMtbAart(),
|
||||
totalNumCnfDoc,
|
||||
@@ -376,13 +374,13 @@ public class PickingResiViewModel {
|
||||
this.mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
||||
|
||||
mtbColr
|
||||
.setDataCollo(value.getDataColloS())
|
||||
.setNumCollo(value.getNumCollo())
|
||||
.setGestione(value.getGestione())
|
||||
.setSerCollo(value.getSerCollo())
|
||||
.setRiga(value.getMtbColr().get(0).getRiga())
|
||||
.setUntMis(withdrawableDtbDocr.getMtbAart().getUntMis())
|
||||
.setMtbAart(withdrawableDtbDocr.getMtbAart());
|
||||
.setDataCollo(value.getDataColloS())
|
||||
.setNumCollo(value.getNumCollo())
|
||||
.setGestione(value.getGestione())
|
||||
.setSerCollo(value.getSerCollo())
|
||||
.setRiga(value.getMtbColr().get(0).getRiga())
|
||||
.setUntMis(withdrawableDtbDocr.getMtbAart().getUntMis())
|
||||
.setMtbAart(withdrawableDtbDocr.getMtbAart());
|
||||
|
||||
withdrawableDtbDocr.getWithdrawRows().add(mtbColr);
|
||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||
|
||||
@@ -37,148 +37,18 @@ public class PickingResiRESTConsumer {
|
||||
for(int i = 0; i < documents.size(); i++) {
|
||||
HashMap<String, Object> filter = new HashMap<>();
|
||||
|
||||
filter.put("dtb_docr.data_doc", documents.get(i).getDataDocD());
|
||||
filter.put("dtb_docr.num_doc", documents.get(i).getNumDoc());
|
||||
filter.put("dtb_docr.ser_doc", documents.get(i).getSerDoc());
|
||||
filter.put("dtb_docr.cod_anag", documents.get(i).getCodAnag());
|
||||
filter.put("dtb_docr.cod_dtip", documents.get(i).getCodDtip());
|
||||
filter.put("data_doc", documents.get(i).getDataDocD());
|
||||
filter.put("num_doc", documents.get(i).getNumDoc());
|
||||
filter.put("ser_doc", documents.get(i).getSerDoc());
|
||||
filter.put("cod_anag", documents.get(i).getCodAnag());
|
||||
filter.put("cod_dtip", documents.get(i).getCodDtip());
|
||||
|
||||
filterCond.add(filter);
|
||||
}
|
||||
|
||||
String sql = "SELECT dtb_docr.[cod_anag]" +
|
||||
" ,dtb_docr.[cod_dtip]" +
|
||||
" ,dtb_docr.[data_doc]" +
|
||||
" ,dtb_docr.[ser_doc]" +
|
||||
" ,dtb_docr.[num_doc]" +
|
||||
" ,dtb_docr.[id_riga]" +
|
||||
" ,dtb_docr.[cod_mart]" +
|
||||
" ,dtb_docr.[descrizione]" +
|
||||
" ,dtb_docr.[unt_doc]" +
|
||||
" ,(dtb_docr.[rap_conv] / dtb_docr.[rap_conv]) as rap_conv" +
|
||||
" ,(dtb_docr.[qta_doc] * dtb_docr.[rap_conv]) - ISNULL(mtb_colr.qta_col, 0) as qta_doc" +
|
||||
" ,dtb_docr.[val_unt]" +
|
||||
" ,dtb_docr.[sconto5]" +
|
||||
" ,dtb_docr.[sconto6]" +
|
||||
" ,dtb_docr.[sconto7]" +
|
||||
" ,dtb_docr.[sconto8]" +
|
||||
" ,dtb_docr.[cod_aliq]" +
|
||||
" ,dtb_docr.[perc_prov]" +
|
||||
" ,dtb_docr.[val_prov]" +
|
||||
" ,dtb_docr.[data_ord]" +
|
||||
" ,dtb_docr.[num_ord]" +
|
||||
" ,dtb_docr.[riga_ord]" +
|
||||
" ,dtb_docr.[importo_riga]" +
|
||||
" ,dtb_docr.[cod_col]" +
|
||||
" ,dtb_docr.[cod_tagl]" +
|
||||
" ,dtb_docr.[cod_jcom]" +
|
||||
" ,dtb_docr.[cod_mdep]" +
|
||||
" ,dtb_docr.[perc_gest]" +
|
||||
" ,dtb_docr.[val_gest]" +
|
||||
" ,dtb_docr.[partita_mag]" +
|
||||
" ,dtb_docr.[val_unt_iva]" +
|
||||
" ,dtb_docr.[qta_cnf]" +
|
||||
" ,dtb_docr.[descrizione_estesa]" +
|
||||
" ,dtb_docr.[costo_unt]" +
|
||||
" ,dtb_docr.[perc_ispe]" +
|
||||
" ,dtb_docr.[val_ispe]" +
|
||||
" ,dtb_docr.[perc_promo]" +
|
||||
" ,dtb_docr.[val_promo]" +
|
||||
" ,dtb_docr.[perc_oneri]" +
|
||||
" ,dtb_docr.[val_oneri]" +
|
||||
" ,dtb_docr.[flag_evaso_forzato]" +
|
||||
" ,dtb_docr.[cod_dtip_comp]" +
|
||||
" ,dtb_docr.[data_doc_comp]" +
|
||||
" ,dtb_docr.[ser_doc_comp]" +
|
||||
" ,dtb_docr.[num_doc_comp]" +
|
||||
" ,dtb_docr.[cod_promo]" +
|
||||
" ,dtb_docr.[perc_prov2]" +
|
||||
" ,dtb_docr.[val_prov2]" +
|
||||
" ,dtb_docr.[cod_art_for]" +
|
||||
" ,dtb_docr.[unt_doc2]" +
|
||||
" ,dtb_docr.[qta_doc2]" +
|
||||
" ,dtb_docr.[unt_doc3]" +
|
||||
" ,dtb_docr.[qta_doc3]" +
|
||||
" ,dtb_docr.[num_cnf]" +
|
||||
" ,dtb_docr.[peso_lordo]" +
|
||||
" ,dtb_docr.[posizione]" +
|
||||
" ,dtb_docr.[cod_anag_comp]" +
|
||||
" ,dtb_docr.[cod_mtip]" +
|
||||
" ,dtb_docr.[matricola]" +
|
||||
" ,dtb_docr.[data_iniz_comp]" +
|
||||
" ,dtb_docr.[data_fine_comp]" +
|
||||
" ,dtb_docr.[cod_kit]" +
|
||||
" ,dtb_docr.[cod_alis]" +
|
||||
" ,dtb_docr.[data_ins_row]" +
|
||||
" ,dtb_docr.[note] " +
|
||||
" ,dtb_doct.[gestione] " +
|
||||
" ,mtb_partita_mag.[data_scad] as data_scad_partita_mag " +
|
||||
"FROM dtb_docr " +
|
||||
"INNER JOIN dtb_doct ON dtb_docr.num_doc = dtb_doct.num_doc AND dtb_docr.data_doc = dtb_doct.data_doc AND dtb_docr.cod_anag = dtb_doct.cod_anag AND dtb_docr.cod_dtip = dtb_doct.cod_dtip AND dtb_docr.ser_doc = dtb_doct.ser_doc " +
|
||||
"INNER JOIN mtb_aart ON dtb_docr.cod_mart = mtb_aart.cod_mart " +
|
||||
"LEFT OUTER JOIN mtb_partita_mag ON dtb_docr.cod_mart = mtb_partita_mag.cod_mart " +
|
||||
" AND dtb_docr.partita_mag = mtb_partita_mag.partita_mag " +
|
||||
"LEFT OUTER JOIN ctb_cont ON mtb_aart.cod_ccon_ricavi = ctb_cont.cod_ccon " +
|
||||
"LEFT OUTER JOIN ctb_grup ON ctb_cont.cod_cgrp = ctb_grup.cod_cgrp " +
|
||||
"LEFT OUTER JOIN (" +
|
||||
" SELECT gestione," +
|
||||
" cod_mart," +
|
||||
" cod_col," +
|
||||
" cod_tagl," +
|
||||
" SUM(qta_col) as qta_col," +
|
||||
" data_ord," +
|
||||
" num_ord," +
|
||||
" riga_ord," +
|
||||
" partita_mag," +
|
||||
" qta_cnf," +
|
||||
" gestione_rif," +
|
||||
" data_collo_rif," +
|
||||
" ser_collo_rif," +
|
||||
" num_collo_rif," +
|
||||
" cod_jcom," +
|
||||
" SUM(num_cnf) as num_cnf," +
|
||||
" cod_anag_doc," +
|
||||
" cod_dtip_doc," +
|
||||
" data_doc," +
|
||||
" ser_doc," +
|
||||
" num_doc," +
|
||||
" id_riga_doc" +
|
||||
" FROM mtb_colr" +
|
||||
" GROUP BY gestione," +
|
||||
" cod_barre," +
|
||||
" cod_mart," +
|
||||
" cod_col," +
|
||||
" cod_tagl," +
|
||||
" data_ord," +
|
||||
" num_ord," +
|
||||
" riga_ord," +
|
||||
" partita_mag," +
|
||||
" qta_cnf," +
|
||||
" gestione_rif," +
|
||||
" data_collo_rif," +
|
||||
" ser_collo_rif," +
|
||||
" num_collo_rif," +
|
||||
" cod_jcom," +
|
||||
" cod_anag_doc," +
|
||||
" cod_dtip_doc," +
|
||||
" data_doc," +
|
||||
" ser_doc," +
|
||||
" num_doc," +
|
||||
" id_riga_doc" +
|
||||
" ) mtb_colr" +
|
||||
" ON " +
|
||||
" dtb_docr.cod_anag = mtb_colr.cod_anag_doc AND " +
|
||||
" dtb_docr.cod_dtip = mtb_colr.cod_dtip_doc AND " +
|
||||
" dtb_docr.ser_doc = mtb_colr.ser_doc AND " +
|
||||
" dtb_docr.data_doc = mtb_colr.data_doc AND " +
|
||||
" dtb_docr.num_doc = mtb_colr.num_doc AND " +
|
||||
" dtb_docr.id_riga = mtb_colr.id_riga_doc " +
|
||||
String sql = "SELECT * FROM dvw_situazione_qta_docs " +
|
||||
"WHERE " +
|
||||
" (ctb_grup.sezione <> 1 OR ctb_grup.sezione IS NULL) AND " +
|
||||
" dtb_docr.[qta_doc] - ISNULL(mtb_colr.qta_col, 0) > 0 AND" +
|
||||
" ( " +
|
||||
UtilityQuery.concatFieldListInWhereCond(filterCond) +
|
||||
" ) " +
|
||||
"ORDER BY cod_mart";
|
||||
|
||||
|
||||
|
||||
@@ -79,7 +79,6 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initBarcode() {
|
||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessfull(onScanSuccessful)
|
||||
@@ -97,13 +96,12 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
BarcodeManager.disable();
|
||||
|
||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
if(UtilityBarcode.isEtichettaAnonima(data) || UtilityBarcode.isEtichetta128(data)){
|
||||
if (UtilityBarcode.isEtichettaAnonima(data) || UtilityBarcode.isEtichetta128(data)) {
|
||||
this.executeEtichettaUL(data, progressDialog);
|
||||
}
|
||||
|
||||
@@ -112,10 +110,10 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
private void executeEtichettaUL(BarcodeScanDTO barcodeScanDTO, Dialog progressDialog) {
|
||||
ColliMagazzinoRESTConsumer.getBySSCCStatic(barcodeScanDTO.getStringValue(), true, false, mtbColt -> {
|
||||
|
||||
if(mtbColt != null) {
|
||||
if (mtbColt != null) {
|
||||
|
||||
HistoryVersamentoProdULDTO historyVersamentoProdULRestDTO = this.getHistoryElementFromMtbColt(mtbColt);
|
||||
if(historyVersamentoProdULRestDTO != null) {
|
||||
if (historyVersamentoProdULRestDTO != null) {
|
||||
this.dispatchItem(historyVersamentoProdULRestDTO, mtbColt, progressDialog);
|
||||
} else {
|
||||
DialogCommon.showNoULFound(mContext, () -> {
|
||||
@@ -144,9 +142,9 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
x.getDataColloRif().equals(mtbColt.getDataColloS()) &&
|
||||
x.getSerColloRif().equalsIgnoreCase(mtbColt.getSerCollo()) &&
|
||||
x.getGestioneRif().equalsIgnoreCase(mtbColt.getGestione()))
|
||||
.toList();
|
||||
.toList();
|
||||
|
||||
if(filteredItems != null && filteredItems.size() > 0) {
|
||||
if (filteredItems != null && filteredItems.size() > 0) {
|
||||
return filteredItems.get(0);
|
||||
}
|
||||
|
||||
@@ -175,17 +173,14 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
DialogInputQuantity.makeBase(mContext, dto, false, quantity -> {
|
||||
onItemDispatched(item, quantity.qtaTot.getBigDecimal(), sourceMtbColt, dialogProgress);
|
||||
}, () -> {
|
||||
if(dialogProgress != null) dialogProgress.dismiss();
|
||||
if (dialogProgress != null) dialogProgress.dismiss();
|
||||
}).show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void onItemDispatched(HistoryVersamentoProdULDTO item, BigDecimal quantity, MtbColt sourceMtbColt, Dialog progress) {
|
||||
|
||||
if(progress == null) {
|
||||
if (progress == null) {
|
||||
progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
}
|
||||
Dialog finalProgress = progress;
|
||||
@@ -197,7 +192,7 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
.setGestione(item.getGestione())
|
||||
.setMtbColr(new ObservableArrayList<>());
|
||||
|
||||
for(HistoryVersamentoProdULDTO.OrdineDto ordine : item.getOrdini()) {
|
||||
for (HistoryVersamentoProdULDTO.OrdineDto ordine : item.getOrdini()) {
|
||||
BigDecimal qtaCol = quantity.multiply(new BigDecimal(-1).multiply(new BigDecimal(ordine.getPercentageHr()))).divide(new BigDecimal(100), 3, RoundingMode.HALF_EVEN);
|
||||
|
||||
final MtbColr mtbColrScarico = new MtbColr()
|
||||
@@ -220,18 +215,17 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
mtbColtScarico.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
|
||||
RunnableArgss<MtbColt, Boolean> saveRunnable = (mtbColt, createdLU) -> {
|
||||
|
||||
if(mtbColt != null) {
|
||||
if (mtbColt != null) {
|
||||
|
||||
List<MtbColt> colliToSave = new ArrayList<>();
|
||||
boolean shouldPrint = false;
|
||||
|
||||
if(!Objects.equals(mtbColt.getNumCollo(), item.getNumColloRif()) ||
|
||||
if (!Objects.equals(mtbColt.getNumCollo(), item.getNumColloRif()) ||
|
||||
!Objects.equals(mtbColt.getSerCollo(), item.getSerColloRif()) ||
|
||||
!Objects.equals(mtbColt.getDataColloS(), item.getDataColloRif()) ||
|
||||
!Objects.equals(mtbColt.getGestione(), item.getGestioneRif())) {
|
||||
@@ -267,7 +261,7 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
|
||||
FBToast.successToast(mContext, mContext.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||
|
||||
if(finalShouldPrint) {
|
||||
if (finalShouldPrint) {
|
||||
printCollo(finalProgress, value.get(0), () -> {
|
||||
this.refreshAdapter();
|
||||
mOnRecuperoCompleted.run();
|
||||
@@ -287,7 +281,7 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
};
|
||||
|
||||
if(sourceMtbColt != null) saveRunnable.run(sourceMtbColt, false);
|
||||
if (sourceMtbColt != null) saveRunnable.run(sourceMtbColt, false);
|
||||
else DialogScanOrCreateLU.make(mContext, true, false, saveRunnable).show();
|
||||
|
||||
}
|
||||
@@ -329,21 +323,18 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||
ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum(), reportName -> {
|
||||
String reportName = ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum());
|
||||
|
||||
PrinterRESTConsumer.printColloStatic(
|
||||
printerName,
|
||||
mtbColtToPrint,
|
||||
1,
|
||||
reportName, onComplete, onAbort);
|
||||
PrinterRESTConsumer.printColloStatic(
|
||||
printerName,
|
||||
mtbColtToPrint,
|
||||
1,
|
||||
reportName, onComplete, onAbort);
|
||||
|
||||
}, onAbort);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void refreshAdapter() {
|
||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
@@ -360,5 +351,4 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -648,7 +648,23 @@ public class SpedizioneViewModel {
|
||||
if (matchedRows == null || matchedRows.size() == 0) {
|
||||
this.sendError(new NoArtsFoundException());
|
||||
} else if (matchedRows.size() == 1) {
|
||||
this.dispatchOrdineRow(matchedRows.get(0), matchedRows.get(0).getRefMtbColt());
|
||||
PickingObjectDTO matchedItem = matchedRows.get(0);
|
||||
|
||||
|
||||
if (matchedItem.getMtbColts() != null && matchedItem.getMtbColts().size() > 1) {
|
||||
|
||||
List<PickingObjectDTO> pickingList = mPickingList.getValue();
|
||||
|
||||
Stream.of(pickingList)
|
||||
.filter(x -> x != matchedItem)
|
||||
.forEach(x -> x.setHidden(true));
|
||||
|
||||
this.sendFilterApplied(null);
|
||||
this.getPickingList().postValue(pickingList);
|
||||
} else {
|
||||
this.dispatchOrdineRow(matchedItem, matchedItem.getRefMtbColt());
|
||||
}
|
||||
|
||||
} else {
|
||||
List<PickingObjectDTO> pickingList = mPickingList.getValue();
|
||||
|
||||
@@ -714,7 +730,7 @@ public class SpedizioneViewModel {
|
||||
|
||||
MtbColr refMtbColr = null;
|
||||
|
||||
if(refMtbColt != null && refMtbColt.getMtbColr().size() > 0) {
|
||||
if (scannedMtbColr != null && refMtbColt != null && refMtbColt.getMtbColr().size() > 0) {
|
||||
Optional<MtbColr> optionalMtbColr = Stream.of(refMtbColt.getMtbColr())
|
||||
.filter(y -> UtilityString.equalsIgnoreCase(y.getCodMart(), scannedMtbColr.getCodMart()) &&
|
||||
UtilityString.equalsIgnoreCase(y.getCodTagl(), scannedMtbColr.getCodTagl()) &&
|
||||
@@ -722,7 +738,7 @@ public class SpedizioneViewModel {
|
||||
(!mEnableCheckPartitaMag || UtilityString.equalsIgnoreCase(y.getPartitaMag(), scannedMtbColr.getPartitaMag()) || UtilityString.isNullOrEmpty(scannedMtbColr.getPartitaMag())))
|
||||
.findFirst();
|
||||
|
||||
if(optionalMtbColr.isPresent()) refMtbColr = optionalMtbColr.get();
|
||||
if (optionalMtbColr.isPresent()) refMtbColr = optionalMtbColr.get();
|
||||
}
|
||||
|
||||
MtbColr mtbColrToUse = refMtbColr != null ? refMtbColr : scannedMtbColr;
|
||||
@@ -1201,15 +1217,17 @@ public class SpedizioneViewModel {
|
||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||
|
||||
|
||||
mtbColr.setRefMtbColr(new MtbColr()
|
||||
.setCodMart(mtbColr.getCodMart())
|
||||
.setPartitaMag(mtbColr.getPartitaMag())
|
||||
.setCodTagl(mtbColr.getCodTagl())
|
||||
.setCodCol(mtbColr.getCodCol())
|
||||
.setNumCollo(refMtbColt.getNumCollo())
|
||||
.setDataCollo(refMtbColt.getDataColloS())
|
||||
.setSerCollo(refMtbColt.getSerCollo())
|
||||
.setGestione(refMtbColt.getGestione()));
|
||||
if(mEnableGiacenza) {
|
||||
mtbColr.setRefMtbColr(new MtbColr()
|
||||
.setCodMart(mtbColr.getCodMart())
|
||||
.setPartitaMag(mtbColr.getPartitaMag())
|
||||
.setCodTagl(mtbColr.getCodTagl())
|
||||
.setCodCol(mtbColr.getCodCol())
|
||||
.setNumCollo(refMtbColt.getNumCollo())
|
||||
.setDataCollo(refMtbColt.getDataColloS())
|
||||
.setSerCollo(refMtbColt.getSerCollo())
|
||||
.setGestione(refMtbColt.getGestione()));
|
||||
}
|
||||
|
||||
pickingObjectDTO.getWithdrawMtbColrs().add(mtbColr);
|
||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||
@@ -1412,15 +1430,14 @@ public class SpedizioneViewModel {
|
||||
}
|
||||
|
||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum(), reportName -> {
|
||||
String reportName = ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum());
|
||||
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
printerName,
|
||||
mtbColtToPrint,
|
||||
1,
|
||||
reportName, onComplete, onFailed);
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
printerName,
|
||||
mtbColtToPrint,
|
||||
1,
|
||||
reportName, onComplete, onFailed);
|
||||
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
|
||||
@@ -1428,6 +1445,8 @@ public class SpedizioneViewModel {
|
||||
this.mCurrentMtbColt = mtbColt;
|
||||
mMtbColtSessionID = this.mColliDataRecoverService.startNewSession(mtbColt, mTestateOrdini);
|
||||
|
||||
this.mCurrentMtbColt.generaFiltroOrdineFromDTO(mDefaultFiltroOrdine);
|
||||
|
||||
this.resetMatchedRows();
|
||||
this.sendLUOpened(this.mCurrentMtbColt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user