[mapper-pull] for sales / purchae

This commit is contained in:
Rushabh Mehta
2013-07-08 18:01:46 +05:30
parent 304a4a66b4
commit d9e7070f2d
20 changed files with 154 additions and 688 deletions

View File

@@ -94,8 +94,12 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend(
}
})
});
}
},
tc_name: function() {
this.get_terms();
},
});
// for backward compatibility: combine new and previous states

View File

@@ -243,7 +243,8 @@ def make_purchase_invoice(source_name, target_doclist=None):
target.conversion_factor = 1
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)
if flt(obj.purchase_rate):
target.qty = target.amount / flt(obj.purchase_rate)
doclist = get_mapped_doclist("Purchase Order", source_name, {
"Purchase Order": {

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-21 16:16:39",
"docstatus": 0,
"modified": "2013-07-08 15:12:46",
"modified": "2013-07-08 17:49:29",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -488,13 +488,6 @@
"options": "Terms and Conditions",
"print_hide": 1
},
{
"doctype": "DocField",
"fieldname": "get_terms",
"fieldtype": "Button",
"label": "Get Terms and Conditions",
"oldfieldtype": "Button"
},
{
"doctype": "DocField",
"fieldname": "terms",

View File

@@ -85,7 +85,8 @@ def _get_basic_details(args, item_bean):
"item_tax_rate": json.dumps(dict(([d.tax_type, d.tax_rate] for d in
item_bean.doclist.get({"parentfield": "item_tax"})))),
"batch_no": None,
"expense_head": item.purchase_account,
"expense_head": item.purchase_account \
or webnotes.conn.get_value("Company", args.company, "default_expense_account"),
"cost_center": item.cost_center
})