namespace MMDAL.DTO.StockValuation; /// /// Maps 1:1 to StockMovementTVP. Populated by StockPostingBLL before calling sp_ApplyStockBatch. /// Cost/GC fields default to 0 at posting time; UpdateCostForDocumentAsync fills them after save. /// public class StockMovementDTO { public int StockLedgerId { get; set; } // TSTOCKLEDGER PK; DB IDENTITY column — populated only when read back, never set for insert public string StockLedgerNumber { get; set; } = string.Empty; public int OuId { get; set; } = -1; public int BizTransactionTypeId { get; set; } public int ObjectTypeId { get; set; } = -1; // head entity id (e.g. TMMHEAD) public int ObjectId { get; set; } = -1; // head document id public byte LocationType { get; set; } // 0=Inside, 1=Site, 2=Both public int AllocationId { get; set; } = -1; // MALLOCATION ref; -1=none public int StoreId { get; set; } = -1; public int WorkCenterId { get; set; } = -1; // WIP rows only public int PartyBranchId { get; set; } = -1; // shop/site; -1=OU-level public int ItemId { get; set; } public int SkuId { get; set; } = -1; public byte StockPostType { get; set; } // 0=IN,1=OUT,2=WIP IN,3=WIP OUT public byte MaterialOwnershipType { get; set; } // 0=Own,1=Party public decimal TransactionQuantity { get; set; } // qty in TransactionUomId public int UomId { get; set; } = -1; // = TransactionUomId typically public decimal ConversionFactor { get; set; } = 1; // TransactionQuantity -> Quantity public decimal Quantity { get; set; } public decimal PackQuantity { get; set; } public int PackId { get; set; } = -1; public decimal Weight { get; set; } public int CurrencyId { get; set; } = -1; public decimal RateConversionFactor { get; set; } = 1; public decimal Rate { get; set; } public int RatePerUomId { get; set; } = -1; public decimal Cost { get; set; } // 0 at post; filled by UpdateCost public decimal PostedCost { get; set; } public decimal PostedValue { get; set; } public decimal GoodQuantity { get; set; } public decimal RejectedQuantity { get; set; } public decimal ReworkQuantity { get; set; } public decimal OtherQuantity { get; set; } public decimal TransactionActualQuantity { get; set; } public decimal ActualQuantity { get; set; } public int TransactionUomId { get; set; } = -1; public int ObjectDetailTypeId { get; set; } // EntityId of TMMDETAIL for MM public int ObjectDetailId { get; set; } // DOCUMENTDETAILID public byte DeliveryType { get; set; } public decimal? MaterialCost { get; set; } // null at post; filled post-cost-calc public decimal? ProcessCost { get; set; } public decimal? ChargesCost { get; set; } public decimal? Revenue { get; set; } public int IndentDetailId { get; set; } = -1; // originating indent; -1=none public decimal GcCurrencyConversion { get; set; } // 0 at post; deferred GC step public decimal PostedCostGc { get; set; } public decimal PostedValueGc { get; set; } public int TenantId { get; set; } public string? ReferenceNumber { get; set; } }