| | |
| | | Joins("left join wms_operation on wms_operation_details.operation_id = wms_operation.id"). |
| | | Where("wms_operation_details.product_id in (?)", productIds). |
| | | Where("wms_operation.from_location_id in (?)", locationIds).Where("wms_operation.status = ?", constvar.OperationStatus_Ready). |
| | | Where("wms_operation.base_operation_type in (?)", []constvar.BaseOperationType{constvar.BaseOperationTypeOutgoing, constvar.BaseOperationTypeInternal}). |
| | | Where("wms_operation.base_operation_type in (?)", []constvar.BaseOperationType{constvar.BaseOperationTypeOutgoing, constvar.BaseOperationTypeInternal, constvar.BaseOperationTypeDisuse}). |
| | | Find(&canUse).Error |
| | | if err != nil { |
| | | return nil, err |
| | |
| | | cu = cu.Add(info.Amount) |
| | | } |
| | | } |
| | | cu = at.Sub(cu) |
| | | p.AvailableNumber = cu.String() |
| | | |
| | | products = append(products, &p) |