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.presacador.model.PreSacadorItemVO
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
fun PreSacadorItemVO.toSale() : SaleVO { fun PreSacadorItemVO.toSale(): SaleVO {
return SaleVO( return SaleVO(
ticketFk = id, ticketFk = id,
level = "1", level = "1",
saleFk = idMovimiento, saleFk = idMovimiento,
itemFk = itemFk, itemFk = itemFk,
quantity = saldo, quantity = saldo,
longName = if (longName != null) longName else "", longName = if (longName != null) longName else "",
isPreviousPrepared = if (quantity == picked) "1" else "0", isPreviousPrepared = if (quantity == picked) "1" else "0",
line1 = longName, line1 = longName,
line2 = if (subName.isNullOrEmpty()) "" else subName,//sergio:cuando subida versión de tarea #3510 se puede quitar isNullOrEmpty 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, originalQuantity = quantity,
placements = carros, placements = carros,
agencyName = trabajador.toString(), agencyName = trabajador.toString(),
packingType=packingType, packingType = packingType,
salePersonFk=if (salesPersonFk.isNullOrEmpty()){""}else salesPersonFk, rgb = null
rgb= null
) )
} }
fun PreSacadorItemVO.toSaleReposicion(): SaleVO {
fun PreSacadorItemVO.toSaleReposicion() : SaleVO {
return SaleVO( return SaleVO(
ticketFk = id, ticketFk = id,
level = "1", level = "1",
saleFk = idMovimiento, saleFk = idMovimiento,
itemFk = itemFk, itemFk = itemFk,
quantity = quantity, quantity = quantity,
longName = if (longName != null) longName else "", longName = if (longName != null) longName else "",
isPreviousPrepared = if ((quantity - saldo) == 0) "1" else "0", isPreviousPrepared = if ((quantity - saldo) == 0) "1" else "0",
line1 = longName, line1 = longName,
line2 = if (subName.isNullOrEmpty()) "" else subName, line2 = if (subName.isNullOrEmpty()) "" else subName,
pickedQuantity = (quantity - saldo), pickedQuantity = (quantity - saldo),
workerFk =trabajador, workerFk = trabajador,
originalQuantity = quantity, originalQuantity = quantity,
placements = carros, placements = carros,
agencyName = trabajador.toString(), agencyName = trabajador.toString(),
rgb=null rgb = null
) )
} }