Checking whether a dish is included in a certain category

    var    Categ: TClassificatorGroup;
    begin
      Categ := TClassificatorGroup(getitemBycodeNum('ClassificatorGroups', CategCode));
        if SYS.ObjectInheritsFrom(TObject(it), 'TDish') then
          if Categ.IsChild(it.RefItem) then
    end
CODE

Defining the ID and name of the current station or cash register

   RK7.Cash.Ident, RK7.Cash.Name
CODE

Checking the object status in the refernce

TDiscount(TDiscountItem(it).RefItem).Status <>rsDeleted        // stActive
CODE

Checking for an empty string

   if SYS.ObjectInheritsFrom(TObject(it), 'TEmptyLine') then break;
CODE

Access to the "Alt. name" dish property

    gui.showmessage(TRK7MenuItem(TDish(AObjectAft).RefItem).altname);
CODE

Determining the "Cancelled" flag when iterating through rows

   TPrintCheckItem(it).State = disDeleted
CODE

Entering a value in the input window

   sdate:=gui.InputBox('Date of birth dd. mm. yyyy', 'Enter the guest's date of birth',", true);
CODE

Changing the order type

    procedure ProcessOperation1002320(Parameter: integer);
    begin
      if not RKCheck.Valid then Exit;
      if (GUI.CheckFormInPayMode) then exit;
      RK7.PerformRefObject(RK7.FindItemByCode(rkrefChangeableOrderTypes, 1)); // 1-order type code
    end;
CODE

Changing the order category

    procedure ProcessOperation1000813(Parameter: integer);
    var Props: TVisitOrderInfo;
    begin
      Props := TVisitOrderInfo.Create();
      try
        Props.OrderCategoryID := 0;
        RKCheck.UpdateOrderProps(Props);
      finally
        Props.Free;
      end;
     end;
CODE

Changing the guest type

    Props.GuestTypeID.
CODE

Hide the currency button if the amount is "0"

On the order editing form, specify the script for the MainSelector object in the OnSuitableItem event:

    procedure MainSelectorOnSuitableItemScript(Sender: TBasePanel; item: TReferentItem; var Suitable: boolean);
    begin
      if GUI.CheckFormInPayMode then  // if payment mode now is
      begin
        if SYS.ObjectInheritsFrom(item, 'TCurrency') then
          Suitable := Suitable and (TCurrency(item).tag <> 0); // show non-zero currencies
      end;
    end;
CODE

Implemented in versions 7.5.4.204, 7.5.5.045, 7.5.6.004

GUI.ShowMessage('Order amount: '+FloatToStr(RKCheck.CurrentOrder.UnpaidSum));
CODE

Adding a menu group when editing a receipt

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

Adding a dish to the receipt if a discount is added

    procedure CheckViewOnAfterCheckViewEdit(Sender: TObject; AEditType: TEditType; AObjectBef, AObjectAft: TObject);
    begin
       if AEditType = etInsert then
         if SYS.ObjectInheritsFrom(AObjectAft, 'TDiscountItem') then
           if (TDiscountItem(AObjectAft).Code = 3) then
             RKCheck.CreateCheckItem(rkrefMenuItems, IntToStr(143), '1');          
    end;
CODE

Changing the color of the dish in the order window

    procedure CheckViewOnGetColors(Sender: TObject; CheckItem: TObject; Selected: boolean; var Color, FontColor: TColor);
    begin
      if SYS.ObjectInheritsFrom(CheckItem, 'TDish') then begin
        if (TDish(CheckItem).Quantity = 0) and (TDish(CheckItem).State = disOpened) then begin
          // bug#10226 red color for dishes with quantity = 0
          Color := $004646FF;
          FontColor := clBlack;
        end;
      end;
    end;
    Trk7menuitem(CheckItem.RefItem).VisualType_BColor - background color
    Trk7menuitem(CheckItem.RefItem).VisualType_TextColor - font color
CODE

Displaying a previously created message when adding the first dish to an order

procedure CheckViewOnAfterCheckViewEdit(Sender: TObject; AEditType: TEditType; AObjectBef, AObjectAft: TObject);
var i, CntDish: integer;
it: TCheckItem;
begin
if SYS.ObjectInheritsFrom(AObjectAft, 'TDish') then
begin
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
CntDish := CntDish + 1;
end;
if CntDish = 1 then
gui.ShowMessage('Сообщение');
end;
end;
CODE

Compliance with the requirements of the Lithuanian Tax Inspectorate

In Lithuania, there is a law according to which cash machines of bars and restaurants should print the sums and amounts of unpaid preliminary invoices in the control tape when printing the Z report.
That is, when the common shift is closed, a report should be printed that shows the number of rejected bills and the sum of all rejected bills.
The necessary functionality is implemented in 7.05.04.148. When a bill is canceled (if the bill was printed), a record about it is saved in the PRINTCHECKS receipt table.

Such records have the following lines:

DELETED=1
ISBILL=1
IGNOREINREP=1
CODE

Fixing the amount when canceling a bill

Implemented in 7.5.5.12 and 7.05.04.148

Now, when canceling a bill (if the bill was printed), a record of it is saved in the PRINTCHECKS receipt table.

Such records have the following lines:

DELETED=1
ISBILL=1
IGNOREINREP=1
CODE