Merge branch 'stable'

This commit is contained in:
Anand Doshi 2012-01-11 14:53:12 +05:30
commit 65032af912
116 changed files with 903 additions and 665 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -89,9 +89,6 @@ class DocType:
def on_update(self): def on_update(self):
self.update_nsm_model() self.update_nsm_model()
def check_if_child_exists(self):
return sql("select name from `tabCost Center` where parent_cost_center = %s and docstatus != 2", self.doc.name)
# On Trash # On Trash
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def on_trash(self): def on_trash(self):

View File

@ -146,7 +146,6 @@ cur_frm.cscript['Get Items'] = function(doc, dt, dn) {
$c_obj(make_doclist(dt,dn),'pull_details','',callback); $c_obj(make_doclist(dt,dn),'pull_details','',callback);
} }
// ========== PV Details Table ============ // ========== PV Details Table ============
// Item Code // Item Code

View File

@ -5,7 +5,7 @@
{ {
'creation': '2010-08-08 17:09:18', 'creation': '2010-08-08 17:09:18',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-12-22 19:04:07', 'modified': '2012-01-09 16:52:22',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@ -21,7 +21,7 @@
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1324367593', '_last_update': '1326105583',
'change_log': '1. Change in pull_details method dt.-26-06-2009', 'change_log': '1. Change in pull_details method dt.-26-06-2009',
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard', 'default_print_format': 'Standard',
@ -34,7 +34,7 @@
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'subject': 'To %(customer_name)s worth %(currency)s %(grand_total_export)s due on %(due_date)s | %(outstanding_amount)s outstanding', 'subject': 'To %(customer_name)s worth %(currency)s %(grand_total_export)s due on %(due_date)s | %(outstanding_amount)s outstanding',
'version': 392 'version': 394
}, },
# These values are common for all DocFormat # These values are common for all DocFormat
@ -653,7 +653,7 @@
'oldfieldname': 'net_total', 'oldfieldname': 'net_total',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 0,
'reqd': 1 'reqd': 1
}, },
@ -1218,7 +1218,7 @@
'oldfieldname': 'grand_total_export', 'oldfieldname': 'grand_total_export',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 0,
'reqd': 1 'reqd': 1
}, },
@ -1231,7 +1231,7 @@
'oldfieldname': 'rounded_total_export', 'oldfieldname': 'rounded_total_export',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1 'print_hide': 0
}, },
# DocField # DocField

View File

@ -5,8 +5,8 @@
{ {
'creation': '2010-08-08 17:09:20', 'creation': '2010-08-08 17:09:20',
'docstatus': 0, 'docstatus': 0,
'modified': '2010-09-20 14:06:57', 'modified': '2011-12-28 17:33:30',
'modified_by': 'nabin@webnotestech.com', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@ -14,6 +14,7 @@
{ {
'autoname': 'INVTD.######', 'autoname': 'INVTD.######',
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
'hide_heading': 1, 'hide_heading': 1,
'istable': 1, 'istable': 1,
@ -22,7 +23,7 @@
'section_style': 'Tray', 'section_style': 'Tray',
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'version': 15 'version': 18
}, },
# These values are common for all DocField # These values are common for all DocField
@ -45,7 +46,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'charge_type', 'fieldname': 'charge_type',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 1,
'label': 'Type', 'label': 'Type',
'oldfieldname': 'charge_type', 'oldfieldname': 'charge_type',
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
@ -60,7 +60,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'account_head', 'fieldname': 'account_head',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 2,
'label': 'Account Head', 'label': 'Account Head',
'oldfieldname': 'account_head', 'oldfieldname': 'account_head',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
@ -75,13 +74,11 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'cost_center_other_charges', 'fieldname': 'cost_center_other_charges',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 3,
'label': 'Cost Center', 'label': 'Cost Center',
'oldfieldname': 'cost_center_other_charges', 'oldfieldname': 'cost_center_other_charges',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
'options': 'Cost Center', 'options': 'Cost Center',
'permlevel': 0, 'permlevel': 0
'search_index': 0
}, },
# DocField # DocField
@ -89,7 +86,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'description', 'fieldname': 'description',
'fieldtype': 'Small Text', 'fieldtype': 'Small Text',
'idx': 4,
'label': 'Description', 'label': 'Description',
'oldfieldname': 'description', 'oldfieldname': 'description',
'oldfieldtype': 'Small Text', 'oldfieldtype': 'Small Text',
@ -103,7 +99,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'rate', 'fieldname': 'rate',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 5,
'label': 'Rate', 'label': 'Rate',
'oldfieldname': 'rate', 'oldfieldname': 'rate',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@ -117,7 +112,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'tax_amount', 'fieldname': 'tax_amount',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 6,
'label': 'Amount*', 'label': 'Amount*',
'oldfieldname': 'tax_amount', 'oldfieldname': 'tax_amount',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@ -131,7 +125,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'total', 'fieldname': 'total',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 7,
'label': 'Total*', 'label': 'Total*',
'oldfieldname': 'total', 'oldfieldname': 'total',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@ -144,7 +137,6 @@
'fieldname': 'row_id', 'fieldname': 'row_id',
'fieldtype': 'Data', 'fieldtype': 'Data',
'hidden': 0, 'hidden': 0,
'idx': 8,
'label': 'Enter Row', 'label': 'Enter Row',
'oldfieldname': 'row_id', 'oldfieldname': 'row_id',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
@ -157,7 +149,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'item_wise_tax_detail', 'fieldname': 'item_wise_tax_detail',
'fieldtype': 'Small Text', 'fieldtype': 'Small Text',
'idx': 9,
'label': 'Item Wise Tax Detail ', 'label': 'Item Wise Tax Detail ',
'oldfieldname': 'item_wise_tax_detail', 'oldfieldname': 'item_wise_tax_detail',
'oldfieldtype': 'Small Text', 'oldfieldtype': 'Small Text',
@ -170,7 +161,6 @@
'fieldname': 'parenttype', 'fieldname': 'parenttype',
'fieldtype': 'Data', 'fieldtype': 'Data',
'hidden': 1, 'hidden': 1,
'idx': 10,
'in_filter': 1, 'in_filter': 1,
'label': 'Parenttype', 'label': 'Parenttype',
'oldfieldname': 'parenttype', 'oldfieldname': 'parenttype',
@ -188,7 +178,6 @@
'fieldname': 'total_tax_amount', 'fieldname': 'total_tax_amount',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'hidden': 1, 'hidden': 1,
'idx': 11,
'label': 'Total Tax Amount', 'label': 'Total Tax Amount',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'total_tax_amount', 'oldfieldname': 'total_tax_amount',
@ -205,7 +194,6 @@
'fieldname': 'total_amount', 'fieldname': 'total_amount',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'hidden': 1, 'hidden': 1,
'idx': 12,
'label': 'Total Amount', 'label': 'Total Amount',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'total_amount', 'oldfieldname': 'total_amount',
@ -213,5 +201,20 @@
'permlevel': 0, 'permlevel': 0,
'print_hide': 1, 'print_hide': 1,
'report_hide': 1 'report_hide': 1
},
# DocField
{
'allow_on_submit': 0,
'description': 'If checked, the tax amount will be considered as already included in the Print Rate / Print Amount',
'doctype': 'DocField',
'fieldname': 'included_in_print_rate',
'fieldtype': 'Check',
'label': 'Included in Print Rate',
'no_column': 0,
'no_copy': 1,
'permlevel': 0,
'print_hide': 1,
'report_hide': 1
} }
] ]

View File

@ -1,274 +1,155 @@
# Module Def, Buying
[ [
# These values are common in all dictionaries
{ {
'_last_update': None, 'creation': '2011-07-01 17:40:38',
'creation': '2011-06-30 15:47:45',
'disabled': 'No',
'docstatus': 0, 'docstatus': 0,
'doctype': u'Module Def', 'modified': '2012-01-10 17:52:19',
'doctype_list': 'DocType Mapper, Purchase Receipt-Payable Voucher\nDocType Mapper, Purchase Order-Payable Voucher\nDocType Mapper, Purchase Order-Purchase Receipt\nDocType Mapper, Indent-Purchase Order\nPrint Format, Purchase Order Format\nPrint Format, Purchase Receipt Format',
'file_list': 'scm.gif,FileData/00209',
'idx': None,
'is_hidden': 'No',
'last_updated_date': None,
'modified': '2011-06-30 15:47:45',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all Module Def Role
{
'doctype': 'Module Def Role',
'name': '__common__',
'parent': 'Buying',
'parentfield': 'roles',
'parenttype': 'Module Def'
},
# These values are common for all Module Def Item
{
'doctype': 'Module Def Item',
'name': '__common__',
'parent': 'Buying',
'parentfield': 'items',
'parenttype': 'Module Def'
},
# These values are common for all Module Def
{
'disabled': 'No',
'doctype': u'Module Def',
'doctype_list': 'DocType Mapper, Purchase Receipt-Payable Voucher\nDocType Mapper, Purchase Order-Payable Voucher\nDocType Mapper, Purchase Order-Purchase Receipt\nDocType Mapper, Indent-Purchase Order\nPrint Format, Purchase Order Format\nPrint Format, Purchase Receipt Format\nDocType Label, Indent',
'file_list': 'scm.gif,FileData/00209',
'is_hidden': 'No',
'module_desc': '<p>All details about your Suppliers and past transactions</p>', 'module_desc': '<p>All details about your Suppliers and past transactions</p>',
'module_icon': 'Buying.gif', 'module_icon': 'Buying.gif',
'module_label': 'Buying', 'module_label': 'Buying',
'module_name': 'Buying', 'module_name': 'Buying',
'module_page': None,
'module_seq': 4, 'module_seq': 4,
'name': 'Buying', 'name': '__common__'
'owner': 'Administrator',
'parent': None,
'parentfield': None,
'parenttype': None,
'trash_reason': None,
'widget_code': None
}, },
# Module Def, Buying
{
'doctype': u'Module Def',
'name': 'Buying'
},
# Module Def Item
{ {
'click_function': None,
'creation': '2011-06-30 15:47:45',
'description': 'Your Supplier Database', 'description': 'Your Supplier Database',
'display_name': 'Supplier', 'display_name': 'Supplier',
'doc_name': 'Supplier', 'doc_name': 'Supplier',
'doc_type': 'Forms', 'doc_type': 'Forms',
'docstatus': 0,
'doctype': 'Module Def Item', 'doctype': 'Module Def Item',
'fields': 'id\nsupplier_type\nsupplier_status\ncompany', 'fields': 'id\nsupplier_type\nsupplier_status\ncompany'
'hide': None,
'icon': None,
'idx': 1,
'modified': '2011-06-30 15:47:45',
'modified_by': 'Administrator',
'name': 'MDI01312',
'owner': 'Administrator',
'parent': 'Buying',
'parentfield': 'items',
'parenttype': 'Module Def'
}, },
# Module Def Item
{ {
'click_function': None,
'creation': '2011-06-30 15:47:45',
'description': 'Buy requests from various people in your company', 'description': 'Buy requests from various people in your company',
'display_name': 'Indent', 'display_name': 'Indent',
'doc_name': 'Indent', 'doc_name': 'Indent',
'doc_type': 'Forms', 'doc_type': 'Forms',
'docstatus': 0,
'doctype': 'Module Def Item', 'doctype': 'Module Def Item',
'fields': 'status\ntransaction_date\nsales_order_no\nremark', 'fields': 'status\ntransaction_date\nsales_order_no\nremark'
'hide': None,
'icon': None,
'idx': 2,
'modified': '2011-06-30 15:47:45',
'modified_by': 'Administrator',
'name': 'MDI01313',
'owner': 'Administrator',
'parent': 'Buying',
'parentfield': 'items',
'parenttype': 'Module Def'
}, },
# Module Def Item
{ {
'click_function': None,
'creation': '2011-06-30 15:47:45',
'description': 'Orders you have placed to your suppliers', 'description': 'Orders you have placed to your suppliers',
'display_name': 'Purchase Order', 'display_name': 'Purchase Order',
'doc_name': 'Purchase Order', 'doc_name': 'Purchase Order',
'doc_type': 'Forms', 'doc_type': 'Forms',
'docstatus': 0,
'doctype': 'Module Def Item', 'doctype': 'Module Def Item',
'fields': 'status\nsupplier\ntransaction_date\ngrand_total', 'fields': 'status\nsupplier\ntransaction_date\ngrand_total'
'hide': None,
'icon': None,
'idx': 3,
'modified': '2011-06-30 15:47:45',
'modified_by': 'Administrator',
'name': 'MDI01314',
'owner': 'Administrator',
'parent': 'Buying',
'parentfield': 'items',
'parenttype': 'Module Def'
}, },
# Module Def Item
{ {
'click_function': None,
'creation': '2011-06-30 15:47:45',
'description': None,
'display_name': 'Itemwise Receipt Details', 'display_name': 'Itemwise Receipt Details',
'doc_name': 'Purchase Receipt Detail', 'doc_name': 'Purchase Receipt Detail',
'doc_type': 'Reports', 'doc_type': 'Reports',
'docstatus': 0, 'doctype': 'Module Def Item'
'doctype': 'Module Def Item',
'fields': None,
'hide': None,
'icon': None,
'idx': 4,
'modified': '2011-06-30 15:47:45',
'modified_by': 'Administrator',
'name': 'MDI01315',
'owner': 'Administrator',
'parent': 'Buying',
'parentfield': 'items',
'parenttype': 'Module Def'
}, },
# Module Def Item
{ {
'click_function': None,
'creation': '2011-06-30 15:47:45',
'description': None,
'display_name': 'Purchase in Transit', 'display_name': 'Purchase in Transit',
'doc_name': 'PV Detail', 'doc_name': 'PV Detail',
'doc_type': 'Reports', 'doc_type': 'Reports',
'docstatus': 0, 'doctype': 'Module Def Item'
'doctype': 'Module Def Item',
'fields': None,
'hide': None,
'icon': None,
'idx': 5,
'modified': '2011-06-30 15:47:45',
'modified_by': 'Administrator',
'name': 'MDI01316',
'owner': 'Administrator',
'parent': 'Buying',
'parentfield': 'items',
'parenttype': 'Module Def'
}, },
# Module Def Item
{ {
'click_function': None,
'creation': '2011-06-30 15:47:45',
'description': None,
'display_name': 'Pending PO Items To Receive', 'display_name': 'Pending PO Items To Receive',
'doc_name': 'PO Detail', 'doc_name': 'PO Detail',
'doc_type': 'Reports', 'doc_type': 'Reports',
'docstatus': 0, 'doctype': 'Module Def Item'
'doctype': 'Module Def Item',
'fields': None,
'hide': None,
'icon': None,
'idx': 6,
'modified': '2011-06-30 15:47:45',
'modified_by': 'Administrator',
'name': 'MDI01317',
'owner': 'Administrator',
'parent': 'Buying',
'parentfield': 'items',
'parenttype': 'Module Def'
}, },
# Module Def Item
{ {
'click_function': None,
'creation': '2011-06-30 15:47:45',
'description': None,
'display_name': 'Pending PO Items To Bill', 'display_name': 'Pending PO Items To Bill',
'doc_name': 'PO Detail', 'doc_name': 'PO Detail',
'doc_type': 'Reports', 'doc_type': 'Reports',
'docstatus': 0, 'doctype': 'Module Def Item'
'doctype': 'Module Def Item',
'fields': None,
'hide': None,
'icon': None,
'idx': 7,
'modified': '2011-06-30 15:47:45',
'modified_by': 'Administrator',
'name': 'MDI01318',
'owner': 'Administrator',
'parent': 'Buying',
'parentfield': 'items',
'parenttype': 'Module Def'
}, },
# Module Def Item
{ {
'click_function': None,
'creation': '2011-06-30 15:47:45',
'description': None,
'display_name': 'Itemwise Purchase Details', 'display_name': 'Itemwise Purchase Details',
'doc_name': 'PO Detail', 'doc_name': 'PO Detail',
'doc_type': 'Reports', 'doc_type': 'Reports',
'docstatus': 0, 'doctype': 'Module Def Item'
'doctype': 'Module Def Item',
'fields': None,
'hide': None,
'icon': None,
'idx': 8,
'modified': '2011-06-30 15:47:45',
'modified_by': 'Administrator',
'name': 'MDI01319',
'owner': 'Administrator',
'parent': 'Buying',
'parentfield': 'items',
'parenttype': 'Module Def'
}, },
# Module Def Item
{ {
'click_function': None,
'creation': '2011-06-30 15:47:45',
'description': 'Ledger details of your creditors', 'description': 'Ledger details of your creditors',
'display_name': "Creditor's Ledger", 'display_name': "Creditor's Ledger",
'doc_name': 'GL Entry', 'doc_name': 'GL Entry',
'doc_type': 'Reports', 'doc_type': 'Reports',
'docstatus': 0,
'doctype': 'Module Def Item', 'doctype': 'Module Def Item',
'fields': None, 'icon': 'accept.gif'
'hide': None,
'icon': 'accept.gif',
'idx': 9,
'modified': '2011-06-30 15:47:45',
'modified_by': 'Administrator',
'name': 'MDI01320',
'owner': 'Administrator',
'parent': 'Buying',
'parentfield': 'items',
'parenttype': 'Module Def'
}, },
# Module Def Role
{ {
'creation': '2011-06-30 15:47:45',
'docstatus': 0,
'doctype': 'Module Def Role', 'doctype': 'Module Def Role',
'idx': 1,
'modified': '2011-06-30 15:47:45',
'modified_by': 'Administrator',
'name': 'MDR00332',
'owner': 'Administrator',
'parent': 'Buying',
'parentfield': 'roles',
'parenttype': 'Module Def',
'role': 'Purchase User' 'role': 'Purchase User'
}, },
# Module Def Role
{ {
'creation': '2011-06-30 15:47:45',
'docstatus': 0,
'doctype': 'Module Def Role', 'doctype': 'Module Def Role',
'idx': 2,
'modified': '2011-06-30 15:47:45',
'modified_by': 'Administrator',
'name': 'MDR00333',
'owner': 'Administrator',
'parent': 'Buying',
'parentfield': 'roles',
'parenttype': 'Module Def',
'role': 'Purchase Manager' 'role': 'Purchase Manager'
}, },
# Module Def Role
{ {
'creation': '2011-06-30 15:47:45',
'docstatus': 0,
'doctype': 'Module Def Role', 'doctype': 'Module Def Role',
'idx': 3,
'modified': '2011-06-30 15:47:45',
'modified_by': 'Administrator',
'name': 'MDR00334',
'owner': 'Administrator',
'parent': 'Buying',
'parentfield': 'roles',
'parenttype': 'Module Def',
'role': 'Administrator' 'role': 'Administrator'
}, },
# Module Def Role
{ {
'creation': '2011-06-30 15:47:45',
'docstatus': 0,
'doctype': 'Module Def Role', 'doctype': 'Module Def Role',
'idx': 4,
'modified': '2011-06-30 15:47:45',
'modified_by': 'Administrator',
'name': 'MDR00335',
'owner': 'Administrator',
'parent': 'Buying',
'parentfield': 'roles',
'parenttype': 'Module Def',
'role': 'Purchase Master Manager' 'role': 'Purchase Master Manager'
} }
] ]

View File

@ -3,9 +3,10 @@ cur_frm.cscript.fname = "indent_details";
$import(Purchase Common) $import(Purchase Common)
$import(SMS Control) $import(SMS Control)
cur_frm.cscript.indent_doctype_label = get_doctype_label('Indent');
//========================== On Load ================================================= //========================== On Load =================================================
cur_frm.cscript.onload = function(doc, cdt, cdn) { cur_frm.cscript.onload = function(doc, cdt, cdn) {
if (!doc.transaction_date) doc.transaction_date = dateutil.obj_to_str(new Date()) if (!doc.transaction_date) doc.transaction_date = dateutil.obj_to_str(new Date())
if (!doc.status) doc.status = 'Draft'; if (!doc.status) doc.status = 'Draft';
@ -42,18 +43,18 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
} }
if(!is_closed) { if(!is_closed) {
cur_frm.add_custom_button('Make Purchase Order', cur_frm.cscript['Make Purchase Order']) cur_frm.add_custom_button('Make Purchase Order', cur_frm.cscript['Make Purchase Order'])
cur_frm.add_custom_button('Stop Indent', cur_frm.cscript['Stop Indent']) cur_frm.add_custom_button('Stop ' + cur_frm.cscript.indent_doctype_label, cur_frm.cscript['Stop Purchase Requisition'])
} }
cur_frm.add_custom_button('Send SMS', cur_frm.cscript['Send SMS']); cur_frm.add_custom_button('Send SMS', cur_frm.cscript['Send SMS']);
} }
if(doc.docstatus == 1 && doc.status == 'Stopped') if(doc.docstatus == 1 && doc.status == 'Stopped')
cur_frm.add_custom_button('Unstop Indent', cur_frm.cscript['Unstop Indent']) cur_frm.add_custom_button('Unstop ' + cur_frm.cscript.indent_doctype_label, cur_frm.cscript['Unstop Purchase Requisition'])
if(doc.docstatus == 1) if(doc.docstatus == 1)
unhide_field(['Repair Indent']); unhide_field(['Repair Purchase Requisition']);
else else
hide_field(['Repair Indent']); hide_field(['Repair Purchase Requisition']);
} }
//======================= validation =================================== //======================= validation ===================================
@ -71,7 +72,7 @@ cur_frm.cscript.transaction_date = function(doc,cdt,cdn){
cur_frm.cscript.qty = function(doc, cdt, cdn) { cur_frm.cscript.qty = function(doc, cdt, cdn) {
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
if (flt(d.qty) < flt(d.min_order_qty)) if (flt(d.qty) < flt(d.min_order_qty))
alert("Warning: Indent Qty is less than Minimum Order Qty"); alert("Warning: " + cur_frm.cscript.indent_doctype_label + " Qty is less than Minimum Order Qty");
} }
// On Button Click Functions // On Button Click Functions
@ -95,9 +96,9 @@ cur_frm.cscript['Make Purchase Order'] = function() {
// Stop INDENT // Stop INDENT
// ================================================================================================== // ==================================================================================================
cur_frm.cscript['Stop Indent'] = function() { cur_frm.cscript['Stop Purchase Requisition'] = function() {
var doc = cur_frm.doc; var doc = cur_frm.doc;
var check = confirm("Do you really want to STOP this Indent?"); var check = confirm("Do you really want to STOP this " + cur_frm.cscript.indent_doctype_label + "?");
if (check) { if (check) {
$c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': compress_doclist(make_doclist(doc.doctype, doc.name))}, function(r,rt) { $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': compress_doclist(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
@ -108,9 +109,9 @@ cur_frm.cscript['Stop Indent'] = function() {
// Un Stop INDENT // Un Stop INDENT
//==================================================================================================== //====================================================================================================
cur_frm.cscript['Unstop Indent'] = function(){ cur_frm.cscript['Unstop Purchase Requisition'] = function(){
var doc = cur_frm.doc var doc = cur_frm.doc
var check = confirm("Do you really want to UNSTOP this Indent?"); var check = confirm("Do you really want to UNSTOP this " + cur_frm.cscript.indent_doctype_label + "?");
if (check) { if (check) {
$c('runserverobj', args={'method':'update_status', 'arg': 'Submitted','docs': compress_doclist(make_doclist(doc.doctype, doc.name))}, function(r,rt) { $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted','docs': compress_doclist(make_doclist(doc.doctype, doc.name))}, function(r,rt) {

View File

@ -5,14 +5,14 @@
{ {
'creation': '2010-08-08 17:09:04', 'creation': '2010-08-08 17:09:04',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-10-12 13:09:38', 'modified': '2012-01-10 15:39:17',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1318404775', '_last_update': '1326190064',
'allow_print': 0, 'allow_print': 0,
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard', 'default_print_format': 'Standard',
@ -25,7 +25,7 @@
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'subject': '%(per_ordered)s% ordered', 'subject': '%(per_ordered)s% ordered',
'version': 188 'version': 197
}, },
# These values are common for all DocField # These values are common for all DocField
@ -235,7 +235,7 @@
'fieldname': 'transaction_date', 'fieldname': 'transaction_date',
'fieldtype': 'Date', 'fieldtype': 'Date',
'in_filter': 1, 'in_filter': 1,
'label': 'Indent Date', 'label': 'Transaction Date',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'transaction_date', 'oldfieldname': 'transaction_date',
'oldfieldtype': 'Date', 'oldfieldtype': 'Date',
@ -249,7 +249,7 @@
# DocField # DocField
{ {
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': '% of materials ordered against this Indent', 'description': '% of materials ordered against this Purchase Requisition',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'per_ordered', 'fieldname': 'per_ordered',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
@ -273,7 +273,7 @@
# DocField # DocField
{ {
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'One or multiple Sales Order no which generated this Indent', 'description': 'One or multiple Sales Order no which generated this Purchase Requisition',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'sales_order_no', 'fieldname': 'sales_order_no',
'fieldtype': 'Link', 'fieldtype': 'Link',
@ -302,7 +302,7 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'indent_details', 'fieldname': 'indent_details',
'fieldtype': 'Table', 'fieldtype': 'Table',
'label': 'Indent Details', 'label': 'Purchase Requisition Details',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'indent_details', 'oldfieldname': 'indent_details',
'oldfieldtype': 'Table', 'oldfieldtype': 'Table',
@ -314,7 +314,7 @@
{ {
'colour': 'White:FFF', 'colour': 'White:FFF',
'default': 'Give additional details about the indent.', 'default': 'Give additional details about the indent.',
'description': 'Filing in Additional Information about the Indent will help you analyze your data better.', 'description': 'Filing in Additional Information about the Purchase Requisition will help you analyze your data better.',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'label': 'More Info', 'label': 'More Info',
@ -362,7 +362,7 @@
# DocField # DocField
{ {
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'Name of the entity who has requested for the indent', 'description': 'Name of the entity who has requested for the Purchase Requisition',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'requested_by', 'fieldname': 'requested_by',
'fieldtype': 'Data', 'fieldtype': 'Data',
@ -400,7 +400,7 @@
# DocField # DocField
{ {
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'After cancelling the indent, a dialog box will ask you reason for cancellation which will be reflected in this field', 'description': 'After cancelling the Purchase Requisition, a dialog box will ask you reason for cancellation which will be reflected in this field',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'cancel_reason', 'fieldname': 'cancel_reason',
'fieldtype': 'Data', 'fieldtype': 'Data',
@ -443,7 +443,7 @@
# DocField # DocField
{ {
'description': 'Add Terms and Conditions for the Indent. You can also prepare a master Term Sheet and use the Template', 'description': 'Add Terms and Conditions for the Purchase Requisition. You can also prepare a master Term Sheet and use the Template',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'label': 'Terms', 'label': 'Terms',
@ -505,7 +505,7 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'terms', 'fieldname': 'terms',
'fieldtype': 'Text Editor', 'fieldtype': 'Text Editor',
'label': 'Terms1', 'label': 'Terms Content',
'oldfieldname': 'terms', 'oldfieldname': 'terms',
'oldfieldtype': 'Text Editor', 'oldfieldtype': 'Text Editor',
'permlevel': 0 'permlevel': 0
@ -526,7 +526,7 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'label': 'Repair Indent', 'label': 'Repair Purchase Requisition',
'oldfieldtype': 'Button', 'oldfieldtype': 'Button',
'options': 'repair_indent', 'options': 'repair_indent',
'permlevel': 0, 'permlevel': 0,

View File

@ -5,7 +5,7 @@
{ {
'creation': '2010-08-08 17:09:12', 'creation': '2010-08-08 17:09:12',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-12-14 10:49:46', 'modified': '2012-01-10 16:38:21',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@ -22,7 +22,7 @@
'section_style': 'Tray', 'section_style': 'Tray',
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'version': 60 'version': 61
}, },
# These values are common for all DocField # These values are common for all DocField
@ -301,7 +301,7 @@
'fieldtype': 'Link', 'fieldtype': 'Link',
'hidden': 0, 'hidden': 0,
'in_filter': 1, 'in_filter': 1,
'label': 'Indent No', 'label': 'Purchase Requisition No',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'prevdoc_docname', 'oldfieldname': 'prevdoc_docname',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
@ -319,7 +319,7 @@
'fieldtype': 'Date', 'fieldtype': 'Date',
'hidden': 0, 'hidden': 0,
'in_filter': 1, 'in_filter': 1,
'label': 'Indent Date', 'label': 'Purchase Requisition Date',
'oldfieldname': 'prevdoc_date', 'oldfieldname': 'prevdoc_date',
'oldfieldtype': 'Date', 'oldfieldtype': 'Date',
'permlevel': 1, 'permlevel': 1,
@ -335,7 +335,7 @@
'fieldtype': 'Data', 'fieldtype': 'Data',
'hidden': 1, 'hidden': 1,
'in_filter': 1, 'in_filter': 1,
'label': 'Indent Detail No', 'label': 'Purchase Requisition Detail No',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'prevdoc_detail_docname', 'oldfieldname': 'prevdoc_detail_docname',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',

View File

@ -5,15 +5,25 @@
{ {
'creation': '2010-08-08 17:09:15', 'creation': '2010-08-08 17:09:15',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-05-17 16:29:14', 'modified': '2012-01-10 16:19:19',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'Purchase Order',
'parentfield': 'fields',
'parenttype': 'DocType'
},
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1306471022', '_last_update': '1306471022',
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
'document_type': 'Transaction', 'document_type': 'Transaction',
'is_transaction_doc': 1, 'is_transaction_doc': 1,
@ -25,15 +35,15 @@
'server_code_error': ' ', 'server_code_error': ' ',
'show_in_menu': 0, 'show_in_menu': 0,
'subject': 'To %(supplier_name)s on %(transaction_date)s | %(per_received)s% delivered', 'subject': 'To %(supplier_name)s on %(transaction_date)s | %(per_received)s% delivered',
'version': 494 'version': 495
}, },
# These values are common for all DocField # These values are common for all DocFormat
{ {
'doctype': 'DocField', 'doctype': 'DocFormat',
'name': '__common__', 'name': '__common__',
'parent': 'Purchase Order', 'parent': 'Purchase Order',
'parentfield': 'fields', 'parentfield': 'formats',
'parenttype': 'DocType' 'parenttype': 'DocType'
}, },
@ -53,13 +63,24 @@
'name': 'Purchase Order' 'name': 'Purchase Order'
}, },
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'permlevel': 0,
'role': 'Production Manager',
'submit': 0,
'write': 1
},
# DocPerm # DocPerm
{ {
'amend': 0, 'amend': 0,
'cancel': 0, 'cancel': 0,
'create': 0, 'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 1,
'permlevel': 1, 'permlevel': 1,
'role': 'Material User', 'role': 'Material User',
'submit': 0, 'submit': 0,
@ -72,7 +93,6 @@
'cancel': 0, 'cancel': 0,
'create': 0, 'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 2,
'permlevel': 0, 'permlevel': 0,
'role': 'Material User', 'role': 'Material User',
'submit': 0, 'submit': 0,
@ -85,7 +105,6 @@
'cancel': 0, 'cancel': 0,
'create': 0, 'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 3,
'permlevel': 1, 'permlevel': 1,
'role': 'Purchase Manager', 'role': 'Purchase Manager',
'submit': 0, 'submit': 0,
@ -98,7 +117,6 @@
'cancel': 1, 'cancel': 1,
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 4,
'permlevel': 0, 'permlevel': 0,
'role': 'Purchase Manager', 'role': 'Purchase Manager',
'submit': 1, 'submit': 1,
@ -111,7 +129,6 @@
'cancel': 0, 'cancel': 0,
'create': 1, 'create': 1,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 5,
'permlevel': 0, 'permlevel': 0,
'role': 'Purchase User', 'role': 'Purchase User',
'submit': 0, 'submit': 0,
@ -120,37 +137,64 @@
# DocPerm # DocPerm
{ {
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 6,
'permlevel': 1, 'permlevel': 1,
'role': 'All' 'role': 'All',
'submit': 0,
'write': 0
}, },
# DocPerm # DocPerm
{ {
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 7,
'match': 'supplier',
'permlevel': 0, 'permlevel': 0,
'role': 'Supplier' 'role': 'Supplier',
'submit': 0,
'write': 0
}, },
# DocPerm # DocPerm
{ {
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': 'DocPerm', 'doctype': 'DocPerm',
'idx': 8,
'permlevel': 2, 'permlevel': 2,
'role': 'All', 'role': 'All',
'submit': 0,
'write': 1 'write': 1
}, },
# DocFormat
{
'doctype': 'DocFormat',
'format': 'Purchase Order Classic'
},
# DocFormat
{
'doctype': 'DocFormat',
'format': 'Purchase Order Modern'
},
# DocFormat
{
'doctype': 'DocFormat',
'format': 'Purchase Order Spartan'
},
# DocField # DocField
{ {
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'Enter rates and quantity of items you want to purchase and send the purchase order to your supplier.', 'description': 'Enter rates and quantity of items you want to purchase and send the purchase order to your supplier.',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 1,
'label': 'Basic Info', 'label': 'Basic Info',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0, 'permlevel': 0,
@ -161,7 +205,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 2,
'oldfieldtype': 'Column Break', 'oldfieldtype': 'Column Break',
'permlevel': 0, 'permlevel': 0,
'width': '50%' 'width': '50%'
@ -174,7 +217,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'naming_series', 'fieldname': 'naming_series',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 3,
'label': 'Series', 'label': 'Series',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'naming_series', 'oldfieldname': 'naming_series',
@ -192,7 +234,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'supplier', 'fieldname': 'supplier',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 4,
'in_filter': 1, 'in_filter': 1,
'label': 'Supplier', 'label': 'Supplier',
'oldfieldname': 'supplier', 'oldfieldname': 'supplier',
@ -210,7 +251,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'supplier_address', 'fieldname': 'supplier_address',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 5,
'in_filter': 1, 'in_filter': 1,
'label': 'Supplier Address', 'label': 'Supplier Address',
'options': 'Address', 'options': 'Address',
@ -223,7 +263,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'contact_person', 'fieldname': 'contact_person',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 6,
'in_filter': 1, 'in_filter': 1,
'label': 'Contact Person', 'label': 'Contact Person',
'options': 'Contact', 'options': 'Contact',
@ -236,7 +275,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'supplier_name', 'fieldname': 'supplier_name',
'fieldtype': 'Data', 'fieldtype': 'Data',
'idx': 7,
'label': 'Name', 'label': 'Name',
'permlevel': 1 'permlevel': 1
}, },
@ -246,7 +284,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'address_display', 'fieldname': 'address_display',
'fieldtype': 'Small Text', 'fieldtype': 'Small Text',
'idx': 8,
'label': 'Address', 'label': 'Address',
'permlevel': 1 'permlevel': 1
}, },
@ -256,7 +293,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'contact_display', 'fieldname': 'contact_display',
'fieldtype': 'Small Text', 'fieldtype': 'Small Text',
'idx': 9,
'label': 'Contact', 'label': 'Contact',
'permlevel': 1 'permlevel': 1
}, },
@ -266,7 +302,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'contact_mobile', 'fieldname': 'contact_mobile',
'fieldtype': 'Text', 'fieldtype': 'Text',
'idx': 10,
'label': 'Mobile No', 'label': 'Mobile No',
'permlevel': 1 'permlevel': 1
}, },
@ -276,7 +311,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'contact_email', 'fieldname': 'contact_email',
'fieldtype': 'Text', 'fieldtype': 'Text',
'idx': 11,
'label': 'Contact Email', 'label': 'Contact Email',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1 'print_hide': 1
@ -286,7 +320,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 12,
'oldfieldtype': 'Column Break', 'oldfieldtype': 'Column Break',
'permlevel': 0, 'permlevel': 0,
'print_hide': 0, 'print_hide': 0,
@ -300,7 +333,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'transaction_date', 'fieldname': 'transaction_date',
'fieldtype': 'Date', 'fieldtype': 'Date',
'idx': 13,
'in_filter': 1, 'in_filter': 1,
'label': 'Purchase Order Date', 'label': 'Purchase Order Date',
'oldfieldname': 'transaction_date', 'oldfieldname': 'transaction_date',
@ -317,7 +349,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'status', 'fieldname': 'status',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 14,
'in_filter': 1, 'in_filter': 1,
'label': 'Status', 'label': 'Status',
'no_copy': 1, 'no_copy': 1,
@ -337,7 +368,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'project_name', 'fieldname': 'project_name',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 15,
'in_filter': 1, 'in_filter': 1,
'label': 'Project Name', 'label': 'Project Name',
'oldfieldname': 'project_name', 'oldfieldname': 'project_name',
@ -356,7 +386,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'per_received', 'fieldname': 'per_received',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 16,
'label': '% Received', 'label': '% Received',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'per_received', 'oldfieldname': 'per_received',
@ -373,7 +402,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'per_billed', 'fieldname': 'per_billed',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 17,
'label': '% Billed', 'label': '% Billed',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'per_billed', 'oldfieldname': 'per_billed',
@ -387,7 +415,6 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 18,
'label': 'Items', 'label': 'Items',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@ -396,13 +423,12 @@
# DocField # DocField
{ {
'colour': 'White:FFF', 'colour': 'White:FFF',
'description': 'You can make a purchase order from multiple indents. Select indents one by one and click on the button below.', 'description': 'You can make a purchase order from multiple Purchase Requisitions. Select Purchase Requisitions one by one and click on the button below.',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'indent_no', 'fieldname': 'indent_no',
'fieldtype': 'Link', 'fieldtype': 'Link',
'hidden': 0, 'hidden': 0,
'idx': 19, 'label': 'Select Purchase Requisition',
'label': 'Select Indent',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'indent_no', 'oldfieldname': 'indent_no',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
@ -416,7 +442,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'hidden': 0, 'hidden': 0,
'idx': 20,
'label': 'Get Items', 'label': 'Get Items',
'oldfieldtype': 'Button', 'oldfieldtype': 'Button',
'options': 'get_indent_details', 'options': 'get_indent_details',
@ -428,7 +453,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'is_subcontracted', 'fieldname': 'is_subcontracted',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 21,
'label': 'Is Subcontracted', 'label': 'Is Subcontracted',
'options': '\nYes\nNo', 'options': '\nYes\nNo',
'permlevel': 0, 'permlevel': 0,
@ -439,7 +463,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 22,
'permlevel': 0, 'permlevel': 0,
'width': '50%' 'width': '50%'
}, },
@ -451,7 +474,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'currency', 'fieldname': 'currency',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 23,
'label': 'Currency', 'label': 'Currency',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'currency', 'oldfieldname': 'currency',
@ -471,7 +493,6 @@
'fieldname': 'conversion_rate', 'fieldname': 'conversion_rate',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'hidden': 0, 'hidden': 0,
'idx': 24,
'label': 'Conversion Rate', 'label': 'Conversion Rate',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'conversion_rate', 'oldfieldname': 'conversion_rate',
@ -486,7 +507,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 25,
'permlevel': 0 'permlevel': 0
}, },
@ -496,7 +516,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'po_details', 'fieldname': 'po_details',
'fieldtype': 'Table', 'fieldtype': 'Table',
'idx': 26,
'label': 'PO Details', 'label': 'PO Details',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'po_details', 'oldfieldname': 'po_details',
@ -510,7 +529,6 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 27,
'label': 'Get Last Purchase Rate', 'label': 'Get Last Purchase Rate',
'oldfieldtype': 'Button', 'oldfieldtype': 'Button',
'permlevel': 0, 'permlevel': 0,
@ -523,7 +541,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'net_total', 'fieldname': 'net_total',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 28,
'label': 'Net Total*', 'label': 'Net Total*',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'net_total', 'oldfieldname': 'net_total',
@ -537,7 +554,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 29,
'label': 'Re-Calculate Values', 'label': 'Re-Calculate Values',
'oldfieldtype': 'Button', 'oldfieldtype': 'Button',
'permlevel': 0, 'permlevel': 0,
@ -549,7 +565,6 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'HTML', 'fieldtype': 'HTML',
'idx': 30,
'label': 'Note HTML', 'label': 'Note HTML',
'options': '<div style="margin-top:16px"><b>Note :</b> * In Base Currency\n</div>', 'options': '<div style="margin-top:16px"><b>Note :</b> * In Base Currency\n</div>',
'permlevel': 1, 'permlevel': 1,
@ -561,7 +576,6 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 31,
'label': 'Taxes', 'label': 'Taxes',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@ -574,7 +588,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'purchase_other_charges', 'fieldname': 'purchase_other_charges',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 32,
'label': 'Purchase Other Charges', 'label': 'Purchase Other Charges',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'purchase_other_charges', 'oldfieldname': 'purchase_other_charges',
@ -588,7 +601,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 33,
'label': 'Get Tax Detail', 'label': 'Get Tax Detail',
'oldfieldtype': 'Button', 'oldfieldtype': 'Button',
'options': 'get_purchase_tax_details', 'options': 'get_purchase_tax_details',
@ -601,7 +613,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'purchase_tax_details', 'fieldname': 'purchase_tax_details',
'fieldtype': 'Table', 'fieldtype': 'Table',
'idx': 34,
'label': 'Purchase Tax Details', 'label': 'Purchase Tax Details',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'purchase_tax_details', 'oldfieldname': 'purchase_tax_details',
@ -614,7 +625,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 35,
'label': 'Calculate Tax', 'label': 'Calculate Tax',
'oldfieldtype': 'Button', 'oldfieldtype': 'Button',
'permlevel': 0, 'permlevel': 0,
@ -626,7 +636,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'HTML', 'fieldtype': 'HTML',
'idx': 36,
'label': 'Tax Calculation', 'label': 'Tax Calculation',
'no_copy': 1, 'no_copy': 1,
'oldfieldtype': 'HTML', 'oldfieldtype': 'HTML',
@ -639,7 +648,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'total_tax', 'fieldname': 'total_tax',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 37,
'label': 'Total Tax*', 'label': 'Total Tax*',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'total_tax', 'oldfieldname': 'total_tax',
@ -653,7 +661,6 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'HTML', 'fieldtype': 'HTML',
'idx': 38,
'label': 'Note HTML', 'label': 'Note HTML',
'options': '<div style="margin-top:16px"><b>Note :</b> * In Base Currency\n</div>', 'options': '<div style="margin-top:16px"><b>Note :</b> * In Base Currency\n</div>',
'permlevel': 1, 'permlevel': 1,
@ -665,7 +672,6 @@
'colour': 'White:FFF', 'colour': 'White:FFF',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 39,
'label': 'Totals', 'label': 'Totals',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@ -676,7 +682,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'grand_total', 'fieldname': 'grand_total',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 40,
'label': 'Grand Total', 'label': 'Grand Total',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'grand_total', 'oldfieldname': 'grand_total',
@ -690,7 +695,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'rounded_total', 'fieldname': 'rounded_total',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 41,
'label': 'Rounded Total', 'label': 'Rounded Total',
'oldfieldname': 'rounded_total', 'oldfieldname': 'rounded_total',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
@ -705,7 +709,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'in_words', 'fieldname': 'in_words',
'fieldtype': 'Data', 'fieldtype': 'Data',
'idx': 42,
'label': 'In Words', 'label': 'In Words',
'oldfieldname': 'in_words', 'oldfieldname': 'in_words',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
@ -718,7 +721,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'other_charges_added', 'fieldname': 'other_charges_added',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 43,
'label': 'Other Charges Added', 'label': 'Other Charges Added',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'other_charges_added', 'oldfieldname': 'other_charges_added',
@ -732,7 +734,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'other_charges_deducted', 'fieldname': 'other_charges_deducted',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 44,
'label': 'Other Charges Deducted', 'label': 'Other Charges Deducted',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'other_charges_deducted', 'oldfieldname': 'other_charges_deducted',
@ -745,7 +746,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 45,
'oldfieldtype': 'Column Break', 'oldfieldtype': 'Column Break',
'permlevel': 0, 'permlevel': 0,
'print_hide': 0 'print_hide': 0
@ -756,7 +756,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'net_total_import', 'fieldname': 'net_total_import',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 46,
'label': 'Net Total (Import)', 'label': 'Net Total (Import)',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'net_total_import', 'oldfieldname': 'net_total_import',
@ -770,7 +769,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'grand_total_import', 'fieldname': 'grand_total_import',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 47,
'label': 'Grand Total (Import)', 'label': 'Grand Total (Import)',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'grand_total_import', 'oldfieldname': 'grand_total_import',
@ -787,7 +785,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'in_words_import', 'fieldname': 'in_words_import',
'fieldtype': 'Data', 'fieldtype': 'Data',
'idx': 48,
'label': 'In Words(Import)', 'label': 'In Words(Import)',
'oldfieldname': 'in_words_import', 'oldfieldname': 'in_words_import',
'oldfieldtype': 'Data', 'oldfieldtype': 'Data',
@ -800,7 +797,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'other_charges_added_import', 'fieldname': 'other_charges_added_import',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 49,
'label': 'Other Charges Added (Import)', 'label': 'Other Charges Added (Import)',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'other_charges_added_import', 'oldfieldname': 'other_charges_added_import',
@ -815,7 +811,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'other_charges_deducted_import', 'fieldname': 'other_charges_deducted_import',
'fieldtype': 'Currency', 'fieldtype': 'Currency',
'idx': 50,
'label': 'Other Charges Deducted (Import)', 'label': 'Other Charges Deducted (Import)',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'other_charges_deducted_import', 'oldfieldname': 'other_charges_deducted_import',
@ -829,7 +824,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 51,
'label': 'Terms', 'label': 'Terms',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@ -841,7 +835,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'letter_head', 'fieldname': 'letter_head',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 52,
'label': 'Letter Head', 'label': 'Letter Head',
'oldfieldname': 'letter_head', 'oldfieldname': 'letter_head',
'oldfieldtype': 'Select', 'oldfieldtype': 'Select',
@ -855,7 +848,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'tc_name', 'fieldname': 'tc_name',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 53,
'label': 'Select Terms', 'label': 'Select Terms',
'oldfieldname': 'tc_name', 'oldfieldname': 'tc_name',
'oldfieldtype': 'Link', 'oldfieldtype': 'Link',
@ -868,7 +860,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 54,
'label': 'Get Terms', 'label': 'Get Terms',
'oldfieldtype': 'Button', 'oldfieldtype': 'Button',
'options': 'get_tc_details', 'options': 'get_tc_details',
@ -879,7 +870,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'HTML', 'fieldtype': 'HTML',
'idx': 55,
'label': 'Terms HTML', 'label': 'Terms HTML',
'oldfieldtype': 'HTML', 'oldfieldtype': 'HTML',
'options': 'You can add Terms and Notes that will be printed in the Transaction', 'options': 'You can add Terms and Notes that will be printed in the Transaction',
@ -892,7 +882,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'terms', 'fieldname': 'terms',
'fieldtype': 'Text Editor', 'fieldtype': 'Text Editor',
'idx': 56,
'label': 'Terms1', 'label': 'Terms1',
'oldfieldname': 'terms', 'oldfieldname': 'terms',
'oldfieldtype': 'Text Editor', 'oldfieldtype': 'Text Editor',
@ -903,7 +892,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 57,
'label': 'More Info', 'label': 'More Info',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@ -915,7 +903,6 @@
'fieldname': 'ref_sq', 'fieldname': 'ref_sq',
'fieldtype': 'Data', 'fieldtype': 'Data',
'hidden': 1, 'hidden': 1,
'idx': 58,
'label': 'Ref SQ', 'label': 'Ref SQ',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'ref_sq', 'oldfieldname': 'ref_sq',
@ -930,7 +917,6 @@
'fieldname': 'amended_from', 'fieldname': 'amended_from',
'fieldtype': 'Data', 'fieldtype': 'Data',
'hidden': 0, 'hidden': 0,
'idx': 59,
'label': 'Amended From', 'label': 'Amended From',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'amended_from', 'oldfieldname': 'amended_from',
@ -947,7 +933,6 @@
'fieldname': 'amendment_date', 'fieldname': 'amendment_date',
'fieldtype': 'Date', 'fieldtype': 'Date',
'hidden': 0, 'hidden': 0,
'idx': 60,
'label': 'Amendment Date', 'label': 'Amendment Date',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'amendment_date', 'oldfieldname': 'amendment_date',
@ -963,7 +948,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'company', 'fieldname': 'company',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 61,
'in_filter': 1, 'in_filter': 1,
'label': 'Company', 'label': 'Company',
'no_copy': 0, 'no_copy': 0,
@ -981,7 +965,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'fiscal_year', 'fieldname': 'fiscal_year',
'fieldtype': 'Select', 'fieldtype': 'Select',
'idx': 62,
'in_filter': 1, 'in_filter': 1,
'label': 'Fiscal Year', 'label': 'Fiscal Year',
'no_copy': 0, 'no_copy': 0,
@ -1001,7 +984,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'select_print_heading', 'fieldname': 'select_print_heading',
'fieldtype': 'Link', 'fieldtype': 'Link',
'idx': 63,
'label': 'Select Print Heading', 'label': 'Select Print Heading',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'select_print_heading', 'oldfieldname': 'select_print_heading',
@ -1017,7 +999,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'instructions', 'fieldname': 'instructions',
'fieldtype': 'Text', 'fieldtype': 'Text',
'idx': 64,
'label': 'Instructions', 'label': 'Instructions',
'oldfieldname': 'instructions', 'oldfieldname': 'instructions',
'oldfieldtype': 'Text', 'oldfieldtype': 'Text',
@ -1028,7 +1009,6 @@
{ {
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Column Break', 'fieldtype': 'Column Break',
'idx': 65,
'oldfieldtype': 'Column Break', 'oldfieldtype': 'Column Break',
'permlevel': 0, 'permlevel': 0,
'width': '50%' 'width': '50%'
@ -1040,7 +1020,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'payment_terms', 'fieldname': 'payment_terms',
'fieldtype': 'Text', 'fieldtype': 'Text',
'idx': 66,
'label': 'Payment Terms', 'label': 'Payment Terms',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'payment_terms', 'oldfieldname': 'payment_terms',
@ -1054,7 +1033,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'remarks', 'fieldname': 'remarks',
'fieldtype': 'Text', 'fieldtype': 'Text',
'idx': 67,
'label': 'Remarks', 'label': 'Remarks',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'remarks', 'oldfieldname': 'remarks',
@ -1071,7 +1049,6 @@
'fieldname': 'cancel_reason', 'fieldname': 'cancel_reason',
'fieldtype': 'Data', 'fieldtype': 'Data',
'hidden': 0, 'hidden': 0,
'idx': 68,
'label': 'Cancel Reason', 'label': 'Cancel Reason',
'no_copy': 1, 'no_copy': 1,
'oldfieldname': 'cancel_reason', 'oldfieldname': 'cancel_reason',
@ -1086,7 +1063,6 @@
'description': 'Required raw materials issued to the supplier for producing a sub - contracted item.', 'description': 'Required raw materials issued to the supplier for producing a sub - contracted item.',
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Section Break', 'fieldtype': 'Section Break',
'idx': 69,
'label': 'Raw Material Details', 'label': 'Raw Material Details',
'oldfieldtype': 'Section Break', 'oldfieldtype': 'Section Break',
'permlevel': 0 'permlevel': 0
@ -1098,7 +1074,6 @@
'doctype': 'DocField', 'doctype': 'DocField',
'fieldname': 'po_raw_material_details', 'fieldname': 'po_raw_material_details',
'fieldtype': 'Table', 'fieldtype': 'Table',
'idx': 70,
'label': 'PO Raw Material Details', 'label': 'PO Raw Material Details',
'no_copy': 0, 'no_copy': 0,
'oldfieldname': 'po_raw_material_details', 'oldfieldname': 'po_raw_material_details',
@ -1113,7 +1088,6 @@
'allow_on_submit': 1, 'allow_on_submit': 1,
'doctype': 'DocField', 'doctype': 'DocField',
'fieldtype': 'Button', 'fieldtype': 'Button',
'idx': 71,
'label': 'Repair Purchase Order', 'label': 'Repair Purchase Order',
'oldfieldtype': 'Button', 'oldfieldtype': 'Button',
'options': 'repair_purchase_order', 'options': 'repair_purchase_order',

View File

@ -583,7 +583,11 @@ HomeStatusBar = function() {
this.render = function(r) { this.render = function(r) {
this.wrapper.innerHTML = ''; this.wrapper.innerHTML = '';
this.span = $a(this.wrapper, 'span', 'link_type', {fontWeight:'bold'}); this.profile_settings = $a($a(this.wrapper, 'p'), 'span', 'link_type', {fontWeight:'bold'});
this.profile_settings.innerHTML = user_fullname + ' (Profile Settings)';
this.profile_settings.onclick = function() { loadpage('profile-settings'); }
this.span = $a($a(this.wrapper, 'p'), 'span', 'link_type', {fontWeight:'bold'});
this.span.onclick = function() { loadpage('My Company') } this.span.onclick = function() { loadpage('My Company') }
if(r.unread_messages) { if(r.unread_messages) {

View File

@ -48,9 +48,8 @@ pscript.myc_add_user = function() {
reqd: 1, reqd: 1,
label: 'Email Id of the user to add' label: 'Email Id of the user to add'
}]; }];
console.log(pscript.is_erpnext_saas);
if(pscript.is_erpnext_saas==0) { if(!pscript.is_erpnext_saas) {
fields = fields.concat([ fields = fields.concat([
{ {
fieldtype: 'Data', fieldtype: 'Data',
@ -61,7 +60,6 @@ pscript.myc_add_user = function() {
{ {
fieldtype: 'Data', fieldtype: 'Data',
fieldname: 'last_name', fieldname: 'last_name',
reqd: 1,
label: 'Last Name' label: 'Last Name'
}, },
{ {
@ -78,8 +76,6 @@ pscript.myc_add_user = function() {
fieldname: 'add' fieldname: 'add'
}); });
console.log(fields);
var d = new wn.widgets.Dialog({ var d = new wn.widgets.Dialog({
title: 'Add User', title: 'Add User',
width: 400, width: 400,

View File

@ -34,6 +34,8 @@ def disable_profile(arg=''):
return 'Cannot disable Administrator' return 'Cannot disable Administrator'
webnotes.conn.sql("update tabProfile set enabled=0 where name=%s", arg) webnotes.conn.sql("update tabProfile set enabled=0 where name=%s", arg)
login_manager = LoginManager()
login_manager.logout(user=arg)
return 0 return 0
# #

View File

@ -36,7 +36,7 @@ MyProfile = function(wrapper) {
this.form = new wn.widgets.FieldGroup() this.form = new wn.widgets.FieldGroup()
this.form.make_fields(div, [ this.form.make_fields(div, [
{fieldname:'first_name', fieldtype:'Data',label:'First Name',reqd:1}, {fieldname:'first_name', fieldtype:'Data',label:'First Name',reqd:1},
{fieldname:'last_name', fieldtype:'Data',label:'Last Name',reqd:1}, {fieldname:'last_name', fieldtype:'Data',label:'Last Name'},
{fieldname:'bio', fieldtype:'Text',label:'Bio'}, {fieldname:'bio', fieldtype:'Text',label:'Bio'},
{fieldname:'update', fieldtype:'Button',label:'Update'} {fieldname:'update', fieldtype:'Button',label:'Update'}
]); ]);

View File

View File

@ -0,0 +1,20 @@
import webnotes
def execute():
"""
To Hide Net Total, Grand Total Export and Rounded Total Export on checking print hide
Uncheck print_hide for fields:
net_total, grand_total_export and rounded_total_export
For DocType(s):
* Receivable Voucher
* Sales Order
* Delivery Note
* Quotation
"""
webnotes.conn.sql("""\
UPDATE tabDocField
SET print_hide = 0
WHERE fieldname IN ('net_total', 'grand_total_export', 'rounded_total_export')
AND parent IN ('Receivable Voucher', 'Sales Order', 'Delivery Note', 'Quotation')
""")

View File

@ -0,0 +1,37 @@
import webnotes
def execute():
"""
* Create DocType Label
* Reload Related DocTypes
"""
create_doctype_label()
reload_related_doctype()
def create_doctype_label():
"""
Creates a DocType Label Record for Indent
"""
res = webnotes.conn.sql("""\
SELECT name FROM `tabDocType Label`
WHERE name='Indent'
""")
if not(res and res[0] and res[0][0]):
from webnotes.model.doc import Document
doclabel = Document('DocType Label')
doclabel.dt = 'Indent'
doclabel.dt_label = 'Purchase Requisition'
doclabel.save(1)
def reload_related_doctype():
"""
Reload:
* indent
* purchase_order
* po_detail
"""
from webnotes.modules.module_manager import reload_doc
reload_doc('buying', 'doctype', 'indent')
reload_doc('buying', 'doctype', 'purchase_order')
reload_doc('buying', 'doctype', 'po_detail')

View File

@ -0,0 +1,38 @@
import webnotes
from webnotes.modules.module_manager import reload_doc
def execute():
"""
* Reload RV Tax Detail
* Reload Support Ticket
* Run Install Print Format Patch
* Reload DocLayer
"""
reload_doc('accounts', 'doctype', 'rv_tax_detail')
reload_doc('support', 'doctype', 'support_ticket')
reload_print_formats()
reload_doc('core', 'doctype', 'doclayer')
def reload_print_formats():
"""
Reloads the following print formats:
* Sales Invoice Classic/Modern/Spartan
* Sales Order Classic/Modern/Spartan
* Delivery Note Classic/Modern/Spartan
* Quotation Classic/Modern/Spartan
"""
reload_doc('accounts', 'Print Format', 'Sales Invoice Classic')
reload_doc('accounts', 'Print Format', 'Sales Invoice Modern')
reload_doc('accounts', 'Print Format', 'Sales Invoice Spartan')
reload_doc('selling', 'Print Format', 'Sales Order Classic')
reload_doc('selling', 'Print Format', 'Sales Order Modern')
reload_doc('selling', 'Print Format', 'Sales Order Spartan')
reload_doc('selling', 'Print Format', 'Quotation Classic')
reload_doc('selling', 'Print Format', 'Quotation Modern')
reload_doc('selling', 'Print Format', 'Quotation Spartan')
reload_doc('stock', 'Print Format', 'Delivery Note Classic')
reload_doc('stock', 'Print Format', 'Delivery Note Modern')
reload_doc('stock', 'Print Format', 'Delivery Note Spartan')

View File

@ -361,32 +361,6 @@ def execute(patch_no):
elif patch_no == 370: elif patch_no == 370:
sql("update `tabDocField` set `hidden` = 0 where fieldname = 'group_or_ledger' and parent = 'Cost Center'") sql("update `tabDocField` set `hidden` = 0 where fieldname = 'group_or_ledger' and parent = 'Cost Center'")
elif patch_no == 371: elif patch_no == 371:
comp = sql("select name from tabCompany where docstatus!=2")
fy = sql("select name from `tabFiscal Year` order by year_start_date asc")
for c in comp:
prev_fy = ''
for f in fy:
fy_obj = get_obj('Fiscal Year', f[0])
fy_obj.doc.past_year = prev_fy
fy_obj.doc.company = c[0]
fy_obj.doc.save()
fy_obj.repost()
prev_fy = f[0]
sql("commit")
sql("start transaction")
elif patch_no == 372:
sql("update tabDocPerm set amend = 0 where parent = 'Salary Structure'")
sql("update tabDocPerm set cancel = 1 where parent = 'Company' and role = 'System Manager'")
elif patch_no == 373:
if sql("select count(name) from `tabDocField` where label = 'View Ledger Entry' and parent = 'Journal Voucher' and fieldtype = 'Button'")[0][0] > 1:
sql("delete from `tabDocField` where label = 'View Ledger Entry' and parent = 'Journal Voucher' and fieldtype = 'Button' limit 1")
if sql("select count(name) from `tabDocField` where label = 'Get Balance' and parent = 'Journal Voucher' and fieldtype = 'Button'")[0][0] > 1:
sql("delete from `tabDocField` where label = 'Get Balance' and parent = 'Journal Voucher' and fieldtype = 'Button' limit 1")
elif patch_no == 374:
reload_doc('accounts', 'doctype', 'internal_reconciliation')
reload_doc('accounts', 'doctype', 'ir_payment_detail')
reload_doc('accounts', 'Module Def', 'Accounts')
elif patch_no == 375:
from webnotes.modules.module_manager import reload_doc from webnotes.modules.module_manager import reload_doc
reload_doc('setup', 'doctype','features_setup') reload_doc('setup', 'doctype','features_setup')
@ -402,8 +376,7 @@ def execute(patch_no):
sql("delete from `tabDefaultValue` where defkey in (%s) and parent = 'Control Panel'" % st) sql("delete from `tabDefaultValue` where defkey in (%s) and parent = 'Control Panel'" % st)
get_obj('Features Setup', 'Features Setup').doc.save() get_obj('Features Setup', 'Features Setup').doc.save()
elif patch_no == 372:
elif patch_no == 376:
from webnotes.modules.module_manager import reload_doc from webnotes.modules.module_manager import reload_doc
reload_doc('setup', 'doctype','features_setup') reload_doc('setup', 'doctype','features_setup')
@ -420,10 +393,10 @@ def execute(patch_no):
sql("delete from `tabDefaultValue` where defkey in (%s) and parent = 'Control Panel'" % st) sql("delete from `tabDefaultValue` where defkey in (%s) and parent = 'Control Panel'" % st)
get_obj('Features Setup', 'Features Setup').doc.save() get_obj('Features Setup', 'Features Setup').doc.save()
elif patch_no == 377: elif patch_no == 373:
sql("delete from `tabDocField` where fieldname = 'item_searial_nos' and parent = 'Features Setup'") sql("delete from `tabDocField` where fieldname = 'item_searial_nos' and parent = 'Features Setup'")
sql("delete from `tabDefaultValue` where defkey = 'item_searial_nos' and parent = 'Control Panel'") sql("delete from `tabDefaultValue` where defkey = 'item_searial_nos' and parent = 'Control Panel'")
elif patch_no == 378: elif patch_no == 374:
rs = sql("select fieldname from tabDocField where parent='Features Setup' and fieldname is not null") rs = sql("select fieldname from tabDocField where parent='Features Setup' and fieldname is not null")
from webnotes.model.code import get_obj from webnotes.model.code import get_obj
m = get_obj('Features Setup') m = get_obj('Features Setup')
@ -431,15 +404,12 @@ def execute(patch_no):
m.doc.fields[d[0]] = 1 m.doc.fields[d[0]] = 1
m.doc.save() m.doc.save()
m.validate() m.validate()
elif patch_no == 379: elif patch_no == 375:
if sql("select count(name) from `tabDocField` where label = 'Get Specification Details' and parent = 'QA Inspection Report' and fieldtype = 'Button'")[0][0] > 1:
sql("delete from `tabDocField` where label = 'Get Specification Details' and parent = 'QA Inspection Report' and fieldtype = 'Button' limit 1")
elif patch_no == 380:
from webnotes.session_cache import clear_cache from webnotes.session_cache import clear_cache
clear_cache(webnotes.session['user']) clear_cache(webnotes.session['user'])
elif patch_no == 381: elif patch_no == 376:
reload_doc('stock', 'DocType Mapper', 'Purchase Order-Purchase Receipt') reload_doc('stock', 'DocType Mapper', 'Purchase Order-Purchase Receipt')
elif patch_no == 382: elif patch_no == 377:
flds = ['page_break', 'projects', 'packing_details', 'discounts', 'brands', 'item_batch_nos', 'after_sales_installations', 'item_searial_nos', 'item_group_in_details', 'exports', 'imports', 'item_advanced', 'sales_extras', 'more_info', 'quality', 'manufacturing', 'pos', 'item_serial_nos'] flds = ['page_break', 'projects', 'packing_details', 'discounts', 'brands', 'item_batch_nos', 'after_sales_installations', 'item_searial_nos', 'item_group_in_details', 'exports', 'imports', 'item_advanced', 'sales_extras', 'more_info', 'quality', 'manufacturing', 'pos', 'item_serial_nos']
st = "'"+"', '".join(flds)+"'" st = "'"+"', '".join(flds)+"'"
@ -448,6 +418,35 @@ def execute(patch_no):
from webnotes.session_cache import clear_cache from webnotes.session_cache import clear_cache
clear_cache(webnotes.session['user']) clear_cache(webnotes.session['user'])
elif patch_no == 378:
comp = sql("select name from tabCompany where docstatus!=2")
fy = sql("select name from `tabFiscal Year` order by year_start_date asc")
for c in comp:
prev_fy = ''
for f in fy:
fy_obj = get_obj('Fiscal Year', f[0])
fy_obj.doc.past_year = prev_fy
fy_obj.doc.company = c[0]
fy_obj.doc.save()
fy_obj.repost()
prev_fy = f[0]
sql("commit")
sql("start transaction")
elif patch_no == 379:
sql("update tabDocPerm set amend = 0 where parent = 'Salary Structure'")
sql("update tabDocPerm set cancel = 1 where parent = 'Company' and role = 'System Manager'")
elif patch_no == 380:
if sql("select count(name) from `tabDocField` where label = 'View Ledger Entry' and parent = 'Journal Voucher' and fieldtype = 'Button'")[0][0] > 1:
sql("delete from `tabDocField` where label = 'View Ledger Entry' and parent = 'Journal Voucher' and fieldtype = 'Button' limit 1")
if sql("select count(name) from `tabDocField` where label = 'Get Balance' and parent = 'Journal Voucher' and fieldtype = 'Button'")[0][0] > 1:
sql("delete from `tabDocField` where label = 'Get Balance' and parent = 'Journal Voucher' and fieldtype = 'Button' limit 1")
elif patch_no == 381:
reload_doc('accounts', 'doctype', 'internal_reconciliation')
reload_doc('accounts', 'doctype', 'ir_payment_detail')
reload_doc('accounts', 'Module Def', 'Accounts')
elif patch_no == 382:
if sql("select count(name) from `tabDocField` where label = 'Get Specification Details' and parent = 'QA Inspection Report' and fieldtype = 'Button'")[0][0] > 1:
sql("delete from `tabDocField` where label = 'Get Specification Details' and parent = 'QA Inspection Report' and fieldtype = 'Button' limit 1")
elif patch_no == 383: elif patch_no == 383:
reload_doc('accounts', 'doctype', 'cost_center') reload_doc('accounts', 'doctype', 'cost_center')
elif patch_no == 384: elif patch_no == 384:

View File

@ -0,0 +1,17 @@
patch_list = [
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'stable_branch_shift_09_01_12',
'description': 'Various Reloads for shifting branch from master to stable'
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'print_hide_totals',
'description': 'Uncheck print_hide for RV, SO, DN and Quotation'
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'rename_doctype_indent',
'description': 'Add DocType Label: Indent to Purchase Requisition'
}
]

View File

@ -115,7 +115,8 @@
var to_append = '' var to_append = ''
if(data_row.adj_rate){ if(data_row.adj_rate){
to_append = '<div style="padding-left: 15px;"><i>Discount: ' + to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
data_row.adj_rate + '%</i></div>'; data_row.adj_rate + '% on ' + doc.currency + ' ' +
fmt_money(data_row.ref_rate) + '</i></div>';
if(data_row.description.indexOf(to_append)==-1) { if(data_row.description.indexOf(to_append)==-1) {
data_row.description = data_row.description + to_append; data_row.description = data_row.description + to_append;
} }
@ -156,6 +157,7 @@
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges'); var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n'; var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) { for(var i=0; i<oc.length; i++) {
if(!oc[i].included_in_print_rate) {
rows += rows +=
'<tr>\n' + '<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' + '\t<td>' + oc[i].description + '</td>\n' +
@ -163,6 +165,7 @@
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' + '\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n'; '</tr>\n';
} }
}
return rows + '</table>\n'; return rows + '</table>\n';
} }
}; };

View File

@ -138,7 +138,8 @@
var to_append = '' var to_append = ''
if(data_row.adj_rate){ if(data_row.adj_rate){
to_append = '<div style="padding-left: 15px;"><i>Discount: ' + to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
data_row.adj_rate + '%</i></div>'; data_row.adj_rate + '% on ' + doc.currency + ' ' +
fmt_money(data_row.ref_rate) + '</i></div>';
if(data_row.description.indexOf(to_append)==-1) { if(data_row.description.indexOf(to_append)==-1) {
data_row.description = data_row.description + to_append; data_row.description = data_row.description + to_append;
} }
@ -179,6 +180,7 @@
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges'); var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n'; var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) { for(var i=0; i<oc.length; i++) {
if(!oc[i].included_in_print_rate) {
rows += rows +=
'<tr>\n' + '<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' + '\t<td>' + oc[i].description + '</td>\n' +
@ -186,6 +188,7 @@
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' + '\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n'; '</tr>\n';
} }
}
return rows + '</table>\n'; return rows + '</table>\n';
} }
}; };

View File

@ -137,7 +137,8 @@
var to_append = '' var to_append = ''
if(data_row.adj_rate){ if(data_row.adj_rate){
to_append = '<div style="padding-left: 15px;"><i>Discount: ' + to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
data_row.adj_rate + '%</i></div>'; data_row.adj_rate + '% on ' + doc.currency + ' ' +
fmt_money(data_row.ref_rate) + '</i></div>';
if(data_row.description.indexOf(to_append)==-1) { if(data_row.description.indexOf(to_append)==-1) {
data_row.description = data_row.description + to_append; data_row.description = data_row.description + to_append;
} }
@ -178,6 +179,7 @@
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges'); var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n'; var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) { for(var i=0; i<oc.length; i++) {
if(!oc[i].included_in_print_rate) {
rows += rows +=
'<tr>\n' + '<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' + '\t<td>' + oc[i].description + '</td>\n' +
@ -185,6 +187,7 @@
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' + '\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n'; '</tr>\n';
} }
}
return rows + '</table>\n'; return rows + '</table>\n';
} }
}; };

View File

@ -114,7 +114,8 @@
'description' : function(data_row) { 'description' : function(data_row) {
if(data_row.adj_rate) { if(data_row.adj_rate) {
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' + var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
data_row.adj_rate + '%</i></div>'; data_row.adj_rate + '% on ' + doc.currency + ' ' +
fmt_money(data_row.ref_rate) + '</i></div>';
if(data_row.description.indexOf(to_append)==-1) { if(data_row.description.indexOf(to_append)==-1) {
return data_row.description + to_append; return data_row.description + to_append;
} else { return data_row.description; } } else { return data_row.description; }
@ -146,6 +147,7 @@
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges'); var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n'; var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) { for(var i=0; i<oc.length; i++) {
if(!oc[i].included_in_print_rate) {
rows += rows +=
'<tr>\n' + '<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' + '\t<td>' + oc[i].description + '</td>\n' +
@ -153,6 +155,7 @@
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' + '\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n'; '</tr>\n';
} }
}
return rows + '</table>\n'; return rows + '</table>\n';
} }
}; };

View File

@ -137,7 +137,8 @@
'description' : function(data_row) { 'description' : function(data_row) {
if(data_row.adj_rate) { if(data_row.adj_rate) {
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' + var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
data_row.adj_rate + '%</i></div>'; data_row.adj_rate + '% on ' + doc.currency + ' ' +
fmt_money(data_row.ref_rate) + '</i></div>';
if(data_row.description.indexOf(to_append)==-1) { if(data_row.description.indexOf(to_append)==-1) {
return data_row.description + to_append; return data_row.description + to_append;
} else { return data_row.description; } } else { return data_row.description; }
@ -169,6 +170,7 @@
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges'); var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n'; var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) { for(var i=0; i<oc.length; i++) {
if(!oc[i].included_in_print_rate) {
rows += rows +=
'<tr>\n' + '<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' + '\t<td>' + oc[i].description + '</td>\n' +
@ -176,6 +178,7 @@
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' + '\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n'; '</tr>\n';
} }
}
return rows + '</table>\n'; return rows + '</table>\n';
} }
}; };

View File

@ -136,7 +136,8 @@
'description' : function(data_row) { 'description' : function(data_row) {
if(data_row.adj_rate) { if(data_row.adj_rate) {
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' + var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
data_row.adj_rate + '%</i></div>'; data_row.adj_rate + '% on ' + doc.currency + ' ' +
fmt_money(data_row.ref_rate) + '</i></div>';
if(data_row.description.indexOf(to_append)==-1) { if(data_row.description.indexOf(to_append)==-1) {
return data_row.description + to_append; return data_row.description + to_append;
} else { return data_row.description; } } else { return data_row.description; }
@ -168,6 +169,7 @@
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges'); var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n'; var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) { for(var i=0; i<oc.length; i++) {
if(!oc[i].included_in_print_rate) {
rows += rows +=
'<tr>\n' + '<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' + '\t<td>' + oc[i].description + '</td>\n' +
@ -175,6 +177,7 @@
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' + '\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n'; '</tr>\n';
} }
}
return rows + '</table>\n'; return rows + '</table>\n';
} }
}; };

View File

@ -114,7 +114,8 @@
'description' : function(data_row) { 'description' : function(data_row) {
if(data_row.adj_rate) { if(data_row.adj_rate) {
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' + var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
data_row.adj_rate + '%</i></div>'; data_row.adj_rate + '% on ' + doc.currency + ' ' +
fmt_money(data_row.ref_rate) + '</i></div>';
if(data_row.description.indexOf(to_append)==-1) { if(data_row.description.indexOf(to_append)==-1) {
return data_row.description + to_append; return data_row.description + to_append;
} else { return data_row.description; } } else { return data_row.description; }
@ -146,6 +147,7 @@
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges'); var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n'; var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) { for(var i=0; i<oc.length; i++) {
if(!oc[i].included_in_print_rate) {
rows += rows +=
'<tr>\n' + '<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' + '\t<td>' + oc[i].description + '</td>\n' +
@ -153,6 +155,7 @@
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' + '\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n'; '</tr>\n';
} }
}
return rows + '</table>\n'; return rows + '</table>\n';
} }
}; };

View File

@ -137,7 +137,8 @@
'description' : function(data_row) { 'description' : function(data_row) {
if(data_row.adj_rate) { if(data_row.adj_rate) {
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' + var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
data_row.adj_rate + '%</i></div>'; data_row.adj_rate + '% on ' + doc.currency + ' ' +
fmt_money(data_row.ref_rate) + '</i></div>';
if(data_row.description.indexOf(to_append)==-1) { if(data_row.description.indexOf(to_append)==-1) {
return data_row.description + to_append; return data_row.description + to_append;
} else { return data_row.description; } } else { return data_row.description; }
@ -169,6 +170,7 @@
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges'); var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n'; var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) { for(var i=0; i<oc.length; i++) {
if(!oc[i].included_in_print_rate) {
rows += rows +=
'<tr>\n' + '<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' + '\t<td>' + oc[i].description + '</td>\n' +
@ -176,6 +178,7 @@
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' + '\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n'; '</tr>\n';
} }
}
return rows + '</table>\n'; return rows + '</table>\n';
} }
}; };

View File

@ -136,7 +136,8 @@
'description' : function(data_row) { 'description' : function(data_row) {
if(data_row.adj_rate) { if(data_row.adj_rate) {
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' + var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
data_row.adj_rate + '%</i></div>'; data_row.adj_rate + '% on ' + doc.currency + ' ' +
fmt_money(data_row.ref_rate) + '</i></div>';
if(data_row.description.indexOf(to_append)==-1) { if(data_row.description.indexOf(to_append)==-1) {
return data_row.description + to_append; return data_row.description + to_append;
} else { return data_row.description; } } else { return data_row.description; }
@ -168,6 +169,7 @@
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges'); var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n'; var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) { for(var i=0; i<oc.length; i++) {
if(!oc[i].included_in_print_rate) {
rows += rows +=
'<tr>\n' + '<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' + '\t<td>' + oc[i].description + '</td>\n' +
@ -175,6 +177,7 @@
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' + '\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n'; '</tr>\n';
} }
}
return rows + '</table>\n'; return rows + '</table>\n';
} }
}; };

View File

@ -114,7 +114,8 @@
'description' : function(data_row) { 'description' : function(data_row) {
if(data_row.adj_rate) { if(data_row.adj_rate) {
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' + var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
data_row.adj_rate + '%</i></div>'; data_row.adj_rate + '% on ' + doc.currency + ' ' +
fmt_money(data_row.ref_rate) + '</i></div>';
if(data_row.description.indexOf(to_append)==-1) { if(data_row.description.indexOf(to_append)==-1) {
return data_row.description + to_append; return data_row.description + to_append;
} else { return data_row.description; } } else { return data_row.description; }
@ -146,6 +147,7 @@
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges'); var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n'; var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) { for(var i=0; i<oc.length; i++) {
if(!oc[i].included_in_print_rate) {
rows += rows +=
'<tr>\n' + '<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' + '\t<td>' + oc[i].description + '</td>\n' +
@ -153,6 +155,7 @@
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' + '\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n'; '</tr>\n';
} }
}
return rows + '</table>\n'; return rows + '</table>\n';
} }
}; };

View File

@ -137,7 +137,8 @@
'description' : function(data_row) { 'description' : function(data_row) {
if(data_row.adj_rate) { if(data_row.adj_rate) {
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' + var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
data_row.adj_rate + '%</i></div>'; data_row.adj_rate + '% on ' + doc.currency + ' ' +
fmt_money(data_row.ref_rate) + '</i></div>';
if(data_row.description.indexOf(to_append)==-1) { if(data_row.description.indexOf(to_append)==-1) {
return data_row.description + to_append; return data_row.description + to_append;
} else { return data_row.description; } } else { return data_row.description; }
@ -169,6 +170,7 @@
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges'); var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n'; var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) { for(var i=0; i<oc.length; i++) {
if(!oc[i].included_in_print_rate) {
rows += rows +=
'<tr>\n' + '<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' + '\t<td>' + oc[i].description + '</td>\n' +
@ -176,6 +178,7 @@
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' + '\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n'; '</tr>\n';
} }
}
return rows + '</table>\n'; return rows + '</table>\n';
} }
}; };

View File

@ -136,7 +136,8 @@
'description' : function(data_row) { 'description' : function(data_row) {
if(data_row.adj_rate) { if(data_row.adj_rate) {
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' + var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
data_row.adj_rate + '%</i></div>'; data_row.adj_rate + '% on ' + doc.currency + ' ' +
fmt_money(data_row.ref_rate) + '</i></div>';
if(data_row.description.indexOf(to_append)==-1) { if(data_row.description.indexOf(to_append)==-1) {
return data_row.description + to_append; return data_row.description + to_append;
} else { return data_row.description; } } else { return data_row.description; }
@ -168,6 +169,7 @@
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges'); var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
var rows = '<table width=100%>\n'; var rows = '<table width=100%>\n';
for(var i=0; i<oc.length; i++) { for(var i=0; i<oc.length; i++) {
if(!oc[i].included_in_print_rate) {
rows += rows +=
'<tr>\n' + '<tr>\n' +
'\t<td>' + oc[i].description + '</td>\n' + '\t<td>' + oc[i].description + '</td>\n' +
@ -175,6 +177,7 @@
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' + '\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
'</tr>\n'; '</tr>\n';
} }
}
return rows + '</table>\n'; return rows + '</table>\n';
} }
}; };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -116,7 +116,6 @@ class DocType(TransactionBase):
ch.person = d ch.person = d
ch.save(1) ch.save(1)
#--------------Validation For Last Contact Date----------------- #--------------Validation For Last Contact Date-----------------
# ==================================================================================================================== # ====================================================================================================================
def set_last_contact_date(self): def set_last_contact_date(self):

View File

@ -5,7 +5,7 @@
{ {
'creation': '2010-08-08 17:09:17', 'creation': '2010-08-08 17:09:17',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-12-22 19:03:04', 'modified': '2012-01-09 16:52:51',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@ -21,7 +21,7 @@
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1322549700', '_last_update': '1325570646',
'allow_attach': 1, 'allow_attach': 1,
'allow_email': 0, 'allow_email': 0,
'allow_trash': 1, 'allow_trash': 1,
@ -41,7 +41,7 @@
'show_in_menu': 0, 'show_in_menu': 0,
'subject': 'To %(customer_name)s on %(transaction_date)s worth %(currency)s %(grand_total_export)s', 'subject': 'To %(customer_name)s on %(transaction_date)s worth %(currency)s %(grand_total_export)s',
'tag_fields': 'status', 'tag_fields': 'status',
'version': 598 'version': 599
}, },
# These values are common for all DocFormat # These values are common for all DocFormat
@ -703,7 +703,7 @@
'oldfieldname': 'net_total', 'oldfieldname': 'net_total',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 0,
'reqd': 0, 'reqd': 0,
'width': '100px' 'width': '100px'
}, },
@ -902,7 +902,7 @@
'oldfieldname': 'grand_total_export', 'oldfieldname': 'grand_total_export',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 0,
'reqd': 0, 'reqd': 0,
'width': '200px' 'width': '200px'
}, },
@ -917,7 +917,7 @@
'oldfieldname': 'rounded_total_export', 'oldfieldname': 'rounded_total_export',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 0,
'reqd': 0, 'reqd': 0,
'width': '200px' 'width': '200px'
}, },

View File

@ -131,25 +131,46 @@ cur_frm.cscript.adj_rate = function(doc, cdt, cdn) { cur_frm.cscript.recalc(doc,
// ************************ REF RATE **************************** // ************************ REF RATE ****************************
cur_frm.cscript.ref_rate = function(doc, cdt, cdn){ cur_frm.cscript.ref_rate = function(doc, cdt, cdn){
var d = locals[cdt][cdn]; var d = locals[cdt][cdn];
var consider_incl_rate = cur_frm.cscript.consider_incl_rate(doc, cur_frm.cscript.other_fname);
if(!consider_incl_rate) {
set_multiple(cur_frm.cscript.tname, d.name, {'export_rate': flt(d.ref_rate) * (100 - flt(d.adj_rate)) / 100}, cur_frm.cscript.fname); set_multiple(cur_frm.cscript.tname, d.name, {'export_rate': flt(d.ref_rate) * (100 - flt(d.adj_rate)) / 100}, cur_frm.cscript.fname);
cur_frm.cscript.recalc(doc, 3); }
cur_frm.cscript.recalc(doc, 1);
} }
// *********************** BASIC RATE ************************** // *********************** BASIC RATE **************************
cur_frm.cscript.basic_rate = function(doc, cdt, cdn) { cur_frm.cscript.basic_rate = function(doc, cdt, cdn) {
var fname = cur_frm.cscript.fname; var fname = cur_frm.cscript.fname;
var d = locals[cdt][cdn];; var d = locals[cdt][cdn];
if(!d.qty) if(!d.qty) {
{
d.qty = 1; d.qty = 1;
refresh_field('qty', d.name, fname); refresh_field('qty', d.name, fname);
} }
var consider_incl_rate = cur_frm.cscript.consider_incl_rate(doc, cur_frm.cscript.other_fname);
if(!consider_incl_rate) {
cur_frm.cscript.recalc(doc, 2); cur_frm.cscript.recalc(doc, 2);
} else {
var basic_rate = cur_frm.cscript.back_calc_basic_rate(
doc, cur_frm.cscript.tname, fname, d, cur_frm.cscript.other_fname
);
if (d.basic_rate != basic_rate.toFixed(2)) {
d.basic_rate = basic_rate;
refresh_field('basic_rate', d.name, fname);
msgprint("You cannot change Basic Rate* (Base Currency) when \
considering rates inclusive of taxes.<br /> \
Please either <br /> \
* Specify Basic Rate (i.e. Rate which will be displayed in print) <br /> \
-- or -- <br />\
* Uncheck 'Included in Print Rate' in the tax entries of Taxes section.");
}
}
} }
// ************************ EXPORT RATE ************************* // ************************ EXPORT RATE *************************
cur_frm.cscript.export_rate = function(doc,cdt,cdn) { cur_frm.cscript.recalc(doc, 3);} cur_frm.cscript.export_rate = function(doc,cdt,cdn) {
doc = locals[doc.doctype][doc.name];
cur_frm.cscript.recalc(doc, 1);
}
@ -177,7 +198,7 @@ cur_frm.cscript.recalc = function(doc, n) {
if(!flt(doc.conversion_rate)) { doc.conversion_rate = 1; refresh_field('conversion_rate'); } if(!flt(doc.conversion_rate)) { doc.conversion_rate = 1; refresh_field('conversion_rate'); }
if(!flt(doc.plc_conversion_rate)) { doc.plc_conversion_rate = 1; refresh_field('plc_conversion_rate'); } if(!flt(doc.plc_conversion_rate)) { doc.plc_conversion_rate = 1; refresh_field('plc_conversion_rate'); }
if(n > 0) cur_frm.cscript.update_fname_table(doc , tname , fname , n); // updates all values in table (i.e. amount, export amount, net total etc.) if(n > 0) cur_frm.cscript.update_fname_table(doc , tname , fname , n, other_fname); // updates all values in table (i.e. amount, export amount, net total etc.)
if(flt(doc.net_total) > 0) { if(flt(doc.net_total) > 0) {
var cl = getchildren('RV Tax Detail', doc.name, other_fname,doc.doctype); var cl = getchildren('RV Tax Detail', doc.name, other_fname,doc.doctype);
@ -218,11 +239,18 @@ cur_frm.cscript.calc_doc_values = function(doc, cdt, cdn, tname, fname, other_fn
for(var i = 0; i<cl.length; i++){ for(var i = 0; i<cl.length; i++){
net_total += flt(cl[i].amount); net_total += flt(cl[i].amount);
} }
net_total_incl = net_total
var d = getchildren('RV Tax Detail', doc.name, other_fname,doc.doctype); var d = getchildren('RV Tax Detail', doc.name, other_fname,doc.doctype);
for(var j = 0; j<d.length; j++){ for(var j = 0; j<d.length; j++){
other_charges_total += flt(d[j].amount); other_charges_total += flt(d[j].amount);
if(d[j].included_in_print_rate) {
net_total_incl += flt(d[j].amount);
} }
doc.net_total = flt(net_total); }
//console.log("Net Total: " + net_total);
//console.log("Net Total Incl: " + net_total_incl);
//console.log("Other Charges: " + other_charges_total);
doc.net_total = net_total_incl > net_total ? flt(net_total_incl) : flt(net_total);
doc.other_charges_total = flt(other_charges_total); doc.other_charges_total = flt(other_charges_total);
doc.grand_total = flt(flt(net_total) + flt(other_charges_total)); doc.grand_total = flt(flt(net_total) + flt(other_charges_total));
doc.rounded_total = Math.round(doc.grand_total); doc.rounded_total = Math.round(doc.grand_total);
@ -278,9 +306,12 @@ cur_frm.cscript.calc_other_charges = function(doc , tname , fname , other_fname)
// this is calculation part for all types // this is calculation part for all types
if(tax[t].charge_type != "Actual") tax[t].item_wise_tax_detail += item_wise_tax_detail; if(tax[t].charge_type != "Actual") tax[t].item_wise_tax_detail += item_wise_tax_detail;
tax[t].total_amount = flt(tax_amount.toFixed(2)); //stores actual tax amount in virtual field //tax[t].total_amount = flt(tax_amount.toFixed(2)); //stores actual tax amount in virtual field
tax[t].total_tax_amount = flt(prev_total.toFixed(2)); //stores total amount in virtual field //tax[t].total_tax_amount = flt(prev_total.toFixed(2)); //stores total amount in virtual field
tax[t].tax_amount += flt(tax_amount.toFixed(2)); //tax[t].tax_amount += flt(tax_amount.toFixed(2));
tax[t].total_amount = flt(tax_amount); //stores actual tax amount in virtual field
tax[t].total_tax_amount = flt(prev_total); //stores total amount in virtual field
tax[t].tax_amount += flt(tax_amount);
var total_amount = flt(tax[t].tax_amount); var total_amount = flt(tax[t].tax_amount);
total_tax_amount = flt(tax[t].total_tax_amount) + flt(total_amount); total_tax_amount = flt(tax[t].total_tax_amount) + flt(total_amount);
set_multiple('RV Tax Detail', tax[t].name, { 'item_wise_tax_detail':tax[t].item_wise_tax_detail, 'amount':total_amount, 'total':flt(total)+flt(tax[t].tax_amount)/*_tax_amount)*/}, other_fname); set_multiple('RV Tax Detail', tax[t].name, { 'item_wise_tax_detail':tax[t].item_wise_tax_detail, 'amount':total_amount, 'total':flt(total)+flt(tax[t].tax_amount)/*_tax_amount)*/}, other_fname);
@ -311,6 +342,7 @@ cur_frm.cscript.check_charge_type_and_get_tax_amount = function( doc, tax, t, cl
refresh_field('total_excise_rate'); refresh_field('total_excise_rate');
return return
} }
return tax_amount = (flt(rate) * flt(cl.amount) / 100); return tax_amount = (flt(rate) * flt(cl.amount) / 100);
} }
else if(tax[t].charge_type == 'On Previous Row Amount'){ else if(tax[t].charge_type == 'On Previous Row Amount'){
@ -347,28 +379,158 @@ cur_frm.cscript.check_charge_type_and_get_tax_amount = function( doc, tax, t, cl
} }
} }
// ********************** Functions for inclusive value calc ******************************
cur_frm.cscript.consider_incl_rate = function(doc, other_fname) {
var tax_list = getchildren('RV Tax Detail', doc.name, other_fname, doc.doctype);
for(var i=0; i<tax_list.length; i++) {
if(tax_list[i].included_in_print_rate) {
//console.log('consider incl rate');
return true;
}
}
//console.log('do not consider incl rate');
return false;
}
cur_frm.cscript.back_calc_basic_rate = function(doc, tname, fname, child, other_fname) {
var get_item_tax_rate = function(item, tax) {
if(item.item_tax_rate) {
// Should to replace eval with JSON.parse when item_tax_rate is converted to json string notation
var item_tax = eval('var a='+item.item_tax_rate+';a');
if(item_tax[tax.account_head]!=null) {
return flt(item_tax[tax.account_head]);
}
}
};
var tax_list = getchildren('RV Tax Detail', doc.name, other_fname, doc.doctype);
var total = 1;
var temp_tax_list = [];
var amt = 0;
var item_tax_rate = 0;
var rate = 0;
for(var i=0; i<tax_list.length; i++) {
amt = 0;
item_tax_rate = get_item_tax_rate(child, tax_list[i]);
rate = item_tax_rate ? item_tax_rate : flt(tax_list[i].rate);
if(tax_list[i].included_in_print_rate) {
if(tax_list[i].charge_type=='On Net Total') {
amt = flt(rate / 100);
} else if(tax_list[i].charge_type=='On Previous Row Total') {
amt = flt((rate * temp_tax_list[tax_list[i].row_id-1]['total']) / 100);
} else if(tax_list[i].charge_type=='On Previous Row Amount') {
amt = flt((rate * temp_tax_list[tax_list[i].row_id-1]['amt']) / 100);
}
}
total += flt(amt);
temp_tax_list[i] = {
amt: amt,
total: total
};
}
var basic_rate = flt((child.export_rate * flt(doc.conversion_rate)) / total);
//console.log(temp_tax_list);
//console.log('in basic rate back calc');
//console.log(basic_rate);
return basic_rate;
}
cur_frm.cscript.included_in_print_rate = function(doc, cdt, cdn) {
var tax = locals[cdt][cdn];
if(tax.included_in_print_rate==1) {
if(!inList(['On Net Total', 'On Previous Row Total', 'On Previous Row Amount'], tax.charge_type)) {
msgprint("Included in Print Rate (i.e. Inclusive Price) is only valid for charges of type: <br /> \
* On Net Total <br /> \
* On Previous Row Amount <br /> \
* On Previous Row Total");
tax.included_in_print_rate = 0;
refresh_field('included_in_print_rate', tax.name, cur_frm.cscript.other_fname);
} else if(inList(['On Previous Row Total', 'On Previous Row Amount'], tax.charge_type)){
if(tax.row_id) {
var tax_list = getchildren('RV Tax Detail', doc.name, cur_frm.cscript.other_fname, doc.doctype);
if(tax_list[tax.row_id-1].charge_type=='Actual') {
msgprint("Row of type 'Actual' cannot be depended on for type '" + tax.charge_type + "'\
when using tax inclusive prices.<br />\
This will lead to incorrect values.<br /><br /> \
<b>Please specify correct value in 'Enter Row' column of <span style='color:red'>Row: "
+ tax.idx + "</span> in Taxes table</b>");
validated = false;
tax.included_in_print_rate = 0;
refresh_field('included_in_print_rate', tax.name, cur_frm.cscript.other_fname);
}
}
}
}
}
// ********************** Update values in table ****************************** // ********************** Update values in table ******************************
cur_frm.cscript.update_fname_table = function(doc , tname , fname , n) { cur_frm.cscript.update_fname_table = function(doc , tname , fname , n, other_fname) {
doc = locals[doc.doctype][doc.name] doc = locals[doc.doctype][doc.name]
var net_total = 0 var net_total = 0
var cl = getchildren(tname, doc.name, fname); var cl = getchildren(tname, doc.name, fname);
var consider_incl_rate = cur_frm.cscript.consider_incl_rate(doc, other_fname);
for(var i=0;i<cl.length;i++) { for(var i=0;i<cl.length;i++) {
if(n == 1){ if(n == 1){
if(flt(cl[i].ref_rate) > 0) if(!consider_incl_rate) {
set_multiple(tname, cl[i].name, {'export_rate': flt(flt(cl[i].ref_rate) * (100 - flt(cl[i].adj_rate)) / 100)}, fname); if(flt(cl[i].ref_rate) > 0) {
set_multiple(tname, cl[i].name, {'export_amount': flt(flt(cl[i].qty) * flt(cl[i].export_rate)), 'basic_rate': flt(flt(cl[i].export_rate) * flt(doc.conversion_rate)), 'amount': flt((flt(cl[i].export_rate) * flt(doc.conversion_rate)) * flt(cl[i].qty)) }, fname); set_multiple(tname, cl[i].name, {
'export_rate': flt(flt(cl[i].ref_rate) * (100 - flt(cl[i].adj_rate)) / 100)
}, fname);
} else if(flt(cl[i].export_rate) > 0) {
var ref_rate = flt(cl[i].adj_rate)!=flt(100) ?
flt((100 * flt(cl[i].export_rate))/flt(100 - flt(cl[i].adj_rate))) :
flt(0)
set_multiple(tname, cl[i].name, { 'ref_rate': ref_rate }, fname);
}
set_multiple(tname, cl[i].name, {
'export_amount': flt(flt(cl[i].qty) * flt(cl[i].export_rate)),
'basic_rate': flt(flt(cl[i].export_rate) * flt(doc.conversion_rate)),
'amount': flt((flt(cl[i].export_rate) * flt(doc.conversion_rate)) * flt(cl[i].qty))
}, fname);
var base_ref_rate = flt(cl[i].basic_rate) + flt(flt(cl[i].basic_rate) * flt(cl[i].adj_rate) / 100);
set_multiple(tname, cl[i].name, {
'base_ref_rate': flt(base_ref_rate)
}, fname);
} else if(consider_incl_rate) {
if(flt(cl[i].export_rate) > 0) {
// calculate basic rate based on taxes
// then calculate and set basic_rate, base_ref_rate, ref_rate, amount, export_amount
var ref_rate = flt(cl[i].adj_rate)!=flt(100) ?
flt((100 * flt(cl[i].export_rate))/flt(100 - flt(cl[i].adj_rate))) :
flt(0)
set_multiple(tname, cl[i].name, { 'ref_rate': ref_rate }, fname);
} else if((flt(cl[i].ref_rate) > 0) && (flt(cl[i].adj_rate) > 0)) {
var export_rate = flt(cl[i].ref_rate) * flt(1 - flt(cl[i].adj_rate / 100));
set_multiple(tname, cl[i].name, { 'export_rate': flt(export_rate) }, fname);
}
//console.log("export_rate: " + cl[i].export_rate);
var basic_rate = cur_frm.cscript.back_calc_basic_rate(doc, tname, fname, cl[i], other_fname);
var base_ref_rate = basic_rate + flt(basic_rate * flt(cl[i].adj_rate) / 100);
set_multiple(tname, cl[i].name, {
'basic_rate': flt(basic_rate),
'amount': flt(basic_rate * flt(cl[i].qty)),
'export_amount': flt(flt(cl[i].qty) * flt(cl[i].export_rate)),
'base_ref_rate': flt(base_ref_rate)
}, fname);
}
} }
else if(n == 2){ else if(n == 2){
if(flt(cl[i].ref_rate) > 0) if(flt(cl[i].ref_rate) > 0)
set_multiple(tname, cl[i].name, {'adj_rate': 100 - flt(flt(cl[i].basic_rate) * 100 / (flt(cl[i].ref_rate) * flt(doc.conversion_rate)))}, fname); set_multiple(tname, cl[i].name, {'adj_rate': 100 - flt(flt(cl[i].basic_rate) * 100 / (flt(cl[i].ref_rate) * flt(doc.conversion_rate)))}, fname);
set_multiple(tname, cl[i].name, {'amount': flt(flt(cl[i].qty) * flt(cl[i].basic_rate)), 'export_rate': flt(flt(cl[i].basic_rate) / flt(doc.conversion_rate)), 'export_amount': flt((flt(cl[i].basic_rate) / flt(doc.conversion_rate)) * flt(cl[i].qty)) }, fname); set_multiple(tname, cl[i].name, {'amount': flt(flt(cl[i].qty) * flt(cl[i].basic_rate)), 'export_rate': flt(flt(cl[i].basic_rate) / flt(doc.conversion_rate)), 'export_amount': flt((flt(cl[i].basic_rate) / flt(doc.conversion_rate)) * flt(cl[i].qty)) }, fname);
} }
else if(n == 3){ /*else if(n == 3){
set_multiple(tname, cl[i].name, {'basic_rate': flt(flt(cl[i].export_rate) * flt(doc.conversion_rate))}, fname); set_multiple(tname, cl[i].name, {'basic_rate': flt(flt(cl[i].export_rate) * flt(doc.conversion_rate))}, fname);
set_multiple(tname, cl[i].name, {'amount' : flt(flt(cl[i].basic_rate) * flt(cl[i].qty)), 'export_amount': flt(flt(cl[i].export_rate) * flt(cl[i].qty))}, fname); set_multiple(tname, cl[i].name, {'amount' : flt(flt(cl[i].basic_rate) * flt(cl[i].qty)), 'export_amount': flt(flt(cl[i].export_rate) * flt(cl[i].qty))}, fname);
if(cl[i].ref_rate > 0) if(cl[i].ref_rate > 0)
set_multiple(tname, cl[i].name, {'adj_rate': 100 - flt(flt(cl[i].export_rate) * 100 / flt(cl[i].ref_rate)), 'base_ref_rate': flt(flt(cl[i].ref_rate) * flt(doc.conversion_rate)) }, fname); set_multiple(tname, cl[i].name, {'adj_rate': 100 - flt(flt(cl[i].export_rate) * 100 / flt(cl[i].ref_rate)), 'base_ref_rate': flt(flt(cl[i].ref_rate) * flt(doc.conversion_rate)) }, fname);
} }*/
net_total += flt(flt(cl[i].qty) * flt(cl[i].basic_rate)); net_total += flt(flt(cl[i].qty) * flt(cl[i].basic_rate));
} }
doc.net_total = net_total; doc.net_total = net_total;
@ -397,9 +559,20 @@ cur_frm.cscript['Calculate Charges'] = function(doc, cdt, cdn) {
cl[i].total_amount = 0; cl[i].total_amount = 0;
cl[i].tax_amount = 0; // this is done to calculate other charges cl[i].tax_amount = 0; // this is done to calculate other charges
cl[i].total = 0; cl[i].total = 0;
if(in_list(['On Previous Row Amount','On Previous Row Total'],cl[i].charge_type) && !cl[i].row_id){ if(in_list(['On Previous Row Amount','On Previous Row Total'], cl[i].charge_type)) {
if(!cl[i].row_id){
alert("Please Enter Row on which amount needs to be calculated for row : "+cl[i].idx); alert("Please Enter Row on which amount needs to be calculated for row : "+cl[i].idx);
validated = false; validated = false;
} else if(cl[i].included_in_print_rate && cl[cl[i].row_id-1].charge_type=='Actual') {
msgprint("Row of type 'Actual' cannot be depended on for type '" + cl[i].charge_type + "'\
when using tax inclusive prices.<br />\
This will lead to incorrect values.<br /><br /> \
<b>Please specify correct value in 'Enter Row' column of <span style='color:red'>Row: "
+ cl[i].idx + "</span> in Taxes table</b>");
validated = false;
cl[i].included_in_print_rate = 0;
refresh_field('included_in_print_rate', cl[i].name, other_fname);
}
} }
} }
cur_frm.cscript.recalc(doc, 1); cur_frm.cscript.recalc(doc, 1);

View File

@ -52,7 +52,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
// indent // indent
if(doc.order_type != 'Maintenance') if(doc.order_type != 'Maintenance')
cur_frm.add_custom_button('Make Indent', cur_frm.cscript['Make Indent']); cur_frm.add_custom_button('Make ' + get_doctype_label('Indent'), cur_frm.cscript['Make Purchase Requisition']);
// sales invoice // sales invoice
if(doc.per_billed < 100) if(doc.per_billed < 100)
@ -242,7 +242,7 @@ cur_frm.cscript['Make Maintenance Visit'] = function() {
// make indent // make indent
// ================================================================================================ // ================================================================================================
cur_frm.cscript['Make Indent'] = function() { cur_frm.cscript['Make Purchase Requisition'] = function() {
var doc = cur_frm.doc; var doc = cur_frm.doc;
if (doc.docstatus == 1) { if (doc.docstatus == 1) {
n = createLocal("Indent"); n = createLocal("Indent");

View File

@ -5,7 +5,7 @@
{ {
'creation': '2010-08-08 17:09:21', 'creation': '2010-08-08 17:09:21',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-12-22 19:03:25', 'modified': '2012-01-09 16:52:34',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@ -21,7 +21,7 @@
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1324295218', '_last_update': '1325570646',
'allow_attach': 0, 'allow_attach': 0,
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard', 'default_print_format': 'Standard',
@ -38,7 +38,7 @@
'show_in_menu': 0, 'show_in_menu': 0,
'subject': 'From %(customer_name)s on %(transaction_date)s worth %(currency)s %(grand_total_export)s | %(per_delivered)s% delivered | %(per_billed)s% billed', 'subject': 'From %(customer_name)s on %(transaction_date)s worth %(currency)s %(grand_total_export)s | %(per_delivered)s% delivered | %(per_billed)s% billed',
'tag_fields': 'delivery_status,billing_status', 'tag_fields': 'delivery_status,billing_status',
'version': 609 'version': 610
}, },
# These values are common for all DocFormat # These values are common for all DocFormat
@ -771,7 +771,7 @@
'oldfieldname': 'net_total', 'oldfieldname': 'net_total',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 0,
'reqd': 0, 'reqd': 0,
'width': '150px' 'width': '150px'
}, },
@ -951,7 +951,7 @@
'oldfieldname': 'grand_total_export', 'oldfieldname': 'grand_total_export',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 0,
'reqd': 0, 'reqd': 0,
'width': '150px' 'width': '150px'
}, },
@ -965,7 +965,7 @@
'oldfieldname': 'rounded_total_export', 'oldfieldname': 'rounded_total_export',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 0,
'width': '150px' 'width': '150px'
}, },

View File

@ -1,7 +1,7 @@
# Please edit this list and import only required elements # Please edit this list and import only required elements
import webnotes import webnotes
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add, make_esc
from webnotes.model import db_exists from webnotes.model import db_exists
from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
from webnotes.model.doclist import getlist, copy_doclist from webnotes.model.doclist import getlist, copy_doclist
@ -88,7 +88,7 @@ class DocType(TransactionBase):
if doc_obj: if doc_obj:
if doc_obj.doc.doctype == 'Receivable Voucher': customer = doc_obj.doc.customer if doc_obj.doc.doctype == 'Receivable Voucher': customer = doc_obj.doc.customer
else: customer = doc_obj.doc.customer_name else: customer = doc_obj.doc.customer_name
add_cond = " and master_name = '"+cstr(customer)+"'" add_cond = " and master_name = '"+make_esc("'")(cstr(customer))+"'"
if based_on == 'Itemwise Discount': if based_on == 'Itemwise Discount':
if doc_obj: if doc_obj:
for t in getlist(doc_obj.doclist, doc_obj.fname): for t in getlist(doc_obj.doclist, doc_obj.fname):

View File

@ -8,6 +8,17 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
}*/ }*/
// For customizing print // For customizing print
cur_frm.pformat.net_total = function(doc) {
return '';
}
cur_frm.pformat.grand_total_export = function(doc) {
return '';
}
cur_frm.pformat.round_total_export = function(doc) {
return '';
}
cur_frm.pformat.other_charges= function(doc){ cur_frm.pformat.other_charges= function(doc){
//function to make row of table //function to make row of table
@ -25,24 +36,43 @@ cur_frm.pformat.other_charges= function(doc){
} }
out =''; out ='';
if (!doc.print_without_amount) { if (!doc.print_without_amount) {
print_hide_dict = {};
for(var i in locals['DocField']) {
var doc_field = locals['DocField'][i];
if(doc_field.fieldname) {
print_hide_dict[doc_field.fieldname] = doc_field.print_hide;
}
}
var cl = getchildren('RV Tax Detail',doc.name,'other_charges'); var cl = getchildren('RV Tax Detail',doc.name,'other_charges');
// outer table // outer table
var out='<div><table class="noborder" style="width:100%"><tr><td style="width: 60%"></td><td>'; var out='<div><table class="noborder" style="width:100%"><tr><td style="width: 60%"></td><td>';
// main table // main table
out +='<table class="noborder" style="width:100%">'+make_row('Net Total',fmt_money(convert_rate(doc.net_total)),1);
out +='<table class="noborder" style="width:100%">';
if(!print_hide_dict['net_total']) {
out +=make_row('Net Total',fmt_money(convert_rate(doc.net_total)),1);
}
// add rows // add rows
if(cl.length){ if(cl.length){
for(var i=0;i<cl.length;i++){ for(var i=0;i<cl.length;i++){
if(fmt_money(convert_rate(cl[i].tax_amount))!=0) if(fmt_money(convert_rate(cl[i].tax_amount))!=0 && !cl[i].included_in_print_rate)
out += make_row(cl[i].description,fmt_money(convert_rate(cl[i].tax_amount)),0); out += make_row(cl[i].description,fmt_money(convert_rate(cl[i].tax_amount)),0);
} }
} }
// grand total // grand total
out +=make_row('Grand Total',fmt_money(doc.grand_total_export),1) +make_row('Rounded Total',fmt_money(doc.rounded_total_export),1) if(!print_hide_dict['grand_total_export']) {
out += make_row('Grand Total',fmt_money(doc.grand_total_export),1);
}
if(!print_hide_dict['rounded_total_export']) {
out += make_row('Rounded Total',fmt_money(doc.rounded_total_export),1);
}
if(doc.in_words_export){ if(doc.in_words_export){
out +='</table></td></tr>'; out +='</table></td></tr>';
out += '<tr><td colspan = "2">'; out += '<tr><td colspan = "2">';

View File

@ -45,6 +45,20 @@ def on_login_post_session(login_manager):
webnotes.session['data']['login_from'] = webnotes.form.getvalue('login_from') webnotes.session['data']['login_from'] = webnotes.form.getvalue('login_from')
webnotes.session_obj.update() webnotes.session_obj.update()
# Clear previous sessions i.e. logout previous log-in attempts
exception_list = ['demo@webnotestech.com', 'Administrator']
if webnotes.session['user'] not in exception_list:
sid_list = webnotes.conn.sql("""
SELECT sid
FROM `tabSessions`
WHERE
user=%s AND
sid!=%s
ORDER BY lastupdate desc""", \
(webnotes.session['user'], webnotes.session['sid']), as_list=1)
for sid in sid_list:
webnotes.conn.sql("DELETE FROM `tabSessions` WHERE sid=%s", sid[0])
update_account_details() update_account_details()
# #
@ -53,7 +67,7 @@ def on_login_post_session(login_manager):
def on_logout(login_manager): def on_logout(login_manager):
if cint(webnotes.conn.get_value('Control Panel', None, 'sync_with_gateway')): if cint(webnotes.conn.get_value('Control Panel', None, 'sync_with_gateway')):
from server_tools.gateway_utils import logout_sso from server_tools.gateway_utils import logout_sso
logout_sso() logout_sso(user=login_manager.user)
# #
# create a profile (if logs in for the first time) # create a profile (if logs in for the first time)

View File

@ -432,15 +432,16 @@ pscript.startup_set_module_order = function() {
pscript.startup_setup_toolbar = function() { pscript.startup_setup_toolbar = function() {
var menu_tab = page_body.wntoolbar.menu_table_right; var menu_tab = page_body.wntoolbar.menu_table_right;
// Profile // help
// --------- // ----
$td(menu_tab,0,0).innerHTML = '<a style="font-weight: bold; color: #FFF" href="javascript:'+"loadpage('profile-settings')"+'">'+user_fullname+'</a>'; $td(menu_tab,0,0).innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://erpnext.blogspot.com/2011/03/erpnext-help.html" target="_blank">Help</a>';
$td(menu_tab,0,1).innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://groups.google.com/group/erpnext-user-forum" target="_blank">Forum</a>';
if(pscript.is_erpnext_saas){ if(pscript.is_erpnext_saas){
// Help // Live Chat Help
// -------------- // --------------
//var help_url = login_file + '#!helpdesk' $td(menu_tab,0,2).innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">Chat</a>';
$td(menu_tab,0,1).innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://groups.google.com/group/erpnext-user-forum" target="_blank">Forum</a>';
// Manage account // Manage account
// -------------- // --------------
@ -449,18 +450,10 @@ pscript.startup_setup_toolbar = function() {
} }
} }
else{ else{
$dh($td(menu_tab,0,1)); $dh($td(menu_tab,0,2));
$dh($td(menu_tab,0,3)); $dh($td(menu_tab,0,3));
} }
// Live Chat Help
// --------------
$td(menu_tab,0,2).innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">Chat</a>';
// help
// ----
var cell = menu_tab.rows[0].insertCell(3);
cell.innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://erpnext.blogspot.com/2011/03/erpnext-help.html" target="_blank">Help</a>';
$y(cell, page_body.wntoolbar.right_table_style); $y(cell, page_body.wntoolbar.right_table_style);
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More