mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
fix: Map warehouse and serial no
This commit is contained in:
@@ -1548,6 +1548,26 @@ def make_inter_company_transaction(doctype, source_name, target_doc=None):
|
|||||||
if currency:
|
if currency:
|
||||||
target_doc.currency = currency
|
target_doc.currency = currency
|
||||||
|
|
||||||
|
item_field_map = {
|
||||||
|
"doctype": target_doctype + " Item",
|
||||||
|
"field_no_map": [
|
||||||
|
"income_account",
|
||||||
|
"expense_account",
|
||||||
|
"cost_center",
|
||||||
|
"warehouse"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
if source_doc.get('update_stock'):
|
||||||
|
item_field_map.update({
|
||||||
|
'field_map': {
|
||||||
|
source_document_warehouse_field: target_document_warehouse_field,
|
||||||
|
'batch_no': 'batch_no',
|
||||||
|
'serial_no': 'serial_no'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
doclist = get_mapped_doc(doctype, source_name, {
|
doclist = get_mapped_doc(doctype, source_name, {
|
||||||
doctype: {
|
doctype: {
|
||||||
"doctype": target_doctype,
|
"doctype": target_doctype,
|
||||||
@@ -1619,22 +1639,22 @@ def update_multi_mode_option(doc, pos_profile):
|
|||||||
|
|
||||||
for pos_payment_method in pos_profile.get('payments'):
|
for pos_payment_method in pos_profile.get('payments'):
|
||||||
pos_payment_method = pos_payment_method.as_dict()
|
pos_payment_method = pos_payment_method.as_dict()
|
||||||
|
|
||||||
payment_mode = get_mode_of_payment_info(pos_payment_method.mode_of_payment, doc.company)
|
payment_mode = get_mode_of_payment_info(pos_payment_method.mode_of_payment, doc.company)
|
||||||
payment_mode[0].default = pos_payment_method.default
|
payment_mode[0].default = pos_payment_method.default
|
||||||
append_payment(payment_mode[0])
|
append_payment(payment_mode[0])
|
||||||
|
|
||||||
def get_all_mode_of_payments(doc):
|
def get_all_mode_of_payments(doc):
|
||||||
return frappe.db.sql("""
|
return frappe.db.sql("""
|
||||||
select mpa.default_account, mpa.parent, mp.type as type
|
select mpa.default_account, mpa.parent, mp.type as type
|
||||||
from `tabMode of Payment Account` mpa,`tabMode of Payment` mp
|
from `tabMode of Payment Account` mpa,`tabMode of Payment` mp
|
||||||
where mpa.parent = mp.name and mpa.company = %(company)s and mp.enabled = 1""",
|
where mpa.parent = mp.name and mpa.company = %(company)s and mp.enabled = 1""",
|
||||||
{'company': doc.company}, as_dict=1)
|
{'company': doc.company}, as_dict=1)
|
||||||
|
|
||||||
def get_mode_of_payment_info(mode_of_payment, company):
|
def get_mode_of_payment_info(mode_of_payment, company):
|
||||||
return frappe.db.sql("""
|
return frappe.db.sql("""
|
||||||
select mpa.default_account, mpa.parent, mp.type as type
|
select mpa.default_account, mpa.parent, mp.type as type
|
||||||
from `tabMode of Payment Account` mpa,`tabMode of Payment` mp
|
from `tabMode of Payment Account` mpa,`tabMode of Payment` mp
|
||||||
where mpa.parent = mp.name and mpa.company = %s and mp.enabled = 1 and mp.name = %s""",
|
where mpa.parent = mp.name and mpa.company = %s and mp.enabled = 1 and mp.name = %s""",
|
||||||
(company, mode_of_payment), as_dict=1)
|
(company, mode_of_payment), as_dict=1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user