Browse Source

项目管理,本期应付,界面显示小数位数,应根据“合同支付是否单独设置”来识别

MaiXinRong 7 years ago
parent
commit
c45de07917
2 changed files with 13 additions and 2 deletions
  1. 11 0
      Units/CalcDecimal.pas
  2. 2 2
      Units/ProjectData.pas

+ 11 - 0
Units/CalcDecimal.pas

@@ -17,6 +17,7 @@ type
 
 
     function GetDisplayFormat(ADigit: Integer): string;
     function GetDisplayFormat(ADigit: Integer): string;
     procedure SetRelaDecimal(const Value: TDecimal);
     procedure SetRelaDecimal(const Value: TDecimal);
+    function GetTrueDigit: Integer;
   public
   public
     constructor Create;
     constructor Create;
     destructor Destroy; override;
     destructor Destroy; override;
@@ -34,6 +35,8 @@ type
     property Format: string read FFormat;
     property Format: string read FFormat;
     property CompareValue: Double read FCompareValue;
     property CompareValue: Double read FCompareValue;
 
 
+    property TrueDigit: Integer read GetTrueDigit;
+
     property RelaDecimal: TDecimal read FRelaDecimal write SetRelaDecimal;
     property RelaDecimal: TDecimal read FRelaDecimal write SetRelaDecimal;
   end;
   end;
 
 
@@ -128,6 +131,14 @@ begin
   end;
   end;
 end;
 end;
 
 
+function TDecimal.GetTrueDigit: Integer;
+begin
+  if Assigned(FRelaDecimal) then
+    Result := FRelaDecimal.TrueDigit
+  else
+    Result := FDigit;
+end;
+
 procedure TDecimal.RefreshLinkViewColsFormat;
 procedure TDecimal.RefreshLinkViewColsFormat;
 var
 var
   i: Integer;
   i: Integer;

+ 2 - 2
Units/ProjectData.pas

@@ -539,8 +539,8 @@ begin
   InfoRec.ValueByName('PhasePay').AsFloat := PhaseRec.ValueByName('PhasePay').AsFloat;
   InfoRec.ValueByName('PhasePay').AsFloat := PhaseRec.ValueByName('PhasePay').AsFloat;
   InfoRec.ValueByName('PhaseCount').AsInteger := FProjProperties.PhaseCount;
   InfoRec.ValueByName('PhaseCount').AsInteger := FProjProperties.PhaseCount;
   InfoRec.ValueByName('AuditStatus').AsInteger := FProjProperties.AuditStatus;
   InfoRec.ValueByName('AuditStatus').AsInteger := FProjProperties.AuditStatus;
-  InfoRec.ValueByName('CommonDigit').AsInteger := FProjProperties.DecimalManager.Common.TotalPrice.Digit;
-  InfoRec.ValueByName('DealPayDigit').AsInteger := FProjProperties.DecimalManager.DealPay.TotalPrice.Digit;
+  InfoRec.ValueByName('CommonDigit').AsInteger := FProjProperties.DecimalManager.Common.TotalPrice.TrueDigit;
+  InfoRec.ValueByName('DealPayDigit').AsInteger := FProjProperties.DecimalManager.DealPay.TotalPrice.TrueDigit;
   ProjectManager.CalculateParentInfo(InfoRec.ValueByName('ParentID').AsInteger);
   ProjectManager.CalculateParentInfo(InfoRec.ValueByName('ParentID').AsInteger);
   ProjectManager.Save;
   ProjectManager.Save;
 end;
 end;