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/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_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_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" />

View File

@ -35,5 +35,22 @@ class ApiSalixUtils {
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
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 salixClient: SalixService? = null
var nodejsClient: NodeJsService? = null
var salixClientSend:SalixServiceSend?=null
init {
restClient = ApiUtils.getApiService(context)
salixClient = ApiSalixUtils.getApiService(context)
nodejsClient = ApiNodeJsUtils.getApiService()
salixClientSend = ApiSalixUtilsSend.getApiService(context)
}
}

View File

@ -155,4 +155,16 @@ interface SalixService {
):
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 =
binding.root.context.getString(R.string.originalQuantity) + sale.originalQuantity
if (sale.isPrepared == "1" || sale.isControlled == "1")
sale.pickedQuantity = sale.quantity
sale.pickedQuantity = sale.quantity.toString()
}
if (sale.isNew) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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