Skip to content

Instantly share code, notes, and snippets.

@emreeren emreeren/fastpayment.txt
Last active Aug 29, 2015

Embed
What would you like to do?
SambaPOS Fast Payment Configuration
{"AccountScreens":null,"AccountTransactionDocumentTypes":null,"AccountTransactionTypes":null,"AccountTypes":null,"Accounts":null,"Actions":null,"AutoConfigurationTasks":[{"CreateBackup":true,"Description":"Adds \/ Removes fast payment buttons that appears under orders. Clicking a fast payment button will close ticket without need of switching to payment screen. ","Language":"en","Name":"Setup Fast Payment Buttons","SortOrder":20,"TaskData":"[{\"Action\":\"var payments = sql.Query('select Name from PaymentTypes').Join('|');\\u000d\\u000aresult = '[?Payment Type::'+payments+']'\",\"ActionType\":4,\"Condition\":null,\"Description\":\"Initialize Parameters\"},{\"Action\":\"Data.Set('op','Create');\\u000d\\u000aif(!sql.Exists(\\\"SELECT Id from PaymentTypes where Name = '[:Payment Type]'\\\"))\\u000d\\u000a{\\u000d\\u000a dlg.ShowMessage(\\\"A Payment Type named [:Payment Type] does not exists.\\\");\\u000d\\u000a result = false;\\u000d\\u000a}\\u000d\\u000aelse result = true;\",\"ActionType\":3,\"Condition\":null,\"Description\":\"Validate Payment Type\"},{\"Action\":\"if(sql.Exists(\\\"SELECT Id from AppActions where Name = 'ACM Pay Ticket by [:Payment Type]'\\\"))\\u000d\\u000a{\\u000d\\u000a var operation = dlg.AskQuestion(\\\"Fast Payment button for [:Payment Type] already exists. Do you want to Remove Fast Payment Button?\\\",\\\"Yes,No\\\");\\u000d\\u000a if(operation == 'No')\\u000d\\u000a result = false;\\u000d\\u000a else if(operation == 'Yes')\\u000d\\u000a {\\u000d\\u000a Data.Set('op','Delete');\\u000d\\u000a result = true;\\u000d\\u000a }\\u000d\\u000a}\\u000d\\u000aelse result = true;\",\"ActionType\":3,\"Condition\":null,\"Description\":\"Check if an action already created\"},{\"Action\":\"Actions:\\u000d\\u000a- Name: Close Ticket\\u000d\\u000a ActionType: CloseActiveTicket\\u000d\\u000a Parameter: \\u000d\\u000a SortOrder: -1\\u000d\\u000a- Name: ACM Pay Ticket by [:Payment Type]\\u000d\\u000a ActionType: PayTicket\\u000d\\u000a Parameter: '[{\\\"Key\\\":\\\"PaymentTypeName\\\",\\\"Value\\\":\\\"[:Payment Type]\\\"}]'\\u000d\\u000a- Name: Execute Automation Command\\u000d\\u000a ActionType: ExecuteAutomationCommand\\u000d\\u000a Parameter: '[{\\\"Key\\\":\\\"AutomationCommandName\\\",\\\"Value\\\":\\\"[:Command Name]\\\"},{\\\"Key\\\":\\\"CommandValue\\\",\\\"Value\\\":\\\"[:Command Value]\\\"}]'\\u000d\\u000aRules:\\u000d\\u000a- Name: ACM Fast [:Payment Type] Rule\\u000d\\u000a EventName: AutomationCommandExecuted\\u000d\\u000a RuleConstraints: '[{\\\"L\\\":\\\"AutomationCommandName\\\",\\\"O\\\":\\\"Equal\\\",\\\"R\\\":\\\"ACM Fast Pay Ticket [:Payment Type]\\\"}]'\\u000d\\u000a Actions:\\u000d\\u000a - Name: ACM Pay Ticket by [:Payment Type]\\u000d\\u000a SortOrder: 10\\u000d\\u000a - Name: Execute Automation Command\\u000d\\u000a ParameterValues: Command Name=ACM Close Settled Ticket\\u000d\\u000a SortOrder: 20\\u000d\\u000a AppRuleMaps:\\u000d\\u000a - {}\\u000d\\u000a- Name: ACM Close Settled Ticket Rule\\u000d\\u000a EventName: AutomationCommandExecuted\\u000d\\u000a RuleConstraints: '[{\\\"L\\\":\\\"AutomationCommandName\\\",\\\"O\\\":\\\"Equal\\\",\\\"R\\\":\\\"ACM Close Settled Ticket\\\"},{\\\"L\\\":\\\"[=TN(''{REMAINING TOTAL}'')]\\\",\\\"O\\\":\\\"Equal\\\",\\\"R\\\":\\\"0\\\"}]'\\u000d\\u000a Actions:\\u000d\\u000a - Name: Close Ticket\\u000d\\u000a ParameterValues: \\u000d\\u000a SortOrder: 10\\u000d\\u000a AppRuleMaps:\\u000d\\u000a - {}\\u000d\\u000aAutomationCommands:\\u000d\\u000a- Name: ACM Fast Pay Ticket [:Payment Type]\\u000d\\u000a ButtonHeader: [:Payment Type]\\u000d\\u000a FontSize: 26\\u000d\\u000a SortOrder: 2\\u000d\\u000a ClearSelection: true\\u000d\\u000a ExecuteOnce: true\\u000d\\u000a AutomationCommandMaps:\\u000d\\u000a - DisplayUnderTicket: true\\u000d\\u000a EnabledStates: 'New Orders,Unpaid,Locked'\\u000d\\u000a VisibleStates: '*'\",\"ActionType\":0,\"Condition\":\"Data.Get('op') == 'Create'\",\"Description\":\"Create Button if Create\"},{\"Action\":\"Delete from AppActions Where Name = 'ACM Pay Ticket by [:Payment Type]'\\u000d\\u000ago\\u000d\\u000aDelete from AppRules Where Name = 'ACM Fast [:Payment Type] Rule'\\u000d\\u000ago\\u000d\\u000aDelete from AutomationCommands Where Name = 'ACM Fast Pay Ticket [:Payment Type]'\\u000d\\u000ago\",\"ActionType\":2,\"Condition\":\"Data.Get('op') == 'Delete'\",\"Description\":\"Delete Button if Delete\"},{\"Action\":\"Update AutomationCommands set SortOrder = 10 Where Name = 'Close Ticket'\",\"ActionType\":2,\"Condition\":null,\"Description\":\"Push Close button to End\"}]"},{"CreateBackup":true,"Description":"Add or Remove operator Confirmation for a Payment Type.","Language":"en","Name":"Setup Confirmation for Payment","SortOrder":10,"TaskData":"[{\"Action\":\"var payments = sql.Query('select Name from PaymentTypes').Join('|');\\u000d\\u000aresult = '[?Payment Type::'+payments+']'\",\"ActionType\":4,\"Condition\":null,\"Description\":\"Initialize Parameters\"},{\"Action\":\"if(!sql.Exists(\\\"SELECT Id from PaymentTypes where Name = '[:Payment Type]'\\\"))\\u000d\\u000a{\\u000d\\u000a dlg.ShowMessage(\\\"A Payment Type named [:Payment Type] does not exists.\\\");\\u000d\\u000a result = false;\\u000d\\u000a}\\u000d\\u000aelse result = true;\",\"ActionType\":3,\"Condition\":null,\"Description\":\"Validate Payment Type\"},{\"Action\":\"if(api.PaymentType('[:Payment Type]').Processors('Ask Payment Confirmation').Exists())\\u000d\\u000a{\\u000d\\u000a var answer = dlg.AskQuestion('Confirmation for [:Payment Type] already exists. Remove Confirmation?','Yes,No');\\u000d\\u000a if (answer == 'Yes') \\u000d\\u000a {\\u000d\\u000a result = true;\\u000d\\u000a Data.Set('op','Delete');\\u000d\\u000a }\\u000d\\u000a else \\u000d\\u000a {\\u000d\\u000a result = false;\\u000d\\u000a }\\u000d\\u000a}\\u000d\\u000aelse result = true;\",\"ActionType\":3,\"Condition\":null,\"Description\":\"Select Operation\"},{\"Action\":\"api.PaymentType('[:Payment Type]').Processors('Ask Payment Confirmation').Create();\\u000d\\u000a\",\"ActionType\":1,\"Condition\":\"Data.Get('op') != 'Delete'\",\"Description\":\"Create Confirmation if not Delete\"},{\"Action\":\"api.PaymentType('[:Payment Type]').Processors('Ask Payment Confirmation').Delete();\",\"ActionType\":1,\"Condition\":\"Data.Get('op') == 'Delete'\",\"Description\":\"Remove Confirmation if Delete\"}]"},{"CreateBackup":true,"Description":"Setup a printing job that works automatically when a payment made.","Language":"en","Name":"Automatic Print on Payment","SortOrder":30,"TaskData":"[{\"Action\":\"var payments = sql.Query('select Name from PaymentTypes').Join('|');\\u000d\\u000aresult = '[?Payment Type::'+payments+']';\",\"ActionType\":4,\"Condition\":null,\"Description\":\"Select Payment Type\"},{\"Action\":\"var printJobs = sql.Query('select Name from PrintJobs').Join('|');\\u000d\\u000aresult = '[?Print Job::'+printJobs+']';\",\"ActionType\":4,\"Condition\":null,\"Description\":\"Select Print Job\"},{\"Action\":\"if(sql.Exists(\\\"SELECT Id from AppRules where Name = 'ACM Auto Print Rule for [:Payment Type]'\\\"))\\u000d\\u000a{\\u000d\\u000a var operation = dlg.AskQuestion(\\\"Auto Print for [:Payment Type] already exists. Do you want to Remove Auto Print?\\\",\\\"Yes,No\\\");\\u000d\\u000a if(operation == 'No')\\u000d\\u000a result = false;\\u000d\\u000a else if(operation == 'Yes')\\u000d\\u000a {\\u000d\\u000a Data.Set('op','Delete');\\u000d\\u000a result = true;\\u000d\\u000a }\\u000d\\u000a}\\u000d\\u000aelse result = true;\",\"ActionType\":3,\"Condition\":null,\"Description\":\"Check if already created\"},{\"Action\":\"Actions:\\u000d\\u000a- Name: ACM Execute Auto Print for [:Payment Type]\\u000d\\u000a ActionType: ExecutePrintJob\\u000d\\u000a Parameter: '[{\\\"Key\\\":\\\"PrintJobName\\\",\\\"Value\\\":\\\"[:Print Job]\\\"},{\\\"Key\\\":\\\"PrintTicket\\\",\\\"Value\\\":\\\"True\\\"},{\\\"Key\\\":\\\"TicketIds\\\",\\\"Value\\\":null},{\\\"Key\\\":\\\"HighPriority\\\",\\\"Value\\\":null},{\\\"Key\\\":\\\"OrderStateName\\\",\\\"Value\\\":null},{\\\"Key\\\":\\\"OrderState\\\",\\\"Value\\\":null},{\\\"Key\\\":\\\"OrderStateValue\\\",\\\"Value\\\":null},{\\\"Key\\\":\\\"OrderTagName\\\",\\\"Value\\\":null},{\\\"Key\\\":\\\"OrderTagValue\\\",\\\"Value\\\":null},{\\\"Key\\\":\\\"IgnoreSelectedOrders\\\",\\\"Value\\\":\\\"True\\\"},{\\\"Key\\\":\\\"Copies\\\",\\\"Value\\\":null}]'\\u000d\\u000aRules:\\u000d\\u000a- Name: ACM Auto Print Rule for [:Payment Type]\\u000d\\u000a EventName: PaymentProcessed\\u000d\\u000a RuleConstraints: '[{\\\"L\\\":\\\"PaymentTypeName\\\",\\\"O\\\":\\\"Equal\\\",\\\"R\\\":\\\"[:Payment Type]\\\"}]'\\u000d\\u000a Tags: \\u000d\\u000a Actions:\\u000d\\u000a - Name: ACM Execute Auto Print for [:Payment Type]\\u000d\\u000a ParameterValues: \\u000d\\u000a SortOrder: 10\\u000d\\u000a AppRuleMaps:\\u000d\\u000a - {}\\u000d\\u000a\",\"ActionType\":0,\"Condition\":\"Data.Get('op') != 'Delete'\",\"Description\":\"Create print rule and action\"},{\"Action\":\"Delete from AppActions Where Name = 'ACM Execute Auto Print for [:Payment Type]'\\u000d\\u000ago\\u000d\\u000aDelete from AppRules Where Name = 'ACM Auto Print Rule for [:Payment Type]'\\u000d\\u000ago\",\"ActionType\":2,\"Condition\":\"Data.Get('op') == 'Delete'\",\"Description\":\"Remove rule if Delete\"}]"}],"AutomationCommands":null,"CalculationSelectors":null,"CalculationTypes":null,"CustomReports":null,"Departments":null,"EntityScreens":null,"EntityTypes":null,"Numerators":null,"OrderTagGroups":null,"PaymentTypes":null,"PrintJobs":null,"PrinterTemplates":null,"Printers":null,"ProgramSettingValues":null,"Rules":null,"Scripts":null,"States":null,"TaskTypes":null,"TicketTagGroups":null,"TicketTypes":null,"Triggers":null}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.