mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
Merge branch 'development' into 'production'
Development See merge request mbugroup/lti-api!378
This commit is contained in:
@@ -37,6 +37,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
chickinDeletePopulationGuardMessage = "Chickin tidak dapat dihapus karena masih memiliki population aktif"
|
chickinDeletePopulationGuardMessage = "Chickin tidak dapat dihapus karena masih memiliki population aktif"
|
||||||
chickinDeleteDownstreamGuardMessage = "Chickin tidak bisa dihapus karena masih dipakai oleh transaksi turunan. Hapus/unexecute Marketing, Recording, Transfer, Adjustment, dan Transfer to Laying terlebih dahulu."
|
chickinDeleteDownstreamGuardMessage = "Chickin tidak bisa dihapus karena masih dipakai oleh transaksi turunan. Hapus/unexecute Marketing, Recording, Transfer, Adjustment, dan Transfer to Laying terlebih dahulu."
|
||||||
|
chickinAdjustmentSourceTable = "adjustment_stocks"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ChickinService interface {
|
type ChickinService interface {
|
||||||
@@ -577,7 +578,7 @@ func (s *chickinService) resolveLayingSourceAvailableQty(ctx context.Context, tx
|
|||||||
Lane: commonSvc.FifoStockV2Lane("STOCKABLE"),
|
Lane: commonSvc.FifoStockV2Lane("STOCKABLE"),
|
||||||
AllocationPurpose: entity.StockAllocationPurposeConsume,
|
AllocationPurpose: entity.StockAllocationPurposeConsume,
|
||||||
ProductWarehouseID: productWarehouseID,
|
ProductWarehouseID: productWarehouseID,
|
||||||
AsOf: asOf,
|
AsOf: nil,
|
||||||
Limit: 10000,
|
Limit: 10000,
|
||||||
Tx: tx,
|
Tx: tx,
|
||||||
})
|
})
|
||||||
@@ -586,10 +587,16 @@ func (s *chickinService) resolveLayingSourceAvailableQty(ctx context.Context, tx
|
|||||||
}
|
}
|
||||||
|
|
||||||
available := 0.0
|
available := 0.0
|
||||||
|
hasAsOf := asOf != nil && !asOf.IsZero()
|
||||||
for _, row := range gatherRows {
|
for _, row := range gatherRows {
|
||||||
if row.AvailableQuantity <= 0 {
|
if row.AvailableQuantity <= 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if hasAsOf &&
|
||||||
|
!strings.EqualFold(strings.TrimSpace(row.SourceTable), chickinAdjustmentSourceTable) &&
|
||||||
|
row.SortAt.After(*asOf) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
available += row.AvailableQuantity
|
available += row.AvailableQuantity
|
||||||
}
|
}
|
||||||
return available, nil
|
return available, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user