refs #4923 previas
This commit is contained in:
parent
2525560fe9
commit
d1d7ffa42c
|
@ -276,7 +276,7 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
|
@ -14,9 +14,6 @@
|
|||
<option name="jvmTarget" value="1.8" />
|
||||
<option name="languageVersion" value="1.6" />
|
||||
<option name="apiVersion" value="1.6" />
|
||||
<option name="pluginOptions">
|
||||
<array />
|
||||
</option>
|
||||
<option name="pluginClasspaths">
|
||||
<array>
|
||||
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.6.10/88f2073f4020cdb83132cfe940ceb9a60aba54ea/kotlin-compiler-embeddable-1.6.10.jar" />
|
||||
|
@ -30,6 +27,9 @@
|
|||
<option value="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna/5.6.0/330f2244e9030119ab3030fc3fededc86713d9cc/jna-5.6.0.jar" />
|
||||
</array>
|
||||
</option>
|
||||
<option name="pluginOptions">
|
||||
<array />
|
||||
</option>
|
||||
<option name="errors">
|
||||
<ArgumentParseErrors />
|
||||
</option>
|
||||
|
|
|
@ -83,12 +83,19 @@
|
|||
</select>
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="Quitar procedimiento refs #4661">
|
||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #4923 añadirTickets">
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/res/drawable/ic_arrow_down.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/res/drawable/ic_arrow_up.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/modules/app/Gestor_Almacén.app.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules/app/Gestor_Almacén.app.iml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt" 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/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/CollectionViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/mapper/CollectionMapper.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/mapper/CollectionMapper.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/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>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -99,7 +106,7 @@
|
|||
<component name="CodeInsightWorkspaceSettings">
|
||||
<option name="optimizeImportsOnTheFly" value="true" />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[C:\Users\sergiodt\.android\avd\Pixel_2_API_24.avd]" />
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[21114523025303]" />
|
||||
<component name="ExportToHTMLSettings">
|
||||
<option name="OPEN_IN_BROWSER" value="true" />
|
||||
<option name="OUTPUT_DIRECTORY" value="C:\Program Files\Android\Android Studio\inspections" />
|
||||
|
@ -237,12 +244,14 @@
|
|||
"keyToString": {
|
||||
"ApkExportedModule": "Gestor_Almacén.app",
|
||||
"ExportApk.ApkPathForGestor_Almacén.app": "C:\\Users\\sergiodt\\AndroidStudioProjects\\vn-warehouseManager\\app",
|
||||
"PROJECT_TRUSTED_KEY": "true",
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.cidr.known.project.marker": "true",
|
||||
"ScreenRecorder.SavePath": "C:\\Users\\sergiodt\\device-2023-03-17-114045.mp4",
|
||||
"cidr.known.project.marker": "true",
|
||||
"com.google.services.firebase.aqiPopupShown": "true",
|
||||
"last_opened_file_path": "C:/Users/sergiodt/proyectos/Rocket.Chat.ReactNative/android/app",
|
||||
"last_opened_file_path": "C:/Users/sergiodt",
|
||||
"project.structure.last.edited": "Modules",
|
||||
"project.structure.proportion": "0.17",
|
||||
"project.structure.side.proportion": "0.2",
|
||||
|
@ -396,62 +405,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1618825571576</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00061" summary="Version 8.4.1Beta,Tarea #3958">
|
||||
<created>1653663791334</created>
|
||||
<option name="number" value="00061" />
|
||||
<option name="presentableId" value="LOCAL-00061" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1653663791335</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00062" summary="Version 8.4.1Beta=8.4 Master,sin envio rockets de sacador/controlador y quitar strings.">
|
||||
<created>1654145430078</created>
|
||||
<option name="number" value="00062" />
|
||||
<option name="presentableId" value="LOCAL-00062" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1654145430079</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00063" summary="Version 8.5Beta, strings, body =null y muestra coger vehículo">
|
||||
<created>1654670479261</created>
|
||||
<option name="number" value="00063" />
|
||||
<option name="presentableId" value="LOCAL-00063" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1654670479262</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00064" summary="Version 8.5.1Beta, strings, muestra previa y comentar smarttads">
|
||||
<created>1654772518409</created>
|
||||
<option name="number" value="00064" />
|
||||
<option name="presentableId" value="LOCAL-00064" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1654772518410</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00065" summary="Version 8.5.1Beta acceso a control vehiculo ok">
|
||||
<created>1654781827179</created>
|
||||
<option name="number" value="00065" />
|
||||
<option name="presentableId" value="LOCAL-00065" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1654781827179</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00066" summary="Version 8.5.2Beta, quitado color del item, quitado back de revisor y control de previa solo sus líneas">
|
||||
<created>1655369652090</created>
|
||||
<option name="number" value="00066" />
|
||||
<option name="presentableId" value="LOCAL-00066" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1655369652090</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00067" summary="Version 8.6.1Beta, añadido ticketColor más grande, quitados colores items y permutado quantity por cel2. Quitados warnings">
|
||||
<created>1655960861634</created>
|
||||
<option name="number" value="00067" />
|
||||
<option name="presentableId" value="LOCAL-00067" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1655960861634</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00068" summary="Version 8.6.1Beta tareas #3601 refactor ivnentario.Tarea #3959(warnings deprecated,typedate,neverused)">
|
||||
<created>1656322885999</created>
|
||||
<option name="number" value="00068" />
|
||||
<option name="presentableId" value="LOCAL-00068" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1656322886000</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00069" summary="Version 8.7 Reubicación, sector = SACADOR V, controlador no puede hacer parking si no están revisados todos los tickets,">
|
||||
<created>1656930096719</created>
|
||||
<option name="number" value="00069" />
|
||||
|
@ -739,7 +692,63 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1676562624751</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="110" />
|
||||
<task id="LOCAL-00110" summary="refs #5117 Autoconsumo">
|
||||
<created>1679050268326</created>
|
||||
<option name="number" value="00110" />
|
||||
<option name="presentableId" value="LOCAL-00110" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1679050268327</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00111" summary="refs #5117 Autoconsumo">
|
||||
<created>1679050285819</created>
|
||||
<option name="number" value="00111" />
|
||||
<option name="presentableId" value="LOCAL-00111" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1679050285819</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00112" summary="refs #4683 Autoconsumo">
|
||||
<created>1679050359974</created>
|
||||
<option name="number" value="00112" />
|
||||
<option name="presentableId" value="LOCAL-00112" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1679050359974</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00113" summary="refs #4755 mostrar tickets">
|
||||
<created>1679305084809</created>
|
||||
<option name="number" value="00113" />
|
||||
<option name="presentableId" value="LOCAL-00113" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1679305084810</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00114" summary="refs #5117 autoconsumo">
|
||||
<created>1679378828592</created>
|
||||
<option name="number" value="00114" />
|
||||
<option name="presentableId" value="LOCAL-00114" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1679378828593</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00115" summary="refs #4755 añadirTickets">
|
||||
<created>1679389139208</created>
|
||||
<option name="number" value="00115" />
|
||||
<option name="presentableId" value="LOCAL-00115" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1679389139208</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00116" summary="refs #4755 añadirTickets">
|
||||
<created>1679389189173</created>
|
||||
<option name="number" value="00116" />
|
||||
<option name="presentableId" value="LOCAL-00116" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1679389189174</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00117" summary="refs #4755 añadirTickets">
|
||||
<created>1679389331215</created>
|
||||
<option name="number" value="00117" />
|
||||
<option name="presentableId" value="LOCAL-00117" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1679389331215</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="118" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.History.Properties">
|
||||
|
@ -781,7 +790,7 @@
|
|||
<entry key="branch">
|
||||
<value>
|
||||
<list>
|
||||
<option value="testBeta" />
|
||||
<option value="testBeta_5109_Agrupar_sales_exandible_simple" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
|
@ -840,12 +849,6 @@
|
|||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
||||
<MESSAGE value="Version 9.2.1 añadido error encajado y modificado marcaje" />
|
||||
<MESSAGE value="Version 9.2.1 en producción" />
|
||||
<MESSAGE value="Version 9.2.1 en producción. Borrada Voz y Ajustes impresora" />
|
||||
<MESSAGE value="Version 9.2 Error encajado y en ver Ticket aparece ver la colección" />
|
||||
<MESSAGE value="Version 9.4Beta Cmr, Control ubicación, volver atrás de Controlador, botón llamadas, volver pantalla anterior parking," />
|
||||
<MESSAGE value="Modificado control ubicación" />
|
||||
<MESSAGE value="Version 9.5Beta añadido inteceptor y modificado código worker_getId. Subida como 9.4.2Beta" />
|
||||
<MESSAGE value="Version 9.6Beta Interteceptors, quitando userCase y arreglado click sobre carita. Cambiado .gitignore" />
|
||||
<MESSAGE value="Version 9.6Beta Interteptors, quitando userCase y arreglado click sobre carita. Cambiado .gitignore" />
|
||||
|
@ -865,23 +868,15 @@
|
|||
<MESSAGE value="Version 23.2 Modificado actualizar pantalla al transferir en Ubicador. Subida version" />
|
||||
<MESSAGE value="Activado impresion labelCount" />
|
||||
<MESSAGE value="Quitar procedimiento refs #4661" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Quitar procedimiento refs #4661" />
|
||||
<MESSAGE value="Reclycler extra y agrupacion previa" />
|
||||
<MESSAGE value="refs #5117 Autoconsumo" />
|
||||
<MESSAGE value="refs #4683 Autoconsumo" />
|
||||
<MESSAGE value="refs #4755 mostrar tickets" />
|
||||
<MESSAGE value="refs #5117 autoconsumo" />
|
||||
<MESSAGE value="refs #4755 añadirTickets" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="refs #4755 añadirTickets" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<line-breakpoint enabled="true" suspend="THREAD" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt</url>
|
||||
<line>362</line>
|
||||
<option name="timeStamp" value="1" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" suspend="THREAD" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt</url>
|
||||
<line>123</line>
|
||||
<option name="timeStamp" value="4" />
|
||||
</line-breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
<pin-to-top-manager>
|
||||
<pinned-members>
|
||||
<PinnedItemInfo parentTag="java.net.SocketException" memberName="detailMessage" />
|
||||
|
|
|
@ -40,7 +40,6 @@ android {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
}
|
||||
|
|
|
@ -25,12 +25,20 @@ class SaleAdapter(
|
|||
private val onSaleClickListener: OnSaleClickListener,
|
||||
private val onMistakeClickListener: OnMistakeClickListener,
|
||||
private val onPackingClick: onPackingClickListener,
|
||||
private var onTicketClick: OnTicketClickListener? = null,
|
||||
private var SaleAdapter: SaleAdapter? = null,
|
||||
|
||||
) : RecyclerView.Adapter<SaleAdapter.AjustesItemHolder>() {
|
||||
|
||||
) : RecyclerView.Adapter<SaleAdapter.AjustesItemHolder>() {
|
||||
var context: Context? = null
|
||||
var position: Int = 0
|
||||
|
||||
var isExpanded: Boolean = false
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
|
||||
this.context = parent.context
|
||||
|
||||
|
||||
return AjustesItemHolder(
|
||||
|
||||
ItemArticleRowFragmentBinding.inflate(
|
||||
|
@ -59,6 +67,9 @@ class SaleAdapter(
|
|||
val childLayoutManager =
|
||||
LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
|
||||
|
||||
val childLayoutManagerV =
|
||||
LinearLayoutManager(context!!, RecyclerView.VERTICAL, false)
|
||||
|
||||
itemArticlePlacements.apply {
|
||||
layoutManager = childLayoutManager
|
||||
adapter = PlacementAdapter(sale.placements, onPasillerosItemClickListener)
|
||||
|
@ -66,7 +77,9 @@ class SaleAdapter(
|
|||
|
||||
//CLICK EVENTS
|
||||
contentLayout.setOnClickListener {
|
||||
onSaleClickListener.onSaleClick(sale)
|
||||
if (!sale.isParent) {
|
||||
onSaleClickListener.onSaleClick(sale)
|
||||
}
|
||||
}
|
||||
|
||||
itemArticleItemFk.setOnClickListener {
|
||||
|
@ -92,22 +105,24 @@ class SaleAdapter(
|
|||
txtde.setOnClickListener {
|
||||
onQuantityClick.onQuantityClick(sale)
|
||||
}
|
||||
ticketFk.setOnClickListener {
|
||||
|
||||
if (onTicketClick != null) {
|
||||
onTicketClick!!.onTicketClickListener(sale)
|
||||
}
|
||||
|
||||
contentLayout.setOnLongClickListener {
|
||||
//"Nueva funcionalidad en el icono de la derecha".toast(context!!)
|
||||
//onMistakeClickListener.onMistakeClickListener(sale)
|
||||
false
|
||||
}
|
||||
|
||||
|
||||
/*itemRowLayout.setOnLongClickListener{
|
||||
onMistakeClickListener.onMistakeClickListener(sale)
|
||||
false
|
||||
}*/
|
||||
|
||||
//Tarea #5004
|
||||
/* if (sale.hasMistake){
|
||||
imageErrorMessage.setBackgroundColor(color.RED)
|
||||
}*/
|
||||
//Tarea #5004
|
||||
/* if (sale.hasMistake){
|
||||
imageErrorMessage.setBackgroundColor(color.RED)
|
||||
}*/
|
||||
|
||||
imageErrorMessage.setOnClickListener {
|
||||
onMistakeClickListener.onMistakeClickListener(sale)
|
||||
|
@ -127,7 +142,7 @@ class SaleAdapter(
|
|||
sale.pickedQuantity = sale.quantity
|
||||
}
|
||||
}
|
||||
// d("VERDNATURA::","La quantity de ${sale.saleFk} es ${sale.pickedQuantity} y está ${sale.isPrepared}")
|
||||
// d("VERDNATURA::","La quantity de ${sale.saleFk} es ${sale.pickedQuantity} y está ${sale.isPrepared}")
|
||||
|
||||
if (sale.isNew) {
|
||||
layoutError.visibility = View.VISIBLE
|
||||
|
@ -294,6 +309,88 @@ class SaleAdapter(
|
|||
)
|
||||
)
|
||||
}
|
||||
if (isExpanded) {
|
||||
itemArticlePlacements.visibility = View.VISIBLE
|
||||
ivArrow.setImageResource(R.drawable.ic_arrow_down)
|
||||
|
||||
} else {
|
||||
itemArticlePlacements.visibility = View.GONE
|
||||
ivArrow.setImageResource(R.drawable.ic_arrow_up)
|
||||
}
|
||||
|
||||
itemArticlePlacements.visibility = if (isExpanded) View.VISIBLE else {
|
||||
View.GONE
|
||||
}
|
||||
|
||||
if (sale.isParent) {
|
||||
itemArticleItemFk.visibility = View.INVISIBLE
|
||||
itemPackingText.visibility = View.INVISIBLE
|
||||
itemPackingItemFk.visibility = View.INVISIBLE
|
||||
itemArticleCel1.visibility = View.INVISIBLE
|
||||
itemArticleCel2.visibility = View.INVISIBLE
|
||||
itemArticleCel3.visibility = View.INVISIBLE
|
||||
itemArticleQuantity.visibility = View.INVISIBLE
|
||||
txtdeNew.visibility = View.INVISIBLE
|
||||
itemArticleQuantityPicked.visibility = View.INVISIBLE
|
||||
itemArticleQuantityLine3.visibility = View.VISIBLE
|
||||
imageErrorMessage.visibility = View.INVISIBLE
|
||||
ivArrow.visibility = View.VISIBLE
|
||||
|
||||
|
||||
} else {
|
||||
itemArticleItemFk.visibility = View.VISIBLE
|
||||
itemPackingText.visibility = View.VISIBLE
|
||||
itemPackingItemFk.visibility = View.VISIBLE
|
||||
itemArticleCel1.visibility = View.VISIBLE
|
||||
itemArticleCel2.visibility = View.VISIBLE
|
||||
itemArticleCel3.visibility = View.VISIBLE
|
||||
itemArticleQuantity.visibility = View.VISIBLE
|
||||
txtdeNew.visibility = View.VISIBLE
|
||||
itemArticleQuantityPicked.visibility = View.VISIBLE
|
||||
itemArticleQuantityLine3.visibility = View.VISIBLE
|
||||
imageErrorMessage.visibility = View.VISIBLE
|
||||
ivArrow.visibility = View.INVISIBLE
|
||||
}
|
||||
|
||||
if (!sale.sonSales.isNullOrEmpty()) {
|
||||
itemArticlePlacements.apply {
|
||||
layoutManager = childLayoutManagerV
|
||||
adapter = SaleAdapter(
|
||||
sale.sonSales,
|
||||
onPasillerosItemClickListener,
|
||||
onQuantityClick,
|
||||
onSaleClickListener,
|
||||
onMistakeClickListener,
|
||||
onPackingClick
|
||||
)
|
||||
}
|
||||
|
||||
} else {
|
||||
//revisar porque incosistencia
|
||||
itemArticlePlacements.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
|
||||
/* rvHeadlines.adapter=SaleAdapter(sale.sonSales,onPasillerosItemClickListener,onQuantityClick,onSaleClickListener,onMistakeClickListener,onPackingClick)
|
||||
rvHeadlines.visibility=View.VISIBLE
|
||||
rvHeadlines.layoutManager = LinearLayoutManager(context)}*/
|
||||
|
||||
ivArrow.setOnClickListener {
|
||||
d("VERDNATURA::", "click on line1 PADRE")
|
||||
//Revisar lunes
|
||||
|
||||
if (isExpanded!!) {
|
||||
ivArrow.setImageResource(R.drawable.ic_arrow_up)
|
||||
itemArticlePlacements.visibility = View.GONE
|
||||
} else {
|
||||
|
||||
ivArrow.setImageResource(R.drawable.ic_arrow_down)
|
||||
itemArticlePlacements.visibility = View.VISIBLE
|
||||
}
|
||||
isExpanded = !isExpanded
|
||||
|
||||
// isExpanded=!isExpanded
|
||||
}
|
||||
|
||||
|
||||
//ASIGNAMOS VALOR A LA VSITA
|
||||
|
@ -303,50 +400,7 @@ class SaleAdapter(
|
|||
}
|
||||
}
|
||||
|
||||
/* private fun paintTicketcolorOld(color: String, itemView: View) {
|
||||
when (color.uppercase()) {
|
||||
"ROJO" -> itemView.setBackgroundColor(Color.RED)
|
||||
"AMARILLO" -> itemView.setBackgroundColor(Color.YELLOW)
|
||||
"VERDE" -> itemView.setBackgroundColor(Color.GREEN)
|
||||
"AZUL" -> itemView.setBackgroundColor(Color.BLUE)
|
||||
"BLANCO" -> {
|
||||
itemView.setBackgroundColor(Color.WHITE)
|
||||
itemView.setBackgroundResource((R.drawable.border))
|
||||
}
|
||||
"NEGRO" -> {
|
||||
itemView.setBackgroundColor(Color.BLACK)
|
||||
}
|
||||
"VIOLETA" -> itemView.setBackgroundColor(0xFF4c2882.toInt())
|
||||
"GRIS" -> itemView.setBackgroundColor(Color.GRAY)
|
||||
"ORANGE" -> itemView.setBackgroundColor(
|
||||
getColor(
|
||||
context!!,
|
||||
android.R.color.holo_orange_light
|
||||
)
|
||||
)
|
||||
"MORADO" -> itemView.setBackgroundColor(
|
||||
getColor(
|
||||
context!!,
|
||||
android.R.color.holo_purple
|
||||
)
|
||||
)
|
||||
"CELESTE" -> itemView.setBackgroundColor(0xFF5b85F5.toInt())
|
||||
"ROSA" -> itemView.setBackgroundColor(0xFFfc0fc0.toInt())
|
||||
"DORADO" -> itemView.setBackgroundColor(0xFFb8860b.toInt())
|
||||
"MARRON" -> itemView.setBackgroundColor(0xFF663300.toInt())
|
||||
"PERLA" -> itemView.setBackgroundColor(0xFFcdcecf.toInt())
|
||||
"MARFIL" -> itemView.setBackgroundColor(0xFFf7eada.toInt())
|
||||
"CIAN" -> itemView.setBackgroundColor(0xFF00ffff.toInt())
|
||||
"BEIGE" -> itemView.setBackgroundColor(0xFFf2e7bf.toInt())
|
||||
"transparente" -> itemView.setBackgroundColor(0xFFf2e7bf.toInt())
|
||||
|
||||
else -> {
|
||||
itemView.setBackgroundColor(Color.TRANSPARENT)
|
||||
itemView.setBackgroundResource(R.drawable.background_item_color)
|
||||
|
||||
}
|
||||
}
|
||||
}*/
|
||||
private fun paintTicketcolor(color: String?, itemView: View) {
|
||||
|
||||
if (color.isNullOrBlank()) {
|
||||
|
@ -363,12 +417,6 @@ class SaleAdapter(
|
|||
when (color.uppercase().trim()) {
|
||||
"ROJO" ->
|
||||
itemView.setBackgroundColor(Color.RED)
|
||||
/*if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
itemView.background.colorFilter =
|
||||
BlendModeColorFilter(Color.RED, BlendMode.SRC_ATOP)
|
||||
} else {
|
||||
itemView.background.setColorFilter(Color.RED, PorterDuff.Mode.SRC_ATOP)
|
||||
}*/
|
||||
|
||||
"AMARILLO" ->
|
||||
itemView.setBackgroundColor(Color.YELLOW)
|
||||
|
|
|
@ -10,12 +10,14 @@ import android.os.Build
|
|||
import android.os.Bundle
|
||||
import android.os.Parcelable
|
||||
import android.text.InputType
|
||||
import android.text.InputType.TYPE_CLASS_TEXT
|
||||
import android.util.Log.d
|
||||
import android.view.KeyEvent
|
||||
import android.view.KeyEvent.ACTION_DOWN
|
||||
import android.view.View
|
||||
import android.view.View.GONE
|
||||
import android.view.View.VISIBLE
|
||||
import android.view.WindowManager
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.ImageView
|
||||
|
@ -24,12 +26,14 @@ import androidx.annotation.RequiresApi
|
|||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.gson.Gson
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentCollectionBinding
|
||||
import es.verdnatura.domain.ConstAndValues.CONTROLADOR
|
||||
import es.verdnatura.domain.ConstAndValues.OK
|
||||
import es.verdnatura.domain.ConstAndValues.PRECHECKER
|
||||
import es.verdnatura.domain.ConstAndValues.SACADOR
|
||||
import es.verdnatura.domain.notNull
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -54,6 +58,7 @@ class CollectionFragment(
|
|||
|
||||
private lateinit var dataMessageSalix: DataMessageSalix
|
||||
private var sales: List<SaleVO> = listOf()
|
||||
private var salesParent: List<SaleVO> = listOf()
|
||||
private var saleAdapter: SaleAdapter? = null
|
||||
private var lm: LinearLayoutManager? = null
|
||||
private var storedPosition: Int = 0
|
||||
|
@ -103,6 +108,8 @@ class CollectionFragment(
|
|||
private var recylerViewState: Parcelable? = null
|
||||
private var isScanned: Boolean? = null
|
||||
|
||||
private lateinit var myGroupList: List<SaleVO>
|
||||
|
||||
companion object {
|
||||
fun newInstance(collection: CollectionVO, type: String) =
|
||||
CollectionFragment(collection, type)
|
||||
|
@ -122,12 +129,10 @@ class CollectionFragment(
|
|||
if (type.equals(CONTROLADOR)) {
|
||||
//sergio: comprueba si viene de la pantalla de controlador
|
||||
//Tarea #4280 cambiar a ticket_isOutClosureZone
|
||||
/* viewModel.ticket_checkFullyControlled(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
collection.collectionFk
|
||||
/* viewModel.ticket_isOutClosureZone(
|
||||
collection.collectionFk
|
||||
|
||||
)*/
|
||||
)*/
|
||||
workerFkFromTicket = collection.tickets.get(0).sales.get(0).workerFk
|
||||
}
|
||||
|
||||
|
@ -348,7 +353,19 @@ class CollectionFragment(
|
|||
//sergio:para ver si ha marcado dos veces el mismo ticket
|
||||
binding.scanInput.setText(textScanned_filterDouble(binding.scanInput.text!!.toString()))
|
||||
|
||||
findSale(binding.scanInput.text.toString())
|
||||
//de momento solo está el qr de artículo
|
||||
isScanned =
|
||||
event != null && event.action == ACTION_DOWN && event.keyCode == KeyEvent.KEYCODE_ENTER
|
||||
var myItem = try {
|
||||
itemScanValue(
|
||||
binding.scanInput.text.toString(),
|
||||
"buy",
|
||||
"more"
|
||||
).toString()
|
||||
} catch (ex: Exception) {
|
||||
binding.scanInput.text.toString()
|
||||
}
|
||||
|
||||
buttonPushedGetCollection = false
|
||||
|
||||
}
|
||||
|
@ -628,20 +645,20 @@ class CollectionFragment(
|
|||
|
||||
})*/
|
||||
//Tarea 4280
|
||||
/* responseTicketClosure.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (!goBack) {
|
||||
responseTicketClosure.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (!goBack) {
|
||||
if (it.response.toBoolean()) {
|
||||
var customDialogWarning = CustomDialog(requireContext())
|
||||
customDialogWarning.setTitle(getString(R.string.urgentWarning))
|
||||
customDialogWarning.setDescription(getString(R.string.ticketWarning))
|
||||
.setOkButton(getString(R.string.aware)) {
|
||||
customDialogWarning.dismiss()
|
||||
}.show()
|
||||
}
|
||||
}
|
||||
var customDialogWarning = CustomDialog(requireContext())
|
||||
customDialogWarning.setTitle(getString(R.string.urgentWarning))
|
||||
customDialogWarning.setDescription(getString(R.string.ticketWarning))
|
||||
.setOkButton(getString(R.string.aware)) {
|
||||
customDialogWarning.dismiss()
|
||||
}.show()
|
||||
}
|
||||
}
|
||||
|
||||
})*/
|
||||
})
|
||||
|
||||
responseIncQuantity.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
|
@ -755,50 +772,88 @@ class CollectionFragment(
|
|||
//goBack = false
|
||||
}
|
||||
})
|
||||
responseDel.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (!goBack) {
|
||||
loadResponseDel.observe(viewLifecycleOwner) { event ->
|
||||
event.getContentIfNotHandled().notNull {
|
||||
binding.splashProgress.visibility = View.INVISIBLE
|
||||
if (it.isError) {
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (!goBack) {
|
||||
|
||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
viewModel.collectionTicketGet(
|
||||
collection.collectionFk,
|
||||
getDataInt(SECTORFK),
|
||||
print = "0",
|
||||
type
|
||||
)
|
||||
|
||||
goBack = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* responseDel.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (!goBack) {
|
||||
|
||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
viewModel.collectionTicketGet(
|
||||
collection.collectionFk,
|
||||
getDataInt(SECTORFK),
|
||||
print = "0",
|
||||
type
|
||||
)
|
||||
|
||||
goBack = false
|
||||
}
|
||||
|
||||
})*/
|
||||
|
||||
loadResponseItemShelvingUpdate.observe(viewLifecycleOwner) { event ->
|
||||
event.getContentIfNotHandled().notNull {
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||
|
||||
} else {
|
||||
viewModel.saleTrackingDel(
|
||||
saleFk = sales[positionUnmarked].saleFk
|
||||
)
|
||||
}
|
||||
} else {
|
||||
|
||||
viewModel.collectionTicketGet(
|
||||
collection.collectionFk,
|
||||
getDataInt(SECTORFK),
|
||||
print = "0",
|
||||
type
|
||||
)
|
||||
|
||||
goBack = false
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
/* responseItemShelvingUpdate.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
|
||||
if (!goBack) {
|
||||
|
||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
responseItemShelvingUpdate.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
|
||||
if (!goBack) {
|
||||
|
||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||
|
||||
} else {
|
||||
//Test volver atrás
|
||||
if (!goBack){
|
||||
viewModel.saleTrackingDel(
|
||||
saleFk = sales[positionUnmarked].saleFk
|
||||
)}
|
||||
goBack = false
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
viewModel.saleTrackingDel(
|
||||
saleFk = sales[positionUnmarked].saleFk
|
||||
)
|
||||
|
||||
goBack = false
|
||||
}
|
||||
})
|
||||
})*/
|
||||
|
||||
responseSaleReplace.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = GONE
|
||||
|
@ -823,14 +878,51 @@ class CollectionFragment(
|
|||
goBack = false
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
loadResponseSaleTrackingMark.observe(viewLifecycleOwner) { event ->
|
||||
event.getContentIfNotHandled().notNull {
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (it.isError) {
|
||||
//TEST3
|
||||
/* if (getDataInt(USERFK) == 18890 || getDataInt(USERFK) == 19591) {
|
||||
"La línea NO se ha marcado correctamente".toast(context)
|
||||
}*/
|
||||
|
||||
if (!goBack) {
|
||||
ma.messageWithSound(it.errorMessage, it.isError, true)
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.collectionTicketGet(
|
||||
collection.collectionFk,
|
||||
getDataInt(SECTORFK),
|
||||
print = "0",
|
||||
type
|
||||
)
|
||||
}
|
||||
|
||||
} else {
|
||||
// pintar línea
|
||||
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
|
||||
ReviewQuantityForRefreshingAndSorting(
|
||||
sales[storedPosition].quantity!!.toInt(),
|
||||
sales[storedPosition].pickedQuantity!!.toInt()
|
||||
)
|
||||
goBack = false
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
////Tarea #4371
|
||||
responseSaleTracking_mark.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (it.isError) {
|
||||
//TEST3
|
||||
/* if (getDataInt(USERFK) == 18890 || getDataInt(USERFK) == 19591) {
|
||||
/* responseSaleTracking_mark.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = GONE
|
||||
if (it.isError) {
|
||||
//TEST3
|
||||
*//* if (getDataInt(USERFK) == 18890 || getDataInt(USERFK) == 19591) {
|
||||
"La línea NO se ha marcado correctamente".toast(context)
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
if (!goBack) {
|
||||
ma.messageWithSound(it.errorMessage, it.isError, true)
|
||||
|
@ -850,14 +942,14 @@ class CollectionFragment(
|
|||
"La línea se ha marcado correctamente".toast(context)
|
||||
}
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
setListPosition(storedPosition, false)
|
||||
|
||||
ReviewQuantityForRefreshingAndSorting(
|
||||
sales[storedPosition].quantity!!.toInt(),
|
||||
sales[storedPosition].pickedQuantity!!.toInt()
|
||||
)
|
||||
goBack = false
|
||||
}
|
||||
})
|
||||
})*/
|
||||
|
||||
|
||||
responseItemShelvingSaleSupplyAdd.observe(viewLifecycleOwner, Observer {
|
||||
|
@ -993,92 +1085,119 @@ class CollectionFragment(
|
|||
|
||||
|
||||
sales = salesList.sortedWith(compareBy({ it.saleOrder }))
|
||||
/* for (s in sales) {
|
||||
d("VERDNATURA::", "El id es " + s.saleFk + " tiene saleOrder" + s.saleOrder)
|
||||
}*/
|
||||
myGroupList = groupSaleGroup(salesList).sortedWith(compareBy({ it.saleOrder }))
|
||||
|
||||
if (type == CONTROLADOR) {
|
||||
sales = salesList.sortedWith(compareBy({ it.picked }))
|
||||
myGroupList = groupSaleGroup(salesList).sortedWith(compareBy({ it.picked }))
|
||||
|
||||
}
|
||||
|
||||
|
||||
saleAdapter =
|
||||
SaleAdapter(sales, pasillerosItemClickListener!!, object : OnQuantityClickListener {
|
||||
SaleAdapter(
|
||||
myGroupList,
|
||||
pasillerosItemClickListener!!,
|
||||
object : OnQuantityClickListener {
|
||||
|
||||
override fun onQuantityClick(sale: SaleVO) {
|
||||
override fun onQuantityClick(sale: SaleVO) {
|
||||
|
||||
sales.forEachIndexed { index, saleVO ->
|
||||
if (saleVO.saleFk == sale.saleFk) {
|
||||
if (type != "PRECHECKER") {
|
||||
showQuantityDialog(index)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}, object : OnSaleClickListener {
|
||||
override fun onSaleClick(sale: SaleVO) {
|
||||
|
||||
sales.forEachIndexed { index, saleVO ->
|
||||
if (saleVO.saleFk == sale.saleFk) {
|
||||
|
||||
if (type == CONTROLADOR || type == PRECHECKER) {// sergio:cuidado , esta es de lo último para marcar colores
|
||||
markLine(index, type)
|
||||
/// Log.i("VERDNATURA:","marcamos linea")
|
||||
} else if (type == SACADOR) {
|
||||
|
||||
if (sale.isPrepared == "0" || sale.isPrepared.isNullOrEmpty()) {
|
||||
showScanner(index, sale)
|
||||
} else {
|
||||
unMarkLine(index, OK)
|
||||
sales.forEachIndexed { index, saleVO ->
|
||||
if (saleVO.saleFk == sale.saleFk) {
|
||||
if (type != "PRECHECKER") {
|
||||
showQuantityDialog(index)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
object : OnSaleClickListener {
|
||||
override fun onSaleClick(sale: SaleVO) {
|
||||
|
||||
}, object : OnMistakeClickListener {
|
||||
override fun onMistakeClickListener(sale: SaleVO) {
|
||||
//Tarea #4969
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.mistakeType()
|
||||
mistakeSale = sale
|
||||
goMistakeBack = false
|
||||
sales.forEachIndexed { index, saleVO ->
|
||||
if (saleVO.saleFk == sale.saleFk) {
|
||||
|
||||
}
|
||||
}, object : onPackingClickListener {
|
||||
override fun onPackingClick(sale: SaleVO) {
|
||||
item_updatePackingShelve(sale.itemFk)
|
||||
}
|
||||
}
|
||||
if (type == CONTROLADOR || type == PRECHECKER) {// sergio:cuidado , esta es de lo último para marcar colores
|
||||
isScanned = false
|
||||
markLine(index, type)
|
||||
/// Log.i("VERDNATURA:","marcamos linea")
|
||||
} else if (type == SACADOR) {
|
||||
|
||||
if (sale.isPrepared == "0" || sale.isPrepared.isNullOrEmpty()) {
|
||||
showScanner(index, sale)
|
||||
} else {
|
||||
unMarkLine(index, OK)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
object : OnMistakeClickListener {
|
||||
override fun onMistakeClickListener(sale: SaleVO) {
|
||||
//Tarea #4969
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.mistakeType()
|
||||
mistakeSale = sale
|
||||
goMistakeBack = false
|
||||
|
||||
}
|
||||
},
|
||||
object : onPackingClickListener {
|
||||
override fun onPackingClick(sale: SaleVO) {
|
||||
item_updatePackingShelve(sale.itemFk)
|
||||
}
|
||||
},
|
||||
object : OnTicketClickListener {
|
||||
override fun onTicketClickListener(sale: SaleVO) {
|
||||
if (type == CONTROLADOR) {
|
||||
//var ticketFk = sale.ticketFk
|
||||
|
||||
var entryPoint = Gson().toJson(
|
||||
mutableMapOf(
|
||||
"entryPoint" to sale.ticketFk,
|
||||
"web" to "https://salix.verdnatura.es/#!/ticket/${sale.ticketFk}/sale"
|
||||
)
|
||||
)
|
||||
ma.onPasillerosItemClickListener(
|
||||
PasillerosItemVO(
|
||||
title = getString(R.string.titleWebViewer),
|
||||
), entryPoint = entryPoint
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
|
||||
binding.fragmentSacadorCollections.adapter = saleAdapter
|
||||
|
||||
binding.fragmentSacadorCollections.layoutManager = lm
|
||||
setTotalLines()
|
||||
//Tarea #4628
|
||||
if (type == CONTROLADOR) {
|
||||
setListPosition(storedBackPosition, true)
|
||||
setScrollListener(lm!!)
|
||||
} else {
|
||||
if (storedPosition != 0)
|
||||
setListPosition(storedPosition, true)
|
||||
else if (storedBackPosition != 0)
|
||||
setListPosition(storedBackPosition, true)
|
||||
|
||||
}
|
||||
//CAU ISMAELCT
|
||||
if (type == SACADOR) {
|
||||
for (indice in sales.indices) {
|
||||
if (sales[indice].isPrepared == "0") {
|
||||
setListPosition(position = indice, isFromBack = true)
|
||||
break
|
||||
}
|
||||
else {
|
||||
|
||||
if (type == SACADOR) {
|
||||
setStoredPosition(true)
|
||||
} else {
|
||||
if (storedPosition != 0)
|
||||
setListPosition(storedPosition, true)
|
||||
else if (storedBackPosition != 0)
|
||||
setListPosition(storedBackPosition, true)
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1203,6 +1322,7 @@ class CollectionFragment(
|
|||
}
|
||||
//2- Por barcode
|
||||
saleVO.Barcodes.forEach { barcode ->
|
||||
|
||||
if (txtscan == barcode) {
|
||||
if (mpok != null) mpok!!.start()
|
||||
isOk = true
|
||||
|
@ -1256,12 +1376,10 @@ class CollectionFragment(
|
|||
|
||||
if (type.equals(CONTROLADOR)) {
|
||||
//Tarea #4280 cambiar a ticket_isOutClosureZone
|
||||
/* viewModel.ticket_checkFullyControlled(
|
||||
getData(USER),
|
||||
getData(PASSWORD),
|
||||
txtscan
|
||||
/* viewModel.ticket_isOutClosureZone(
|
||||
txtscan.toInt()
|
||||
|
||||
)*/
|
||||
)*/
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1335,15 +1453,22 @@ class CollectionFragment(
|
|||
if (sales[position].isPrepared == "1") {
|
||||
sales[position].pickedQuantity = sales[position].quantity!!
|
||||
}
|
||||
|
||||
} else if (type == CONTROLADOR)
|
||||
checkStateParent()
|
||||
} else if (type == CONTROLADOR) {
|
||||
sales[position].isControlled = if (sales[position].isControlled == "1") "0" else "1"
|
||||
//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()
|
||||
|
||||
}
|
||||
|
||||
if (type == PRECHECKER) {
|
||||
sales[position].isPreControlled =
|
||||
if (sales[position].isPreControlled == "1") "0" else "1"
|
||||
checkStateParent()
|
||||
|
||||
}
|
||||
|
||||
//Tarea #4371 se quita y se deja en el response de viewmodel saleTracking_mark
|
||||
//saleAdapter!!.notifyDataSetChanged()
|
||||
//setListPosition(position, false)
|
||||
|
@ -1360,6 +1485,41 @@ class CollectionFragment(
|
|||
setTotalLines()
|
||||
}
|
||||
|
||||
private fun checkStateParent() {
|
||||
for (s in myGroupList) {
|
||||
if (s.isParent) {
|
||||
var totalLines = s.sonSales.size
|
||||
var isPreviousPrepared = s.sonSales.filter { it.isPreviousPrepared == "1" }.size
|
||||
var isPrepared = s.sonSales.filter { it.isPrepared == "1" }.size
|
||||
var isControlled = s.sonSales.filter { it.isControlled == "1" }.size
|
||||
var isPreControlled = s.sonSales.filter { it.isPreControlled == "1" }.size
|
||||
if (totalLines == isPreviousPrepared) {
|
||||
s.isPreviousPrepared = "1"
|
||||
} else {
|
||||
s.isPreviousPrepared = "0"
|
||||
}
|
||||
if (totalLines == isPrepared) {
|
||||
s.isPrepared = "1"
|
||||
} else {
|
||||
s.isPrepared = "0"
|
||||
}
|
||||
if (totalLines == isControlled) {
|
||||
s.isControlled = "1"
|
||||
} else {
|
||||
s.isControlled = "0"
|
||||
}
|
||||
if (totalLines == isPreControlled) {
|
||||
s.isPreControlled = "1"
|
||||
} else {
|
||||
s.isPreControlled = "0"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun setListPosition(position: Int, isFromBack: Boolean) {
|
||||
storedPosition = position
|
||||
//tarea #4628, se asigna storedBackPosition
|
||||
|
@ -1375,6 +1535,7 @@ class CollectionFragment(
|
|||
binding.fragmentSacadorCollections.addViewObserver {
|
||||
lm!!.scrollToPositionWithOffset(position, 0)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else if (isFromBack) {
|
||||
|
@ -1386,6 +1547,7 @@ class CollectionFragment(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun saleTrackingReplace(position: Int, type: String) {
|
||||
|
@ -1397,7 +1559,8 @@ class CollectionFragment(
|
|||
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
|
||||
vOriginalQuantity = sales[position].pickedQuantity!!,
|
||||
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
|
||||
vBuyFk = originalItemScan!!
|
||||
vBuyFk = originalItemScan!!,
|
||||
vIsScanned = isScanned
|
||||
|
||||
)
|
||||
|
||||
|
@ -1408,17 +1571,19 @@ class CollectionFragment(
|
|||
private fun saleTracking_mark(position: Int, type: String) {
|
||||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.saleTracking_mark(
|
||||
saleFk = sales[position].saleFk,
|
||||
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
|
||||
vOriginalQuantity = sales[position].pickedQuantity!!,
|
||||
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
|
||||
vBuyFk = originalItemScan!!,
|
||||
vItemShelvingFk = itemShelvingTracking_mark,
|
||||
vQuantity = customDialogList.getValue().toInt(),
|
||||
vIsScanned = isScanned
|
||||
viewModel.run {
|
||||
saleTracking_mark(
|
||||
saleFk = sales[position].saleFk,
|
||||
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
|
||||
vOriginalQuantity = sales[position].pickedQuantity!!,
|
||||
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
|
||||
vBuyFk = originalItemScan!!,
|
||||
vItemShelvingFk = itemShelvingTracking_mark,
|
||||
vQuantity = customDialogList.getValue().toInt(),
|
||||
vIsScanned = isScanned
|
||||
|
||||
)
|
||||
)
|
||||
}
|
||||
isScanned = null
|
||||
|
||||
}
|
||||
|
@ -1437,6 +1602,7 @@ class CollectionFragment(
|
|||
|
||||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
|
||||
viewModel.itemShelving_updateFromSale(
|
||||
sales[position].saleFk
|
||||
)
|
||||
|
@ -1604,7 +1770,7 @@ class CollectionFragment(
|
|||
} catch (e: Exception) {
|
||||
}
|
||||
try {
|
||||
customDialogList.getEditTextTwo().setRawInputType(InputType.TYPE_CLASS_NUMBER)
|
||||
customDialogList.getEditTextTwo().setRawInputType(InputType.TYPE_CLASS_NUMBER)
|
||||
|
||||
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
|
@ -1722,10 +1888,29 @@ class CollectionFragment(
|
|||
type
|
||||
)
|
||||
|
||||
} else {
|
||||
setStoredPosition(false)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun setStoredPosition(isFromBack: Boolean) {
|
||||
if (type == SACADOR) {
|
||||
for (indice in myGroupList.indices) {
|
||||
if (myGroupList[indice].isPrepared == "0") {
|
||||
storedPosition = if (indice != 0) {
|
||||
indice - 1
|
||||
} else {
|
||||
indice
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
setListPosition(storedPosition, isFromBack)
|
||||
}
|
||||
|
||||
|
||||
private fun checkItemScan(valueToCheck: String): Boolean {
|
||||
d("VERDNATURA::", "Entramos a ver el checkItem")
|
||||
|
@ -1834,10 +2019,12 @@ class CollectionFragment(
|
|||
if (listPlacementSupply.size == 1) {
|
||||
ticketSelected = listPlacementSupply[0].code!!.toInt()
|
||||
}
|
||||
customDialogList.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
|
||||
customDialogList.getEditTextTwo().inputType = InputType.TYPE_CLASS_NUMBER
|
||||
customDialogList.getEditText().inputType = InputType.TYPE_CLASS_NUMBER
|
||||
customDialogList.getEditText().setRawInputType(InputType.TYPE_CLASS_NUMBER)
|
||||
customDialogList.setTitle(getString(R.string.Agregarartículoparaticket) + " " + ticketSelected)
|
||||
.setOkButton(getString(R.string.Agregar)) {
|
||||
|
||||
if (ticketSelected == 0) {
|
||||
getString(R.string.Seleccionaunticketdelaista).toast(requireContext())
|
||||
} else if (customDialogList.getValue()
|
||||
|
@ -1874,21 +2061,36 @@ class CollectionFragment(
|
|||
customDialogList.dismiss()
|
||||
}.setHintValue(getString(R.string.Artículo)).setValue("")
|
||||
.setHintValueTwo(getString(R.string.Cantidad)).setValueTwo("").show()
|
||||
|
||||
customDialogList.getEditText().requestFocus()
|
||||
hideKeyboards()
|
||||
|
||||
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (!customDialogList.getValue().isNullOrEmpty()) {
|
||||
try {
|
||||
customDialogList.setValue(
|
||||
itemScanValue(
|
||||
customDialogList.getValue(),
|
||||
"buy",
|
||||
"more"
|
||||
).toString()
|
||||
)
|
||||
|
||||
} catch (e: Exception) {
|
||||
ma.messageWithSound(e.message.toString(), true, true)
|
||||
}
|
||||
customDialogList.getEditTextTwo().requestFocus()
|
||||
}
|
||||
hideKeyboards()
|
||||
//hideKeyboards()
|
||||
return@setOnEditorActionListener true
|
||||
|
||||
|
||||
}
|
||||
false
|
||||
|
||||
}
|
||||
|
||||
|
||||
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
|
||||
if (!customDialogList.getValueTwo().isNullOrEmpty()) {
|
||||
|
@ -1941,6 +2143,7 @@ class CollectionFragment(
|
|||
customDialogList.getRecyclerView().layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* private fun showDisponibility() {
|
||||
|
@ -2021,7 +2224,7 @@ class CollectionFragment(
|
|||
totalMark += 1
|
||||
}
|
||||
} else if (type == CONTROLADOR) {
|
||||
if (it.isControlled == "1" || it.isControlled == "2")
|
||||
if ((it.isControlled == "1" || it.isControlled == "2") && !it.isParent)
|
||||
totalMark += 1
|
||||
|
||||
}//Refactor #4030
|
||||
|
@ -2035,11 +2238,18 @@ class CollectionFragment(
|
|||
|
||||
if (binding.mainToolbar.toolbarTitle != null) binding.mainToolbar.toolbarTitle.text =
|
||||
if (collection.collectionFk != 0) collection.collectionFk.toString() else ""
|
||||
|
||||
var total = sales.size
|
||||
var totalParents = sales.filter { it.isParent }.size
|
||||
total = total - totalParents
|
||||
|
||||
if (binding.mainToolbar.toolbarSubtitle != null && totalMark != null) binding.mainToolbar.toolbarSubtitle.text =
|
||||
"" + totalMark + "/" + sales.size
|
||||
"" + totalMark + "/" + total
|
||||
|
||||
if (totalMark == sales.size) {
|
||||
getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT)
|
||||
saleAdapter!!.notifyDataSetChanged()
|
||||
|
||||
if (!goBack)
|
||||
ticketCollection_setUsedShelves()
|
||||
goBack = false
|
||||
|
@ -2448,6 +2658,7 @@ class CollectionFragment(
|
|||
|
||||
//OTROS
|
||||
private fun showScanner(index: Int, sale: SaleVO) {
|
||||
customDialogInput.getEditText().inputType = TYPE_CLASS_TEXT
|
||||
customDialogInput.setTitle("" + sale.itemFk)
|
||||
.setDescription(getString(R.string.scanWagonForItem))
|
||||
.setOkButton(getString(R.string.accept)) {
|
||||
|
@ -2575,6 +2786,62 @@ class CollectionFragment(
|
|||
}
|
||||
|
||||
|
||||
private fun groupSaleGroup(salesList: ArrayList<SaleVO>): MutableList<SaleVO> {
|
||||
var myMap = salesList.groupBy { it.saleGroupFk }
|
||||
var myList: MutableList<SaleVO> = mutableListOf()
|
||||
|
||||
for ((key, value) in myMap.entries) {
|
||||
if (key.isNullOrEmpty()) { // si no tiene saleGroup se añaden las líneas
|
||||
for (s in value) {
|
||||
myList.add(s)
|
||||
}
|
||||
} else { // si tiene saleGroup se crea el padre con el tamaño e indicando que es padre, como ejemplo se toma el primer elemento
|
||||
|
||||
/*crea padre*/
|
||||
if (value.size > 1) {
|
||||
var mySale = SaleVO(
|
||||
saleOrder = value[0].saleOrder,
|
||||
workerFk = value[0].workerFk,
|
||||
originalQuantity = null,
|
||||
quantity = null,
|
||||
rgb = null,
|
||||
saleFk = value[0].saleFk,
|
||||
saleGroupFk = value[0].saleGroupFk,
|
||||
isPreControlled = value[0].isPreControlled,
|
||||
isPrepared = value[0].isPrepared,
|
||||
isPreviousPrepared = value[0].isPreviousPrepared,
|
||||
isControlled = value[0].isControlled,
|
||||
line3 = value[0].code,
|
||||
picked = value[0].picked,
|
||||
ticketFk = value[0].ticketFk,
|
||||
level = value[0].level
|
||||
|
||||
)//prime elemento//hay que hacer una copia si no queda la referencia
|
||||
mySale.totalSales = value.size //total líneas
|
||||
mySale.isParent = true
|
||||
value as MutableList<SaleVO>
|
||||
mySale.sonSales = value as MutableList<SaleVO>
|
||||
|
||||
mySale.line1 = "Previa :${mySale.saleGroupFk}"
|
||||
mySale.line2 = "Líneas: ${value.size}"
|
||||
mySale.line3 = value[0].code
|
||||
mySale.placements = listOf(PlacementVO(shelving = value[0].code))
|
||||
|
||||
myList.add(mySale)
|
||||
} else {
|
||||
for (s in value) {
|
||||
myList.add(s)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return myList
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3,10 +3,12 @@ package es.verdnatura.presentation.view.feature.collection.fragment
|
|||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.collection.*
|
||||
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||
|
@ -143,6 +145,12 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
get() = _responseGetExtensionFromUserId
|
||||
|
||||
|
||||
val loadResponseDel = Transformations.map(_responseDel) { Event(it) }
|
||||
val loadResponseSaleTrackingMark=Transformations.map(_responseSaleTracking_mark) { Event(it) }
|
||||
val loadResponseItemShelvingUpdate=Transformations.map(_responseItemShelvingUpdate) { Event(it) }
|
||||
|
||||
|
||||
|
||||
fun collectionTicketGet(
|
||||
collectionFk: Int,
|
||||
sectorFk: Int,
|
||||
|
@ -226,14 +234,16 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
vOriginalQuantity: Int,
|
||||
vStateFk: String,
|
||||
vIsChecked: String,
|
||||
vBuyFk: Int
|
||||
vBuyFk: Int,
|
||||
vIsScanned:Boolean?
|
||||
) {
|
||||
silex.saleTrackingReplace(
|
||||
saleFk,
|
||||
vOriginalQuantity,
|
||||
vStateFk,
|
||||
vIsChecked != "0",
|
||||
vBuyFk
|
||||
vBuyFk,
|
||||
vIsScanned!!
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseSaleReplace.value = ResponseItemVO(
|
||||
|
|
|
@ -21,6 +21,9 @@ fun CollectionVO.map(context: Context): CollectionVO {
|
|||
it.agencyName = ticket.agencyName
|
||||
it.isNew = it.isAdded == "1"
|
||||
|
||||
//tarea 4723
|
||||
it.code= it.cel3
|
||||
|
||||
// sergio: OBLIGAR A ACTUALIZAR VERSIÓN PARA SUBIR DESPUÉS FICHEROS DEL BACK collection_getTickets al mismo tiempo")
|
||||
|
||||
//it.quantity = it.quantity.substring(0, it.quantity.indexOf("."))
|
||||
|
|
|
@ -120,7 +120,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
|
||||
//Tarea 5095
|
||||
/* _pasillerositem.add(
|
||||
/* _pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
1,
|
||||
R.drawable.ic_shopping_self,
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M7.41,7.84L12,12.42l4.59,-4.58L18,9.25l-6,6 -6,-6z"/>
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M7.41,15.41L12,10.83l4.59,4.58L18,14l-6,-6 -6,6z"/>
|
||||
</vector>
|
|
@ -32,9 +32,15 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
|
||||
|
||||
>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvHeadlines"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/content_layout"
|
||||
android:layout_marginTop="6dp"
|
||||
android:visibility="visible"
|
||||
tools:listitem="@layout/item_article_row_fragment"/>
|
||||
|
||||
<LinearLayout
|
||||
|
||||
|
@ -44,7 +50,7 @@
|
|||
android:orientation="vertical"
|
||||
android:padding="@dimen/layout_margin_min"
|
||||
android:textColor="@color/verdnatura_black"
|
||||
>
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -80,6 +86,7 @@
|
|||
android:textSize="@dimen/h8" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ticketFk"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{sale.ticketFk}"
|
||||
|
@ -94,7 +101,14 @@
|
|||
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:rotation="180"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="20dp"
|
||||
android:src="@drawable/ic_arrow_down" />
|
||||
<ImageView
|
||||
android:id="@+id/imageErrorMessage"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -126,6 +140,8 @@
|
|||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="39dp"
|
||||
android:background="@drawable/background_and_round_collection_fragment" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
Loading…
Reference in New Issue