printer disable in reprint settlement
This commit is contained in:
parent
95d50ec3a7
commit
49e787a56c
@ -53,6 +53,7 @@ public class ManagementFunctionFragment extends DataBindingFragment {
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
sharedViewModel.printerDisabled.setValue(!SystemParamsOperation.getInstance().getPrinterEnabled());
|
||||
setToolBarTitleWithBackIcon(getString(R.string.title_select_function));
|
||||
}
|
||||
|
||||
|
||||
@ -86,6 +86,7 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
sharedViewModel.printerDisabled.setValue(!SystemParamsOperation.getInstance().getPrinterEnabled());
|
||||
setToolBarTitleWithBackIcon(getString(R.string.title_qr_settlement));
|
||||
|
||||
String merchantName = SystemParamsOperation.getInstance().getMerchantName();
|
||||
@ -134,7 +135,7 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
managementViewModel.detailReportLayoutLoadingVisibility.setValue(8);
|
||||
managementViewModel.detailReportLayoutVisibility.setValue(8);
|
||||
managementViewModel.detailReportLayoutViewVisibility.setValue(0);
|
||||
managementViewModel.detailReportBottomLayoutVisibility.setValue(0);
|
||||
managementViewModel.detailReportBottomLayoutVisibility.setValue(isLastSettlementPrinterDisabled() ? 8 : 0);
|
||||
}
|
||||
|
||||
private void showEmptyDataView() {
|
||||
@ -149,6 +150,13 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
managementViewModel.cardTypeDR.setValue("QR PAY");
|
||||
}
|
||||
|
||||
private boolean isLastSettlementPrinterDisabled() {
|
||||
Boolean printerDisabled = sharedViewModel.printerDisabled.getValue();
|
||||
return sharedViewModel.getTransMenu().getValue() == TransMenu.LAST_SETTLEMENT
|
||||
&& printerDisabled != null
|
||||
&& printerDisabled;
|
||||
}
|
||||
|
||||
private void observeQRTransactions() {
|
||||
managementViewModel.getTransactionHistory().observe(getViewLifecycleOwner(), payDetailList -> {
|
||||
if (payDetailList != null) {
|
||||
@ -385,4 +393,4 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,6 +88,8 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
boolean printerDisabled = !SystemParamsOperation.getInstance().getPrinterEnabled();
|
||||
sharedViewModel.printerDisabled.setValue(printerDisabled);
|
||||
|
||||
if(sharedViewModel.getTransMenu().getValue() == TransMenu.LAST_SETTLEMENT) {
|
||||
setToolBarTitleWithBackIcon(getString(R.string.txt_subtitle_reprint_last_settle_report));
|
||||
@ -103,6 +105,8 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
|
||||
|
||||
if(sharedViewModel.getTransMenu().getValue() == TransMenu.REVIEW_BATCH){
|
||||
settlementViewModel.btmLayout.setValue(8);
|
||||
} else if(sharedViewModel.getTransMenu().getValue() == TransMenu.LAST_SETTLEMENT && printerDisabled) {
|
||||
settlementViewModel.btmLayout.setValue(8);
|
||||
} else {
|
||||
settlementViewModel.btmLayout.setValue(0);
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<data>
|
||||
<import type="android.view.View" />
|
||||
<variable
|
||||
name="sharedViewModel"
|
||||
type="com.utsmm.kbz.ui.core_viewmodel.SharedViewModel" />
|
||||
@ -93,6 +94,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:visibility="@{sharedViewModel.printerDisabled ? View.GONE : View.VISIBLE}"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
|
||||
@ -224,7 +224,7 @@ public abstract class BaseXPrint {
|
||||
if (settleData.getCashAdvanceCount() != 0)
|
||||
print3ColumnsString("CASH ADVANCE ", countStringFormat(settleData.getCashAdvanceCount()), PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getCashAdvanceAmount()));
|
||||
print3ColumnsString("REFUND ", countStringFormat(settleData.getRefundCount()), "- " + PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getRefundAmount()));
|
||||
print3ColumnsString("TOTAL(MMK) ", countStringFormat(totalCount), PrintUtils.getInstance().getSeparatorNumberFormat(totalAmount));
|
||||
print3ColumnsString("TOTAL"+ "(" + "MMK" +")" + " ", countStringFormat(totalCount), PrintUtils.getInstance().getSeparatorNumberFormat(totalAmount));
|
||||
|
||||
emptyLine(2);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user