refs #6607 feat:checking_boxes

This commit is contained in:
Sergio De la torre 2024-03-06 13:27:33 +01:00
parent 8dd4a6dacf
commit bfcf7916b4
5 changed files with 87 additions and 49 deletions

View File

@ -116,17 +116,13 @@
</select>
</component>
<component name="ChangeListManager">
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #6964 refactor:settings">
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #6607 feat:checking_boxes">
<change afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivityViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/app/build.gradle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/dataStore/DataStoreLocal.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/dataStore/DataStoreLocal.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixService.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixService.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPickerNew.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPickerNew.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/pasillero/fragment/PasilleroViewModel.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/model/TicketItemVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/model/TicketItemVO.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/res/layout/item_article_row_fragment.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/item_article_row_fragment.xml" afterDir="false" />
</list>
@ -499,20 +495,6 @@
<option name="presentableId" value="Default" />
<updated>1618825571576</updated>
</task>
<task id="LOCAL-00224" summary="refs #5135 feat: refactor animation">
<created>1704786635795</created>
<option name="number" value="00224" />
<option name="presentableId" value="LOCAL-00224" />
<option name="project" value="LOCAL" />
<updated>1704786635795</updated>
</task>
<task id="LOCAL-00225" summary="refs #6275 feat: back to Salix (delivery)">
<created>1704786709770</created>
<option name="number" value="00225" />
<option name="presentableId" value="LOCAL-00225" />
<option name="project" value="LOCAL" />
<updated>1704786709770</updated>
</task>
<task id="LOCAL-00226" summary="refs #6276: prepare Salixback">
<created>1704786754497</created>
<option name="number" value="00226" />
@ -842,7 +824,21 @@
<option name="project" value="LOCAL" />
<updated>1709725610487</updated>
</task>
<option name="localTasksCounter" value="273" />
<task id="LOCAL-00273" summary="refs #6964 feat:hasOlderItem">
<created>1709725742258</created>
<option name="number" value="00273" />
<option name="presentableId" value="LOCAL-00273" />
<option name="project" value="LOCAL" />
<updated>1709725742258</updated>
</task>
<task id="LOCAL-00274" summary="version 24.8Beta">
<created>1709725795643</created>
<option name="number" value="00274" />
<option name="presentableId" value="LOCAL-00274" />
<option name="project" value="LOCAL" />
<updated>1709725795643</updated>
</task>
<option name="localTasksCounter" value="275" />
<servers />
</component>
<component name="Vcs.Log.History.Properties">
@ -888,13 +884,6 @@
</list>
</value>
</entry>
<entry key="text">
<value>
<list>
<option value="datastore" />
</list>
</value>
</entry>
</map>
</option>
<option name="COLUMN_ID_WIDTH">
@ -950,10 +939,6 @@
</component>
<component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="refs #6458 feat:showDialogChecker" />
<MESSAGE value="refs #5890 feat:itemShelving" />
<MESSAGE value="refs #6531feat:show last Tickets" />
<MESSAGE value="refs #6559feat:refactor get_sectors" />
<MESSAGE value="refs #6078feat:activityWorker" />
<MESSAGE value="refs #6531feat:showLastTickets" />
<MESSAGE value="refs #6440: errorNaturPhotos" />
@ -975,7 +960,11 @@
<MESSAGE value="refs #6284 feat:update and review xml" />
<MESSAGE value="refs #6560 refactor:settings" />
<MESSAGE value="refs #6964 refactor:settings" />
<option name="LAST_COMMIT_MESSAGE" value="refs #6964 refactor:settings" />
<MESSAGE value="refs #6964 feat:hasOlderItem" />
<MESSAGE value="version 24.5Beta" />
<MESSAGE value="version 24.8Beta" />
<MESSAGE value="refs #6607 feat:checking_boxes" />
<option name="LAST_COMMIT_MESSAGE" value="refs #6607 feat:checking_boxes" />
</component>
<component name="XDebuggerManager">
<pin-to-top-manager>

View File

@ -23,7 +23,6 @@ import es.verdnatura.presentation.common.onPackingClickListener
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
class SaleAdapter(
private val items: List<SaleVO>,
private val onPasillerosItemClickListener: OnPasillerosItemClickListener,
@ -41,7 +40,6 @@ class SaleAdapter(
var isExpanded: Boolean = type == "PRECHECKER"
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
this.context = parent.context
@ -118,7 +116,6 @@ class SaleAdapter(
}
/*itemRowLayout.setOnLongClickListener{
onMistakeClickListener.onMistakeClickListener(sale)
false
@ -129,7 +126,6 @@ class SaleAdapter(
false
}
//ERROR
if (sale.originalQuantity != sale.quantity) {
layoutError.visibility = View.VISIBLE
@ -287,7 +283,6 @@ class SaleAdapter(
contentLayout.setBackgroundColor(getColor(context!!, R.color.verdnatura_black))
}
//sergio: para de momento que pinten las lineas sin actualizar ni nada
if (sale.isControlled == "2") {
DrawableCompat.setTint(
@ -335,7 +330,6 @@ class SaleAdapter(
imageErrorMessage.visibility = View.INVISIBLE
ivArrow.visibility = View.VISIBLE
} else {
itemArticleItemFk.visibility = View.VISIBLE
//itemPackingText.visibility = View.VISIBLE
@ -377,7 +371,6 @@ class SaleAdapter(
itemArticlePlacements.visibility = View.VISIBLE
}
/* rvHeadlines.adapter=SaleAdapter(sale.sonSales,onPasillerosItemClickListener,onQuantityClick,onSaleClickListener,onMistakeClickListener,onPackingClick)
rvHeadlines.visibility=View.VISIBLE
rvHeadlines.layoutManager = LinearLayoutManager(context)}*/
@ -397,6 +390,13 @@ class SaleAdapter(
// isExpanded=!isExpanded
}
//Tarea 6607
itemArticleCel2Count.visibility = View.GONE
/*itemArticleCel2Count.visibility = if (type == CONTROLADOR) {
View.VISIBLE
} else {
View.GONE
}*/
//ASIGNAMOS VALOR A LA VSITA
this.sale = sale
@ -405,7 +405,6 @@ class SaleAdapter(
}
}
private fun paintTicketcolor(color: String?, itemView: View) {
if (color.isNullOrBlank()) {
@ -418,7 +417,6 @@ class SaleAdapter(
private fun paintTicketcolorOld(color: String, itemView: View) {
when (color.uppercase().trim()) {
"ROJO" ->
itemView.setBackgroundColor(Color.RED)
@ -460,7 +458,6 @@ class SaleAdapter(
"CIAN" -> itemView.setBackgroundColor(0xFF00ffff.toInt())
"BEIGE" -> itemView.setBackgroundColor(0xFFf2e7bf.toInt())
else -> {
@ -471,6 +468,5 @@ class SaleAdapter(
}
// itemTicketColor.setBackgroundResource((R.drawable.rectangle))
}
}

View File

@ -140,7 +140,7 @@ class CollectionFragment(
)
//tarea 6458
viewModel.ticketState(collection.collectionFk)
viewModel.ticketState(collection.collectionFk)
workerFkFromTicket = collection.tickets.get(0).sales.get(0).workerFk
}
@ -967,6 +967,13 @@ class CollectionFragment(
tickets.add(saleVO.ticketFk)
} else if (type == CONTROLADOR) {
salesList.add(saleVO)
//Tarea 6607
/* if (saleVO.cel2.contains("pack de")) {
saleVO.packingChecked =
saleVO.cel2.substringBefore("pack de").trim().toInt()
} else {
saleVO.packingChecked = 1
}*/
if (tickets.firstOrNull { it == saleVO.ticketFk }.isNullOrEmpty())
tickets.add(saleVO.ticketFk)
} else if (type == PRECHECKER) {
@ -1202,7 +1209,13 @@ class CollectionFragment(
if (txtscan == saleVO.itemFk.toString()) {
if (mpok != null) mpok!!.start()
isOk = true
//Tarea 6067
// if (saleVO.packingChecked == 1) {
markLine(index, type)
// } else {
// saleVO.packingChecked = saleVO.packingChecked - 1
//}
//saleAdapter!!.notifyDataSetChanged()
break
}
//2- Por barcode
@ -1211,7 +1224,13 @@ class CollectionFragment(
if (txtscan == barcode) {
if (mpok != null) mpok!!.start()
isOk = true
//Tarea 6067
//if (saleVO.packingChecked == 1) {
markLine(index, type)
//} else {
// saleVO.packingChecked = saleVO.packingChecked - 1
//}
saleAdapter!!.notifyDataSetChanged()
isBreak = true
}
}
@ -1341,7 +1360,24 @@ class CollectionFragment(
}
checkStateParent()
} else if (type == CONTROLADOR) {
//tarea 6067
//if (sales[position].packingChecked == 1) {
sales[position].isControlled = if (sales[position].isControlled == "1") "0" else "1"
//tarea 6067
/*if (sales[position].isControlled=="0"){
if (sales[position].cel2.contains("pack de")){
sales[position].packingChecked = sales[position].cel2.substringBefore("pack de").trim().toInt()}
}*/
saleAdapter!!.notifyDataSetChanged()
saleTrackingReplace(position, newType)
setListPosition(position, false)
/* } else {
sales[position].packingChecked = sales[position].packingChecked - 1
saleAdapter!!.notifyDataSetChanged()
}*/
//En primera instancia coge el primer elemento hijo para realizar la copia y según se va interactuando con las sales ya se actualiza el
// estado del padre
checkStateParent()
@ -1352,6 +1388,9 @@ class CollectionFragment(
sales[position].isPreControlled =
if (sales[position].isPreControlled == "1") "0" else "1"
checkStateParent()
saleAdapter!!.notifyDataSetChanged()
saleTrackingReplace(position, newType)
setListPosition(position, false)
}
@ -1362,11 +1401,11 @@ class CollectionFragment(
if (type == SACADOR) {
saleTracking_mark(position, newType)
//saleTrackingReplace(position,newType)
} else {
} /*else {
saleAdapter!!.notifyDataSetChanged()
saleTrackingReplace(position, newType)
setListPosition(position, false)
}
}*/
isMarking = true
setTotalLines()
}

View File

@ -145,7 +145,8 @@ class SaleVO(
var sonSales: MutableList<SaleVO> = mutableListOf(),
var code: String = "",
var hasMistake: Boolean = false,
var sectorFk: Int? = null
var sectorFk: Int? = null,
var packingChecked:Int = 1
)

View File

@ -249,7 +249,6 @@
app:layout_constraintTop_toTopOf="parent"
tool:text="10" />
<TextView
android:id="@+id/item_article_cel2"
android:layout_width="wrap_content"
@ -264,6 +263,20 @@
app:layout_constraintTop_toTopOf="parent"
tool:text="5x1" />
<TextView
android:id="@+id/item_article_cel2_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:paddingStart="10dp"
android:text="@{String.valueOf(sale.packingChecked)}"
android:textColor="@color/verdnatura_dark_sky_blue"
android:textSize="@dimen/body1"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@id/item_article_cel2"
app:layout_constraintTop_toTopOf="parent"
tool:text="10x5" />
<TextView
android:id="@+id/item_article_quantity_line1"
android:layout_width="0dp"