Formateado código

This commit is contained in:
Sergio De la torre 2023-02-17 07:15:53 +01:00
parent 8abea66221
commit 19eaf275cd
2 changed files with 56 additions and 58 deletions

View File

@ -83,11 +83,8 @@
</select>
</component>
<component name="ChangeListManager">
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="Version 23.4Beta Buscar item, isScanned preparado">
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="Activado impresion labelCount">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/app/build.gradle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/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/ShowTicketFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/ShowTicketFragment.kt" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -99,7 +96,7 @@
<component name="CodeInsightWorkspaceSettings">
<option name="optimizeImportsOnTheFly" value="true" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[21114523025303]" />
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[C:\Users\sergiodt\.android\avd\Pixel_2_API_24.avd]" />
<component name="ExportToHTMLSettings">
<option name="OPEN_IN_BROWSER" value="true" />
<option name="OUTPUT_DIRECTORY" value="C:\Program Files\Android\Android Studio\inspections" />
@ -392,13 +389,6 @@
<option name="presentableId" value="Default" />
<updated>1618825571576</updated>
</task>
<task id="LOCAL-00060" summary="Version 8.4.1Beta, strings y return finish">
<created>1653644047502</created>
<option name="number" value="00060" />
<option name="presentableId" value="LOCAL-00060" />
<option name="project" value="LOCAL" />
<updated>1653644047502</updated>
</task>
<task id="LOCAL-00061" summary="Version 8.4.1Beta,Tarea #3958">
<created>1653663791334</created>
<option name="number" value="00061" />
@ -735,7 +725,14 @@
<option name="project" value="LOCAL" />
<updated>1674813532898</updated>
</task>
<option name="localTasksCounter" value="109" />
<task id="LOCAL-00109" summary="Activado impresion labelCount">
<created>1676562624750</created>
<option name="number" value="00109" />
<option name="presentableId" value="LOCAL-00109" />
<option name="project" value="LOCAL" />
<updated>1676562624751</updated>
</task>
<option name="localTasksCounter" value="110" />
<servers />
</component>
<component name="Vcs.Log.History.Properties">
@ -836,7 +833,6 @@
</component>
<component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="Version 9.2.1 Modificado fragment" />
<MESSAGE value="Version 9.2.1 Modificado fragment a fragment_general" />
<MESSAGE value="Version 9.2.1 añadido error encajado y modificado marcaje" />
<MESSAGE value="Version 9.2.1 en producción" />
@ -861,7 +857,8 @@
<MESSAGE value="Version 23.2-Fallo item_card" />
<MESSAGE value="Version 23.2 Modificado orden ubicador y revisión anterior falta activar icono" />
<MESSAGE value="Version 23.2 Modificado actualizar pantalla al transferir en Ubicador. Subida version" />
<option name="LAST_COMMIT_MESSAGE" value="Version 23.2 Modificado actualizar pantalla al transferir en Ubicador. Subida version" />
<MESSAGE value="Activado impresion labelCount" />
<option name="LAST_COMMIT_MESSAGE" value="Activado impresion labelCount" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>

View File

@ -57,7 +57,7 @@ class CollectionShowTicketFragment(
viewModel.collectionTicketGet(
collection.collectionFk,
getDataInt(SECTORFK),
print="0",
print = "0",
type
)
}
@ -99,16 +99,17 @@ class CollectionShowTicketFragment(
binding.mainToolbar.toolbarIcons.adapter =
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
override fun onOptionsItemSelected(item: Drawable) {
when (item){
iconPrint.drawable->print()
iconViewCollection.drawable->getCollection()
}
when (item) {
iconPrint.drawable -> print()
iconViewCollection.drawable -> getCollection()
}
}
})
binding.mainToolbar.toolbarIcons.layoutManager =
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
}
private fun getCollection() {
binding.splashProgress.visibility = VISIBLE
@ -125,7 +126,7 @@ class CollectionShowTicketFragment(
viewModel.collectionTicketGet(
lastScanned,
getDataInt(SECTORFK),
print="0",
print = "0",
type
)
@ -136,36 +137,37 @@ class CollectionShowTicketFragment(
private fun print() {
//tarea#4672
var isTicket = false
for (t in collection.tickets) {
if (t.ticketFk.toInt()==(collection.collectionFk)) {
isTicket = true
}
}
if (isTicket){
val builder = AlertDialog.Builder(context)
builder.setTitle(getString(R.string.selectLabeltoPrint))
val labelCount = arrayOf("1", "2", "3", "4", "5","6","7","8","9","10")
builder.setItems(labelCount) { dialog, which ->
viewModel.collectionStickerPrint(
collectionFk = collection.collectionFk,
labelCount = (which+1)
)
}
val dialog = builder.create()
dialog.show()
}else{
//tarea#4672
var isTicket = false
for (t in collection.tickets) {
if (t.ticketFk.toInt() == (collection.collectionFk)) {
isTicket = true
}
}
if (isTicket) {
val builder = AlertDialog.Builder(context)
builder.setTitle(getString(R.string.selectLabeltoPrint))
val labelCount = arrayOf("1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
builder.setItems(labelCount) { dialog, which ->
viewModel.collectionStickerPrint(
collectionFk = collection.collectionFk,
labelCount = null
labelCount = (which + 1)
)
}
val dialog = builder.create()
dialog.show()
} else {
viewModel.collectionStickerPrint(
collectionFk = collection.collectionFk,
labelCount = null
)
}
}
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
@ -179,7 +181,7 @@ class CollectionShowTicketFragment(
viewModel.collectionTicketGet(
binding.scanInput.text.toString().toInt(),
getDataInt(SECTORFK),
print="0",
print = "0",
type
)
@ -203,7 +205,7 @@ class CollectionShowTicketFragment(
viewModel.collectionTicketGet(
collection.collectionFk,
getDataInt(SECTORFK),
print="0",
print = "0",
type
)
binding.collectionSwipe.isRefreshing = false
@ -234,7 +236,7 @@ class CollectionShowTicketFragment(
binding.mainToolbar.toolbarSubtitle.text = "0/0"
}
} else {
ma.messageWithSound(it.errorMessage,it.isError,false)
ma.messageWithSound(it.errorMessage, it.isError, false)
if (activity != null) requireActivity().onBackPressed()
}
@ -244,14 +246,14 @@ class CollectionShowTicketFragment(
responsePrint.observe(viewLifecycleOwner, Observer {
binding.splashProgress.visibility = GONE
if (it.isError) {
ma.messageWithSound(
it.errorMessage,
it.isError, true
)
}else{
(getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast(requireContext())
}
if (it.isError) {
ma.messageWithSound(
it.errorMessage,
it.isError, true
)
} else {
(getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast(requireContext())
}
})
@ -293,7 +295,7 @@ class CollectionShowTicketFragment(
}, object : OnMistakeClickListener {
override fun onMistakeClickListener(sale: SaleVO) {
}
},object : onPackingClickListener{
}, object : onPackingClickListener {
override fun onPackingClick(sale: SaleVO) {
}
@ -320,13 +322,12 @@ class CollectionShowTicketFragment(
}
private fun setTotalLines() {
var totalMark = 0
sales.forEach {
if (it.isControlled == "1")
totalMark += 1
if (it.isControlled == "1")
totalMark += 1
}
binding.mainToolbar.toolbarTitle.text =
collection.collectionFk.toString()