| | |
| | | stockInfo = new Dt_StockInfo(); |
| | | stockInfo.Details = new List<Dt_StockInfoDetail>(); |
| | | #region MyRegion |
| | | string OrderNo = productionlineDTO.batchNo.Substring(0, 6);// DateTime.Now.ToString("yyMMdd"); |
| | | string OrderNo = productionlineDTO.batchNo.Substring(0, 8);// DateTime.Now.ToString("yyMMdd"); |
| | | Dt_InboundOrder? inboundOrder = _inboundService.InbounOrderService.GetInboundOrder(OrderNo); |
| | | if (inboundOrder == null) throw new Exception($"æªæ¾å°æ¹å·ä¸ºã{OrderNo}ãçå
¥åºå"); |
| | | //var BatchNo = string.Join("", productionlineDTO.batchNo.Except(OrderNo)); |
| | | var BatchNo = productionlineDTO.batchNo.Substring(6); |
| | | var BatchNo = productionlineDTO.batchNo.Substring(8); |
| | | Dt_InboundOrderDetail? inboundOrderDetail = inboundOrder.Details.Where(x => x.BatchNo == BatchNo).FirstOrDefault(); |
| | | if (inboundOrderDetail == null) throw new Exception($"æ¹å·ã{OrderNo}ãçå
¥åºåæªæ¾å°æå·ã{BatchNo}ã"); |
| | | if (inboundOrderDetail.OrderQuantity - inboundOrderDetail.ReceiptQuantity < 1) throw new Exception($"æ¹å·ã{OrderNo}ãçæå·ã{BatchNo}ãå¯ç»çæ°éä¸è¶³"); |