feat: refs #8099 addSalarySupplement

This commit is contained in:
Sergio De la torre 2024-11-08 10:51:27 +01:00
parent 26e13bb7d0
commit afc8abe090
2 changed files with 11 additions and 4 deletions

View File

@ -34,7 +34,11 @@ class SalaryComplementFragment(
private val adapterComplement: SalarySupplementAdapter by lazy { private val adapterComplement: SalarySupplementAdapter by lazy {
SalarySupplementAdapter(emptyList(), object : OnSalarySupplementClickListener { SalarySupplementAdapter(emptyList(), object : OnSalarySupplementClickListener {
override fun onSalarySupplementClickListener(item: RouteComplement) { override fun onSalarySupplementClickListener(item: RouteComplement) {
viewModel.routeComplementDelete(item.id, binding.date.text.toString()) viewModel.routeComplementDelete(
item.id,
binding.date.text.toString(),
mobileApplication.userId!!
)
} }
}) })
} }
@ -61,7 +65,10 @@ class SalaryComplementFragment(
requireContext(), { _, selectedYear, selectedMonth, selectedDay -> requireContext(), { _, selectedYear, selectedMonth, selectedDay ->
binding.date.text = binding.date.text =
getString(R.string.dateDay, selectedDay, selectedMonth + 1, selectedYear) getString(R.string.dateDay, selectedDay, selectedMonth + 1, selectedYear)
viewModel.getRouteComplements(binding.date.text.toString()) viewModel.getRouteComplements(
binding.date.text.toString(),
mobileApplication.userId!!
)
}, year, month, day }, year, month, day
).apply { ).apply {
setTitle(getString(R.string.selectDate)) setTitle(getString(R.string.selectDate))
@ -72,7 +79,7 @@ class SalaryComplementFragment(
override fun init() { override fun init() {
viewModel.getRouteAction() viewModel.getRouteAction()
binding.date.text = toDateString(Date()) binding.date.text = toDateString(Date())
viewModel.getRouteComplements(binding.date.text.toString()) viewModel.getRouteComplements(binding.date.text.toString(), mobileApplication.userId!!)
ma.hideBottomNavigation(View.GONE) ma.hideBottomNavigation(View.GONE)
setToolBar() setToolBar()
setEvents() setEvents()

View File

@ -104,7 +104,7 @@ class ExpeditionDeleteFragment(var title: String = "") :
adapter!!.updateItems(listExpeditions.map { it.expeditionFk.toLong() } as ArrayList<Long>) adapter!!.updateItems(listExpeditions.map { it.expeditionFk.toLong() } as ArrayList<Long>)
} else { } else {
ma.messageWithSound( ma.messageWithSound(
message = "Caja ya escaneada", message = getString(R.string.boxScanned),
isError = true, isError = true,
isPlayed = true, isPlayed = true,
isToasted = true isToasted = true