previous qr showing in settlement fixed
This commit is contained in:
parent
e51d658733
commit
91207f1051
@ -102,3 +102,6 @@ card
|
||||
- fix for invoice number and trance number place mismatch in reprint any transaction screen
|
||||
- secondary host show Tid Mid
|
||||
- settlement fixed for duel currency
|
||||
|
||||
|
||||
## [2.43]
|
||||
|
||||
@ -39,8 +39,8 @@ android {
|
||||
applicationId "com.utsmm.kbz.uat"
|
||||
versionNameSuffix "-uat"
|
||||
resValue "string", "app_name", "KBZ-UAT"
|
||||
versionCode 47
|
||||
versionName "2.42"
|
||||
versionCode 48
|
||||
versionName "2.43"
|
||||
}
|
||||
|
||||
prod {
|
||||
|
||||
@ -72,6 +72,10 @@ public class ManagementViewModel extends ViewModel {
|
||||
return repository.getTransactionHistory();
|
||||
}
|
||||
|
||||
public LiveData<List<PayDetail>> getUnsettledQRTransactions(){
|
||||
return repository.getUnsettledQRTransactions();
|
||||
}
|
||||
|
||||
public LiveData<List<PayDetail>> getLastSettlement(String voucherNo){
|
||||
return repository.getLastSettlement(voucherNo);
|
||||
}
|
||||
|
||||
@ -158,7 +158,7 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
}
|
||||
|
||||
private void observeQRTransactions() {
|
||||
managementViewModel.getTransactionHistory().observe(getViewLifecycleOwner(), payDetailList -> {
|
||||
managementViewModel.getUnsettledQRTransactions().observe(getViewLifecycleOwner(), payDetailList -> {
|
||||
if (payDetailList != null) {
|
||||
qrTransactionsList.clear();
|
||||
qrTransListAll.clear();
|
||||
@ -314,6 +314,7 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
}
|
||||
|
||||
private void processData() {
|
||||
settlementViewModel.markAllUnsettledQRTransactionsSettled();
|
||||
TradeData tradeData = Params.newTrade(false);
|
||||
PayDetail payDetail = tradeData.getPayDetail();
|
||||
payDetail.setSettleDataObj(settleData);
|
||||
@ -335,11 +336,11 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
sharedViewModel.payDetail.setValue(payDetail);
|
||||
|
||||
for (PayDetail pay : qrTransactionsList) {
|
||||
settlementViewModel.deletePayDetail(pay);
|
||||
settlementViewModel.markQRTransactionSettled(pay);
|
||||
}
|
||||
|
||||
for (PayDetail pay : qrTransListAll) {
|
||||
settlementViewModel.deletePayDetail(pay);
|
||||
settlementViewModel.markQRTransactionSettled(pay);
|
||||
}
|
||||
}
|
||||
private void updateData() {
|
||||
|
||||
@ -308,7 +308,7 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
|
||||
}
|
||||
});
|
||||
|
||||
managementViewModel.getTransactionHistory().observe(getViewLifecycleOwner(), payDetailList -> {
|
||||
managementViewModel.getUnsettledQRTransactions().observe(getViewLifecycleOwner(), payDetailList -> {
|
||||
if (payDetailList != null) {
|
||||
qrTransactionsList.clear();
|
||||
qrTransListAll.clear();
|
||||
@ -350,6 +350,11 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
|
||||
settlementViewModel.qr_refund_count.setValue(qrRefundCount);
|
||||
settlementViewModel.qr_refund_amount.setValue(qrRefundAmount);
|
||||
settlementViewModel.qr_section_visibility.setValue(qrCount > 0 ? 0 : 8);
|
||||
if (qrCount > 0) {
|
||||
settlementViewModel.isNoData.setValue(false);
|
||||
} else if (cardTransactionsList.isEmpty() && settlementViewModel.deleteTrans.isEmpty()) {
|
||||
settlementViewModel.isNoData.setValue(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -774,6 +779,7 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
|
||||
}
|
||||
|
||||
private void settleQr() {
|
||||
settlementViewModel.markAllUnsettledQRTransactionsSettled();
|
||||
if (qrTransactionsList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
@ -796,10 +802,10 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
|
||||
sharedViewModel.payDetails.setValue(new ArrayList<>(qrTransactionsList));
|
||||
|
||||
for (PayDetail pay : qrTransactionsList) {
|
||||
settlementViewModel.deletePayDetail(pay);
|
||||
settlementViewModel.markQRTransactionSettled(pay);
|
||||
}
|
||||
for (PayDetail pay : qrTransListAll) {
|
||||
settlementViewModel.deletePayDetail(pay);
|
||||
settlementViewModel.markQRTransactionSettled(pay);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -300,6 +300,14 @@ public class SettlementViewModel extends ViewModel {
|
||||
repository.deletePayDetail(payDetail);
|
||||
}
|
||||
|
||||
public void markQRTransactionSettled(PayDetail payDetail){
|
||||
repository.markQRTransactionSettled(payDetail);
|
||||
}
|
||||
|
||||
public void markAllUnsettledQRTransactionsSettled(){
|
||||
repository.markAllUnsettledQRTransactionsSettled();
|
||||
}
|
||||
|
||||
private void updateDB() {
|
||||
|
||||
if(payDetails != null && payDetails.size() > 0) {
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View" />
|
||||
|
||||
<import type="com.utsmyanmar.paylibs.utils.POSUtil" />
|
||||
|
||||
<variable
|
||||
@ -44,7 +46,8 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:visibility="@{settleViewModel.isNoData ? View.GONE : View.VISIBLE}">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
@ -70,7 +73,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@color/colorLightGray" />
|
||||
android:background="@color/colorLightGray"
|
||||
android:visibility="@{settleViewModel.isNoData ? View.GONE : View.VISIBLE}" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -156,6 +160,16 @@
|
||||
tools:text="1,000.00" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:gravity="center"
|
||||
android:text="No Transaction Exist"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="17sp"
|
||||
android:visibility="@{settleViewModel.isNoData ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout3"
|
||||
android:layout_width="match_parent"
|
||||
@ -166,7 +180,7 @@
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:visibility="@{settleViewModel.btmLayout}"
|
||||
android:visibility="@{settleViewModel.isNoData ? View.GONE : settleViewModel.btmLayout}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ public final class TerminalKeyUtil {
|
||||
|
||||
// private static final byte[] main_key_data = ByteUtil.hexStr2Bytes("B4D74774CC846CAFF6D1AAAC2EB79CFF".toUpperCase()); // KBZ UAT
|
||||
// private static final byte[] main_key_usd_data = ByteUtil.hexStr2Bytes("3f4bcac6cc559ab12bbbc5a51118f3f5".toUpperCase()); // KBZ UAT
|
||||
private static final byte[] main_key_data = ByteUtil.hexStr2Bytes("b4d74774cc846caff6d1aaac2eb79cff".toUpperCase());
|
||||
private static final byte[] main_key_data = ByteUtil.hexStr2Bytes("3F4BCAC6CC559AB12BBBC5A51118F3F5".toUpperCase());
|
||||
// private static final byte[] main_key_data = ByteUtil.hexStr2Bytes("e121249099a677e8b7d4f6a9d49fe8d1".toUpperCase()); // MPU
|
||||
private static final byte[] work_key_data = new byte[16];
|
||||
public static void initNexKey() {
|
||||
|
||||
@ -105,6 +105,17 @@ public interface PayDetailDao {
|
||||
LiveData<List<PayDetail>> getAllReversalTransactionsLive();
|
||||
|
||||
// @Query("SELECT * FROM paydetail WHERE transactionType != 10 ORDER BY PID DESC")
|
||||
@Query("SELECT * FROM paydetail WHERE isSettle = 0 "
|
||||
+ "AND transactionType IN (20, 34) ORDER BY PID DESC")
|
||||
LiveData<List<PayDetail>> getUnsettledQRTransactions();
|
||||
|
||||
@Query("UPDATE paydetail SET isSettle = 1 WHERE PID = :pid")
|
||||
void markQRTransactionSettled(Long pid);
|
||||
|
||||
@Query("UPDATE paydetail SET isSettle = 1 "
|
||||
+ "WHERE isSettle = 0 AND transactionType IN (20, 34)")
|
||||
void markAllUnsettledQRTransactionsSettled();
|
||||
|
||||
@Query("SELECT * FROM paydetail ORDER BY PID DESC")
|
||||
LiveData<List<PayDetail>> getTransactionHistory();
|
||||
|
||||
|
||||
@ -255,6 +255,10 @@ public class Repository {
|
||||
|
||||
public LiveData<List<PayDetail>> getTransactionHistory(){ return payDetailDao.getTransactionHistory();}
|
||||
|
||||
public LiveData<List<PayDetail>> getUnsettledQRTransactions(){
|
||||
return payDetailDao.getUnsettledQRTransactions();
|
||||
}
|
||||
|
||||
public LiveData<List<PayDetail>> getLastSettlement(String voucherNo) { return payDetailDao.getLastSettlement(voucherNo);}
|
||||
public LiveData<List<PayDetail>> getLastSettlementQR(String voucherNo) { return payDetailDao.getLastSettlementQR(voucherNo);}
|
||||
|
||||
@ -365,6 +369,16 @@ public class Repository {
|
||||
payDetailDao.deletePayDetail(payDetail);
|
||||
}
|
||||
|
||||
public void markQRTransactionSettled(PayDetail payDetail) {
|
||||
if (payDetail != null && payDetail.getPID() != null) {
|
||||
payDetailDao.markQRTransactionSettled(payDetail.getPID());
|
||||
}
|
||||
}
|
||||
|
||||
public void markAllUnsettledQRTransactionsSettled() {
|
||||
payDetailDao.markAllUnsettledQRTransactionsSettled();
|
||||
}
|
||||
|
||||
public LiveData<List<PayDetail>> getAllTrans() { return payDetailDao.getAllTrans(); }
|
||||
|
||||
public LiveData<List<PayDetail>> getAllQRHistory(){ return payDetailDao.getAllQRHistory();}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user