feat issues refs #7636
This commit is contained in:
parent
5e778d2ba6
commit
c35b763376
|
@ -13,27 +13,3 @@ class SalixSaleQuantity(
|
|||
var saleId: Int = 0,
|
||||
var quantity: Int = 0
|
||||
)
|
||||
|
||||
class listSaleSalix(
|
||||
var sales: ArrayList<saleSalix>
|
||||
)
|
||||
|
||||
class saleSalix(
|
||||
var id: Int = 0,
|
||||
var quantity: Int = 0
|
||||
)
|
||||
|
||||
class SalesModified(
|
||||
var ticketFk: Int = 0,
|
||||
var itemFk: String = "",
|
||||
var concept: String = "",
|
||||
var originalQuantity: Int = 0,
|
||||
var newQuantity: Int = 0,
|
||||
var isError: Boolean = false,
|
||||
var errorMessage: String = ""
|
||||
|
||||
)
|
||||
|
||||
class SalesModifiedList(
|
||||
var list: List<SalesModified> = listOf()
|
||||
)
|
|
@ -43,6 +43,7 @@ import es.verdnatura.presentation.common.ItemScanned
|
|||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
import es.verdnatura.presentation.common.OnPackingClickListener
|
||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||
import es.verdnatura.presentation.common.OnQuantityClickListener
|
||||
import es.verdnatura.presentation.common.OnSaleClickListener
|
||||
|
@ -52,7 +53,6 @@ import es.verdnatura.presentation.common.addViewObserver
|
|||
import es.verdnatura.presentation.common.hideKeyboard
|
||||
import es.verdnatura.presentation.common.itemScanIsQr
|
||||
import es.verdnatura.presentation.common.itemScanValue
|
||||
import es.verdnatura.presentation.common.onPackingClickListener
|
||||
import es.verdnatura.presentation.common.showKeyboard
|
||||
import es.verdnatura.presentation.common.showKeyboardIn
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -495,7 +495,7 @@ class CollectionFragment(
|
|||
if (it.tickets.isNotEmpty()) {
|
||||
collection = it
|
||||
createCollectionList()
|
||||
workerFkFromTicket = it.tickets.get(0).sales.get(0).workerFk
|
||||
workerFkFromTicket = it.tickets[0].sales[0].workerFk
|
||||
|
||||
} else {
|
||||
binding.mainToolbar.toolbarSubtitle.text = "0/0"
|
||||
|
@ -1037,7 +1037,7 @@ class CollectionFragment(
|
|||
|
||||
}
|
||||
},
|
||||
object : onPackingClickListener {
|
||||
object : OnPackingClickListener {
|
||||
override fun onPackingClick(sale: SaleVO) {
|
||||
}
|
||||
},
|
||||
|
@ -1589,7 +1589,7 @@ class CollectionFragment(
|
|||
var longName = ""
|
||||
var total = "0"
|
||||
var itemShelvingFk = 0
|
||||
if (!placementSupplyListVO.list.isEmpty()) {
|
||||
if (placementSupplyListVO.list.isNotEmpty()) {
|
||||
var placement: PlacementSupplyVO? = null
|
||||
placementSupplyListVO.list.forEach { placementVO ->
|
||||
if (placementVO.stock != "0" && placement == null) placement = placementVO
|
||||
|
|
|
@ -10,7 +10,6 @@ import android.os.Build
|
|||
import android.os.Bundle
|
||||
import android.os.Parcelable
|
||||
import android.text.InputType
|
||||
import android.util.Log.d
|
||||
import android.view.KeyEvent
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
|
@ -41,6 +40,7 @@ import es.verdnatura.presentation.common.ItemScanned
|
|||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
import es.verdnatura.presentation.common.OnPackingClickListener
|
||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||
import es.verdnatura.presentation.common.OnQuantityClickListener
|
||||
import es.verdnatura.presentation.common.OnSaleClickListener
|
||||
|
@ -49,7 +49,6 @@ import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
|||
import es.verdnatura.presentation.common.hideKeyboard
|
||||
import es.verdnatura.presentation.common.itemScanIsQr
|
||||
import es.verdnatura.presentation.common.itemScanValue
|
||||
import es.verdnatura.presentation.common.onPackingClickListener
|
||||
import es.verdnatura.presentation.common.showKeyboard
|
||||
import es.verdnatura.presentation.common.showKeyboardIn
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -153,7 +152,7 @@ class CollectionFragmentPicker(
|
|||
collection.collectionFk
|
||||
|
||||
)
|
||||
workerFkFromTicket = collection.tickets.get(0).sales.get(0).workerFk
|
||||
workerFkFromTicket = collection.tickets[0].sales[0].workerFk
|
||||
}
|
||||
|
||||
if (collection.tickets.isEmpty()) {
|
||||
|
@ -320,7 +319,7 @@ class CollectionFragmentPicker(
|
|||
|
||||
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
||||
if (!customDialogList.getValue().isEmpty()) {
|
||||
if (customDialogList.getValue().isNotEmpty()) {
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
try {
|
||||
val saleGroupScanned = itemScanValue(
|
||||
|
@ -464,7 +463,7 @@ class CollectionFragmentPicker(
|
|||
if (it.tickets.isNotEmpty()) {
|
||||
collection = it
|
||||
createCollectionList()
|
||||
workerFkFromTicket = it.tickets.get(0).sales.get(0).workerFk
|
||||
workerFkFromTicket = it.tickets[0].sales[0].workerFk
|
||||
|
||||
} else {
|
||||
binding.mainToolbar.toolbarSubtitle.text = "0/0"
|
||||
|
@ -1001,7 +1000,7 @@ class CollectionFragmentPicker(
|
|||
|
||||
}
|
||||
},
|
||||
object : onPackingClickListener {
|
||||
object : OnPackingClickListener {
|
||||
override fun onPackingClick(sale: SaleVO) {
|
||||
}
|
||||
},
|
||||
|
@ -1183,12 +1182,10 @@ class CollectionFragmentPicker(
|
|||
//////Log.i("VERDNATURA:","encontrado producto")
|
||||
showShelving(index, shelvingIndex)
|
||||
//nuevo
|
||||
d("VERDNATURA::", "el index de la sale es" + index)
|
||||
var mySale = sales[index].saleFk
|
||||
for (indice in myGroupList.indices) {
|
||||
|
||||
if (!myGroupList[indice].isParent && myGroupList[indice].saleFk == mySale) {
|
||||
d("VERDNATURA::", "la pos del index de la sale es" + indice)
|
||||
storedBackPosition = indice
|
||||
// setListPosition(storedBackPosition,false)
|
||||
}
|
||||
|
@ -1392,7 +1389,6 @@ class CollectionFragmentPicker(
|
|||
for (indice in myGroupList.indices) {
|
||||
|
||||
if (!myGroupList[indice].isParent && myGroupList[indice].saleFk == mySale) {
|
||||
d("VERDNATURA::", "la pos del index de la sale es" + indice)
|
||||
storedBackPosition = indice
|
||||
// setListPosition(storedBackPosition,false)
|
||||
}
|
||||
|
@ -1443,7 +1439,6 @@ class CollectionFragmentPicker(
|
|||
}
|
||||
|
||||
private fun setListPosition(position: Int, isFromBack: Boolean) {
|
||||
d("VERDNATURA::", "Vamos a la pos" + storedBackPosition)
|
||||
lm!!.scrollToPositionWithOffset(storedBackPosition, 0)
|
||||
// lm!!.scrollToPositionWithOffset(position, 0)
|
||||
|
||||
|
@ -1599,7 +1594,7 @@ class CollectionFragmentPicker(
|
|||
var longName = ""
|
||||
var total = "0"
|
||||
var itemShelvingFk = 0
|
||||
if (!placementSupplyListVO.list.isEmpty()) {
|
||||
if (placementSupplyListVO.list.isNotEmpty()) {
|
||||
var placement: PlacementSupplyVO? = null
|
||||
placementSupplyListVO.list.forEach { placementVO ->
|
||||
if (placementVO.stock != "0" && placement == null) placement = placementVO
|
||||
|
|
|
@ -44,6 +44,7 @@ import es.verdnatura.presentation.common.ItemScanned
|
|||
import es.verdnatura.presentation.common.OnBarcodeRowClickListener
|
||||
import es.verdnatura.presentation.common.OnMistakeClickListener
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
import es.verdnatura.presentation.common.OnPackingClickListener
|
||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||
import es.verdnatura.presentation.common.OnQuantityClickListener
|
||||
import es.verdnatura.presentation.common.OnSaleClickListener
|
||||
|
@ -53,7 +54,6 @@ import es.verdnatura.presentation.common.addViewObserver
|
|||
import es.verdnatura.presentation.common.hideKeyboard
|
||||
import es.verdnatura.presentation.common.itemScanIsQr
|
||||
import es.verdnatura.presentation.common.itemScanValue
|
||||
import es.verdnatura.presentation.common.onPackingClickListener
|
||||
import es.verdnatura.presentation.common.showKeyboard
|
||||
import es.verdnatura.presentation.common.showKeyboardIn
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -321,7 +321,7 @@ class CollectionFragmentPreChecker(
|
|||
|
||||
customDialogList.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) {
|
||||
if (!customDialogList.getValue().isEmpty()) {
|
||||
if (customDialogList.getValue().isNotEmpty()) {
|
||||
ma.hideKeyboard(customDialogList.getEditText())
|
||||
var saleGroupScanned = customDialogList.getValue()
|
||||
isScanned =
|
||||
|
@ -1070,7 +1070,7 @@ class CollectionFragmentPreChecker(
|
|||
|
||||
}
|
||||
},
|
||||
object : onPackingClickListener {
|
||||
object : OnPackingClickListener {
|
||||
override fun onPackingClick(sale: SaleVO) {
|
||||
}
|
||||
},
|
||||
|
@ -1576,7 +1576,7 @@ class CollectionFragmentPreChecker(
|
|||
var longName = ""
|
||||
var total = "0"
|
||||
var itemShelvingFk = 0
|
||||
if (!placementSupplyListVO.list.isEmpty()) {
|
||||
if (placementSupplyListVO.list.isNotEmpty()) {
|
||||
var placement: PlacementSupplyVO? = null
|
||||
placementSupplyListVO.list.forEach { placementVO ->
|
||||
if (placementVO.stock != "0" && placement == null)
|
||||
|
|
|
@ -20,7 +20,6 @@ import es.verdnatura.presentation.common.SaleTrackingReplaceSalix
|
|||
import es.verdnatura.presentation.common.SaleTrackingSalix
|
||||
import es.verdnatura.presentation.common.TicketState
|
||||
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
||||
import es.verdnatura.presentation.view.feature.collection.SalesModifiedList
|
||||
import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
|
||||
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
||||
|
@ -72,10 +71,6 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val placementSuppleyList: LiveData<PlacementSupplyListVO>
|
||||
get() = _placementSuppleyList
|
||||
|
||||
private val _salesModifiedList by lazy { MutableLiveData<SalesModifiedList>() }
|
||||
val salesModifiedList: LiveData<SalesModifiedList>
|
||||
get() = _salesModifiedList
|
||||
|
||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
@ -677,83 +672,6 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
/* fun saleMove(
|
||||
usuario: String,
|
||||
password: String,
|
||||
saleFk: String,
|
||||
quantity: String,
|
||||
originalQuantity: String
|
||||
) {
|
||||
silex.saleMove(
|
||||
usuario,
|
||||
password,
|
||||
saleFk,
|
||||
quantity,
|
||||
originalQuantity
|
||||
).enqueue(object : Callback<Any> {
|
||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||
_responseSaleMove.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||
if (!response.isSuccessful) {
|
||||
_responseSaleMove.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
|
||||
} else {
|
||||
_responseSaleMove.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
}
|
||||
})
|
||||
}*/
|
||||
|
||||
/* fun transferSalesSalix(
|
||||
ticketFk: String,
|
||||
saleFk: Int,
|
||||
quantity: String,
|
||||
|
||||
) {
|
||||
var saleTransfer =
|
||||
listSaleSalix(arrayListOf(saleSalix(id = saleFk, quantity = quantity.toInt())))
|
||||
salix.transferSalesSalix(
|
||||
ticketFk, saleTransfer
|
||||
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseSplit.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
//sergio: salix devuelve id
|
||||
if (response.body() == null) {
|
||||
_responseSplit.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
} else {
|
||||
_responseSplit.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
}
|
||||
})
|
||||
}*/
|
||||
|
||||
fun saleTrackingDel(saleFk: Int) {
|
||||
//Tarea 6276
|
||||
salix.saleTrackingDel(
|
||||
|
|
|
@ -575,7 +575,6 @@ class EndSacadorFragment(
|
|||
|
||||
//SEARCH AND MARK
|
||||
private fun findSale(txtscan: String) {
|
||||
println("text scanned" + txtscan)
|
||||
var index = 0
|
||||
var isBreak = false
|
||||
var isOk = false
|
||||
|
@ -636,7 +635,7 @@ class EndSacadorFragment(
|
|||
if (mperror != null) {
|
||||
mperror!!.start()
|
||||
}
|
||||
("getString(R.string.itemScanetNotFound)" + txtscan).toast(requireContext())
|
||||
(getString(R.string.itemScanetNotFound) + txtscan).toast(requireContext())
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue