salary.pas

来自「pasa人力资源考勤管理系统」· PAS 代码 · 共 1,163 行 · 第 1/3 页

PAS
1,163
字号
    BCDField14: TBCDField;
    BCDField15: TBCDField;
    BCDField16: TBCDField;
    BCDField17: TBCDField;
    BCDField18: TBCDField;
    BCDField19: TBCDField;
    BCDField20: TBCDField;
    BCDField21: TBCDField;
    BCDField22: TBCDField;
    BCDField23: TBCDField;
    BCDField24: TBCDField;
    BCDField25: TBCDField;
    BCDField26: TBCDField;
    BCDField27: TBCDField;
    BCDField28: TBCDField;
    IntegerField1: TIntegerField;
    BCDField29: TBCDField;
    BCDField30: TBCDField;
    BCDField31: TBCDField;
    BCDField32: TBCDField;
    BCDField33: TBCDField;
    ADODataSet5decrease2: TBCDField;
    ppLabel257: TppLabel;
    ppGroup1: TppGroup;
    ppGroupHeaderBand1: TppGroupHeaderBand;
    ppGroupFooterBand1: TppGroupFooterBand;
    ppLabel316: TppLabel;
    ppLine134: TppLine;
    ppLabel243: TppLabel;
    ppLine135: TppLine;
    ppLabel244: TppLabel;
    ppLine136: TppLine;
    ppLabel245: TppLabel;
    ppLine137: TppLine;
    ppLabel246: TppLabel;
    ppLine138: TppLine;
    ppLabel247: TppLabel;
    ppLine139: TppLine;
    ppLabel248: TppLabel;
    ppLine126: TppLine;
    ppLine121: TppLine;
    ppLabel234: TppLabel;
    ppLine122: TppLine;
    ppLabel235: TppLabel;
    ppLine123: TppLine;
    ppLabel236: TppLabel;
    ppLine124: TppLine;
    ppLabel237: TppLabel;
    ppLine127: TppLine;
    ppLabel239: TppLabel;
    ppLine131: TppLine;
    ppLine132: TppLine;
    ppLabel241: TppLabel;
    ppLine24: TppLine;
    ppLine25: TppLine;
    ppLabel138: TppLabel;
    ppLine129: TppLine;
    ppLine125: TppLine;
    ppLabel238: TppLabel;
    ppLabel240: TppLabel;
    ppLine133: TppLine;
    ppLabel242: TppLabel;
    ppLabel142: TppLabel;
    ppLabel143: TppLabel;
    ppLine30: TppLine;
    ppLine32: TppLine;
    ppLine120: TppLine;
    ppLabel139: TppLabel;
    ppLabel140: TppLabel;
    ppLine130: TppLine;
    ppLabel173: TppLabel;
    ppLabel214: TppLabel;
    ppLabel215: TppLabel;
    ppLabel216: TppLabel;
    ppLabel217: TppLabel;
    ppLabel218: TppLabel;
    ppLabel219: TppLabel;
    ppLabel220: TppLabel;
    ppLabel222: TppLabel;
    ppLabel223: TppLabel;
    ppLabel224: TppLabel;
    ppLabel225: TppLabel;
    ppLine146: TppLine;
    ppLabel174: TppLabel;
    ppLine142: TppLine;
    ppLine141: TppLine;
    ppLabel250: TppLabel;
    ppLabel249: TppLabel;
    ppLine140: TppLine;
    ppLine27: TppLine;
    ppLabel141: TppLabel;
    ppLabel221: TppLabel;
    ppLine144: TppLine;
    ppLabel258: TppLabel;
    ppDBText201: TppDBText;
    ppLabel259: TppLabel;
    ppDBCalc1: TppDBCalc;
    ppDBCalc2: TppDBCalc;
    ppLabel260: TppLabel;
    ppLabel261: TppLabel;
    ppDBCalc3: TppDBCalc;
    ppLabel262: TppLabel;
    ppGroup2: TppGroup;
    ppGroupHeaderBand2: TppGroupHeaderBand;
    ppGroupFooterBand2: TppGroupFooterBand;
    ppLabel263: TppLabel;
    ppDBText202: TppDBText;
    ppLabel264: TppLabel;
    ppLabel265: TppLabel;
    ppDBCalc4: TppDBCalc;
    ppLabel266: TppLabel;
    ppDBCalc5: TppDBCalc;
    ppLabel267: TppLabel;
    ppDBCalc6: TppDBCalc;
    ADODataSet5deptname: TStringField;
    ADODataSet4deptname: TStringField;
    Button3: TButton;
    procedure RadioGroup1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure ppReport1PreviewFormCreate(Sender: TObject);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure ppReport3PreviewFormCreate(Sender: TObject);
    procedure ppReport3BeforePrint(Sender: TObject);
    procedure ppReport8PreviewFormCreate(Sender: TObject);
    procedure Edit2Exit(Sender: TObject);
    procedure ppReport8BeforePrint(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure ppReport4PreviewFormCreate(Sender: TObject);
    procedure ppReport5PreviewFormCreate(Sender: TObject);
    procedure ppReport5BeforePrint(Sender: TObject);
    procedure ppReport4BeforePrint(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  salaryreport: Tsalaryreport;

implementation
uses main,datamol, print;
{$R *.DFM}

procedure Tsalaryreport.RadioGroup1Click(Sender: TObject);
var
qry:tadoquery;
begin
     case radiogroup1.ItemIndex of
       0:
         begin
           combobox1.visible:=false;
           edit2.visible:=false;
           edit3.visible:=false;
           statictext1.Visible:=false;
         end;
       1:
       begin
         combobox1.visible:=true;
         combobox1.SetFocus;
         edit2.Visible:=false;
         edit3.visible:=false;
         qry:=tadoquery.Create(self);
         qry.Connection:=datamod.Database1;
         qry.SQL.Text:='select * from pub05010 order by dno';
         qry.Open;
         statictext1.Visible:=false;
      while not qry.Eof do
        begin
          combobox1.Items.Add(qry.fieldbyname('dept').asstring);
          qry.Next;
        end;
          qry.Close;
        combobox1.text:=combobox1.items[0];
       end;
       2:
         begin
           edit2.Visible:=true;
           edit2.SetFocus;
           edit3.visible:=true;
           combobox1.Visible:=false;
           statictext1.Visible:=true;
         end;
     end;
 end;
procedure Tsalaryreport.Button2Click(Sender: TObject);
begin
  close;
end;

procedure Tsalaryreport.ppReport1PreviewFormCreate(Sender: TObject);
begin
  tppReport(Sender).PreviewForm.WindowState:=wsMaximized
end;

procedure Tsalaryreport.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if key=#13 then
   begin
      key:=#0;
      selectnext(activecontrol,true,true);
   end;
end;
procedure Tsalaryreport.FormCreate(Sender: TObject);
begin
  edit1.Text:=copy(datetostr(date),1,7);
end;
procedure Tsalaryreport.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  salaryreport:=nil;
  action:=cafree;
end;
procedure Tsalaryreport.ppReport3PreviewFormCreate(Sender: TObject);
begin
  //tppReport(Sender).PreviewForm.WindowState:=wsMaximized
  tppreport(sender).previewform.windowstate:=wsmaximized
end;
procedure Tsalaryreport.ppReport3BeforePrint(Sender: TObject);
var aqy:tadoquery;
begin
pplabel135.caption:=edit1.text;
pplabel137.caption:=companyname1;
aqy:=tadoquery.create(application);
aqy.connection:=datamod.database1;
aqy.close;
aqy.SQL.Add('select * from salnoname');
aqy.open;
pplabel83.caption:=aqy.fieldbyname('noname1').asstring;
pplabel85.caption:=aqy.fieldbyname('noname2').asstring;
pplabel94.caption:=aqy.fieldbyname('noname3').asstring;
pplabel95.caption:=aqy.fieldbyname('noname4').asstring;
pplabel99.caption:=aqy.fieldbyname('noname5').asstring;
pplabel100.caption:=aqy.fieldbyname('noname6').asstring;
pplabel101.caption:=aqy.fieldbyname('noname7').asstring;
pplabel102.caption:=aqy.fieldbyname('noname8').asstring;
pplabel103.caption:=aqy.fieldbyname('noname9').asstring;
pplabel104.caption:=aqy.fieldbyname('noname10').asstring;
pplabel105.caption:=aqy.fieldbyname('noname11').asstring;
end;

procedure Tsalaryreport.ppReport8PreviewFormCreate(Sender: TObject);
begin
 tppReport(Sender).PreviewForm.WindowState:=wsMaximized ;
end;

procedure Tsalaryreport.Edit2Exit(Sender: TObject);
begin
  edit3.Text:=edit2.Text;
end;

procedure Tsalaryreport.ppReport8BeforePrint(Sender: TObject);
begin
  pplabel353.caption:=pubworkname;
  pplabel315.Caption:= companyname1;
  pplabel316.Caption:='日/月薪员工'+ Edit1.Text+'月薪资';

end;

procedure Tsalaryreport.Button3Click(Sender: TObject);
begin
formmain.form:='salaryreport';
case radiogroup3.ItemIndex of
0:
begin
      formmain.labe:='日/月薪员工'+edit1.Text+'月薪资总表';
      if (trim(edit1.Text) <>'/')  then
      begin
        if (radiogroup1.itemindex=0)and (radiogroup2.ItemIndex=0) then
        begin
          formmain.sql:=' a.monthy='''+edit1.text+'''  and b.leave<>1  and b.mankind<>''计件''';
        end
        else if (radiogroup1.itemindex=1)and (radiogroup2.ItemIndex=0) then
        begin
          formmain.sql:=' a.deptname='''+combobox1.text+''' and a.monthy='''+edit1.text+''' and b.leave<>1 and b.mankind<>''计件''';
        end
        else if (radiogroup1.itemindex=2)and (radiogroup2.ItemIndex=0) then
        begin
          formmain.sql:=' a.workno between '''+edit2.text+''' and '''+edit3.text+''' and a.monthy='''+edit1.text+''' and b.leave<>1 and b.mankind<>''计件''';
         end
         else if (radiogroup1.itemindex=0)and (radiogroup2.ItemIndex=1) then
         begin
          formmain.sql:=' a.monthy='''+edit1.text+'''  and b.leave=1  and b.leaveworkmoney=0 and b.mankind<>''计件''';
          end
          else if (radiogroup1.itemindex=1)and (radiogroup2.ItemIndex=1) then
          begin
            formmain.sql:=' a.deptname='''+combobox1.text+''' and a.monthy='''+edit1.text+''' and b.leave=1 and b.leaveworkmoney=0  and b.mankind<>''计件''';
          end
          else if (radiogroup1.itemindex=2)and (radiogroup2.ItemIndex=1) then
          begin
            formmain.sql:=' a.workno between '''+edit2.text+''' and '''+edit3.text+''' and a.monthy='''+edit1.text+''' and b.leave=1  and b.leaveworkmoney=0  and b.mankind<>''计件''';
          end
          ////////////
             else if (radiogroup1.itemindex=0)and (radiogroup2.ItemIndex=2) then
         begin
           formmain.sql:=' a.monthy='''+edit1.text+'''  and b.leave=1  and b.leaveworkmoney=1 and b.mankind<>''计件''';
          end
          else if (radiogroup1.itemindex=1)and (radiogroup2.ItemIndex=2) then
          begin
            formmain.sql:=' a.deptname='''+combobox1.text+''' and a.monthy='''+edit1.text+''' and b.leave=1 and b.leaveworkmoney=1 and b.mankind<>''计件''';
          end
          else if (radiogroup1.itemindex=2)and (radiogroup2.ItemIndex=2) then
          begin
            formmain.sql:=' a.workno between '''+edit2.text+''' and '''+edit3.text+''' and a.monthy='''+edit1.text+''' and b.leave=1  and b.leaveworkmoney=1 and b.mankind<>''计件''';
          end;
          end;
 end;
1:
begin
      formmain.labe:='计件员工'+edit1.Text+'月薪资总表';
      if (trim(edit1.Text) <>'/')  then
      begin
        if (radiogroup1.itemindex=0)and (radiogroup2.ItemIndex=0) then
        begin
          formmain.sql:=' a.monthy='''+edit1.text+'''  and b.leave<>1 and b.mankind=''计件''';
        end
        else if (radiogroup1.itemindex=1)and (radiogroup2.ItemIndex=0) then
        begin
          formmain.sql:=' a.deptname='''+combobox1.text+''' and a.monthy='''+edit1.text+''' and b.leave<>1 and b.mankind=''计件''';
        end
        else if (radiogroup1.itemindex=2)and (radiogroup2.ItemIndex=0) then
        begin
          formmain.sql:=' a.workno between '''+edit2.text+''' and '''+edit3.text+''' and a.monthy='''+edit1.text+''' and b.leave<>1 and b.mankind=''计件''';
         end
         else if (radiogroup1.itemindex=0)and (radiogroup2.ItemIndex=1) then
         begin
           formmain.sql:=' a.monthy='''+edit1.text+'''  and b.leave=1  and b.leaveworkmoney=0  and b.mankind=''计件''';
          end
          else if (radiogroup1.itemindex=1)and (radiogroup2.ItemIndex=1) then
          begin
            formmain.sql:=' a.deptname='''+combobox1.text+''' and a.monthy='''+edit1.text+''' and b.leave=1 and b.leaveworkmoney=0  and b.mankind=''计件''';
          end
          else if (radiogroup1.itemindex=2)and (radiogroup2.ItemIndex=1) then
          begin
            formmain.sql:=' a.workno between '''+edit2.text+''' and '''+edit3.text+''' and a.monthy='''+edit1.text+''' and b.leave=1  and b.leaveworkmoney=0  and b.mankind=''计件''';
          end
          ////////////
             else if (radiogroup1.itemindex=0)and (radiogroup2.ItemIndex=2) then
         begin
           formmain.sql:=' a.monthy='''+edit1.text+'''  and b.leave=1  and b.leaveworkmoney=1  and b.mankind=''计件''';
          end
          else if (radiogroup1.itemindex=1)and (radiogroup2.ItemIndex=2) then
          begin
            formmain.sql:=' a.deptname='''+combobox1.text+''' and a.monthy='''+edit1.text+''' and b.leave=1 and b.leaveworkmoney=1 and b.mankind=''计件''';
          end
          else if (radiogroup1.itemindex=2)and (radiogroup2.ItemIndex=2) then
          begin
            formmain.sql:=' a.workno between '''+edit2.text+''' and '''+edit3.text+''' and a.monthy='''+edit1.text+''' and b.leave=1  and b.leaveworkmoney=1 and b.mankind=''计件''';
          end;
          end;
end;
end;
 if not assigned(formprint) then
  formprint:=tformprint.create(self);
 formprint.show;

{  adocommand1.CommandText:='exec notsumday '''+edit1.text+'''';
  adocommand1.Execute;}
end;

procedure Tsalaryreport.ppReport4PreviewFormCreate(Sender: TObject);
begin
 tppReport(Sender).PreviewForm.WindowState:=wsMaximized;
end;

procedure Tsalaryreport.ppReport5PreviewFormCreate(Sender: TObject);
begin
   tppReport(Sender).PreviewForm.WindowState:=wsMaximized;
end;

procedure Tsalaryreport.ppReport5BeforePrint(Sender: TObject);
begin
   pplabel213.caption:=pubworkname;
   pplabel175.Caption:= companyname1;
  pplabel176.Caption:='('+edit1.Text+')  '+'员工薪资条';
end;
procedure Tsalaryreport.ppReport4BeforePrint(Sender: TObject);
begin
  pplabel149.caption:=pubworkname;
  pplabel144.Caption:= companyname1;
  pplabel145.Caption:='计薪员工'+ Edit1.Text+'薪资';
end;

end.

⌨️ 快捷键说明

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