Ограничение скидки в кассире — различия между версиями
Материал из wiki.standart-n.ru
								
												
				| Olgav  (обсуждение | вклад)  (Новая страница: «Вставить текст в тмс кассира "После сканирования ШК": <pre> uses   Graphics, Controls, Forms, Dialogs, StdCtrls,   ComC…») | Olgav  (обсуждение | вклад)  | ||
| Строка 36: | Строка 36: | ||
| </pre> | </pre> | ||
| + | |||
| + | Строки | ||
| + | <pre>  | ||
| + | iq.sql.text := 'select 100*iif(price_o=0,1,(price-price_o)/price_o) as nac from parts where id='+ inttostr(chequelist[i].P_id); | ||
| + | </pre> | ||
| + | и | ||
| + | <pre> | ||
| + | if (chequelist[i].P_DscPrc<-3) and (iq.FieldByName('nac').asFloat<=20) then | ||
| + |   chequelist[i].P_SetDiscount(-chequelist[i].P_Price * chequelist[i].P_Quant*0.03); | ||
| + | </pre> | ||
| + | меняем в зависимости от пожеланий клиента | ||
Текущая версия на 12:46, 4 января 2017
Вставить текст в тмс кассира "После сканирования ШК":
uses
  Graphics, Controls, Forms, Dialogs, StdCtrls,
  ComCtrls, ExtCtrls, ibquery, DB, ChequeList, FR, 
  ScriptRes, Barcode,ZKassa, StrUtils, Windows, Classes,
  StrUtils, System,SysUtils,
  IBDataBase, Buttons;
var iq: tibquery;
    i,j: Integer;
procedure SetDsc;
begin
   iq := tibquery.create(nil);
   iq.transaction := CreateRT(CurrDB);
   iq.transaction.starttransaction;
  for i := 0 to chequelist.count - 1 do
    for j := 0 to chequelist[i].count - 1 do
    begin
      chequelist[i].p_index := j;
      iq.active := False;
      iq.sql.text := 'select 100*iif(price_o=0,1,(price-price_o)/price_o) as nac from parts where id='+ inttostr(chequelist[i].P_id);
      iq.active := True;
      if (chequelist[i].P_DscPrc<-3) and (iq.FieldByName('nac').asFloat<=20) then
        chequelist[i].P_SetDiscount(-chequelist[i].P_Price * chequelist[i].P_Quant*0.03);
     end;
   iq.Free;
end;
begin
  SetDsc
end;
Строки
iq.sql.text := 'select 100*iif(price_o=0,1,(price-price_o)/price_o) as nac from parts where id='+ inttostr(chequelist[i].P_id);
и
if (chequelist[i].P_DscPrc<-3) and (iq.FieldByName('nac').asFloat<=20) then
  chequelist[i].P_SetDiscount(-chequelist[i].P_Price * chequelist[i].P_Quant*0.03);
меняем в зависимости от пожеланий клиента
