[mapper]
This commit is contained in:
parent
1bec8012d2
commit
126aedda08
@ -1,132 +0,0 @@
|
||||
[
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-08-03 12:33:04",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-08-06 16:45:56"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"parent": "Supplier Quotation-Purchase Order",
|
||||
"doctype": "Table Mapper Detail",
|
||||
"parenttype": "DocType Mapper",
|
||||
"validation_logic": "docstatus = 1",
|
||||
"parentfield": "table_mapper_details"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"parent": "Supplier Quotation-Purchase Order",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"parenttype": "DocType Mapper",
|
||||
"parentfield": "field_mapper_details"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"to_doctype": "Purchase Order",
|
||||
"module": "Buying",
|
||||
"doctype": "DocType Mapper",
|
||||
"ref_doc_submitted": 1,
|
||||
"from_doctype": "Supplier Quotation"
|
||||
},
|
||||
{
|
||||
"name": "Supplier Quotation-Purchase Order",
|
||||
"doctype": "DocType Mapper"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "company",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "company",
|
||||
"checking_operator": "="
|
||||
},
|
||||
{
|
||||
"map": "No",
|
||||
"match_id": 0,
|
||||
"to_field": "transaction_date",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "transaction_date",
|
||||
"checking_operator": ">="
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "conversion_rate",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "conversion_rate"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "net_total",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "net_total"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "total_tax",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "total_tax"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "grand_total",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "grand_total"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 1,
|
||||
"to_field": "supplier_quotation",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "parent"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 1,
|
||||
"to_field": "supplier_quotation_item",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "name"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 1,
|
||||
"to_field": "stock_uom",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "uom"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 1,
|
||||
"to_field": "conversion_factor",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "eval:flt(1)"
|
||||
},
|
||||
{
|
||||
"reference_key": "prevdoc_docname",
|
||||
"match_id": 0,
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_table": "Supplier Quotation",
|
||||
"to_table": "Purchase Order"
|
||||
},
|
||||
{
|
||||
"match_id": 1,
|
||||
"reference_doctype_key": "prevdoc_doctype",
|
||||
"to_field": "po_details",
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_field": "quotation_details",
|
||||
"from_table": "Supplier Quotation Item",
|
||||
"to_table": "Purchase Order Item"
|
||||
},
|
||||
{
|
||||
"match_id": 2,
|
||||
"to_field": "purchase_tax_details",
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_field": "purchase_tax_details",
|
||||
"from_table": "Purchase Taxes and Charges",
|
||||
"to_table": "Purchase Taxes and Charges"
|
||||
}
|
||||
]
|
@ -252,10 +252,9 @@ def make_purchase_invoice(source_name, target_doclist=None):
|
||||
|
||||
def update_item(obj, target, source_parent):
|
||||
target.conversion_factor = 1
|
||||
target.qty = (flt(obj.amount) - flt(obj.billed_amt)) / flt(obj.purchase_rate)
|
||||
target.import_amount = (flt(obj.amount) - flt(obj.billed_amt)) / \
|
||||
flt(source_parent.conversion_rate)
|
||||
target.amount = flt(obj.amount) - flt(obj.billed_amt)
|
||||
target.import_amount = flt(obj.import_amount) - flt(obj.billed_amt)
|
||||
target.amount = target.import_amount / flt(source_parent.conversion_rate)
|
||||
target.qty = target.amount / flt(obj.purchase_rate)
|
||||
|
||||
doclist = get_mapped_doclist("Purchase Order", source_name, {
|
||||
"Purchase Order": {
|
||||
|
@ -1,63 +0,0 @@
|
||||
[
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2010-08-08 17:09:34",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2011-09-14 12:36:24"
|
||||
},
|
||||
{
|
||||
"match_id": 0,
|
||||
"parent": "Lead-Customer",
|
||||
"name": "__common__",
|
||||
"doctype": "Table Mapper Detail",
|
||||
"parenttype": "DocType Mapper",
|
||||
"from_table": "Lead",
|
||||
"to_table": "Customer",
|
||||
"validation_logic": "name is not null",
|
||||
"parentfield": "table_mapper_details"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"parent": "Lead-Customer",
|
||||
"name": "__common__",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"parenttype": "DocType Mapper",
|
||||
"parentfield": "field_mapper_details"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"to_doctype": "Customer",
|
||||
"module": "Selling",
|
||||
"doctype": "DocType Mapper",
|
||||
"from_doctype": "Lead"
|
||||
},
|
||||
{
|
||||
"name": "Lead-Customer",
|
||||
"doctype": "DocType Mapper"
|
||||
},
|
||||
{
|
||||
"to_field": "lead_name",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "name"
|
||||
},
|
||||
{
|
||||
"to_field": "customer_name",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "company_name"
|
||||
},
|
||||
{
|
||||
"to_field": "phone_1",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "contact_no"
|
||||
},
|
||||
{
|
||||
"to_field": "fax_1",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "fax"
|
||||
},
|
||||
{
|
||||
"doctype": "Table Mapper Detail"
|
||||
}
|
||||
]
|
@ -1,66 +0,0 @@
|
||||
[
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2010-08-08 17:09:34",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-04-03 12:49:50"
|
||||
},
|
||||
{
|
||||
"match_id": 0,
|
||||
"parent": "Lead-Opportunity",
|
||||
"name": "__common__",
|
||||
"doctype": "Table Mapper Detail",
|
||||
"parenttype": "DocType Mapper",
|
||||
"from_table": "Lead",
|
||||
"to_table": "Opportunity",
|
||||
"validation_logic": "name is not null",
|
||||
"parentfield": "table_mapper_details"
|
||||
},
|
||||
{
|
||||
"match_id": 0,
|
||||
"parent": "Lead-Opportunity",
|
||||
"name": "__common__",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"parenttype": "DocType Mapper",
|
||||
"parentfield": "field_mapper_details"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"to_doctype": "Opportunity",
|
||||
"module": "Selling",
|
||||
"doctype": "DocType Mapper",
|
||||
"from_doctype": "Lead"
|
||||
},
|
||||
{
|
||||
"name": "Lead-Opportunity",
|
||||
"doctype": "DocType Mapper"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"to_field": "campaign",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "campaign_name"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"to_field": "enquiry_from",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "doctype"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"to_field": "lead",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "name"
|
||||
},
|
||||
{
|
||||
"map": "No",
|
||||
"to_field": "status",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "status"
|
||||
},
|
||||
{
|
||||
"doctype": "Table Mapper Detail"
|
||||
}
|
||||
]
|
@ -1,130 +0,0 @@
|
||||
[
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2010-08-08 17:09:35",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2011-09-14 12:36:24"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"parent": "Quotation-Sales Order",
|
||||
"doctype": "Table Mapper Detail",
|
||||
"parenttype": "DocType Mapper",
|
||||
"parentfield": "table_mapper_details"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"parent": "Quotation-Sales Order",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"parenttype": "DocType Mapper",
|
||||
"parentfield": "field_mapper_details"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"to_doctype": "Sales Order",
|
||||
"module": "Selling",
|
||||
"doctype": "DocType Mapper",
|
||||
"ref_doc_submitted": 1,
|
||||
"from_doctype": "Quotation"
|
||||
},
|
||||
{
|
||||
"name": "Quotation-Sales Order",
|
||||
"doctype": "DocType Mapper"
|
||||
},
|
||||
{
|
||||
"map": "No",
|
||||
"match_id": 0,
|
||||
"to_field": "transaction_date",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "transaction_date",
|
||||
"checking_operator": ">="
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "quotation_date",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "transaction_date"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "quotation_no",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "name"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "company",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "company",
|
||||
"checking_operator": "="
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "fiscal_year",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "fiscal_year",
|
||||
"checking_operator": "="
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 1,
|
||||
"to_field": "prevdoc_docname",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "parent"
|
||||
},
|
||||
{
|
||||
"map": "No",
|
||||
"match_id": 0,
|
||||
"to_field": "naming_series",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "naming_series"
|
||||
},
|
||||
{
|
||||
"map": "No",
|
||||
"match_id": 0,
|
||||
"to_field": "status",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "status"
|
||||
},
|
||||
{
|
||||
"match_id": 3,
|
||||
"to_field": "sales_team",
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_field": "sales_team",
|
||||
"from_table": "Sales Team",
|
||||
"to_table": "Sales Team",
|
||||
"validation_logic": "name is not null"
|
||||
},
|
||||
{
|
||||
"match_id": 2,
|
||||
"to_field": "other_charges",
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_field": "other_charges",
|
||||
"from_table": "Sales Taxes and Charges",
|
||||
"to_table": "Sales Taxes and Charges",
|
||||
"validation_logic": "name is not null"
|
||||
},
|
||||
{
|
||||
"match_id": 1,
|
||||
"reference_doctype_key": "prevdoc_doctype",
|
||||
"to_field": "sales_order_details",
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_field": "quotation_details",
|
||||
"from_table": "Quotation Item",
|
||||
"to_table": "Sales Order Item",
|
||||
"validation_logic": "name is not null"
|
||||
},
|
||||
{
|
||||
"reference_key": "prevdoc_docname",
|
||||
"match_id": 0,
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_table": "Quotation",
|
||||
"to_table": "Sales Order",
|
||||
"validation_logic": "docstatus = 1"
|
||||
}
|
||||
]
|
@ -448,11 +448,10 @@ def make_delivery_note(source_name, target_doclist=None):
|
||||
def make_sales_invoice(source_name, target_doclist=None):
|
||||
from webnotes.model.mapper import get_mapped_doclist
|
||||
|
||||
def update_item(obj, target):
|
||||
target.export_amount = (flt(obj.amount) - flt(obj.billed_amt))* flt(obj.export_rate)/flt(obj.basic_rate)
|
||||
target.qty = obj.basic_rate and \
|
||||
(flt(obj.amount) - flt(obj.billed_amt))/flt(obj.basic_rate) or obj.qty
|
||||
target.amount = flt(obj.amount) - flt(obj.billed_amt)
|
||||
def update_item(obj, target, source_parent):
|
||||
target.export_amount = flt(obj.amount) - flt(obj.billed_amt)
|
||||
target.amount = target.export_amount / flt(source_parent.conversion_rate)
|
||||
target.qty = obj.basic_rate and target.amount / flt(obj.basic_rate) or obj.qty
|
||||
|
||||
def update_accounts(source, target):
|
||||
si = webnotes.bean(target)
|
||||
|
@ -1,107 +0,0 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-02-20 16:54:17",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-02-20 16:54:17",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"doctype": "Table Mapper Detail",
|
||||
"name": "__common__",
|
||||
"parent": "Material Request-Stock Entry",
|
||||
"parentfield": "table_mapper_details",
|
||||
"parenttype": "DocType Mapper"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"map": "Yes",
|
||||
"name": "__common__",
|
||||
"parent": "Material Request-Stock Entry",
|
||||
"parentfield": "field_mapper_details",
|
||||
"parenttype": "DocType Mapper"
|
||||
},
|
||||
{
|
||||
"doctype": "DocType Mapper",
|
||||
"from_doctype": "Material Request",
|
||||
"module": "Stock",
|
||||
"name": "__common__",
|
||||
"ref_doc_submitted": 1,
|
||||
"to_doctype": "Stock Entry"
|
||||
},
|
||||
{
|
||||
"doctype": "DocType Mapper",
|
||||
"name": "Material Request-Stock Entry"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "eval:\"Material Transfer\"",
|
||||
"match_id": 0,
|
||||
"to_field": "purpose"
|
||||
},
|
||||
{
|
||||
"checking_operator": "=",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "company",
|
||||
"match_id": 0,
|
||||
"to_field": "company"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "parent",
|
||||
"match_id": 1,
|
||||
"to_field": "material_request"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "name",
|
||||
"match_id": 1,
|
||||
"to_field": "material_request_item"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "uom",
|
||||
"match_id": 1,
|
||||
"to_field": "stock_uom"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "eval:flt(1)",
|
||||
"match_id": 1,
|
||||
"to_field": "conversion_factor"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "eval:flt(obj.qty) - flt(obj.ordered_qty)",
|
||||
"match_id": 1,
|
||||
"to_field": "transfer_qty"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "eval:flt(obj.qty) - flt(obj.ordered_qty)",
|
||||
"match_id": 1,
|
||||
"to_field": "qty"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "warehouse",
|
||||
"match_id": 1,
|
||||
"to_field": "t_warehouse"
|
||||
},
|
||||
{
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_table": "Material Request",
|
||||
"match_id": 0,
|
||||
"to_table": "Stock Entry",
|
||||
"validation_logic": "docstatus = 1"
|
||||
},
|
||||
{
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_field": "indent_details",
|
||||
"from_table": "Material Request Item",
|
||||
"match_id": 1,
|
||||
"to_field": "mtn_details",
|
||||
"to_table": "Stock Entry Detail",
|
||||
"validation_logic": "qty > ifnull(ordered_qty,0) and docstatus =1"
|
||||
}
|
||||
]
|
@ -1,170 +0,0 @@
|
||||
[
|
||||
{
|
||||
"creation": "2013-02-22 01:28:05",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-03-26 07:58:20",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"doctype": "Table Mapper Detail",
|
||||
"name": "__common__",
|
||||
"parent": "Purchase Order-Purchase Receipt",
|
||||
"parentfield": "table_mapper_details",
|
||||
"parenttype": "DocType Mapper"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"map": "Yes",
|
||||
"name": "__common__",
|
||||
"parent": "Purchase Order-Purchase Receipt",
|
||||
"parentfield": "field_mapper_details",
|
||||
"parenttype": "DocType Mapper"
|
||||
},
|
||||
{
|
||||
"doctype": "DocType Mapper",
|
||||
"from_doctype": "Purchase Order",
|
||||
"module": "Stock",
|
||||
"name": "__common__",
|
||||
"ref_doc_submitted": 1,
|
||||
"to_doctype": "Purchase Receipt"
|
||||
},
|
||||
{
|
||||
"doctype": "DocType Mapper",
|
||||
"name": "Purchase Order-Purchase Receipt"
|
||||
},
|
||||
{
|
||||
"checking_operator": "=",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "supplier",
|
||||
"match_id": 0,
|
||||
"to_field": "supplier"
|
||||
},
|
||||
{
|
||||
"checking_operator": "=",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "company",
|
||||
"match_id": 0,
|
||||
"to_field": "company"
|
||||
},
|
||||
{
|
||||
"checking_operator": "=",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "currency",
|
||||
"match_id": 0,
|
||||
"to_field": "currency"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "name",
|
||||
"match_id": 1,
|
||||
"to_field": "prevdoc_detail_docname"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "parent",
|
||||
"match_id": 1,
|
||||
"to_field": "prevdoc_docname"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "parenttype",
|
||||
"match_id": 1,
|
||||
"to_field": "prevdoc_doctype"
|
||||
},
|
||||
{
|
||||
"checking_operator": "=",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "item_code",
|
||||
"match_id": 1,
|
||||
"to_field": "item_code"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "eval:(flt(obj.qty) - flt(obj.received_qty)) ",
|
||||
"match_id": 1,
|
||||
"to_field": "received_qty"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "eval:(flt(obj.qty) - flt(obj.received_qty)) ",
|
||||
"match_id": 1,
|
||||
"to_field": "qty"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "eval:(flt(obj.qty) - flt(obj.received_qty)) * flt(obj.conversion_factor)",
|
||||
"match_id": 1,
|
||||
"to_field": "stock_qty"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "eval:(flt(obj.qty) - flt(obj.received_qty)) * flt(obj.import_rate)",
|
||||
"match_id": 1,
|
||||
"to_field": "import_amount"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "eval:(flt(obj.qty) - flt(obj.received_qty)) * flt(obj.purchase_rate)",
|
||||
"match_id": 1,
|
||||
"to_field": "amount"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "schedule_date",
|
||||
"match_id": 1,
|
||||
"to_field": "schedule_date"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "net_total",
|
||||
"match_id": 0,
|
||||
"to_field": "net_total"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "grand_total",
|
||||
"match_id": 0,
|
||||
"to_field": "grand_total"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "total_tax",
|
||||
"match_id": 0,
|
||||
"to_field": "total_tax"
|
||||
},
|
||||
{
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "conversion_rate",
|
||||
"match_id": 0,
|
||||
"to_field": "conversion_rate"
|
||||
},
|
||||
{
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_field": "po_details",
|
||||
"from_table": "Purchase Order Item",
|
||||
"match_id": 1,
|
||||
"reference_doctype_key": "prevdoc_doctype",
|
||||
"reference_key": "prevdoc_detail_docname",
|
||||
"to_field": "purchase_receipt_details",
|
||||
"to_table": "Purchase Receipt Item",
|
||||
"validation_logic": "docstatus=1 and qty > ifnull(received_qty,0)"
|
||||
},
|
||||
{
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_table": "Purchase Order",
|
||||
"match_id": 0,
|
||||
"reference_key": "prevdoc_docname",
|
||||
"to_table": "Purchase Receipt",
|
||||
"validation_logic": "docstatus = 1"
|
||||
},
|
||||
{
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_field": "purchase_tax_details",
|
||||
"from_table": "Purchase Taxes and Charges",
|
||||
"match_id": 2,
|
||||
"to_field": "purchase_tax_details",
|
||||
"to_table": "Purchase Taxes and Charges",
|
||||
"validation_logic": "docstatus = 1"
|
||||
}
|
||||
]
|
@ -1,203 +0,0 @@
|
||||
[
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2010-08-08 17:09:35",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-05-08 11:50:18"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"parent": "Sales Order-Delivery Note",
|
||||
"doctype": "Table Mapper Detail",
|
||||
"parenttype": "DocType Mapper",
|
||||
"parentfield": "table_mapper_details"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"parent": "Sales Order-Delivery Note",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"parenttype": "DocType Mapper",
|
||||
"parentfield": "field_mapper_details"
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
"to_doctype": "Delivery Note",
|
||||
"module": "Stock",
|
||||
"doctype": "DocType Mapper",
|
||||
"ref_doc_submitted": 1,
|
||||
"from_doctype": "Sales Order"
|
||||
},
|
||||
{
|
||||
"name": "Sales Order-Delivery Note",
|
||||
"doctype": "DocType Mapper"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "sales_order_no",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "name"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "company",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "company",
|
||||
"checking_operator": "="
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "currency",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "currency",
|
||||
"checking_operator": "="
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "customer_address",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "shipping_address_name"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "address_display",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "shipping_address"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 1,
|
||||
"to_field": "prevdoc_docname",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "parent"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 1,
|
||||
"to_field": "prevdoc_doctype",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "parenttype"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 1,
|
||||
"to_field": "prevdoc_detail_docname",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "name"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 1,
|
||||
"to_field": "export_amount",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "eval: (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.export_rate)"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 1,
|
||||
"to_field": "export_rate",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "export_rate",
|
||||
"checking_operator": "="
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 1,
|
||||
"to_field": "qty",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "eval: flt(obj.qty) - flt(obj.delivered_qty)"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 1,
|
||||
"to_field": "amount",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "eval: (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.basic_rate)"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 1,
|
||||
"to_field": "warehouse",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "reserved_warehouse"
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "project_name",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "project_name",
|
||||
"checking_operator": "="
|
||||
},
|
||||
{
|
||||
"map": "Yes",
|
||||
"match_id": 0,
|
||||
"to_field": "customer",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "customer",
|
||||
"checking_operator": "="
|
||||
},
|
||||
{
|
||||
"map": "No",
|
||||
"match_id": 0,
|
||||
"to_field": "naming_series",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "naming_series"
|
||||
},
|
||||
{
|
||||
"map": "No",
|
||||
"match_id": 0,
|
||||
"to_field": "status",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "status"
|
||||
},
|
||||
{
|
||||
"map": "No",
|
||||
"match_id": 3,
|
||||
"to_field": "incentives",
|
||||
"doctype": "Field Mapper Detail",
|
||||
"from_field": "incentives"
|
||||
},
|
||||
{
|
||||
"match_id": 3,
|
||||
"to_field": "sales_team",
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_field": "sales_team",
|
||||
"from_table": "Sales Team",
|
||||
"to_table": "Sales Team",
|
||||
"validation_logic": "name is not null"
|
||||
},
|
||||
{
|
||||
"match_id": 2,
|
||||
"to_field": "other_charges",
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_field": "other_charges",
|
||||
"from_table": "Sales Taxes and Charges",
|
||||
"to_table": "Sales Taxes and Charges",
|
||||
"validation_logic": "name is not null"
|
||||
},
|
||||
{
|
||||
"reference_key": "prevdoc_detail_docname",
|
||||
"match_id": 1,
|
||||
"reference_doctype_key": "prevdoc_doctype",
|
||||
"to_field": "delivery_note_details",
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_field": "sales_order_details",
|
||||
"from_table": "Sales Order Item",
|
||||
"to_table": "Delivery Note Item",
|
||||
"validation_logic": "qty > ifnull(delivered_qty,0) and docstatus = 1"
|
||||
},
|
||||
{
|
||||
"reference_key": "prevdoc_docname",
|
||||
"match_id": 0,
|
||||
"doctype": "Table Mapper Detail",
|
||||
"from_table": "Sales Order",
|
||||
"to_table": "Delivery Note",
|
||||
"validation_logic": "docstatus = 1"
|
||||
}
|
||||
]
|
@ -339,10 +339,9 @@ def make_purchase_invoice(source_name, target_doclist=None):
|
||||
|
||||
def update_item(obj, target, source_parent):
|
||||
target.conversion_factor = 1
|
||||
target.qty = (flt(obj.amount) - flt(obj.billed_amt)) / flt(obj.purchase_rate)
|
||||
target.import_amount = (flt(obj.amount) - flt(obj.billed_amt)) / \
|
||||
flt(source_parent.conversion_rate)
|
||||
target.amount = flt(obj.amount) - flt(obj.billed_amt)
|
||||
target.import_amount = flt(obj.import_amount) - flt(obj.billed_amt)
|
||||
target.amount = target.import_amount / flt(source_parent.conversion_rate)
|
||||
target.qty = target.amount / flt(obj.purchase_rate)
|
||||
|
||||
doclist = get_mapped_doclist("Purchase Receipt", source_name, {
|
||||
"Purchase Receipt": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user