Autor Beitrag
Becks16 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 405



BeitragVerfasst: So 08.07.07 15:33 
jaa also bei der query waren z.b. 2 paramter drin das war wohl auch eine ursache ich poste nochmal den quelltext dann kannst du dir das mal angucken

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
// Nun die Provision bestimmen
    // dazu aus dem gegebenen Rabatt die zugehoerige Provision in Prozent aus Db auslesen
    f_kalkulation.qu_prov.Close;
    f_kalkulation.qu_prov.Parameters.ParamByName('rabatt').Value := max(lRabatt, 0);
    f_kalkulation.qu_prov.Parameters.ParamByName('rabatt2').Value := max (lRabatt, 0 );

    f_kalkulation.qu_prov.Open;
    lProvisionValue := f_kalkulation.qu_prov.FieldByname('prov').Value;
    f_kalkulation.qu_prov.Close;

    // Wurde eine gültige Provision gefunden?
    if not VarIsNull(lProvisionValue) then
    begin
      // Testweise anzeigen Provisionszahl:
      ShowMessage('Provision = ' + VarToStr(lProvisionValue));

      // Provisionssatz gefunden, dann daraus die Provision in Geld ausrechnen
      lProvision := lVerkaufspreis * lProvisionValue / 100;

      // und ausgeben
      edit_provision.Text := FloatToStr(lProvision);
    end
    else
    begin
      ShowMessage('Keine Provision gefunden');

      // Keine Provision gefunden in DB, also 0 als Provision ausgeben
      edit_provision.Text := '0';
    end;
  end;
end;


mfg

_________________
Ich bin Dumm und weiss nichts :-)
Agawain
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 460

win xp
D5, MySQL, devxpress
BeitragVerfasst: So 08.07.07 18:29 
LOL

ich weiß zwar nicht, wie der 2. Parameter da reinkommt, der war am Freitag noch nicht da und anscheinend hast Du auch die Werte in der DB geändert, aber ich freu mich, daß Du offenbar alles verstanden hast, sonst hättest Du den Code nicht so umstellen können.
Damit biste ja auf dem richtigen Weg.

Gruß

Aga
Becks16 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 405



BeitragVerfasst: So 08.07.07 19:23 
jaa hmm aber ohne eure hilfe wer das nix geworden , ins besondere zum schluß hat mir uko sehr geholfen

_________________
Ich bin Dumm und weiss nichts :-)