print button hidden in Detail Report

This commit is contained in:
MooN 2026-02-05 22:46:40 +06:30
parent fc4e3558f7
commit fccf781c3b
2 changed files with 219 additions and 213 deletions

View File

@ -72,6 +72,7 @@ public class DetailReportFragment extends DataBindingFragment {
super.onResume(); super.onResume();
setToolBarTitleWithBackIcon(getResourceString(R.string.txt_subtitle_print_detail_report)); setToolBarTitleWithBackIcon(getResourceString(R.string.txt_subtitle_print_detail_report));
sharedViewModel.printerDisabled.setValue(!SystemParamsOperation.getInstance().getPrinterEnabled());
showLoadingView(); showLoadingView();
} }
@ -222,6 +223,10 @@ public class DetailReportFragment extends DataBindingFragment {
} }
public void onPrint() { public void onPrint() {
if (!SystemParamsOperation.getInstance().getPrinterEnabled()) {
showDeclineDialog("Printer is disabled!");
return;
}
TradeData tradeData = Params.newTrade(false); TradeData tradeData = Params.newTrade(false);
PayDetail payDetail = tradeData.getPayDetail(); PayDetail payDetail = tradeData.getPayDetail();
payDetail.setTransType(TransactionsType.DETAIL_REPORT.name); payDetail.setTransType(TransactionsType.DETAIL_REPORT.name);

View File

@ -6,6 +6,7 @@
<data> <data>
<import type="com.utsmyanmar.paylibs.utils.POSUtil"/> <import type="com.utsmyanmar.paylibs.utils.POSUtil"/>
<import type="com.utsmyanmar.paylibs.utils.enums.HostType"/> <import type="com.utsmyanmar.paylibs.utils.enums.HostType"/>
<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" />
@ -186,136 +187,136 @@
android:orientation="vertical"> android:orientation="vertical">
<!-- Report Header Table --> <!-- Report Header Table -->
<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:layout_marginBottom="16dp"> <!-- android:layout_marginBottom="16dp">-->
<!-- Table Headers Row 1 --> <!-- &lt;!&ndash; Table Headers Row 1 &ndash;&gt;-->
<LinearLayout <!-- <LinearLayout-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:orientation="horizontal" <!-- android:orientation="horizontal"-->
android:paddingVertical="8dp" <!-- android:paddingVertical="8dp"-->
android:background="@color/colorPrimary" <!-- android:background="@color/colorPrimary"-->
android:alpha="0.1"> <!-- android:alpha="0.1">-->
<TextView <!-- <TextView-->
android:layout_width="0dp" <!-- android:layout_width="0dp"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:layout_weight="1" <!-- android:layout_weight="1"-->
android:text="@{sharedViewModel.hostType == HostType.QR ? `PAYMENT NAME`:`CARD NAME`}" <!-- android:text="@{sharedViewModel.hostType == HostType.QR ? `PAYMENT NAME`:`CARD NAME`}"-->
android:textColor="@color/colorPrimary" <!-- android:textColor="@color/colorPrimary"-->
android:textSize="12sp" <!-- android:textSize="12sp"-->
android:textStyle="bold" <!-- android:textStyle="bold"-->
android:fontFamily="sans-serif-medium" <!-- android:fontFamily="sans-serif-medium"-->
android:textAlignment="center" <!-- android:textAlignment="center"-->
tools:text="CARD NAME" /> <!-- tools:text="CARD NAME" />-->
<TextView <!-- <TextView-->
android:layout_width="0dp" <!-- android:layout_width="0dp"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:layout_weight="1" <!-- android:layout_weight="1"-->
android:text="@{sharedViewModel.hostType == HostType.QR ? ` `:`CARD NUMBER`}" <!-- android:text="@{sharedViewModel.hostType == HostType.QR ? ` `:`CARD NUMBER`}"-->
android:textColor="@color/colorPrimary" <!-- android:textColor="@color/colorPrimary"-->
android:textSize="12sp" <!-- android:textSize="12sp"-->
android:textStyle="bold" <!-- android:textStyle="bold"-->
android:fontFamily="sans-serif-medium" <!-- android:fontFamily="sans-serif-medium"-->
android:textAlignment="center" <!-- android:textAlignment="center"-->
tools:text="CARD NUMBER" /> <!-- tools:text="CARD NUMBER" />-->
</LinearLayout> <!-- </LinearLayout>-->
<!-- Table Headers Row 2 --> <!-- &lt;!&ndash; Table Headers Row 2 &ndash;&gt;-->
<LinearLayout <!-- <LinearLayout-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:orientation="horizontal" <!-- android:orientation="horizontal"-->
android:paddingVertical="8dp" <!-- android:paddingVertical="8dp"-->
android:background="@color/colorPrimary" <!-- android:background="@color/colorPrimary"-->
android:alpha="0.1"> <!-- android:alpha="0.1">-->
<TextView <!-- <TextView-->
android:layout_width="0dp" <!-- android:layout_width="0dp"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:layout_weight="1" <!-- android:layout_weight="1"-->
android:text="@string/txt_exp_date" <!-- android:text="@string/txt_exp_date"-->
android:textColor="@color/colorPrimary" <!-- android:textColor="@color/colorPrimary"-->
android:textSize="12sp" <!-- android:textSize="12sp"-->
android:textStyle="bold" <!-- android:textStyle="bold"-->
android:fontFamily="sans-serif-medium" <!-- android:fontFamily="sans-serif-medium"-->
android:textAlignment="center" /> <!-- android:textAlignment="center" />-->
<TextView <!-- <TextView-->
android:layout_width="0dp" <!-- android:layout_width="0dp"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:layout_weight="1" <!-- android:layout_weight="1"-->
android:text="@string/txt_trace_no" <!-- android:text="@string/txt_trace_no"-->
android:textColor="@color/colorPrimary" <!-- android:textColor="@color/colorPrimary"-->
android:textSize="12sp" <!-- android:textSize="12sp"-->
android:textStyle="bold" <!-- android:textStyle="bold"-->
android:fontFamily="sans-serif-medium" <!-- android:fontFamily="sans-serif-medium"-->
android:textAlignment="center" /> <!-- android:textAlignment="center" />-->
</LinearLayout> <!-- </LinearLayout>-->
<!-- Table Headers Row 3 --> <!-- &lt;!&ndash; Table Headers Row 3 &ndash;&gt;-->
<LinearLayout <!-- <LinearLayout-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:orientation="horizontal" <!-- android:orientation="horizontal"-->
android:paddingVertical="8dp" <!-- android:paddingVertical="8dp"-->
android:background="@color/colorPrimary" <!-- android:background="@color/colorPrimary"-->
android:alpha="0.1"> <!-- android:alpha="0.1">-->
<TextView <!-- <TextView-->
android:layout_width="0dp" <!-- android:layout_width="0dp"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:layout_weight="1" <!-- android:layout_weight="1"-->
android:text="@string/txt_transaction" <!-- android:text="@string/txt_transaction"-->
android:textColor="@color/colorPrimary" <!-- android:textColor="@color/colorPrimary"-->
android:textSize="12sp" <!-- android:textSize="12sp"-->
android:textStyle="bold" <!-- android:textStyle="bold"-->
android:fontFamily="sans-serif-medium" <!-- android:fontFamily="sans-serif-medium"-->
android:textAlignment="center" /> <!-- android:textAlignment="center" />-->
<TextView <!-- <TextView-->
android:layout_width="0dp" <!-- android:layout_width="0dp"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:layout_weight="1" <!-- android:layout_weight="1"-->
android:text="@string/txt_amount" <!-- android:text="@string/txt_amount"-->
android:textColor="@color/colorPrimary" <!-- android:textColor="@color/colorPrimary"-->
android:textSize="12sp" <!-- android:textSize="12sp"-->
android:textStyle="bold" <!-- android:textStyle="bold"-->
android:fontFamily="sans-serif-medium" <!-- android:fontFamily="sans-serif-medium"-->
android:textAlignment="center" /> <!-- android:textAlignment="center" />-->
</LinearLayout> <!-- </LinearLayout>-->
<!-- Table Headers Row 4 --> <!-- &lt;!&ndash; Table Headers Row 4 &ndash;&gt;-->
<LinearLayout <!-- <LinearLayout-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:orientation="horizontal" <!-- android:orientation="horizontal"-->
android:paddingVertical="8dp" <!-- android:paddingVertical="8dp"-->
android:background="@color/colorPrimary" <!-- android:background="@color/colorPrimary"-->
android:alpha="0.1"> <!-- android:alpha="0.1">-->
<TextView <!-- <TextView-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:text="@{sharedViewModel.hostType == HostType.QR ? `WAVE TRXN ID`:`REF NUM`}" <!-- android:text="@{sharedViewModel.hostType == HostType.QR ? `WAVE TRXN ID`:`REF NUM`}"-->
android:textColor="@color/colorPrimary" <!-- android:textColor="@color/colorPrimary"-->
android:textSize="12sp" <!-- android:textSize="12sp"-->
android:textStyle="bold" <!-- android:textStyle="bold"-->
android:fontFamily="sans-serif-medium" <!-- android:fontFamily="sans-serif-medium"-->
android:textAlignment="center" <!-- android:textAlignment="center"-->
tools:text="REF NUM" /> <!-- tools:text="REF NUM" />-->
</LinearLayout> <!-- </LinearLayout>-->
</LinearLayout> <!-- </LinearLayout>-->
<!-- Dotted Divider --> <!-- Dotted Divider -->
<View <View
@ -337,116 +338,116 @@
tools:listitem="@layout/item_view_detail_report" /> tools:listitem="@layout/item_view_detail_report" />
<!-- Report Summary --> <!-- Report Summary -->
<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:layout_marginTop="24dp" <!-- android:layout_marginTop="24dp"-->
android:padding="16dp" <!-- android:padding="16dp"-->
android:background="@color/colorPrimary" <!-- android:background="@color/colorPrimary"-->
android:alpha="0.1"> <!-- android:alpha="0.1">-->
<!-- Summary Title --> <!-- &lt;!&ndash; Summary Title &ndash;&gt;-->
<TextView <!-- <TextView-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:text="@{manageViewModel.hostTypeDR}" <!-- android:text="@{manageViewModel.hostTypeDR}"-->
android:textAlignment="center" <!-- android:textAlignment="center"-->
android:textColor="@color/colorPrimary" <!-- android:textColor="@color/colorPrimary"-->
android:textSize="18sp" <!-- android:textSize="18sp"-->
android:textStyle="bold" <!-- android:textStyle="bold"-->
android:fontFamily="sans-serif-medium" <!-- android:fontFamily="sans-serif-medium"-->
android:layout_marginBottom="16dp" <!-- android:layout_marginBottom="16dp"-->
tools:text="MPU" /> <!-- tools:text="MPU" />-->
<!-- Summary Row --> <!-- &lt;!&ndash; Summary Row &ndash;&gt;-->
<LinearLayout <!-- <LinearLayout-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:orientation="horizontal"> <!-- android:orientation="horizontal">-->
<TextView <!-- <TextView-->
android:layout_width="0dp" <!-- android:layout_width="0dp"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:layout_weight="2" <!-- android:layout_weight="2"-->
android:text="@{sharedViewModel.hostType == HostType.QR ? `TYPE`:`CARD TYPE`}" <!-- android:text="@{sharedViewModel.hostType == HostType.QR ? `TYPE`:`CARD TYPE`}"-->
android:textColor="@color/colorPrimary" <!-- android:textColor="@color/colorPrimary"-->
android:textSize="14sp" <!-- android:textSize="14sp"-->
android:textStyle="bold" <!-- android:textStyle="bold"-->
android:fontFamily="sans-serif-medium" <!-- android:fontFamily="sans-serif-medium"-->
android:textAlignment="textStart" <!-- android:textAlignment="textStart"-->
tools:text="CARD TYPE" /> <!-- tools:text="CARD TYPE" />-->
<TextView <!-- <TextView-->
android:layout_width="0dp" <!-- android:layout_width="0dp"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:layout_weight="1" <!-- android:layout_weight="1"-->
android:text="@string/txt_title_count" <!-- android:text="@string/txt_title_count"-->
android:textColor="@color/colorPrimary" <!-- android:textColor="@color/colorPrimary"-->
android:textSize="14sp" <!-- android:textSize="14sp"-->
android:textStyle="bold" <!-- android:textStyle="bold"-->
android:fontFamily="sans-serif-medium" <!-- android:fontFamily="sans-serif-medium"-->
android:textAlignment="center" /> <!-- android:textAlignment="center" />-->
<TextView <!-- <TextView-->
android:layout_width="0dp" <!-- android:layout_width="0dp"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:layout_weight="2" <!-- android:layout_weight="2"-->
android:text="@string/txt_amount" <!-- android:text="@string/txt_amount"-->
android:textColor="@color/colorPrimary" <!-- android:textColor="@color/colorPrimary"-->
android:textSize="14sp" <!-- android:textSize="14sp"-->
android:textStyle="bold" <!-- android:textStyle="bold"-->
android:fontFamily="sans-serif-medium" <!-- android:fontFamily="sans-serif-medium"-->
android:textAlignment="textEnd" /> <!-- android:textAlignment="textEnd" />-->
</LinearLayout> <!-- </LinearLayout>-->
<!-- Summary Data Row --> <!-- &lt;!&ndash; Summary Data Row &ndash;&gt;-->
<LinearLayout <!-- <LinearLayout-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:orientation="horizontal" <!-- android:orientation="horizontal"-->
android:layout_marginTop="8dp"> <!-- android:layout_marginTop="8dp">-->
<TextView <!-- <TextView-->
android:layout_width="0dp" <!-- android:layout_width="0dp"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:layout_weight="2" <!-- android:layout_weight="2"-->
android:text="@{manageViewModel.cardTypeDR}" <!-- android:text="@{manageViewModel.cardTypeDR}"-->
android:textColor="@color/colorPrimary" <!-- android:textColor="@color/colorPrimary"-->
android:textSize="16sp" <!-- android:textSize="16sp"-->
android:textStyle="bold" <!-- android:textStyle="bold"-->
android:fontFamily="sans-serif-medium" <!-- android:fontFamily="sans-serif-medium"-->
android:textAlignment="textStart" <!-- android:textAlignment="textStart"-->
tools:text="MPU" /> <!-- tools:text="MPU" />-->
<TextView <!-- <TextView-->
android:layout_width="0dp" <!-- android:layout_width="0dp"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:layout_weight="1" <!-- android:layout_weight="1"-->
android:text="@{manageViewModel.trnxCountDR}" <!-- android:text="@{manageViewModel.trnxCountDR}"-->
android:textColor="@color/colorPrimary" <!-- android:textColor="@color/colorPrimary"-->
android:textSize="16sp" <!-- android:textSize="16sp"-->
android:textStyle="bold" <!-- android:textStyle="bold"-->
android:fontFamily="monospace" <!-- android:fontFamily="monospace"-->
android:textAlignment="center" <!-- android:textAlignment="center"-->
tools:text="5" /> <!-- tools:text="5" />-->
<TextView <!-- <TextView-->
android:layout_width="0dp" <!-- android:layout_width="0dp"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:layout_weight="2" <!-- android:layout_weight="2"-->
android:text="@{`MMK ` + POSUtil.getInstance().getDecimalAmountFormat(manageViewModel.totalAmountDR)}" <!-- android:text="@{`MMK ` + POSUtil.getInstance().getDecimalAmountFormat(manageViewModel.totalAmountDR)}"-->
android:textColor="@color/colorPrimary" <!-- android:textColor="@color/colorPrimary"-->
android:textSize="16sp" <!-- android:textSize="16sp"-->
android:textStyle="bold" <!-- android:textStyle="bold"-->
android:fontFamily="sans-serif-medium" <!-- android:fontFamily="sans-serif-medium"-->
android:textAlignment="textEnd" <!-- android:textAlignment="textEnd"-->
tools:text="MMK 10,000.00" /> <!-- tools:text="MMK 10,000.00" />-->
</LinearLayout> <!-- </LinearLayout>-->
</LinearLayout> <!-- </LinearLayout>-->
</LinearLayout> </LinearLayout>
@ -464,7 +465,7 @@
android:orientation="horizontal" android:orientation="horizontal"
android:padding="16dp" android:padding="16dp"
android:paddingBottom="24dp" android:paddingBottom="24dp"
android:visibility="@{manageViewModel.detailReportBottomLayoutVisibility}" android:visibility="@{sharedViewModel.printerDisabled ? View.GONE : manageViewModel.detailReportBottomLayoutVisibility}"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"> app:layout_constraintStart_toStartOf="parent">