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

📄 pzlr.pas

📁 凭证管理系统的制作
💻 PAS
📖 第 1 页 / 共 3 页
字号:
begin
  JCXMlb := True;
  For m := 1 to a.RowCount-1 do
  begin
    if (Trim(a.Cells[0,m])='')or(Trim(a.Cells[1,m])='')then
    begin
      JCXMlb := False;
      Break;
    end
    else
    begin
      if (JisNull(m)= True)and(DIsNull(m)= True) then
      begin
        JCXMlb := False;
        Break;
      end
    end;
  end;
end;

procedure TForm2.ClearCurrent;
var
  b: Integer;
begin
  For b := 0 to a.ColCount-1 do
    a.Cells[b,x]:= '';
end;

procedure TForm2.ClearEnd;
var
  b: Integer;
begin
  For b := 0 to a.ColCount-1 do
    a.Cells[b,a.RowCount-1]:= '';
end;

procedure TForm2.Edit3KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if (Key = VK_ReTurn)and(Trim(Edit3.Text)<>'') then
  begin
    a.SetFocus;
    a.Col := 0;
  end;
end;

function TForm2.JCZYKJ: Boolean;
var
  aa: Integer;
begin
  JCZYKJ := True;
  For aa := 1 to a.RowCount-1 do
  begin
    with da.ADOQuery1 do
    begin
      Close;
      SQL.Clear;
      SQL.Add('select * from 摘要表 where 摘要名称 = :a');
      Parameters.ParamByName('a').Value := Trim(a.Cells[0,aa]);
      Open;
    end;
    if da.ADOQuery1.RecordCount<1 then
    begin
      JCZYKj := False;
      Break;
    end
    else
    begin
      with da.ADOQuery2 do
      begin
        Close;
        SQL.Clear;
        SQL.Add('select * from 会计科目表 where 科目名称 = :a');
        Parameters.ParamByName('a').Value := Trim(a.Cells[1,aa]);
        Open;
      end;
      if da.ADOQuery1.RecordCount<1 then
      begin
        JCZYKj := False;
        Break;
      end
    end;
  end;
end;

function TForm2.JSJFje(Row: Integer): Real;

begin
  JsJFje := 0.0;
  if a.Cells[2,row]='-' then
  begin
    if a.Cells[3,row]<>'' then Result := Result -StrToInt(a.Cells[3,row])*10000000000.0  ;
    if a.Cells[4,row]<>'' then Result :=Result - StrToInt(a.Cells[4,row])*1000000000.0;
    if a.Cells[5,row]<>'' then Result :=Result - StrToInt(a.Cells[5,row])*100000000.0 ;
    if a.Cells[6,row]<>'' then Result :=Result - StrToInt(a.Cells[6,row])*10000000.0;
    if a.Cells[7,row]<>'' then Result :=Result - StrToInt(a.Cells[7,row])*1000000.0;
    if a.Cells[8,row]<>'' then Result :=Result - StrToInt(a.Cells[8,row])*100000.0;
    if a.Cells[9,row]<>'' then Result :=Result - StrToInt(a.Cells[9,row])*10000.0;
    if a.Cells[10,row]<>'' then Result :=Result - StrToInt(a.Cells[10,row])*1000.0;
    if a.Cells[11,row]<>'' then Result :=Result - StrToInt(a.Cells[11,row])*100.0;
    if a.Cells[12,row]<>'' then Result :=Result - StrToInt(a.Cells[12,row])*10.0;
    if a.Cells[13,row]<>'' then Result :=Result - StrToInt(a.Cells[13,row]);
    if a.Cells[14,row]<>'' then Result :=Result - StrToInt(a.Cells[14,row])*0.1;
    if a.Cells[15,row]<>'' then Result :=Result -StrToInt(a.Cells[15,row])*0.01;
  end
  else
  begin
    if a.Cells[3,row]<>'' then Result := Result +StrToInt(a.Cells[3,row])*10000000000.0;
    if a.Cells[4,row]<>'' then Result := Result + StrToInt(a.Cells[4,row])*1000000000.0;
    if a.Cells[5,row]<>'' then Result := Result + StrToInt(a.Cells[5,row])*100000000.0 ;
    if a.Cells[6,row]<>'' then Result := Result + StrToInt(a.Cells[6,row])*10000000.0;
    if a.Cells[7,row]<>'' then Result := Result + StrToInt(a.Cells[7,row])*1000000.0;
    if a.Cells[8,row]<>'' then Result := Result + StrToInt(a.Cells[8,row])*100000.0;
    if a.Cells[9,row]<>'' then Result := Result + StrToInt(a.Cells[9,row])*10000.0;
    if a.Cells[10,row]<>'' then Result := Result + StrToInt(a.Cells[10,row])*1000.0;
    if a.Cells[11,row]<>'' then Result := Result + StrToInt(a.Cells[11,row])*100.0;
    if a.Cells[12,row]<>'' then Result := Result + StrToInt(a.Cells[12,row])*10.0;
    if a.Cells[13,row]<>'' then Result := Result + StrToInt(a.Cells[13,row]);
    if a.Cells[14,row]<>'' then Result := Result + StrToInt(a.Cells[14,row])*0.1;
    if a.Cells[15,row]<>'' then Result := Result +StrToInt(a.Cells[15,row])*0.01;
  end;
end;

function TForm2.JSDFje(Row: Integer): Real;

begin
  JsDFje := 0.0;
  if a.Cells[16,row]='-' then
  begin
    if a.Cells[17,row]<>'' then Result := Result -StrToInt(a.Cells[17,row])*10000000000.0  ;
    if a.Cells[18,row]<>'' then Result :=Result - StrToInt(a.Cells[18,row])*1000000000.0;
    if a.Cells[19,row]<>'' then Result :=Result - StrToInt(a.Cells[19,row])*100000000.0 ;
    if a.Cells[20,row]<>'' then Result :=Result - StrToInt(a.Cells[20,row])*10000000.0;
    if a.Cells[21,row]<>'' then Result :=Result - StrToInt(a.Cells[21,row])*1000000.0;
    if a.Cells[22,row]<>'' then Result :=Result - StrToInt(a.Cells[22,row])*100000.0;
    if a.Cells[23,row]<>'' then Result :=Result - StrToInt(a.Cells[23,row])*10000.0;
    if a.Cells[24,row]<>'' then Result :=Result - StrToInt(a.Cells[24,row])*1000.0;
    if a.Cells[25,row]<>'' then Result :=Result - StrToInt(a.Cells[25,row])*100.0;
    if a.Cells[26,row]<>'' then Result :=Result - StrToInt(a.Cells[26,row])*10.0;
    if a.Cells[27,row]<>'' then Result :=Result - StrToInt(a.Cells[27,row]);
    if a.Cells[28,row]<>'' then Result :=Result - StrToInt(a.Cells[28,row])*0.1;
    if a.Cells[29,row]<>'' then Result :=Result -StrToInt(a.Cells[29,row])*0.01;
  end
  else
  begin
    if a.Cells[17,row]<>'' then Result := Result + StrToInt(a.Cells[17,row])*10000000000.0;
    if a.Cells[18,row]<>'' then Result := Result + StrToInt(a.Cells[18,row])*1000000000.0;
    if a.Cells[19,row]<>'' then Result := Result + StrToInt(a.Cells[19,row])*100000000.0 ;
    if a.Cells[20,row]<>'' then Result := Result + StrToInt(a.Cells[20,row])*10000000.0;
    if a.Cells[21,row]<>'' then Result := Result + StrToInt(a.Cells[21,row])*1000000.0;
    if a.Cells[22,row]<>'' then Result := Result + StrToInt(a.Cells[22,row])*100000.0;
    if a.Cells[23,row]<>'' then Result := Result + StrToInt(a.Cells[23,row])*10000.0;
    if a.Cells[24,row]<>'' then Result := Result + StrToInt(a.Cells[24,row])*1000.0;
    if a.Cells[25,row]<>'' then Result := Result + StrToInt(a.Cells[25,row])*100.0;
    if a.Cells[26,row]<>'' then Result := Result + StrToInt(a.Cells[26,row])*10.0;
    if a.Cells[27,row]<>'' then Result := Result + StrToInt(a.Cells[27,row]);
    if a.Cells[28,row]<>'' then Result := Result + StrToInt(a.Cells[28,row])*0.1;
    if a.Cells[29,row]<>'' then Result := Result +StrToInt(a.Cells[29,row])*0.01;
  end;
end;

procedure TForm2.BitBtn3Click(Sender: TObject);
var
  aa,bb: Integer;
begin
  For aa := 1 to a.RowCount-1 do
    For bb := 0 to a.ColCount-1 do
      a.Cells[bb,aa]:= '';
  a.RowCount := 2;
  Label3.Caption := '';
  Edit3.Clear;
  Edit4.Text := '1';
  Label8.Caption := '';
  Label10.Caption := '';
end;

function TForm2.JDisPH: Boolean;
var
  i: Integer;
begin
  Result := True;
  For i := 1 to a.RowCount do
    if GroupzyDj(a.Cells[0,i])<>GroupzyJJ(a.Cells[0,i]) then
    begin
      Result := False;
      Break;
    end;
end;

function TForm2.GroupzyDJ(zy: String): real;
var
  i: Integer;
  Je: real;//记录金额
begin
  Result := 0.0;
  Je:= 0.0;
  For i := 1 to a.RowCount do
    if (Trim(zy)=Trim(a.Cells[0,i]))and(DIsNull(i)= False)then
      Je := Je + JsDJe(i); 
  Result := Je;
end;

function TForm2.GroupzyJJ(zy: String): real;
var
  i: Integer;
  Je: real;//记录金额
begin
  Result := 0.0;
  Je:= 0.0;
  For i := 1 to a.RowCount do
    if (Trim(zy)=Trim(a.Cells[0,i]))and(JIsNull(i)= False)then
      Je := Je + JsJJe(i); 
  Result := Je;
end;

function TForm2.JsDJe(Row: Integer): Real;
var
  a2: real;
begin
  JsDje := 0.0;
  if a.Cells[2,Row]='-' then
    begin
      if a.Cells[17,row]<>'' then a2 := a2 - StrToInt(a.Cells[17,row])*10000000000.0;
      if a.Cells[18,row]<>'' then a2 := a2 - StrToInt(a.Cells[18,row])*1000000000.0;
      if a.Cells[19,row]<>'' then a2 := a2 - StrToInt(a.Cells[19,row])*100000000.0;
      if a.Cells[20,row]<>'' then a2 := a2 - StrToInt(a.Cells[20,row])*10000000.0;
      if a.Cells[21,row]<>'' then a2 := a2 - StrToInt(a.Cells[21,row])*1000000.0;
      if a.Cells[22,row]<>'' then a2 := a2 - StrToInt(a.Cells[22,row])*100000.0;
      if a.Cells[23,row]<>'' then a2 := a2 - StrToInt(a.Cells[23,row])*10000.0;
      if a.Cells[24,row]<>'' then a2 := a2 - StrToInt(a.Cells[24,row])*1000.0;
      if a.Cells[25,row]<>'' then a2 := a2 - StrToInt(a.Cells[25,row])*100.0;
      if a.Cells[26,row]<>'' then a2 := a2 - StrToInt(a.Cells[26,row])*10.0;
      if a.Cells[27,row]<>'' then a2 := a2 - StrToInt(a.Cells[27,row]);
      if a.Cells[28,row]<>'' then a2 := a2 - StrToInt(a.Cells[28,row])*0.1;
      if a.Cells[29,row]<>'' then a2 := a2 -StrToInt(a.Cells[29,row])*0.01;
    end
    else
    begin
      if a.Cells[17,row]<>'' then a2 := a2 +StrToInt(a.Cells[17,row])*10000000000.0  ;
      if a.Cells[18,row]<>'' then a2 :=a2 + StrToInt(a.Cells[18,row])*1000000000.0;
      if a.Cells[19,row]<>'' then a2 := a2 + StrToInt(a.Cells[19,row])*100000000.0 ;
      if a.Cells[20,row]<>'' then a2 := a2 + StrToInt(a.Cells[20,row])*10000000.0;
      if a.Cells[21,row]<>'' then a2 := a2 + StrToInt(a.Cells[21,row])*1000000.0;
      if a.Cells[22,row]<>'' then a2 := a2 + StrToInt(a.Cells[22,row])*100000.0;
      if a.Cells[23,row]<>'' then a2 := a2 + StrToInt(a.Cells[23,row])*10000.0;
      if a.Cells[24,row]<>'' then a2 := a2 + StrToInt(a.Cells[24,row])*1000.0;
      if a.Cells[25,row]<>'' then a2 := a2 + StrToInt(a.Cells[25,row])*100.0;
      if a.Cells[26,row]<>'' then a2 := a2 + StrToInt(a.Cells[26,row])*10.0;
      if a.Cells[27,row]<>'' then a2 := a2 + StrToInt(a.Cells[27,row]);
      if a.Cells[28,row]<>'' then a2 := a2 + StrToInt(a.Cells[28,row])*0.1;
      if a.Cells[29,row]<>'' then a2 := a2 +StrToInt(a.Cells[29,row])*0.01;
    end;  
    Result := a2;
end;

function TForm2.JSJJe(Row: Integer): real;
var
  a1: real;
begin
  JsJJe := 0.0;
  if a.Cells[16,row]='-' then
    begin
      if a.Cells[3,row]<>'' then a1 := a1 -StrToInt(a.Cells[3,row])*10000000000.0;
      if a.Cells[4,row]<>'' then a1 :=a1 - StrToInt(a.Cells[4,row])*1000000000.0;
      if a.Cells[5,row]<>'' then a1 := a1 - StrToInt(a.Cells[5,row])*100000000.0;
      if a.Cells[6,row]<>'' then a1 := a1 - StrToInt(a.Cells[6,row])*10000000.0;
      if a.Cells[7,row]<>'' then a1 := a1 - StrToInt(a.Cells[7,row])*1000000.0;
      if a.Cells[8,row]<>'' then a1 := a1 - StrToInt(a.Cells[8,row])*100000.0;
      if a.Cells[9,row]<>'' then a1 := a1 - StrToInt(a.Cells[9,row])*10000.0;
      if a.Cells[10,row]<>'' then a1 := a1 - StrToInt(a.Cells[10,row])*1000.0;
      if a.Cells[11,row]<>'' then a1 := a1 - StrToInt(a.Cells[11,row])*100.0;
      if a.Cells[12,row]<>'' then a1 := a1 - StrToInt(a.Cells[12,row])*10.0;
      if a.Cells[13,row]<>'' then a1 := a1 - StrToInt(a.Cells[13,row]);
      if a.Cells[14,row]<>'' then a1 := a1 - StrToInt(a.Cells[14,row])*0.1;
      if a.Cells[15,row]<>'' then a1 := a1 -StrToInt(a.Cells[15,row])*0.01;
    end
    else
    begin
      if a.Cells[3,row]<>'' then a1 := a1 +StrToInt(a.Cells[3,row])*10000000000.0  ;
      if a.Cells[4,row]<>'' then a1 :=a1 + StrToInt(a.Cells[4,row])*1000000000.0;
      if a.Cells[5,row]<>'' then a1 := a1 + StrToInt(a.Cells[5,row])*100000000.0 ;
      if a.Cells[6,row]<>'' then a1 := a1 + StrToInt(a.Cells[6,row])*10000000.0;
      if a.Cells[7,row]<>'' then a1 := a1 + StrToInt(a.Cells[7,row])*1000000.0;
      if a.Cells[8,row]<>'' then a1 := a1 + StrToInt(a.Cells[8,row])*100000.0;
      if a.Cells[9,row]<>'' then a1 := a1 + StrToInt(a.Cells[9,row])*10000.0;
      if a.Cells[10,row]<>'' then a1 := a1 + StrToInt(a.Cells[10,row])*1000.0;
      if a.Cells[11,row]<>'' then a1 := a1 + StrToInt(a.Cells[11,row])*100.0;
      if a.Cells[12,row]<>'' then a1 := a1 + StrToInt(a.Cells[12,row])*10.0;
      if a.Cells[13,row]<>'' then a1 := a1 + StrToInt(a.Cells[13,row]);
      if a.Cells[14,row]<>'' then a1 := a1 + StrToInt(a.Cells[14,row])*0.1;
      if a.Cells[15,row]<>'' then a1 := a1 +StrToInt(a.Cells[15,row])*0.01;
    end;
  Result := a1;
end;

end.

⌨️ 快捷键说明

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