hide/show auto-reversal

This commit is contained in:
moon 2026-04-09 16:13:19 +06:30
parent 9b9d827d47
commit c9032de30d
5 changed files with 29 additions and 2 deletions

View File

@ -163,6 +163,10 @@ public class SettingsFragment extends DataBindingFragment {
}
private void updateReversalSettings() {
boolean isVisible = SystemParamsOperation.getInstance().getAutoReversalEnable();
LogUtil.d("SettingsFragment", "isVisible " + isVisible);
binding.reversalCard.setVisibility(isVisible ? View.VISIBLE : View.GONE);
boolean isEnabled = SystemParamsOperation.getInstance().isReversalOn();
binding.reversalSwitch.setChecked(isEnabled);
binding.reversalSummary.setText(isEnabled ?

View File

@ -654,6 +654,8 @@ public class TMSSetupsImpl implements TMSSetups{
}
else if(TextUtils.equals(name, "pre_auth_manual_enabled")) {
SystemParamsOperation.getInstance().setPreAuthManualEnabled(parseBoolean(data));
}else if(TextUtils.equals(name, "auto_reversal_enable")) {
SystemParamsOperation.getInstance().setAutoReversalEnable(parseBoolean(data));
}
}

View File

@ -729,7 +729,9 @@
android:onClick="@{()->click.onReversalClick()}"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
app:cardElevation="2dp"
>
<LinearLayout
android:layout_width="match_parent"

View File

@ -1916,4 +1916,14 @@ public class SystemParamsOperation {
}
public void setAutoReversalEnable(boolean autoReversalEnable) {
SystemParamsSettings params = getSystemParamsSettings();
params.setAutoReversalEnable(autoReversalEnable);
saveSystemParamsSettings(params);
}
public boolean getAutoReversalEnable(){
SystemParamsSettings params = getSystemParamsSettings();
return params.getAutoReversalEnable();
}
}

View File

@ -276,6 +276,7 @@ public class SystemParamsSettings implements Serializable {
private String certificateClientUrl = "";
private boolean printerEnabled = true;
private boolean duelCurrencyStatus = false;
private boolean autoReversalEnable = false;
public boolean isQrPartialRefundEnable(){
return qrPartialRefundEnable;
@ -1179,6 +1180,14 @@ public class SystemParamsSettings implements Serializable {
return duelCurrencyStatus;
}
public void setAutoReversalEnable(boolean autoReversalEnable) {
this.autoReversalEnable = autoReversalEnable;
}
public boolean getAutoReversalEnable(){
return autoReversalEnable;
}
/* // 流水号起始
private String serialNum = Configs.getInstance().SERIAL_NUM();
// 批次号起始