Attachment option and total invoiced amt added in c-form

This commit is contained in:
Nabin Hait 2012-04-06 17:30:53 +05:30
parent 1299dab010
commit 7da6ebc9af
2 changed files with 123 additions and 80 deletions

View File

@ -46,6 +46,14 @@ class DocType:
else: else:
msgprint("Please enter atleast 1 invoice in the table below", raise_exception=1) msgprint("Please enter atleast 1 invoice in the table below", raise_exception=1)
self.calculate_total_invoiced_amount()
def calculate_total_invoiced_amount(self):
total = 0
for d in getlist(self.doclist, 'invoice_details'):
total += flt(d.grand_total)
webnotes.conn.set(self.doc, 'total_invoiced_amount', total)
def get_invoice_details(self, invoice_no): def get_invoice_details(self, invoice_no):
""" Pull details from invoices for referrence """ """ Pull details from invoices for referrence """

View File

@ -3,188 +3,223 @@
# These values are common in all dictionaries # These values are common in all dictionaries
{ {
'creation': '2011-12-07 16:16:16', 'creation': '2011-12-14 11:40:47',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-12-07 17:50:17', 'modified': '2012-04-06 17:29:50',
'modified_by': 'Administrator', 'modified_by': u'Administrator',
'owner': 'Administrator' 'owner': u'Administrator'
}, },
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1323255350', '_last_update': u'1333712835',
'colour': 'White:FFF', 'allow_attach': 1,
'colour': u'White:FFF',
'doctype': 'DocType', 'doctype': 'DocType',
'module': 'Accounts', 'max_attachments': 3,
'module': u'Accounts',
'name': '__common__', 'name': '__common__',
'section_style': 'Simple', 'section_style': u'Simple',
'show_in_menu': 0, 'show_in_menu': 0,
'version': 11 'version': 19
}, },
# These values are common for all DocField # These values are common for all DocField
{ {
'doctype': 'DocField', 'doctype': u'DocField',
'name': '__common__', 'name': '__common__',
'parent': 'C-Form', 'parent': u'C-Form',
'parentfield': 'fields', 'parentfield': u'fields',
'parenttype': 'DocType', 'parenttype': u'DocType'
'permlevel': 0
}, },
# These values are common for all DocPerm # These values are common for all DocPerm
{ {
'doctype': 'DocPerm', 'doctype': u'DocPerm',
'name': '__common__', 'name': '__common__',
'parent': 'C-Form', 'parent': u'C-Form',
'parentfield': 'permissions', 'parentfield': u'permissions',
'parenttype': 'DocType', 'parenttype': u'DocType',
'read': 1 'read': 1
}, },
# DocType, C-Form # DocType, C-Form
{ {
'doctype': 'DocType', 'doctype': 'DocType',
'name': 'C-Form' 'name': u'C-Form'
}, },
# DocPerm # DocPerm
{ {
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': u'DocPerm',
'permlevel': 0, 'permlevel': 0,
'role': 'Accounts User', 'role': u'Accounts User',
'write': 1 'write': 1
}, },
# DocPerm # DocPerm
{ {
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': u'DocPerm',
'permlevel': 0, 'permlevel': 0,
'role': 'Accounts Manager', 'role': u'Accounts Manager',
'submit': 0, 'submit': 0,
'write': 1 'write': 1
}, },
# DocPerm # DocPerm
{ {
'doctype': 'DocPerm', 'doctype': u'DocPerm',
'permlevel': 1, 'permlevel': 1,
'role': 'All' 'role': u'All'
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': u'DocField',
'fieldtype': 'Column Break', 'fieldtype': u'Column Break',
'width': '50%' 'permlevel': 0,
'width': u'50%'
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': u'DocField',
'fieldname': 'naming_series', 'fieldname': u'naming_series',
'fieldtype': 'Select', 'fieldtype': u'Select',
'label': 'Series', 'label': u'Series',
'options': '\nC-FORM/', 'options': u'\nC-FORM/',
'permlevel': 0,
'reqd': 1 'reqd': 1
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': u'DocField',
'fieldname': 'c_form_no', 'fieldname': u'c_form_no',
'fieldtype': 'Data', 'fieldtype': u'Data',
'label': 'C-Form No', 'label': u'C-Form No',
'permlevel': 0,
'reqd': 1 'reqd': 1
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': u'DocField',
'fieldname': 'received_date', 'fieldname': u'received_date',
'fieldtype': 'Date', 'fieldtype': u'Date',
'label': 'Received Date', 'label': u'Received Date',
'permlevel': 0,
'reqd': 1 'reqd': 1
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': u'DocField',
'fieldname': 'customer', 'fieldname': u'customer',
'fieldtype': 'Link', 'fieldtype': u'Link',
'label': 'Customer', 'label': u'Customer',
'options': 'Customer', 'options': u'Customer',
'permlevel': 0,
'reqd': 1 'reqd': 1
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': u'DocField',
'fieldtype': 'Column Break', 'fieldtype': u'Column Break',
'width': '50%' 'permlevel': 0,
'width': u'50%'
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': u'DocField',
'fieldname': 'company', 'fieldname': u'company',
'fieldtype': 'Select', 'fieldtype': u'Select',
'label': 'Company', 'label': u'Company',
'options': 'link:Company' 'options': u'link:Company',
'permlevel': 0
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': u'DocField',
'fieldname': 'fiscal_year', 'fieldname': u'fiscal_year',
'fieldtype': 'Select', 'fieldtype': u'Select',
'label': 'Fiscal Year', 'label': u'Fiscal Year',
'options': 'link:Fiscal Year', 'options': u'link:Fiscal Year',
'permlevel': 0,
'reqd': 1 'reqd': 1
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': u'DocField',
'fieldname': 'quarter', 'fieldname': u'quarter',
'fieldtype': 'Select', 'fieldtype': u'Select',
'label': 'Quarter', 'label': u'Quarter',
'options': '\nI\nII\nIII\nIV' 'options': u'\nI\nII\nIII\nIV',
'permlevel': 0
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': u'DocField',
'fieldname': 'total_amount', 'fieldname': u'total_amount',
'fieldtype': 'Currency', 'fieldtype': u'Currency',
'label': 'Total Amount', 'label': u'Total Amount',
'permlevel': 0,
'reqd': 1 'reqd': 1
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': u'DocField',
'fieldname': 'state', 'fieldname': u'state',
'fieldtype': 'Select', 'fieldtype': u'Select',
'label': 'State', 'label': u'State',
'options': "link:State\ncountry='India'", 'options': u"link:State\ncountry='India'",
'permlevel': 0,
'reqd': 1 'reqd': 1
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': u'DocField',
'fieldtype': 'Section Break' 'fieldtype': u'Section Break',
'permlevel': 0
}, },
# DocField # DocField
{ {
'doctype': 'DocField', 'doctype': u'DocField',
'fieldname': 'invoice_details', 'fieldname': u'invoice_details',
'fieldtype': 'Table', 'fieldtype': u'Table',
'label': 'Invoice Details', 'label': u'Invoice Details',
'options': 'C-Form Invoice Detail' 'options': u'C-Form Invoice Detail',
'permlevel': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'total_invoiced_amount',
'fieldtype': u'Currency',
'label': u'Total Invoiced Amount',
'permlevel': 1,
'print_hide': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'file_list',
'fieldtype': u'Text',
'hidden': 1,
'label': u'File List',
'permlevel': 0,
'print_hide': 1
} }
] ]