File tree Expand file tree Collapse file tree
erpnext/accounts/doctype/payment_entry Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2105,6 +2105,37 @@ def test_outstanding_multicurrency_sales_order_split(self):
21052105 self .assertEqual (ref .voucher_no , so .name )
21062106 self .assertIsNotNone (ref .payment_term )
21072107
2108+ def test_project_name_in_exchange_gain_loss_entry (self ):
2109+ si = create_sales_invoice (
2110+ customer = "_Test Customer USD" ,
2111+ debit_to = "_Test Receivable USD - _TC" ,
2112+ currency = "USD" ,
2113+ conversion_rate = 50 ,
2114+ do_not_submit = True ,
2115+ )
2116+ from erpnext .projects .doctype .project .test_project import make_project
2117+
2118+ si .project = make_project ({"project_name" : "_Test Project for Exchange Gain Loss Entry" }).name
2119+
2120+ si .submit ()
2121+
2122+ pe = get_payment_entry ("Sales Invoice" , si .name )
2123+
2124+ pe .source_exchange_rate = 100
2125+
2126+ pe .insert ()
2127+ pe .submit ()
2128+
2129+ rows = frappe .get_all (
2130+ "Journal Entry Account" ,
2131+ or_filters = [{"reference_name" : pe .name }, {"reference_name" : si .name }],
2132+ fields = ["project" ],
2133+ )
2134+ self .assertEqual (len (rows ), 2 )
2135+
2136+ self .assertEqual (rows [0 ].project , si .project )
2137+ self .assertEqual (rows [1 ].project , si .project )
2138+
21082139
21092140def create_payment_entry (** args ):
21102141 payment_entry = frappe .new_doc ("Payment Entry" )
You can’t perform that action at this time.
0 commit comments