A script to hide the tips line

On the editing form of the CheckView object, insert the following script in the OnSuitableObjectScript event:

procedure CheckViewOnSuitableObjectScript(Sender: TBasePanel; Obj: TObject; var Suitable: boolean);
begin
if RKCheck.CurrentOrder.FinishedService then
if (SYS.ObjectInheritsFrom(Obj, 'TPayLine')) then
Suitable := Suitable and (TPayLine(Obj).code <> 1); // Tips code
end;

You may also hide the change line by currency type or the discount line by its code in the receipt editor:

procedure CheckViewOnSuitableObjectScript(Sender: TBasePanel; Obj: TObject; var Suitable: boolean);
var TypeCurrCode, DiscountCode: integer;
begin
TypeCurrCode := 15; // Currency type
DiscountCode := 1113; // discount code
if (SYS.ObjectInheritsFrom(Obj, 'TDiscountItem')) then
Suitable := Suitable and (TDiscountItem(Obj).Code <> DiscountCode);
if (SYS.ObjectInheritsFrom(Obj, 'TPayLine')) then
if (TPayLine(Obj).BasicSum < 0) then
Suitable := Suitable and (TCurrencyType(TCurrency(TPayLine(Obj).RefItem).MainParent).Code <> TypeCurrCode);
end;

A script to hide the change line in closed receipts

procedure CheckViewOnSuitableObjectScript(Sender: TBasePanel; Obj: TObject; var Suitable: boolean);
begin
if RKCheck.CurrentOrder.FinishedService then
if (SYS.ObjectInheritsFrom(Obj, 'TPayLine')) then
Suitable := Suitable and (TPayLine(Obj).BasicSum >= 0); // hide payments with a negative amount, i.e. change
end;
  • No labels