|
@@ -24,6 +24,7 @@ type
|
|
actnDealPayment: TActionList;
|
|
actnDealPayment: TActionList;
|
|
actnCalculatePhasePay: TAction;
|
|
actnCalculatePhasePay: TAction;
|
|
actnSetDealPayPlan: TAction;
|
|
actnSetDealPayPlan: TAction;
|
|
|
|
+ actnCanCalc: TAction;
|
|
procedure zgParameterCellCanEdit(Sender: TObject; const ACoord: TPoint;
|
|
procedure zgParameterCellCanEdit(Sender: TObject; const ACoord: TPoint;
|
|
var Allow: Boolean);
|
|
var Allow: Boolean);
|
|
procedure imgHelpClick(Sender: TObject);
|
|
procedure imgHelpClick(Sender: TObject);
|
|
@@ -46,6 +47,8 @@ type
|
|
procedure zgDealPaymentShowHint(var HintStr: String;
|
|
procedure zgDealPaymentShowHint(var HintStr: String;
|
|
var CanShow: Boolean; var HintInfo: THintInfo; const ACoord: TPoint);
|
|
var CanShow: Boolean; var HintInfo: THintInfo; const ACoord: TPoint);
|
|
procedure actnSetDealPayPlanUpdate(Sender: TObject);
|
|
procedure actnSetDealPayPlanUpdate(Sender: TObject);
|
|
|
|
+ procedure actnCanCalcExecute(Sender: TObject);
|
|
|
|
+ procedure actnCanCalcUpdate(Sender: TObject);
|
|
private
|
|
private
|
|
FDealPaymentData: TDealPaymentData;
|
|
FDealPaymentData: TDealPaymentData;
|
|
|
|
|
|
@@ -69,7 +72,8 @@ type
|
|
implementation
|
|
implementation
|
|
|
|
|
|
uses
|
|
uses
|
|
- MainFrm, UtilMethods, ProjectData, PhaseData, DealPayPlanFrm;
|
|
|
|
|
|
+ MainFrm, UtilMethods, ProjectData, PhaseData, DealPayPlanFrm, PhasePayDm,
|
|
|
|
+ Math;
|
|
|
|
|
|
{$R *.dfm}
|
|
{$R *.dfm}
|
|
|
|
|
|
@@ -159,6 +163,7 @@ procedure TDealPaymentFrame.dxpmDealPaymentPopup(Sender: TObject);
|
|
begin
|
|
begin
|
|
SetDxBtnAction(actnCalculatePhasePay, MainForm.dxbtnCalculatePhasePay);
|
|
SetDxBtnAction(actnCalculatePhasePay, MainForm.dxbtnCalculatePhasePay);
|
|
SetDxBtnAction(actnSetDealPayPlan, MainForm.dxbtnSetDealPayPlan);
|
|
SetDxBtnAction(actnSetDealPayPlan, MainForm.dxbtnSetDealPayPlan);
|
|
|
|
+ SetDxBtnAction(actnCanCalc, MainForm.dxbtnCanCalc);
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TDealPaymentFrame.actnCalculatePhasePayExecute(Sender: TObject);
|
|
procedure TDealPaymentFrame.actnCalculatePhasePayExecute(Sender: TObject);
|
|
@@ -174,7 +179,7 @@ end;
|
|
procedure TDealPaymentFrame.zgDealPaymentCellGetColor(Sender: TObject;
|
|
procedure TDealPaymentFrame.zgDealPaymentCellGetColor(Sender: TObject;
|
|
ACoord: TPoint; var AColor: TColor);
|
|
ACoord: TPoint; var AColor: TColor);
|
|
var
|
|
var
|
|
- Rec: TsdDataRecord;
|
|
|
|
|
|
+ Rec, PhaseRec: TsdDataRecord;
|
|
iCurPhase: Integer;
|
|
iCurPhase: Integer;
|
|
begin
|
|
begin
|
|
if (ACoord.Y > zgDealPayment.FixedRowCount - 1) and
|
|
if (ACoord.Y > zgDealPayment.FixedRowCount - 1) and
|
|
@@ -196,6 +201,14 @@ begin
|
|
// µ±ÆÚÐÂÔöÏî
|
|
// µ±ÆÚÐÂÔöÏî
|
|
else if Rec.ValueByName('CreatePhaseID').AsInteger = iCurPhase then
|
|
else if Rec.ValueByName('CreatePhaseID').AsInteger = iCurPhase then
|
|
AColor := clInfoBk;
|
|
AColor := clInfoBk;
|
|
|
|
+
|
|
|
|
+ with TProjectData(FDealPaymentData.ProjectData) do
|
|
|
|
+ if PhaseData.Active then
|
|
|
|
+ begin
|
|
|
|
+ PhaseRec := PhaseData.PhasePayData.PayRecord(Rec.ValueByName('ID').AsInteger);
|
|
|
|
+ if Assigned(PhaseRec) and PhaseRec.ValueByName('StopCalc').AsBoolean then
|
|
|
|
+ AColor := clSilver;
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -378,4 +391,42 @@ begin
|
|
TAction(Sender).Enabled := Assigned(sdDealPayment.DataView.Current);
|
|
TAction(Sender).Enabled := Assigned(sdDealPayment.DataView.Current);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TDealPaymentFrame.actnCanCalcExecute(Sender: TObject);
|
|
|
|
+var
|
|
|
|
+ Rec, PhaseRec: TsdDataRecord;
|
|
|
|
+begin
|
|
|
|
+ Rec := sdDealPayment.DataView.Current;
|
|
|
|
+ with TProjectData(FDealPaymentData.ProjectData).PhaseData.PhasePayData do
|
|
|
|
+ PhaseRec := PayRecord(Rec.ValueByName('ID').AsInteger);
|
|
|
|
+ PhaseRec.ValueByName('StopCalc').AsBoolean := not PhaseRec.ValueByName('StopCalc').AsBoolean;
|
|
|
|
+
|
|
|
|
+ TProjectData(FDealPaymentData.ProjectData).PhaseData.PhasePayData.CalculateAll;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+procedure TDealPaymentFrame.actnCanCalcUpdate(Sender: TObject);
|
|
|
|
+var
|
|
|
|
+ Rec, PhaseRec: TsdDataRecord;
|
|
|
|
+begin
|
|
|
|
+ Rec := sdDealPayment.DataView.Current;
|
|
|
|
+ if not Assigned(Rec) or Rec.ValueByName('PreDefined').AsBoolean then
|
|
|
|
+ begin
|
|
|
|
+ TAction(Sender).Visible := False;
|
|
|
|
+ Exit;
|
|
|
|
+ end;
|
|
|
|
+ TAction(Sender).Visible := TProjectData(FDealPaymentData.ProjectData).ValidStageIsRefer;
|
|
|
|
+
|
|
|
|
+ with TProjectData(FDealPaymentData.ProjectData) do
|
|
|
|
+ if PhaseData.Active then
|
|
|
|
+ PhaseRec := PhaseData.PhasePayData.PayRecord(Rec.ValueByName('ID').AsInteger)
|
|
|
|
+ else
|
|
|
|
+ PhaseRec := nil;
|
|
|
|
+ if Assigned(PhaseRec) then
|
|
|
|
+ begin
|
|
|
|
+ if PhaseRec.ValueByName('StopCalc').AsBoolean then
|
|
|
|
+ TAction(Sender).Caption := 'ÆôÓÃ'
|
|
|
|
+ else
|
|
|
|
+ TAction(Sender).Caption := 'Í£ÓÃ';
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
end.
|
|
end.
|