new logic in CardWaitingFragment
This commit is contained in:
parent
c729bce5a2
commit
1ff9aba77a
2
.gitignore
vendored
2
.gitignore
vendored
@ -21,3 +21,5 @@ local.properties
|
||||
/.idea
|
||||
/app/prod/release
|
||||
nexdlkey-lib/build/
|
||||
/nexsdk-lib
|
||||
/nexsdk-lib
|
||||
|
||||
@ -129,12 +129,49 @@ public class CardWaitingFragment extends DataBindingFragment implements DataBind
|
||||
}
|
||||
}
|
||||
|
||||
private void updateManualEntryVisibility() {
|
||||
TransactionsType type = sharedViewModel.transactionsType.getValue();
|
||||
boolean manualEntryStatus = SystemParamsOperation.getInstance().getManualEntryStatus();
|
||||
boolean preAuthManualEntryStatus = SystemParamsOperation.getInstance().getPreAuthManualEnabled();
|
||||
boolean preAuthCompManualEntryStatus = SystemParamsOperation.getInstance().getPreAuthCompleteManualEnabled();
|
||||
boolean preAuthCancelManualEntryStatus = SystemParamsOperation.getInstance().getPreAuthVoidManualEnabled();
|
||||
boolean show;
|
||||
if (type == null) {
|
||||
show = manualEntryStatus;
|
||||
} else {
|
||||
switch (type) {
|
||||
case SALE:
|
||||
case CASH_OUT:
|
||||
case CASH_DEPOSIT:
|
||||
case REFUND:
|
||||
case VOID:
|
||||
show = manualEntryStatus;
|
||||
break;
|
||||
case PRE_AUTH_SALE:
|
||||
show = preAuthManualEntryStatus;
|
||||
break;
|
||||
case PRE_AUTH_VOID:
|
||||
show = preAuthCancelManualEntryStatus;
|
||||
break;
|
||||
case PRE_AUTH_COMPLETE:
|
||||
show = preAuthCompManualEntryStatus;
|
||||
break;
|
||||
default:
|
||||
show = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sharedViewModel.setManualEntryStatus(show);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
resetUI();
|
||||
|
||||
updateManualEntryVisibility();
|
||||
|
||||
setToolBarTitleWithBackIcon(getResourceString(R.string.txt_title_card_capture));
|
||||
|
||||
delayFunctionCall(()-> {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user