Merge branch 'master' into perpetual

This commit is contained in:
Nabin Hait
2013-08-02 11:53:00 +05:30
24 changed files with 149 additions and 55 deletions

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 12:15:51",
"docstatus": 0,
"modified": "2013-07-26 11:16:53",
"modified": "2013-08-01 16:50:05",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -81,7 +81,6 @@
"reqd": 1
},
{
"default": "1",
"doctype": "DocField",
"fieldname": "conversion_rate",
"fieldtype": "Float",

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-21 16:16:39",
"docstatus": 0,
"modified": "2013-07-25 16:08:44",
"modified": "2013-08-01 16:49:49",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -223,7 +223,6 @@
"read_only": 0
},
{
"default": "1",
"description": "The rate at which Bill Currency is converted into company's base currency",
"doctype": "DocField",
"fieldname": "conversion_rate",

View File

@@ -93,12 +93,18 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
wn.model.map_current_doc({
method: "stock.doctype.delivery_note.delivery_note.make_sales_invoice",
source_doctype: "Delivery Note",
get_query_filters: {
docstatus: 1,
customer: cur_frm.doc.customer || undefined,
company: cur_frm.doc.company
get_query: function() {
var filters = {
docstatus: 1,
company: cur_frm.doc.company
};
if(cur_frm.doc.customer) filters["customer"] = cur_frm.doc.customer;
return {
query: "controllers.queries.get_delivery_notes_to_be_billed",
filters: filters
};
}
})
});
});
// cur_frm.add_custom_button(wn._("POS View"), function() {

View File

@@ -975,10 +975,12 @@ def make_delivery_note(source_name, target_doclist=None):
bean = webnotes.bean(target)
bean.run_method("onload_post_render")
def update_item(obj, target, source_parent):
target.amount = (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.basic_rate)
target.export_amount = (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.export_rate)
target.qty = flt(obj.qty) - flt(obj.delivered_qty)
def update_item(source_doc, target_doc, source_parent):
target_doc.amount = (flt(source_doc.qty) - flt(source_doc.delivered_qty)) * \
flt(source_doc.basic_rate)
target_doc.export_amount = (flt(source_doc.qty) - flt(source_doc.delivered_qty)) * \
flt(source_doc.export_rate)
target_doc.qty = flt(source_doc.qty) - flt(source_doc.delivered_qty)
doclist = get_mapped_doclist("Sales Invoice", source_name, {
"Sales Invoice": {