修改药品基数时如果新基数大于原则需要补药数量为新基数减去原基数
This commit is contained in:
		
							parent
							
								
									af620ae141
								
							
						
					
					
						commit
						1d27a080fa
					
				| 
						 | 
					@ -350,7 +350,13 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                int baseQty = 0;
 | 
					                int baseQty = 0;
 | 
				
			||||||
                if (int.TryParse(BaseQuantity, out baseQty))
 | 
					                if (int.TryParse(BaseQuantity, out baseQty))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    Channel.BaseQuantity = Convert.ToInt32(baseQty);
 | 
					                    logger.Info($"修改药品基数{Channel.BaseQuantity}改为{baseQty}");
 | 
				
			||||||
 | 
					                    if (baseQty > Channel.BaseQuantity)
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        //基数变大,需要补药
 | 
				
			||||||
 | 
					                        Channel.NeedNum = baseQty - Channel.BaseQuantity;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    Channel.BaseQuantity = baseQty;
 | 
				
			||||||
                    int iUpdate = SqlSugarHelper.Db.Updateable<ChannelStock>(Channel).ExecuteCommand();
 | 
					                    int iUpdate = SqlSugarHelper.Db.Updateable<ChannelStock>(Channel).ExecuteCommand();
 | 
				
			||||||
                    if (iUpdate > 0)
 | 
					                    if (iUpdate > 0)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue