From bcbc2f6ce58fd52a5738d3edadb7f010d3cb883c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 13 Feb 2013 11:30:14 +0530 Subject: [PATCH] c-form fixes --- accounts/doctype/c_form/c_form.js | 4 ++++ accounts/doctype/c_form/c_form.py | 2 +- accounts/doctype/c_form/c_form.txt | 10 +++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/accounts/doctype/c_form/c_form.js b/accounts/doctype/c_form/c_form.js index 29c05f7223..d8c7d81f14 100644 --- a/accounts/doctype/c_form/c_form.js +++ b/accounts/doctype/c_form/c_form.js @@ -26,6 +26,10 @@ cur_frm.fields_dict.invoice_details.grid.get_field("invoice_no").get_query = fun } } +cur_frm.fields_dict.state.get_query = function(doc) { + return {filters: { country: "India"}} +} + cur_frm.cscript.invoice_no = function(doc, cdt, cdn) { var d = locals[cdt][cdn]; get_server_fields('get_invoice_details', d.invoice_no, 'invoice_details', doc, cdt, cdn, 1); diff --git a/accounts/doctype/c_form/c_form.py b/accounts/doctype/c_form/c_form.py index 5bca063dd7..2636b0cfc4 100644 --- a/accounts/doctype/c_form/c_form.py +++ b/accounts/doctype/c_form/c_form.py @@ -68,7 +68,7 @@ class DocType: self.set_total_invoiced_amount() def set_total_invoiced_amount(self): - total = sum([flt(d.total) for d in getlist(self.doclist, 'invoice_details')]) + total = sum([flt(d.grand_total) for d in getlist(self.doclist, 'invoice_details')]) webnotes.conn.set(self.doc, 'total_invoiced_amount', total) def get_invoice_details(self, invoice_no): diff --git a/accounts/doctype/c_form/c_form.txt b/accounts/doctype/c_form/c_form.txt index c429632d1f..3a956e9aec 100644 --- a/accounts/doctype/c_form/c_form.txt +++ b/accounts/doctype/c_form/c_form.txt @@ -1,8 +1,8 @@ [ { - "creation": "2013-01-19 10:23:34", + "creation": "2013-01-30 12:49:46", "docstatus": 0, - "modified": "2013-01-29 16:27:57", + "modified": "2013-02-13 11:29:18", "modified_by": "Administrator", "owner": "Administrator" }, @@ -127,9 +127,9 @@ { "doctype": "DocField", "fieldname": "state", - "fieldtype": "Select", + "fieldtype": "Link", "label": "State", - "options": "link:State\ncountry='India'", + "options": "State", "read_only": 0, "reqd": 1 }, @@ -171,7 +171,7 @@ "fieldtype": "Link", "label": "Amended From", "no_copy": 1, - "options": "Sales Invoice", + "options": "C-Form", "print_hide": 1, "read_only": 1 },