mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
feat/BE/US-76/US-78/US-79/TASK-112,120,133,121-Recording growing/TASK-187,189,202,190-Recording Laying/TASK-191,192,194,197,203-Grading Telur
This commit is contained in:
@@ -35,11 +35,21 @@ func MapStocks(recordingID uint, items []validation.Stock) []entity.RecordingSto
|
||||
|
||||
result := make([]entity.RecordingStock, 0, len(items))
|
||||
for _, item := range items {
|
||||
var usageAmount float64
|
||||
if item.Qty != nil {
|
||||
usageAmount = *item.Qty
|
||||
}
|
||||
usagePtr := new(float64)
|
||||
*usagePtr = usageAmount
|
||||
pending := item.PendingQty
|
||||
if pending == nil {
|
||||
pending = new(float64)
|
||||
}
|
||||
result = append(result, entity.RecordingStock{
|
||||
RecordingId: recordingID,
|
||||
ProductWarehouseId: item.ProductWarehouseId,
|
||||
UsageQty: item.UsageAmount,
|
||||
PendingQty: item.PendingQty,
|
||||
UsageQty: usagePtr,
|
||||
PendingQty: pending,
|
||||
})
|
||||
}
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user