Compare commits

..

No commits in common. "a37b035493c995347d48f6ef75d821c146f0c416" and "95d50ec3a7d3b519afdda92f01dbaa333eb6797d" have entirely different histories.

6 changed files with 29 additions and 76 deletions

View File

@ -53,7 +53,6 @@ public class ManagementFunctionFragment extends DataBindingFragment {
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
sharedViewModel.printerDisabled.setValue(!SystemParamsOperation.getInstance().getPrinterEnabled());
setToolBarTitleWithBackIcon(getString(R.string.title_select_function)); setToolBarTitleWithBackIcon(getString(R.string.title_select_function));
} }

View File

@ -86,7 +86,6 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
sharedViewModel.printerDisabled.setValue(!SystemParamsOperation.getInstance().getPrinterEnabled());
setToolBarTitleWithBackIcon(getString(R.string.title_qr_settlement)); setToolBarTitleWithBackIcon(getString(R.string.title_qr_settlement));
String merchantName = SystemParamsOperation.getInstance().getMerchantName(); String merchantName = SystemParamsOperation.getInstance().getMerchantName();
@ -135,7 +134,7 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
managementViewModel.detailReportLayoutLoadingVisibility.setValue(8); managementViewModel.detailReportLayoutLoadingVisibility.setValue(8);
managementViewModel.detailReportLayoutVisibility.setValue(8); managementViewModel.detailReportLayoutVisibility.setValue(8);
managementViewModel.detailReportLayoutViewVisibility.setValue(0); managementViewModel.detailReportLayoutViewVisibility.setValue(0);
managementViewModel.detailReportBottomLayoutVisibility.setValue(isLastSettlementPrinterDisabled() ? 8 : 0); managementViewModel.detailReportBottomLayoutVisibility.setValue(0);
} }
private void showEmptyDataView() { private void showEmptyDataView() {
@ -150,13 +149,6 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
managementViewModel.cardTypeDR.setValue("QR PAY"); 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() { private void observeQRTransactions() {
managementViewModel.getTransactionHistory().observe(getViewLifecycleOwner(), payDetailList -> { managementViewModel.getTransactionHistory().observe(getViewLifecycleOwner(), payDetailList -> {
if (payDetailList != null) { if (payDetailList != null) {
@ -393,4 +385,4 @@ public class QRSettlementTransactionFragment extends DataBindingFragment impleme
} }
} }
} }

View File

@ -88,8 +88,6 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
boolean printerDisabled = !SystemParamsOperation.getInstance().getPrinterEnabled();
sharedViewModel.printerDisabled.setValue(printerDisabled);
if(sharedViewModel.getTransMenu().getValue() == TransMenu.LAST_SETTLEMENT) { if(sharedViewModel.getTransMenu().getValue() == TransMenu.LAST_SETTLEMENT) {
setToolBarTitleWithBackIcon(getString(R.string.txt_subtitle_reprint_last_settle_report)); setToolBarTitleWithBackIcon(getString(R.string.txt_subtitle_reprint_last_settle_report));
@ -105,8 +103,6 @@ public class SettlementTransactionFragment extends DataBindingFragment implement
if(sharedViewModel.getTransMenu().getValue() == TransMenu.REVIEW_BATCH){ if(sharedViewModel.getTransMenu().getValue() == TransMenu.REVIEW_BATCH){
settlementViewModel.btmLayout.setValue(8); settlementViewModel.btmLayout.setValue(8);
} else if(sharedViewModel.getTransMenu().getValue() == TransMenu.LAST_SETTLEMENT && printerDisabled) {
settlementViewModel.btmLayout.setValue(8);
} else { } else {
settlementViewModel.btmLayout.setValue(0); settlementViewModel.btmLayout.setValue(0);
} }

View File

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

View File

@ -3,7 +3,6 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<data> <data>
<import type="android.view.View" />
<variable <variable
name="sharedViewModel" name="sharedViewModel"
type="com.utsmm.kbz.ui.core_viewmodel.SharedViewModel" /> type="com.utsmm.kbz.ui.core_viewmodel.SharedViewModel" />
@ -94,7 +93,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="12dp" android:layout_marginBottom="12dp"
android:visibility="@{sharedViewModel.printerDisabled ? View.GONE : View.VISIBLE}"
app:cardCornerRadius="12dp" app:cardCornerRadius="12dp"
app:cardElevation="0dp" app:cardElevation="0dp"
app:cardBackgroundColor="@color/white" app:cardBackgroundColor="@color/white"

View File

@ -224,7 +224,7 @@ public abstract class BaseXPrint {
if (settleData.getCashAdvanceCount() != 0) if (settleData.getCashAdvanceCount() != 0)
print3ColumnsString("CASH ADVANCE ", countStringFormat(settleData.getCashAdvanceCount()), PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getCashAdvanceAmount())); print3ColumnsString("CASH ADVANCE ", countStringFormat(settleData.getCashAdvanceCount()), PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getCashAdvanceAmount()));
print3ColumnsString("REFUND ", countStringFormat(settleData.getRefundCount()), "- " + PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getRefundAmount())); 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); emptyLine(2);