QR settlement fixed
This commit is contained in:
parent
3eb67d92d9
commit
c46b8793a1
@ -424,6 +424,8 @@ public class SharedViewModel extends ViewModel {
|
||||
|
||||
private void startPrintProcessQRSettlement() {
|
||||
|
||||
|
||||
|
||||
if(payDetail.getValue() == null && payDetails.getValue() == null) return;
|
||||
|
||||
PrintXReceipt.getInstance().printQRSettlementReport(payDetail.getValue(),payDetails.getValue(), new PrintXStatus() {
|
||||
|
||||
@ -302,7 +302,7 @@ public class ReprintAnyTransactionFragment extends DataBindingFragment {
|
||||
if(sharedViewModel.transactionsType.getValue() != null && sharedViewModel.transactionsType.getValue() == TransactionsType.MMQR_HISTORY) {
|
||||
// Wave Inquiry Status::
|
||||
// April 2, 2024 QR Inquiry status check is for unsuccessful transactions.
|
||||
if(yesterday.compareTo(transDate) <= 0 && pay.getTransactionType() == TransactionsType.MMQR.value ) {
|
||||
if(yesterday.compareTo(transDate) <= 0 && (pay.getTransactionType() == TransactionsType.MMQR.value || pay.getTransactionType() == TransactionsType.MMQR_REFUND.value) ) {
|
||||
|
||||
filteredLists.add(pay);
|
||||
}
|
||||
|
||||
@ -45,6 +45,7 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
|
||||
@Override
|
||||
protected void initViewModel() {
|
||||
|
||||
sharedViewModel = getFragmentScopeViewModel(SharedViewModel.class);
|
||||
managementViewModel = getFragmentScopeViewModel(ManagementViewModel.class);
|
||||
settlementViewModel = getFragmentScopeViewModel(SettlementViewModel.class);
|
||||
@ -167,11 +168,14 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
showEmptyDataView();
|
||||
settlementViewModel.isNoData.setValue(true);
|
||||
} else {
|
||||
|
||||
showDataView();
|
||||
settlementViewModel.isNoData.setValue(false);
|
||||
}
|
||||
|
||||
setupSettlementDisplayData();
|
||||
}
|
||||
|
||||
// setupSettlementDisplayData();
|
||||
|
||||
} else {
|
||||
showEmptyDataView();
|
||||
@ -213,7 +217,7 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
settlementViewModel.isNoData.setValue(false);
|
||||
}
|
||||
|
||||
setupSettlementDisplayData();
|
||||
|
||||
|
||||
} else {
|
||||
showEmptyDataView();
|
||||
@ -232,6 +236,8 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
int qrRefundCount = 0;
|
||||
long qrRefundAmount = 0;
|
||||
|
||||
long totalAmount = 0;
|
||||
|
||||
for (PayDetail payDetail : qrTransactionsList) {
|
||||
if (payDetail.getTransactionType() == TransactionsType.MMQR.value) {
|
||||
qrSaleCount++;
|
||||
@ -242,6 +248,8 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
}
|
||||
}
|
||||
|
||||
totalAmount = qrSaleAmount - qrRefundAmount;
|
||||
|
||||
// Set values in settlement view model for display
|
||||
settlementViewModel.sale_count.setValue(qrSaleCount);
|
||||
settlementViewModel.sale_amount.setValue(qrSaleAmount);
|
||||
@ -266,10 +274,11 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
}
|
||||
|
||||
|
||||
sharedViewModel.setAmount(String.valueOf(qrSaleAmount - qrRefundAmount));
|
||||
sharedViewModel.setAmount(POSUtil.getInstance().getDecimalAmountSeparatorFormat(totalAmount));
|
||||
|
||||
sharedViewModel.payDetail.setValue(payDetail);
|
||||
sharedViewModel.payDetails.setValue(qrTransactionsList);
|
||||
sharedViewModel.payDetail.setValue(payDetail);
|
||||
|
||||
}
|
||||
|
||||
private void finishECRProcess() {
|
||||
@ -279,10 +288,10 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
}
|
||||
|
||||
private void navigateToResult() {
|
||||
delayFunctionCall(()->{
|
||||
|
||||
routeId = R.id.action_QRSettlementTransactionFragment_to_transactionResultFragment;
|
||||
safeNavigateToRouteId();
|
||||
},1000);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -321,10 +330,13 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
public void onConfirm() {
|
||||
if(sharedViewModel.getTransMenu().getValue() == TransMenu.SETTLEMENT) {
|
||||
if (!qrTransactionsList.isEmpty()) {
|
||||
|
||||
for (PayDetail payDetail : qrTransactionsList) {
|
||||
settlementViewModel.deletePayDetail(payDetail);
|
||||
}
|
||||
|
||||
|
||||
|
||||
updateData();
|
||||
navigateToResult();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user