v5.1.6
This commit is contained in:
parent
7bc6e93a84
commit
3032f8b721
|
@ -12,8 +12,8 @@ android {
|
||||||
applicationId "es.verdnatura"
|
applicationId "es.verdnatura"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 25
|
versionCode 26
|
||||||
versionName "5.1.5"
|
versionName "5.1.6"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
class ApiUtils {
|
class ApiUtils {
|
||||||
companion object {
|
companion object {
|
||||||
//const val BASE_URL:String = "http://192.168.1.100:8009/"
|
// const val BASE_URL:String = "http://192.168.1.115:8009/"
|
||||||
const val BASE_URL:String = "https://app.verdnatura.es/"
|
const val BASE_URL:String = "https://app.verdnatura.es/"
|
||||||
fun getApiService():VerdnaturaService{
|
fun getApiService():VerdnaturaService{
|
||||||
val retrofit = Retrofit.Builder()
|
val retrofit = Retrofit.Builder()
|
||||||
|
|
|
@ -66,6 +66,13 @@ class CustomDialogThreeButtons (context: Context) : Dialog(context, R.style.Dial
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setOkButtonFour(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
||||||
|
custom_dialog_button_ok_four.visibility = View.VISIBLE
|
||||||
|
custom_dialog_button_ok_four.text = text
|
||||||
|
custom_dialog_button_ok_four.setOnClickListener { onButtonClicked() }
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
fun setOkButtonAdd(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
fun setOkButtonAdd(text: String, onButtonClicked: () -> Unit): CustomDialogThreeButtons {
|
||||||
custom_dialog_button_add.visibility = View.VISIBLE
|
custom_dialog_button_add.visibility = View.VISIBLE
|
||||||
custom_dialog_button_add.text = text
|
custom_dialog_button_add.text = text
|
||||||
|
|
|
@ -920,8 +920,11 @@ class CollectionFragment(
|
||||||
var totalMark = 0
|
var totalMark = 0
|
||||||
sales.forEach {
|
sales.forEach {
|
||||||
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"){
|
||||||
|
totalMark += 1
|
||||||
|
}
|
||||||
}else if (type == CONTROLADOR){
|
}else if (type == CONTROLADOR){
|
||||||
if (it.isControlled == "1")
|
if (it.isControlled == "1")
|
||||||
totalMark += 1
|
totalMark += 1
|
||||||
|
@ -938,7 +941,7 @@ class CollectionFragment(
|
||||||
|
|
||||||
//FALTAS / BASURA / SPLIT
|
//FALTAS / BASURA / SPLIT
|
||||||
private fun showQuantityDialog(position:Int) {
|
private fun showQuantityDialog(position:Int) {
|
||||||
customDialogThreeButtons.setTitle(getString(R.string.Nuevacantidad)).setDescription(getString(R.string.txtnuevacantidad)).setValue("")
|
customDialogThreeButtons.setDescription(getString(R.string.txtnuevacantidad)).setValue("")
|
||||||
.setOkButton(getString(R.string.Faltas)){
|
.setOkButton(getString(R.string.Faltas)){
|
||||||
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){
|
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){
|
||||||
getString(R.string.Indicanuevacantidad).toast(requireContext())
|
getString(R.string.Indicanuevacantidad).toast(requireContext())
|
||||||
|
@ -955,7 +958,16 @@ class CollectionFragment(
|
||||||
scanRequest()
|
scanRequest()
|
||||||
customDialogThreeButtons.dismiss()
|
customDialogThreeButtons.dismiss()
|
||||||
}
|
}
|
||||||
}.setOkButtonThree("Split"){
|
}.setOkButtonThree(getString(R.string.Reject)){
|
||||||
|
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){
|
||||||
|
getString(R.string.Indicanuevacantidad).toast(requireContext())
|
||||||
|
}else{
|
||||||
|
reject(position,customDialogThreeButtons.getValue())
|
||||||
|
scanRequest()
|
||||||
|
customDialogThreeButtons.dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
|
}.setOkButtonFour("Split"){
|
||||||
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){
|
if (customDialogThreeButtons.getValue().trim().isNullOrEmpty()){
|
||||||
getString(R.string.Indicanuevacantidad).toast(requireContext())
|
getString(R.string.Indicanuevacantidad).toast(requireContext())
|
||||||
}else{
|
}else{
|
||||||
|
@ -1064,6 +1076,34 @@ class CollectionFragment(
|
||||||
viewModel.sendChekingPresence(token = token,workerId = sales[position].salePersonFk,message = message)
|
viewModel.sendChekingPresence(token = token,workerId = sales[position].salePersonFk,message = message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun reject(position: Int,quantity:String){
|
||||||
|
var totalQuantity: Int = 0
|
||||||
|
try {
|
||||||
|
totalQuantity = sales[position].quantity.toInt() - quantity.toInt()
|
||||||
|
}catch (e:Exception){}
|
||||||
|
viewModel.collectionMissingTrash(
|
||||||
|
usuario = user,
|
||||||
|
password = password,
|
||||||
|
saleFk = sales[position].saleFk,
|
||||||
|
quantity = totalQuantity.toString(),
|
||||||
|
warehouseFk = warehouseFk,
|
||||||
|
type = "reject",
|
||||||
|
originalQuantity = quantity
|
||||||
|
)
|
||||||
|
//sales[position].originalQuantity = quantity
|
||||||
|
sales[position].quantity = quantity
|
||||||
|
//sales[position].startQuantity = quantity
|
||||||
|
saleAdapter!!.notifyDataSetChanged()
|
||||||
|
if (quantity == "0")
|
||||||
|
markLine(position,type)
|
||||||
|
|
||||||
|
|
||||||
|
//enviar mensaje a salix
|
||||||
|
val ticket = "[" + sales[position].ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + sales[position].ticketFk + "/summary)"
|
||||||
|
val message = "Se ha modificado la cantidad original "+sales[position].originalQuantity+" del artículo "+sales[position].itemFk+" a nueva cantidad: "+ sales[position].quantity +" del ticket "+ticket
|
||||||
|
viewModel.sendChekingPresence(token = token,workerId = sales[position].salePersonFk,message = message)
|
||||||
|
}
|
||||||
|
|
||||||
private fun increaseQuantity(position:Int,quantity:String){
|
private fun increaseQuantity(position:Int,quantity:String){
|
||||||
viewModel.collectionIncreaseQuantity(
|
viewModel.collectionIncreaseQuantity(
|
||||||
usuario = user,
|
usuario = user,
|
||||||
|
@ -1080,6 +1120,12 @@ class CollectionFragment(
|
||||||
}*/
|
}*/
|
||||||
}catch (e:Exception){}
|
}catch (e:Exception){}
|
||||||
saleAdapter?.notifyDataSetChanged()
|
saleAdapter?.notifyDataSetChanged()
|
||||||
|
|
||||||
|
|
||||||
|
//enviar mensaje a salix
|
||||||
|
val ticket = "[" + sales[position].ticketFk + "](https://salix.verdnatura.es/#!/ticket/" + sales[position].ticketFk + "/summary)"
|
||||||
|
val message = "Se ha modificado la cantidad original "+sales[position].originalQuantity+" del artículo "+sales[position].itemFk+" a nueva cantidad: "+ sales[position].quantity +" del ticket "+ticket
|
||||||
|
viewModel.sendChekingPresence(token = token,workerId = sales[position].salePersonFk,message = message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,11 +99,11 @@ class LoginFragment : BaseFragment<FragmentLoginBinding,LoginViewModel> (LoginVi
|
||||||
goToMain()
|
goToMain()
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
customDialog.setTitle("Actualizar").setDescription("Existe una versión nueva, es recomendable actualizar.").setOkButton("Actualizar"){
|
customDialog.setTitle(getString(R.string.Actualizar)).setDescription(getString(R.string.updatemng)).setOkButton(getString(R.string.Actualizar)){
|
||||||
val openURL = Intent(Intent.ACTION_VIEW)
|
val openURL = Intent(Intent.ACTION_VIEW)
|
||||||
openURL.data = Uri.parse("https://app.verdnatura.es/bin/vn-pickingV2.apk")
|
openURL.data = Uri.parse("https://app.verdnatura.es/bin/vn-pickingV2.apk")
|
||||||
startActivity(openURL)
|
startActivity(openURL)
|
||||||
}.setKoButton("Omitir"){
|
}.setKoButton("Cancelar"){
|
||||||
customDialog.dismiss()
|
customDialog.dismiss()
|
||||||
goToMain()
|
goToMain()
|
||||||
}.show()
|
}.show()
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
android:id="@+id/custom_dialog_title"
|
android:id="@+id/custom_dialog_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/layout_margin_3"
|
android:layout_marginTop="@dimen/layout_margin_min"
|
||||||
android:layout_marginBottom="@dimen/default_layout_margin"
|
android:layout_marginBottom="@dimen/layout_margin_min"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/verdnatura_white"
|
android:textColor="@color/verdnatura_white"
|
||||||
android:textSize="@dimen/h6"
|
android:textSize="@dimen/h6"
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
android:id="@+id/custom_dialog_button_add"
|
android:id="@+id/custom_dialog_button_add"
|
||||||
style="@style/DefaultButton.NormalButtonThree"
|
style="@style/DefaultButton.NormalButtonThree"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginTop="@dimen/default_layout_margin"
|
android:layout_marginTop="@dimen/layout_margin_min"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:text="Agregar"
|
tools:text="Agregar"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
android:id="@+id/custom_dialog_button_ok"
|
android:id="@+id/custom_dialog_button_ok"
|
||||||
style="@style/DefaultButton.NormalButton"
|
style="@style/DefaultButton.NormalButton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginTop="@dimen/default_layout_margin"
|
android:layout_marginTop="@dimen/layout_margin_1"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:text="Falta"
|
tools:text="Falta"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
@ -81,16 +81,25 @@
|
||||||
android:id="@+id/custom_dialog_button_ok_two"
|
android:id="@+id/custom_dialog_button_ok_two"
|
||||||
style="@style/DefaultButton.NormalButton"
|
style="@style/DefaultButton.NormalButton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginTop="@dimen/default_layout_margin"
|
android:layout_marginTop="@dimen/layout_margin_1"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:text="Basura"
|
tools:text="Basura"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/custom_dialog_button_ok_three"
|
android:id="@+id/custom_dialog_button_ok_three"
|
||||||
|
style="@style/DefaultButton.NormalButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_marginTop="@dimen/layout_margin_1"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:text="RECHAZO"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/custom_dialog_button_ok_four"
|
||||||
style="@style/DefaultButton.NormalButtonTwo"
|
style="@style/DefaultButton.NormalButtonTwo"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginTop="@dimen/default_layout_margin"
|
android:layout_marginTop="@dimen/layout_margin_1"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:text="Split"
|
tools:text="Split"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
@ -99,7 +108,7 @@
|
||||||
android:id="@+id/custom_dialog_button_ko"
|
android:id="@+id/custom_dialog_button_ko"
|
||||||
style="@style/DefaultButton.TransparentButton"
|
style="@style/DefaultButton.TransparentButton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_marginTop="@dimen/default_layout_margin"
|
android:layout_marginTop="@dimen/layout_margin_1"
|
||||||
android:layout_marginBottom="@dimen/default_layout_margin"
|
android:layout_marginBottom="@dimen/default_layout_margin"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:text="Cancelar"
|
tools:text="Cancelar"
|
||||||
|
|
|
@ -78,9 +78,12 @@
|
||||||
<string name="ArtículoparaTicket">Artículo para Ticket</string>
|
<string name="ArtículoparaTicket">Artículo para Ticket</string>
|
||||||
<string name="Escaneaelcarroparaelitemseleccionado">Escanea el carro para el item seleccionado</string>
|
<string name="Escaneaelcarroparaelitemseleccionado">Escanea el carro para el item seleccionado</string>
|
||||||
<string name="txtnuevacantidad">Indica la nueva cantidad y la acción que quieres realizar con el resto.</string>
|
<string name="txtnuevacantidad">Indica la nueva cantidad y la acción que quieres realizar con el resto.</string>
|
||||||
<string name="BasuraRechazar">Basura / Rechazar</string>
|
<string name="BasuraRechazar">Basura</string>
|
||||||
<string name="Indicanuevacantidad">Indica nueva cantidad</string>
|
<string name="Indicanuevacantidad">Indica nueva cantidad</string>
|
||||||
<string name="Coleccióncompleta">Colección completa</string>
|
<string name="Coleccióncompleta">Colección completa</string>
|
||||||
<string name="Parking">Parking</string>
|
<string name="Parking">Parking</string>
|
||||||
<string name="ShelvingParking">Shelving Parking</string>
|
<string name="ShelvingParking">Shelving Parking</string>
|
||||||
|
<string name="Reject">Rechazar</string>
|
||||||
|
<string name="updatemng">Existe una versión nueva, es recomendable actualizar.</string>
|
||||||
|
<string name="Actualizar">Actualizar</string>
|
||||||
</resources>
|
</resources>
|
|
@ -77,9 +77,12 @@
|
||||||
<string name="ArtículoparaTicket">Ticket Item</string>
|
<string name="ArtículoparaTicket">Ticket Item</string>
|
||||||
<string name="Escaneaelcarroparaelitemseleccionado">Scan the cart for the selected item</string>
|
<string name="Escaneaelcarroparaelitemseleccionado">Scan the cart for the selected item</string>
|
||||||
<string name="txtnuevacantidad">Indicate the new quantity and the action you want to take with the rest.</string>
|
<string name="txtnuevacantidad">Indicate the new quantity and the action you want to take with the rest.</string>
|
||||||
<string name="BasuraRechazar">Garbage / Reject</string>
|
<string name="BasuraRechazar">Garbage</string>
|
||||||
<string name="Indicanuevacantidad">Indicates new quantity</string>
|
<string name="Indicanuevacantidad">Indicates new quantity</string>
|
||||||
<string name="Coleccióncompleta">Complete collection</string>
|
<string name="Coleccióncompleta">Complete collection</string>
|
||||||
<string name="Parking">Parking</string>
|
<string name="Parking">Parking</string>
|
||||||
<string name="ShelvingParking">Shelving Parking</string>
|
<string name="ShelvingParking">Shelving Parking</string>
|
||||||
|
<string name="Reject">Reject</string>
|
||||||
|
<string name="updatemng">There is a new version, it is recommended to update.</string>
|
||||||
|
<string name="Actualizar">Update</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in New Issue