mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-06 23:10:26 +00:00
[mapper]
This commit is contained in:
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user