-
Notifications
You must be signed in to change notification settings - Fork 0
/
DemoApplForm.sim
175 lines (175 loc) · 46.5 KB
/
DemoApplForm.sim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
{
"pages": [
{
"Name": "pcMinistryEconomyPage",
"Conditions": "true",
"Menu": "Applications",
"Value": "SetTitle(Ministry Economy)\r\nDiv(Class: content-wrapper){\r\n If(GetVar(application_id)){\r\n DBFind(Name:\"pc_license_application\",Source:src_lic).Vars(app).WhereId(#application_id#)\r\n DBFind(Name: \"pcproperty\",Source:src_prop).Columns(\"id\").Vars(property)\r\n Div(Class: col-md-6 panel-default data-sweet-alert){\r\n Div(Class: list-group-item){\r\n Span(Class: h2,Body: Ministry Economy)\r\n Div(Class: panel-body pt0){\r\n DBFind(Name:pcproperty,Source: serch_prop).Custom(typ){EcosysParam(business_scope, #type#)}.Custom(Maps){Map(Value: `#coords#`, MapType: \"satellite\", Hmap: 400)}.WhereId(\"#app_business_premises#\")\r\n Table(Source: serch_prop,Columns:\"Location on the map=Maps\")\r\n }\r\n }\r\n }\r\n Div(Class: col-md-6 panel-default data-sweet-alert){\r\n Div(Class: list-group-item){\r\n Span(Class: h3,Body: Application id: #app_id#)\r\n Div(Class: panel-body){\r\n Div(Class: well box-placeholder){\r\n Span(Class: h4 text-bold, Body: List of shareholders)\r\n DBFind(Name: \"pc_app_shareholders\", Source: sh).Columns(\"id,person_id,shareholding,name,person_status\").Where(\"application_id=#app_id# and status != 0\").Order(id)\r\n ForList(sh){\r\n P(Class: h4 pclass,Body:\"#name# - #shareholding#%\")\r\n }\r\n }\r\n }\r\n Span(Class: h3 ,Body: \"Company detail\")\r\n Div(Class: clearfix){\r\n Div(Class: pull-left){\r\n P(Class: h4 text-bold, Body: \"Company name:\")\r\n }\r\n Div(Class: pull-right){\r\n P(Class: h4, Body: \"#app_company_name#\")\r\n }\r\n }\r\n Div(Class: clearfix){\r\n Div(Class: pull-left){\r\n P(Class: h4 text-bold, Body: \"Business scope:\")\r\n }\r\n Div(Class: pull-right){\r\n P(Class: h4, Body: EcosysParam(business_scope, #app_business_scope#))\r\n }\r\n }\r\n Div(Class: clearfix){\r\n Div(Class: pull-left){\r\n P(Class: h4 text-bold, Body: \"Bussiness premises:\")\r\n }\r\n Div(Class: pull-right){\r\n DBFind(\"pcproperty\").Columns(\"name\").Vars(pref).WhereId(\"#app_business_premises#\")\r\n P(Class: h4, Body:\"#pref_name#\")\r\n }\r\n }\r\n Div(Class: clearfix){\r\n Div(Class: pull-left){\r\n Button(Denial,Contract:pcDenialEco,Class: btn btn-danger,Params:\"notific_id = #notific_id#,application_id = #application_id#\",Page:demoApplicationForm)\r\n }\r\n Div(Class: pull-right){\r\n Button(Approve,Contract:pcConfirmEco,Class:btn btn-success,Params:\"notific_id = #notific_id#,application_id = #application_id#\",Page:demoApplicationForm)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}"
},
{
"Name": "pcPolicePage",
"Conditions": "true",
"Menu": "Applications",
"Value": "SetTitle(Police)\r\nDiv(Class: content-wrapper){\r\n If(GetVar(application_id)){\r\n DBFind(Name:\"pc_license_application\",Source:src_lic).Vars(app).WhereId(#application_id#)\r\n DBFind(Name: \"pcproperty\",Source:src_prop).Columns(\"id,name\").Vars(property).WhereId(\"#app_business_premises#\")\r\n Div(Class: col-md-6 panel-default data-sweet-alert){\r\n Div(Class: list-group-item){\r\n Span(Class: h2,Body: Police Departament)\r\n Div(Class: panel-body pt0){\r\n DBFind(Name:pcproperty,Source: serch_prop).Custom(typ){EcosysParam(business_scope, #type#)}.Custom(Maps){Map(Value: `#coords#`, MapType: \"satellite\", Hmap: 400)}.WhereId(\"#app_business_premises#\")\r\n Table(Source: serch_prop,Columns:\"Location on the map=Maps\")\r\n }\r\n }\r\n }\r\n Div(Class: col-md-6 panel-default data-sweet-alert){\r\n Div(Class: list-group-item){\r\n Span(Class: h3,Body: Application id: #app_id#)\r\n Div(Class: panel-body){\r\n Div(Class: well box-placeholder){\r\n Span(Class: h4 text-bold, Body: List of shareholders)\r\n DBFind(Name: \"pc_app_shareholders\", Source: sh).Columns(\"id,person_id,shareholding,name,person_status\").Where(\"application_id=#app_id# and status != 0\").Order(id)\r\n ForList(sh){\r\n P(Class: h4 pclass,Body:\"#name# - #shareholding#%\")\r\n }\r\n }\r\n }\r\n Span(Class: h3 ,Body: \"Company detail\")\r\n Div(Class: clearfix){\r\n Div(Class: pull-left){\r\n P(Class: h4 text-bold, Body: \"Company name:\")\r\n }\r\n Div(Class: pull-right){\r\n P(Class: h4, Body: \"#app_company_name#\")\r\n }\r\n }\r\n Div(Class: clearfix){\r\n Div(Class: pull-left){\r\n P(Class: h4 text-bold, Body: \"Business scope:\")\r\n }\r\n Div(Class: pull-right){\r\n P(Class: h4, Body: EcosysParam(business_scope, #app_business_scope#))\r\n }\r\n }\r\n Div(Class: clearfix){\r\n Div(Class: pull-left){\r\n P(Class: h4 text-bold, Body: \"Bussiness premises:\")\r\n }\r\n Div(Class: pull-right){\r\n P(Class: h4, Body:\"#property_name#\")\r\n }\r\n }\r\n Div(Class: clearfix){\r\n Div(Class: pull-left){\r\n Button(Denial,Contract:pcDenial,Class: btn btn-danger,Params:\"notific_id=#notific_id#,application_id = #application_id#\",Page:demoApplicationForm)\r\n }\r\n Div(Class: pull-right){\r\n Button(Approve,Contract:pcConfirmPolice,Class:btn btn-success,Params:\"notific_id=#notific_id#,application_id = #application_id#\",Page:demoApplicationForm)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}"
},
{
"Name": "demoApplicationForm",
"Conditions": "true",
"Menu": "Applications",
"Value": "SetTitle(\"Application Form\")\r\nDiv(Class: content-wrapper){\r\n DBFind(Name: members, Source: ava).Columns(\"id,member_name,avatar\").Custom(mem_shar){[#id#] #member_name#}.Where(\"id!=0\")\r\n SetVar(Name: app_company_name, Value: \"\")\r\n SetVar(Name: app_id, Value:\"0\")\r\n DBFind(Name: pc_license_application, Source: app).Vars(app).Where(\"company_founder=#key_id# and status != 4\")\r\n If(#app_status# > 0){\r\n Div(Class: col-md-6 panel-default data-sweet-alert){\r\n Div(Class: list-group-item){\r\n Span(Class: h3,Body: Application id: #app_id#)\r\n Div(Class: panel-body){\r\n Div(Class: well box-placeholder){\r\n Span(Class: h4 text-bold, Body: List of shareholders)\r\n DBFind(Name: pc_app_shareholders, Source: sh).Columns(\"id,person_id,shareholding,name,person_status\").Where(\"application_id=#app_id# and status != 0\").Order(id)\r\n ForList(sh){\r\n P(Class: h4 pclass,Body:\"#name# - #shareholding#%\")\r\n }\r\n }\r\n Span(Class: h3 ,Body: \"Company detail\")\r\n Div(Class: clearfix){\r\n Div(Class: pull-left){\r\n P(Class: h4 text-bold, Body: \"Company name:\")\r\n }\r\n Div(Class: pull-right){\r\n P(Class: h4, Body: \"#app_company_name#\")\r\n }\r\n }\r\n Div(Class: clearfix){\r\n Div(Class: pull-left){\r\n P(Class: h4 text-bold, Body: \"Business scope:\")\r\n }\r\n Div(Class: pull-right){\r\n P(Class: h4, Body: EcosysParam(business_scope, #app_business_scope#))\r\n }\r\n }\r\n Div(Class: clearfix){\r\n Div(Class: pull-left){\r\n P(Class: h4 text-bold, Body: \"Bussiness premises:\")\r\n }\r\n Div(Class: pull-right){\r\n DBFind(\"pcproperty\").Columns(\"name\").Vars(pref).WhereId(\"#app_business_premises#\")\r\n P(Class: h4, Body:\"#pref_name#\")\r\n }\r\n }\r\n }\r\n }\r\n }\r\n Div(Class: col-md-6 panel-default data-sweet-alert){\r\n Div(panel-heading, Div(panel-title, Overall progress))\r\n Div(Class: panel panel-body){\r\n Div(Class: \"processfs\"){\r\n If(#app_name_reservation#==2){\r\n Div(){\r\n Span(Class: \"faProcBellDenied\", Body: Em(Class: fa fa-bell))\r\n Span(Class:text-danger, Body: Company name is not approved. Enter the new name.)\r\n Form(Class: d-inline-block){\r\n Input(Name: business_scope, Class: hidden, Type: text, Placeholder: text,Value: #app_business_scope#)\r\n Input(Name: business_premises, Class: hidden, Type: text, Placeholder: text,Value: #app_business_premises#)\r\n Input(Name: id, Class: hidden, Type: text, Placeholder: text,Value: #app_id#)\r\n Div(Class: input-group){\r\n Input(Name: company_name, Class: form-control, Type: text, Placeholder: text,Value: #app_company_name#)\r\n }\r\n Div(Class: input-group-btn){\r\n Button(Save,Contract:pcApplicationFormEdit,Class:btn btn-default bl0 radius-tl-clear radius-bl-clear,Page: demoApplicationForm)\r\n }\r\n }\r\n }\r\n }.ElseIf(#app_name_reservation#==1){\r\n Div(){Span(Class:\"faLineSucces\")}\r\n Span(Class:\"faProcBellSuccess\",Body: Em(Class:fa fa-bell))\r\n Span(Class:text-success,Body: Company name is approved)\r\n \r\n }\r\n }\r\n Div(Class: \"process\"){\r\n If(#app_police_inspection#==2){\r\n \r\n Span(Class: \"faProcBellDenied\",Body: Em(Class:fa fa-bell))\r\n Span(Class: text-danger,Body:\" No Police inspection.\") \r\n }.ElseIf(#app_police_inspection#==1){\r\n Div(){Span(Class:\"faLineSucces\")}\r\n Span(Class:\"faProcBellSuccess\",Body: Em(Class:fa fa-bell))\r\n Span(Class:text-success, Body:\"Police inspection.\") \r\n } \r\n }\r\n Div(Class: \"process\"){\r\n If(#app_ministry_economy#==2){\r\n Span(Class: \"faProcBellDenied\",Body: Em(Class:fa fa-bell))\r\n Span(Class: text-danger, Body:\"No Decision of Ministry Economy.\") \r\n }.ElseIf(#app_ministry_economy#==1){\r\n Div(){Span(Class:\"faLineSucces\")}\r\n Span(Class:\"faProcBellSuccess\",Body: Em(Class:fa fa-bell))\r\n Span(Class:text-success, Body:\"Decision of Ministry Economy.\") \r\n }\r\n }\r\n Div(Class: \"process\"){\r\n If(#app_status# > 1){\r\n If(#app_status# == 3){\r\n If(#app_company_id# != 0){\r\n Span(Class:\"faProcBellInfo\", Body: Em(Class:fa fa-bell))\r\n Span(Class:text-info, Body: Company #app_company_name# registered DateTime(#app_date_end#, YYYY.MM.DD) - ID = #app_company_id#)\r\n }.Else{\r\n Span(Class:\"faProcBellDenied\", Body: Em(Class:fa fa-bell))\r\n Span(Class:text-danger, Body: Registration is denied DateTime(#app_date_end#, YYYY.MM.DD)) \r\n }\r\n }\r\n }\r\n }\r\n Div(Class: panel-footer){\r\n Div(Class: clearfix){\r\n Div(Class: pull-right){\r\n If(#app_company_founder#==#key_id#){\r\n If(#app_status# > 1){\r\n Form(){\r\n Input(Name:application_id, Class: hidden, Type: text, Placeholder: text,Value: #app_id#)\r\n Button(New,Contract:pcNewApplication,Class:btn btn-primary,Page: demoApplicationForm)\r\n }\r\n }.Else{\r\n SetVar(note_page_name=\"\")\r\n Form(){\r\n Input(Name:application_id, Class: hidden, Type: text, Placeholder: text,Value: #app_id#)\r\n Button(Check,Class:btn btn-primary,Page: demoApplicationForm)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }.Else{\r\n Div(Class:col-md-6 panel-primary data-sweet-alert){\r\n Div(Class: panel-heading panel-title,Body: \"Application Form\")\r\n If(#app_id# != 0){\r\n DBFind(Name: pc_app_shareholders, Source:sh).Columns(\"id,person_id,shareholding,name,person_status,application_id\").Where(\"application_id=#app_id# and status!=0\").Order(\"id\")\r\n Form(){\r\n Div(Class: list-group-item){\r\n ForList(Source: sh){\r\n Div(Class: row df f-valign){\r\n Div(Class: col-md-3 mt-sm text-right){\r\n If(#person_status#!=4){\r\n Label(Name : #name#)\r\n }.Else{\r\n Label(Name : #name#)\r\n Span(Class: h4, Body:\"Person is forbidden to conduct business!\") \r\n }\r\n }\r\n Div(Class: col-md-7 mt-sm text-center){\r\n \r\n Input(Name:share, Class: \"form-control\", Type: int, Placeholder: text,Value: #shareholding#)\r\n Input(Name:idshare, Class: \"hidden\", Type: text, Placeholder: text,Value: #id#)\r\n }\r\n Div(Class: col-md-2 mt-sm){\r\n Div(Class: clearfix){\r\n Div(Class: pull-right){\r\n Button(Delete,Contract:pcAppShareholdersDel,Class:btn btn-default,Params:\"Id=#id#,application_id=#app_id#\",Page:demoApplicationForm).Alert(Text:Are you sure you want to delete?,ConfirmButton:Confirm,CancelButton:Cancel)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n Input(Name:share, Class: \"hidden\", Type: int, Placeholder: text,Value:\"0\")\r\n Input(Name:idshare, Class: \"hidden\", Type: text, Placeholder: text,Value:\"0\")\r\n Div(Class: clearfix){\r\n Div(Class: pull-right){\r\n Button(Save,Class: btn btn-primary,Contract: pcShareholding,Params: \"Shareholding=Val(share),Id=Val(idshare)\",Page:\"demoApplicationForm\")\r\n }\r\n }\r\n }\r\n }\r\n Form(){\r\n Div(Class: list-group-item){\r\n Div(Class: row df f-valign){\r\n Div(Class: col-md-3 mt-sm text-right){\r\n Label(\"Add shareholder ID\")\r\n }\r\n Div(Class: col-md-7 mt-sm text-center){\r\n Select(Name: person_id,Source: ava,NameColumn:mem_shar ,ValueColumn: id)\r\n }\r\n Div(Class: col-md-2 mt-sm){\r\n Input(Name:application_id, Class: hidden, Type: text, Placeholder: text,Value: #app_id#)\r\n Button(Add,Contract:pcAppShareholders,Class:btn btn-default pull-right,Params:\"person_id=Val(person_id)\",Page:demoApplicationForm)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n Form(){\r\n Div(Class: list-group-item){\r\n Div(Class: row df f-valign){\r\n Div(Class: col-md-3 mt-sm text-right){\r\n Label(\"Company Name\")\r\n }\r\n Div(Class: col-md-9 mt-sm text-center){\r\n Input(Name:company_name,Type:text,Class:form-control m-b, Value: #app_company_name#)\r\n }\r\n }\r\n }\r\n Div(Class: list-group-item){\r\n Div(Class: row df f-valign){\r\n Div(Class: col-md-3 mt-sm text-right){\r\n Label(\"Business Scope\")\r\n }\r\n Div(Class: col-md-9 mt-sm text-center){\r\n EcosysParam(Name:business_scope, Source:src_scope)\r\n Select(Name:business_scope,Source:src_scope,NameColumn:\"name\", ValueColumn: \"id\", Value: #app_business_scope#)\r\n }\r\n }\r\n Div(Class: row df f-valign){\r\n Div(Class: col-md-3 mt-sm text-right){\r\n Label(\"Business premises\")\r\n }\r\n Div(Class: col-md-9 mt-sm text-center){\r\n DBFind(Name: pcproperty, Source: src_property).Where(\"del=0\")\r\n Select(Name:business_premises,Source:src_property,NameColumn:\"name\",ValueColumn:\"id\",Value:#app_business_premises# )\r\n }\r\n }\r\n }\r\n Input(Name: id, Class: hidden, Type: text,Placeholder: text,Value:#app_id#)\r\n Div(Class: panel-footer){\r\n Div(Class: clearfix){\r\n Div(Class: pull-right){\r\n If(#app_company_name# != \"\"){\r\n Button(Edit,Contract:pcApplicationFormEdit,Class:btn btn-default btn-pill-left,Page: demoApplicationForm)\r\n Button(Send,Contract:pcApplicationFormSend,Class:btn btn-primary btn-pill-right,Params:\"id=#app_id#,Shareholding=share,Id=idshare\",Page:demoApplicationForm)\r\n }.Else{\r\n Button(Create,Contract:pcApplicationForm,Class:btn btn-primary,Page:demoApplicationForm,PageParams:\"app_business_premises=Val(business_premises),app_company_name=Val(company_name),app_business_scope=Val(business_scope)\")\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n If(!GetVar(#app_status#)){\r\n Div(Class: col-md-6 panel panel-default data-sweet-alert){\r\n Div(Class: panel-heading){\r\n Div(Class: panel-title,Body: Overall progress)\r\n }\r\n Div(Class: panel-body){\r\n Div(Class: \"processfs\"){\r\n Div(){Span(Class:\"faLine\")}\r\n Span(Class:\"faProcBell\",Body: Em(Class:fa fa-bell))\r\n Span(Class:,Body: Approve company name)\r\n }\r\n Div(Class: \"process\"){\r\n Div(){Span(Class:\"faLine\")}\r\n Span(Class:\"faProcBell\",Body: Em(Class:fa fa-bell))\r\n Span(Class:,Body:Police inspection)\r\n }\r\n Div(Class: \"process\"){\r\n Span(Class:\"faProcBell\",Body: Em(Class:fa fa-bell))\r\n Span(Class:,Body:Decision of Ministry Economy)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n If(#app_company_founder#==#key_id#){\r\n If(GetVar(app_id)){\r\n Form(){\r\n Input(Name: application_id,Class: hidden,Type: text,Placeholder: text,Value: #app_id#)\r\n Button(Reset,Contract: pcCancel,Class: btn btn-default btn-xs ml-lg,Page:demoApplicationForm)\r\n }\r\n }\r\n }\r\n}"
},
{
"Name": "demoProperty",
"Conditions": "true",
"Menu": "Applications",
"Value": "SetTitle(Property)\r\nDiv(Class: content-wrapper){\r\n DBFind(Name:pcproperty,Source: src_prop).Custom(typ){EcosysParam(business_scope, #type#)}.Custom(Maps){Map(Value: `#coords#`, MapType: \"satellite\", Hmap: 150)}.Where(del=0)\r\n Div(Class:col-md-12 panel panel-primary data-sweet-alert){\r\n Table(Source: src_prop,Columns:\"ID=id,Location on the map=Maps,Address=name,Owner=member_id,Type=typ\")\r\n }\r\n}"
},
{
"Name": "demoCompanies",
"Conditions": "true",
"Menu": "Applications",
"Value": "SetTitle(Companies)\r\nDiv(Class: content-wrapper){\r\n Div(Class: col-md-12 panel panel-primary data-sweet-alert){\r\n Form(){\r\n Div(panel-heading, Div(Class:panel-title, Registry of Companies))\r\n Div(Class: list-group-item){\r\n Div(Class: table-responsive){\r\n DBFind(Name:pc_companies,Source: src_prop).Custom(type){EcosysParam(business_scope, #business_scope#)}.Custom(Reg_date){DateTime(#date_start#,DD.MM.YYYY HH:MI)}.Where(delete=0)\r\n Table(Source: src_prop,Columns:\"ID=id,Company name = company_name, Company founder = company_founder,Type = type,Registration Date=Reg_date\")\r\n }\r\n }\r\n }\r\n }\r\n\r\n Div(Class: col-md-12 panel panel-primary data-sweet-alert){\r\n Form(){\r\n Div(panel-heading, Div(Class:panel-title, Registry of Shareholders))\r\n Div(Class: list-group-item){\r\n Div(Class: table-responsive){\r\n DBFind(Name:pc_shareholders,Source: src_shar).Custom(founder).Custom(type){EcosysParam(business_scope, #business_scope#)}.Custom(Reg_date){DateTime(#date_start#,DD.MM.YYYY HH:MI)}.Where(delete=0)\r\n Table(Source: src_shar,Columns:\"ID=id,Company name = company_name,Name=person_name,Registration Date=#Reg_date#,%=shareholding\")\r\n }\r\n }\r\n }\r\n }\r\n}"
}
],
"blocks": [],
"menus": [
{
"Name": "Applications",
"Conditions": "true",
"Value": "MenuItem(\r\n Icon: \"icon-grid\",\r\n Page: \"demoApplicationForm\",\r\n Title: \"Application Form\"\r\n)\r\nMenuItem(\r\n Icon: \"icon-globe\",\r\n Page: \"demoProperty\",\r\n Title: \"Property\"\r\n)\r\nMenuItem(\r\n Icon: \"icon-briefcase\",\r\n Page: \"demoCompanies\",\r\n Title: \"Companies\"\r\n)"
}
],
"parameters": [
{
"Name": "business_scope",
"Value": "Agriculture,Financial services,Entertainment and mass media,Industrial manufacturing,Real estate,Retail,Transportation,Utilities,Service businesses",
"Conditions": "ContractConditions(\"MainCondition\")"
},
{
"Name": "stylesheet",
"Value": "body {\n\t\t /* You can define your custom styles here or create custom CSS rules */\n\t\t}\n\n.process{\n\tdisplay: flex;\n\t-webkit-box-orient: horizontal;\n\t-webkit-box-direction: normal;\n\tflex-flow: row nowrap;\n\t-webkit-box-pack: start;\n\tjustify-content: flex-start;\n\talign-content: center;\n\t-webkit-box-align: center;\n\talign-items: center;\n\topacity: 0.7;\n\tfont-size: 22px;\n\tmargin-top: 22px;\n}\n.processfs{\n\tdisplay: flex;\n\t-webkit-box-orient: horizontal;\n\t-webkit-box-direction: normal;\n\tflex-flow: row nowrap;\n\t-webkit-box-pack: start;\n\tjustify-content: flex-start;\n\talign-content: center;\n\t-webkit-box-align: center;\n\talign-items: center;\n\topacity: 0.7;\n\tfont-size: 22px;\n}\n.faProcBell{\n\tdisplay: flex;\n\t-webkit-box-orient: horizontal;\n\t-webkit-box-direction: normal;\n\tflex-flow: row nowrap;\n\t-webkit-box-pack: center;\n\tjustify-content: center;\n\t-webkit-box-align: center;\n\talign-items: center;\n\tposition: relative;\n\tmin-width: 30px;\n\tmin-height: 30px;\n\tmax-width: 30px;\n\tmax-height: 30px;\n\tborder-radius: 50%;\n\tbackground-color: #7f7f7f;\n\tfont-size: 16px;\n\tcolor: #ffffff!important;\n\tmargin-right: 15px;\n}\n.faProcBellSuccess{\n\tdisplay: flex;\n\t-webkit-box-orient: horizontal;\n\t-webkit-box-direction: normal;\n\tflex-flow: row nowrap;\n\t-webkit-box-pack: center;\n\tjustify-content: center;\n\t-webkit-box-align: center;\n\talign-items: center;\n\tposition: relative;\n\tmin-width: 30px;\n\tmin-height: 30px;\n\tmax-width: 30px;\n\tmax-height: 30px;\n\tborder-radius: 50%;\n\tbackground-color: limegreen;\n\tfont-size: 16px;\n\tcolor: #ffffff!important;\n\tmargin-right: 15px;\n}\n.faProcBellDenied{\n\tdisplay: flex;\n\t-webkit-box-orient: horizontal;\n\t-webkit-box-direction: normal;\n\tflex-flow: row nowrap;\n\t-webkit-box-pack: center;\n\tjustify-content: center;\n\t-webkit-box-align: center;\n\talign-items: center;\n\tposition: relative;\n\tmin-width: 30px;\n\tmin-height: 30px;\n\tmax-width: 30px;\n\tmax-height: 30px;\n\tborder-radius: 50%;\n\tbackground-color: red;\n\tfont-size: 16px;\n\tcolor: #ffffff!important;\n\tmargin-right: 15px;\n}\n.faProcBellInfo{\n\tdisplay: flex;\n\t-webkit-box-orient: horizontal;\n\t-webkit-box-direction: normal;\n\tflex-flow: row nowrap;\n\t-webkit-box-pack: center;\n\tjustify-content: center;\n\t-webkit-box-align: center;\n\talign-items: center;\n\tposition: relative;\n\tmin-width: 30px;\n\tmin-height: 30px;\n\tmax-width: 30px;\n\tmax-height: 30px;\n\tborder-radius: 50%;\n\tbackground-color: deepskyblue;\n\tfont-size: 16px;\n\tcolor: #ffffff!important;\n\tmargin-right: 15px;\n}\n.faLine {\n\tdisplay:block;\n\topacity: 0.7;\n\tcontent: \"\";\n\tposition: absolute;\n\tbottom: calc(100% +2px);\n\twidth: 2px;\n\theight: 40px;\n\tbackground-color: #7f7f7f;\n\tmargin-left: 14px;\n}\n.faLineSucces {\n\tdisplay: block;\n\topacity: 0.7;\n\tcontent: \"\";\n\tposition: absolute;\n\tbottom: calc(100% +2px);\n\twidth: 2px;\n\theight: 40px;\n\tbackground-color: limegreen;\n\tmargin-left: 14px;\n}",
"Conditions": "ContractConditions(\"MainCondition\")"
}
],
"languages": [],
"contracts": [
{
"Name": "pcAppShareholders",
"Value": "contract pcAppShareholders \n{\n data \n {\n application_id int\n person_id int\n }\n\n conditions \n {\n if (DBFind(\"pc_app_shareholders\").Columns(\"id\").Where(\"application_id=? and person_id=? and status!=0\", $application_id, $person_id))\n\t {\n\t warning(\"Shareholder already in the list\")\n\t }\n if(!DBFind(\"members\").Columns(\"id\").WhereId($person_id))\n\t {\n\t warning(\"Non-existent member ID\")\n\t }\n \n }\n\n action {\n $ret_member = DBFind(\"members\").Columns(\"member_name\").Where(\"id = $\", $person_id).Order(\"id\")\n $shareholder_id = DBFind(\"pc_app_shareholders\").Where(\"application_id=? and person_id=? and status=0\",$application_id,$person_id).One(\"id\")\n if (Len($ret_member) > 0) {\n $vals_member = $ret_member[0]\n }\n if $shareholder_id != nil {\n DBUpdate(\"pc_app_shareholders\", Int($shareholder_id), \"status\", 1) \n }\n else{\n DBInsert(\"pc_app_shareholders\", \"person_id,application_id,name,shareholding,status\", $person_id, $application_id, $vals_member[\"member_name\"], 0,1)\n }\n }\n}",
"Conditions": "true"
},
{
"Name": "pcAppShareholdersDel",
"Value": "contract pcAppShareholdersDel {\n data {\n Id int\n application_id int\n }\n\n conditions {\n $ret_dell = DBFind(\"pc_app_shareholders\").WhereId($Id)\n if (Len($ret_dell) > 0){\n $vals_dell_founder = $ret_dell[0]\n }\n if ($vals_dell_founder[\"status\"] == 3){\n warning(\"You can not remove a company founder\")\n }\n }\n\n action {\n $ret_ms = DBFind(\"pc_license_application\").Columns(\"emigration\").WhereId($application_id)\n if (Len($ret_ms) == 3){\n DBUpdate(\"pc_license_application\", $application_id, \"emigration\", 0)\n }\n DBUpdate(\"pc_app_shareholders\", $Id, \"status,shareholding\", 0,0)\n }\n}",
"Conditions": "true"
},
{
"Name": "pcApplicationFormEdit",
"Value": "contract pcApplicationFormEdit {\n data {\n company_name string\n business_scope int\n business_premises int\n id int\n }\n\n conditions {\n \n }\n\n action {\n $ret_m = DBFind(\"pc_license_application\").WhereId($id).One(\"name_reservation\")\n $ret_l = DBFind(\"pc_license_application\").WhereId($id).One(\"property_suitability\")\n DBUpdate(\"pc_license_application\", $id, \"company_name,business_scope,business_premises\", $company_name, $business_scope,$business_premises)\n if (Int($ret_m) == 2){\n pcCompanyName(\"application_id\",$id)\n }\n if (Int($ret_l) == 3){\n DBUpdate(\"pc_license_application\", $id, \"property_suitability\", 0)\n } \n }\n}",
"Conditions": "true"
},
{
"Name": "pcNewApplication",
"Value": "contract pcNewApplication {\n data {\n application_id int\n }\n\n conditions {\n\n }\n\n action {\n DBUpdate(\"pc_license_application\", $application_id, \"status\",4)\n }\n}",
"Conditions": "true"
},
{
"Name": "pcApplicationForm",
"Value": "contract pcApplicationForm \n{\n data \n {\n company_name string\n business_scope int\n business_premises int\n }\n\n conditions \n {\n $ret_member = DBFind(\"members\").Columns(\"member_name,avatar\").Where(\"id = $\", $key_id).Order(\"id\")\n if (Len($ret_member) > 0){\n $vals_member = $ret_member[0]\n }\n }\n\n action \n {\n $application_id= DBInsert(\"pc_license_application\",\"company_name,business_scope,company_founder,business_premises,days_initial_approval,status,timestamp date_start,lease_contract_id\", $company_name, $business_scope, $key_id, $business_premises, 30, 0, $block_time, 0)\n DBInsert(\"pc_app_shareholders\",\"person_id,application_id,name,shareholding,status\", $key_id, $application_id,$vals_member[\"member_name\"], 100, 3)\n }\n}",
"Conditions": "true"
},
{
"Name": "pcConfirmEco",
"Value": "contract pcConfirmEco {\n data {\n application_id int\n notific_id int\n }\n\n conditions {\n \n }\n\n action {\n DBUpdate(\"pc_license_application\", $application_id, \"ministry_economy\",1)\n pcRegisterCompany(\"application_id\", $application_id)\n Notifications_Single_Close(\"notific_id\",$notific_id)\n }\n}",
"Conditions": "true"
},
{
"Name": "pcDenialEco",
"Value": "contract pcDenialEco {\n data {\n application_id int\n notific_id int\n }\n\n conditions {\n \n }\n\n action {\n DBUpdate(\"pc_license_application\", $application_id, \"ministry_economy,status,company_id,timestamp date_end,name_reservation\",3,4,0,$block_time,0)\n Notifications_Single_Close(\"notific_id\",$notific_id)\n }\n}",
"Conditions": "true"
},
{
"Name": "pcConfirmPolice",
"Value": "contract pcConfirmPolice {\n data {\n application_id int\n notific_id int\n }\n\n conditions {\n \n }\n\n action {\n DBUpdate(\"pc_license_application\", $application_id, \"police_inspection\",1)\n pcCheckApplication(\"application_id\",$application_id)\n Notifications_Single_Close(\"notific_id\",$notific_id)\n \n }\n}",
"Conditions": "true"
},
{
"Name": "pcDenial",
"Value": "contract pcDenial {\n data {\n application_id int\n notific_id int\n }\n\n conditions {\n \n }\n\n action {\n DBUpdate(\"pc_license_application\", $application_id, \"police_inspection,status,company_id,timestamp date_end,name_reservation\",3,4,0,$block_time,0)\n Notifications_Single_Close(\"notific_id\",$notific_id)\n }\n}",
"Conditions": "true"
},
{
"Name": "pcCancel",
"Value": "contract pcCancel {\n data {\n application_id int\n }\n\n conditions {\n\n }\n\n action {\n DBUpdate(\"pc_license_application\", $application_id, \"ministry_economy,status,company_id,timestamp date_end,name_reservation\",3,4,0,$block_time,0)\n }\n}",
"Conditions": "true"
},
{
"Name": "pcApplicationFormSend",
"Value": "contract pcApplicationFormSend {\n data {\n id int\n \n }\n\n conditions {\n\n }\n\n action {\n DBUpdate(\"pc_license_application\", $id, \"status\", 1)\n pcAPEmigration(\"application_id\",$id)\n }\n}",
"Conditions": "true"
},
{
"Name": "pcShareholding",
"Value": "contract pcShareholding \n{\n data \n {\n Id array \"optional\"\n Shareholding array \"optional\"\n \n }\n\n conditions \n { \n \n var len, i, summ int\n i=0\n summ=0\n\n len = Len($Shareholding)\n while i < len \n {\n summ = summ + Int($Shareholding[i])\n /*if(Int($Shareholding[i])==0)\n {\n warning(\"The value can not be zero.\")\n }*/\n\t\t\ti = i + 1\n\t\t}\n\t\n\t\tif summ != 100\n\t\t{\n\t\t warning(\"The amount if shareholding is not 100\")\n\t\t}\n }\n\n action \n {\n var i,len int\n len = Len($Shareholding)\n\t\t\n\t\twhile i < len {\n DBUpdate(\"pc_app_shareholders\", Int($Id[i]), \"shareholding\", Int($Shareholding[i]))\n i = i + 1\n\t\t}\n }\n}",
"Conditions": "true"
},
{
"Name": "pcAPEmigration",
"Value": "contract pcAPEmigration {\n data {\n application_id int\n }\n\n conditions {\n\n }\n\n action {\n \n\t\t DBUpdate(\"pc_license_application\", $application_id, \"emigration\", 1)\n\t\t pcCompanyName(\"application_id\",$application_id)\n\t\t}\n }",
"Conditions": "true"
},
{
"Name": "pcCompanyName",
"Value": "contract pcCompanyName {\n data {\n application_id int\n }\n\n conditions {\n $ret_member = DBFind(\"pc_license_application\").Columns(\"company_name\").Where(\"id = $\", $application_id)\n if (Len($ret_member) > 0){\n $company_name = $ret_member[0]\n }\n }\n\n action {\n if (DBFind(\"pc_companies\").Columns(\"id\").Where(\"company_name = ?\",$company_name[\"company_name\"]) || DBFind(\"pc_license_application\").Columns(\"id\").Where(\"company_name = ? and id != ? and name_reservation = ?\", $company_name[\"company_name\"], $application_id,1) )\n {\n DBUpdate(\"pc_license_application\", $application_id, \"name_reservation\",2)\n } else{\n DBUpdate(\"pc_license_application\", $application_id, \"name_reservation\",1)\n pcBusinessPremises(\"application_id\",$application_id)\n }\n }\n}",
"Conditions": "true"
},
{
"Name": "pcBusinessPremises",
"Value": "contract pcBusinessPremises {\n data {\n application_id int \n }\n\n conditions {\n\n }\n\n action {\n \n DBUpdate(\"pc_license_application\", $application_id, \"property_suitability\",1)\n pcPoliceInspection(\"application_id\",$application_id) \n \n }\n}",
"Conditions": "true"
},
{
"Name": "pcPoliceInspection",
"Value": "contract pcPoliceInspection {\n data {\n application_id int \n }\n\n conditions {\n $ret_member = DBFind(\"pc_license_application\").Columns(\"police_inspection\").Where(\"id = $\", $application_id)\n if (Len($ret_member)){\n $vals_member = $ret_member[0]\n }\n if ($vals_member[\"police_inspection\"] == 3) {\n info (\"The police denied your request\")\n }\n }\n\n action {\n \n if ($vals_member[\"police_inspection\"] == 1) {\n DBUpdate(\"pc_license_application\", $application_id, \"police_inspection\",1)\n pcCheckApplication(\"application_id\",$application_id)\n }\n \n else {\n DBUpdate(\"pc_license_application\",$application_id,\"police_inspection\",2)\n pcRequest(\"application_id,page_name,citizen_id\",$application_id,\"pcPolicePage\",$key_id)\n }\n }\n}",
"Conditions": "true"
},
{
"Name": "pcCheckApplication",
"Value": "contract pcCheckApplication {\n data {\n application_id int \n }\n\n conditions {\n $ret_member = DBFind(\"pc_license_application\").Columns(\"ministry_economy\").Where(\"id = $\", $application_id)\n if (Len($ret_member)){\n $vals_member = $ret_member[0]\n }\n if ($vals_member[\"ministry_economy\"] == 3) {\n info (\"The Ministry Economy denied your request\")\n }\n }\n\n action {\n \n if ($vals_member[\"ministry_economy\"] == 1) {\n DBUpdate(\"pc_license_application\", $application_id, \"ministry_economy\",1)\n pcRegisterCompany(\"application_id\", $application_id)\n }\n \n else {\n DBUpdate(\"pc_license_application\",$application_id,\"ministry_economy\",2)\n pcRequest(\"application_id,page_name,citizen_id\",$application_id,\"pcMinistryEconomyPage\",$key_id)\n }\n }\n}",
"Conditions": "true"
},
{
"Name": "pcRequest",
"Value": "contract pcRequest {\n data {\n application_id int\n page_name string\n citizen_id int \"optional\"\n \n }\n\n conditions {\n\n }\n\n action {\n Notifications_Single_Send(\"icon_name,text_header,text_body,page_name,params_val,member_id\", 1, \"New request\", \"Need your confirmation\", $page_name,Sprintf(\"application_id=%v\",$application_id),$citizen_id)\n }\n}",
"Conditions": "true"
},
{
"Name": "pcRegisterCompany",
"Value": "contract pcRegisterCompany \n{\n data \n {\n application_id int\n }\n\n conditions \n {\n //warning(\"pcRegisterCompany\")\n }\n\n action \n {\n var company_id int\n var ret array\n var row map\n ret = DBFind(\"pc_license_application\").Columns(\"business_premises,business_scope,company_founder,company_name\").Where(\"id=$\",$application_id)\n row = ret[0]\n \n company_id=DBInsert(\"pc_companies\",\"application_id,business_premises,business_scope,company_founder,company_name, timestamp date_start,delete\", $application_id,Int(row[\"business_premises\"]),Int(row[\"business_scope\"]),Int(row[\"company_founder\"]),row[\"company_name\"], $block_time,0)\n \n var shareholding array\n var str map\n var len, i, request int\n\n shareholding = DBFind(\"pc_app_shareholders\").Columns(\"person_id,shareholding,name\").Where(\"application_id=$ and status!=0\", $application_id)\n \n len = Len(shareholding)\n while i < len \n {\n str = shareholding[i]\n\t\t\tDBInsert(\"pc_shareholders\",\"company,company_name,person_id,person_name,shareholding,delete\",company_id,row[\"company_name\"], Int(str[\"person_id\"]),str[\"name\"],Int(str[\"shareholding\"]),0)\n\t\t\ti = i + 1\n\t\t}\n \n DBUpdate(\"pc_license_application\", $application_id, \"status,company_id,timestamp date_end\",3, company_id, $block_time)\n }\n \n}",
"Conditions": "true"
}
],
"tables": [
{
"Name": "pc_app_shareholders",
"Columns": "[{\"name\":\"name\",\"type\":\"varchar\",\"conditions\":\"true\"},{\"name\":\"status\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"person_id\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"shareholding\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"person_status\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"application_id\",\"type\":\"number\",\"conditions\":\"true\"}]",
"Permissions": "{\"insert\":\"true\",\"update\":\"true\",\"new_column\":\"true\"}"
},
{
"Name": "pc_companies",
"Columns": "[{\"name\":\"company_founder\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"date_start\",\"type\":\"datetime\",\"conditions\":\"true\"},{\"name\":\"business_scope\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"company_type\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"application_id\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"business_premises\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"memorandum_association\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"delete\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"company_name\",\"type\":\"varchar\",\"conditions\":\"true\"}]",
"Permissions": "{\"insert\":\"true\",\"update\":\"true\",\"new_column\":\"true\"}"
},
{
"Name": "pc_license_application",
"Columns": "[{\"name\":\"sewerage\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"date_start\",\"type\":\"datetime\",\"conditions\":\"true\"},{\"name\":\"emigration\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"company_type\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"name_reservation\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"lease_contract_id\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"status\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"date_end\",\"type\":\"datetime\",\"conditions\":\"true\"},{\"name\":\"lease_ownership\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"ministry_economy\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"business_premises\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"date_initial_approval\",\"type\":\"datetime\",\"conditions\":\"true\"},{\"name\":\"days_initial_approval\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"memorandum_association\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"company_name\",\"type\":\"varchar\",\"conditions\":\"true\"},{\"name\":\"waste_solutions\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"property_suitability\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"company_id\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"business_scope\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"company_founder\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"police_inspection\",\"type\":\"number\",\"conditions\":\"true\"}]",
"Permissions": "{\"insert\":\"true\",\"update\":\"true\",\"new_column\":\"true\"}"
},
{
"Name": "pc_shareholders",
"Columns": "[{\"name\":\"delete\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"company\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"person_id\",\"type\":\"number\",\"conditions\":\"true\"},{\"name\":\"person_name\",\"type\":\"varchar\",\"conditions\":\"true\"},{\"name\":\"company_name\",\"type\":\"varchar\",\"conditions\":\"true\"},{\"name\":\"shareholding\",\"type\":\"number\",\"conditions\":\"true\"}]",
"Permissions": "{\"insert\":\"true\",\"update\":\"true\",\"new_column\":\"true\"}"
}
],
"data": []
}