|
@@ -183,7 +183,8 @@ 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);
|
|
@@ -477,6 +478,19 @@ end;
|
|
|
|
|
|
procedure TPhasePayData.CopyPrePhasePayData(const APreFile: string;
|
|
|
APreFinalIndex: Integer);
|
|
|
+
|
|
|
+ function CheckFormulaWithBase(AFormula: string): Boolean;
|
|
|
+ var
|
|
|
+ sFormula: string;
|
|
|
+ begin
|
|
|
+ sFormula := StringReplace(AFormula, 'htj', '', [rfReplaceAll, rfIgnoreCase]);
|
|
|
+ sFormula := StringReplace(sFormula, 'kgyfk', '', [rfReplaceAll, rfIgnoreCase]);
|
|
|
+ sFormula := StringReplace(sFormula, 'clyfk', '', [rfReplaceAll, rfIgnoreCase]);
|
|
|
+ sFormula := StringReplace(sFormula, 'ybbqwc', '', [rfReplaceAll, rfIgnoreCase]);
|
|
|
+ sFormula := StringReplace(sFormula, 'bqwc', '', [rfReplaceAll, rfIgnoreCase]);
|
|
|
+ Result := Length(sFormula) < Length(AFormula);
|
|
|
+ end;
|
|
|
+
|
|
|
const
|
|
|
sCopySql = 'Insert Into %s (' +
|
|
|
' ID, PreTotalPrice0, EndTotalPrice0, Formula0, StopCalc' +
|
|
@@ -498,7 +512,7 @@ begin
|
|
|
for i := 0 to sddPhasePay.RecordCount - 1 do
|
|
|
begin
|
|
|
vRec := sddPhasePay.Records[i];
|
|
|
- if TryStrToFloat(vRec.ValueByName('Formula0').AsString, fValue) then
|
|
|
+ if not CheckFormulaWithBase(vRec.ValueByName('Formula0').AsString) and GetCalcType(Rec.ValueByName('ID').AsInteger) = 2 then
|
|
|
vRec.ValueByName('Formula0').AsString := '';
|
|
|
end;
|
|
|
end;
|