✌ V5 Feature Compilation

[JScript] method: JSON.parse()

https://msdn.microsoft.com/en-us/library/cc836466(v=vs.84).aspx

Example Uses:
Web Services that have JSON output … http://openweathermap.org/api
JSON data stored in SambaPOS Database


[.NET] method: xml.Parse()

Method exposed to scripting engine

var weather=xml.Parse(allxml);
return weather.Temperature.Value + nL + weather.SkyConditions.Value + nL + weather.Wind.Value;

Debugger for scripts

Local Settings > Scripting

Download Free Visual Studio …
http://www.visualstudio.com/en-us/products/free-developer-offers-vs.aspx2

Temporarily add keyword debugger inside script code.
When debugger keyword is found, the VS JIT Debugger will launch so we can step through code line-by-line.


KPI Tile example

Demonstrates various new features using JScript and Helper Functions:

tag.X()
dt.X
sql.Query('@@SQL').X

Tile Template:

{CALL:kpi.ticketCount()}

@@TicketCount

Select count(*) from Tickets where Date > '{Start}' and Date < '{End}'

JScript

function ticketCount()
{
   var thisMonthTickets = sql.Query('@@TicketCount').ThisMonth.First;
   var previousMonthTickets = sql.Query('@@TicketCount').PreviousMonth.First;
   var thisAvg = Math.round(thisMonthTickets / dt.ThisMonth.Days);
   var prevAvg = Math.round(previousMonthTickets / dt.PreviousMonth.Days);
   var inc = thisAvg > prevAvg;
   var sym = inc ? tag.Color('green').Sym('▲') : tag.Color('red').Sym('▼');
   var header = tag.Add(sym).Add(thisMonthTickets).Add('Tickets').Get();
   var footer = tag.Add(dt.PreviousMonth.MonthName).Add(previousMonthTickets).Get('tickets');
   var todayTickets = sql.Query('@@TicketCount').Today.First;
   var footer2a = (prevAvg - todayTickets) + ' more tickets needed';
   var footer2b = (todayTickets - prevAvg) + ' tickets ahead. Keep going';
   var footer2 = inc ? footer2b : footer2a;
   footer = tag.Add(footer).Linebreak().Add(footer2).Get();
   return tag.Size(30).Add(header).Linebreak().Linebreak().Size(14,footer);
}

<sparkline> Tag

Generates simple graphics inside Tiles.

<sparkline [type] [width]>1,2,3,4,5</sparkline>

[type] can be bar, line, or area


<block> Tag

Used to fine-tune Tile Layouts.

When used as the root tag, it will reset the Tile Margin to zero.
We can also set the following values:

<block [margin] [color] [alignment] [width]>

Parameters:

[margin] is comma-separated values for: Left,Top,Right,Bottom
[color] can be specified as one of: Red, #FF0000, #55FF0000
[alignment] can be one of: left, right, center ,justified
[width] sets the block width in pixels

Example:

<block 5,2,9,22 #FF0000 left 250>

Custom Keyboard improvements

CSV support using quoted values:

"1","2","3"|"4","5","6"|"7","8","9"|",","0",8

Last 8 will be a backspace as it not surrounded with double quotes.

New shortcuts:

"<ds>"          Decimal Separator.
"<enter>"       Enter key
"<space>"       Space key
"<backspace>"   Backspace key
"<tab>"         Tab key

Setting text values in the Editor:

"Accept<linebreak/>This=Yes"|"Don't Accept=No"

Clicking “Accept This” button will send “Yes” text into the editor.

Automation Command support:

"Display<linebreak/>Calculator=Execute App:Calculator"

Clicking “Display Calculator” button will execute Execute App Automation Command with Calculator as the Command Value.


POS Numberpad converted to Custom Keyboard

Change it through Menu Category Custom Keyboard setting.

Old Alpha Button Values setting for Menu Category will appear as Custom Keyboard. In the DB it appears as AlphaButtonValues.

Now we have more space to place Automation Command buttons since custom keyboards supports executing automation commands.


Multiple Menu Functionality

Change Screen Menu action implemented for changing menu inside tickets.


Display in Report Explorer setting added to custom reports to un-list widget or print only reports from reports module.


{ENTITY ACCOUNT NAME:<entity type>} Tag

Retrieves the Account Name of an Entity.


Batch Entity Creation screen improvements

Batch adding / editing / deleting entities
Displaying custom fields properly
Batch creating entities with custom fields by CSV format


Markup language for data transfer, import, export

Example, for Batch Create Products dialog:

- Name: Coke
  GroupCode: Drink
  Portions:
  - Name: Bottle
    Price: 1.00
  - Name: Can
    Price: 1.50
  Tags:
  - Name: TagName
    Value: TagValue
- Name: Fanta
  GroupCode: Drink
  Portions:
  - Name: Can
    Price: 1.50
2 Likes