|
@@ -167,7 +167,7 @@ begin
|
|
|
with TProjectData(TPhaseData(FPhaseData).ProjectData).DealPaymentData do
|
|
|
UpdateTotalPrice(AValue.Owner.ValueByName('ID').AsInteger, AValue.AsFloat - FBeforeChangeTotalPrice);
|
|
|
end;
|
|
|
- CalculateCurPay;
|
|
|
+ CalculateCurPay;
|
|
|
end;
|
|
|
|
|
|
procedure TPhasePayData.CalculateAll;
|
|
@@ -183,8 +183,7 @@ begin
|
|
|
Rec := sddPhasePay.Records[iIndex];
|
|
|
if GetCalcType(Rec.ValueByName('ID').AsInteger) in [0, 3] then
|
|
|
Calculate(Rec.ValueByName('ID').AsInteger);
|
|
|
- end;
|
|
|
- CalculateCurPay;
|
|
|
+ end; CalculateCurPay;
|
|
|
end;
|
|
|
|
|
|
procedure TPhasePayData.Calculate(AID: Integer);
|
|
@@ -249,6 +248,8 @@ begin
|
|
|
// ¼ÆËã½ØÖ¹Êý¾Ý
|
|
|
Rec.ValueByName('End' + sTPField).AsFloat := FDecimal.TotalPrice.RoundTo(Rec.ValueByName(sTPField).AsFloat
|
|
|
+ Rec.ValueByName('Pre' + sTPField).AsFloat);
|
|
|
+ with TProjectData(TPhaseData(FPhaseData).ProjectData).DealPaymentData do
|
|
|
+ SetTotalPrice(AID, Rec.ValueByName('End' + sTPField).AsFloat);
|
|
|
end;
|
|
|
|
|
|
function TPhasePayData.GetPayablePrice(AIndex: Integer): Double;
|
|
@@ -478,11 +479,14 @@ procedure TPhasePayData.CopyPrePhasePayData(const APreFile: string;
|
|
|
const
|
|
|
sCopySql = 'Insert Into %s (' +
|
|
|
' ID, PreTotalPrice0, EndTotalPrice0, Formula0, StopCalc' +
|
|
|
- ' ) Select ID, PreTotalPrice%d, EndTotalPrice%d, Formula%d, StopCalc' +
|
|
|
+ ' ) Select ID, EndTotalPrice%d, EndTotalPrice%d, Formula%d, StopCalc' +
|
|
|
' From %s' +
|
|
|
' In ''%s''';
|
|
|
var
|
|
|
sPre, sSql: string;
|
|
|
+ i: Integer;
|
|
|
+ vRec: TsdDataRecord;
|
|
|
+ fValue: Double;
|
|
|
begin
|
|
|
try
|
|
|
sSql := Format(sCopySql, [TableName, APreFinalIndex, APreFinalIndex,
|
|
@@ -490,6 +494,12 @@ begin
|
|
|
ExecuteSql(TPhaseData(FPhaseData).ADOConnection, sSql);
|
|
|
finally
|
|
|
sddPhasePay.Reload;
|
|
|
+ for i := 0 to sddPhasePay.RecordCount - 1 do
|
|
|
+ begin
|
|
|
+ vRec := sddPhasePay.Records[i];
|
|
|
+ if TryStrToFloat(vRec.ValueByName('Formula0').AsString, fValue) then
|
|
|
+ vRec.ValueByName('Formula0').AsString := '';
|
|
|
+ end;
|
|
|
end;
|
|
|
end;
|
|
|
|