refs #4731 print
This commit is contained in:
parent
6c58e8012f
commit
4c63845dca
|
@ -83,12 +83,8 @@
|
||||||
</select>
|
</select>
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #4021">
|
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #4731 print">
|
||||||
<change afterPath="$PROJECT_DIR$/app/beta/release/output-metadata.json" 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/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/app/build.gradle" 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/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/presacador/fragment/InitPreSacadorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/InitPreSacadorFragment.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/InitPreSacadorFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/InitPreSacadorFragment.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/values-es/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values-es/strings.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/res/values-es/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values-es/strings.xml" afterDir="false" />
|
||||||
|
@ -402,13 +398,6 @@
|
||||||
<option name="presentableId" value="Default" />
|
<option name="presentableId" value="Default" />
|
||||||
<updated>1618825571576</updated>
|
<updated>1618825571576</updated>
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00071" summary="Version 9Beta, dos opciones a Paletizadores y carros de operator">
|
|
||||||
<created>1662699501924</created>
|
|
||||||
<option name="number" value="00071" />
|
|
||||||
<option name="presentableId" value="LOCAL-00071" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1662699501924</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00072" summary="Version 9Beta-Tarea3420">
|
<task id="LOCAL-00072" summary="Version 9Beta-Tarea3420">
|
||||||
<created>1662982877783</created>
|
<created>1662982877783</created>
|
||||||
<option name="number" value="00072" />
|
<option name="number" value="00072" />
|
||||||
|
@ -745,7 +734,14 @@
|
||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1679575710293</updated>
|
<updated>1679575710293</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="120" />
|
<task id="LOCAL-00120" summary="refs #4731 print">
|
||||||
|
<created>1679905259957</created>
|
||||||
|
<option name="number" value="00120" />
|
||||||
|
<option name="presentableId" value="LOCAL-00120" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1679905259957</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="121" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="Vcs.Log.History.Properties">
|
<component name="Vcs.Log.History.Properties">
|
||||||
|
@ -846,7 +842,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.6Beta Interteptors, quitando userCase y arreglado click sobre carita. Cambiado .gitignore" />
|
|
||||||
<MESSAGE value="Version 9.6Beta Añadido a BaseFragment(context). Quitado código repetido de las llamadas" />
|
<MESSAGE value="Version 9.6Beta Añadido a BaseFragment(context). Quitado código repetido de las llamadas" />
|
||||||
<MESSAGE value="Version 9.6Beta Borrado referencias a api Nodejs y código relacionado" />
|
<MESSAGE value="Version 9.6Beta Borrado referencias a api Nodejs y código relacionado" />
|
||||||
<MESSAGE value="Version 9.6Beta Cambiadas llamadas y campos( collectionFk). Borrado Presacador" />
|
<MESSAGE value="Version 9.6Beta Cambiadas llamadas y campos( collectionFk). Borrado Presacador" />
|
||||||
|
@ -871,7 +866,8 @@
|
||||||
<MESSAGE value="refs #4755 añadirTickets" />
|
<MESSAGE value="refs #4755 añadirTickets" />
|
||||||
<MESSAGE value="refs #4923 previas" />
|
<MESSAGE value="refs #4923 previas" />
|
||||||
<MESSAGE value="EntrySalix" />
|
<MESSAGE value="EntrySalix" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="EntrySalix" />
|
<MESSAGE value="refs #4731 print" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="refs #4731 print" />
|
||||||
</component>
|
</component>
|
||||||
<component name="XDebuggerManager">
|
<component name="XDebuggerManager">
|
||||||
<pin-to-top-manager>
|
<pin-to-top-manager>
|
||||||
|
|
|
@ -4,6 +4,7 @@ import android.content.Context
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
@ -84,8 +85,8 @@ class InitPreSacadorFragment(
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
|
||||||
iconAdd.tooltipText = getTooltip(R.drawable.ic_add_black_24dp)
|
iconAdd.tooltipText = getTooltip(R.drawable.ic_add_black_24dp)
|
||||||
// Tarea 4731
|
// Tarea 4731
|
||||||
// iconPrint.tooltipText = getTooltip(R.drawable.ic_print_black_24dp)
|
// iconPrint.tooltipText = getTooltip(R.drawable.ic_print_black_24dp)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,6 +114,18 @@ class InitPreSacadorFragment(
|
||||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun print() {
|
||||||
|
if (ma.havePrinter()) {
|
||||||
|
binding.splashProgress.visibility = View.VISIBLE
|
||||||
|
viewModel.ticket_printLabelPrevious(customDialogInput.getValue().toInt())
|
||||||
|
(getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast(
|
||||||
|
requireContext()
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
getString(R.string.selectPrinter).toast(requireContext())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun showPrintPrevious() {
|
private fun showPrintPrevious() {
|
||||||
|
|
||||||
customDialogInput.setInputText()
|
customDialogInput.setInputText()
|
||||||
|
@ -121,19 +134,38 @@ class InitPreSacadorFragment(
|
||||||
.setValue("")
|
.setValue("")
|
||||||
.setOkButton(getString(R.string.print)) {
|
.setOkButton(getString(R.string.print)) {
|
||||||
try {
|
try {
|
||||||
binding.splashProgress.visibility = View.VISIBLE
|
if (customDialogInput.getValue().isNotEmpty()
|
||||||
viewModel.ticket_printLabelPrevious(customDialogInput.getValue().toInt())
|
) {
|
||||||
(getString(R.string.Imprimiendo) + getData(PRINTERNAME)).toast(
|
print()
|
||||||
requireContext())
|
}
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
|
getString(R.string.errorInput)
|
||||||
}
|
}
|
||||||
customDialogInput.dismiss()
|
customDialogInput.setValue("")
|
||||||
|
|
||||||
}.setKoButton(getString(R.string.cancel)) {
|
}.setKoButton(getString(R.string.cancel)) {
|
||||||
customDialogInput.dismiss()
|
customDialogInput.dismiss()
|
||||||
}.show()
|
}.show()
|
||||||
customDialogInput.setFocusText()
|
customDialogInput.setFocusText()
|
||||||
|
|
||||||
|
|
||||||
|
customDialogInput.setFocusText()
|
||||||
|
ma.hideKeyboard(customDialogInput.getEditText())
|
||||||
|
|
||||||
|
customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
||||||
|
|
||||||
|
if (customDialogInput.getValue().isNotEmpty()
|
||||||
|
) {
|
||||||
|
print()
|
||||||
|
}
|
||||||
|
|
||||||
|
return@setOnEditorActionListener true
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setEvents() {
|
private fun setEvents() {
|
||||||
|
|
|
@ -456,9 +456,9 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun ticket_printLabelPrevious(saleGroup: Int) {
|
fun ticket_printLabelPrevious(ticketFk: Int) {
|
||||||
|
|
||||||
silex.ticket_printLabelPrevious(saleGroup).enqueue(object : SilexCallback<Any>(context) {
|
silex.ticket_printLabelPrevious(ticketFk).enqueue(object : SilexCallback<Any>(context) {
|
||||||
override fun onError(t: Throwable) {
|
override fun onError(t: Throwable) {
|
||||||
_response.value = ResponseItemVO(
|
_response.value = ResponseItemVO(
|
||||||
isError = true,
|
isError = true,
|
||||||
|
|
|
@ -548,5 +548,6 @@
|
||||||
<string name="problemUpdate">No es posible actualizar. Problema con la descarga de la app</string>
|
<string name="problemUpdate">No es posible actualizar. Problema con la descarga de la app</string>
|
||||||
<string name="printPreviousGroup">Introduce el número de previa a imprimir</string>
|
<string name="printPreviousGroup">Introduce el número de previa a imprimir</string>
|
||||||
<string name="print">Imprimir</string>
|
<string name="print">Imprimir</string>
|
||||||
|
<string name="errorInput">Elemento introducido no válido</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -242,6 +242,7 @@
|
||||||
<string name="info">Information</string>
|
<string name="info">Information</string>
|
||||||
<string name="accept">Accept</string>
|
<string name="accept">Accept</string>
|
||||||
<string name="selectPrinter">You have to select a printer</string>
|
<string name="selectPrinter">You have to select a printer</string>
|
||||||
|
<string name="errorInput">Input no valid</string>
|
||||||
<string name="newTruck">New truck</string>
|
<string name="newTruck">New truck</string>
|
||||||
<string name="psScan">PScan: </string>
|
<string name="psScan">PScan: </string>
|
||||||
<string name="savedShelves">Shelvings saved</string>
|
<string name="savedShelves">Shelvings saved</string>
|
||||||
|
|
Loading…
Reference in New Issue