mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
fix: chickin include stock allocation, fix calculation hpp
This commit is contained in:
@@ -1914,11 +1914,12 @@ func (s *purchaseService) resolveChickinLockedItemIDsByItemID(ctx context.Contex
|
||||
if err := db.WithContext(ctx).
|
||||
Model(&entity.StockAllocation{}).
|
||||
Distinct("stockable_id").
|
||||
Where("stockable_type = ? AND stockable_id IN ? AND usable_type = ? AND status IN ?",
|
||||
Where("stockable_type = ? AND stockable_id IN ? AND usable_type = ? AND status IN ? AND allocation_purpose = ?",
|
||||
fifo.StockableKeyPurchaseItems.String(),
|
||||
itemIDs,
|
||||
fifo.UsableKeyProjectChickin.String(),
|
||||
[]string{entity.StockAllocationStatusActive, entity.StockAllocationStatusPending},
|
||||
entity.StockAllocationPurposeConsume,
|
||||
).
|
||||
Pluck("stockable_id", &allocationLockedIDs).Error; err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user