| | |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.Base; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.CalcOut; |
| | | using WIDESEA_DTO.ReturnMES; |
| | |
| | | List<Dt_StockInfoDetail> stockInfoDetails = stockInfo.Details.Where((x => x.StockQuantity > x.OutboundQuantity)).ToList(); |
| | | |
| | | decimal itemQuantity = item.LockQuantity - item.OverOutQuantity; |
| | | |
| | | decimal unitbarcodeQuantity; |
| | | foreach (var stockDetail in stockInfoDetails) |
| | | { |
| | | |
| | | |
| | | if (itemQuantity >= stockDetail.StockQuantity - stockDetail.OutboundQuantity) |
| | | { |
| | | unitbarcodeQuantity = stockDetail.StockQuantity - stockDetail.OutboundQuantity; |
| | | UnitConvertResultDTO currentResult = _basicService.UnitQuantityConvert(item.MaterielCode, item.Unit, item.BarcodeUnit, unitbarcodeQuantity); |
| | | |
| | | Barcodes barcodes = new Barcodes |
| | | { |
| | | Barcode = stockDetail.Barcode, |
| | | Qty = stockDetail.StockQuantity - stockDetail.OutboundQuantity, |
| | | Qty = currentResult.ToQuantity, |
| | | SupplyCode = stockDetail?.SupplyCode ?? "", |
| | | BatchNo = stockDetail?.BatchNo ?? "", |
| | | Unit = stockDetail?.Unit ?? "" |
| | | Unit = currentResult.ToUnit ?? "" |
| | | }; |
| | | |
| | | itemQuantity -= (stockDetail.StockQuantity - stockDetail.OutboundQuantity); |
| | |
| | | } |
| | | else |
| | | { |
| | | UnitConvertResultDTO currentResult = _basicService.UnitQuantityConvert(item.MaterielCode, item.Unit, item.BarcodeUnit, itemQuantity); |
| | | Barcodes barcodes = new Barcodes |
| | | { |
| | | Barcode = stockDetail.Barcode, |
| | | Qty = itemQuantity, |
| | | Qty = currentResult.ToQuantity, |
| | | SupplyCode = stockDetail?.SupplyCode ?? "", |
| | | BatchNo = stockDetail?.BatchNo ?? "", |
| | | Unit = stockDetail?.Unit ?? "" |
| | | Unit = currentResult.ToUnit ?? "" |
| | | }; |
| | | stockDetail.OutboundQuantity += itemQuantity; |
| | | barcodesList.Add(barcodes); |
| | |
| | | updateDetails.Add(item); |
| | | |
| | | List<Barcodes> barcodesList = new List<Barcodes>(); |
| | | UnitConvertResultDTO currentResult = _basicService.UnitQuantityConvert(item.MaterielCode, item.Unit, item.BarcodeUnit, barcodeQuantity); |
| | | |
| | | Barcodes barcodes = new Barcodes |
| | | { |
| | | Barcode = isUnpacked ? newBarcode : stockDetail?.Barcode, |
| | | Qty = barcodeQuantity, |
| | | Qty = currentResult.ToQuantity, |
| | | SupplyCode = stockDetail?.SupplyCode ?? "", |
| | | BatchNo = stockDetail?.BatchNo ?? "", |
| | | Unit = stockDetail?.Unit ?? "" |
| | | Unit = currentResult.ToUnit ?? "" |
| | | }; |
| | | if (!string.IsNullOrEmpty(item.ReturnJsonData)) |
| | | { |
| | |
| | | /// <param name="beforeQuantity"></param> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | private (string NewBarcode, List<MaterialCodeReturnDTO> MaterialCodeReturnDTOs) PerformUnpackOperation(Dt_StockInfoDetail stockDetail, Dt_StockInfo stockInfo, |
| | | public (string NewBarcode, List<MaterialCodeReturnDTO> MaterialCodeReturnDTOs) PerformUnpackOperation(Dt_StockInfoDetail stockDetail, Dt_StockInfo stockInfo, |
| | | decimal actualOutboundQuantity, OutboundCompleteRequestDTO request, decimal beforeQuantity, int taskNum, int orderId, string orderNo) |
| | | { |
| | | string newBarcode = GenerateNewBarcode(); |
| | |
| | | /// <summary> |
| | | /// æ§è¡å®æ´åºåºæä½ï¼ä¸æå
ï¼ |
| | | /// </summary> |
| | | private void PerformFullOutboundOperation(Dt_StockInfoDetail stockDetail, Dt_StockInfo stockInfo, |
| | | public void PerformFullOutboundOperation(Dt_StockInfoDetail stockDetail, Dt_StockInfo stockInfo, |
| | | decimal actualOutboundQuantity, OutboundCompleteRequestDTO request, decimal beforeQuantity, int taskNum) |
| | | { |
| | | // ä¿ååºåæç»å°åå²è®°å½ |