Compare commits
2 Commits
95d50ec3a7
...
a37b035493
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a37b035493 | ||
|
|
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) {
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="android.text.TextUtils"/>
|
||||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="com.utsmm.kbz.ui.settings.HostConfigViewModel"/>
|
||||
@ -96,7 +98,8 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.hostName) ? View.GONE : View.VISIBLE}">
|
||||
|
||||
<TextView
|
||||
android:text="PRIMARY HOST"
|
||||
@ -110,48 +113,56 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:stretchColumns="1">
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.hostName) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Name"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.hostName}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.tid) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="TID"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.tid}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.mid) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="MID"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.mid}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.primaryIp) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Primary IP"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.primaryIp}'/>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.primaryPort) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Primary Port"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.primaryPort}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.secondaryIp) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Secondary IP"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.secondaryIp}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.secondaryPort) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Secondary Port"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.secondaryPort}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.currencyCode) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Currency"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.currencyCode}'/>
|
||||
@ -163,6 +174,7 @@
|
||||
android:text="--------------------------------------------------------------------------"
|
||||
android:gravity="left"
|
||||
android:paddingVertical="8dp"
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.hostName) ? View.GONE : View.VISIBLE}"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"/>
|
||||
|
||||
@ -170,7 +182,8 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostName) ? View.GONE : View.VISIBLE}">
|
||||
|
||||
<TextView
|
||||
android:text="SECONDARY HOST"
|
||||
@ -187,49 +200,57 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:stretchColumns="1">
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostName) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Name"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.thirdHostName}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostTid) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="TID"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.thirdHostTid}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostMid) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="MID"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.thirdHostMid}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostPrimaryIp) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Primary IP"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.thirdHostPrimaryIp}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostPrimaryPort) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Primary Port"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.thirdHostPrimaryPort}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostSecondaryIp) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Secondary IP"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.thirdHostSecondaryIp}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostSecondaryPort) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Secondary Port"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.thirdHostSecondaryPort}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostCurrency) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Currency"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.thirdHostCurrency}'/>
|
||||
@ -240,6 +261,7 @@
|
||||
android:text="--------------------------------------------------------------------------"
|
||||
android:gravity="left"
|
||||
android:paddingVertical="8dp"
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.thirdHostName) ? View.GONE : View.VISIBLE}"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"/>
|
||||
</LinearLayout>
|
||||
@ -248,7 +270,8 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.secHostName) ? View.GONE : View.VISIBLE}">
|
||||
|
||||
<TextView
|
||||
android:text="QR HOST"
|
||||
@ -265,43 +288,50 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:stretchColumns="1">
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.secHostName) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Name"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.secHostName}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.shortCode) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Short Code"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.shortCode}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.secHostPrimaryIp) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Primary IP"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.secHostPrimaryIp}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.secHostPrimaryPort) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Primary Port"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.secHostPrimaryPort}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.secHostSecondaryIp) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Secondary IP"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.secHostSecondaryIp}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.secHostSecondaryPort) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Secondary Port"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.secHostSecondaryPort}'/>
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.secHostCurrency) ? View.GONE : View.VISIBLE}">
|
||||
<TextView style="@style/HostLabelStyle" android:text="Currency"/>
|
||||
<TextView style="@style/HostValueStyle"
|
||||
android:text='@{": " + viewModel.secHostCurrency}'/>
|
||||
@ -312,6 +342,7 @@
|
||||
android:text="--------------------------------------------------------------------------"
|
||||
android:gravity="left"
|
||||
android:paddingVertical="8dp"
|
||||
android:visibility="@{TextUtils.isEmpty(viewModel.secHostName) ? View.GONE : View.VISIBLE}"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"/>
|
||||
</LinearLayout>
|
||||
@ -355,6 +386,7 @@
|
||||
android:layout_height="52dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="8dp"
|
||||
android:visibility="@{sharedViewModel.printerDisabled ? View.GONE : View.VISIBLE}"
|
||||
android:text="Print"
|
||||
android:onClick="@{()-> click.onPrint()}"
|
||||
android:background="@drawable/bg_rounded_btn_cv"
|
||||
|
||||
@ -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