Compare commits

...

2 Commits

Author SHA1 Message Date
MooN
328f114ca0 fail receipt disable 2026-02-18 22:08:24 +06:30
MooN
74bed47d68 Update InputRRNFragment.java 2026-02-18 21:28:49 +06:30
5 changed files with 113 additions and 11 deletions

View File

@ -479,15 +479,19 @@ public class InputRRNFragment extends DataBindingFragment {
} }
private void refundProcessEmv(boolean isECR) { private void refundProcessEmv(boolean isECR) {
PayDetail payDetail = emvTransactionProcessViewModel.getPayDetail(); rrnViewModel.searchPayDetail(cardNo, rrnNo).observe(getViewLifecycleOwner(), payDetail -> {
payDetail.setReferNo(rrnNo); if (payDetail != null && isCurrentBatchUnsettled(payDetail)) {
terminatedTransRefund(isECR);
return;
}
PayDetail newPay = emvTransactionProcessViewModel.getPayDetail();
newPay.setReferNo(rrnNo);
emvTransactionProcessViewModel.setPayDetail(newPay);
emvTransactionProcessViewModel.setPayDetail(payDetail); sharedViewModel.rrNNo.setValue(rrnNo);
callNextScreen();
sharedViewModel.rrNNo.setValue(rrnNo); });
callNextScreen();
} }
private void checkRRNRefund(boolean isECR) { private void checkRRNRefund(boolean isECR) {
@ -518,6 +522,11 @@ public class InputRRNFragment extends DataBindingFragment {
LogUtil.d(TAG,"Trans Type:"+payDetail.getTransactionType()); LogUtil.d(TAG,"Trans Type:"+payDetail.getTransactionType());
if (isCurrentBatchUnsettled(payDetail)) {
terminatedTransRefund(isECR);
return;
}
if(payDetail.getTransactionType() != TransactionsType.SALE.value) { if(payDetail.getTransactionType() != TransactionsType.SALE.value) {
terminatedTransRefund(isECR); terminatedTransRefund(isECR);
return; return;
@ -559,6 +568,17 @@ public class InputRRNFragment extends DataBindingFragment {
} }
private boolean isCurrentBatchUnsettled(PayDetail payDetail) {
if (payDetail == null) {
return false;
}
String currentBatch = SystemParamsOperation.getInstance().getCurrentBatchNum();
String batchNo = payDetail.getBatchNo();
return batchNo != null
&& batchNo.equals(currentBatch)
&& !payDetail.isSettle;
}
private void terminatedTransRefund(boolean isECR) { private void terminatedTransRefund(boolean isECR) {
showDeclineDialog(getResourceString(R.string.txt_refund_not_allow)); showDeclineDialog(getResourceString(R.string.txt_refund_not_allow));
if (isECR) { if (isECR) {

View File

@ -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() {

View File

@ -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;

View File

@ -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);

View File

@ -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