Compare commits

...

2 Commits

Author SHA1 Message Date
moon
40fa96bb55 last settlement fixed 2026-08-01 00:58:48 +06:30
moon
5beea4afdd last settlement changed 2026-08-01 00:51:37 +06:30
4 changed files with 43 additions and 11 deletions

View File

@ -1,7 +1,3 @@
1. QR Host
When we generate QR , this transaction not successful.
But this transaction included as success transaction in summary report and history.
Please remove "CANCEL" records in summary report and history.
2. Card Host 2. Card Host
@ -14,7 +10,6 @@ Preauth - 2500
Preauth cancel - 500 Preauth cancel - 500
Preauth complete - 2000 Preauth complete - 2000
KBZ Host USD - 3000 (Not include in total net amount for void , preauth , preauth cancel) KBZ Host USD - 3000 (Not include in total net amount for void , preauth , preauth cancel)
Sale - 2000 Sale - 2000
Void - 1000 Void - 1000
@ -25,6 +20,3 @@ Preauth complete - 2000
MMQR Pay - 3000 (Not include in total net amount for refund transaction and cancel transaction) MMQR Pay - 3000 (Not include in total net amount for refund transaction and cancel transaction)
QR pay - 4000 QR pay - 4000
Refund - 1000 Refund - 1000
3. Reprint Last Settlement Report
Same process with settlement

View File

@ -140,7 +140,7 @@ public class ManagementFunctionFragment extends DataBindingFragment {
// observeLastSettlement(); // observeLastSettlement();
sharedViewModel.setTransMenu(TransMenu.LAST_SETTLEMENT); sharedViewModel.setTransMenu(TransMenu.LAST_SETTLEMENT);
routeId = R.id.action_managementFunctionFragment_to_selectHostFragment; routeId = R.id.action_managementFunctionFragment_to_settlementTransactionFragment;
safeNavigateToRouteId(); safeNavigateToRouteId();
} }

View File

@ -3,10 +3,12 @@ package com.utsmm.kbz.ui.management;
import android.animation.ObjectAnimator; import android.animation.ObjectAnimator;
import android.animation.ValueAnimator; import android.animation.ValueAnimator;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils;
import android.view.View; import android.view.View;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import com.github.gcacace.signaturepad.BR; import com.github.gcacace.signaturepad.BR;
@ -42,6 +44,7 @@ public class ReprintReceiptFragment extends DataBindingFragment {
private static final String TAG = ReprintReceiptFragment.class.getSimpleName(); private static final String TAG = ReprintReceiptFragment.class.getSimpleName();
private PayDetail payDetail; private PayDetail payDetail;
private List<QRSettleData> lastQrSettleData;
private ObjectAnimator slideUpAnimator; private ObjectAnimator slideUpAnimator;
private View printingCard; private View printingCard;
@ -165,7 +168,12 @@ public class ReprintReceiptFragment extends DataBindingFragment {
transType = ""; transType = "";
} }
payDetail.setTransType(transType + "(REPRINT)"); payDetail.setTransType(transType + "(REPRINT)");
checkPaperExists(payDetail);
if (payDetail.getTransactionType() == TransactionsType.SETTLEMENT.value) {
observeLastQrSettlement(payDetail);
} else {
checkPaperExists(payDetail);
}
// managementViewModel.payDetail.observe(getViewLifecycleOwner(), new Observer<PayDetail>() { // managementViewModel.payDetail.observe(getViewLifecycleOwner(), new Observer<PayDetail>() {
// @Override // @Override
// public void onChanged(PayDetail pay) { // public void onChanged(PayDetail pay) {
@ -185,12 +193,41 @@ public class ReprintReceiptFragment extends DataBindingFragment {
// }); // });
} }
private void observeLastQrSettlement(PayDetail settlePayDetail) {
lastQrSettleData = null;
LiveData<List<PayDetail>> liveData = managementViewModel.getLastSettlementQR(SystemParamsOperation.getInstance().getCurrentSerialNum());
liveData.observe(getViewLifecycleOwner(), new Observer<List<PayDetail>>() {
@Override
public void onChanged(List<PayDetail> qrSettlements) {
liveData.removeObserver(this);
if (qrSettlements != null) {
for (int i = qrSettlements.size() - 1; i >= 0; i--) {
PayDetail qrSettle = qrSettlements.get(i);
if (qrSettle != null
&& qrSettle.getTransactionType() == TransactionsType.MMQR_SETTLEMENT.value
&& TextUtils.equals(qrSettle.getBatchNo(), settlePayDetail.getBatchNo())
&& qrSettle.getQrSettleData() != null
&& !qrSettle.getQrSettleData().isEmpty()) {
lastQrSettleData = qrSettle.getQrSettleData();
break;
}
}
}
checkPaperExists(settlePayDetail);
}
});
}
private void printReceipt(PayDetail payDetail) { private void printReceipt(PayDetail payDetail) {
if (payDetail.getTransactionType() == TransactionsType.MMQR_SETTLEMENT.value) { if (payDetail.getTransactionType() == TransactionsType.MMQR_SETTLEMENT.value) {
PrintXReceipt.getInstance().printQRSettlementReport(payDetail, payDetail.getQrSettleData(), printXStatus); PrintXReceipt.getInstance().printQRSettlementReport(payDetail, payDetail.getQrSettleData(), printXStatus);
} else if (lastQrSettleData != null && !lastQrSettleData.isEmpty()) {
PrintXReceipt.getInstance().printSmileSettlementReport(payDetail, lastQrSettleData, printXStatus);
} else { } else {
PrintXReceipt.getInstance().printSmileSettlementReport(payDetail, printXStatus); PrintXReceipt.getInstance().printSmileSettlementReport(payDetail, printXStatus);
} }

View File

@ -226,6 +226,9 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
sharedViewModel.payDetail.setValue(payDetail); sharedViewModel.payDetail.setValue(payDetail);
} else {
settlementViewModel.isNoData.setValue(true);
setSettlementViewModelData(0, 0, 0, 0, 0, 0, 0, 0);
} }
} else { } else {