Version 9.1Beta- Modificar original y originalQuantity

This commit is contained in:
Sergio De la torre 2022-09-22 14:24:05 +02:00
parent 6a876e010f
commit 7b43fdd7e4
12 changed files with 74 additions and 48 deletions

View File

@ -207,7 +207,7 @@
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_workermistake.xml" value="0.2265625" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_workermistake.xml" value="0.2265625" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_ajustes_row.xml" value="0.16666666666666666" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_ajustes_row.xml" value="0.16666666666666666" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row.xml" value="0.3333333333333333" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row.xml" value="0.3333333333333333" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row_fragment.xml" value="0.4466666666666667" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row_fragment.xml" value="0.15982721382289417" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row_presacador.xml" value="0.4466666666666667" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row_presacador.xml" value="0.4466666666666667" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row_reubication_fragment.xml" value="0.36614583333333334" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row_reubication_fragment.xml" value="0.36614583333333334" />
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_barcode_row.xml" value="0.15579710144927536" /> <entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_barcode_row.xml" value="0.15579710144927536" />

View File

@ -35,5 +35,22 @@ class ApiSalixUtils {
val preferences = PreferenceManager.getDefaultSharedPreferences(context) val preferences = PreferenceManager.getDefaultSharedPreferences(context)
return preferences.getString(key, null) return preferences.getString(key, null)
} }
}
}
class ApiSalixUtilsSend {
companion object {
const val BASE_URL: String = "https://salix.verdnatura.es/api/"
fun getApiService(context: Context): SalixServiceSend {
val salixRetrofit = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(
GsonConverterFactory.create()
).build()
//d("VERDNATURA::","El server Salix es "+getBaseUrlLocal(context = context))
return salixRetrofit.create(SalixServiceSend::class.java)
}
} }
} }

View File

@ -6,11 +6,13 @@ open class RestClient(context: Context) {
var restClient: VerdnaturaService? = null var restClient: VerdnaturaService? = null
var salixClient: SalixService? = null var salixClient: SalixService? = null
var nodejsClient: NodeJsService? = null var nodejsClient: NodeJsService? = null
var salixClientSend:SalixServiceSend?=null
init { init {
restClient = ApiUtils.getApiService(context) restClient = ApiUtils.getApiService(context)
salixClient = ApiSalixUtils.getApiService(context) salixClient = ApiSalixUtils.getApiService(context)
nodejsClient = ApiNodeJsUtils.getApiService() nodejsClient = ApiNodeJsUtils.getApiService()
salixClientSend = ApiSalixUtilsSend.getApiService(context)
} }
} }

View File

@ -155,4 +155,16 @@ interface SalixService {
): ):
Call<List<ShelvingLogSalix>> Call<List<ShelvingLogSalix>>
}
interface SalixServiceSend {
@POST("chats/sendCheckingPresence")
fun sendChekingPresence(
@Header("Content-Type") content_type: String,
@Header("Authorization") authorization: String,
@Body params: SalixMessageVO):
Call<Boolean>
} }

View File

@ -111,7 +111,7 @@ class SaleAdapter(
txtError.text = txtError.text =
binding.root.context.getString(R.string.originalQuantity) + sale.originalQuantity binding.root.context.getString(R.string.originalQuantity) + sale.originalQuantity
if (sale.isPrepared == "1" || sale.isControlled == "1") if (sale.isPrepared == "1" || sale.isControlled == "1")
sale.pickedQuantity = sale.quantity sale.pickedQuantity = sale.quantity.toString()
} }
if (sale.isNew) { if (sale.isNew) {

View File

@ -74,14 +74,14 @@ class CollectionFragment(
private var mistakeSale: SaleVO? = null private var mistakeSale: SaleVO? = null
private var positionIncreaseQuantity = 0 private var positionIncreaseQuantity = 0
private var positionReject = 0 private var positionReject = 0
private var quantityIncrease = "" private var quantityIncrease:Int=0
private var quantityReject = "" private var quantityReject = ""
private var typeCollectionMissing = "" private var typeCollectionMissing = ""
private var positionCollectionMissing = 0 private var positionCollectionMissing = 0
private var quantityCollectionMissing = "" private var quantityCollectionMissing:Int=0
private var isMarking = false private var isMarking = false
private var positionCollectionSplit = 0 private var positionCollectionSplit = 0
private var quantityCollectionSplit = "" private var quantityCollectionSplit:Int=0
private lateinit var ticketToParking: String private lateinit var ticketToParking: String
private lateinit var ticketScanTxt: String private lateinit var ticketScanTxt: String
@ -865,7 +865,7 @@ class CollectionFragment(
private fun responseSaleMoveSuccesful() { private fun responseSaleMoveSuccesful() {
sales[positionCollectionSplit].quantity = quantityCollectionSplit sales[positionCollectionSplit].quantity = quantityCollectionSplit
if (quantityCollectionSplit == "0") if (quantityCollectionSplit == 0)
markLine(positionCollectionSplit, type) markLine(positionCollectionSplit, type)
saleAdapter!!.notifyDataSetChanged() saleAdapter!!.notifyDataSetChanged()
@ -947,7 +947,7 @@ class CollectionFragment(
var observations = "" var observations = ""
collection.tickets.forEach { ticket -> collection.tickets.forEach { ticket ->
ticket.sales.forEach { saleVO -> ticket.sales.forEach { saleVO ->
if (type == SACADOR && saleVO.quantity != "0") { if (type == SACADOR && saleVO.quantity != 0) {
salesList.add(saleVO) salesList.add(saleVO)
if (tickets.firstOrNull { it == saleVO.ticketFk }.isNullOrEmpty()) if (tickets.firstOrNull { it == saleVO.ticketFk }.isNullOrEmpty())
tickets.add(saleVO.ticketFk) tickets.add(saleVO.ticketFk)
@ -1342,7 +1342,7 @@ class CollectionFragment(
if (type == SACADOR) { if (type == SACADOR) {
sales[position].isPrepared = if (sales[position].isPrepared == "1") "0" else "1" sales[position].isPrepared = if (sales[position].isPrepared == "1") "0" else "1"
if (sales[position].isPrepared == "1") { if (sales[position].isPrepared == "1") {
sales[position].pickedQuantity = sales[position].quantity sales[position].pickedQuantity = sales[position].quantity.toString()
} }
} else if (type == CONTROLADOR) } else if (type == CONTROLADOR)
@ -1448,7 +1448,7 @@ class CollectionFragment(
getData(USER), getData(USER),
getData(PASSWORD), getData(PASSWORD),
sales[position].saleFk, sales[position].saleFk,
sales[position].quantity sales[position].quantity.toString()
) )
positionUnmarked = position positionUnmarked = position
@ -1480,7 +1480,7 @@ class CollectionFragment(
var quantityGet = "0" var quantityGet = "0"
try { try {
quantityGet = quantityGet =
(sales[position].quantity.toInt() - sales[position].pickedQuantity.toInt()).toString() (sales[position].quantity!!.toInt() - sales[position].pickedQuantity.toInt()).toString()
} catch (e: Exception) { } catch (e: Exception) {
} }
//Log.i("VERDNATURA:","Aparece para enviar") //Log.i("VERDNATURA:","Aparece para enviar")
@ -1543,7 +1543,7 @@ class CollectionFragment(
mpok?.start() mpok?.start()
ReviewQuantityForRefreshingAndSorting( ReviewQuantityForRefreshingAndSorting(
customDialogList.getValue().toInt(), customDialogList.getValue().toInt(),
sales[storedPosition].quantity.toInt(), sales[storedPosition].quantity!!.toInt(),
sales[storedPosition].pickedQuantity.toInt() sales[storedPosition].pickedQuantity.toInt()
) )
customDialogList.dismiss() customDialogList.dismiss()
@ -1622,7 +1622,7 @@ class CollectionFragment(
mpok?.start() mpok?.start()
ReviewQuantityForRefreshingAndSorting( ReviewQuantityForRefreshingAndSorting(
customDialogList.getValue().toInt(), customDialogList.getValue().toInt(),
sales[storedPosition].quantity.toInt(), sales[storedPosition].quantity!!.toInt(),
sales[storedPosition].pickedQuantity.toInt() sales[storedPosition].pickedQuantity.toInt()
) )
// SalesSorter(sales) // SalesSorter(sales)
@ -1785,7 +1785,7 @@ class CollectionFragment(
//Tarea #4371 //Tarea #4371
itemShelvingTracking_mark = itemShelvingFk itemShelvingTracking_mark = itemShelvingFk
if (sales[storedPosition].pickedQuantity != sales[storedPosition].quantity) { if (sales[storedPosition].pickedQuantity != sales[storedPosition].quantity.toString()) {
sales[storedPosition].isPrepared = "1" sales[storedPosition].isPrepared = "1"
markLine(storedPosition, OK) markLine(storedPosition, OK)
} else { } else {
@ -2013,7 +2013,7 @@ class CollectionFragment(
if (type == SACADOR) { if (type == SACADOR) {
if (it.isPrepared == "1" || it.isControlled == "1" || it.isPreviousPrepared == "1") { if (it.isPrepared == "1" || it.isControlled == "1" || it.isPreviousPrepared == "1") {
totalMark += 1 totalMark += 1
} else if (it.quantity == "0") { } else if (it.quantity == 0) {
totalMark += 1 totalMark += 1
} }
} else if (type == CONTROLADOR) { } else if (type == CONTROLADOR) {
@ -2235,11 +2235,11 @@ class CollectionFragment(
} else { } else {
when (action) { when (action) {
getString(R.string.Agregar) -> increaseQuantity(position, value) getString(R.string.Agregar) -> increaseQuantity(position, value.toInt())
getString(R.string.BasuraRechazar) -> TrashMissingReject(position, value, "TRUE") getString(R.string.BasuraRechazar) -> TrashMissingReject(position, value.toInt(), "TRUE")
getString(R.string.titleFaults) -> TrashMissingReject(position, value, "FALSE") getString(R.string.titleFaults) -> TrashMissingReject(position, value.toInt(), "FALSE")
getString(R.string.Reject) -> TrashMissingReject(position, value, "reject") getString(R.string.Reject) -> TrashMissingReject(position, value.toInt(), "reject")
getString(R.string.Split) -> split(position, value) getString(R.string.Split) -> split(position, value.toInt())
} }
@ -2248,7 +2248,7 @@ class CollectionFragment(
} }
} }
private fun split(position: Int, quantity: String) { private fun split(position: Int, quantity: Int) {
//sergio: SPLIT SALIX //sergio: SPLIT SALIX
@ -2257,7 +2257,7 @@ class CollectionFragment(
var totalQuantity: Int = 0 var totalQuantity: Int = 0
try { try {
totalQuantity = sales[position].quantity.toInt() - quantity.toInt() totalQuantity = sales[position].quantity!!.toInt() - quantity.toInt()
} catch (e: Exception) { } catch (e: Exception) {
} }
@ -2292,7 +2292,7 @@ class CollectionFragment(
private fun TrashMissingReject( private fun TrashMissingReject(
position: Int, position: Int,
quantity: String, quantity: Int,
typeCollectionTrashMissingReject: String typeCollectionTrashMissingReject: String
) { ) {
typeCollectionMissing = typeCollectionTrashMissingReject typeCollectionMissing = typeCollectionTrashMissingReject
@ -2301,7 +2301,7 @@ class CollectionFragment(
var totalQuantity: Int = 0 var totalQuantity: Int = 0
try { try {
totalQuantity = sales[position].quantity.toInt() - quantity.toInt() totalQuantity = sales[position].quantity!!.toInt() - quantity.toInt()
} catch (e: Exception) { } catch (e: Exception) {
} }
@ -2312,7 +2312,7 @@ class CollectionFragment(
quantity = totalQuantity.toString(), quantity = totalQuantity.toString(),
warehouseFk = getData(WAREHOUSEFK), warehouseFk = getData(WAREHOUSEFK),
type = typeCollectionTrashMissingReject, type = typeCollectionTrashMissingReject,
originalQuantity = quantity originalQuantity = quantity.toString()
) )
/* sales[position].quantity = quantity /* sales[position].quantity = quantity
saleAdapter!!.notifyDataSetChanged() saleAdapter!!.notifyDataSetChanged()
@ -2440,13 +2440,13 @@ class CollectionFragment(
sales[positionCollectionMissing].quantity = quantityCollectionMissing sales[positionCollectionMissing].quantity = quantityCollectionMissing
saleAdapter!!.notifyDataSetChanged() saleAdapter!!.notifyDataSetChanged()
if (quantityCollectionMissing == "0") if (quantityCollectionMissing == 0)
markLine(positionCollectionMissing, type) markLine(positionCollectionMissing, type)
var totalQuantity: Int = 0 var totalQuantity: Int = 0
try { try {
totalQuantity = totalQuantity =
sales[positionCollectionMissing].originalQuantity.toInt() - quantityCollectionMissing.toInt() sales[positionCollectionMissing].originalQuantity!!.toInt() - quantityCollectionMissing.toInt()
} catch (e: Exception) { } catch (e: Exception) {
} }
@ -2528,7 +2528,7 @@ class CollectionFragment(
) )
} }
private fun increaseQuantity(position: Int, quantity: String) { private fun increaseQuantity(position: Int, quantity: Int) {
positionIncreaseQuantity = position positionIncreaseQuantity = position
quantityIncrease = quantity quantityIncrease = quantity
@ -2546,7 +2546,7 @@ class CollectionFragment(
viewModel.collectionIncreaseQuantitySalix( viewModel.collectionIncreaseQuantitySalix(
getData(TOKEN), getData(TOKEN),
saleFk = sales[position].saleFk, saleFk = sales[position].saleFk,
quantity = quantity quantity = quantity.toString()
) )
/* }*/ /* }*/

View File

@ -28,17 +28,12 @@ fun CollectionVO.map(context: Context): CollectionVO {
//Log.d("VERDNATURA::","quantity"+it.quantity) //Log.d("VERDNATURA::","quantity"+it.quantity)
//Log.d("VERDNATURA::","quantity original"+it.originalQuantity) //Log.d("VERDNATURA::","quantity original"+it.originalQuantity)
it.quantity = if (it.quantity.indexOf(".") > 0) { it.quantity = it.quantity!!.toInt()
it.quantity.substring(0, it.quantity.indexOf("."))
} else {
it.quantity
}
it.originalQuantity = (if (it.originalQuantity.indexOf(".") > 0) {
it.originalQuantity.substring(0, it.originalQuantity.indexOf("."))
} else it.originalQuantity)
if (it.originalQuantity.equals("-1")) it.originalQuantity = it.quantity it.originalQuantity = it.originalQuantity!!.toInt()
if (it.originalQuantity==-1) it.originalQuantity = it.quantity
/* it.originalQuantity = /* it.originalQuantity =
if (it.originalQuantity != "-1") it.originalQuantity.substring( if (it.originalQuantity != "-1") it.originalQuantity.substring(
@ -48,7 +43,7 @@ fun CollectionVO.map(context: Context): CollectionVO {
it.pickedQuantity = it.pickedQuantity =
if (it.isPrepared == "1" || it.isPreviousPrepared == "1" || it.isControlled == "1") it.quantity else it.pickedQuantity if (it.isPrepared == "1" || it.isPreviousPrepared == "1" || it.isControlled == "1") it.quantity.toString() else it.pickedQuantity
if (!it.placements.isNullOrEmpty()) { if (!it.placements.isNullOrEmpty()) {
it.placements.forEachIndexed { index, placement -> it.placements.forEachIndexed { index, placement ->
if (index == 0) { if (index == 0) {

View File

@ -78,7 +78,7 @@ class PreSacadorAdapter (
onQuantityClick.onQuantityClick(sale) onQuantityClick.onQuantityClick(sale)
} }
if (sale.quantity == sale.pickedQuantity){ if (sale.quantity == sale.pickedQuantity.toInt()){
sale.isPreviousPrepared = "1" sale.isPreviousPrepared = "1"
}else{ }else{
sale.isPreviousPrepared = "0" sale.isPreviousPrepared = "0"

View File

@ -9,14 +9,14 @@ fun PreSacadorItemVO.toSale() : SaleVO {
level = "1", level = "1",
saleFk = idMovimiento, saleFk = idMovimiento,
itemFk = itemFk, itemFk = itemFk,
quantity = saldo.toString(), quantity = saldo,
longName = if (longName != null) longName else "", longName = if (longName != null) longName else "",
isPreviousPrepared = if (quantity == picked) "1" else "0", isPreviousPrepared = if (quantity == picked) "1" else "0",
line1 = longName, line1 = longName,
line2 = if (subName.isNullOrEmpty()) "" else subName,//sergio:cuando subida versión de tarea #3510 se puede quitar isNullOrEmpty line2 = if (subName.isNullOrEmpty()) "" else subName,//sergio:cuando subida versión de tarea #3510 se puede quitar isNullOrEmpty
pickedQuantity = picked.toString(), pickedQuantity = picked.toString(),
workerFk = if (trabajador.isNullOrEmpty()) { "0" } else trabajador, workerFk = if (trabajador.isNullOrEmpty()) { "0" } else trabajador,
originalQuantity = quantity.toString(), originalQuantity = quantity,
placements = carros, placements = carros,
agencyName = if (trabajador.isNullOrEmpty()) { "" } else trabajador, agencyName = if (trabajador.isNullOrEmpty()) { "" } else trabajador,
packingType=packingType, packingType=packingType,
@ -34,14 +34,14 @@ fun PreSacadorItemVO.toSaleReposicion() : SaleVO {
level = "1", level = "1",
saleFk = idMovimiento, saleFk = idMovimiento,
itemFk = itemFk, itemFk = itemFk,
quantity = quantity.toString(), quantity = quantity,
longName = if (longName != null) longName else "", longName = if (longName != null) longName else "",
isPreviousPrepared = if ((quantity - saldo) == 0) "1" else "0", isPreviousPrepared = if ((quantity - saldo) == 0) "1" else "0",
line1 = longName, line1 = longName,
line2 = if (subName.isNullOrEmpty()) "" else subName, line2 = if (subName.isNullOrEmpty()) "" else subName,
pickedQuantity = (quantity - saldo).toString(), pickedQuantity = (quantity - saldo).toString(),
workerFk = if (trabajador.isNullOrEmpty()) { "0" } else trabajador, workerFk = if (trabajador.isNullOrEmpty()) { "0" } else trabajador,
originalQuantity = quantity.toString(), originalQuantity = quantity,
placements = carros, placements = carros,
agencyName = if (trabajador.isNullOrEmpty()) { "" } else trabajador, agencyName = if (trabajador.isNullOrEmpty()) { "" } else trabajador,
rgb=null rgb=null

View File

@ -69,7 +69,7 @@ class ReposicionAdapter (
} }
if (sale.quantity == sale.pickedQuantity){ if (sale.quantity == sale.pickedQuantity.toInt()){
sale.isPreviousPrepared = "1" sale.isPreviousPrepared = "1"
}else{ }else{
sale.isPreviousPrepared = "0" sale.isPreviousPrepared = "0"

View File

@ -33,7 +33,7 @@ class SaleVO(
var saleOrder: Int = 9999, var saleOrder: Int = 9999,
var saleFk: String = "", var saleFk: String = "",
var itemFk: String = "", var itemFk: String = "",
var quantity: String = "", var quantity: Int?,
var longName: String = "", var longName: String = "",
var size: String = "", var size: String = "",
var reserved: String = "", var reserved: String = "",
@ -49,7 +49,7 @@ class SaleVO(
var category: String = "", var category: String = "",
var origin: String = "", var origin: String = "",
var clientFk: String = "", var clientFk: String = "",
var originalQuantity: String = "", var originalQuantity:Int?,
var line1: String = "", var line1: String = "",
var line2: String? = "", var line2: String? = "",
var line3: String = "", var line3: String = "",

View File

@ -252,7 +252,7 @@
android:paddingRight="10dp" android:paddingRight="10dp"
android:visibility="gone" android:visibility="gone"
android:text="@{sale.quantity}" android:text="@{Integer.toString(sale.quantity)}"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body1" android:textSize="@dimen/body1"
android:textStyle="bold" android:textStyle="bold"
@ -365,7 +365,7 @@
android:paddingBottom="@dimen/layout_margin_minest" android:paddingBottom="@dimen/layout_margin_minest"
android:paddingLeft="@dimen/layout_margin_1" android:paddingLeft="@dimen/layout_margin_1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{sale.quantity}" android:text="@{Integer.toString(sale.quantity)}"
android:textColor="@color/verdnatura_white" android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body3" android:textSize="@dimen/body3"
android:textStyle="bold" android:textStyle="bold"