diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index b2797fc9db3..f57c070f80b 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -7,7 +7,7 @@ from frappe import _ from frappe.model.document import Document from frappe.model.meta import get_field_precision from frappe.model.naming import set_name_from_naming_options -from frappe.utils import flt, fmt_money +from frappe.utils import flt, fmt_money, now import erpnext from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( @@ -405,7 +405,7 @@ def rename_temporarily_named_docs(doctype): set_name_from_naming_options(frappe.get_meta(doctype).autoname, doc) newname = doc.name frappe.db.sql( - f"UPDATE `tab{doctype}` SET name = %s, to_rename = 0 where name = %s", - (newname, oldname), + f"UPDATE `tab{doctype}` SET name = %s, to_rename = 0, modified = %s where name = %s", + (newname, now(), oldname), auto_commit=True, ) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index d40efc52d84..5830246bca9 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -350,15 +350,25 @@ class PaymentEntry(AccountsController): self.set(self.party_account_field, party_account) self.party_account = party_account - if self.paid_from and not (self.paid_from_account_currency or self.paid_from_account_balance): + if self.paid_from and ( + not self.paid_from_account_currency + or not self.paid_from_account_balance + or not self.paid_from_account_type + ): acc = get_account_details(self.paid_from, self.posting_date, self.cost_center) self.paid_from_account_currency = acc.account_currency self.paid_from_account_balance = acc.account_balance + self.paid_from_account_type = acc.account_type - if self.paid_to and not (self.paid_to_account_currency or self.paid_to_account_balance): + if self.paid_to and ( + not self.paid_to_account_currency + or not self.paid_to_account_balance + or not self.paid_to_account_type + ): acc = get_account_details(self.paid_to, self.posting_date, self.cost_center) self.paid_to_account_currency = acc.account_currency self.paid_to_account_balance = acc.account_balance + self.paid_to_account_type = acc.account_type self.party_account_currency = ( self.paid_from_account_currency diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html index 7d8d33c46b4..9cae94ff8b4 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html @@ -282,4 +282,4 @@ {% } %} -

{{ __("Printed On ") }}{%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}

\ No newline at end of file +

{%= __("Printed on {0}", [frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())]) %}

diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html index eaabc90205f..6957ab41681 100644 --- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html +++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.html @@ -1,6 +1,3 @@ -
- {%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %} -

{%= __("Bank Reconciliation Statement") %}

{%= filters.account && (filters.account + ", "+filters.report_date) || "" %} {%= filters.company %}


@@ -46,4 +43,4 @@ {% } %} -

Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}

+

{%= __("Printed on {0}", [frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())]) %}

diff --git a/erpnext/accounts/report/financial_statements.html b/erpnext/accounts/report/financial_statements.html index 2bb09cf0dc5..dc1d0093bce 100644 --- a/erpnext/accounts/report/financial_statements.html +++ b/erpnext/accounts/report/financial_statements.html @@ -67,5 +67,5 @@

- Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %} + {%= __("Printed on {0}", [frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())]) %}

diff --git a/erpnext/accounts/report/general_ledger/general_ledger.html b/erpnext/accounts/report/general_ledger/general_ledger.html index 3c4e1a05c97..81b5c97937c 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.html +++ b/erpnext/accounts/report/general_ledger/general_ledger.html @@ -78,4 +78,4 @@ {% } %} -

Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}

+

{%= __("Printed on {0}", [frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())]) %}

diff --git a/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.html b/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.html index 015b31c2064..2fb0986c7bb 100644 --- a/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.html +++ b/erpnext/buying/report/supplier_quotation_comparison/supplier_quotation_comparison.html @@ -94,9 +94,6 @@ -
- {%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %} -

{%= __(report.report_name) %}

{%= filters.item %}

@@ -124,9 +121,7 @@ -

Analysis Chart

+

{%= __("Analysis Chart") %}

- - -

Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}

+

{%= __("Printed on {0}", [frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string())]) %}

diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index bb7d944e639..53c739599ff 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -1835,6 +1835,59 @@ class TestStockEntry(FrappeTestCase): self.assertEqual(sle.stock_value_difference, 100) self.assertEqual(sle.stock_value, 100 * i) + def test_stock_entry_amount(self): + warehouse = "_Test Warehouse - _TC" + rm_item_code = "Test Stock Entry Amount 1" + make_item(rm_item_code, {"is_stock_item": 1}) + + fg_item_code = "Test Repack Stock Entry Amount 1" + make_item(fg_item_code, {"is_stock_item": 1}) + + make_stock_entry( + item_code=rm_item_code, + qty=1, + to_warehouse=warehouse, + basic_rate=200, + posting_date=nowdate(), + ) + + se = make_stock_entry( + item_code=rm_item_code, + qty=1, + purpose="Repack", + basic_rate=100, + do_not_save=True, + ) + + se.items[0].s_warehouse = warehouse + se.append( + "items", + { + "item_code": fg_item_code, + "qty": 1, + "t_warehouse": warehouse, + "uom": "Nos", + "conversion_factor": 1.0, + }, + ) + se.set_stock_entry_type() + se.submit() + + self.assertEqual(se.items[0].amount, 200) + self.assertEqual(se.items[0].basic_amount, 200) + + make_stock_entry( + item_code=rm_item_code, + qty=1, + to_warehouse=warehouse, + basic_rate=300, + posting_date=add_days(nowdate(), -1), + ) + + se.reload() + self.assertEqual(se.items[0].amount, 300) + self.assertEqual(se.items[0].basic_amount, 300) + def make_serialized_item(**args): args = frappe._dict(args) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 58c2fb51339..08a8262b246 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -864,7 +864,12 @@ class update_entries_after: stock_entry.calculate_rate_and_amount(reset_outgoing_rate=False, raise_error_if_no_rate=False) stock_entry.db_update() for d in stock_entry.items: - if d.name == voucher_detail_no or (not d.s_warehouse and d.t_warehouse): + # Update only the row that matches the voucher_detail_no or the row containing the FG/Scrap Item. + if ( + d.name == voucher_detail_no + or (not d.s_warehouse and d.t_warehouse) + or stock_entry.purpose in ["Manufacture", "Repack"] + ): d.db_update() def update_rate_on_delivery_and_sales_return(self, sle, outgoing_rate): diff --git a/erpnext/translations/de.csv b/erpnext/translations/de.csv index 648fba49fe5..dc71198987d 100644 --- a/erpnext/translations/de.csv +++ b/erpnext/translations/de.csv @@ -316,7 +316,7 @@ BOM {0} does not belong to Item {1},Stückliste {0} gehört nicht zum Artikel {1 BOM {0} must be active,Stückliste {0} muss aktiv sein, BOM {0} must be submitted,Stückliste {0} muss übertragen werden, Balance,Saldo, -Balance (Dr - Cr),Balance (Dr - Cr), +Balance (Dr - Cr),Saldo (S - H), Balance ({0}),Saldo ({0}), Balance Qty,Bilanzmenge, Balance Sheet,Bilanz, @@ -4009,6 +4009,7 @@ Partially ordered,teilweise geordnete, Please select company first,Bitte wählen Sie zuerst die Firma aus, Please select patient,Bitte wählen Sie Patient, Printed On ,Gedruckt am, +Printed on {0},Gedruckt am {0}, Projected qty,Geplante Menge, Sales person,Vertriebsmitarbeiter, Serial No {0} Created,Seriennummer {0} Erstellt,