Skip to content

Commit

Permalink
Merge pull request #43184 from frappe/mergify/bp/version-15/pr-43182
Browse files Browse the repository at this point in the history
fix: typo with po_date when creating remarks (backport #43182)
  • Loading branch information
ruthra-kumar authored Sep 12, 2024
2 parents d9d86da + 31e0bb4 commit 578ddb9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/sales_invoice/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ def add_remarks(self):
if self.po_no:
self.remarks = _("Against Customer Order {0}").format(self.po_no)
if self.po_date:
self.remarks += " " + _("dated {0}").format(formatdate(self.po_data))
self.remarks += " " + _("dated {0}").format(formatdate(self.po_date))

else:
self.remarks = _("No Remarks")
Expand Down
10 changes: 9 additions & 1 deletion erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from frappe import qb
from frappe.model.dynamic_links import get_dynamic_link_map
from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import add_days, flt, getdate, nowdate, today
from frappe.utils import add_days, flt, format_date, getdate, nowdate, today

import erpnext
from erpnext.accounts.doctype.account.test_account import create_account, get_inventory_account
Expand Down Expand Up @@ -3997,6 +3997,14 @@ def test_common_party_with_foreign_currency_jv(self):
self.assertTrue(jv)
self.assertEqual(jv[0], si.grand_total)

def test_invoice_remarks(self):
si = frappe.copy_doc(test_records[0])
si.po_no = "Test PO"
si.po_date = nowdate()
si.save()
si.submit()
self.assertEqual(si.remarks, f"Against Customer Order Test PO dated {format_date(nowdate())}")


def set_advance_flag(company, flag, default_account):
frappe.db.set_value(
Expand Down

0 comments on commit 578ddb9

Please sign in to comment.