mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-25 07:45:44 +00:00
feat(BE): update expense DTO and service to directly use location from expense
This commit is contained in:
@@ -105,11 +105,9 @@ func ToExpenseBaseDTO(e *entity.Expense) ExpenseBaseDTO {
|
||||
realizationDate = &e.RealizationDate
|
||||
}
|
||||
|
||||
if len(e.Nonstocks) > 0 && e.Nonstocks[0].Kandang != nil {
|
||||
if e.Nonstocks[0].Kandang.Location.Id != 0 {
|
||||
mapped := locationDTO.ToLocationRelationDTO(e.Nonstocks[0].Kandang.Location)
|
||||
location = &mapped
|
||||
}
|
||||
if e.Location != nil && e.Location.Id != 0 {
|
||||
mapped := locationDTO.ToLocationRelationDTO(*e.Location)
|
||||
location = &mapped
|
||||
}
|
||||
|
||||
if e.Supplier != nil && e.Supplier.Id != 0 {
|
||||
|
||||
Reference in New Issue
Block a user