<?xml version="1.0" encoding="utf-8"?>

<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <data>

        <import type="it.integry.integrywmsnative.core.utility.UtilityString" />

        <import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />

        <import type="it.integry.integrywmsnative.core.utility.UtilityBigDecimal" />

        <import type="android.view.View" />

        <import type="it.integry.integrywmsnative.R" />

        <import type="androidx.core.content.ContextCompat" />

        <variable
            name="viewmodel"
            type="it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2ViewModel" />

        <variable
            name="view"
            type="it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View" />
    </data>

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/full_white"
            android:orientation="vertical">

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?attr/colorPrimary"
                android:minHeight="?attr/actionBarSize"
                app:titleTextColor="@android:color/white">


            </androidx.appcompat.widget.Toolbar>


            <ScrollView
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <androidx.appcompat.widget.LinearLayoutCompat
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="8dp"
                    android:layout_marginTop="8dp"
                    android:orientation="vertical">

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp">

                        <androidx.appcompat.widget.AppCompatTextView
                            style="@style/AppTheme.NewMaterial.Dialog.DialogTitleText"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_alignParentStart="true"
                            android:layout_toStartOf="@id/unt_mis"
                            android:ellipsize="end"
                            android:text="@{viewmodel.mtbAart.codMart}"
                            android:textColor="@color/colorPrimary"
                            tools:text="COD MART (Partita mag)" />

                        <androidx.appcompat.widget.AppCompatTextView
                            android:id="@+id/unt_mis"
                            style="@style/AppTheme.NewMaterial.Dialog.DialogTitleText"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_alignParentEnd="true"
                            android:ellipsize="end"
                            android:text="@{viewmodel.mtbAart.untMis}"
                            android:textColor="@color/colorPrimary"
                            android:visibility="@{viewmodel.mtbAart.untMis != null ? View.VISIBLE : View.GONE}"
                            tools:text="UM" />

                    </RelativeLayout>


                    <androidx.appcompat.widget.AppCompatTextView
                        style="@style/AppTheme.NewMaterial.Dialog.DialogSubTitleText"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:ellipsize="end"
                        android:text="@{viewmodel.mtbAart.diacod}"
                        android:textColor="@color/red_600"
                        android:visibility="@{UtilityString.isNullOrEmpty(viewmodel.mtbAart.diacod) ? View.GONE : View.VISIBLE}"
                        tools:text="DIACOD" />

                    <androidx.appcompat.widget.AppCompatTextView
                        style="@style/AppTheme.NewMaterial.Text.Small"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="4dp"
                        android:singleLine="false"
                        android:text="@{viewmodel.mtbAart.descrizioneEstesa}"
                        tools:text="RAD 25 D H/L 200 - 10 EL B BIANCO" />


                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp"
                        android:visibility="@{viewmodel.totalNumCnfOrd != null || viewmodel.totalQtaOrd != null ? View.VISIBLE : View.GONE}">


                        <androidx.appcompat.widget.AppCompatTextView
                            style="@style/AppTheme.NewMaterial.Text.Medium"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_toStartOf="@id/qta_ord_panel"
                            android:text="@string/total_ordered"
                            android:textColor="@android:color/black" />

                        <androidx.appcompat.widget.LinearLayoutCompat
                            android:id="@+id/qta_ord_panel"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_alignParentEnd="true"
                            android:orientation="horizontal">

                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="@{UtilityNumber.decimalToString(viewmodel.totalNumCnfOrd)}"
                                android:textColor="@android:color/black"
                                android:textStyle="bold" />

                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_alignParentEnd="true"
                                android:layout_marginStart="4dp"
                                android:text="@string/unt_mis_col"
                                android:textColor="@android:color/black"
                                android:textStyle="bold" />


                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_alignParentEnd="true"
                                android:layout_marginStart="4dp"
                                android:text="("
                                android:textColor="@android:color/black"
                                android:textStyle="bold" />

                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="0dp"
                                android:text="@{UtilityNumber.decimalToString(viewmodel.totalQtaOrd)}"
                                android:textColor="@android:color/black"
                                android:textStyle="bold" />

                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_alignParentEnd="true"
                                android:layout_marginStart="2dp"
                                android:text="@{viewmodel.mtbAart.untMis}"
                                android:textColor="@android:color/black"
                                android:textStyle="bold" />

                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_alignParentEnd="true"
                                android:layout_marginStart="0dp"
                                android:text=")"
                                android:textColor="@android:color/black"
                                android:textStyle="bold" />


                        </androidx.appcompat.widget.LinearLayoutCompat>


                    </RelativeLayout>

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:layout_marginTop="2dp"
                        android:gravity="center"
                        android:visibility="@{view.flagShowCnfToTakeLabel &amp;&amp; (view.currentTextNumCnfToTake > 0 || view.currentTextNumPezziToTake > 0) ? View.VISIBLE : View.GONE}">


                        <androidx.appcompat.widget.LinearLayoutCompat
                            android:id="@+id/qta_ord_text_panel"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:background="@drawable/badge_round_corner"
                            android:backgroundTint="@color/light_blue_100"
                            android:gravity="center"
                            android:orientation="horizontal"
                            android:paddingHorizontal="12dp"
                            android:paddingVertical="4dp">

                            <androidx.appcompat.widget.AppCompatImageView
                                android:layout_width="20dp"
                                android:layout_height="20dp"
                                android:src="@drawable/ic_info_78dp"
                                android:tint="@color/gray_600" />

                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="4dp"
                                android:text="@{view.currentTextNumCnfToTake.toString()}"
                                android:textColor="@color/gray_600"
                                android:textStyle="bold"
                                android:visibility="@{view.currentTextNumCnfToTake > 0 ? View.VISIBLE : View.GONE}"
                                tools:text="1" />

                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_alignParentEnd="true"
                                android:layout_marginStart="4dp"
                                android:text="@{@plurals/item_package(view.currentTextNumCnfToTake)}"
                                android:textColor="@color/gray_600"
                                android:textStyle="bold"
                                android:visibility="@{view.currentTextNumCnfToTake > 0 ? View.VISIBLE : View.GONE}"
                                tools:text="conf" />


                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_alignParentEnd="true"
                                android:layout_marginStart="4dp"
                                android:text="e"
                                android:textColor="@color/gray_600"
                                android:visibility="@{view.currentTextNumPezziToTake > 0 &amp;&amp; view.currentTextNumCnfToTake > 0 ? View.VISIBLE : View.GONE}" />

                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="4dp"
                                android:text="@{view.currentTextNumPezziToTake.toString()}"
                                android:textColor="@color/gray_600"
                                android:textStyle="bold"
                                android:visibility="@{view.currentTextNumPezziToTake > 0 ? View.VISIBLE : View.GONE}"
                                tools:text="4" />

                            <androidx.appcompat.widget.AppCompatTextView
                                style="@style/AppTheme.NewMaterial.Text.Medium"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_alignParentEnd="true"
                                android:layout_marginStart="2dp"
                                android:text="@{@plurals/pieces(view.currentTextNumPezziToTake)}"
                                android:textAllCaps="false"
                                android:textColor="@color/gray_600"
                                android:textStyle="bold"
                                android:visibility="@{view.currentTextNumPezziToTake > 0 ? View.VISIBLE : View.GONE}"
                                tools:text="Pezzi" />


                        </androidx.appcompat.widget.LinearLayoutCompat>

                    </RelativeLayout>


                    <androidx.appcompat.widget.LinearLayoutCompat
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:weightSum="1">

                        <androidx.appcompat.widget.LinearLayoutCompat
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:layout_marginEnd="2dp"
                            android:layout_weight="0.5"
                            android:background="@drawable/badge_round_corner"
                            android:backgroundTint="@color/light_blue_100"
                            android:orientation="vertical"
                            android:paddingHorizontal="8dp"
                            android:paddingVertical="4dp"
                            android:visibility="@{viewmodel.totalNumCnfInWarehouse != null || viewmodel.totalQtaInWarehouse != null ? View.VISIBLE : View.GONE}">


                            <androidx.appcompat.widget.AppCompatTextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:text="@string/in_warehouse"
                                android:textColor="@color/gray_600" />

                            <androidx.appcompat.widget.LinearLayoutCompat
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:orientation="horizontal">

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Medium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="@{UtilityNumber.decimalToString(viewmodel.totalNumCnfInWarehouse, 1)}"
                                    android:textColor="@color/gray_600"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Medium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="4dp"
                                    android:text="@string/unt_mis_col"
                                    android:textColor="@color/gray_600"
                                    android:textStyle="bold" />


                            </androidx.appcompat.widget.LinearLayoutCompat>


                            <androidx.appcompat.widget.LinearLayoutCompat
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:orientation="horizontal">


                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="4dp"
                                    android:text="("
                                    android:textColor="@color/gray_600"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginStart="0dp"
                                    android:text="@{UtilityNumber.decimalToString(viewmodel.totalQtaInWarehouse, 2)}"
                                    android:textColor="@color/gray_600"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="2dp"
                                    android:text="@{viewmodel.mtbAart.untMis}"
                                    android:textColor="@color/gray_600"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="0dp"
                                    android:text=")"
                                    android:textColor="@color/gray_600"
                                    android:textStyle="bold" />

                            </androidx.appcompat.widget.LinearLayoutCompat>


                        </androidx.appcompat.widget.LinearLayoutCompat>

                        <androidx.appcompat.widget.LinearLayoutCompat
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:layout_marginStart="2dp"
                            android:layout_weight="0.5"
                            android:background="@drawable/badge_round_corner"
                            android:backgroundTint="@color/light_blue_100"
                            android:orientation="vertical"
                            android:paddingHorizontal="8dp"
                            android:paddingVertical="4dp"
                            android:visibility="@{viewmodel.totalNumCnfCommitted != null || viewmodel.totalQtaCommitted != null ? View.VISIBLE : View.GONE}">


                            <androidx.appcompat.widget.AppCompatTextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:text="@string/total_committed"
                                android:textColor="@color/gray_600" />

                            <androidx.appcompat.widget.LinearLayoutCompat
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:orientation="horizontal">

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Medium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="@{UtilityNumber.decimalToString(viewmodel.totalNumCnfCommitted, 1)}"
                                    android:textColor="@color/gray_600"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Medium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="4dp"
                                    android:text="@string/unt_mis_col"
                                    android:textColor="@color/gray_600"
                                    android:textStyle="bold" />

                            </androidx.appcompat.widget.LinearLayoutCompat>


                            <androidx.appcompat.widget.LinearLayoutCompat
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:orientation="horizontal">


                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="4dp"
                                    android:text="("
                                    android:textColor="@color/gray_600"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginStart="0dp"
                                    android:text="@{UtilityNumber.decimalToString(viewmodel.totalQtaCommitted, 2)}"
                                    android:textColor="@color/gray_600"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="2dp"
                                    android:text="@{viewmodel.mtbAart.untMis}"
                                    android:textColor="@color/gray_600"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="0dp"
                                    android:text=")"
                                    android:textColor="@color/gray_600"
                                    android:textStyle="bold" />


                            </androidx.appcompat.widget.LinearLayoutCompat>

                        </androidx.appcompat.widget.LinearLayoutCompat>


                    </androidx.appcompat.widget.LinearLayoutCompat>

                    <androidx.appcompat.widget.LinearLayoutCompat
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp"
                        android:gravity="center"
                        android:orientation="horizontal"
                        android:weightSum="1">

                        <androidx.appcompat.widget.LinearLayoutCompat
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:layout_marginEnd="2dp"
                            android:layout_weight="0.5"
                            android:background="@drawable/badge_round_corner"
                            android:backgroundTint="@color/green_600"
                            android:orientation="vertical"
                            android:padding="8dp"
                            android:visibility="@{viewmodel.totalNumCnfToBeTaken != null || viewmodel.totalQtaToBeTaken != null ? View.VISIBLE : View.GONE}">


                            <androidx.appcompat.widget.AppCompatTextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:text="@string/to_be_taken"
                                android:textColor="@android:color/white" />

                            <androidx.appcompat.widget.LinearLayoutCompat
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:orientation="horizontal">

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Medium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="@{UtilityNumber.decimalToString(viewmodel.totalNumCnfToBeTaken)}"
                                    android:textColor="@android:color/white"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Medium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="4dp"
                                    android:text="@string/unt_mis_col"
                                    android:textColor="@android:color/white"
                                    android:textStyle="bold" />


                            </androidx.appcompat.widget.LinearLayoutCompat>


                            <androidx.appcompat.widget.LinearLayoutCompat
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:orientation="horizontal">


                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="4dp"
                                    android:text="("
                                    android:textColor="@android:color/white"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginStart="0dp"
                                    android:text="@{UtilityNumber.decimalToString(viewmodel.totalQtaToBeTaken)}"
                                    android:textColor="@android:color/white"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="2dp"
                                    android:text="@{viewmodel.mtbAart.untMis}"
                                    android:textColor="@android:color/white"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="0dp"
                                    android:text=")"
                                    android:textColor="@android:color/white"
                                    android:textStyle="bold" />

                            </androidx.appcompat.widget.LinearLayoutCompat>


                        </androidx.appcompat.widget.LinearLayoutCompat>

                        <androidx.appcompat.widget.LinearLayoutCompat
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:layout_marginStart="2dp"
                            android:layout_weight="0.5"
                            android:background="@drawable/badge_round_corner"
                            android:backgroundTint="@color/colorPrimary"
                            android:orientation="vertical"
                            android:padding="8dp"
                            android:visibility="@{viewmodel.totalNumCnfAvailable != null || viewmodel.totalQtaAvailable != null ? View.VISIBLE : View.GONE}">


                            <androidx.appcompat.widget.AppCompatTextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:text="@string/total_available"
                                android:textColor="@android:color/white" />

                            <androidx.appcompat.widget.LinearLayoutCompat
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:orientation="horizontal">

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Medium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="@{UtilityNumber.decimalToString(viewmodel.totalNumCnfAvailable)}"
                                    android:textColor="@android:color/white"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Medium"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="4dp"
                                    android:text="@string/unt_mis_col"
                                    android:textColor="@android:color/white"
                                    android:textStyle="bold" />

                            </androidx.appcompat.widget.LinearLayoutCompat>


                            <androidx.appcompat.widget.LinearLayoutCompat
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:orientation="horizontal">


                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="4dp"
                                    android:text="("
                                    android:textColor="@android:color/white"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginStart="0dp"
                                    android:text="@{UtilityNumber.decimalToString(viewmodel.totalQtaAvailable)}"
                                    android:textColor="@android:color/white"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="2dp"
                                    android:text="@{viewmodel.mtbAart.untMis}"
                                    android:textColor="@android:color/white"
                                    android:textStyle="bold" />

                                <androidx.appcompat.widget.AppCompatTextView
                                    style="@style/AppTheme.NewMaterial.Text.Small"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentEnd="true"
                                    android:layout_marginStart="0dp"
                                    android:text=")"
                                    android:textColor="@android:color/white"
                                    android:textStyle="bold" />


                            </androidx.appcompat.widget.LinearLayoutCompat>

                        </androidx.appcompat.widget.LinearLayoutCompat>


                    </androidx.appcompat.widget.LinearLayoutCompat>

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:layout_marginTop="8dp"
                        android:layout_marginBottom="8dp"
                        android:background="@color/gray_400" />


                    <androidx.appcompat.widget.LinearLayoutCompat
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp"
                        android:orientation="horizontal"
                        android:weightSum="2">

                        <com.google.android.material.textfield.TextInputLayout
                            android:id="@+id/input_partita_mag_layout"
                            style="@style/TextInputLayout.OutlinePrimary"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="@{viewmodel.shouldAskDataScad || viewmodel.shouldShowDataScad ? 1f : 2f}"
                            android:enabled="@{view.enabledChangePartitaMag}"
                            android:paddingEnd="4dp"
                            android:visibility="@{viewmodel.canPartitaMagBeChanged() || viewmodel.partitaMag != null ? View.VISIBLE : View.GONE}"
                            tools:layout_weight="1">

                            <EditText
                                android:id="@+id/input_partita_mag_text"
                                style="@style/TextInputEditText.OutlinePrimary"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:hint="@string/batch_lot"
                                android:imeOptions="actionDone"
                                android:inputType="text"
                                app:binding="@{view.currentPartitaMag}" />

                        </com.google.android.material.textfield.TextInputLayout>

                        <com.google.android.material.textfield.TextInputLayout
                            android:id="@+id/input_data_scad_layout"
                            style="@style/TextInputLayout.OutlinePrimary"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:enabled="@{view.enabledChangePartitaMag}"
                            android:visibility="@{viewmodel.shouldAskDataScad || viewmodel.shouldShowDataScad ? View.VISIBLE : View.GONE}">

                            <EditText
                                android:id="@+id/input_data_scad_text"
                                style="@style/TextInputEditText.OutlinePrimary"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:focusableInTouchMode="false"
                                android:hint="@string/expire_date"
                                android:inputType="text"
                                app:binding="@{view.currentDataScad}"
                                app:parentView="@{view}"
                                app:warningOnOldDates="@{true}" />

                        </com.google.android.material.textfield.TextInputLayout>


                    </androidx.appcompat.widget.LinearLayoutCompat>

                    <androidx.appcompat.widget.LinearLayoutCompat
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp"
                        android:orientation="horizontal"
                        android:weightSum="3">

                        <com.google.android.material.textfield.TextInputLayout
                            android:id="@+id/input_num_cnf_layout"
                            style="@style/TextInputLayout.OutlinePrimary"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="@{!viewmodel.mtbAart.flagQtaCnfFissaBoolean ? 1f : 1.5f}"
                            android:enabled="@{view.enabledNumCnf}"
                            android:focusableInTouchMode="false"
                            android:paddingEnd="4dp"
                            tools:layout_weight="1">

                            <EditText
                                android:id="@+id/input_num_cnf_text"
                                style="@style/TextInputEditText.OutlinePrimary"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:hint="@string/num_pcks"
                                android:imeOptions="actionDone"
                                android:inputType="number"
                                android:nextFocusForward="@+id/input_qta_cnf_text"
                                android:selectAllOnFocus="true"
                                app:binding="@{view.currentNumCnf}" />

                        </com.google.android.material.textfield.TextInputLayout>

                        <com.google.android.material.textfield.TextInputLayout
                            android:id="@+id/input_qta_cnf_layout"
                            style="@style/TextInputLayout.OutlinePrimary"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:enabled="@{view.enabledQtaCnf}"
                            android:focusableInTouchMode="false"
                            android:paddingEnd="4dp"
                            android:visibility="@{!viewmodel.mtbAart.flagQtaCnfFissaBoolean ? View.VISIBLE : View.GONE}">

                            <EditText
                                android:id="@+id/input_qta_cnf_text"
                                style="@style/TextInputEditText.OutlinePrimary"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:hint="@string/qty_x_pck"
                                android:imeOptions="actionDone"
                                android:inputType="numberDecimal"
                                android:nextFocusForward="@+id/input_qta_tot_text"
                                android:selectAllOnFocus="true"
                                app:binding="@{view.currentQtaCnf}" />

                        </com.google.android.material.textfield.TextInputLayout>

                        <com.google.android.material.textfield.TextInputLayout
                            android:id="@+id/input_qta_tot_layout"
                            style="@style/TextInputLayout.OutlinePrimary"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="@{!viewmodel.mtbAart.flagQtaCnfFissaBoolean ? 1f : 1.5f}"
                            android:enabled="@{view.enabledQtaTot}"
                            android:focusableInTouchMode="false"
                            tools:layout_weight="1">

                            <EditText
                                android:id="@+id/input_qta_tot_text"
                                style="@style/TextInputEditText.OutlinePrimary"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:digits="0123456789"
                                android:hint="@string/tot_qty"
                                android:imeOptions="actionDone"
                                android:inputType="number"
                                android:selectAllOnFocus="true"
                                app:binding="@{view.currentQtaTot}" />

                        </com.google.android.material.textfield.TextInputLayout>


                    </androidx.appcompat.widget.LinearLayoutCompat>

                    <androidx.appcompat.widget.LinearLayoutCompat
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp"
                        android:orientation="horizontal"
                        android:visibility="@{viewmodel.mtbAart.isFlagQtaCnfFissaBoolean() ? View.GONE : View.VISIBLE}"
                        android:weightSum="3">

                        <com.google.android.material.textfield.TextInputLayout
                            android:id="@+id/input_tara_ped_layout"
                            style="@style/TextInputLayout.OutlinePrimary"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:enabled="false"
                            android:focusableInTouchMode="false"
                            android:paddingEnd="4dp"
                            tools:layout_weight="1">

                            <EditText
                                android:id="@+id/input_tara_ped_text"
                                style="@style/TextInputEditText.OutlinePrimary"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:enabled="false"
                                android:hint="@string/tare_art"
                                android:inputType="number"
                                android:textColor="@color/gray_400"
                                app:binding="@{view.currentTaraArticolo}" />

                        </com.google.android.material.textfield.TextInputLayout>

                        <com.google.android.material.textfield.TextInputLayout
                            android:id="@+id/input_tara_col_layout"
                            style="@style/TextInputLayout.OutlinePrimary"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:enabled="false"
                            android:focusableInTouchMode="false"
                            android:paddingEnd="4dp">

                            <EditText
                                android:id="@+id/input_tara_col_text"
                                style="@style/TextInputEditText.OutlinePrimary"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:enabled="false"
                                android:hint="@string/tare_pckg"
                                android:imeOptions="actionDone"
                                android:inputType="numberDecimal"
                                android:textColor="@color/gray_400"
                                app:binding="@{view.currentTaraTot}" />

                        </com.google.android.material.textfield.TextInputLayout>

                        <com.google.android.material.textfield.TextInputLayout
                            android:id="@+id/input_peso_lordo_layout"
                            style="@style/TextInputLayout.OutlinePrimary"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:enabled="@{view.enabledPesoLordo}"
                            android:focusableInTouchMode="false"
                            android:imeOptions="actionDone"
                            tools:enabled="false"
                            tools:layout_weight="1">

                            <EditText
                                android:id="@+id/input_peso_lordo_text"
                                style="@style/TextInputEditText.OutlinePrimary"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:hint="@string/LU_weight"
                                android:inputType="number"
                                android:textColor="@{ContextCompat.getColor(context, view.enabledQtaCnf ? android.R.color.black : R.color.gray_400)}"
                                app:binding="@{view.currentPesoLordo}" />

                        </com.google.android.material.textfield.TextInputLayout>


                    </androidx.appcompat.widget.LinearLayoutCompat>

                    <androidx.appcompat.widget.LinearLayoutCompat
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="8dp"
                        android:orientation="horizontal">

                        <com.google.android.material.textfield.TextInputLayout
                            android:id="@+id/input_note_layout"
                            style="@style/TextInputLayout.OutlinePrimary"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:enabled="@{view.enabledNotes}"
                            android:visibility="@{view.enabledNotes ? View.VISIBLE : View.GONE }">

                            <EditText
                                android:id="@+id/input_note_text"
                                style="@style/TextInputEditText.OutlinePrimary"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:hint="@string/hint_additional_notes"
                                android:inputType="textMultiLine"
                                app:binding="@{view.currentNotes}" />

                        </com.google.android.material.textfield.TextInputLayout>


                    </androidx.appcompat.widget.LinearLayoutCompat>

                    <androidx.appcompat.widget.LinearLayoutCompat
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="16dp"
                        android:gravity="center_horizontal"
                        android:orientation="horizontal"
                        android:weightSum="3">

                        <Button
                            style="@style/Widget.Material3.Button.OutlinedButton"
                            android:id="@+id/close_lu_btn"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="0dp"
                            android:layout_marginEnd="4dp"
                            android:layout_weight="1"
                            android:onClick="@{() -> view.saveAndCloseLU()}"
                            android:text="@string/action_close_ul"
                            app:strokeColor="@color/colorPrimary"
                            app:visibility="@{view.enabledLUCloseButton}" />


                        <Button
                            android:id="@+id/abort_btn"
                            style="@style/Button.DangerOutline"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="4dp"
                            android:layout_marginEnd="4dp"
                            android:layout_weight="1"
                            android:onClick="@{() -> view.dismiss()}"
                            android:text="@string/abort"
                            app:iconGravity="start" />


                        <Button
                            android:id="@+id/save_btn"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="4dp"
                            android:layout_marginEnd="0dp"
                            android:layout_weight="1"
                            android:onClick="@{() -> view.save()}"
                            android:text="@string/action_save"
                            app:icon="@drawable/ic_save_24"
                            app:iconGravity="start" />
                    </androidx.appcompat.widget.LinearLayoutCompat>

                </androidx.appcompat.widget.LinearLayoutCompat>
            </ScrollView>
        </LinearLayout>

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

</layout>