Number of service receipts = number of dishes in an order
Task: You've got Delivery RK7 and a label printer. Once an order is processed, labels are printed.
The number of dishes in the order is should be equal to the number of labels. However, service receipts are issued incorrectly, i. e. if an order contains two identical pizzas and a burger, the printer prints two labels: one for 1 burger and one for 1 pizza.
Solution: The script should be linked to the parent band (in this case, to the Dishes band).
var q: integer; begin q :=Trunc([Dishes.Number]); if q < 1 then q := 1; bndBandVirt.DataSetName := 'Virtual' + '[' + IntToStr(q)+ ']'; end
Number in Receipt
Task: It is required to add a unique number with a text into a receipt when a certain dish or dishes are added. The code is equal to the first 13 digits of the unique GUID number.
Example: Your prize code is FC58AC1A-241C. Details at adresssite.ru
If possible, the code should be framed.
Solution: Add a memo field to the Receipts band and specify the following in the Script property:
Memo52.Text := 'Your prize code '+#10#13 +copy([GUID],2,13)+#10#13 +'Details at bkcard.ru';
Instead of Memo52, indicate the name of the created memo field.
If you need to specify dishes in a receipt:
- Keep the previous script
- Uncheck the Visible property box in Memo52
- In the Dishes band, add the following to the existing script:
If [Code]=25 then memo52.visible := True;
The script means that if a receipt contains a dish having the code 25, memo52 will be shown
Script for Printing a Password in a Receipt Once the Threshold Amount is Reached
Task: To create a script that will print the Wi-Fi password once the required order amount is reached.
Solution: Add a memo field to the Receipts band and specify the following script for it:
if [Amount]>200 then Memo11.text := 'WiFi password' else Memo11.text := ''
Indicate the memo field name instead of Memo11.
Use of Print Layouts by Printers (Adjustment)
Task: There are different fiscal recorders in a restaurant (standard ones and those having the narrow tape for 36 characters). All fiscal recorders are connected to the same station via COM ports. Therefore, different print layouts should be used but the current conditions of using print layouts don't allow that.
Solution: Create a layout with the width 80 and two sheets:
- The width of the first sheet is 80.
- The width of the second sheet is 36.
Depending on the printer code you should make one of the sheets invisible by using the script located on the first page of the layout:
if [Receipts.Printer.Code]=1 then begin Document1.Visible := True; Document2.Visible := False; end; if [Receipts.Printer.Code]=2 then begin Document1.Visible := False; Document2.Visible := True; end;
Cash station forms in r_keeper 7 + CRM
Conditions: RK7 + CRM, bonus cards allowing bonus accumulation and expenditure The bonus validity period is three months.
Task 1:
To write the following text in the bill: The bonus awarded with this receipt is valid till dd.mm.yyyy.
The date is generated as the current one + three months.
Task 2:
To show the card balance in the bill and then perform mathematical operations with it.
Solution:
If you use a graphical layout, open fastreport and enter the following script:
[DayOf(Date)].[IIF+3>12,MonthOf(Now)+3-12,MonthOf(Now)+3)].[IIF+3>12,YearOf(Now)+1,YearOf(Now))]
If you use a standard layout, open the Layout Editor of r_keeper 7. In the cash station layout, insert the following script into the memo field:
var s:string; addmonths: integer; begin addmonths := 3; S := FormatDateTime('dd.',[Date]); if StrToInt(FormatDateTime('mm',[Date]))+addmonths > 12 then s := s + IntToStr(StrToInt(FormatDateTime('mm',[Date]))+ addmonths - 12) else s := s + IntToStr(StrToInt(FormatDateTime('mm',[Date]))+ addmonths); if StrToInt(FormatDateTime('mm',[Date]))+addmonths > 12 then s := s + '.' + IntToStr(StrToInt(FormatDateTime('yyyy',[Date]))+ 1) else s := s + '.' + IntToStr(StrToInt(FormatDateTime('yyyy',[Date]))); memo11.text := s; end
Different Print Types for Per Piece and Weighted Dishes
Task: When printing, it is required:
- For per piece orders: to omit the fractional part if it is equal to zero and add 'pcs'
- For weighted orders: to keep the fractional part and add 'kg' or another unit of weight from the dish settings
- For portioned orders: to indicate the number of portions without the fractional part and the weight with the fractional part in parentheses.
Solution: change memQnt to the name of the memo field showing the quantity.
case [Menuelement.Pricemode] of 0: memQnt.Text := FormatFloat('0',[Quantity])+' pcs'; 1: memQnt.Text := FormatFloat('0',[Quantity])+' ('+FormatFloat('0.####',[Menuelement.Portionweight])+' '+[Menuelement.Uom]+')'; 2: memQnt.Text := FormatFloat('0.000',[Quantity])+' '+[Menuelement.Uom]; end;