Durante il fast picking aggiunto blocco se la quantità "da prelevare" risulti inferiore al "totale disponibile"

This commit is contained in:
2025-11-20 09:29:38 +01:00
parent d99fd542c2
commit e46cbca2a9
4 changed files with 32 additions and 9 deletions

View File

@@ -564,14 +564,24 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
}
@Override
public void onWarning(String text, RunnableArgs<Boolean> result) {
public void onWarning(String text, Boolean showNegativeClick, RunnableArgs<Boolean> result) {
handler.post(() -> {
DialogSimpleMessageView.makeWarningDialog(context, new SpannableString(Html.fromHtml(text)),
null,
() -> result.run(true),
() -> result.run(false)
).show();
if (showNegativeClick) {
DialogSimpleMessageView.makeWarningDialog(
context,
new SpannableString(Html.fromHtml(text)),
null,
() -> result.run(true),
() -> result.run(false)
).show();
} else {
DialogSimpleMessageView.makeWarningDialog(
context,
new SpannableString(Html.fromHtml(text)),
null,
() -> result.run(true)
).show();
}
});
}

View File

@@ -215,6 +215,12 @@ public class DialogInputQuantityV2ViewModel {
} else if (ean128Model.Sscc != null) {
//Close current UDS and open another one with new SSCC
if (enableSSCCRead) {
if (UtilityBigDecimal.lowerThan(totalNumCnfToBeTaken, totalNumCnfAvailable)){
this.sendWarning(UtilityResources.getString(R.string.qta_to_be_taken_lower_then_qta_available), false);
return;
}
this.internalNextUlBarcode = barcodeScanDTO;
this.sendOnULCloseRequested();
}
@@ -674,7 +680,7 @@ public class DialogInputQuantityV2ViewModel {
final FutureTask<Object> ft = new FutureTask<>(() -> {
}, new Object());
AtomicBoolean returnResult = new AtomicBoolean();
mListener.onWarning(text, result -> {
mListener.onWarning(text, true, result -> {
returnResult.set(result);
ft.run();
});
@@ -745,12 +751,17 @@ public class DialogInputQuantityV2ViewModel {
if (this.mListener != null) mListener.onULCloseRequested();
}
private void sendWarning(String text, Boolean showNegativeClick) {
if (this.mListener != null) mListener.onWarning(text, showNegativeClick, result -> {
});
}
public interface Listener extends ILoadingListener {
void onDataChanged();
void onError(Exception ex);
void onWarning(String text, RunnableArgs<Boolean> result);
void onWarning(String text, Boolean showNegativeClick, RunnableArgs<Boolean> result);
void onULCloseRequested();
}

View File

@@ -225,6 +225,7 @@
<string name="check_box_preference_title">Check box</string>
<string name="check_box_preference_summary">This is a regular preference</string>
<string name="confirm_anomalie"><![CDATA[Sono state riscontrate <b>%d</b> anomalie. Continuare?]]></string>
<string name="qta_to_be_taken_lower_then_qta_available"><![CDATA[La <b>quantità</b> da prelevare risulta inferiore alla <b>quantità</b> totale disponibile. <br> Chiudere manualmente la UL.]]></string>
<string name="alert_delete_UL">Stai per eliminare una UL. Confermi?</string>
<string name="alert_delete_mtb_colr">Stai per eliminare una riga. Confermi?</string>

View File

@@ -224,6 +224,7 @@
<string name="check_box_preference_title">Check box</string>
<string name="check_box_preference_summary">This is a regular preference</string>
<string name="confirm_anomalie"><![CDATA[<b>%d</b> anomalies were found. To continue?]]></string>
<string name="qta_to_be_taken_lower_then_qta_available"><![CDATA[The <b>quantity</b> to be withdrawn is less than the total <b>quantity</b> available. Close the UL manually.]]></string>
<string name="alert_delete_UL">Are you sure you want to delete this UL? Please confirm</string>
<string name="alert_delete_mtb_colr">Are you sure to delete? Please confirm</string>