Bläddra i källkod

本期数量变更 -- 数量,输入公式,应可正确选择变更令

MaiXinRong 6 år sedan
förälder
incheckning
aa34491c8a
1 ändrade filer med 13 tillägg och 7 borttagningar
  1. 13 7
      DataModules/BillsMeasureDm.pas

+ 13 - 7
DataModules/BillsMeasureDm.pas

@@ -352,22 +352,28 @@ procedure TBillsMeasureData.sdvBillsMeasureSetText(var Text: String;
   var
     vNode: TBillsIDTreeNode;
   begin
-    // ±ä¸üӦѡÔñ±ä¸üÁî
-    if SameText(AField , 'Qc') or SameText(AField , 'Pc') then
-      Allow := SelectAndUpdateBGL(GetBillsID, AValue.Owner, StrToFloatDef(Text, 0), AField);
-    if not Allow then Exit;
-
     if CheckStringNull(Text) or CheckNumeric(Text) then
     begin
+      Text := FloatToStr(QuantityRoundTo(StrToFloatDef(Text, 0)));
+
+      // ±ä¸üӦѡÔñ±ä¸üÁî
+      if SameText(AField , 'Qc') or SameText(AField , 'Pc') then
+        Allow := SelectAndUpdateBGL(GetBillsID, AValue.Owner, StrToFloatDef(Text, 0), AField);
+      if not Allow then Exit;
+
       AValue.Owner.ValueByName(AField + 'Flag').AsInteger := 0;
       AValue.Owner.ValueByName(AField + 'Formula').AsString := '';
-      Text := FloatToStr(QuantityRoundTo(StrToFloatDef(Text, 0)));
     end
     else
     begin
+      Text := FloatToStr(QuantityRoundTo(EvaluateExprs(Text)));
+      // ±ä¸üӦѡÔñ±ä¸üÁî
+      if SameText(AField , 'Qc') or SameText(AField , 'Pc') then
+        Allow := SelectAndUpdateBGL(GetBillsID, AValue.Owner, StrToFloatDef(Text, 0), AField);
+      if not Allow then Exit;
+
       AValue.Owner.ValueByName(AField + 'Flag').AsInteger := 1;
       AValue.Owner.ValueByName(AField + 'Formula').AsString := Text;
-      Text := FloatToStr(QuantityRoundTo(EvaluateExprs(Text)));
     end;
 
     ANode.Rec.SetIntValue(ANode.Rec.CalcType, 0);