feat: In words in payment entry
(cherry picked from commit b21da472f6e106ea7b2430c285ce24400a0208dd)
This commit is contained in:
parent
e0c35d60b4
commit
5df2f5d523
@ -87,12 +87,14 @@
|
|||||||
"status",
|
"status",
|
||||||
"custom_remarks",
|
"custom_remarks",
|
||||||
"remarks",
|
"remarks",
|
||||||
|
"base_in_words",
|
||||||
"column_break_16",
|
"column_break_16",
|
||||||
"letter_head",
|
"letter_head",
|
||||||
"print_heading",
|
"print_heading",
|
||||||
"bank",
|
"bank",
|
||||||
"bank_account_no",
|
"bank_account_no",
|
||||||
"payment_order",
|
"payment_order",
|
||||||
|
"in_words",
|
||||||
"subscription_section",
|
"subscription_section",
|
||||||
"auto_repeat",
|
"auto_repeat",
|
||||||
"amended_from",
|
"amended_from",
|
||||||
@ -746,6 +748,20 @@
|
|||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
"label": "Book Advance Payments in Separate Party Account",
|
"label": "Book Advance Payments in Separate Party Account",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "base_in_words",
|
||||||
|
"fieldtype": "Small Text",
|
||||||
|
"label": "In Words (Company Currency)",
|
||||||
|
"print_hide": 1,
|
||||||
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "in_words",
|
||||||
|
"fieldtype": "Small Text",
|
||||||
|
"label": "In Words",
|
||||||
|
"print_hide": 1,
|
||||||
|
"read_only": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
@ -759,7 +775,7 @@
|
|||||||
"table_fieldname": "payment_entries"
|
"table_fieldname": "payment_entries"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2023-11-23 12:07:20.887885",
|
"modified": "2024-01-03 12:46:41.759121",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Entry",
|
"name": "Payment Entry",
|
||||||
|
@ -95,6 +95,7 @@ class PaymentEntry(AccountsController):
|
|||||||
self.validate_paid_invoices()
|
self.validate_paid_invoices()
|
||||||
self.ensure_supplier_is_not_blocked()
|
self.ensure_supplier_is_not_blocked()
|
||||||
self.set_status()
|
self.set_status()
|
||||||
|
self.set_total_in_words()
|
||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
if self.difference_amount:
|
if self.difference_amount:
|
||||||
@ -702,6 +703,21 @@ class PaymentEntry(AccountsController):
|
|||||||
|
|
||||||
self.db_set("status", self.status, update_modified=True)
|
self.db_set("status", self.status, update_modified=True)
|
||||||
|
|
||||||
|
def set_total_in_words(self):
|
||||||
|
from frappe.utils import money_in_words
|
||||||
|
|
||||||
|
if self.payment_type in ("Pay", "Internal Transfer"):
|
||||||
|
base_amount = abs(self.base_paid_amount)
|
||||||
|
amount = abs(self.paid_amount)
|
||||||
|
currency = self.paid_from_account_currency
|
||||||
|
elif self.payment_type == "Receive":
|
||||||
|
base_amount = abs(self.base_received_amount)
|
||||||
|
amount = abs(self.received_amount)
|
||||||
|
currency = self.paid_to_account_currency
|
||||||
|
|
||||||
|
self.base_in_words = money_in_words(base_amount, self.company_currency)
|
||||||
|
self.in_words = money_in_words(amount, currency)
|
||||||
|
|
||||||
def set_tax_withholding(self):
|
def set_tax_withholding(self):
|
||||||
if not self.party_type == "Supplier":
|
if not self.party_type == "Supplier":
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user