瀏覽代碼

计量台账,公式问题

MaiXinRong 5 年之前
父節點
當前提交
6887927488
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      DataModules/BillsMeasureDm.pas

+ 4 - 2
DataModules/BillsMeasureDm.pas

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