diff --git a/examples/biztools/bizmodel_complete.vsh b/examples/biztools/bizmodel_complete.vsh index aa8a89d3..0a8119bf 100755 --- a/examples/biztools/bizmodel_complete.vsh +++ b/examples/biztools/bizmodel_complete.vsh @@ -9,4 +9,4 @@ heroscript := os.join_path(os.dir(@FILE), 'examples/complete.heroscript') // Execute the script and print results bizmodel.play(heroscript_path:heroscript)! mut bm := bizmodel.get("threefold")! -bm.sheet.pprint(nr_columns: 25)! +bm.sheet.pprint(nr_columns: 10)! diff --git a/examples/biztools/bizmodel_export.vsh b/examples/biztools/bizmodel_export.vsh index a1c9e754..3632caf7 100755 --- a/examples/biztools/bizmodel_export.vsh +++ b/examples/biztools/bizmodel_export.vsh @@ -16,7 +16,7 @@ bizmodel.play(heroscript_path:heroscript)! mut bm := bizmodel.get("threefold")! -bm.sheet.pprint(nr_columns: 25)! +bm.sheet.pprint(nr_columns: 10)! // buildpath := '${os.home_dir()}/hero/var/mdbuild/bizmodel' // println("buildpath: ${buildpath}") diff --git a/lib/biz/bizmodel/play.v b/lib/biz/bizmodel/play.v index 6ea0067b..4648480f 100644 --- a/lib/biz/bizmodel/play.v +++ b/lib/biz/bizmodel/play.v @@ -57,6 +57,9 @@ pub fn (mut m BizModel) play(mut plbook PlayBook) ! { m.hrcost_total()! m.funding_total()! m.cost_total()! + m.pl_total()! + + // m.sheet.pprint(nr_columns: 10)! for action in actions.filter(it.name in action_priorities[3]) { diff --git a/lib/biz/bizmodel/play_pl.v b/lib/biz/bizmodel/play_pl.v new file mode 100644 index 00000000..003cccd1 --- /dev/null +++ b/lib/biz/bizmodel/play_pl.v @@ -0,0 +1,26 @@ +module bizmodel + +import arrays +import freeflowuniverse.herolib.core.playbook { Action, PlayBook } +import freeflowuniverse.herolib.ui.console + +// revenue_total calculates and aggregates the total revenue and cost of goods sold (COGS) for the business model +fn (mut sim BizModel) pl_total() ! { + mut sheet := sim.sheet + + // sheet.pprint(nr_columns: 10)! + + mut pl_total := sheet.group2row( + name: 'pl_summary' + include: ['pl'] + tags: 'summary' + descr: 'Cashflow Summary' + )! + + // sheet.pprint(nr_columns: 10)! + + // println(pl_total) + + // if true{panic("sdsd")} + +} diff --git a/lib/biz/bizmodel/templates/intro.md b/lib/biz/bizmodel/templates/intro.md index 27759c99..f3276094 100644 --- a/lib/biz/bizmodel/templates/intro.md +++ b/lib/biz/bizmodel/templates/intro.md @@ -32,8 +32,14 @@ @{bizmodel.sheet.wiki(title:'P&L Overview', includefilter:'pl')!} +### result + +@{bizmodel.sheet.wiki(title:'P&L Result', includefilter:'summary')!} + + @{bizmodel.graph_bar_row(rowname:'revenue_total', unit:'million', title:'A Title', title_sub:'Sub')!} + Unit is in Million USD. @{bizmodel.graph_bar_row(rowname:'revenue_total', unit:'million')!} @@ -42,8 +48,9 @@ Unit is in Million USD. @{bizmodel.graph_pie_row(rowname:'revenue_total', unit:'million', size:'80%')!} -## Some Details + + \ No newline at end of file diff --git a/lib/biz/bizmodel/templates/introduction.md b/lib/biz/bizmodel/templates/introduction.md index e78cbc11..c7b271fe 100644 --- a/lib/biz/bizmodel/templates/introduction.md +++ b/lib/biz/bizmodel/templates/introduction.md @@ -39,6 +39,9 @@ @{model.sheet.wiki(title:'P&L Overview', includefilter:['pl']) or {panic(err)}} +@{model.sheet.wiki(title:'P&L Result', includefilter:['summary']) or {panic(err)}} + + @{model.sheet.bar_chart(rowname:'revenue_total', unit: .million, title:'Total Revenue', title_sub:'Sub') or {panic(err)}.mdx()} Unit is in Million USD. @@ -47,8 +50,8 @@ Unit is in Million USD. @{model.sheet.pie_chart(rowname:'revenue_total', unit: .million, size:'80%') or {panic(err)}.mdx()} -## Some Details + \ No newline at end of file