feat: #refs 6861 reservas

This commit is contained in:
Sergio De la torre 2024-09-19 13:00:09 +02:00
parent 2c42f3b54b
commit 746972d226
5 changed files with 127 additions and 129 deletions

View File

@ -13,8 +13,8 @@ android {
applicationId "es.verdnatura" applicationId "es.verdnatura"
minSdkVersion 26 minSdkVersion 26
targetSdkVersion 33 // se deja con target si no Play Protect la bloquea targetSdkVersion 33 // se deja con target si no Play Protect la bloquea
versionCode 326 versionCode 330
versionName = "24.36Beta" versionName = "24.38Beta"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }

View File

@ -12,9 +12,8 @@ import java.util.Calendar
fun CollectionVO.map(context: Context): CollectionVO { fun CollectionVO.map(context: Context): CollectionVO {
try { try {
this.tickets.forEach { ticket -> this.tickets.forEach { ticket ->
// if (ticket.sales.size>0){ // if (ticket.sales.size>0){
ticket.sales.forEach { ticket.sales.forEach {
it.ticketFk = ticket.ticketFk it.ticketFk = ticket.ticketFk
it.level = ticket.level it.level = ticket.level
@ -22,11 +21,10 @@ fun CollectionVO.map(context: Context): CollectionVO {
it.salePersonFk = ticket.salesPersonFk it.salePersonFk = ticket.salesPersonFk
it.agencyName = ticket.agencyName it.agencyName = ticket.agencyName
it.isNew = it.isAdded == "1" it.isNew = it.isAdded == "1"
it.code = it.cel3
it.code= it.cel3
it.quantity = it.quantity!!.toInt() it.quantity = it.quantity!!.toInt()
it.originalQuantity = it.originalQuantity!!.toInt() it.originalQuantity = it.originalQuantity!!.toInt()
if (it.originalQuantity==-1) it.originalQuantity = it.quantity if (it.originalQuantity == -1) it.originalQuantity = it.quantity
it.pickedQuantity = it.pickedQuantity =
if (it.isPrepared == "1" || it.isPreviousPrepared == "1" || it.isControlled == "1") it.quantity else it.pickedQuantity if (it.isPrepared == "1" || it.isPreviousPrepared == "1" || it.isControlled == "1") it.quantity else it.pickedQuantity
if (!it.placements.isNullOrEmpty()) { if (!it.placements.isNullOrEmpty()) {
@ -39,7 +37,7 @@ fun CollectionVO.map(context: Context): CollectionVO {
} }
} }
placement.created = placement.created =
getCalendarFromDate(placement.created,context).convertToDateString() getCalendarFromDate(placement.created, context).convertToDateString()
placement.visible = placement.visible =
"(" + (if (placement.visible.toInt() > 0) placement.visible else "0") + ")" "(" + (if (placement.visible.toInt() > 0) placement.visible else "0") + ")"
} }
@ -47,7 +45,6 @@ fun CollectionVO.map(context: Context): CollectionVO {
it.placements = listOf() it.placements = listOf()
} }
} }
}//} }//}
} catch (e: Exception) { } catch (e: Exception) {
@ -66,11 +63,11 @@ fun CollectionVO.map(context: Context): CollectionVO {
fun CollectionTicket.map(context: Context): CollectionTicket { fun CollectionTicket.map(context: Context): CollectionTicket {
try { try {
this.tickets.forEach { ticket -> this.tickets.forEach { ticket ->
ticket.sales.forEach { ticket.sales.forEach {
it.level = ticket.level?:"" it.level = ticket.level ?: ""
it.rgb = ticket.rgb?:""} it.rgb = ticket.rgb ?: ""
}
} }
} catch (e: Exception) { } catch (e: Exception) {
@ -78,25 +75,26 @@ fun CollectionTicket.map(context: Context): CollectionTicket {
if (this.tickets.isNullOrEmpty()) { if (this.tickets.isNullOrEmpty()) {
this.errorMessage = context.getString(R.string.collectionNoTicketsError) this.errorMessage = context.getString(R.string.collectionNoTicketsError)
} else { } else {
this.errorMessage = this.errorMessage =
context.getString(R.string.collectionErrorBuilding) + ".Revisa el sector por si acaso" context.getString(R.string.collectionErrorBuilding) + context.getString(R.string.reviewSector)
} }
} }
return this return this
} }
private fun getCalendarFromDate(date: String,context:Context): Calendar {
private fun getCalendarFromDate(date: String, context: Context): Calendar {
val sdf = SimpleDateFormat(context.getString(R.string.dateFormat)) val sdf = SimpleDateFormat(context.getString(R.string.dateFormat))
val cal = Calendar.getInstance() val cal = Calendar.getInstance()
cal.time = sdf.parse(date)!! cal.time = sdf.parse(date)!!
return cal return cal
} }
// para cuando se pase a Salix el modelo // para cuando se pase a Salix el modelo
//Tarea 5134 //Tarea 5134
fun PlacementSupplyVO.proposal(context: Context): PlacementSupplyVO { fun PlacementSupplyVO.proposal(context: Context): PlacementSupplyVO {
try { try {
}catch (ex:Exception){ } catch (ex: Exception) {
} }
return this return this
} }

View File

@ -199,10 +199,10 @@ class SectorCollectionReserveFragment(
isPlayed = true, isPlayed = true,
isToasted = true isToasted = true
) )
listSalesGroup.removeAt(0) // listSalesGroup.removeAt(0)
} }
listSaleGroupAdapter!!.notifyItemChanged(0) // listSaleGroupAdapter!!.notifyItemChanged(0)
} }
customDialogList.setValue("") customDialogList.setValue("")
ma.hideKeyboard(customDialogList.getEditText()) ma.hideKeyboard(customDialogList.getEditText())
@ -359,7 +359,8 @@ class SectorCollectionReserveFragment(
if (::customDialogList.isInitialized) customDialogList.dismiss() if (::customDialogList.isInitialized) customDialogList.dismiss()
ma.onPasillerosItemClickListener( ma.onPasillerosItemClickListener(
PasillerosItemVO(title =R.string.preitempickertestMayus), entryPoint = collectionFk.toString() PasillerosItemVO(title = R.string.preitempickertestMayus),
entryPoint = collectionFk.toString()
) )
// onBack = true // onBack = true
} }

View File

@ -32,8 +32,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:visibility="visible" android:visibility="visible" />
/>
<LinearLayout <LinearLayout
@ -45,95 +44,93 @@
android:textColor="@color/verdnatura_black"> android:textColor="@color/verdnatura_black">
<TextView
android:id="@+id/levelTxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/layout_margin_minest"
android:text="@string/level"
android:textColor="@color/verdnatura_black"
android:textSize="@dimen/h8" />
<TextView <TextView
android:id="@+id/levelTxt" android:id="@+id/level"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/layout_margin_minest"
android:text="@{sale.level}"
android:textColor="@color/verdnatura_black"
android:textSize="@dimen/h8"
android:textStyle="bold"
tool:text="2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/layout_margin_minest"
android:text="@string/ticketAbb"
android:textColor="@color/verdnatura_black"
android:textSize="@dimen/h8" />
<TextView
android:id="@+id/ticketFk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{Integer.toString(sale.ticketFk)}"
android:textColor="@color/verdnatura_black"
android:textSize="@dimen/h8"
android:textStyle="bold"
tool:text="123456789"
/>
<View
android:id="@+id/item_ticket_color"
android:layout_width="@dimen/semaforo_next_to_ticket"
android:layout_height="@dimen/semaforo_next_to_ticket"
android:layout_gravity="center"
android:layout_marginStart="1dp"
android:background="@drawable/background_and_round_collection_fragment" />
<TextView
android:id="@+id/previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/layout_margin_minest"
android:text=""
android:textColor="@color/verdnatura_black"
android:textSize="@dimen/h9"
android:textStyle="bold"
tool:text="PREV:"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/ivArrow"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentEnd="true"
android:layout_marginEnd="20dp"
android:contentDescription="@string/previousCollected"
android:rotation="180"
android:src="@drawable/ic_arrow_down" />
<ImageView
android:id="@+id/imageErrorMessage"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/layout_margin_minest"
android:text="@string/level"
android:textColor="@color/verdnatura_black"
android:textSize="@dimen/h8" />
<TextView
android:id="@+id/level"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/layout_margin_minest"
android:text="@{sale.level}"
android:textColor="@color/verdnatura_black"
android:textSize="@dimen/h8"
android:textStyle="bold"
tool:text="2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/layout_margin_minest"
android:text="@string/ticketAbb"
android:textColor="@color/verdnatura_black"
android:textSize="@dimen/h8" />
<TextView
android:id="@+id/ticketFk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{Integer.toString(sale.ticketFk)}"
android:textColor="@color/verdnatura_black"
android:textSize="@dimen/h8"
android:textStyle="bold"
tool:text="123456789"
/>
<View
android:id="@+id/item_ticket_color"
android:layout_width="@dimen/semaforo_next_to_ticket"
android:layout_height="@dimen/semaforo_next_to_ticket"
android:layout_gravity="center"
android:layout_marginStart="1dp"
android:background="@drawable/background_and_round_collection_fragment" />
<TextView
android:id="@+id/previous"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:layout_marginStart="@dimen/layout_margin_minest"
android:textColor="@color/verdnatura_black"
android:textSize="@dimen/h9"
android:textStyle="bold"
tool:text="PREV:"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal"> android:layout_alignParentEnd="true"
android:contentDescription="@string/error"
<ImageView app:srcCompat="@drawable/emoticon_error_fragment" />
android:id="@+id/ivArrow"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentEnd="true"
android:layout_marginEnd="20dp"
android:rotation="180"
android:src="@drawable/ic_arrow_down"
android:contentDescription="@string/previousCollected"/>
<ImageView
android:id="@+id/imageErrorMessage"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
app:srcCompat="@drawable/emoticon_error_fragment"
android:contentDescription="@string/error"/>
</RelativeLayout>
</RelativeLayout>
</LinearLayout> </LinearLayout>
@ -144,13 +141,14 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal" android:baselineAligned="false"
android:baselineAligned="false"> android:orientation="horizontal">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/content_layout" android:id="@+id/content_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/verdnatura_black" android:background="@color/verdnatura_black"
android:paddingTop="@dimen/layout_margin_min" android:paddingTop="@dimen/layout_margin_min"
android:paddingBottom="@dimen/layout_margin_min"> android:paddingBottom="@dimen/layout_margin_min">
@ -159,8 +157,8 @@
<LinearLayout <LinearLayout
android:id="@+id/infoSale" android:id="@+id/infoSale"
android:layout_width="250dp" android:layout_width="240dp"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
@ -168,14 +166,14 @@
<LinearLayout <LinearLayout
android:id="@+id/linearLayoutItem" android:id="@+id/linearLayoutItem"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="20dp" android:layout_height="25dp"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="@dimen/layout_margin_prepicker">
<TextView <TextView
android:id="@+id/item_parking_code" android:id="@+id/item_parking_code"
@ -206,21 +204,19 @@
tool:text="25 x 5" /> tool:text="25 x 5" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/linearLayoutLongItem" android:id="@+id/linearLayoutLongItem"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="20dp" android:layout_height="@dimen/layout_margin_prepicker"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintTop_toBottomOf="@+id/linearLayoutItem"> app:layout_constraintTop_toBottomOf="@+id/linearLayoutItem">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="25dp">
<TextView <TextView
android:id="@+id/item_code" android:id="@+id/item_code"
@ -252,13 +248,13 @@
<LinearLayout <LinearLayout
android:id="@+id/linearLayoutItemOrigin" android:id="@+id/linearLayoutItemOrigin"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="20dp" android:layout_height="25dp"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintTop_toBottomOf="@+id/linearLayoutLongItem"> app:layout_constraintTop_toBottomOf="@+id/linearLayoutLongItem">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="@dimen/layout_margin_prepicker">
<TextView <TextView
android:id="@+id/item_article_itemFkNew" android:id="@+id/item_article_itemFkNew"
@ -272,6 +268,7 @@
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textSize="@dimen/bodyPicker" android:textSize="@dimen/bodyPicker"
tool:text="123456" /> tool:text="123456" />
<TextView <TextView
android:id="@+id/item_article_colour" android:id="@+id/item_article_colour"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -317,7 +314,7 @@
<LinearLayout <LinearLayout
android:id="@+id/linearLayoutItemColor" android:id="@+id/linearLayoutItemColor"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="20dp" android:layout_height="@dimen/layout_margin_prepicker"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintTop_toBottomOf="@+id/linearLayoutItemOrigin"> app:layout_constraintTop_toBottomOf="@+id/linearLayoutItemOrigin">
@ -376,15 +373,15 @@
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintEnd_toStartOf="@+id/linearLayoutColor" app:layout_constraintEnd_toStartOf="@+id/linearLayoutColor"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent">
>
<TextView <TextView
android:id="@+id/packingTopicker" android:id="@+id/packingTopicker"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:textSize="26sp"
android:gravity="end" android:gravity="end"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textSize="26sp"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
</TextView> </TextView>
@ -397,17 +394,18 @@
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginStart="50dp" android:layout_marginStart="50dp"
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@+id/linearLayoutRight"
app:layout_constraintEnd_toStartOf="@+id/linearLayoutColor" app:layout_constraintEnd_toStartOf="@+id/linearLayoutColor"
app:layout_constraintTop_toBottomOf="@+id/linearLayoutRight"
tool:layout_editor_absoluteY="4dp"> tool:layout_editor_absoluteY="4dp">
<TextView <TextView
android:id="@+id/selectToPicker" android:id="@+id/selectToPicker"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:textSize="22sp"
android:gravity="start" android:gravity="start"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textSize="21sp"
tools:text="11/22"> tools:text="11/22">
</TextView> </TextView>
@ -416,11 +414,11 @@
android:id="@+id/quantityReserved" android:id="@+id/quantityReserved"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.30" android:layout_marginEnd="5dp"
android:textSize="22sp" android:layout_weight="0.4"
android:gravity="end" android:gravity="end"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:layout_marginEnd="5dp" android:textSize="21sp"
tool:text="2000/3000"> tool:text="2000/3000">
</TextView> </TextView>
@ -445,8 +443,8 @@
android:layout_width="@dimen/semaforo_width" android:layout_width="@dimen/semaforo_width"
android:layout_height="@dimen/ticketColor_height" android:layout_height="@dimen/ticketColor_height"
android:layout_marginBottom="1dp" android:layout_marginBottom="1dp"
android:visibility="invisible" android:background="@drawable/border"
android:background="@drawable/border" /> android:visibility="invisible" />
</LinearLayout> </LinearLayout>
@ -472,7 +470,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:background="@color/verdnatura_white"/> android:background="@color/verdnatura_white" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/item_article_placements" android:id="@+id/item_article_placements"

View File

@ -20,6 +20,7 @@
<dimen name="layout_margin_7">64dp</dimen> <dimen name="layout_margin_7">64dp</dimen>
<dimen name="layout_margin_8">72dp</dimen> <dimen name="layout_margin_8">72dp</dimen>
<dimen name="layout_margin_12">104dp</dimen> <dimen name="layout_margin_12">104dp</dimen>
<dimen name="layout_margin_prepicker">25dp</dimen>
<dimen name="layout_margin_min_dynamic">64dp</dimen> <dimen name="layout_margin_min_dynamic">64dp</dimen>
<dimen name="layout_height_dynamic">36dp</dimen> <dimen name="layout_height_dynamic">36dp</dimen>