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