refactor: checkbox to toggle exchange rate inheritence in PO->PI
This commit is contained in:
parent
087f378a4f
commit
08315522bb
@ -36,6 +36,7 @@
|
|||||||
"currency_and_price_list",
|
"currency_and_price_list",
|
||||||
"currency",
|
"currency",
|
||||||
"conversion_rate",
|
"conversion_rate",
|
||||||
|
"use_transaction_date_exchange_rate",
|
||||||
"column_break2",
|
"column_break2",
|
||||||
"buying_price_list",
|
"buying_price_list",
|
||||||
"price_list_currency",
|
"price_list_currency",
|
||||||
@ -1588,13 +1589,20 @@
|
|||||||
"label": "Repost Required",
|
"label": "Repost Required",
|
||||||
"options": "Account",
|
"options": "Account",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "use_transaction_date_exchange_rate",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Use Transaction Date Exchange Rate",
|
||||||
|
"read_only": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-file-text",
|
"icon": "fa fa-file-text",
|
||||||
"idx": 204,
|
"idx": 204,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-10-01 21:01:47.282533",
|
"modified": "2023-10-16 16:24:51.886231",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Purchase Invoice",
|
"name": "Purchase Invoice",
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
"bill_for_rejected_quantity_in_purchase_invoice",
|
"bill_for_rejected_quantity_in_purchase_invoice",
|
||||||
"disable_last_purchase_rate",
|
"disable_last_purchase_rate",
|
||||||
"show_pay_button",
|
"show_pay_button",
|
||||||
|
"use_transaction_date_exchange_rate",
|
||||||
"subcontract",
|
"subcontract",
|
||||||
"backflush_raw_materials_of_subcontract_based_on",
|
"backflush_raw_materials_of_subcontract_based_on",
|
||||||
"column_break_11",
|
"column_break_11",
|
||||||
@ -164,6 +165,13 @@
|
|||||||
"fieldname": "over_order_allowance",
|
"fieldname": "over_order_allowance",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"label": "Over Order Allowance (%)"
|
"label": "Over Order Allowance (%)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"description": "While making Purchase Invoice from Purchase Order, use Exchange Rate on Invoice's transaction date rather than inheriting it from Purchase Order. Only applies for Purchase Invoice.",
|
||||||
|
"fieldname": "use_transaction_date_exchange_rate",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Use Transaction Date Exchange Rate"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-cog",
|
"icon": "fa fa-cog",
|
||||||
@ -171,7 +179,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-03-02 17:02:14.404622",
|
"modified": "2023-10-16 16:22:03.201078",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Buying Settings",
|
"name": "Buying Settings",
|
||||||
|
@ -572,6 +572,17 @@ class AccountsController(TransactionBase):
|
|||||||
self.currency, self.company_currency, transaction_date, args
|
self.currency, self.company_currency, transaction_date, args
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (
|
||||||
|
self.currency
|
||||||
|
and buying_or_selling == "Buying"
|
||||||
|
and frappe.db.get_single_value("Buying Settings", "use_transaction_date_exchange_rate")
|
||||||
|
and self.doctype == "Purchase Invoice"
|
||||||
|
):
|
||||||
|
self.use_transaction_date_exchange_rate = True
|
||||||
|
self.conversion_rate = get_exchange_rate(
|
||||||
|
self.currency, self.company_currency, transaction_date, args
|
||||||
|
)
|
||||||
|
|
||||||
def set_missing_item_details(self, for_validate=False):
|
def set_missing_item_details(self, for_validate=False):
|
||||||
"""set missing item values"""
|
"""set missing item values"""
|
||||||
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
|
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
|
||||||
|
Loading…
x
Reference in New Issue
Block a user