mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 10:11:20 +00:00
Merge branch 'develop' into fg_based_operating_cost
This commit is contained in:
@@ -247,7 +247,7 @@ class PaymentEntry(AccountsController):
|
|||||||
self.set_target_exchange_rate(ref_doc)
|
self.set_target_exchange_rate(ref_doc)
|
||||||
|
|
||||||
def set_source_exchange_rate(self, ref_doc=None):
|
def set_source_exchange_rate(self, ref_doc=None):
|
||||||
if self.paid_from and not self.source_exchange_rate:
|
if self.paid_from:
|
||||||
if self.paid_from_account_currency == self.company_currency:
|
if self.paid_from_account_currency == self.company_currency:
|
||||||
self.source_exchange_rate = 1
|
self.source_exchange_rate = 1
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -743,9 +743,9 @@ class TestPurchaseOrder(FrappeTestCase):
|
|||||||
pe = get_payment_entry("Purchase Order", po_doc.name)
|
pe = get_payment_entry("Purchase Order", po_doc.name)
|
||||||
pe.mode_of_payment = "Cash"
|
pe.mode_of_payment = "Cash"
|
||||||
pe.paid_from = "Cash - _TC"
|
pe.paid_from = "Cash - _TC"
|
||||||
pe.source_exchange_rate = 80
|
pe.source_exchange_rate = 1
|
||||||
pe.target_exchange_rate = 1
|
pe.target_exchange_rate = 80
|
||||||
pe.paid_amount = po_doc.grand_total
|
pe.paid_amount = po_doc.base_grand_total
|
||||||
pe.save(ignore_permissions=True)
|
pe.save(ignore_permissions=True)
|
||||||
pe.submit()
|
pe.submit()
|
||||||
|
|
||||||
|
|||||||
@@ -216,6 +216,7 @@ class RequestforQuotation(BuyingController):
|
|||||||
recipients=data.email_id,
|
recipients=data.email_id,
|
||||||
sender=sender,
|
sender=sender,
|
||||||
attachments=attachments,
|
attachments=attachments,
|
||||||
|
print_format=self.meta.default_print_format or "Standard",
|
||||||
send_email=True,
|
send_email=True,
|
||||||
doctype=self.doctype,
|
doctype=self.doctype,
|
||||||
name=self.name,
|
name=self.name,
|
||||||
@@ -224,9 +225,7 @@ class RequestforQuotation(BuyingController):
|
|||||||
frappe.msgprint(_("Email Sent to Supplier {0}").format(data.supplier))
|
frappe.msgprint(_("Email Sent to Supplier {0}").format(data.supplier))
|
||||||
|
|
||||||
def get_attachments(self):
|
def get_attachments(self):
|
||||||
attachments = [d.name for d in get_attachments(self.doctype, self.name)]
|
return [d.name for d in get_attachments(self.doctype, self.name)]
|
||||||
attachments.append(frappe.attach_print(self.doctype, self.name, doc=self))
|
|
||||||
return attachments
|
|
||||||
|
|
||||||
def update_rfq_supplier_status(self, sup_name=None):
|
def update_rfq_supplier_status(self, sup_name=None):
|
||||||
for supplier in self.suppliers:
|
for supplier in self.suppliers:
|
||||||
|
|||||||
@@ -316,6 +316,7 @@ erpnext.patches.v14_0.create_accounting_dimensions_in_subcontracting_doctypes
|
|||||||
erpnext.patches.v14_0.fix_subcontracting_receipt_gl_entries
|
erpnext.patches.v14_0.fix_subcontracting_receipt_gl_entries
|
||||||
erpnext.patches.v14_0.migrate_remarks_from_gl_to_payment_ledger
|
erpnext.patches.v14_0.migrate_remarks_from_gl_to_payment_ledger
|
||||||
erpnext.patches.v13_0.update_schedule_type_in_loans
|
erpnext.patches.v13_0.update_schedule_type_in_loans
|
||||||
|
erpnext.patches.v13_0.drop_unused_sle_index_parts
|
||||||
erpnext.patches.v14_0.create_accounting_dimensions_for_asset_capitalization
|
erpnext.patches.v14_0.create_accounting_dimensions_for_asset_capitalization
|
||||||
erpnext.patches.v14_0.update_partial_tds_fields
|
erpnext.patches.v14_0.update_partial_tds_fields
|
||||||
erpnext.patches.v14_0.create_incoterms_and_migrate_shipment
|
erpnext.patches.v14_0.create_incoterms_and_migrate_shipment
|
||||||
|
|||||||
14
erpnext/patches/v13_0/drop_unused_sle_index_parts.py
Normal file
14
erpnext/patches/v13_0/drop_unused_sle_index_parts.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import frappe
|
||||||
|
|
||||||
|
from erpnext.stock.doctype.stock_ledger_entry.stock_ledger_entry import on_doctype_update
|
||||||
|
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
try:
|
||||||
|
frappe.db.sql_ddl("ALTER TABLE `tabStock Ledger Entry` DROP INDEX `posting_sort_index`")
|
||||||
|
except Exception:
|
||||||
|
frappe.log_error("Failed to drop index")
|
||||||
|
return
|
||||||
|
|
||||||
|
# Recreate indexes
|
||||||
|
on_doctype_update()
|
||||||
@@ -1691,7 +1691,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
var valid = true;
|
var valid = true;
|
||||||
|
|
||||||
$.each(["company", "customer"], function(i, fieldname) {
|
$.each(["company", "customer"], function(i, fieldname) {
|
||||||
if(frappe.meta.has_field(me.frm.doc.doctype, fieldname) && me.frm.doc.doctype != "Purchase Order") {
|
if(frappe.meta.has_field(me.frm.doc.doctype, fieldname) && !["Purchase Order","Purchase Invoice"].includes(me.frm.doc.doctype)) {
|
||||||
if (!me.frm.doc[fieldname]) {
|
if (!me.frm.doc[fieldname]) {
|
||||||
frappe.msgprint(__("Please specify") + ": " +
|
frappe.msgprint(__("Please specify") + ": " +
|
||||||
frappe.meta.get_label(me.frm.doc.doctype, fieldname, me.frm.doc.name) +
|
frappe.meta.get_label(me.frm.doc.doctype, fieldname, me.frm.doc.name) +
|
||||||
|
|||||||
@@ -221,14 +221,9 @@ class StockLedgerEntry(Document):
|
|||||||
|
|
||||||
|
|
||||||
def on_doctype_update():
|
def on_doctype_update():
|
||||||
if not frappe.db.has_index("tabStock Ledger Entry", "posting_sort_index"):
|
frappe.db.add_index(
|
||||||
frappe.db.commit()
|
"Stock Ledger Entry", fields=["posting_date", "posting_time"], index_name="posting_sort_index"
|
||||||
frappe.db.add_index(
|
)
|
||||||
"Stock Ledger Entry",
|
|
||||||
fields=["posting_date", "posting_time", "name"],
|
|
||||||
index_name="posting_sort_index",
|
|
||||||
)
|
|
||||||
|
|
||||||
frappe.db.add_index("Stock Ledger Entry", ["voucher_no", "voucher_type"])
|
frappe.db.add_index("Stock Ledger Entry", ["voucher_no", "voucher_type"])
|
||||||
frappe.db.add_index("Stock Ledger Entry", ["batch_no", "item_code", "warehouse"])
|
frappe.db.add_index("Stock Ledger Entry", ["batch_no", "item_code", "warehouse"])
|
||||||
frappe.db.add_index("Stock Ledger Entry", ["warehouse", "item_code"], "item_warehouse")
|
frappe.db.add_index("Stock Ledger Entry", ["warehouse", "item_code"], "item_warehouse")
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ def get_data(report_filters):
|
|||||||
key = (d.voucher_type, d.voucher_no)
|
key = (d.voucher_type, d.voucher_no)
|
||||||
gl_data = voucher_wise_gl_data.get(key) or {}
|
gl_data = voucher_wise_gl_data.get(key) or {}
|
||||||
d.account_value = gl_data.get("account_value", 0)
|
d.account_value = gl_data.get("account_value", 0)
|
||||||
d.difference_value = abs(d.stock_value - d.account_value)
|
d.difference_value = d.stock_value - d.account_value
|
||||||
if abs(d.difference_value) > 0.1:
|
if abs(d.difference_value) > 0.1:
|
||||||
data.append(d)
|
data.append(d)
|
||||||
|
|
||||||
|
|||||||
@@ -1270,20 +1270,6 @@ def get_valuation_rate(
|
|||||||
(item_code, warehouse, voucher_no, voucher_type),
|
(item_code, warehouse, voucher_no, voucher_type),
|
||||||
)
|
)
|
||||||
|
|
||||||
if not last_valuation_rate:
|
|
||||||
# Get valuation rate from last sle for the item against any warehouse
|
|
||||||
last_valuation_rate = frappe.db.sql(
|
|
||||||
"""select valuation_rate
|
|
||||||
from `tabStock Ledger Entry` force index (item_code)
|
|
||||||
where
|
|
||||||
item_code = %s
|
|
||||||
AND valuation_rate > 0
|
|
||||||
AND is_cancelled = 0
|
|
||||||
AND NOT(voucher_no = %s AND voucher_type = %s)
|
|
||||||
order by posting_date desc, posting_time desc, name desc limit 1""",
|
|
||||||
(item_code, voucher_no, voucher_type),
|
|
||||||
)
|
|
||||||
|
|
||||||
if last_valuation_rate:
|
if last_valuation_rate:
|
||||||
return flt(last_valuation_rate[0][0])
|
return flt(last_valuation_rate[0][0])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user