Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tomar Tipo de cambio actual en la FV #634

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion erpnext/selling/doctype/sales_order/sales_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,14 +671,20 @@ def update_item(source, target, source_parent):
if cost_center:
target.cost_center = cost_center

no_copy_conversion_date_from_ov_to_si = cint(frappe.db.get_single_value('Selling Settings', 'no_copy_conversion_date_from_ov_to_si'))
if no_copy_conversion_date_from_ov_to_si:
field_no_map = ["payment_terms_template", "conversion_rate"]
else:
field_no_map = ["payment_terms_template"]

doclist = get_mapped_doc("Sales Order", source_name, {
"Sales Order": {
"doctype": "Sales Invoice",
"field_map": {
"party_account_currency": "party_account_currency",
"payment_terms_template": "payment_terms_template"
},
"field_no_map": ["payment_terms_template"],
"field_no_map": field_no_map,
"validation": {
"docstatus": ["=", 1]
}
Expand Down
13 changes: 10 additions & 3 deletions erpnext/selling/doctype/selling_settings/selling_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"allow_multiple_items",
"allow_against_multiple_purchase_orders",
"hide_tax_id",
"approval_required_for_sales_commission_payout"
"approval_required_for_sales_commission_payout",
"no_copy_conversion_date_from_ov_to_si"
],
"fields": [
{
Expand Down Expand Up @@ -235,14 +236,20 @@
"in_list_view": 1,
"label": "Tipo de Documento Predeterminado",
"options": "Tipo de Documento"
},
{
"default": "0",
"fieldname": "no_copy_conversion_date_from_ov_to_si",
"fieldtype": "Check",
"label": "No usar el valor de cambio de la Orden de Venta al crear una Factura de Venta"
}
],
"icon": "fa fa-cog",
"idx": 1,
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2021-09-18 23:05:06.139820",
"modified": "2023-02-10 13:11:12.234464",
"modified_by": "Administrator",
"module": "Selling",
"name": "Selling Settings",
Expand All @@ -261,4 +268,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1
}
}