| | |
| | | entity = new Dt_InventoryInfo |
| | | { |
| | | PalletCode = detail.orderDetails?.FirstOrDefault()?.palletCode ?? "", |
| | | WarehouseId = 1, // é»è®¤åºæ¿ç¼å· |
| | | WarehouseCode = 1.ToString(), // é»è®¤åºæ¿ç¼å· |
| | | LocationCode = "", |
| | | StockStatus = 1, // ç«åºåºå®ä¸º 1 |
| | | MaterielCode = detail.productCode ?? detail.productName, |
| | |
| | | switch (request.orderType) |
| | | { |
| | | case "1": // å
¥åº |
| | | entity.StockQuantity += (float)orderQty; |
| | | entity.StockQuantity += orderQty; |
| | | entity.InDate = DateTime.Now; |
| | | entity.Remark = "å
¥åºååä¼ "; |
| | | |
| | | batch.StockQuantity += (float)orderQty; |
| | | batch.StockQuantity += orderQty; |
| | | batch.Remark = "å
¥åºååä¼ "; |
| | | break; |
| | | |
| | | case "2": // åºåº |
| | | entity.OutboundQuantity += (float)orderQty; |
| | | entity.StockQuantity -= (float)orderQty; |
| | | entity.OutboundQuantity += orderQty; |
| | | entity.StockQuantity -= orderQty; |
| | | if (entity.StockQuantity < 0) entity.StockQuantity = 0; |
| | | entity.Remark = "åºåºååä¼ "; |
| | | |
| | | batch.OutboundQuantity += (float)orderQty; |
| | | batch.StockQuantity -= (float)orderQty; |
| | | batch.OutboundQuantity += orderQty; |
| | | batch.StockQuantity -= orderQty; |
| | | if (batch.StockQuantity < 0) batch.StockQuantity = 0; |
| | | batch.Remark = "åºåºååä¼ "; |
| | | break; |
| | |
| | | decimal diff = Convert.ToDecimal(stock.differenceQuantity); |
| | | if (stock.IsProfit == "1") // çç |
| | | { |
| | | entity.SupplyQuantity += (float)Math.Abs(diff); |
| | | batch.SupplyQuantity += (float)Math.Abs(diff); |
| | | entity.SupplyQuantity += Math.Abs(diff); |
| | | batch.SupplyQuantity += Math.Abs(diff); |
| | | } |
| | | else // çäº |
| | | { |
| | | entity.SupplyQuantity -= (float)Math.Abs(diff); |
| | | batch.SupplyQuantity -= (float)Math.Abs(diff); |
| | | entity.SupplyQuantity -= Math.Abs(diff); |
| | | batch.SupplyQuantity -= Math.Abs(diff); |
| | | if (entity.SupplyQuantity < 0) entity.SupplyQuantity = 0; |
| | | if (batch.SupplyQuantity < 0) batch.SupplyQuantity = 0; |
| | | } |