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

View File

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