Compare commits

..

4 commits

Author SHA1 Message Date
Tyler Matteson
7f2e860738
Merge pull request #25 from Sea-Haven-Industries/migrate_final
feat: fix addresses
2025-07-01 19:45:35 -04:00
Tyler Matteson
2027b52147
Merge pull request #24 from Sea-Haven-Industries/migrate_final
feat: migrate final
2025-06-29 17:03:37 -04:00
Adam Moussa
3251eab17b
Merge pull request #23 from Sea-Haven-Industries/in_words_jinja
feat: add jinja method for amount
2025-06-25 16:18:23 -04:00
Tyler Matteson
3d8bae0b7b feat: add jinja method for amount 2025-06-25 16:15:34 -04:00
2 changed files with 17 additions and 0 deletions

View file

@ -248,3 +248,9 @@ website_route_rules = [
] ]
export_python_type_annotations = True export_python_type_annotations = True
jinja = {
"methods": [
"suppliers_portal.overrides.print.amount_in_words_with_asterisks",
]
}

View file

@ -0,0 +1,11 @@
import frappe
from frappe.utils import flt, money_in_words
@frappe.whitelist()
def amount_in_words_with_asterisks(amount):
amount = flt(amount)
amount_in_words = money_in_words(amount)[4:-6]
if amount % 1 == 0:
return f"{amount_in_words + ' and Zero Cents ':*<70}"
return f"{amount_in_words + 's ':*<84}"