Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagedelphi
procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean);

begin

 if AVerifyType = vtNewQuickCheck then

  if RKCheck.CurrentOrder.IsEmpty then

    RK7.PerformRefObject(RK7.FindItemByCode(rkrefCategList, 5 {Menu group code}));

end;

A script to create 2+1 and 3+1

...

special offers

Insert the script in the OnOrderVerify event of the CheckView component on the check editing form. The discount will be calculated and added to the receipt when the bill is printed.

...

  1. When swiping the PDS card (the OnProcessCard handler), the script checks if it is possible to add a discount to the dish.
  2. If the discount was not used, the script finds for a dish that can be given a 100% discount:
    • This dish is given a 100% discount.
    • The discount "DISCOUNT USED" is added to the order via PerformMCRAlgoritm, so that the card code is registered in the discount.

 У скидки «СКИДКА ИСПОЛЬЗОВАНА» должны быть выставлен флаг «Не вручную» и не отмечено «Печатать нулевые».
Скрипт нужно вставить в метод OnProcessCard на форме редактирования заказа.

The «DISCOUNT USED» discount must have the «Not manually» flag set and the «Print nulls» option unchecked.
Insert the script in the OnProcessCard method on the order editing form.

...

Code Block
languagedelphi
procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean);

var i, Interval, RND, DEV,happynum, CntDish, HaveSpecialDish: integer;

    rr : double;

    tt: string;

    it: TCheckItem;

begin 

//************************************//

// stop service without special dish  //

//************************************//

  if (AVerifyType = vtBeforeSave) then

  begin

    HaveSpecialDish := 0;

    CntDish := 0;

    for i := 0 to RKCheck.CurrentOrder.Sessions.LinesCount - 1 do begin

      it := RKCheck.CurrentOrder.Sessions.Lines[i];

      if SYS.ObjectInheritsFrom(TObject(it), 'TDish') then

      if (TDish(it).Quantity <> 0) then

              begin

        CntDish := CntDish + 1;     

        if ((it.CODE = 5502) OR (it.CODE = 1003)) then

          HaveSpecialDish := HaveSpecialDish + 1;

      end;

    end;

    if (CntDish>0) and (HaveSpecialDish = 0) then

    begin

    //  gui.showmessage('НетNo обязательногоmandatory блюдаdish! СохранениеSaving запрещеноprohibited');

              if GUI.RKMessageDlg('Return to edit order?', 0, 3, 10000) = 6 then

            AContinue := False

          else

            AContinue := True;    

    end;

  end;

//************************************//

// stop service without special dish  //

//************************************//


// show meessage on special order

  Interval := 10;

  DEV := 5;

  tt := TimeToStr(time);

  rr := 10*1/StrToInt(Copy(tt,length(tt)-1,2));

  happynum := trunc(Interval + rr*DEV - trunc(DEV/2));

//  GUI.ShowMessage('Happy Num='+IntToStr(happynum));

//  GUI.ShowMessage('Happy Time='+tt+' --'+Copy(tt,length(tt)-1,2));

  if (AVerifyType = vtBill) and (happynum=RKCheck.CurrentOrder.SeqNumber) then

  begin

    GUI.ShowMessage('Happy Order '+IntToStr(RKCheck.CurrentOrder.SeqNumber));

 //  ss := RKCheck.CurrentOrder.OrderName;

 //   CheckView.Tag:=1;

  end;

end;

...

The cashier shouldn't be able to calculate the order equal to or bigger than 1000 rubles if there is no gift dish in it.

...

Code Block
languagedelphi
procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean);

var i,dsk1, dsk2: integer;

it, it2: TCheckItem;

begin

  dsk1 := 0;     // discounts counter canceling markup

  dsk2 := 0;     // markup counter

  for i := 0 to RKCheck.CurrentOrder.Sessions.LinesCount - 1 do begin

    it := RKCheck.CurrentOrder.Sessions.Lines[i];

    if SYS.ObjectInheritsFrom(TObject(it), 'TDiscount') then

    Begin

      if ((it.CODE = 5) or (it.CODE = 6)) then // discounts codes canceling markup

        dsk1 := dsk1 + 1;

      if (it.CODE = 10) then // markup code

      begin

        dsk2 := dsk2 + 1;

        it2 := it;

      end;     

    End;

  end;  

  if (dsk1 > 0) and (dsk2 > 0) then

    RKCheck.DeleteCheckItem(it2);  // delete markup

end;

A script to activate the

...

«Plastek» loyalty card

If there is блюдо пополнения или активации a deposit or activation item in the receipt— the table cannot be closed without using a loyalty card.

...

Code Block
languagedelphi
procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean);

var i: integer;

    minweight: double;

    it: TCheckItem;

begin

  minweight := 0.3;  // setting the minimum weight for sale  

  if (AVerifyType = vtBill)or(AVerifyType = vtPrintReceipt) then

  begin

    for i := 0 to RKCheck.CurrentOrder.Sessions.LinesCount - 1 do begin

      it := RKCheck.CurrentOrder.Sessions.Lines[i];

      if SYS.ObjectInheritsFrom(TObject(it), 'TDish') then

        if TDish(it).Quantity>0.0 then

          if SYS.ObjectInheritsFrom(it, 'TPortion') then //check for a catch weight dish     

           if Tdish(it).Quantity < minweight then

            begin

              gui.showmessage('Too small weight! Set more then '+FloatToStr(minweight));

              AContinue := False;

            end;     

    end;

  end;

end;

A script to confirm saving the special dish by the manager's card

...

The algorithm :

  1. The waiter adds a special dish or drink (with the letter A) to the order.
  2. Then he or she clicks «Save order». After that, the «Confirmation by the manager's card is required » window pops up.
  3. The manager swipes his or her card, controlling if the special offer is correctly applied. The "Save order" window pops up.
  4. After that, the added dishes are printed on the kitchen printers.

On the order editing form of the CheckView object, insert the script in the OnOrderVerify event:

Code Block
languagedelphi

The algorithm :

1.Официант пробивает блюдо/напиток по акции (с литерой А)

2.Нажимает «сохранить заказ». После этого всплывает окно «Требуется подтверждение картой менеджера»

3. Менеджер поводит своей картой (контролирует в этот момент корректность применения акции), после чего всплывает окно «Сохранить заказ».

4. После этого пробитые блюда печатаются в цеховых принтерах.

...

procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean);

var i, DishCode, CntDish, HaveSpecialDish: integer;

    it: TCheckItem;

begin 

//************************************//

//              57799                 //

//************************************//

  if (AVerifyType = vtBeforeSave) then

  begin

    DishCode := 25;       // code of dish

    HaveSpecialDish := 0;

    CntDish := 0;

    for i := 0 to RKCheck.CurrentOrder.Sessions.LinesCount - 1 do begin

      it := RKCheck.CurrentOrder.Sessions.Lines[i];

      if SYS.ObjectInheritsFrom(TObject(it), 'TDish') then

      if (TDish(it).Quantity <> 0) then

      begin

        CntDish := CntDish + 1;     

        if (it.CODE = DishCode) then

          HaveSpecialDish := HaveSpecialDish + 1;

      end;

    end;

    if (CntDish>0) and (HaveSpecialDish > 0) then

    begin

    //  gui.showmessage('??? ????????????? ?????! ?????????? ?????????');

      if RK7.PerformOperation(rkoUser07, 0)=1 then

            AContinue := True

          else

            AContinue := False; 

    end;

  end;

//************************************//

//               57799                //

//************************************//

end;

...



Specify an empty script for a custom operation (operation #7 is used in the example):

Code Block
languagedelphi
procedure ProcessOperation1001837(Parameter: integer);

begin


end;

В свойствах операции выставить галочку «Контроль доступа» и назначить права соотвествующему пользователю.

Скрипт на автоматическое добавление блюда при создании заказа

В форме редактирования чека у компонента CheckView в событии OnOrderVerify укажите скрипт:

In the operation properties, check the box «Access Control» and assign rights to the appropriate user.

A script to automatically add a dish when creating an order

On the check editing form for the CheckView component, insert the script in the OnOrderVerify event:

Code Block
languagedelphi
procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean);

var i, CntDish, HaveSpecialDish: integer;
it:Tcheckitem;


begin

//************************************//

// stop service without special dish //

//************************************//

if (AVerifyType = vtBeforeSave) then

begin

HaveSpecialDish := 0;

CntDish := 0;

for i := 0 to RKCheck.CurrentOrder.Sessions.LinesCount - 1 do begin

it := RKCheck.CurrentOrder.Sessions.Lines[i];

if SYS.ObjectInheritsFrom(TObject(it), 'TDish') then

if (TDish(it).Quantity <> 0) then

begin

CntDish := CntDish + 1;

if ((it.CODE = 5502) OR (it.CODE = 1003)) then

HaveSpecialDish := HaveSpecialDish + 1;

end;

end;

if (CntDish>0) and (HaveSpecialDish = 0) then

begin

// gui.showmessage('

...

No 

...

mandatory 

...

dish! 

...

Saving 

...

prohibited');

if GUI.RKMessageDlg('Return to edit order?', 0, 3, 10000) = 6 then

AContinue := False

else

AContinue := True;

end;

end;

//************************************//

// stop service without special dish //

//************************************//


end;

...

In the line:

Code Block
languagedelphi
if ((it.CODE = 5502) OR (it.CODE = 1003)) then

указаны коды обязательных блюд. Замените условие в этой строке на своё.

Скрипт, печатающий чек и предчек в режиме «быстрый чек»

Скрипт для формы «Редактирование заказа(быстрый чек)»

codes of required dishes are specified. Replace the condition in this line with your own.

The script that prints a receipt and a bill in the «quick check» mode

A script for the «Edit Order (quick receipt)» form:

Code Block
languagedelphi
procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean);

begin

 if (AVerifyType=vtAfterReceipt) then

  RK7.PerformRefObject(RK7.FindItemByCode(rkrefMaketSchemeDetails,1001965)); 

end;

Вместо 1001965 подставите код представления своего чека. Печать будет происходить сразу после печати основного чекаInsert the code of your check view instead of 1001965. Printing will take place immediately after printing the main receipt.