Compare commits
2 Commits
ee297e8e77
...
40fa96bb55
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40fa96bb55 | ||
|
|
5beea4afdd |
10
TODO.md
10
TODO.md
@ -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
|
||||
@ -14,7 +10,6 @@ Preauth - 2500
|
||||
Preauth cancel - 500
|
||||
Preauth complete - 2000
|
||||
|
||||
|
||||
KBZ Host USD - 3000 (Not include in total net amount for void , preauth , preauth cancel)
|
||||
Sale - 2000
|
||||
Void - 1000
|
||||
@ -24,7 +19,4 @@ Preauth complete - 2000
|
||||
|
||||
MMQR Pay - 3000 (Not include in total net amount for refund transaction and cancel transaction)
|
||||
QR pay - 4000
|
||||
Refund - 1000
|
||||
|
||||
3. Reprint Last Settlement Report
|
||||
Same process with settlement
|
||||
Refund - 1000
|
||||
@ -140,7 +140,7 @@ public class ManagementFunctionFragment extends DataBindingFragment {
|
||||
|
||||
// observeLastSettlement();
|
||||
sharedViewModel.setTransMenu(TransMenu.LAST_SETTLEMENT);
|
||||
routeId = R.id.action_managementFunctionFragment_to_selectHostFragment;
|
||||
routeId = R.id.action_managementFunctionFragment_to_settlementTransactionFragment;
|
||||
safeNavigateToRouteId();
|
||||
}
|
||||
|
||||
|
||||
@ -3,10 +3,12 @@ package com.utsmm.kbz.ui.management;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.Observer;
|
||||
|
||||
import com.github.gcacace.signaturepad.BR;
|
||||
@ -42,6 +44,7 @@ public class ReprintReceiptFragment extends DataBindingFragment {
|
||||
private static final String TAG = ReprintReceiptFragment.class.getSimpleName();
|
||||
|
||||
private PayDetail payDetail;
|
||||
private List<QRSettleData> lastQrSettleData;
|
||||
private ObjectAnimator slideUpAnimator;
|
||||
private View printingCard;
|
||||
|
||||
@ -165,7 +168,12 @@ public class ReprintReceiptFragment extends DataBindingFragment {
|
||||
transType = "";
|
||||
}
|
||||
payDetail.setTransType(transType + "(REPRINT)");
|
||||
checkPaperExists(payDetail);
|
||||
|
||||
if (payDetail.getTransactionType() == TransactionsType.SETTLEMENT.value) {
|
||||
observeLastQrSettlement(payDetail);
|
||||
} else {
|
||||
checkPaperExists(payDetail);
|
||||
}
|
||||
// managementViewModel.payDetail.observe(getViewLifecycleOwner(), new Observer<PayDetail>() {
|
||||
// @Override
|
||||
// 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) {
|
||||
|
||||
if (payDetail.getTransactionType() == TransactionsType.MMQR_SETTLEMENT.value) {
|
||||
|
||||
PrintXReceipt.getInstance().printQRSettlementReport(payDetail, payDetail.getQrSettleData(), printXStatus);
|
||||
|
||||
} else if (lastQrSettleData != null && !lastQrSettleData.isEmpty()) {
|
||||
|
||||
PrintXReceipt.getInstance().printSmileSettlementReport(payDetail, lastQrSettleData, printXStatus);
|
||||
|
||||
} else {
|
||||
PrintXReceipt.getInstance().printSmileSettlementReport(payDetail, printXStatus);
|
||||
}
|
||||
|
||||
@ -226,6 +226,9 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
|
||||
sharedViewModel.payDetail.setValue(payDetail);
|
||||
|
||||
|
||||
} else {
|
||||
settlementViewModel.isNoData.setValue(true);
|
||||
setSettlementViewModelData(0, 0, 0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user