procedure TFVorschau.Button1Click(Sender: TObject);
var netto, mwst: single;
begin
RvProject1.Open;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('
SELECT Titel, Adresse, Vorname, Nachname, PLZ, Ort, Land, ID_Rechnungen FROM kunden INNER JOIN Rechnungen ON kunden.ID_Kunden = Rechnungen.ID_Kunden WHERE (Rechnungen.ID_Rechnungen=70)');
adoquery1.Open;
Rvproject1.SetParam('
Name', adoquery1.FieldByName('
Titel').AsString + '
' + adoquery1.FieldByName('
Vorname').AsString + '
' + adoquery1.FieldByName('
Nachname').AsString);
Rvproject1.SetParam('
Adresse', adoquery1.FieldByName('
Adresse').AsString);
Rvproject1.SetParam('
Ort', adoquery1.FieldByName('
PLZ').AsString + '
' + adoquery1.FieldByName('
Ort').AsString);
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('
SELECT Ktn,BLZ,Bank_name,IBAN,BiC, Firmen_name, Adresse, Ort, PLZ, Url, Logo, Steuerid, Umsatzsteuerid FROM (Rechnungen INNER JOIN Konto ON Rechnungen.ID_Konto = Konto.ID_Konto) INNER JOIN Firmen ON Konto.ID_Firma = Firmen.ID_Firma');
adoquery1.SQL.Add('
WHERE Rechnungen.ID_Rechnungen=70;');
adoquery1.Open;
Rvproject1.SetParam('
Ktn', '
Kto.-Nr ' + adoquery1.FieldByName('
Ktn').AsString);
Rvproject1.SetParam('
BLZ', '
BLZ ' + adoquery1.FieldByName('
BLZ').AsString);
Rvproject1.SetParam('
Bankname', '
Bankname ' + adoquery1.FieldByName('
Bank_name').AsString);
// Rvproject1.SetParam('IBAN', 'IBAN ' + adoquery1.FieldByName('IBAN').AsString);
// Rvproject1.SetParam('BIC', 'BIC ' + adoquery1.FieldByName('BIC').AsString);
Rvproject1.SetParam('
F_Adresse', adoquery1.FieldByName('
Adresse').AsString);
Rvproject1.SetParam('
F_Ort', adoquery1.FieldByName('
PLZ').AsString + '
' + adoquery1.FieldByName('
Ort').AsString);
Rvproject1.SetParam('
F_Url', adoquery1.FieldByName('
Url').AsString);
Rvproject1.SetParam('
F_Steuer', adoquery1.FieldByName('
Steuerid').AsString);
Rvproject1.SetParam('
F_Umsatz', adoquery1.FieldByName('
Umsatzsteuerid').AsString);
Rvproject1.SetParam('
F_Name', adoquery1.FieldByName('
Firmen_name').AsString);
Rvproject1.SetParam('
Bankverbindung', '
Bankverbindung');
Rvproject1.SetParam('
Steuernummern', '
Steuernummern');
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('
SELECT Sum(Produkte.Preis) AS [Summe] FROM ((Produkte INNER JOIN Produkt_kategorien ON ');
adoquery1.SQL.Add('
Produkte.ID_P_Kategorie = Produkt_kategorien.ID_P_Kategorie) INNER JOIN (Pos_Nr INNER JOIN Rechnungsposten ON Pos_Nr.ID_Rech_posten = Rechnungsposten.ID_Rech_posten) ');
adoquery1.SQL.add('
ON Produkte.ID_Produkt = Rechnungsposten.ID_Produkt) INNER JOIN Rechnungen ON Pos_Nr.ID_Rechnung = Rechnungen.ID_Rechnungen GROUP BY Rechnungen.ID_Rechnungen HAVING (((Rechnungen.ID_Rechnungen)=70))');
adoquery1.Open;
netto:=adoquery1.FieldByName('
Summe').AsInteger - ((adoquery1.FieldByName('
Summe').AsInteger/100) * 16);
mwst:=adoquery1.FieldByName('
Summe').AsInteger - netto;
Rvproject1.SetParam('
S_Netto', floattostr(roundto(netto,-2)));
Rvproject1.SetParam('
Umsatz', floattostr(roundto(mwst,-2)));
Rvproject1.SetParam('
Gesamt', adoquery1.FieldByName('
Summe').AsString);
adoquery1.Close;
RvProject1.Execute;
RvProject1.Close;
end;