Ver código fonte

台账、计量处,各数量、金额公式显示Bug。具体有:
台账:金额添加公式,数量处双击,可见金额公式,回车后报错提示。
计量:金额添加公式,双击后,公式&值均不出现,显示为空。

MaiXinRong 9 anos atrás
pai
commit
86bf572859
2 arquivos alterados com 28 adições e 13 exclusões
  1. 26 8
      DataModules/BillsCompileDm.pas
  2. 2 5
      DataModules/BillsMeasureDm.pas

+ 26 - 8
DataModules/BillsCompileDm.pas

@@ -147,18 +147,36 @@ procedure TBillsCompileData.sdvBillsCompileGetText(var Text: String;
   ARecord: TsdDataRecord; AValue: TsdValue; AColumn: TsdViewColumn;
   DisplayText: Boolean);
 
+  function GetQtyEditText(const AFormulaField: string): Boolean;
+  begin
+
+  end;
+
   procedure GetEditText;
   var
     sFormula: string;
+    sFormulaField: string;
   begin
-    if SameText('OrgQuantity', AColumn.FieldName) then
-      sFormula := ARecord.ValueByName('OrgFormula').AsString
-    else if SameText('MisQuantity', AColumn.FieldName) then
-      sFormula := ARecord.ValueByName('MisFormula').AsString
-    else if SameText('OthQuantity', AColumn.FieldName) then
-      sFormula := ARecord.ValueByName('OthFormula').AsString
-    else
-      sFormula := '';
+    sFormula := '';
+    if ARecord.ValueByName('CalcType').AsInteger = 0 then
+    begin
+      if SameText('OrgQuantity', AColumn.FieldName) then
+        sFormula := ARecord.ValueByName('OrgFormula').AsString
+      else if SameText('MisQuantity', AColumn.FieldName) then
+        sFormula := ARecord.ValueByName('MisFormula').AsString
+      else if SameText('OthQuantity', AColumn.FieldName) then
+        sFormula := ARecord.ValueByName('OthFormula').AsString;
+    end
+    else if ARecord.ValueByName('CalcType').AsInteger = 1 then
+    begin
+      if SameText('OrgTotalPrice', AColumn.FieldName) then
+        sFormula := ARecord.ValueByName('OrgFormula').AsString
+      else if SameText('MisTotalPrice', AColumn.FieldName) then
+        sFormula := ARecord.ValueByName('MisFormula').AsString
+      else if SameText('OthTotalPrice', AColumn.FieldName) then
+        sFormula := ARecord.ValueByName('OthFormula').AsString;
+    end;
+
     if sFormula <> '' then
       Text := sFormula;
   end;

+ 2 - 5
DataModules/BillsMeasureDm.pas

@@ -180,11 +180,8 @@ procedure TBillsMeasureData.sdvBillsMeasureGetText(var Text: String;
   begin
     with AValue.Owner do
     begin
-      if ValueByName(AQtyType + 'Flag').AsInteger = 2 then
-      begin
-        FFormulaCalc.SetRecordText(ValueByName(AQtyType + 'Formula').AsString);
-        Result := FFormulaCalc.DisplayText;
-      end
+      if ValueByName(AQtyType + 'Formula').AsString <> '' then
+        Result := ValueByName(AQtyType + 'Formula').AsString
       else
         Result := Text;
     end;