feat: refs#6802 SalesPerson

This commit is contained in:
Sergio De la torre 2025-03-24 12:35:39 +01:00
parent e78dfdac0e
commit 028d0b85aa
1 changed files with 8 additions and 11 deletions

View File

@ -3,14 +3,14 @@ package es.verdnatura.presentation.view.feature.presacador.mapper
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
fun PreSacadorItemVO.toSale() : SaleVO {
fun PreSacadorItemVO.toSale(): SaleVO {
return SaleVO(
ticketFk = id,
level = "1",
saleFk = idMovimiento,
itemFk = itemFk,
quantity = saldo,
longName = if (longName != null) longName else "",
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
@ -19,32 +19,29 @@ fun PreSacadorItemVO.toSale() : SaleVO {
originalQuantity = quantity,
placements = carros,
agencyName = trabajador.toString(),
packingType=packingType,
salePersonFk=if (salesPersonFk.isNullOrEmpty()){""}else salesPersonFk,
rgb= null
packingType = packingType,
rgb = null
)
}
fun PreSacadorItemVO.toSaleReposicion() : SaleVO {
fun PreSacadorItemVO.toSaleReposicion(): SaleVO {
return SaleVO(
ticketFk = id,
level = "1",
saleFk = idMovimiento,
itemFk = itemFk,
quantity = quantity,
longName = if (longName != null) longName else "",
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),
workerFk =trabajador,
workerFk = trabajador,
originalQuantity = quantity,
placements = carros,
agencyName = trabajador.toString(),
rgb=null
rgb = null
)
}