|
@@ -3,7 +3,7 @@ unit ProjectGLDm;
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
- SysUtils, Classes, sdDB, sdProvider, ADODB, mDataRecord;
|
|
|
+ SysUtils, Classes, sdDB, sdProvider, ADODB, mDataRecord, CalcDecimal;
|
|
|
|
|
|
type
|
|
|
TProjectGLData = class(TDataModule)
|
|
@@ -49,6 +49,7 @@ type
|
|
|
function GetValidDeltaPrice(AID: Integer): Double;
|
|
|
function GetPM_TotalPrice: Double;
|
|
|
function GetActive: Boolean;
|
|
|
+ function GetDecimal: TCalcDecimal;
|
|
|
public
|
|
|
constructor Create(AProjectData: TObject);
|
|
|
destructor Destroy; override;
|
|
@@ -68,14 +69,14 @@ type
|
|
|
|
|
|
property ValidDeltaPrice[AID: Integer]: Double read GetValidDeltaPrice;
|
|
|
property PM_TotalPrice: Double read GetPM_TotalPrice;
|
|
|
+ property Decimal: TCalcDecimal read GetDecimal;
|
|
|
end;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses
|
|
|
ProjectData, UtilMethods, DB, Variants, PhaseData, DetailGLDm,
|
|
|
- BillsMeasureDm, BillsTree, sdIDTree, PhasePayDm, DateUtils, ZhAPI,
|
|
|
- CalcDecimal;
|
|
|
+ BillsMeasureDm, BillsTree, sdIDTree, PhasePayDm, DateUtils, ZhAPI;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
@@ -269,13 +270,10 @@ begin
|
|
|
else
|
|
|
ValidDeltaC := 0;
|
|
|
|
|
|
- with TProjectData(FProjectData).ProjProperties.DecimalManager do
|
|
|
- begin
|
|
|
- if DeltaC <> ARec.DeltaPrice.AsFloat then
|
|
|
- ARec.DeltaPrice.AsFloat := PriceMargin.Price.RoundTo(DeltaC);
|
|
|
- if ValidDeltaC <> ARec.ValidDeltaPrice.AsFloat then
|
|
|
- ARec.ValidDeltaPrice.AsFloat := PriceMargin.Price.RoundTo(ValidDeltaC);
|
|
|
- end;
|
|
|
+ if DeltaC <> ARec.DeltaPrice.AsFloat then
|
|
|
+ ARec.DeltaPrice.AsFloat := Decimal.Price.RoundTo(DeltaC);
|
|
|
+ if ValidDeltaC <> ARec.ValidDeltaPrice.AsFloat then
|
|
|
+ ARec.ValidDeltaPrice.AsFloat := Decimal.Price.RoundTo(ValidDeltaC);
|
|
|
end;
|
|
|
|
|
|
procedure TProjectGLData.sdvProjectGLGetText(var Text: String;
|
|
@@ -289,7 +287,9 @@ procedure TProjectGLData.sdvProjectGLGetText(var Text: String;
|
|
|
SameText('RiskRange', AColumn.FieldName)) then
|
|
|
begin
|
|
|
if AValue.AsFloat = 0 then
|
|
|
- Text := '';
|
|
|
+ Text := ''
|
|
|
+ else
|
|
|
+ Text := FormatFloat('0.###', Decimal.Price.RoundTo(AValue.AsFloat));
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -580,4 +580,9 @@ begin
|
|
|
ErrorMessage('工料已被应用,不可删除。');
|
|
|
end;
|
|
|
|
|
|
+function TProjectGLData.GetDecimal: TCalcDecimal;
|
|
|
+begin
|
|
|
+ Result := TProjectData(FProjectData).ProjProperties.DecimalManager.PriceMargin;
|
|
|
+end;
|
|
|
+
|
|
|
end.
|