总论

1. //修改发票主表 update Out_Invoice set JieZhangDH=:JieZhangDH where DanJuID=:DanJuID';

2.//生成操作员结帐单
      Sql.Add(' insert into Out_SettlTab (SerialNo,JieZhangDH,JieZhangLB,JieZhangRQ,');

3.//获得已结帐信息 由选择结帐的条数时引发 如/单条记录左转procedure TOutSettlProcForm.spbt3Click(Sender: TObject);

同时进行下面运算:

    1. 进行计算  function TOutSettlProcForm.CalcAmount: String; (添加了计算挂号费)

    2. 追加结帐明细  procedure TOutSettlProcForm.AppendSettlDetail;

按结帐 按钮时进行以下运算

   1. //修改发票主表 update Out_Invoice set JieZhangDH=:JieZhangDH where DanJuID=:DanJuID

  //修改挂号表结算字段 function TOutSettlProcForm.UpTblGh: string;

    2.  //保存结帐流号表
       Sql.add(' update Sys_SettlNo set JieZhangLH=JieZhangLH+1 where RenYuanBM=:RenYuanBM and JieZhangLX=1');
     3. //生成操作员结帐单

         Sql.Add(' insert into Out_SettlTab (SerialNo,JieZhangDH,JieZhangLB,JieZhangRQ,');

添加function TOutSettlProcForm.SaveGh: string;

     4. QrySettlDetail.ApplyUpdates;保存 结帐明细

在function TOutSettlProcForm.SettlProc: String; 开头加入

   Result:=UpTblGh;
  if Result<>'' then exit;
    Result:=SaveGh;
  if Result<>'' then exit;

function TOutSettlProcForm.UpTblGh: string;   //修改挂号表结算字段
begin
  with UserDM.QryFree do
    begin
      Close;
      Sql.Clear;
      sql.Add ('update tblmzgh set JieZhangDH=:JieZhangDH  ') ;
      sql.Add (' where JieZhangDH is null and jieSuanBz=1 and ghry=:ghry' );
      sql.add(' and CONVERT(varchar(10), serialNo, 120)=:temp');
      ParamByName('ghry').AsString:=SysDM.GetUserID;
     ParamByName('temp').AsString:=FormatDateTime('yyyy-mm-dd',dtp.date) ;
     ParamByName('JieZhangDH').AsString:=lbJzdh.caption;
     try
     Execsql;
     result:='';
     except
     result:='修改挂号表结算字段出错!';
     end;
    end;
end;

function TOutSettlProcForm.SaveGh: string;  //保存挂号结算信息
begin
     with UserDM.QryFree do
    begin
      Close;
      Sql.Clear;

      //生成挂号结帐单
      Sql.Add(' insert into Out_SettlTabGh (SerialNo,JieZhangDH,JieZhangRQ,GhRs,Ghf,Ylkf,JieZhangCZ');

      Sql.Add(' Values(:SerialNo,:JieZhangDH,:JieZhangRQ,:GhRs,:Ghf,:Ylkf,:JieZhangCZ');

      ParamByName('SerialNo').AsString:=FormatDateTime('yyyy-mm-dd hh:mm:ss.zzz',now);
      ParamByName('JieZhangDH').AsString:=lbJzdh.Caption;

      ParamByName('JieZhangRQ').AsString:=FormatDateTime('yyyy-mm-dd',date);
      ParamByName('GhRs').asinteger:=strtoint(pangh.Caption);;
      ParamByName('Ghf').AsFloat:=StrToFloat(panGhf.Caption);
      ParamByName('Ylkf').AsFloat:=StrToFloat(panYlkf.Caption);
      ParamByName('JieZhangCZ').AsString:=SysDM.GetUserID;
     try
     Execsql;
     result:='';
     except
     result:='保存挂号表结算字段出错!';
     end;
    end;
end;

posted on 2009-09-07 23:37  舟山牙医  阅读(293)  评论(0编辑  收藏  举报

导航