procedure TdmlSBWXJL_R.qryDataBeforePost(DataSet: TDataSet);
var
BookMark: TBookmark;
fYLJE, fYGJE : Extended;
begin
inherited;
fYLJE := 0;
fYGJE := 0;
BookMark := qryJXYL.GetBookmark;
qryJXYL.DisableControls;
try
qryJXYL.First;
while not qryJXYL.Eof do
begin
fYLJE := fYLJE + tvDetailJXYLSBWXYL_SL.AsFloat * tvDetailJXYLSBWXYL_JG.AsFloat;
qryJXYL.Next;
end;
finally
qryJXYL.GotoBookmark(BookMark);
qryJXYL.FreeBookmark(BookMark);
qryJXYL.EnableControls;
end;
BookMark := qryJXYG.GetBookmark;
qryJXYG.DisableControls;
try
qryJXYG.First;
while not qryJXYG.Eof do
begin
fYLJE := fYLJE + tvSBJXYGSBWXYG_GS.AsFloat * tvSBJXYGSBWXYG_JG.AsFloat;
qryJXYG.Next;
end;
finally
qryJXYG.GotoBookmark(BookMark);
qryJXYG.FreeBookmark(BookMark);
qryJXYG.EnableControls;
end;
qryDataSBWX_FY.AsFloat := fYLJE + fYGJE;
if (qryData.State in [dsInsert]) and bIsGZL then
CallBackOwnerForm(cbWFNewInst,'','');
end;