fail receipt disable
This commit is contained in:
parent
74bed47d68
commit
328f114ca0
@ -28,7 +28,7 @@ import com.utsmm.kbz.ui.core_viewmodel.SharedViewModel;
|
|||||||
public class PrintReceiptFragment extends DataBindingFragment implements DataBindingFragment.BackPressCallback {
|
public class PrintReceiptFragment extends DataBindingFragment implements DataBindingFragment.BackPressCallback {
|
||||||
private SharedViewModel sharedViewModel;
|
private SharedViewModel sharedViewModel;
|
||||||
private static final String TAG = PrintReceiptFragment.class.getSimpleName();
|
private static final String TAG = PrintReceiptFragment.class.getSimpleName();
|
||||||
private boolean printerEnabled = SystemParamsOperation.getInstance().getPrinterEnabled();
|
private boolean printerEnabled = true;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int currentId() {
|
protected int currentId() {
|
||||||
@ -60,6 +60,7 @@ public class PrintReceiptFragment extends DataBindingFragment implements DataBin
|
|||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
printerEnabled = SystemParamsOperation.getInstance().getPrinterEnabled();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* check TMS parameter here
|
* check TMS parameter here
|
||||||
@ -121,6 +122,7 @@ public class PrintReceiptFragment extends DataBindingFragment implements DataBin
|
|||||||
@Override
|
@Override
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
printerEnabled = SystemParamsOperation.getInstance().getPrinterEnabled();
|
||||||
|
|
||||||
if (!printerEnabled) {
|
if (!printerEnabled) {
|
||||||
sharedViewModel.setPrintStatus(PrintStatus.NOT_PRINT);
|
sharedViewModel.setPrintStatus(PrintStatus.NOT_PRINT);
|
||||||
@ -180,6 +182,9 @@ public class PrintReceiptFragment extends DataBindingFragment implements DataBin
|
|||||||
|
|
||||||
|
|
||||||
private void startPrintProcess(boolean isFirstPrint) {
|
private void startPrintProcess(boolean isFirstPrint) {
|
||||||
|
if (!SystemParamsOperation.getInstance().getPrinterEnabled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PrintHelper.getInstance().checkPaperRollStatus(new PaperRollStatusCallback() {
|
PrintHelper.getInstance().checkPaperRollStatus(new PaperRollStatusCallback() {
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ public class TimeoutFragment extends DataBindingFragment {
|
|||||||
|
|
||||||
private SharedViewModel sharedViewModel;
|
private SharedViewModel sharedViewModel;
|
||||||
|
|
||||||
private int resultTimeOut = 3;
|
private int resultTimeOut = 5;
|
||||||
private CountDownTimer countDownTimer;
|
private CountDownTimer countDownTimer;
|
||||||
private int routeId;
|
private int routeId;
|
||||||
|
|
||||||
|
|||||||
@ -56,7 +56,7 @@ public class TransactionResultFragment extends DataBindingFragment implements Da
|
|||||||
private static final String TAG = TransactionResultFragment.class.getSimpleName();
|
private static final String TAG = TransactionResultFragment.class.getSimpleName();
|
||||||
private TransProcessViewModel transProcessViewModel;
|
private TransProcessViewModel transProcessViewModel;
|
||||||
private SharedViewModel sharedViewModel;
|
private SharedViewModel sharedViewModel;
|
||||||
private static final int resultTimeOut = 1;
|
private static final int resultTimeOut = 3;
|
||||||
private int routeId;
|
private int routeId;
|
||||||
|
|
||||||
private final RxUtil<SiriusResponse> siriusRxUtil = new RxUtil<>();
|
private final RxUtil<SiriusResponse> siriusRxUtil = new RxUtil<>();
|
||||||
@ -165,7 +165,9 @@ public class TransactionResultFragment extends DataBindingFragment implements Da
|
|||||||
TransactionsType transactionType = sharedViewModel.transactionsType.getValue();
|
TransactionsType transactionType = sharedViewModel.transactionsType.getValue();
|
||||||
|
|
||||||
if (isNonApprovedTrade(payDetail) && isNonQRPayTransaction(transactionType)) {
|
if (isNonApprovedTrade(payDetail) && isNonQRPayTransaction(transactionType)) {
|
||||||
startPrintProcess(false);
|
if (SystemParamsOperation.getInstance().getPrinterEnabled()) {
|
||||||
|
startPrintProcess(false);
|
||||||
|
}
|
||||||
isCardInside();
|
isCardInside();
|
||||||
} else if (transactionType == TransactionsType.SETTLEMENT || transactionType == TransactionsType.MMQR_SETTLEMENT) {
|
} else if (transactionType == TransactionsType.SETTLEMENT || transactionType == TransactionsType.MMQR_SETTLEMENT) {
|
||||||
handleSettlementTransaction(siriusReq);
|
handleSettlementTransaction(siriusReq);
|
||||||
|
|||||||
@ -894,6 +894,81 @@
|
|||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tools:fontFamily="sans-serif-medium" />
|
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 -->
|
<!-- TMS Server URL Card -->
|
||||||
<!-- android:onClick="@{()->click.onTmsAddressClick()}"-->
|
<!-- android:onClick="@{()->click.onTmsAddressClick()}"-->
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user