Watch
1
0
Fork
You've already forked Seyyed_arc
0
forked from hesabix/arc
Seyyed_arc/docs/hscript/recipes/debtors-top.md
2026-07-26 16:46:22 +00:00

23 lines
749 B
Markdown

---
doc_id: hscript.recipe.debtors-top
title: بدهکاران برتر
tags: [recipe, example, debtors]
version: 1
example_id: ex_debtors_top
---
# دستورپخت: بدهکاران برتر
```hscript
# @param limit integer "تعداد" default=10
report.calendar("jalali")
report.number_format(style="western")
report.title("بدهکاران برتر")
n = params.get("limit", 10)
rows = debtors.top(n)
report.kpi("تعداد", rows.count(), format="integer", span=6)
report.kpi("جمع بدهی", rows.sum("debt"), format="currency", span=6)
report.row_break()
report.bar_chart(rows, x="name", y="debt", title="بیشترین بدهی", span=12)
report.table(rows, columns=["code", "name", "debt"], formats={"debt": "currency"}, span=12)
```