Skip to content

Commit

Permalink
cleanup, logo
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Nov 6, 2022
1 parent 31aca72 commit 0a958a7
Show file tree
Hide file tree
Showing 25 changed files with 87 additions and 131 deletions.
11 changes: 3 additions & 8 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,17 @@ config :n2o,
app: :fin,
mq: :n2o_syn,
port: 8041,
mqtt_services: [:erp, :plm],
ws_services: [:chat],
protocols: [:n2o_heart, :nitro_n2o, :n2o_ftp],
routes: :bank_route
routes: :fin_route

config :kvs,
dba: :kvs_rocks,
dba_st: :kvs_st,
schema: [:kvs, :kvs_stream, :bpe_metainfo, :bank_kvs]

config :rpc,
js: 'priv/static'
schema: [:kvs, :kvs_stream, :bpe_metainfo, :fin_kvs]

config :form,
module: :form_backend,
registry: [:bpe_row,:bpe_act]
registry: [:bpe_row,:bpe_create,:bpe_trace,:bpe_pass]

config :bpe,
procmodules: [:bpe, :bpe_account],
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule FIN.Mixfile do
def project() do
[
app: :fin,
version: "3.11.1",
version: "3.11.2",
description: "FIN Financial Management",
package: package(),
elixir: "~> 1.11",
Expand Down
4 changes: 2 additions & 2 deletions priv/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta name="author" content="Maxim Sokhatsky" />
<title>BANK</title>
<title>FIN</title>
<link rel="stylesheet" href="css/synrc.css?v=2" />
</head>
<body>
Expand All @@ -15,7 +15,7 @@
<a href='http://localhost:8041/app/login.htm'>ADMIN</a>
</nav>
<header>
<a href="https://github.com/synrc/bank"><img src="https://synrc.space/images/Synrc Neo.svg?v=1"></a>
<a href="https://github.com/synrc/bank"><img src="https://crm.erp.uno/img/logo.svg"></a>
<h1>FIN</h1>
</header>
<aside>
Expand Down
2 changes: 1 addition & 1 deletion priv/static/login.htm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<article>
<section>
<h2>LOGIN</h2>
<p>Enterprizing Systems Prompt.</p>
<p>ERP.UNO Systems Prompt.</p>
<br>
<div id=stand class="box">
</div>
Expand Down
9 changes: 4 additions & 5 deletions src/boot/bank_kvs.erl → src/boot/fin_kvs.erl
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
-module(bank_kvs).
-compile(export_all).
-module(fin_kvs).
-export([metainfo/0,fin/0]).
-include("bank/phone.hrl").
-include("ent.hrl").
-include_lib("kvs/include/metainfo.hrl").
-include_lib("form/include/meta.hrl").

metainfo() -> #schema { name = kvx,
tables = lists:flatten([ bank()]) }.
metainfo() -> #schema { name = fin, tables = fin() }.

bank() ->
fin() ->
[
#table{name = phone, fields=record_info(fields, phone), instance = #phone{} },
#table{name = field, fields=record_info(fields, field), instance = #field{} },
Expand Down
2 changes: 1 addition & 1 deletion src/fin.app.src
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{application, fin,
[
{description, "FIN Account Management"},
{vsn, "3.11.1"},
{vsn, "3.11.2"},
{registered, []},
{applications, [public_key,asn1,kernel,stdlib,rocksdb,mnesia,ranch,cowboy,
nitro,syntax_tools,compiler,xmerl,kvs,syn,n2o,bpe,form]},
Expand Down
1 change: 0 additions & 1 deletion src/fin.erl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
-module(fin).
-compile(export_all).
-behaviour(application).
-behaviour(supervisor).
-export([start/2, stop/1, init/1]).
Expand Down
31 changes: 31 additions & 0 deletions src/forms/bpe_create.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-module(bpe_create).
-copyright('Maxim Sokhatsky').
-include_lib("nitro/include/nitro.hrl").
-include_lib("form/include/meta.hrl").
-include_lib("bpe/include/bpe.hrl").
-include("act.hrl").
-export([doc/0,id/0,new/3]).

doc() -> "Dialog for creation of BPE processes.".
id() -> #act{}.
new(Name,#act{}, _) ->
put(process_type_pi_none, "bpe_account"),
#document { name = form:atom([pi,Name]),
sections = [ #sec { name=[<<"New process: "/utf8>>] } ],
buttons = [ #but { id=form:atom([pi,decline]),
title= <<"Discard"/utf8>>,
class=cancel,
postback={'Discard',[]} },
#but { id=form:atom([pi,proceed]),
title = <<"Create"/utf8>>,
class = [button,sgreen],
sources = [process_type],
postback = {'Spawn',[]}}],
fields = [ #field { name=process_type,
id=process_type,
type=select,
title= "Type",
tooltips = [],
default = bpe_account,
options = [ #opt{name=bpe_account,checked=true,title = "Client Account"} ]
} ] }.
2 changes: 1 addition & 1 deletion src/forms/bpe_pass.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-copyright('Maxim Sokhatsky').
-include_lib("form/include/meta.hrl").
-include("bank/phone.hrl").
-compile(export_all).
-export([doc/0,id/0,new/3]).

doc() -> "One-time password PIN control used in banks,".
id() -> #phone{}.
Expand Down
24 changes: 0 additions & 24 deletions src/forms/bpe_route.erl

This file was deleted.

6 changes: 2 additions & 4 deletions src/forms/bpe_row.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-module(bpe_row).
-copyright('Maxim Sokhatsky').
-compile(export_all).
-export([doc/0,id/0,new/3]).
-include_lib("bpe/include/bpe.hrl").
-include_lib("nitro/include/nitro.hrl").

Expand All @@ -11,9 +11,7 @@ current(Proc) -> {_,T} = bpe:current_task(Proc), T.
new(Name,Proc,_) ->
Pid = nitro:to_list(Proc#process.id),
Docs = Proc#process.docs,
#panel { id=form:atom([tr,Name]),
class=td,
body=[
#panel { id=form:atom([tr,Name]), class=td, body=[
#panel{class=column6, body = #link{href="act.htm?p="++Pid, body=Pid } },
#panel{class=column6, body = nitro:to_list(Proc#process.name) },
#panel{class=column6, body = nitro:to_list(current(Proc))},
Expand Down
2 changes: 1 addition & 1 deletion src/forms/bpe_trace.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-module(bpe_trace).
-copyright('Maxim Sokhatsky').
-compile(export_all).
-export([doc/0,id/0,new/3]).
-include_lib("bpe/include/bpe.hrl").
-include_lib("nitro/include/nitro.hrl").

Expand Down
29 changes: 2 additions & 27 deletions src/pages/bpe_act.erl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-include_lib("form/include/meta.hrl").
-include_lib("bpe/include/bpe.hrl").
-include("act.hrl").
-compile(export_all).
-export([event/1]).

event(init) ->
nitro:clear(tableHead),
Expand All @@ -30,36 +30,11 @@ event(init) ->
|| I <- History ]
end;

event(E) ->
io:format("Event:process:~p~n.",[E]),
event(_) ->
ok.

header() ->
#panel{id=header,class=th,body=
[#panel{class=column6,body="State"},
#panel{class=column6,body="Documents"}]}.

doc() -> "Dialog for creation of BPE processes.".
id() -> #act{}.
new(Name,#act{}, _) ->
put(process_type_pi_none, "bpe_account"),
#document { name = form:atom([pi,Name]), sections = [
#sec { name=[<<"New process: "/utf8>>] } ],
buttons = [ #but { id=form:atom([pi,decline]),
title= <<"Discard"/utf8>>,
class=cancel,
postback={'Discard',[]} },
#but { id=form:atom([pi,proceed]),
title = <<"Create"/utf8>>,
class = [button,sgreen],
sources = [process_type],
postback = {'Spawn',[]}}],
fields = [ #field { name=process_type,
id=process_type,
type=select,
title= "Type",
tooltips = [],
default = bpe_account,
options = [ #opt{name=bpe_account,checked=true,title = "Client Account [FIN.ERP.UNO]"} ],
postback = {'TypeSelect'}
} ] }.
11 changes: 5 additions & 6 deletions src/pages/bpe_forms.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-module(bpe_forms).
-copyright('Maxim Sokhatsky').
-compile(export_all).
-export([event/1]).
-include_lib("n2o/include/n2o.hrl").
-include_lib("nitro/include/nitro.hrl").

Expand All @@ -12,11 +12,10 @@ event({client,{form,Module}}) ->
event(init) ->
nitro:clear(stand),
[ self() ! {client,{form,F}} || F <- application:get_env(form, registry, []) ],
?LOG_INFO("HELO.~n",[]);
ok;

event({Event,Name}) ->
nitro:wire(lists:concat(["console.log(\"",io_lib:format("~p",[{Event,Name}]),"\");"])),
?LOG_INFO("Event:~p.~n", [{Event,Name}]);
nitro:wire(lists:concat(["console.log(\"",io_lib:format("~p",[{Event,Name}]),"\");"]));

event(_Event) -> ok.

event(Event) ->
?LOG_INFO("Unknown:~p.~n", [Event]).
25 changes: 10 additions & 15 deletions src/pages/bpe_index.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-module(bpe_index).
-copyright('Maxim Sokhatsky').
-compile(export_all).
-export([event/1]).
-include_lib("n2o/include/n2o.hrl").
-include_lib("bpe/include/bpe.hrl").
-include_lib("nitro/include/nitro.hrl").
Expand All @@ -21,7 +21,7 @@ event(init) ->
nitro:insert_top(tableHead, header()),
nitro:clear(frms),
nitro:clear(ctrl),
Module = bpe_act,
Module = bpe_create,
nitro:insert_bottom(frms, form:new(Module:new(Module,Module:id(), []), Module:id(), [])),
nitro:insert_bottom(ctrl, #link{id=creator, body="New",postback=create, class=[button,sgreen]}),
nitro:hide(frms),
Expand All @@ -30,10 +30,11 @@ event(init) ->
ok;

event({complete,Id}) ->
bpe:start(bpe:load(Id),[]),
io:format("Next: ~p~n",[bpe:next(Id)]),
nitro:update(form:atom([tr,row,Id]),
bpe_row:new(form:atom([row,Id]),bpe:load(Id),[]));
Proc = bpe:load(Id),
bpe:start(Proc,[]),
bpe:next(Id),
nitro:update(form:atom([tr,row,Id]), bpe_row:new(form:atom([row,Id]),Proc,[])),
ok;

event(create) ->
nitro:hide(ctrl),
Expand All @@ -46,20 +47,14 @@ event({'Spawn',_}) ->
{ok,I} -> I end,
nitro:insert_after(header, bpe_row:new(form:atom([row,Id]),bpe:proc(Id),[])),
nitro:hide(frms),
nitro:show(ctrl),
?LOG_INFO("BPE: ~p.~n", [Id]);

event({'TypeSelect'}) ->
% [ io:format("Process Dictionary: ~p : ~p~n",[X,erlang:get(X)]) || X <- erlang:get_keys()],
io:format("~p",["Type Select"]);
nitro:show(ctrl);

event({'Discard',[]}) ->
nitro:hide(frms),
nitro:show(ctrl);

event({Event,Name}) ->
nitro:wire(lists:concat(["console.log(\"",io_lib:format("~p",[{Event,Name}]),"\");"])),
?LOG_INFO("Event:~p.~n", [{Event,Name}]);
nitro:wire(lists:concat(["console.log(\"",io_lib:format("~p",[{Event,Name}]),"\");"]));

event(Event) ->
?LOG_INFO("Unknown:~p.~n", [Event]).
ok.
2 changes: 1 addition & 1 deletion src/pages/bpe_login.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-module(bpe_login).
-copyright('Maxim Sokhatsky').
-compile(export_all).
-export([event/1]).
-include_lib("n2o/include/n2o.hrl").
-include_lib("nitro/include/nitro.hrl").

Expand Down
2 changes: 1 addition & 1 deletion src/pages/bank_route.erl → src/pages/fin_route.erl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-module(bank_route).
-module(fin_route).
-include_lib("n2o/include/n2o.hrl").
-export([init/2, finish/2]).

Expand Down
7 changes: 0 additions & 7 deletions src/processes/bank_charge.erl

This file was deleted.

6 changes: 0 additions & 6 deletions src/processes/bank_close.erl

This file was deleted.

6 changes: 0 additions & 6 deletions src/processes/bank_open.erl

This file was deleted.

6 changes: 0 additions & 6 deletions src/processes/bank_tx.erl

This file was deleted.

7 changes: 0 additions & 7 deletions src/processes/bank_withdraw.erl

This file was deleted.

7 changes: 7 additions & 0 deletions src/processes/fin_charge.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-module(fin_charge).
-include_lib("bpe/include/bpe.hrl").
-export([def/0,action/2]).

def() -> #process{}.
action(_,_) -> #result{}.

7 changes: 7 additions & 0 deletions src/processes/fin_close.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-module(fin_close).
-include_lib("bpe/include/bpe.hrl").
-export([def/0,action/2]).

def() -> #process{}.
action(_,_) -> #result{}.

7 changes: 7 additions & 0 deletions src/processes/fin_open.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-module(fin_open).
-include_lib("bpe/include/bpe.hrl").
-export([def/0,action/2]).

def() -> #process{}.
action(_,_) -> #result{}.

0 comments on commit 0a958a7

Please sign in to comment.