⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uunfinance.pas

📁 适合行业为眼镜业
💻 PAS
📖 第 1 页 / 共 2 页
字号:
      dmmain.CDSexecsql.edit;
      //dmmain.CDSexecsql.FieldByName('Stock_No').AsString:=Trim(Edit2.Text);
      dmmain.CDSexecsql.FieldByName('Goods_NO').AsString:=Trim(StringGrid1.Cells[1,i]);
      dmmain.CDSexecsql.FieldByName('amount').AsString:= Trim(StringGrid1.Cells[3,i]);
      dmmain.CDSexecsql.FieldByName('Pass_NO').AsString:= Trim(StringGrid1.Cells[6,i]);
      dmmain.CDSexecsql.FieldByName('quality').AsString:=Trim(StringGrid1.Cells[2,i]);
      dmmain.CDSexecsql.FieldByName('Fade_Name').AsString:=Trim(StringGrid1.Cells[7,i]);
      dmmain.CDSexecsql.FieldByName('PRICE').AsString:=Trim(StringGrid1.Cells[4,i]);
      dmmain.CDSexecsql.FieldByName('TOTAL_MONEY').AsString:=Trim(StringGrid1.Cells[5,i]);
      dmmain.CDSexecsql.Post;
      dmmain.CDSexecsql.Next;
    end;
    try
      dmmain.CDSexecsql.ApplyUpdates(-1);
    except
      Application.MessageBox('服务器发生故障!',Pchar(Application.Title),Mb_ICONwarning);
      Exit;
    end;
  end ;
  if Public_Do_Result='03' then
  begin
    close;
  end;
end;
procedure TfmfinanceUnpos.SpeedButton3Click(Sender: TObject);
begin
  inherited;
  if dmmain.cdsprintmaster.IsEmpty then exit;
  fastrepxf:=tfastrepxf.Create(self);
  fastrepxf.filenames:='FGoods.ini';
  fastrepxf.ShowModal;
  fastrepxf.Free;
end;

procedure TfmfinanceUnpos.SpeedButton4Click(Sender: TObject);
begin
  inherited;
  if not checkDATA THEN EXIT;
  frm_Public_Don:=Tfrm_Public_Don.Create(self);
  frm_Public_Don.no:=trim(edit2.Text);
  frm_Public_Don.ShowModal;
  frm_Public_Don.FREE;
  SAVEDATA;
end;

procedure TfmfinanceUnpos.SpeedButton2Click(Sender: TObject);
var
  user,wldwname,remarks:widestring;
  flag,intof:olevariant;
  i:integer;
  totals:double;
begin
  inherited;
  if trim(Public_Do)<>'Edited' then exit;
  no:=trim(edit2.Text);
  typed:=' 财务退货单';
  user:=trim(Handle_No);
  flag:=adisp.receipted(no,typed,user,1,Handle_Part);
  if flag='3' then
  begin
    for i:=1 to stringgrid1.RowCount-1 do
    begin
      totals:=totals+strtofloat(stringgrid1.Cells[5,i]);
    end;
      /////////////////////////////////
    wldwname:=trim(edit4.Text);
    remarks:='向供货商:'+trim(edit4.Text)+'退货';
    intof:=ipubtemp.MoneyTable(7,no,totals,user,user,user,wldwno,wldwname,trim(edit5.Text),remarks);
    if vartostr(intof)='1' then
    begin
      flag:='3';
    end else
    begin
      flag:='2';
    end;
    ///////
    ipubtemp.Gether(wldwno,totals,0,1);
  end;
  if flag='1' then
  begin
    application.MessageBox('审核成功!',pchar(application.Title),mb_iconinformation);
    exit;
  end;
  if flag='2' then
  begin
    application.MessageBox('无权进行进行审核',pchar(application.Title),mb_iconinformation);
    exit;
  end;
  if flag='3' then
  begin
    application.MessageBox('审核完毕!',pchar(application.Title),mb_iconinformation);
    exit;
  end;
  if flag='4' then
  begin
    application.MessageBox('反审核完毕!',pchar(application.Title),mb_iconinformation);
    exit;
  end;
  if flag='5' then
  begin
    application.MessageBox('反审核成功!',pchar(application.Title),mb_iconinformation);
    exit;
  end;
  if flag='6' then
  begin
    application.MessageBox('单据过帐后,不能进行审核或反审核!',pchar(application.Title),mb_iconinformation);
    exit;
  end;


end;

procedure TfmfinanceUnpos.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
   dmmain.CDSexecsql.Close;
  dmmain.CDSexecsql.Data:=null;
  inherited;

end;

procedure TfmfinanceUnpos.StringGrid1DrawCell(Sender: TObject; ACol,
  ARow: Integer; Rect: TRect; State: TGridDrawState);
var
  s:string;
  r:TRect;
begin
   inherited;
  with Sender as Tstringgrid do
  begin
  if gdSelected in State then
  Canvas.Brush.Color:= clTeal; //clyellow;//clRed;
  Canvas.TextRect(Rect,Rect.Left,Rect.Top,' '+Cells[ACol,ARow]);
  if gdFocused in State then
  Canvas.DrawFocusRect(Rect);
  end;
  with Sender as Tstringgrid do
  begin
    Canvas.FillRect(Rect);
    s:=Cells[ACol,ARow];
    r:=Rect;
    DrawText(Canvas.Handle,PChar(s),Length(s),r,DT_CENTER or DT_SINGLELINE or DT_VCENTER);
  end;

end;

procedure TfmfinanceUnpos.SpeedButton5Click(Sender: TObject);
begin
  inherited;
  frmselect:=tfrmselect.Create(self);
  frmselect.flag:=3;
  frmselect.ShowModal;
  frmselect.Free;
  if trim(stockinput)<>'' then
  begin
    iFlag:=1;
    Public_Do:='Edited';
    no:=stockinput;
    ReadData (stockinput);
  end;
end;

procedure TfmfinanceUnpos.FormShow(Sender: TObject);
begin
  inherited;
  init;
  iFlag:=0;
  if (Public_Do='Edited')  then
  begin
    No:=List_no;
    speedbutton5.Enabled:=false;
  end;
  ReadData (List_No);
end;

procedure TfmfinanceUnpos.SpeedButton9Click(Sender: TObject);
begin
  inherited;
  Employe_Check:='';
  Employe_Check:='Stock_Fad_str';
  Employe_Check_Result:='';
  frm_Login_Man:=Tfrm_Login_Man.Create(self);
  frm_Login_Man.Caption:='经手人选择';
  frm_Login_Man.ShowModal;
  Edit6.Text:=Employe_Check_Result;
  frm_Login_Man.Free;
end;

procedure TfmfinanceUnpos.StringGrid1KeyPress(Sender: TObject;
  var Key: Char);
begin
  inherited;
   IF ((PCOL=4) OR (PCOL=7)) AND (PROW>0) THEN
  BEGIN
    IF (Pcol=4)  then
    begin
      if key in ['0'..'9',#8,#13,'.'] then
      begin
        stringgrid1.Options:=stringgrid1.Options+[goediting];
      end else
      begin
        key:=#0;
      end;
    end else
    begin
      stringgrid1.Options:=stringgrid1.Options+[goediting];
    end;
  END ELSE
  BEGIN
    stringgrid1.Options:=stringgrid1.Options-[goediting];
    KEY:=#0;
  END;
end;

procedure TfmfinanceUnpos.StringGrid1MouseMove(Sender: TObject;
  Shift: TShiftState; X, Y: Integer);
var
    i:integer;
begin
  inherited;
  for i:=1 to stringgrid1.RowCount-1 do
  begin
    if (trim(stringgrid1.Cells[4,i])<>'') then
    begin
      stringgrid1.Cells[5,i]:=floattostr(strtoint(stringgrid1.Cells[3,i])*strtofloat(stringgrid1.Cells[4,i]));
    end;
  end;

end;

procedure TfmfinanceUnpos.StringGrid1SelectCell(Sender: TObject; ACol,
  ARow: Integer; var CanSelect: Boolean);
begin
  inherited;
  PCOL:=ACOL;
  PROW:=AROW;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -