private void WrapHuStatus(HuStatus huStatus, LocationLotDetail locationLotDetail) { if (locationLotDetail != null && locationLotDetail.Qty > 0) { Location location = this.genericMgr.FindById<Location>(locationLotDetail.Location); huStatus.Status = CodeMaster.HuStatus.Location; huStatus.Region = location.Region; huStatus.Location = locationLotDetail.Location; huStatus.Bin = locationLotDetail.Bin; huStatus.IsConsignment = locationLotDetail.IsConsignment; huStatus.PlanBill = locationLotDetail.PlanBill; huStatus.QualityType = locationLotDetail.QualityType; huStatus.IsFreeze = locationLotDetail.IsFreeze; huStatus.IsATP = locationLotDetail.IsATP; huStatus.OccupyType = locationLotDetail.OccupyType; huStatus.OccupyReferenceNo = locationLotDetail.OccupyReferenceNo; } }
private void CheckLocationLotDetailOccupied(LocationLotDetail locationLotDetail, BusinessException businessException) { if (locationLotDetail.OccupyType == com.Sconit.CodeMaster.OccupyType.Inspect) { //被检验单占用 businessException.AddMessage(Resources.INV.LocationLotDetail.Errors_HuOccupiedByInspectOrder, locationLotDetail.HuId, locationLotDetail.OccupyReferenceNo); } else if (locationLotDetail.OccupyType == com.Sconit.CodeMaster.OccupyType.Pick) { //被捡货单占用 businessException.AddMessage(Resources.INV.LocationLotDetail.Errors_HuOccupiedByPickList, locationLotDetail.HuId, locationLotDetail.OccupyReferenceNo); } else if (locationLotDetail.OccupyType == com.Sconit.CodeMaster.OccupyType.Sequence) { //被排序单占用 businessException.AddMessage(Resources.INV.LocationLotDetail.Errors_HuOccupiedBySequenceOrder, locationLotDetail.HuId, locationLotDetail.OccupyReferenceNo); } else if (locationLotDetail.OccupyType == com.Sconit.CodeMaster.OccupyType.MiscOrder) { //被计划外出入库单占用 businessException.AddMessage(Resources.INV.LocationLotDetail.Errors_HuOccupiedByMiscOrder, locationLotDetail.HuId, locationLotDetail.OccupyReferenceNo); } }
private void CheckLocationLotDetailOccupiedByMiscOrder(LocationLotDetail locationLotDetail, string occupyReferenceNo, BusinessException businessException) { if (locationLotDetail.OccupyType == com.Sconit.CodeMaster.OccupyType.MiscOrder && locationLotDetail.OccupyReferenceNo != occupyReferenceNo) { //要求被计划外出入库单占用,实际被其它捡货占用 throw new BusinessException(Resources.INV.LocationLotDetail.Errors_HuOccupiedByMiscOrder, locationLotDetail.HuId, locationLotDetail.OccupyReferenceNo); } else if (locationLotDetail.OccupyType == com.Sconit.CodeMaster.OccupyType.None) { //要求被计划外出入库单占用,实际没有被占用 throw new BusinessException(Resources.INV.LocationLotDetail.Errors_HuNotOccupiedByMiscOrder, locationLotDetail.HuId, occupyReferenceNo); } else if (locationLotDetail.OccupyType == com.Sconit.CodeMaster.OccupyType.Pick) { //要求被计划外出入库单占用,实际被拣货单占用 throw new BusinessException(Resources.INV.LocationLotDetail.Errors_HuOccupiedByPickList, locationLotDetail.HuId, locationLotDetail.OccupyReferenceNo); } else if (locationLotDetail.OccupyType == com.Sconit.CodeMaster.OccupyType.Inspect) { //要求被计划外出入库单占用,实际被检验单占用 throw new BusinessException(Resources.INV.LocationLotDetail.Errors_HuOccupiedByInspectOrder, locationLotDetail.HuId, locationLotDetail.OccupyReferenceNo); } else if (locationLotDetail.OccupyType == com.Sconit.CodeMaster.OccupyType.Sequence) { //要求被计划外出入库单占用,实际被排序单占用 throw new BusinessException(Resources.INV.LocationLotDetail.Errors_HuOccupiedBySequenceOrder, locationLotDetail.HuId, locationLotDetail.OccupyReferenceNo); } }
private InventoryTransaction CreateInventoryTransaction(InventoryIO inventoryIO, decimal qty, LocationLotDetail backFlushLocLotDet, SettleBillTransaction billTransaction) { InventoryTransaction inventoryTransaction = new InventoryTransaction(); inventoryTransaction.LocationLotDetailId = backFlushLocLotDet.Id; inventoryTransaction.Location = inventoryIO.Location; inventoryTransaction.Bin = inventoryIO.Bin; inventoryTransaction.Item = inventoryIO.Item; inventoryTransaction.HuId = inventoryIO.HuId; inventoryTransaction.LotNo = inventoryIO.LotNo; inventoryTransaction.IsCreatePlanBill = inventoryIO.IsCreatePlanBill; inventoryTransaction.IsConsignment = inventoryIO.IsConsignment; inventoryTransaction.PlanBill = inventoryIO.PlanBill; if (inventoryIO.IsConsignment) { //寄售库存 inventoryTransaction.PlanBillQty = qty; } if (billTransaction != null) //发生了结算,记录结算数量 { inventoryTransaction.BillTransactionId = billTransaction.Id; inventoryTransaction.IsConsignment = false; inventoryTransaction.ActingBill = billTransaction.ActingBill; inventoryTransaction.ActingBillQty = qty; //基本单位 inventoryTransaction.PlanBillQty = inventoryIO.Qty - qty; } inventoryTransaction.Qty = qty; inventoryTransaction.QualityType = inventoryIO.QualityType; inventoryTransaction.IsATP = inventoryIO.IsATP; inventoryTransaction.IsFreeze = inventoryIO.IsFreeze; inventoryTransaction.OccupyType = inventoryIO.OccupyType; inventoryTransaction.OccupyReferenceNo = inventoryIO.OccupyReferenceNo; return inventoryTransaction; }
private InventoryTransaction CreateInventoryTransaction(LocationLotDetail locationLotDetail, decimal qty, bool isCreatePlanBill, SettleBillTransaction billTransaction) { InventoryTransaction inventoryTransaction = new InventoryTransaction(); inventoryTransaction.LocationLotDetailId = locationLotDetail.Id; inventoryTransaction.Location = locationLotDetail.Location; inventoryTransaction.Bin = locationLotDetail.Bin; inventoryTransaction.Item = locationLotDetail.Item; inventoryTransaction.HuId = locationLotDetail.HuId; inventoryTransaction.LotNo = locationLotDetail.LotNo; inventoryTransaction.IsConsignment = locationLotDetail.IsConsignment; inventoryTransaction.IsCreatePlanBill = isCreatePlanBill; inventoryTransaction.PlanBill = locationLotDetail.PlanBill; if (locationLotDetail.IsConsignment) { //寄售库存 inventoryTransaction.PlanBillQty = qty; } if (billTransaction != null) //发生了结算,记录结算数量 { inventoryTransaction.BillTransactionId = billTransaction.Id; //inventoryTransaction.IsConsignment = false; inventoryTransaction.ActingBill = billTransaction.ActingBill; inventoryTransaction.ActingBillQty = qty; inventoryTransaction.PlanBillQty = 0; } inventoryTransaction.Qty = qty; inventoryTransaction.QualityType = locationLotDetail.QualityType; inventoryTransaction.IsATP = locationLotDetail.IsATP; inventoryTransaction.IsFreeze = locationLotDetail.IsFreeze; inventoryTransaction.OccupyType = locationLotDetail.OccupyType; inventoryTransaction.OccupyReferenceNo = locationLotDetail.OccupyReferenceNo; return inventoryTransaction; }
private void RecordFreezeTransaction(LocationLotDetail locationLotDetail) { User user = SecurityContextHolder.Get(); FreezeTransaction freezeTransaction = new FreezeTransaction(); freezeTransaction.CreateDate = DateTime.Now; freezeTransaction.CreateUserName = user.FullName; freezeTransaction.CreateUserId = user.Id; freezeTransaction.Freeze = locationLotDetail.IsFreeze; freezeTransaction.HuId = locationLotDetail.HuId; freezeTransaction.Location = locationLotDetail.Location; freezeTransaction.Item = locationLotDetail.Item; freezeTransaction.LotNo = locationLotDetail.LotNo; freezeTransaction.Bin = locationLotDetail.Bin; freezeTransaction.Reason = locationLotDetail.Reason; freezeTransaction.ItemVersion = locationLotDetail.ItemVersion; this.genericMgr.Create(freezeTransaction); }
private void RecordPickTransaction(LocationLotDetail locationLotDetail) { User user = SecurityContextHolder.Get(); PickTransaction pickTransaction = new PickTransaction(); pickTransaction.CreateDate = DateTime.Now; pickTransaction.CreateUserName = user.FullName; pickTransaction.CreateUserId = user.Id; pickTransaction.HuId = locationLotDetail.HuId; pickTransaction.LotNo = locationLotDetail.LotNo; pickTransaction.Bin = locationLotDetail.Bin; pickTransaction.Item = locationLotDetail.Item; //pickTransaction.ItemDescription = locationLotDetail.ItemDescription; pickTransaction.Location = locationLotDetail.Location; pickTransaction.IsPick = locationLotDetail.IsPick; this.genericMgr.Create(pickTransaction); }
private InventoryTransaction CreateInventoryTransaction(LocationLotDetail locationLotDetail, decimal qty, bool isCreatePlanBill, BillTransaction billTransaction) { InventoryTransaction inventoryTransaction = new InventoryTransaction(); inventoryTransaction.LocationLotDetailId = locationLotDetail.Id; inventoryTransaction.Location = locationLotDetail.Location; inventoryTransaction.Bin = locationLotDetail.Bin; inventoryTransaction.Item = locationLotDetail.Item; inventoryTransaction.HuId = locationLotDetail.HuId; inventoryTransaction.LotNo = locationLotDetail.LotNo; inventoryTransaction.IsConsignment = locationLotDetail.IsConsignment; inventoryTransaction.IsCreatePlanBill = isCreatePlanBill; inventoryTransaction.PlanBill = locationLotDetail.PlanBill; if (locationLotDetail.IsConsignment) { //寄售库存 inventoryTransaction.PlanBillQty = qty; } if (billTransaction != null) { //if (billTransaction.TransactionType == CodeMaster.BillTransactionType.POSettle) //{ //发生了结算,记录结算数量 inventoryTransaction.BillTransactionId = billTransaction.Id; inventoryTransaction.IsConsignment = false; inventoryTransaction.ActingBill = billTransaction.ActingBill; inventoryTransaction.ActingBillQty = qty; inventoryTransaction.PlanBillQty = 0; //} //else if(billTransaction.TransactionType == CodeMaster.BillTransactionType.POSettleVoid) //{ // //发生了反结算,记录反结算数量 // inventoryTransaction.BillTransactionId = billTransaction.Id; // inventoryTransaction.IsConsignment = true; // inventoryTransaction.ActingBill = 0; // inventoryTransaction.ActingBillQty = 0; //基本单位 // inventoryTransaction.PlanBill = billTransaction.PlanBill; // inventoryTransaction.PlanBillQty = qty; //} } inventoryTransaction.Qty = qty; inventoryTransaction.QualityType = locationLotDetail.QualityType; inventoryTransaction.IsATP = locationLotDetail.IsATP; inventoryTransaction.IsFreeze = locationLotDetail.IsFreeze; inventoryTransaction.OccupyType = locationLotDetail.OccupyType; inventoryTransaction.OccupyReferenceNo = locationLotDetail.OccupyReferenceNo; return inventoryTransaction; }