...
Code Block | ||
---|---|---|
| ||
procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean); var DishCode1, DishCode2, DishCode3, DishCode4, ZoneId1,ZoneId2,ZoneId3,ZoneId4: integer; limit1, limit2, limit3, limit4: double; begin DishCode1 := 43; // special dish1 code DishCode2 := 46; // special dish2 code DishCode3 := 47; // special dish3 code DishCode4 := 48; // special dish4 code limit1 := 600; // paid delivery limit 1 limit2 := 750; // paid delivery limit 2 limit3 := 850; // paid delivery limit 3 limit4 := 950; // paid delivery limit 4 ZoneId1 := 2; // delivery zone 1 ID ZoneId2 := 3; // delivery zone 2 ID ZoneId3 := 4; // delivery zone 3 ID ZoneId4 := 5; // delivery zone 4 ID if (AVerifyType=vtBill) // bill if (AVerifyType=vtBill) // bill !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! then if RKCheck.CurrentOrder.ZoneID > 0 then begin if RKCheck.CurrentOrder.ZoneID = ZoneId1 then if RKCheck.CurrentOrder.ToPaySum <= limit1 then RKCheck.CreateCheckItem(rkrefMenuItems, IntToStr(DishCode1), IntToStr(1) ); // доставкаdelivery 1 if RKCheck.CurrentOrder.ZoneID = ZoneId2 then if RKCheck.CurrentOrder.ToPaySum <= limit2 then RKCheck.CreateCheckItem(rkrefMenuItems, IntToStr(DishCode2), IntToStr(1) ); // доставкаdelivery 2 if RKCheck.CurrentOrder.ZoneID = ZoneId3 then if RKCheck.CurrentOrder.ToPaySum <= limit3 then RKCheck.CreateCheckItem(rkrefMenuItems, IntToStr(DishCode3), IntToStr(1) ); // доставкаdelivery 3 if RKCheck.CurrentOrder.ZoneID = ZoneId4 then if RKCheck.CurrentOrder.ToPaySum <= limit4 then RKCheck.CreateCheckItem(rkrefMenuItems, IntToStr(DishCode4), IntToStr(1) ); // доставкаdelivery 4 end; end; |
Скрипт, контролирующий прокат карты PDS
Есть блюда, которые доступны только держателям клубных карт. При выборе этого блюда должно появляться окно — «Используйте карту PDS». Если нет карты, то блюдо в чек не попадает.
A script to control swiping of the PDS card
There are dishes that are only available to club card holders. When you select this dish, the «Use the PDS card» window should appear. If there is no card, the dish is not added to the order.
Code Block | ||
---|---|---|
| ||
procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean); var i, DishCode1, DishCode2, DishCode3, DiscountCode1, DiscountCode2, DiscountCode3, CardPresent,DishPresent: integer; CardCode: string; it: TCheckItem; begin DishCode1 := 1; DiscountCode1 := 12; DiscountCode2 := 13; DiscountCode3 := 14; CardPresent := 0; DishPresent := 0; CardCode := ''; 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 //Check dish lines only if (TDish(it).code = DishCode1) then //Check category of the dish if TDish(it).Quantity > 0 then DishPresent := DishPresent + 1; if SYS.ObjectInheritsFrom(TObject(it), 'TDiscountItem') then //Check discount lines only if (TDiscountItem(it).code = DiscountCode1) or(TDiscountItem(it).code = DiscountCode2) or(TDiscountItem(it).code = DiscountCode3) then // defining PDS |
...
card |
...
by |
...
PDS |
...
discount |
...
availability CardPresent := 1; end; if DishPresent > 0 then if CardPresent > 0 then AContinue:= True else { if GUI.RKMessageDlg(' |
...
Special |
...
dishes |
...
available, |
...
use |
...
PDS |
...
card' ,0,3, 10000)=6 then AContinue := false else AContinue := True; } begin // gui.showmessage(' |
...
There are special dishes in the order, use PDS card' '); gui.showmessage(' |
...
Special |
...
dishes: '+inttostr(DishPresent)+' ; Cards |
...
found |
...
in |
...
the |
...
order: '+inttostr(CardPresent)); // |
...
test |
...
line AContinue := false; end; end; if (AVerifyType = vtBill) or(AVerifyType = vtPrintReceipt) or (AVerifyType=vtBeforeSave) then for i := 0 to RKCheck.CurrentOrder.Sessions.LinesCount - 1 do begin it := RKCheck.CurrentOrder.Sessions.Lines[i]; if SYS.ObjectInheritsFrom(it, 'TDish') then if CheckDishCode(TDish(it).Code) then // if (TDish(it).Code = DishCode) then begin // checking by Consumators if TDish(it).Consumators.Count = 0 then begin gui.ShowMessage(' |
...
Operation |
...
impossible, |
...
add |
...
consumator'); AContinue := false; end; end; end; end; |
Скрипт, ограничивающий оплату картами PDS только быстрым чеком
Необходимо разрешить оплату картами PDS только в случае, если заказ создан с помощью кнопки «Быстрый чек».
На форме быстрого чека у объекта CheckView в событии OnOrderVerify указать скрипт:
A script to restrict the payment with PDS cards to a quick check only
Payments with PDS cards should be allowed only if the order is created using the «Quick Check» button.
On the quick check form of the CheckView object, insert the script in the OnOrderVerify event:
Code Block | ||
---|---|---|
| ||
procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean);
begin
if AVerifyType = vtNewQuickCheck then
if RKCheck.CurrentOrder.IsEmpty then
RKCheck.CurrentOrder.UserTag2 := 33;
end; |
...
Add a line to the MCR script to check the specified custom tag:
Code Block | ||
---|---|---|
| ||
if (RKCheck.CurrentOrder.UserTag2 = 33) then |
...
A script to control the number of consumators for some dishes
Необходимо сделать так, чтобы к одним блюдам был привязан один консумант, а к другим — два консуманта.
...
На форме редактирования заказа у объекта CheckView в событии OnOrderVerify укажите скрипт:
Some dishes should be given one consumator, while other dishes should be given 2 consumators.
To do this, set the limit of consumators — 2 in the parameter, and use the script to limit the dishes of a special category to one consumator.
On the order editing form for the CheckView object, insert the script in the OnOrderVerify event:
Code Block | ||
---|---|---|
| ||
procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean);
var i,j,CntConsumators,MaxQntConsumCateg1:integer;
it: TCheckItem;
CategCode2: integer;
Categ2: TClassificatorGroup;
begin
//************************* Set parameters ******************************//
CategCode2 := 8; // |
...
controlled |
...
dishes |
...
category MaxQntConsumCateg1 := 1; //************************* Set parameters ******************************// Categ2 := TClassificatorGroup(getitemBycodeNum('ClassificatorGroups', CategCode2)); if (AVerifyType = vtBeforeSave)or(AVerifyType = vtBill)or(AVerifyType = vtPrintReceipt) then for i:= 0 to RKCheck.CurrentOrder.Sessions.LinesCount - 1 do begin it := RKCheck.CurrentOrder.Sessions.Lines[i]; if SYS.ObjectInheritsFrom(TObject(it), 'TDish') then begin CntConsumators := 0; CntConsumators := TDish(it).Consumators.Count; //dbg.dbgprint(' |
...
dish '+TDish(it).Name +' |
...
of modifiers '+inttostr(CntConsumators)); if not(Categ2.IsChild(it.RefItem)) then //Check category of the dish if CntConsumators>MaxQntConsumCateg1 then begin AContinue := False; gui.showmessage(' |
...
The number |
...
of |
...
dish |
...
consumants |
...
is exceeded'+TDish(it).Name); end; end; end; end; |
Скрипт для проверки наличия подарочного блюда в заказе
Акция — Подарок от суммы заказа. От 1000 рублей — одно блюдо бесплатно,
от 1200 - одно из двух на выбор.
Необходимо чтобы кассир не смог рассчитать заказ от 1000 рублей, если в нём нет подарочного блюда.
...
A script to check the presence of a gift dish in the order
The special offer: A gift depending on the order sum. One dish is for free if the order sum is bigger than 1000 rubles. When it is bigger than 1200 rubles, one of two free dishes may be chosen.
The cashier shouldn't be able to calculate the order equal or bigger than 1000 rubles if there is no gift dish in it.
Place the script on the order editing form at the CheckView object in the OnOrderVerify event.
Code Block | ||
---|---|---|
| ||
procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean);
var i, CntDish, HaveSpecialDish, SpecialDishCode1, SpecialDishCode2: integer;
LimitSum : double;
it: TCheckItem;
begin
//************************************//
// stop service without special dish //
//************************************//
//********** Set parameters ***********//
SpecialDishCode1 := 23; // |
...
dish |
...
code SpecialDishCode2 := 24; // |
...
dish |
...
code LimitSum := 1000; // |
...
the sum of the check, over which the gift dish is due //********** Set parameters ***********// if ((AVerifyType=vtBill) // |
...
bill or (AVerifyType=vtBeforeSave) // |
...
save |
...
order or (AVerifyType=vtFirstPay) // |
...
first |
...
payment |
...
input or (AVerifyType=vtPrintReceipt)) // |
...
...
receipt 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 = SpecialDishCode1)or(it.CODE = SpecialDishCode2) then HaveSpecialDish := HaveSpecialDish + 1; end; end; if (HaveSpecialDish = 0)and(RKCheck.CurrentOrder.ToPaySum >= LimitSum) then begin gui.showmessage(' |
...
No |
...
gift |
...
dishes!'); AContinue := False end; end; //************************************// // stop service without special dish // //************************************// end; |
Скрипт для привязки валют к типу гостя
Для организации питания персонала введено:
- два типа гостя («Гость» и «Персонал») и дополнительный тип цены;
- тип цены для персонала привязан к типу гости «Персонал»;
- для оплаты заказа по ценам для персонала используется две специальные валюты.
Скрипт ограничивает оплату только данными типами валют при выборе типа гостя «Персонал»
...
A script for link currencies to the type of guest
To arrange the staff meals, the following options were created:
- two guest types («Guest» and «Staff») and an additional type of price;
- the staff price type is linked to the «Staff» guests type;
- two special currencies are used to pay for the order at staff prices.
The script restricts the payment only to these currency types when selecting the «Staff» guests type.
The version of the cash register system 7.5.2.377
В форме редактирования заказ у объекта CheckView в событии OnOrderVerify указать скрипт:
On the order editing form for the CheckView object, insert the script in the OnOrderVerify event:
Code Block | ||
---|---|---|
| ||
procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean);
var i, CntDish, HaveSpecialDish, HaveDiscount: integer;
it: TCheckItem;
HaveAnotherCurr: integer;
begin
//***********41012********************//
if (AVerifyType = vtBill)or(AVerifyType = vtPrintReceipt) then
// if RKCheck.CurrentOrder.GuestType = ' |
...
Staff' then if RKCheck.CurrentOrder.Visit.GuestType <> 0 then if RK7.FindItemBySifr(rkrefGuestTypes, RKCheck.CurrentOrder.Visit.GuestType).Code = 2 then begin HaveAnotherCurr := 0; for i := 0 to RKCheck.CurrentOrder.Sessions.LinesCount - 1 do begin it := RKCheck.CurrentOrder.Sessions.Lines[i]; if SYS.ObjectInheritsFrom(TObject(it), 'TPayLine') then if (TPayLine(it).Code <> 98)and(TPayLine(it).Code <> 99) then // |
...
Currency |
...
code |
...
for |
...
staff HaveAnotherCurr := HaveAnotherCurr + 1; end; if (HaveAnotherCurr>0) then begin AContinue := False; gui.showmessage(' |
...
Prohibited |
...
currency |
...
for |
...
this |
...
order!'); end; end; //***********41012********************// end; |
...
A script to print the final receipt in R_Keeper_7
Ресторан работает под ООО и ИП. В ООО - фискальный регистратор и накопитель. В ИП — роловый принтер. В качестве чекового принтера — фискалкальный регистратор, на котором задана классификация — отдел ФР. Необходимо, чтобы кроме этих двух разделенных чеков, дополнительно печатался третий — общий, на роловом принтере.
Создать макет в "Прочее -- Пользовательский макет" Загрузить в него макет чека. Создать для него представление печати в схемах печати.
В форме редактирования чека у объекта CheckView в событии OnOrderVerify указать скрипт:
The restaurant works under two types of business entities — private limited company and sole proprietorship. In the first one, a fiscal register and a fiscal memory device are used. In the second one, a check printer is used. A fiscal register works as a POS printer and has the «FR department» classification set. Alongside these two separated receipts, the third — a common one — should be printed on a check printer.
Create a layout in «Other — Custom Layout» and load a check layout. Create a print view for it in the print layouts.
On the check editing form of the CheckView object, insert the script in the OnOrderVerify event:
Code Block | ||
---|---|---|
| ||
procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean);
begin
if (AVerifyType=vtAfterReceipt) then
begin
RK7.PerformRefObject(RK7.FindItemByCode(rkrefMaketSchemeDetails,219)); // |
...
...
view |
...
code end; end; |
Вместо «219» указать код представления печати пользовательского макета.
Скрипт на удаление наценки, если в заказе есть определенная скидка
...
Specify the print view code of the custom layout instead of «219».
A script to remove the markup, if the order has a certain discount
The « Service 10% » charge applies only to waiters and is calculated from the order amount. A set of discounts (5%, 10%,
...
Employee,
...
Private) is calculated from the order amount.
Discounts «Employee» (code 5) and «Private» (code 6) remove the markup.
On the check editing form of the CheckView object, insert the script in the OnOrderVerify event:
Скидки «Сотрудник» (код 5) и «Приват» (код 6) убирают наценку.
На форме редактирования чек у объекта CheckView в событии OnOrderVerify указать скрипт:
Code Block | ||
---|---|---|
|
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 блюдо пополнения или активации in the receipt— the table cannot be closed without using a loyalty card.
The script checks the presence of the specified dish and the discount in the order. If there is a dish, but there is no discount, then a message is displayed and the action is blocked until the discount is added or the dish is removed.
Code Block | ||
---|---|---|
| ||
procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean);
var i, Interval, RND, DEV,happynum, CntDish, HaveSpecialDish, HaveSpecialDisc, SpecialDishCode, SpecialDiscCode: integer;
rr : double;
tt: string;
it: TCheckItem;
begin
//************************************//
// stop service without special dish //
//************************************//
if ((AVerifyType=vtBill) // |
...
bill or (AVerifyType=vtBeforeSave) // |
...
save |
...
order or (AVerifyType=vtFirstPay) // input of |
...
the |
...
first |
...
payment or (AVerifyType=vtPrintReceipt)) // |
...
...
receipt |
...
then begin SpecialDishCode := 23; // |
...
dish |
...
code SpecialDiscCode := 10; // |
...
discount |
...
code HaveSpecialDish := 0; HaveSpecialDisc := 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 = SpecialDishCode) then HaveSpecialDish := HaveSpecialDish + 1; end; if SYS.ObjectInheritsFrom(TObject(it), 'TDiscountItem') then if (it.CODE = SpecialDiscCode) then HaveSpecialDisc := HaveSpecialDisc + 1; end; if (HaveSpecialDisc = 0) and (HaveSpecialDish > 0) then begin gui.showmessage(' |
...
No |
...
mandatory |
...
discount!'); AContinue := False end; end; //************************************// // stop service without special dish // //************************************// |
...
end; |
A script to print a coupon layout
Code Block | ||
---|---|---|
| ||
procedure CheckViewOnOrderVerify(Sender: TObject; AVerifyType: TVerifyType; oper: integer; var AContinue: boolean); var i, CntDish2, CntDish3, CntDish4, CodeDish2, CodeDish3_1, CodeDish3_2, CodeCateg4_1, CodeCateg4_2: integer; it: TCheckItem; Categ: TClassificatorGroup; s1: string; begin s1 := FormatDateTime('hh',Now); CntDish2 := 0; CntDish3 := 0; CntDish4 := 0; CodeDish2 := 10; // dish code |
...
...
CodeDish3_1 := 100; // dish |
...
code |
...
...
CodeDish3_2 := 105; // |
...
dish code |
...
...
CodeCateg4_1 := 5; // |
...
"Salad" |
...
category |
...
code CodeCateg4_2 := 8; // |
...
"Drink" |
...
category |
...
code for i := 0 to RKCheck.CurrentOrder.Sessions.LinesCount - 1 do begin it := RKCheck.CurrentOrder.Sessions.Lines[i]; if SYS.ObjectInheritsFrom(TObject(it), 'TDish') then begin if TDish(it).Code = CodeDish2 then CntDish2 := CntDish2 + 1; if (TDish(it).Code = CodeDish3_1) or (TDish(it).Code = CodeDish3_2) then CntDish3 := CntDish3 + 1; Categ := TClassificatorGroup(getitemBycodeNum('ClassificatorGroups', CodeCateg4_1)); if Categ.IsChild(it.RefItem) then CntDish4 := CntDish4 + 1; Categ := TClassificatorGroup(getitemBycodeNum('ClassificatorGroups', CodeCateg4_2)); if Categ.IsChild(it.RefItem) then CntDish4 := CntDish4 + 1; end end; if AVerifyType = vtPrintReceipt then if StrtoInt(s1) <= 18 then Begin // |
...
order |
...
sum >= 500 |
...
rub. if (RKCheck.CurrentOrder.ToPaySum >= 500) {and (RKCheck.CurrentOrder.ToPaySum < 1000)} then RK7.PerformRefObject(RK7.FindItemByCode(rkrefMaketSchemeDetails,3031)) else // there |
...
is |
...
the |
...
dish |
...
with |
...
the |
...
code " |
...
xxx" in the order |
...
if (CntDish2 > 0) then begin RK7.PerformRefObject(RK7.FindItemByCode(rkrefMaketSchemeDetails,3032)); end else // there |
...
is |
...
the |
...
dish |
...
with |
...
the |
...
code "100" |
...
and "105" in the order if (CntDish3 > 0) then begin RK7.PerformRefObject(RK7.FindItemByCode(rkrefMaketSchemeDetails,3033)); end else // |
...
there |
...
is |
...
the |
...
dish |
...
from " |
...
salad" |
...
and " |
...
drink" category in the order |
...
if (CntDish4 > 0) then
begin
RK7.PerformRefObject(RK7.FindItemByCode(rkrefMaketSchemeDetails,3034));
end;
end;
end; |
Скрипт, запрещающий продавать весовой товар, если вес меньше нормы
...
A script to prohibit selling a catch weight product if the weight is less than the norm
On the check editing form of the CheckView object, insert the script in the OnOrderVerify event:
Code Block | ||
---|---|---|
| ||
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.Официант пробивает блюдо/напиток по акции (с литерой А)
...