refs #4923 previas

This commit is contained in:
Sergio De la torre 2023-03-22 10:39:48 +01:00
parent 2525560fe9
commit d1d7ffa42c
12 changed files with 652 additions and 296 deletions

View File

@ -276,7 +276,7 @@
</option> </option>
</component> </component>
<component name="ExternalStorageConfigurationManager" enabled="true" /> <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" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

View File

@ -14,9 +14,6 @@
<option name="jvmTarget" value="1.8" /> <option name="jvmTarget" value="1.8" />
<option name="languageVersion" value="1.6" /> <option name="languageVersion" value="1.6" />
<option name="apiVersion" value="1.6" /> <option name="apiVersion" value="1.6" />
<option name="pluginOptions">
<array />
</option>
<option name="pluginClasspaths"> <option name="pluginClasspaths">
<array> <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" /> <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" /> <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> </array>
</option> </option>
<option name="pluginOptions">
<array />
</option>
<option name="errors"> <option name="errors">
<ArgumentParseErrors /> <ArgumentParseErrors />
</option> </option>

View File

@ -83,12 +83,19 @@
</select> </select>
</component> </component>
<component name="ChangeListManager"> <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/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$/.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/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/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> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -99,7 +106,7 @@
<component name="CodeInsightWorkspaceSettings"> <component name="CodeInsightWorkspaceSettings">
<option name="optimizeImportsOnTheFly" value="true" /> <option name="optimizeImportsOnTheFly" value="true" />
</component> </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"> <component name="ExportToHTMLSettings">
<option name="OPEN_IN_BROWSER" value="true" /> <option name="OPEN_IN_BROWSER" value="true" />
<option name="OUTPUT_DIRECTORY" value="C:\Program Files\Android\Android Studio\inspections" /> <option name="OUTPUT_DIRECTORY" value="C:\Program Files\Android\Android Studio\inspections" />
@ -237,12 +244,14 @@
&quot;keyToString&quot;: { &quot;keyToString&quot;: {
&quot;ApkExportedModule&quot;: &quot;Gestor_Almacén.app&quot;, &quot;ApkExportedModule&quot;: &quot;Gestor_Almacén.app&quot;,
&quot;ExportApk.ApkPathForGestor_Almacén.app&quot;: &quot;C:\\Users\\sergiodt\\AndroidStudioProjects\\vn-warehouseManager\\app&quot;, &quot;ExportApk.ApkPathForGestor_Almacén.app&quot;: &quot;C:\\Users\\sergiodt\\AndroidStudioProjects\\vn-warehouseManager\\app&quot;,
&quot;PROJECT_TRUSTED_KEY&quot;: &quot;true&quot;,
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;, &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.cidr.known.project.marker&quot;: &quot;true&quot;, &quot;RunOnceActivity.cidr.known.project.marker&quot;: &quot;true&quot;,
&quot;ScreenRecorder.SavePath&quot;: &quot;C:\\Users\\sergiodt\\device-2023-03-17-114045.mp4&quot;,
&quot;cidr.known.project.marker&quot;: &quot;true&quot;, &quot;cidr.known.project.marker&quot;: &quot;true&quot;,
&quot;com.google.services.firebase.aqiPopupShown&quot;: &quot;true&quot;, &quot;com.google.services.firebase.aqiPopupShown&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;C:/Users/sergiodt/proyectos/Rocket.Chat.ReactNative/android/app&quot;, &quot;last_opened_file_path&quot;: &quot;C:/Users/sergiodt&quot;,
&quot;project.structure.last.edited&quot;: &quot;Modules&quot;, &quot;project.structure.last.edited&quot;: &quot;Modules&quot;,
&quot;project.structure.proportion&quot;: &quot;0.17&quot;, &quot;project.structure.proportion&quot;: &quot;0.17&quot;,
&quot;project.structure.side.proportion&quot;: &quot;0.2&quot;, &quot;project.structure.side.proportion&quot;: &quot;0.2&quot;,
@ -396,62 +405,6 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1618825571576</updated> <updated>1618825571576</updated>
</task> </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,"> <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> <created>1656930096719</created>
<option name="number" value="00069" /> <option name="number" value="00069" />
@ -739,7 +692,63 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1676562624751</updated> <updated>1676562624751</updated>
</task> </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 /> <servers />
</component> </component>
<component name="Vcs.Log.History.Properties"> <component name="Vcs.Log.History.Properties">
@ -781,7 +790,7 @@
<entry key="branch"> <entry key="branch">
<value> <value>
<list> <list>
<option value="testBeta" /> <option value="testBeta_5109_Agrupar_sales_exandible_simple" />
</list> </list>
</value> </value>
</entry> </entry>
@ -840,12 +849,6 @@
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" /> <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.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 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" /> <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="Version 23.2 Modificado actualizar pantalla al transferir en Ubicador. Subida version" />
<MESSAGE value="Activado impresion labelCount" /> <MESSAGE value="Activado impresion labelCount" />
<MESSAGE value="Quitar procedimiento refs #4661" /> <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>
<component name="XDebuggerManager"> <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> <pin-to-top-manager>
<pinned-members> <pinned-members>
<PinnedItemInfo parentTag="java.net.SocketException" memberName="detailMessage" /> <PinnedItemInfo parentTag="java.net.SocketException" memberName="detailMessage" />

View File

@ -40,7 +40,6 @@ android {
} }
} }
buildFeatures { buildFeatures {
viewBinding = true viewBinding = true
} }

View File

@ -25,12 +25,20 @@ class SaleAdapter(
private val onSaleClickListener: OnSaleClickListener, private val onSaleClickListener: OnSaleClickListener,
private val onMistakeClickListener: OnMistakeClickListener, private val onMistakeClickListener: OnMistakeClickListener,
private val onPackingClick: onPackingClickListener, 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 context: Context? = null
var position: Int = 0 var position: Int = 0
var isExpanded: Boolean = false
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
this.context = parent.context this.context = parent.context
return AjustesItemHolder( return AjustesItemHolder(
ItemArticleRowFragmentBinding.inflate( ItemArticleRowFragmentBinding.inflate(
@ -59,6 +67,9 @@ class SaleAdapter(
val childLayoutManager = val childLayoutManager =
LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false) LinearLayoutManager(context!!, RecyclerView.HORIZONTAL, false)
val childLayoutManagerV =
LinearLayoutManager(context!!, RecyclerView.VERTICAL, false)
itemArticlePlacements.apply { itemArticlePlacements.apply {
layoutManager = childLayoutManager layoutManager = childLayoutManager
adapter = PlacementAdapter(sale.placements, onPasillerosItemClickListener) adapter = PlacementAdapter(sale.placements, onPasillerosItemClickListener)
@ -66,7 +77,9 @@ class SaleAdapter(
//CLICK EVENTS //CLICK EVENTS
contentLayout.setOnClickListener { contentLayout.setOnClickListener {
onSaleClickListener.onSaleClick(sale) if (!sale.isParent) {
onSaleClickListener.onSaleClick(sale)
}
} }
itemArticleItemFk.setOnClickListener { itemArticleItemFk.setOnClickListener {
@ -92,22 +105,24 @@ class SaleAdapter(
txtde.setOnClickListener { txtde.setOnClickListener {
onQuantityClick.onQuantityClick(sale) 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{ /*itemRowLayout.setOnLongClickListener{
onMistakeClickListener.onMistakeClickListener(sale) onMistakeClickListener.onMistakeClickListener(sale)
false false
}*/ }*/
//Tarea #5004 //Tarea #5004
/* if (sale.hasMistake){ /* if (sale.hasMistake){
imageErrorMessage.setBackgroundColor(color.RED) imageErrorMessage.setBackgroundColor(color.RED)
}*/ }*/
imageErrorMessage.setOnClickListener { imageErrorMessage.setOnClickListener {
onMistakeClickListener.onMistakeClickListener(sale) onMistakeClickListener.onMistakeClickListener(sale)
@ -127,7 +142,7 @@ class SaleAdapter(
sale.pickedQuantity = sale.quantity 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) { if (sale.isNew) {
layoutError.visibility = View.VISIBLE 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 //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) { private fun paintTicketcolor(color: String?, itemView: View) {
if (color.isNullOrBlank()) { if (color.isNullOrBlank()) {
@ -363,12 +417,6 @@ class SaleAdapter(
when (color.uppercase().trim()) { when (color.uppercase().trim()) {
"ROJO" -> "ROJO" ->
itemView.setBackgroundColor(Color.RED) 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" -> "AMARILLO" ->
itemView.setBackgroundColor(Color.YELLOW) itemView.setBackgroundColor(Color.YELLOW)

View File

@ -10,12 +10,14 @@ import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.os.Parcelable import android.os.Parcelable
import android.text.InputType import android.text.InputType
import android.text.InputType.TYPE_CLASS_TEXT
import android.util.Log.d import android.util.Log.d
import android.view.KeyEvent import android.view.KeyEvent
import android.view.KeyEvent.ACTION_DOWN import android.view.KeyEvent.ACTION_DOWN
import android.view.View import android.view.View
import android.view.View.GONE import android.view.View.GONE
import android.view.View.VISIBLE import android.view.View.VISIBLE
import android.view.WindowManager
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import android.widget.ImageView import android.widget.ImageView
@ -24,12 +26,14 @@ import androidx.annotation.RequiresApi
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.google.gson.Gson
import es.verdnatura.R import es.verdnatura.R
import es.verdnatura.databinding.FragmentCollectionBinding import es.verdnatura.databinding.FragmentCollectionBinding
import es.verdnatura.domain.ConstAndValues.CONTROLADOR import es.verdnatura.domain.ConstAndValues.CONTROLADOR
import es.verdnatura.domain.ConstAndValues.OK import es.verdnatura.domain.ConstAndValues.OK
import es.verdnatura.domain.ConstAndValues.PRECHECKER import es.verdnatura.domain.ConstAndValues.PRECHECKER
import es.verdnatura.domain.ConstAndValues.SACADOR import es.verdnatura.domain.ConstAndValues.SACADOR
import es.verdnatura.domain.notNull
import es.verdnatura.domain.toast import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.* import es.verdnatura.presentation.common.*
@ -54,6 +58,7 @@ class CollectionFragment(
private lateinit var dataMessageSalix: DataMessageSalix private lateinit var dataMessageSalix: DataMessageSalix
private var sales: List<SaleVO> = listOf() private var sales: List<SaleVO> = listOf()
private var salesParent: List<SaleVO> = listOf()
private var saleAdapter: SaleAdapter? = null private var saleAdapter: SaleAdapter? = null
private var lm: LinearLayoutManager? = null private var lm: LinearLayoutManager? = null
private var storedPosition: Int = 0 private var storedPosition: Int = 0
@ -103,6 +108,8 @@ class CollectionFragment(
private var recylerViewState: Parcelable? = null private var recylerViewState: Parcelable? = null
private var isScanned: Boolean? = null private var isScanned: Boolean? = null
private lateinit var myGroupList: List<SaleVO>
companion object { companion object {
fun newInstance(collection: CollectionVO, type: String) = fun newInstance(collection: CollectionVO, type: String) =
CollectionFragment(collection, type) CollectionFragment(collection, type)
@ -122,12 +129,10 @@ class CollectionFragment(
if (type.equals(CONTROLADOR)) { if (type.equals(CONTROLADOR)) {
//sergio: comprueba si viene de la pantalla de controlador //sergio: comprueba si viene de la pantalla de controlador
//Tarea #4280 cambiar a ticket_isOutClosureZone //Tarea #4280 cambiar a ticket_isOutClosureZone
/* viewModel.ticket_checkFullyControlled( /* viewModel.ticket_isOutClosureZone(
getData(USER), collection.collectionFk
getData(PASSWORD),
collection.collectionFk
)*/ )*/
workerFkFromTicket = collection.tickets.get(0).sales.get(0).workerFk 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 //sergio:para ver si ha marcado dos veces el mismo ticket
binding.scanInput.setText(textScanned_filterDouble(binding.scanInput.text!!.toString())) 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 buttonPushedGetCollection = false
} }
@ -628,20 +645,20 @@ class CollectionFragment(
})*/ })*/
//Tarea 4280 //Tarea 4280
/* responseTicketClosure.observe(viewLifecycleOwner, Observer { responseTicketClosure.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
if (!goBack) { if (!goBack) {
if (it.response.toBoolean()) { if (it.response.toBoolean()) {
var customDialogWarning = CustomDialog(requireContext()) var customDialogWarning = CustomDialog(requireContext())
customDialogWarning.setTitle(getString(R.string.urgentWarning)) customDialogWarning.setTitle(getString(R.string.urgentWarning))
customDialogWarning.setDescription(getString(R.string.ticketWarning)) customDialogWarning.setDescription(getString(R.string.ticketWarning))
.setOkButton(getString(R.string.aware)) { .setOkButton(getString(R.string.aware)) {
customDialogWarning.dismiss() customDialogWarning.dismiss()
}.show() }.show()
} }
} }
})*/ })
responseIncQuantity.observe(viewLifecycleOwner, Observer { responseIncQuantity.observe(viewLifecycleOwner, Observer {
@ -755,50 +772,88 @@ class CollectionFragment(
//goBack = false //goBack = false
} }
}) })
responseDel.observe(viewLifecycleOwner, Observer {
if (it.isError) { loadResponseDel.observe(viewLifecycleOwner) { event ->
binding.splashProgress.visibility = GONE event.getContentIfNotHandled().notNull {
if (!goBack) { 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) 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)
}
} else {
responseItemShelvingUpdate.observe(viewLifecycleOwner, Observer { //Test volver atrás
if (!goBack){
if (it.isError) { viewModel.saleTrackingDel(
saleFk = sales[positionUnmarked].saleFk
if (!goBack) { )}
goBack = false
ma.messageWithSound(it.errorMessage, it.isError, false)
} }
})*/
} else {
viewModel.saleTrackingDel(
saleFk = sales[positionUnmarked].saleFk
)
goBack = false
}
})
responseSaleReplace.observe(viewLifecycleOwner, Observer { responseSaleReplace.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
@ -823,14 +878,51 @@ class CollectionFragment(
goBack = false 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 ////Tarea #4371
responseSaleTracking_mark.observe(viewLifecycleOwner, Observer { /* responseSaleTracking_mark.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE binding.splashProgress.visibility = GONE
if (it.isError) { if (it.isError) {
//TEST3 //TEST3
/* if (getDataInt(USERFK) == 18890 || getDataInt(USERFK) == 19591) { *//* if (getDataInt(USERFK) == 18890 || getDataInt(USERFK) == 19591) {
"La línea NO se ha marcado correctamente".toast(context) "La línea NO se ha marcado correctamente".toast(context)
}*/ }*//*
if (!goBack) { if (!goBack) {
ma.messageWithSound(it.errorMessage, it.isError, true) ma.messageWithSound(it.errorMessage, it.isError, true)
@ -850,14 +942,14 @@ class CollectionFragment(
"La línea se ha marcado correctamente".toast(context) "La línea se ha marcado correctamente".toast(context)
} }
saleAdapter!!.notifyDataSetChanged() saleAdapter!!.notifyDataSetChanged()
setListPosition(storedPosition, false)
ReviewQuantityForRefreshingAndSorting( ReviewQuantityForRefreshingAndSorting(
sales[storedPosition].quantity!!.toInt(), sales[storedPosition].quantity!!.toInt(),
sales[storedPosition].pickedQuantity!!.toInt() sales[storedPosition].pickedQuantity!!.toInt()
) )
goBack = false goBack = false
} }
}) })*/
responseItemShelvingSaleSupplyAdd.observe(viewLifecycleOwner, Observer { responseItemShelvingSaleSupplyAdd.observe(viewLifecycleOwner, Observer {
@ -993,92 +1085,119 @@ class CollectionFragment(
sales = salesList.sortedWith(compareBy({ it.saleOrder })) sales = salesList.sortedWith(compareBy({ it.saleOrder }))
/* for (s in sales) { myGroupList = groupSaleGroup(salesList).sortedWith(compareBy({ it.saleOrder }))
d("VERDNATURA::", "El id es " + s.saleFk + " tiene saleOrder" + s.saleOrder)
}*/
if (type == CONTROLADOR) { if (type == CONTROLADOR) {
sales = salesList.sortedWith(compareBy({ it.picked })) sales = salesList.sortedWith(compareBy({ it.picked }))
myGroupList = groupSaleGroup(salesList).sortedWith(compareBy({ it.picked }))
} }
saleAdapter = 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 -> sales.forEachIndexed { index, saleVO ->
if (saleVO.saleFk == sale.saleFk) { if (saleVO.saleFk == sale.saleFk) {
if (type != "PRECHECKER") { if (type != "PRECHECKER") {
showQuantityDialog(index) 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)
} }
} }
} }
} }
} },
object : OnSaleClickListener {
override fun onSaleClick(sale: SaleVO) {
}, object : OnMistakeClickListener { sales.forEachIndexed { index, saleVO ->
override fun onMistakeClickListener(sale: SaleVO) { if (saleVO.saleFk == sale.saleFk) {
//Tarea #4969
binding.splashProgress.visibility = VISIBLE
viewModel.mistakeType()
mistakeSale = sale
goMistakeBack = false
} if (type == CONTROLADOR || type == PRECHECKER) {// sergio:cuidado , esta es de lo último para marcar colores
}, object : onPackingClickListener { isScanned = false
override fun onPackingClick(sale: SaleVO) { markLine(index, type)
item_updatePackingShelve(sale.itemFk) /// 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) lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
binding.fragmentSacadorCollections.adapter = saleAdapter binding.fragmentSacadorCollections.adapter = saleAdapter
binding.fragmentSacadorCollections.layoutManager = lm binding.fragmentSacadorCollections.layoutManager = lm
setTotalLines() setTotalLines()
//Tarea #4628 //Tarea #4628
if (type == CONTROLADOR) { if (type == CONTROLADOR) {
setListPosition(storedBackPosition, true) setListPosition(storedBackPosition, true)
setScrollListener(lm!!) setScrollListener(lm!!)
} else {
if (storedPosition != 0)
setListPosition(storedPosition, true)
else if (storedBackPosition != 0)
setListPosition(storedBackPosition, true)
} }
//CAU ISMAELCT //CAU ISMAELCT
if (type == SACADOR) { else {
for (indice in sales.indices) {
if (sales[indice].isPrepared == "0") { if (type == SACADOR) {
setListPosition(position = indice, isFromBack = true) setStoredPosition(true)
break } else {
} if (storedPosition != 0)
setListPosition(storedPosition, true)
else if (storedBackPosition != 0)
setListPosition(storedBackPosition, true)
} }
} }
@ -1203,6 +1322,7 @@ class CollectionFragment(
} }
//2- Por barcode //2- Por barcode
saleVO.Barcodes.forEach { barcode -> saleVO.Barcodes.forEach { barcode ->
if (txtscan == barcode) { if (txtscan == barcode) {
if (mpok != null) mpok!!.start() if (mpok != null) mpok!!.start()
isOk = true isOk = true
@ -1256,12 +1376,10 @@ class CollectionFragment(
if (type.equals(CONTROLADOR)) { if (type.equals(CONTROLADOR)) {
//Tarea #4280 cambiar a ticket_isOutClosureZone //Tarea #4280 cambiar a ticket_isOutClosureZone
/* viewModel.ticket_checkFullyControlled( /* viewModel.ticket_isOutClosureZone(
getData(USER), txtscan.toInt()
getData(PASSWORD),
txtscan
)*/ )*/
} }
} }
@ -1335,15 +1453,22 @@ class CollectionFragment(
if (sales[position].isPrepared == "1") { if (sales[position].isPrepared == "1") {
sales[position].pickedQuantity = sales[position].quantity!! sales[position].pickedQuantity = sales[position].quantity!!
} }
checkStateParent()
} else if (type == CONTROLADOR) } else if (type == CONTROLADOR) {
sales[position].isControlled = if (sales[position].isControlled == "1") "0" else "1" 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) { if (type == PRECHECKER) {
sales[position].isPreControlled = sales[position].isPreControlled =
if (sales[position].isPreControlled == "1") "0" else "1" if (sales[position].isPreControlled == "1") "0" else "1"
checkStateParent()
} }
//Tarea #4371 se quita y se deja en el response de viewmodel saleTracking_mark //Tarea #4371 se quita y se deja en el response de viewmodel saleTracking_mark
//saleAdapter!!.notifyDataSetChanged() //saleAdapter!!.notifyDataSetChanged()
//setListPosition(position, false) //setListPosition(position, false)
@ -1360,6 +1485,41 @@ class CollectionFragment(
setTotalLines() 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) { private fun setListPosition(position: Int, isFromBack: Boolean) {
storedPosition = position storedPosition = position
//tarea #4628, se asigna storedBackPosition //tarea #4628, se asigna storedBackPosition
@ -1375,6 +1535,7 @@ class CollectionFragment(
binding.fragmentSacadorCollections.addViewObserver { binding.fragmentSacadorCollections.addViewObserver {
lm!!.scrollToPositionWithOffset(position, 0) lm!!.scrollToPositionWithOffset(position, 0)
} }
} }
} else if (isFromBack) { } else if (isFromBack) {
@ -1386,6 +1547,7 @@ class CollectionFragment(
} }
} }
} }
private fun saleTrackingReplace(position: Int, type: String) { 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", 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!!, vOriginalQuantity = sales[position].pickedQuantity!!,
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(), 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) { private fun saleTracking_mark(position: Int, type: String) {
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
viewModel.saleTracking_mark( viewModel.run {
saleFk = sales[position].saleFk, saleTracking_mark(
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1", saleFk = sales[position].saleFk,
vOriginalQuantity = sales[position].pickedQuantity!!, vIsChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(), vOriginalQuantity = sales[position].pickedQuantity!!,
vBuyFk = originalItemScan!!, vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
vItemShelvingFk = itemShelvingTracking_mark, vBuyFk = originalItemScan!!,
vQuantity = customDialogList.getValue().toInt(), vItemShelvingFk = itemShelvingTracking_mark,
vIsScanned = isScanned vQuantity = customDialogList.getValue().toInt(),
vIsScanned = isScanned
) )
}
isScanned = null isScanned = null
} }
@ -1437,6 +1602,7 @@ class CollectionFragment(
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
viewModel.itemShelving_updateFromSale( viewModel.itemShelving_updateFromSale(
sales[position].saleFk sales[position].saleFk
) )
@ -1604,7 +1770,7 @@ class CollectionFragment(
} catch (e: Exception) { } catch (e: Exception) {
} }
try { try {
customDialogList.getEditTextTwo().setRawInputType(InputType.TYPE_CLASS_NUMBER) customDialogList.getEditTextTwo().setRawInputType(InputType.TYPE_CLASS_NUMBER)
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event -> customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
@ -1722,10 +1888,29 @@ class CollectionFragment(
type 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 { private fun checkItemScan(valueToCheck: String): Boolean {
d("VERDNATURA::", "Entramos a ver el checkItem") d("VERDNATURA::", "Entramos a ver el checkItem")
@ -1834,10 +2019,12 @@ class CollectionFragment(
if (listPlacementSupply.size == 1) { if (listPlacementSupply.size == 1) {
ticketSelected = listPlacementSupply[0].code!!.toInt() ticketSelected = listPlacementSupply[0].code!!.toInt()
} }
customDialogList.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
customDialogList.getEditTextTwo().inputType = InputType.TYPE_CLASS_NUMBER 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) customDialogList.setTitle(getString(R.string.Agregarartículoparaticket) + " " + ticketSelected)
.setOkButton(getString(R.string.Agregar)) { .setOkButton(getString(R.string.Agregar)) {
if (ticketSelected == 0) { if (ticketSelected == 0) {
getString(R.string.Seleccionaunticketdelaista).toast(requireContext()) getString(R.string.Seleccionaunticketdelaista).toast(requireContext())
} else if (customDialogList.getValue() } else if (customDialogList.getValue()
@ -1874,21 +2061,36 @@ class CollectionFragment(
customDialogList.dismiss() customDialogList.dismiss()
}.setHintValue(getString(R.string.Artículo)).setValue("") }.setHintValue(getString(R.string.Artículo)).setValue("")
.setHintValueTwo(getString(R.string.Cantidad)).setValueTwo("").show() .setHintValueTwo(getString(R.string.Cantidad)).setValueTwo("").show()
customDialogList.getEditText().requestFocus() customDialogList.getEditText().requestFocus()
hideKeyboards() hideKeyboards()
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event -> customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!customDialogList.getValue().isNullOrEmpty()) { 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() customDialogList.getEditTextTwo().requestFocus()
} }
hideKeyboards() //hideKeyboards()
return@setOnEditorActionListener true return@setOnEditorActionListener true
} }
false false
} }
customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event -> customDialogList.getEditTextTwo().setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) { if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {
if (!customDialogList.getValueTwo().isNullOrEmpty()) { if (!customDialogList.getValueTwo().isNullOrEmpty()) {
@ -1941,6 +2143,7 @@ class CollectionFragment(
customDialogList.getRecyclerView().layoutManager = customDialogList.getRecyclerView().layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
} }
/* private fun showDisponibility() { /* private fun showDisponibility() {
@ -2021,7 +2224,7 @@ class CollectionFragment(
totalMark += 1 totalMark += 1
} }
} else if (type == CONTROLADOR) { } else if (type == CONTROLADOR) {
if (it.isControlled == "1" || it.isControlled == "2") if ((it.isControlled == "1" || it.isControlled == "2") && !it.isParent)
totalMark += 1 totalMark += 1
}//Refactor #4030 }//Refactor #4030
@ -2035,11 +2238,18 @@ class CollectionFragment(
if (binding.mainToolbar.toolbarTitle != null) binding.mainToolbar.toolbarTitle.text = if (binding.mainToolbar.toolbarTitle != null) binding.mainToolbar.toolbarTitle.text =
if (collection.collectionFk != 0) collection.collectionFk.toString() else "" 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 = if (binding.mainToolbar.toolbarSubtitle != null && totalMark != null) binding.mainToolbar.toolbarSubtitle.text =
"" + totalMark + "/" + sales.size "" + totalMark + "/" + total
if (totalMark == sales.size) { if (totalMark == sales.size) {
getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT) getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT)
saleAdapter!!.notifyDataSetChanged()
if (!goBack) if (!goBack)
ticketCollection_setUsedShelves() ticketCollection_setUsedShelves()
goBack = false goBack = false
@ -2448,6 +2658,7 @@ class CollectionFragment(
//OTROS //OTROS
private fun showScanner(index: Int, sale: SaleVO) { private fun showScanner(index: Int, sale: SaleVO) {
customDialogInput.getEditText().inputType = TYPE_CLASS_TEXT
customDialogInput.setTitle("" + sale.itemFk) customDialogInput.setTitle("" + sale.itemFk)
.setDescription(getString(R.string.scanWagonForItem)) .setDescription(getString(R.string.scanWagonForItem))
.setOkButton(getString(R.string.accept)) { .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
}
} }

View File

@ -3,10 +3,12 @@ package es.verdnatura.presentation.view.feature.collection.fragment
import android.content.Context import android.content.Context
import androidx.lifecycle.LiveData import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import es.verdnatura.domain.SilexCallback import es.verdnatura.domain.SilexCallback
import es.verdnatura.presentation.base.BaseViewModel import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.base.getMessageFromAllResponse import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.common.ResponseItemVO import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.collection.* import es.verdnatura.presentation.view.feature.collection.*
import es.verdnatura.presentation.view.feature.collection.mapper.map import es.verdnatura.presentation.view.feature.collection.mapper.map
@ -143,6 +145,12 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
get() = _responseGetExtensionFromUserId 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( fun collectionTicketGet(
collectionFk: Int, collectionFk: Int,
sectorFk: Int, sectorFk: Int,
@ -226,14 +234,16 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
vOriginalQuantity: Int, vOriginalQuantity: Int,
vStateFk: String, vStateFk: String,
vIsChecked: String, vIsChecked: String,
vBuyFk: Int vBuyFk: Int,
vIsScanned:Boolean?
) { ) {
silex.saleTrackingReplace( silex.saleTrackingReplace(
saleFk, saleFk,
vOriginalQuantity, vOriginalQuantity,
vStateFk, vStateFk,
vIsChecked != "0", vIsChecked != "0",
vBuyFk vBuyFk,
vIsScanned!!
).enqueue(object : SilexCallback<Any>(context) { ).enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
_responseSaleReplace.value = ResponseItemVO( _responseSaleReplace.value = ResponseItemVO(

View File

@ -21,6 +21,9 @@ fun CollectionVO.map(context: Context): CollectionVO {
it.agencyName = ticket.agencyName it.agencyName = ticket.agencyName
it.isNew = it.isAdded == "1" 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") // 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(".")) //it.quantity = it.quantity.substring(0, it.quantity.indexOf("."))

View File

@ -120,7 +120,7 @@ class PasilleroViewModel(context: Context) : BaseViewModel(context) {
) )
//Tarea 5095 //Tarea 5095
/* _pasillerositem.add( /* _pasillerositem.add(
PasillerosItemVO( PasillerosItemVO(
1, 1,
R.drawable.ic_shopping_self, R.drawable.ic_shopping_self,

View File

@ -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>

View File

@ -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>

View File

@ -32,9 +32,15 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" 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 <LinearLayout
@ -44,7 +50,7 @@
android:orientation="vertical" android:orientation="vertical"
android:padding="@dimen/layout_margin_min" android:padding="@dimen/layout_margin_min"
android:textColor="@color/verdnatura_black" android:textColor="@color/verdnatura_black"
> >
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -80,6 +86,7 @@
android:textSize="@dimen/h8" /> android:textSize="@dimen/h8" />
<TextView <TextView
android:id="@+id/ticketFk"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{sale.ticketFk}" android:text="@{sale.ticketFk}"
@ -94,7 +101,14 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal"> 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 <ImageView
android:id="@+id/imageErrorMessage" android:id="@+id/imageErrorMessage"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -126,6 +140,8 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="39dp" android:layout_marginLeft="39dp"
android:background="@drawable/background_and_round_collection_fragment" /> android:background="@drawable/background_and_round_collection_fragment" />
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>