|
@@ -4,7 +4,7 @@ interface
|
|
|
|
|
|
uses
|
|
|
BillsDm, BillsTree, FormulaCalc, sdIDTree, StageDm,
|
|
|
- SysUtils, Classes, sdDB, DB;
|
|
|
+ SysUtils, Classes, sdDB, DB, CalcDecimal;
|
|
|
|
|
|
type
|
|
|
TLocateZJJLEvent = procedure (ABillsID: Integer) of object;
|
|
@@ -48,6 +48,7 @@ type
|
|
|
|
|
|
function GetStageData: TStageData;
|
|
|
procedure SetOnRecChange(const Value: TRecChangeEvent);
|
|
|
+ function GetDecimal: TCalcDecimal;
|
|
|
public
|
|
|
constructor Create(AProjectData: TObject);
|
|
|
destructor Destroy; override;
|
|
@@ -56,6 +57,7 @@ type
|
|
|
procedure Close;
|
|
|
procedure ReConnectTree;
|
|
|
|
|
|
+ function CheckNodeGatherCalc(ANode: TMeasureBillsIDTreeNode): Boolean;
|
|
|
procedure CalculateAll;
|
|
|
|
|
|
procedure ResetPhaseStageLink;
|
|
@@ -81,6 +83,7 @@ type
|
|
|
property ProjectData: TObject read FProjectData;
|
|
|
property BillsData: TBillsData read FBillsData;
|
|
|
property BillsMeasureTree: TMeasureBillsIDTree read FBillsMeasureTree;
|
|
|
+ property Decimal: TCalcDecimal read GetDecimal;
|
|
|
|
|
|
property StageData: TStageData read GetStageData;
|
|
|
property ShowParentData: Boolean read FShowParentData write FShowParentData;
|
|
@@ -91,7 +94,7 @@ implementation
|
|
|
|
|
|
uses
|
|
|
ProjectData, PhaseData, Math, ZhAPI, BillsCommand, BGLSelectFrm,
|
|
|
- BGLDm, UtilMethods, mDataRecord, ConstUnit, Variants;
|
|
|
+ BGLDm, UtilMethods, mDataRecord, ConstUnit, Variants, ConditionalDefines;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
@@ -431,7 +434,7 @@ procedure TBillsMeasureData.sdvBillsMeasureSetText(var Text: String;
|
|
|
var
|
|
|
vNode: TBillsIDTreeNode;
|
|
|
begin
|
|
|
- if not Assigned(AValue) then Exit;
|
|
|
+ {if not Assigned(AValue) then Exit;
|
|
|
// 修改后数据与原数据相同则不提交
|
|
|
if not CheckValidData then
|
|
|
Allow := False;
|
|
@@ -447,7 +450,7 @@ begin
|
|
|
|
|
|
Text := Trim(Text);
|
|
|
if Pos('=', Text) = 1 then
|
|
|
- Text := Copy(Text, 2, Length(Text) - 1);
|
|
|
+ Text := Copy(Text, 2, Length(Text) - 1); }
|
|
|
|
|
|
DoCurChanged(vNode);
|
|
|
end;
|
|
@@ -1172,4 +1175,43 @@ begin
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
+function TBillsMeasureData.CheckNodeGatherCalc(
|
|
|
+ ANode: TMeasureBillsIDTreeNode): Boolean;
|
|
|
+var
|
|
|
+ fLeafSumDeal, fLeafSumQc, fLeafSumGather: Double;
|
|
|
+ i, iCount: Integer;
|
|
|
+ vChild: TMeasureBillsIDTreeNode;
|
|
|
+begin
|
|
|
+ if Assigned(ANode.StageRec) then
|
|
|
+ begin
|
|
|
+ fLeafSumDeal := 0;
|
|
|
+ fLeafSumQc := 0;
|
|
|
+ fLeafSumGather := 0;
|
|
|
+ iCount := ANode.PosterityCount;
|
|
|
+ i := 0;
|
|
|
+ vChild := TMeasureBillsIDTreeNode(ANode.NextNode);
|
|
|
+ while i < iCount do
|
|
|
+ begin
|
|
|
+ if not vChild.HasChildren and Assigned(vChild.StageRec) then
|
|
|
+ begin
|
|
|
+ fLeafSumDeal := fLeafSumDeal + vChild.StageRec.DealTotalPrice.AsFloat;
|
|
|
+ fLeafSumQc := fLeafSumQc + vChild.StageRec.QcTotalPrice.AsFloat;
|
|
|
+ fLeafSumGather := fLeafSumGather + vChild.StageRec.GatherTotalPrice.AsFloat;
|
|
|
+ end;
|
|
|
+ vChild := TMeasureBillsIDTreeNode(vChild.NextNode);
|
|
|
+ Inc(i);
|
|
|
+ end;
|
|
|
+ Result := Decimal.TotalPrice.CheckSameNum(fLeafSumDeal, ANode.StageRec.DealTotalPrice.AsFloat) and
|
|
|
+ Decimal.TotalPrice.CheckSameNum(fLeafSumQc, ANode.StageRec.QcTotalPrice.AsFloat) and
|
|
|
+ Decimal.TotalPrice.CheckSameNum(fLeafSumGather, ANode.StageRec.GatherTotalPrice.AsFloat);
|
|
|
+ end
|
|
|
+ else
|
|
|
+ Result := True;
|
|
|
+end;
|
|
|
+
|
|
|
+function TBillsMeasureData.GetDecimal: TCalcDecimal;
|
|
|
+begin
|
|
|
+ Result := TProjectData(FProjectData).ProjProperties.DecimalManager.Common;
|
|
|
+end;
|
|
|
+
|
|
|
end.
|