refs #6460 fix:date
This commit is contained in:
parent
b13d6388f5
commit
3b8f06a3ba
|
@ -127,19 +127,31 @@
|
||||||
</select>
|
</select>
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #6275 modify call">
|
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="refs #6460 fix:date">
|
||||||
<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/beta/release/output-metadata.json" beforeDir="false" afterPath="$PROJECT_DIR$/app/beta/release/output-metadata.json" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/app/build.gradle" 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/domain/Extensions.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/Extensions.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixCallback.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixCallback.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixService.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SalixService.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SilexCallback.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SilexCallback.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/model/ItemLocationVO.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/model/ItemLocationVO.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPickerNew.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPickerNew.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.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/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/java/es/verdnatura/presentation/view/feature/delivery/adapters/ExpeditionLogAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/adapters/ExpeditionLogAdapter.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/values-fr/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values-fr/strings.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/model/InfoCompany.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/model/InfoCompany.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/values-pt/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values-pt/strings.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/viewmodels/DeliveryViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/delivery/viewmodels/DeliveryViewModel.kt" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/fragment/DayOfSaleViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/fragment/DayOfSaleViewModel.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/model/ItemShelvingSaleDate.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/model/ItemShelvingSaleDate.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloFragment.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogViewModel.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/model/ItemShelvingLog.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/model/ItemShelvingLog.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoViewModel.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/model/ItemHistoricoVehiculo.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/model/ItemHistoricoVehiculo.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryViewModel.kt" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
@ -498,20 +510,6 @@
|
||||||
<option name="presentableId" value="Default" />
|
<option name="presentableId" value="Default" />
|
||||||
<updated>1618825571576</updated>
|
<updated>1618825571576</updated>
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00167" summary="refs #5613 renew token">
|
|
||||||
<created>1688103597824</created>
|
|
||||||
<option name="number" value="00167" />
|
|
||||||
<option name="presentableId" value="LOCAL-00167" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1688103597825</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00168" summary="refs #5891">
|
|
||||||
<created>1688360978709</created>
|
|
||||||
<option name="number" value="00168" />
|
|
||||||
<option name="presentableId" value="LOCAL-00168" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1688360978709</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00169" summary="versionBeta 23.28 renovarToken">
|
<task id="LOCAL-00169" summary="versionBeta 23.28 renovarToken">
|
||||||
<created>1689163182438</created>
|
<created>1689163182438</created>
|
||||||
<option name="number" value="00169" />
|
<option name="number" value="00169" />
|
||||||
|
@ -841,7 +839,21 @@
|
||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1701432170349</updated>
|
<updated>1701432170349</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="216" />
|
<task id="LOCAL-00216" summary="refs #6004 add:saveData">
|
||||||
|
<created>1701936286579</created>
|
||||||
|
<option name="number" value="00216" />
|
||||||
|
<option name="presentableId" value="LOCAL-00216" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1701936286580</updated>
|
||||||
|
</task>
|
||||||
|
<task id="LOCAL-00217" summary="refs #6460 fix:date">
|
||||||
|
<created>1701936308931</created>
|
||||||
|
<option name="number" value="00217" />
|
||||||
|
<option name="presentableId" value="LOCAL-00217" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1701936308933</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="218" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="Vcs.Log.History.Properties">
|
<component name="Vcs.Log.History.Properties">
|
||||||
|
@ -942,8 +954,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="refs #5890 newSacador" />
|
|
||||||
<MESSAGE value="refs #4815 ajustesSerial" />
|
|
||||||
<MESSAGE value="version 23.40Beta" />
|
<MESSAGE value="version 23.40Beta" />
|
||||||
<MESSAGE value="refs #5652" />
|
<MESSAGE value="refs #5652" />
|
||||||
<MESSAGE value="strings" />
|
<MESSAGE value="strings" />
|
||||||
|
@ -967,7 +977,9 @@
|
||||||
<MESSAGE value="refs #6460" />
|
<MESSAGE value="refs #6460" />
|
||||||
<MESSAGE value="version 23.48Beta" />
|
<MESSAGE value="version 23.48Beta" />
|
||||||
<MESSAGE value="refs #6275 modify call" />
|
<MESSAGE value="refs #6275 modify call" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="refs #6275 modify call" />
|
<MESSAGE value="refs #6004 add:saveData" />
|
||||||
|
<MESSAGE value="refs #6460 fix:date" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="refs #6460 fix:date" />
|
||||||
</component>
|
</component>
|
||||||
<component name="XDebuggerManager">
|
<component name="XDebuggerManager">
|
||||||
<breakpoint-manager>
|
<breakpoint-manager>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 239,
|
"versionCode": 242,
|
||||||
"versionName": "23.48Beta",
|
"versionName": "23.48Beta",
|
||||||
"outputFile": "app-beta-release.apk"
|
"outputFile": "app-beta-release.apk"
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ android {
|
||||||
applicationId "es.verdnatura"
|
applicationId "es.verdnatura"
|
||||||
minSdkVersion 24 //21
|
minSdkVersion 24 //21
|
||||||
targetSdkVersion 33
|
targetSdkVersion 33
|
||||||
versionCode 240
|
versionCode 242
|
||||||
versionName = "23.48Beta"
|
versionName = "23.48Beta"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,8 @@ import android.widget.EditText
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
|
import java.time.ZonedDateTime
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
|
@ -48,9 +50,19 @@ fun toDateString(date: Date): String {
|
||||||
return format.format(date)
|
return format.format(date)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun String?.isoToString(): String {
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
fun String?.isoToString(returnOnlyDate: Boolean = false): String {
|
||||||
|
|
||||||
return if (!this.isNullOrEmpty() && this!!.contains("T")) {
|
return if (!this.isNullOrEmpty() && this!!.contains("T")) {
|
||||||
this.replace("T", " ").substring(0, 10)
|
val utcZonedDateTime = ZonedDateTime.parse(this, DateTimeFormatter.ISO_OFFSET_DATE_TIME)
|
||||||
|
val myDate = utcZonedDateTime.withZoneSameInstant(ZonedDateTime.now().zone)
|
||||||
|
.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
|
||||||
|
if (returnOnlyDate) {
|
||||||
|
(myDate.format(DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"))).replace("T", " ")
|
||||||
|
.substring(0, 10)
|
||||||
|
} else {
|
||||||
|
(myDate.format(DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"))).replace("T", " ")
|
||||||
|
}
|
||||||
} else if (!this.isNullOrEmpty() && !this!!.contains("T")) {
|
} else if (!this.isNullOrEmpty() && !this!!.contains("T")) {
|
||||||
this
|
this
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -34,10 +34,9 @@ abstract class SalixCallback<T>(val context: Context) : Callback<T> {
|
||||||
onError(Error(response.message().toString()))
|
onError(Error(response.message().toString()))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var myError = errorSalixMessage(response)
|
|
||||||
println("ErrorSalix:$myError")
|
|
||||||
//defaultErrorHandler(t)
|
|
||||||
onError(Error(errorSalixMessage(response)))
|
onError(Error(errorSalixMessage(response)))
|
||||||
|
// onError(Error(response.message().toString()))
|
||||||
}
|
}
|
||||||
} catch (t: Throwable) {
|
} catch (t: Throwable) {
|
||||||
defaultErrorHandler(t)
|
defaultErrorHandler(t)
|
||||||
|
|
|
@ -95,6 +95,7 @@ interface SalixService {
|
||||||
|
|
||||||
@GET("Buyers")
|
@GET("Buyers")
|
||||||
fun getBuyers(
|
fun getBuyers(
|
||||||
|
@Query("filter") filter:String
|
||||||
): Call<List<BuyerVO>>
|
): Call<List<BuyerVO>>
|
||||||
|
|
||||||
@POST("Applications/{routine}/execute-func")
|
@POST("Applications/{routine}/execute-func")
|
||||||
|
@ -136,6 +137,18 @@ interface SalixService {
|
||||||
@Query("params") params: Any? = null
|
@Query("params") params: Any? = null
|
||||||
): Call<Any>
|
): Call<Any>
|
||||||
|
|
||||||
|
@POST("Applications/collection_addWithReservation/execute-proc")
|
||||||
|
fun collectionAddWithReservation(
|
||||||
|
@Query("schema") schema: String = "vn",
|
||||||
|
@Query("params") params: Any? = null
|
||||||
|
): Call<Any>
|
||||||
|
|
||||||
|
@POST("Applications/collection_get/execute-proc")
|
||||||
|
fun collectionGet(
|
||||||
|
@Query("schema") schema: String = "vn",
|
||||||
|
@Query("params") params: Any? = null
|
||||||
|
): Call<CollectionVO>
|
||||||
|
|
||||||
@GET("Routes/getExpeditionSummary")
|
@GET("Routes/getExpeditionSummary")
|
||||||
fun routeGetExpeditionSummary(
|
fun routeGetExpeditionSummary(
|
||||||
@Query("routeFk") params: Int,
|
@Query("routeFk") params: Int,
|
||||||
|
@ -259,6 +272,12 @@ interface SalixService {
|
||||||
@Query("schema") schema: String = "vn"
|
@Query("schema") schema: String = "vn"
|
||||||
): Call<Unit>
|
): Call<Unit>
|
||||||
|
|
||||||
|
@POST("Applications/itemShelvingSale_unpicked/execute-proc")
|
||||||
|
fun itemShelvingSaleUnpicked(
|
||||||
|
@Query("params") params: Any? = null,
|
||||||
|
@Query("schema") schema: String = "vn"
|
||||||
|
): Call<Unit>
|
||||||
|
|
||||||
@POST("Applications/setParking/execute-proc")
|
@POST("Applications/setParking/execute-proc")
|
||||||
fun setParking(
|
fun setParking(
|
||||||
@Query("params") params: Any? = null,
|
@Query("params") params: Any? = null,
|
||||||
|
@ -707,6 +726,7 @@ interface SalixService {
|
||||||
@Body params: Any
|
@Body params: Any
|
||||||
): Call<Any>
|
): Call<Any>
|
||||||
|
|
||||||
|
|
||||||
@PATCH("ItemShelvingSales/{id}")
|
@PATCH("ItemShelvingSales/{id}")
|
||||||
fun itemShelvingsReservedUpdate(
|
fun itemShelvingsReservedUpdate(
|
||||||
@Path("id") id: Number,
|
@Path("id") id: Number,
|
||||||
|
|
|
@ -257,6 +257,8 @@ class AjustesFragment :
|
||||||
it.list.forEach {
|
it.list.forEach {
|
||||||
listSectores.add(it.description)
|
listSectores.add(it.description)
|
||||||
}
|
}
|
||||||
|
// modificar
|
||||||
|
listSectores.sort()
|
||||||
val array = arrayOfNulls<String>(listSectores.size)
|
val array = arrayOfNulls<String>(listSectores.size)
|
||||||
sectorListVO = it.list
|
sectorListVO = it.list
|
||||||
showDialogSector(listSectores.toArray(array))
|
showDialogSector(listSectores.toArray(array))
|
||||||
|
@ -452,8 +454,6 @@ class AjustesFragment :
|
||||||
|
|
||||||
private fun showDialogSector(array: Array<String>) {
|
private fun showDialogSector(array: Array<String>) {
|
||||||
val builder = AlertDialog.Builder(this.context)
|
val builder = AlertDialog.Builder(this.context)
|
||||||
|
|
||||||
|
|
||||||
builder.setTitle(getString(R.string.Seleccionaunsector))
|
builder.setTitle(getString(R.string.Seleccionaunsector))
|
||||||
builder.setItems(array) { _, which ->
|
builder.setItems(array) { _, which ->
|
||||||
val selected = array[which]
|
val selected = array[which]
|
||||||
|
|
|
@ -83,18 +83,34 @@ class BuscarItemFragment(
|
||||||
|
|
||||||
event.getContentIfNotHandled().notNull {
|
event.getContentIfNotHandled().notNull {
|
||||||
binding.splashProgress.visibility = GONE
|
binding.splashProgress.visibility = GONE
|
||||||
adapter = LocationAdapter(it.list, pasillerosItemClickListener!!)
|
|
||||||
binding.locationRecyclerview.adapter = adapter
|
|
||||||
binding.locationRecyclerview.layoutManager =
|
|
||||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
|
||||||
|
|
||||||
var totalVisible = 0
|
if (it.list.isNotEmpty()) {
|
||||||
it.list.forEach {
|
if (it.list[0].isError) {
|
||||||
totalVisible += it.visible
|
ma.messageWithSound(
|
||||||
|
it.list[0].errorMessage,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
it.list[0].errorMessage
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
adapter = LocationAdapter(it.list, pasillerosItemClickListener!!)
|
||||||
|
binding.locationRecyclerview.adapter = adapter
|
||||||
|
binding.locationRecyclerview.layoutManager =
|
||||||
|
LinearLayoutManager(
|
||||||
|
requireContext(),
|
||||||
|
LinearLayoutManager.VERTICAL,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
|
||||||
|
var totalVisible = 0
|
||||||
|
it.list.forEach {
|
||||||
|
totalVisible += it.visible
|
||||||
|
}
|
||||||
|
binding.mainToolbar.toolbarTitle.text =
|
||||||
|
getString(R.string.item) + itemFk + " " + getString(R.string.visibleTotal) + totalVisible
|
||||||
}
|
}
|
||||||
binding.mainToolbar.toolbarTitle.text =
|
|
||||||
getString(R.string.item) + itemFk + " " + getString(R.string.visibleTotal) + totalVisible
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
package es.verdnatura.presentation.view.feature.buscaritem.fragment
|
package es.verdnatura.presentation.view.feature.buscaritem.fragment
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.os.Build
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
import androidx.lifecycle.LiveData
|
import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.Transformations
|
import androidx.lifecycle.Transformations
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SilexCallback
|
||||||
|
import es.verdnatura.domain.formatWithQuotes
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||||
import es.verdnatura.presentation.base.nameofFunction
|
import es.verdnatura.presentation.base.nameofFunction
|
||||||
|
@ -23,13 +26,14 @@ class BuscarItemViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
fun itemshelvingGetInfo(itemFk: Any) {
|
fun itemshelvingGetInfo(itemFk: Any) {
|
||||||
//salix falla fecha
|
//salix falla fecha
|
||||||
silex.searchItemsUbicador(itemFk)
|
// silex.searchItemsUbicador(itemFk)
|
||||||
// salix.itemshelvingGetInfo(params = arrayListOf(itemFk).formatWithQuotes())
|
salix.itemshelvingGetInfo(params = arrayListOf(itemFk).formatWithQuotes())
|
||||||
.enqueue(object : SalixCallback<List<ItemLocationVO>>(context) {
|
.enqueue(object : SilexCallback<List<ItemLocationVO>>(context) {
|
||||||
override fun onSuccess(response: Response<List<ItemLocationVO>>) {
|
override fun onSuccess(response: Response<List<ItemLocationVO>>) {
|
||||||
_locationList.value = response.body()?.let { LocationListVO(it) }
|
_locationList.value = response.body()?.let { LocationListVO(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
override fun onError(t: Throwable) {
|
override fun onError(t: Throwable) {
|
||||||
val listError: ArrayList<ItemLocationVO> = ArrayList()
|
val listError: ArrayList<ItemLocationVO> = ArrayList()
|
||||||
listError.add(
|
listError.add(
|
||||||
|
|
|
@ -1,19 +1,28 @@
|
||||||
package es.verdnatura.presentation.view.feature.buscaritem.model
|
package es.verdnatura.presentation.view.feature.buscaritem.model
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
|
import es.verdnatura.domain.isoToString
|
||||||
|
|
||||||
class ItemLocationVO (
|
class ItemLocationVO @RequiresApi(Build.VERSION_CODES.O) constructor(
|
||||||
var Parking:String = "",
|
var Parking: String = "",
|
||||||
var Matricula:String = "",
|
var Matricula: String = "",
|
||||||
var visible:Int = 0,
|
var visible: Int = 0,
|
||||||
//var Disponible:Int = 0,
|
var itemFk: Int = 0,
|
||||||
//var level:String = "",
|
val isError: Boolean = false,
|
||||||
var created:String = "",
|
var errorMessage: String = "",
|
||||||
var itemFk:Int = 0,
|
var priority: Int = 0
|
||||||
val isError : Boolean = false,
|
|
||||||
var errorMessage : String = "",
|
|
||||||
var priority:Int = 0
|
|
||||||
)
|
|
||||||
|
|
||||||
class LocationListVO (
|
) {
|
||||||
var list: List<ItemLocationVO> = listOf()
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
var created: String = ""
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
get(){
|
||||||
|
return field.isoToString()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class LocationListVO(
|
||||||
|
var list: List<ItemLocationVO> = listOf()
|
||||||
)
|
)
|
|
@ -84,6 +84,14 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
val responseConfirmReservedItemShelvingSale: LiveData<ResponseItemVO>
|
val responseConfirmReservedItemShelvingSale: LiveData<ResponseItemVO>
|
||||||
get() = _responseConfirmReservedItemShelvingSale
|
get() = _responseConfirmReservedItemShelvingSale
|
||||||
|
|
||||||
|
private val _responseItemShelvingSale by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseItemShelvingSale: LiveData<ResponseItemVO>
|
||||||
|
get() = _responseItemShelvingSale
|
||||||
|
|
||||||
|
private val _responseCollectionAddItem by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
|
val responseCollectionAddItem: LiveData<ResponseItemVO>
|
||||||
|
get() = responseCollectionAddItem
|
||||||
|
|
||||||
private val _responseConfirmReservedUpdate by lazy { MutableLiveData<ResponseItemVO>() }
|
private val _responseConfirmReservedUpdate by lazy { MutableLiveData<ResponseItemVO>() }
|
||||||
val responseConfirmReservedUpdate: LiveData<ResponseItemVO>
|
val responseConfirmReservedUpdate: LiveData<ResponseItemVO>
|
||||||
get() = _responseConfirmReservedUpdate
|
get() = _responseConfirmReservedUpdate
|
||||||
|
@ -256,37 +264,39 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
print: String,
|
print: String,
|
||||||
type: String
|
type: String
|
||||||
) {
|
) {
|
||||||
silex.collection_get(
|
//Falta back de Salix
|
||||||
collectionFk,
|
// salix.collectionGet(params = arrayListOf(collectionFk, sectorFk, print, type).formatWithQuotes())
|
||||||
sectorFk,
|
silex.collection_get(
|
||||||
print,
|
collectionFk,
|
||||||
type
|
sectorFk,
|
||||||
).enqueue(object :
|
print,
|
||||||
SilexCallback<CollectionVO>(context) {
|
type)
|
||||||
override fun onError(t: Throwable) {
|
.enqueue(object :
|
||||||
_collectionTicketList.value = CollectionVO(
|
SalixCallback<CollectionVO>(context) {
|
||||||
0,
|
override fun onError(t: Throwable) {
|
||||||
isError = true,
|
|
||||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onSuccess(response: Response<CollectionVO>) {
|
|
||||||
|
|
||||||
if (response.body() != null) {
|
|
||||||
_collectionTicketList.value = response.body()?.let { it.map(contextApp) }
|
|
||||||
} else {
|
|
||||||
_collectionTicketList.value = CollectionVO(
|
_collectionTicketList.value = CollectionVO(
|
||||||
0,
|
0,
|
||||||
isError = true,
|
isError = true,
|
||||||
errorMessage = getMessageFromAllResponse(
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
nameofFunction(this),
|
|
||||||
response.message()
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
override fun onSuccess(response: Response<CollectionVO>) {
|
||||||
|
|
||||||
|
if (response.body() != null) {
|
||||||
|
_collectionTicketList.value = response.body()?.let { it.map(contextApp) }
|
||||||
|
} else {
|
||||||
|
_collectionTicketList.value = CollectionVO(
|
||||||
|
0,
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(
|
||||||
|
nameofFunction(this),
|
||||||
|
response.message()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun saleTrackingReplace(
|
fun saleTrackingReplace(
|
||||||
|
@ -394,6 +404,29 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun collectionAddWithReservation(
|
||||||
|
item: Int,
|
||||||
|
quantity: Int,
|
||||||
|
ticketSelected: Int
|
||||||
|
) {
|
||||||
|
salix.collectionAddWithReservation(
|
||||||
|
params = arrayListOf(item, quantity, ticketSelected)
|
||||||
|
).enqueue(object : SilexCallback<Any>(context) {
|
||||||
|
override fun onSuccess(response: Response<Any>) {
|
||||||
|
_responseCollectionAddItem.value =
|
||||||
|
ResponseItemVO(isError = false, response = "")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseCollectionAddItem.value = ResponseItemVO(
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
fun confirmItemShelvingReservedUpdate(
|
fun confirmItemShelvingReservedUpdate(
|
||||||
itemShelvingSaleFk: Int,
|
itemShelvingSaleFk: Int,
|
||||||
isPicked: Boolean
|
isPicked: Boolean
|
||||||
|
@ -520,6 +553,27 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun itemShelvingSaleUnpicked(
|
||||||
|
itemShelvingSaleFk: Int
|
||||||
|
) {
|
||||||
|
salix.itemShelvingSaleUnpicked(
|
||||||
|
arrayListOf(
|
||||||
|
itemShelvingSaleFk
|
||||||
|
)
|
||||||
|
).enqueue(object : SalixCallback<Unit>(context) {
|
||||||
|
override fun onError(t: Throwable) {
|
||||||
|
_responseItemShelvingSale.value = ResponseItemVO(
|
||||||
|
isError = true,
|
||||||
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onSuccess(response: Response<Unit>) {
|
||||||
|
_responseItemShelvingSale.value = ResponseItemVO(isError = false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
fun saleTrackingAddPreparedSaleGroup(
|
fun saleTrackingAddPreparedSaleGroup(
|
||||||
saleGroupFk: Int
|
saleGroupFk: Int
|
||||||
) {
|
) {
|
||||||
|
@ -527,16 +581,16 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
arrayListOf(
|
arrayListOf(
|
||||||
saleGroupFk
|
saleGroupFk
|
||||||
)
|
)
|
||||||
).enqueue(object : SilexCallback<Unit>(context) {
|
).enqueue(object : SalixCallback<Unit>(context) {
|
||||||
override fun onError(t: Throwable) {
|
override fun onError(t: Throwable) {
|
||||||
_responseSaleGroup.value = ResponseItemVO(
|
_responseItemShelvingSale.value = ResponseItemVO(
|
||||||
isError = true,
|
isError = true,
|
||||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSuccess(response: Response<Unit>) {
|
override fun onSuccess(response: Response<Unit>) {
|
||||||
_responseSaleGroup.value = ResponseItemVO(isError = false)
|
_responseItemShelvingSale.value = ResponseItemVO(isError = false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
package es.verdnatura.presentation.view.feature.delivery.adapters
|
package es.verdnatura.presentation.view.feature.delivery.adapters
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import es.verdnatura.databinding.ItemExpeditionlogRowBinding
|
import es.verdnatura.databinding.ItemExpeditionlogRowBinding
|
||||||
import es.verdnatura.domain.isoToString
|
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLog
|
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLog
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,6 +26,7 @@ class ExpeditionLogAdapter(
|
||||||
|
|
||||||
override fun getItemCount() = items.size
|
override fun getItemCount() = items.size
|
||||||
|
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
|
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
|
||||||
holder.bind(items[position])
|
holder.bind(items[position])
|
||||||
}
|
}
|
||||||
|
@ -33,9 +35,9 @@ class ExpeditionLogAdapter(
|
||||||
val binding: ItemExpeditionlogRowBinding
|
val binding: ItemExpeditionlogRowBinding
|
||||||
) : RecyclerView.ViewHolder(binding.root) {
|
) : RecyclerView.ViewHolder(binding.root) {
|
||||||
private val res = binding.root.context.resources
|
private val res = binding.root.context.resources
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
fun bind(item: ExpeditionInfoLog) {
|
fun bind(item: ExpeditionInfoLog) {
|
||||||
binding.apply {
|
binding.apply {
|
||||||
item.created = item.created.isoToString()
|
|
||||||
this.item = item
|
this.item = item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@ import androidx.annotation.RequiresApi
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.FragmentExpeditionLogDeliveryBinding
|
import es.verdnatura.databinding.FragmentExpeditionLogDeliveryBinding
|
||||||
import es.verdnatura.domain.isoToString
|
|
||||||
import es.verdnatura.domain.toInt
|
import es.verdnatura.domain.toInt
|
||||||
import es.verdnatura.domain.toast
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
|
@ -200,7 +199,6 @@ class LogExpeditionFragment(
|
||||||
binding.routeLayout.visibility = View.VISIBLE
|
binding.routeLayout.visibility = View.VISIBLE
|
||||||
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
binding.mainToolbar.toolbarIcons.visibility = View.VISIBLE
|
||||||
binding.route.text = routeDelivery.ticket.routeFk.toString()
|
binding.route.text = routeDelivery.ticket.routeFk.toString()
|
||||||
binding.date.text = routeDelivery.ticket.route.created.isoToString()
|
|
||||||
binding.agency.text = routeDelivery.ticket.route.agencyMode.agency.name ?: ""
|
binding.agency.text = routeDelivery.ticket.route.agencyMode.agency.name ?: ""
|
||||||
binding.scanInput.setText("")
|
binding.scanInput.setText("")
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
package es.verdnatura.presentation.view.feature.delivery.model
|
package es.verdnatura.presentation.view.feature.delivery.model
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
import androidx.room.Entity
|
import androidx.room.Entity
|
||||||
import androidx.room.PrimaryKey
|
import androidx.room.PrimaryKey
|
||||||
import androidx.room.TypeConverters
|
import androidx.room.TypeConverters
|
||||||
import com.google.gson.annotations.SerializedName
|
import com.google.gson.annotations.SerializedName
|
||||||
import es.verdnatura.db.MapTypeConverter
|
import es.verdnatura.db.MapTypeConverter
|
||||||
|
import es.verdnatura.domain.isoToString
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
@ -42,10 +45,15 @@ class ExpeditionInfoList(
|
||||||
data class ExpeditionInfoLog(
|
data class ExpeditionInfoLog(
|
||||||
var state: String,
|
var state: String,
|
||||||
var name: String,
|
var name: String,
|
||||||
var created: String,
|
//var created: String,
|
||||||
var routeSalix: RouteSalix
|
var routeSalix: RouteSalix
|
||||||
)
|
) {
|
||||||
|
var created: String = ""
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
get() {
|
||||||
|
return field.isoToString()
|
||||||
|
}
|
||||||
|
}
|
||||||
class RouteDeliveryList(
|
class RouteDeliveryList(
|
||||||
var list: List<RouteDelivery> = listOf()
|
var list: List<RouteDelivery> = listOf()
|
||||||
)
|
)
|
||||||
|
@ -72,11 +80,18 @@ class TicketSalix(
|
||||||
|
|
||||||
class RouteDelivery(
|
class RouteDelivery(
|
||||||
var id: Int,
|
var id: Int,
|
||||||
var created: String,
|
//var created: String,
|
||||||
var name: String?,
|
var name: String?,
|
||||||
var ticket: TicketSalix,
|
var ticket: TicketSalix,
|
||||||
|
|
||||||
)
|
) {
|
||||||
|
var created: String = ""
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
get(){
|
||||||
|
return field.isoToString(returnOnlyDate = true)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
class
|
class
|
||||||
Expedition(
|
Expedition(
|
||||||
|
|
|
@ -106,33 +106,12 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
expedition: Int
|
expedition: Int
|
||||||
) {
|
) {
|
||||||
salix.getExpeditionStates(
|
salix.getExpeditionStates(
|
||||||
"""{
|
"""{"where": {"expeditionFk": $expedition},"include": [{"relation": "expeditionStateType","scope": {"fields": ["id","description"]}}],"fields": {"id": true,"created": true,"typeFk": true}}"""
|
||||||
"where": {
|
|
||||||
"expeditionFk": $expedition
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
{
|
|
||||||
"relation": "expeditionStateType",
|
|
||||||
"scope": {
|
|
||||||
"fields": [
|
|
||||||
"id",
|
|
||||||
"description"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"fields": {
|
|
||||||
"id": true,
|
|
||||||
"created": true,
|
|
||||||
"typeFk": true
|
|
||||||
}
|
|
||||||
}""".trim()
|
|
||||||
)
|
)
|
||||||
// silex.expedition_getLog(expedition)
|
// silex.expedition_getLog(expedition)
|
||||||
.enqueue(object : SilexCallback<List<ExpeditionInfoLog>>(context) {
|
.enqueue(object : SalixCallback<List<ExpeditionInfoLog>>(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<List<ExpeditionInfoLog>>) {
|
override fun onSuccess(response: Response<List<ExpeditionInfoLog>>) {
|
||||||
|
|
||||||
if (response.body() != null) {
|
if (response.body() != null) {
|
||||||
_expeditionInfoList.value =
|
_expeditionInfoList.value =
|
||||||
response.body()?.let { ExpeditionInfoList(it) }
|
response.body()?.let { ExpeditionInfoList(it) }
|
||||||
|
@ -304,7 +283,7 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
) {
|
) {
|
||||||
//Tarea 6275
|
//Tarea 6275
|
||||||
//salix.routeGetExpeditionSummary(route)
|
//salix.routeGetExpeditionSummary(route)
|
||||||
silex.route_getExpeditionSummary(route)
|
silex.route_getExpeditionSummary(route)
|
||||||
.enqueue(object : SalixCallback<List<ExpeditionInfoSummary>>(context) {
|
.enqueue(object : SalixCallback<List<ExpeditionInfoSummary>>(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<List<ExpeditionInfoSummary>>) {
|
override fun onSuccess(response: Response<List<ExpeditionInfoSummary>>) {
|
||||||
|
@ -381,6 +360,7 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
_response.value = ResponseItemVO(context.getString(R.string.sendRouteOk))
|
_response.value = ResponseItemVO(context.getString(R.string.sendRouteOk))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(t: Throwable) {
|
override fun onError(t: Throwable) {
|
||||||
_response.value = ResponseItemVO()
|
_response.value = ResponseItemVO()
|
||||||
super.onError(t)
|
super.onError(t)
|
||||||
|
@ -477,7 +457,7 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
salix.saveSign(filePart, mapQuery)
|
salix.saveSign(filePart, mapQuery)
|
||||||
.enqueue(object : SilexCallback<Any>(context) {
|
.enqueue(object : SalixCallback<Any>(context) {
|
||||||
|
|
||||||
override fun onSuccess(response: Response<Any>) {
|
override fun onSuccess(response: Response<Any>) {
|
||||||
_responseSign.value = ResponseItemVO(filePath, false, "", 0)
|
_responseSign.value = ResponseItemVO(filePath, false, "", 0)
|
||||||
|
|
|
@ -30,8 +30,8 @@ class DayOfSaleViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
fun itemShelvingGetSaleDate(vShelvingFK: String) {
|
fun itemShelvingGetSaleDate(vShelvingFK: String) {
|
||||||
//salix falla fecha
|
//salix falla fecha
|
||||||
silex.itemShelving_getSaleDate(vShelvingFK)
|
// silex.itemShelving_getSaleDate(vShelvingFK)
|
||||||
// salix.itemShelvingGetSaleDate(params = listOf(vShelvingFK).formatWithQuotes())
|
salix.itemShelvingGetSaleDate(params = listOf(vShelvingFK).formatWithQuotes())
|
||||||
.enqueue(object :
|
.enqueue(object :
|
||||||
SalixCallback<List<ItemShelvingSaleDate>>(context) {
|
SalixCallback<List<ItemShelvingSaleDate>>(context) {
|
||||||
override fun onError(t: Throwable) {
|
override fun onError(t: Throwable) {
|
||||||
|
|
|
@ -1,16 +1,26 @@
|
||||||
package es.verdnatura.presentation.view.feature.diadeventa.model
|
package es.verdnatura.presentation.view.feature.diadeventa.model
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
|
import es.verdnatura.domain.isoToString
|
||||||
|
|
||||||
class ItemShelvingSaleDate (
|
class ItemShelvingSaleDate (
|
||||||
var itemFk:Int? = null,
|
var itemFk:Int? = null,
|
||||||
var longName:String? = null,
|
var longName:String? = null,
|
||||||
var dated:String? = null,
|
// var dated:String? = null,
|
||||||
var amount:Int? = null,
|
var amount:Int? = null,
|
||||||
var visible:Int? = null,
|
var visible:Int? = null,
|
||||||
var stock:Int? = null,
|
var stock:Int? = null,
|
||||||
var isError:Boolean = false,
|
var isError:Boolean = false,
|
||||||
var errorMessage:String = ""
|
var errorMessage:String = ""
|
||||||
)
|
) {
|
||||||
|
var dated: String = ""
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
get(){
|
||||||
|
return field.isoToString(returnOnlyDate = true)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
class ItemShelvingSaleDateList(
|
class ItemShelvingSaleDateList(
|
||||||
var list:List<ItemShelvingSaleDate> = listOf()
|
var list:List<ItemShelvingSaleDate> = listOf()
|
||||||
|
|
|
@ -4,6 +4,7 @@ import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
import androidx.core.content.ContextCompat.getColor
|
import androidx.core.content.ContextCompat.getColor
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
|
@ -11,7 +12,6 @@ import es.verdnatura.R
|
||||||
import es.verdnatura.R.color.verdnatura_pumpkin_orange
|
import es.verdnatura.R.color.verdnatura_pumpkin_orange
|
||||||
import es.verdnatura.R.color.verdnatura_white
|
import es.verdnatura.R.color.verdnatura_white
|
||||||
import es.verdnatura.databinding.FragmentHistoricoBinding
|
import es.verdnatura.databinding.FragmentHistoricoBinding
|
||||||
import es.verdnatura.domain.isoToString
|
|
||||||
import es.verdnatura.domain.notNull
|
import es.verdnatura.domain.notNull
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
import es.verdnatura.presentation.base.BaseFragment
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||||
|
@ -150,6 +150,7 @@ class HistoricoArticuloFragment(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
override fun observeViewModel() {
|
override fun observeViewModel() {
|
||||||
with(viewModel) {
|
with(viewModel) {
|
||||||
loadHistoricoList.observe(viewLifecycleOwner, Observer { event ->
|
loadHistoricoList.observe(viewLifecycleOwner, Observer { event ->
|
||||||
|
@ -164,14 +165,12 @@ class HistoricoArticuloFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
private fun listToAdapter(lista: List<ItemHistoricoVO>, filter: String) {
|
private fun listToAdapter(lista: List<ItemHistoricoVO>, filter: String) {
|
||||||
|
|
||||||
listHistoric.clear()
|
listHistoric.clear()
|
||||||
listHistoryAux.clear()
|
listHistoryAux.clear()
|
||||||
lista.forEach {
|
lista.forEach {
|
||||||
if (it.shipped != null) {
|
|
||||||
it.shipped = it.shipped!!.isoToString()
|
|
||||||
}
|
|
||||||
if (filter.equals("all")) {
|
if (filter.equals("all")) {
|
||||||
listHistoric.add(it)
|
listHistoric.add(it)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -5,6 +5,7 @@ import androidx.lifecycle.LiveData
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.Transformations
|
import androidx.lifecycle.Transformations
|
||||||
import es.verdnatura.domain.SilexCallback
|
import es.verdnatura.domain.SilexCallback
|
||||||
|
import es.verdnatura.domain.formatWithQuotes
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||||
import es.verdnatura.presentation.base.nameofFunction
|
import es.verdnatura.presentation.base.nameofFunction
|
||||||
|
@ -23,8 +24,8 @@ class ItemShelvingLogViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
fun itemShelvingLogGet(vShelvingFK: String) {
|
fun itemShelvingLogGet(vShelvingFK: String) {
|
||||||
//salix falla fecha
|
//salix falla fecha
|
||||||
silex.itemShelvingLog_get(vShelvingFK)
|
//silex.itemShelvingLog_get(vShelvingFK)
|
||||||
// salix.itemShelvingLogGet(params = listOf(vShelvingFK).formatWithQuotes())
|
salix.itemShelvingLogGet(params = listOf(vShelvingFK).formatWithQuotes())
|
||||||
.enqueue(object :
|
.enqueue(object :
|
||||||
SilexCallback<List<ItemShelvingLog>>(context) {
|
SilexCallback<List<ItemShelvingLog>>(context) {
|
||||||
override fun onSuccess(response: Response<List<ItemShelvingLog>>) {
|
override fun onSuccess(response: Response<List<ItemShelvingLog>>) {
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package es.verdnatura.presentation.view.feature.historicoshelving.model
|
package es.verdnatura.presentation.view.feature.historicoshelving.model
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
|
import es.verdnatura.domain.isoToString
|
||||||
|
|
||||||
class ItemShelvingLog(
|
class ItemShelvingLog(
|
||||||
var itemFk:Int? = null,
|
var itemFk:Int? = null,
|
||||||
|
@ -8,11 +10,19 @@ class ItemShelvingLog(
|
||||||
var shelvingFk:String? = null,
|
var shelvingFk:String? = null,
|
||||||
var visible:Int? = null,
|
var visible:Int? = null,
|
||||||
var accion:String? = null,
|
var accion:String? = null,
|
||||||
var created:String? = null,
|
//var created:String? = null,
|
||||||
var code:String? = null,
|
var code:String? = null,
|
||||||
var isError:Boolean = false,
|
var isError:Boolean = false,
|
||||||
var errorMessage:String = ""
|
var errorMessage:String = ""
|
||||||
)
|
){
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
var created: String = ""
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
get(){
|
||||||
|
return field.isoToString(returnOnlyDate = true)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
class ItemShelvingSaleDateList(
|
class ItemShelvingSaleDateList(
|
||||||
var list:List<ItemShelvingLog> = listOf())
|
var list:List<ItemShelvingLog> = listOf())
|
||||||
|
|
|
@ -4,6 +4,7 @@ import android.content.Context
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.Transformations
|
import androidx.lifecycle.Transformations
|
||||||
import es.verdnatura.domain.SalixCallback
|
import es.verdnatura.domain.SalixCallback
|
||||||
|
import es.verdnatura.domain.formatWithQuotes
|
||||||
import es.verdnatura.presentation.base.BaseViewModel
|
import es.verdnatura.presentation.base.BaseViewModel
|
||||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||||
import es.verdnatura.presentation.base.nameofFunction
|
import es.verdnatura.presentation.base.nameofFunction
|
||||||
|
@ -19,8 +20,8 @@ class HistoricoVehiculoViewModel(var context: Context) : BaseViewModel(context)
|
||||||
|
|
||||||
fun machineWorkeGetHistorical(plateNumber: String, workerId:Int) {
|
fun machineWorkeGetHistorical(plateNumber: String, workerId:Int) {
|
||||||
//salix falla fecha
|
//salix falla fecha
|
||||||
silex.machineWorker_getHistorical(plateNumber,workerId)
|
//silex.machineWorker_getHistorical(plateNumber,workerId)
|
||||||
//salix.machineWorkerGetHistorical(arrayListOf(plateNumber,workerId).formatWithQuotes())
|
salix.machineWorkerGetHistorical(arrayListOf(plateNumber,workerId).formatWithQuotes())
|
||||||
.enqueue(object :
|
.enqueue(object :
|
||||||
SalixCallback<List<ItemHistoricoVehiculo>>(context) {
|
SalixCallback<List<ItemHistoricoVehiculo>>(context) {
|
||||||
override fun onSuccess(response: Response<List<ItemHistoricoVehiculo>>) {
|
override fun onSuccess(response: Response<List<ItemHistoricoVehiculo>>) {
|
||||||
|
|
|
@ -1,13 +1,28 @@
|
||||||
package es.verdnatura.presentation.view.feature.historicovehiculo.model
|
package es.verdnatura.presentation.view.feature.historicovehiculo.model
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
|
import es.verdnatura.domain.isoToString
|
||||||
|
|
||||||
class ItemHistoricoVehiculo(
|
class ItemHistoricoVehiculo(
|
||||||
var inTimed: String? = null,
|
//var inTimed: String? = null,
|
||||||
var workerName: String? = null,
|
var workerName: String? = null,
|
||||||
var outTimed: String? = null,
|
//var outTimed: String? = null,
|
||||||
var isError: Boolean = false,
|
var isError: Boolean = false,
|
||||||
var errorMessage: String = ""
|
var errorMessage: String = ""
|
||||||
)
|
) {
|
||||||
|
var inTimed: String = ""
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
get(){
|
||||||
|
return field.isoToString()
|
||||||
|
}
|
||||||
|
var outTimed: String = ""
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
get(){
|
||||||
|
return field.isoToString()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
class ItemHistoricoVehiculoList(
|
class ItemHistoricoVehiculoList(
|
||||||
var list: List<ItemHistoricoVehiculo> = listOf()
|
var list: List<ItemHistoricoVehiculo> = listOf()
|
||||||
|
|
|
@ -79,7 +79,7 @@ class InventaryViewModel(val context: Context) : BaseViewModel(context) {
|
||||||
|
|
||||||
//sergio para obtener comprador
|
//sergio para obtener comprador
|
||||||
fun itemShelvingBuyerGet() {
|
fun itemShelvingBuyerGet() {
|
||||||
salix.getBuyers().enqueue(object :
|
salix.getBuyers("""{"order":"nickname"}""").enqueue(object :
|
||||||
SilexCallback<List<BuyerVO>>(context) {
|
SilexCallback<List<BuyerVO>>(context) {
|
||||||
override fun onError(t: Throwable) {
|
override fun onError(t: Throwable) {
|
||||||
val listError: ArrayList<BuyerVO> = ArrayList()
|
val listError: ArrayList<BuyerVO> = ArrayList()
|
||||||
|
|
Loading…
Reference in New Issue