fail receipt disable

This commit is contained in:
MooN 2026-02-18 22:08:24 +06:30
parent 74bed47d68
commit 328f114ca0
4 changed files with 86 additions and 4 deletions

View File

@ -28,7 +28,7 @@ import com.utsmm.kbz.ui.core_viewmodel.SharedViewModel;
public class PrintReceiptFragment extends DataBindingFragment implements DataBindingFragment.BackPressCallback {
private SharedViewModel sharedViewModel;
private static final String TAG = PrintReceiptFragment.class.getSimpleName();
private boolean printerEnabled = SystemParamsOperation.getInstance().getPrinterEnabled();
private boolean printerEnabled = true;
@Override
protected int currentId() {
@ -60,6 +60,7 @@ public class PrintReceiptFragment extends DataBindingFragment implements DataBin
@Override
public void onResume() {
super.onResume();
printerEnabled = SystemParamsOperation.getInstance().getPrinterEnabled();
/*
* check TMS parameter here
@ -121,6 +122,7 @@ public class PrintReceiptFragment extends DataBindingFragment implements DataBin
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
printerEnabled = SystemParamsOperation.getInstance().getPrinterEnabled();
if (!printerEnabled) {
sharedViewModel.setPrintStatus(PrintStatus.NOT_PRINT);
@ -180,6 +182,9 @@ public class PrintReceiptFragment extends DataBindingFragment implements DataBin
private void startPrintProcess(boolean isFirstPrint) {
if (!SystemParamsOperation.getInstance().getPrinterEnabled()) {
return;
}
PrintHelper.getInstance().checkPaperRollStatus(new PaperRollStatusCallback() {

View File

@ -21,7 +21,7 @@ public class TimeoutFragment extends DataBindingFragment {
private SharedViewModel sharedViewModel;
private int resultTimeOut = 3;
private int resultTimeOut = 5;
private CountDownTimer countDownTimer;
private int routeId;

View File

@ -56,7 +56,7 @@ public class TransactionResultFragment extends DataBindingFragment implements Da
private static final String TAG = TransactionResultFragment.class.getSimpleName();
private TransProcessViewModel transProcessViewModel;
private SharedViewModel sharedViewModel;
private static final int resultTimeOut = 1;
private static final int resultTimeOut = 3;
private int routeId;
private final RxUtil<SiriusResponse> siriusRxUtil = new RxUtil<>();
@ -165,7 +165,9 @@ public class TransactionResultFragment extends DataBindingFragment implements Da
TransactionsType transactionType = sharedViewModel.transactionsType.getValue();
if (isNonApprovedTrade(payDetail) && isNonQRPayTransaction(transactionType)) {
if (SystemParamsOperation.getInstance().getPrinterEnabled()) {
startPrintProcess(false);
}
isCardInside();
} else if (transactionType == TransactionsType.SETTLEMENT || transactionType == TransactionsType.MMQR_SETTLEMENT) {
handleSettlementTransaction(siriusReq);

View File

@ -894,6 +894,81 @@
android:textStyle="bold"
tools:fontFamily="sans-serif-medium" />
<!-- Clear Batch Card -->
<androidx.cardview.widget.CardView
android:id="@+id/clearBatchCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground"
android:onClick="@{()->click.onClearBatchClick()}"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="16dp"
app:cardElevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="20dp">
<androidx.cardview.widget.CardView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginEnd="16dp"
app:cardBackgroundColor="@color/colorPrimary"
app:cardCornerRadius="24dp"
app:cardElevation="0dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:src="@drawable/ic_clear_batch"
app:tint="@color/white" />
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/rubik_medium"
android:text="@string/title_clear_batch"
android:textColor="@color/colorTextTitle"
android:textSize="18sp"
android:textStyle="bold"
tools:fontFamily="sans-serif-medium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:fontFamily="@font/rubik_regular"
android:text="@string/clear_batch_description"
android:textColor="@color/colorTextContent"
android:textSize="14sp"
tools:fontFamily="sans-serif" />
</LinearLayout>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/ic_right_arrow"
app:tint="@color/colorPrimary" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<!-- TMS Server URL Card -->
<!-- android:onClick="@{()->click.onTmsAddressClick()}"-->
<androidx.cardview.widget.CardView