Merge branch 'stable'
This commit is contained in:
commit
65032af912
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
@ -63,7 +63,7 @@ class DocType:
|
||||
return sql("select name from `tabCost Center` where parent_cost_center = %s and docstatus != 2", self.doc.name)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
def validate(self):
|
||||
def validate(self):
|
||||
"""
|
||||
Cost Center name must be unique
|
||||
"""
|
||||
@ -89,9 +89,6 @@ class DocType:
|
||||
def on_update(self):
|
||||
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
|
||||
#-------------------------------------------------------------------------
|
||||
def on_trash(self):
|
||||
|
@ -146,7 +146,6 @@ cur_frm.cscript['Get Items'] = function(doc, dt, dn) {
|
||||
$c_obj(make_doclist(dt,dn),'pull_details','',callback);
|
||||
}
|
||||
|
||||
|
||||
// ========== PV Details Table ============
|
||||
|
||||
// Item Code
|
||||
|
@ -72,7 +72,7 @@ class DocType(TransactionBase):
|
||||
ret['cost_center'] = cost_center and cost_center[0][0] or ''
|
||||
return ret
|
||||
|
||||
|
||||
|
||||
# Get Items based on PO or PR
|
||||
# ----------------------------
|
||||
def pull_details(self):
|
||||
|
@ -5,7 +5,7 @@
|
||||
{
|
||||
'creation': '2010-08-08 17:09:18',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-12-22 19:04:07',
|
||||
'modified': '2012-01-09 16:52:22',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
# 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',
|
||||
'colour': 'White:FFF',
|
||||
'default_print_format': 'Standard',
|
||||
@ -34,7 +34,7 @@
|
||||
'server_code_error': ' ',
|
||||
'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',
|
||||
'version': 392
|
||||
'version': 394
|
||||
},
|
||||
|
||||
# These values are common for all DocFormat
|
||||
@ -653,7 +653,7 @@
|
||||
'oldfieldname': 'net_total',
|
||||
'oldfieldtype': 'Currency',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1,
|
||||
'print_hide': 0,
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
@ -1218,7 +1218,7 @@
|
||||
'oldfieldname': 'grand_total_export',
|
||||
'oldfieldtype': 'Currency',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1,
|
||||
'print_hide': 0,
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
@ -1231,7 +1231,7 @@
|
||||
'oldfieldname': 'rounded_total_export',
|
||||
'oldfieldtype': 'Currency',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1
|
||||
'print_hide': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
|
@ -5,8 +5,8 @@
|
||||
{
|
||||
'creation': '2010-08-08 17:09:20',
|
||||
'docstatus': 0,
|
||||
'modified': '2010-09-20 14:06:57',
|
||||
'modified_by': 'nabin@webnotestech.com',
|
||||
'modified': '2011-12-28 17:33:30',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
{
|
||||
'autoname': 'INVTD.######',
|
||||
'colour': 'White:FFF',
|
||||
'default_print_format': 'Standard',
|
||||
'doctype': 'DocType',
|
||||
'hide_heading': 1,
|
||||
'istable': 1,
|
||||
@ -22,7 +23,7 @@
|
||||
'section_style': 'Tray',
|
||||
'server_code_error': ' ',
|
||||
'show_in_menu': 0,
|
||||
'version': 15
|
||||
'version': 18
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
@ -45,7 +46,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'charge_type',
|
||||
'fieldtype': 'Select',
|
||||
'idx': 1,
|
||||
'label': 'Type',
|
||||
'oldfieldname': 'charge_type',
|
||||
'oldfieldtype': 'Select',
|
||||
@ -60,7 +60,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'account_head',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 2,
|
||||
'label': 'Account Head',
|
||||
'oldfieldname': 'account_head',
|
||||
'oldfieldtype': 'Link',
|
||||
@ -75,13 +74,11 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'cost_center_other_charges',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 3,
|
||||
'label': 'Cost Center',
|
||||
'oldfieldname': 'cost_center_other_charges',
|
||||
'oldfieldtype': 'Link',
|
||||
'options': 'Cost Center',
|
||||
'permlevel': 0,
|
||||
'search_index': 0
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
@ -89,7 +86,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'description',
|
||||
'fieldtype': 'Small Text',
|
||||
'idx': 4,
|
||||
'label': 'Description',
|
||||
'oldfieldname': 'description',
|
||||
'oldfieldtype': 'Small Text',
|
||||
@ -103,7 +99,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'rate',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 5,
|
||||
'label': 'Rate',
|
||||
'oldfieldname': 'rate',
|
||||
'oldfieldtype': 'Currency',
|
||||
@ -117,7 +112,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'tax_amount',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 6,
|
||||
'label': 'Amount*',
|
||||
'oldfieldname': 'tax_amount',
|
||||
'oldfieldtype': 'Currency',
|
||||
@ -131,7 +125,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'total',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 7,
|
||||
'label': 'Total*',
|
||||
'oldfieldname': 'total',
|
||||
'oldfieldtype': 'Currency',
|
||||
@ -144,7 +137,6 @@
|
||||
'fieldname': 'row_id',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': 0,
|
||||
'idx': 8,
|
||||
'label': 'Enter Row',
|
||||
'oldfieldname': 'row_id',
|
||||
'oldfieldtype': 'Data',
|
||||
@ -157,7 +149,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'item_wise_tax_detail',
|
||||
'fieldtype': 'Small Text',
|
||||
'idx': 9,
|
||||
'label': 'Item Wise Tax Detail ',
|
||||
'oldfieldname': 'item_wise_tax_detail',
|
||||
'oldfieldtype': 'Small Text',
|
||||
@ -170,7 +161,6 @@
|
||||
'fieldname': 'parenttype',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': 1,
|
||||
'idx': 10,
|
||||
'in_filter': 1,
|
||||
'label': 'Parenttype',
|
||||
'oldfieldname': 'parenttype',
|
||||
@ -188,7 +178,6 @@
|
||||
'fieldname': 'total_tax_amount',
|
||||
'fieldtype': 'Currency',
|
||||
'hidden': 1,
|
||||
'idx': 11,
|
||||
'label': 'Total Tax Amount',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'total_tax_amount',
|
||||
@ -205,7 +194,6 @@
|
||||
'fieldname': 'total_amount',
|
||||
'fieldtype': 'Currency',
|
||||
'hidden': 1,
|
||||
'idx': 12,
|
||||
'label': 'Total Amount',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'total_amount',
|
||||
@ -213,5 +201,20 @@
|
||||
'permlevel': 0,
|
||||
'print_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
|
||||
}
|
||||
]
|
@ -1,274 +1,155 @@
|
||||
# Module Def, Buying
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'_last_update': None,
|
||||
'creation': '2011-06-30 15:47:45',
|
||||
'disabled': 'No',
|
||||
'creation': '2011-07-01 17:40:38',
|
||||
'docstatus': 0,
|
||||
'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',
|
||||
'file_list': 'scm.gif,FileData/00209',
|
||||
'idx': None,
|
||||
'is_hidden': 'No',
|
||||
'last_updated_date': None,
|
||||
'modified': '2011-06-30 15:47:45',
|
||||
'modified': '2012-01-10 17:52:19',
|
||||
'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_icon': 'Buying.gif',
|
||||
'module_label': 'Buying',
|
||||
'module_name': 'Buying',
|
||||
'module_page': None,
|
||||
'module_seq': 4,
|
||||
'name': 'Buying',
|
||||
'owner': 'Administrator',
|
||||
'parent': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'trash_reason': None,
|
||||
'widget_code': None
|
||||
'name': '__common__'
|
||||
},
|
||||
|
||||
# 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',
|
||||
'display_name': 'Supplier',
|
||||
'doc_name': 'Supplier',
|
||||
'doc_type': 'Forms',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Item',
|
||||
'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'
|
||||
'fields': 'id\nsupplier_type\nsupplier_status\ncompany'
|
||||
},
|
||||
|
||||
# Module Def Item
|
||||
{
|
||||
'click_function': None,
|
||||
'creation': '2011-06-30 15:47:45',
|
||||
'description': 'Buy requests from various people in your company',
|
||||
'display_name': 'Indent',
|
||||
'doc_name': 'Indent',
|
||||
'doc_type': 'Forms',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Item',
|
||||
'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'
|
||||
'fields': 'status\ntransaction_date\nsales_order_no\nremark'
|
||||
},
|
||||
|
||||
# Module Def Item
|
||||
{
|
||||
'click_function': None,
|
||||
'creation': '2011-06-30 15:47:45',
|
||||
'description': 'Orders you have placed to your suppliers',
|
||||
'display_name': 'Purchase Order',
|
||||
'doc_name': 'Purchase Order',
|
||||
'doc_type': 'Forms',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Item',
|
||||
'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'
|
||||
'fields': 'status\nsupplier\ntransaction_date\ngrand_total'
|
||||
},
|
||||
|
||||
# Module Def Item
|
||||
{
|
||||
'click_function': None,
|
||||
'creation': '2011-06-30 15:47:45',
|
||||
'description': None,
|
||||
'display_name': 'Itemwise Receipt Details',
|
||||
'doc_name': 'Purchase Receipt Detail',
|
||||
'doc_type': 'Reports',
|
||||
'docstatus': 0,
|
||||
'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'
|
||||
'doctype': 'Module Def Item'
|
||||
},
|
||||
|
||||
# Module Def Item
|
||||
{
|
||||
'click_function': None,
|
||||
'creation': '2011-06-30 15:47:45',
|
||||
'description': None,
|
||||
'display_name': 'Purchase in Transit',
|
||||
'doc_name': 'PV Detail',
|
||||
'doc_type': 'Reports',
|
||||
'docstatus': 0,
|
||||
'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'
|
||||
'doctype': 'Module Def Item'
|
||||
},
|
||||
|
||||
# Module Def Item
|
||||
{
|
||||
'click_function': None,
|
||||
'creation': '2011-06-30 15:47:45',
|
||||
'description': None,
|
||||
'display_name': 'Pending PO Items To Receive',
|
||||
'doc_name': 'PO Detail',
|
||||
'doc_type': 'Reports',
|
||||
'docstatus': 0,
|
||||
'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'
|
||||
'doctype': 'Module Def Item'
|
||||
},
|
||||
|
||||
# Module Def Item
|
||||
{
|
||||
'click_function': None,
|
||||
'creation': '2011-06-30 15:47:45',
|
||||
'description': None,
|
||||
'display_name': 'Pending PO Items To Bill',
|
||||
'doc_name': 'PO Detail',
|
||||
'doc_type': 'Reports',
|
||||
'docstatus': 0,
|
||||
'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'
|
||||
'doctype': 'Module Def Item'
|
||||
},
|
||||
|
||||
# Module Def Item
|
||||
{
|
||||
'click_function': None,
|
||||
'creation': '2011-06-30 15:47:45',
|
||||
'description': None,
|
||||
'display_name': 'Itemwise Purchase Details',
|
||||
'doc_name': 'PO Detail',
|
||||
'doc_type': 'Reports',
|
||||
'docstatus': 0,
|
||||
'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'
|
||||
'doctype': 'Module Def Item'
|
||||
},
|
||||
|
||||
# Module Def Item
|
||||
{
|
||||
'click_function': None,
|
||||
'creation': '2011-06-30 15:47:45',
|
||||
'description': 'Ledger details of your creditors',
|
||||
'display_name': "Creditor's Ledger",
|
||||
'doc_name': 'GL Entry',
|
||||
'doc_type': 'Reports',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Module Def Item',
|
||||
'fields': None,
|
||||
'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'
|
||||
'icon': 'accept.gif'
|
||||
},
|
||||
|
||||
# Module Def Role
|
||||
{
|
||||
'creation': '2011-06-30 15:47:45',
|
||||
'docstatus': 0,
|
||||
'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'
|
||||
},
|
||||
|
||||
# Module Def Role
|
||||
{
|
||||
'creation': '2011-06-30 15:47:45',
|
||||
'docstatus': 0,
|
||||
'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'
|
||||
},
|
||||
|
||||
# Module Def Role
|
||||
{
|
||||
'creation': '2011-06-30 15:47:45',
|
||||
'docstatus': 0,
|
||||
'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'
|
||||
},
|
||||
|
||||
# Module Def Role
|
||||
{
|
||||
'creation': '2011-06-30 15:47:45',
|
||||
'docstatus': 0,
|
||||
'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'
|
||||
}
|
||||
]
|
@ -3,9 +3,10 @@ cur_frm.cscript.fname = "indent_details";
|
||||
|
||||
$import(Purchase Common)
|
||||
$import(SMS Control)
|
||||
cur_frm.cscript.indent_doctype_label = get_doctype_label('Indent');
|
||||
|
||||
//========================== On Load =================================================
|
||||
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
|
||||
if (!doc.transaction_date) doc.transaction_date = dateutil.obj_to_str(new Date())
|
||||
if (!doc.status) doc.status = 'Draft';
|
||||
|
||||
@ -42,18 +43,18 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
}
|
||||
if(!is_closed) {
|
||||
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']);
|
||||
}
|
||||
|
||||
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)
|
||||
unhide_field(['Repair Indent']);
|
||||
unhide_field(['Repair Purchase Requisition']);
|
||||
else
|
||||
hide_field(['Repair Indent']);
|
||||
hide_field(['Repair Purchase Requisition']);
|
||||
}
|
||||
|
||||
//======================= validation ===================================
|
||||
@ -71,7 +72,7 @@ cur_frm.cscript.transaction_date = function(doc,cdt,cdn){
|
||||
cur_frm.cscript.qty = function(doc, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
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
|
||||
@ -95,9 +96,9 @@ cur_frm.cscript['Make Purchase Order'] = function() {
|
||||
|
||||
// Stop INDENT
|
||||
// ==================================================================================================
|
||||
cur_frm.cscript['Stop Indent'] = function() {
|
||||
cur_frm.cscript['Stop Purchase Requisition'] = function() {
|
||||
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) {
|
||||
$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
|
||||
//====================================================================================================
|
||||
cur_frm.cscript['Unstop Indent'] = function(){
|
||||
cur_frm.cscript['Unstop Purchase Requisition'] = function(){
|
||||
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) {
|
||||
$c('runserverobj', args={'method':'update_status', 'arg': 'Submitted','docs': compress_doclist(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
|
||||
|
@ -5,14 +5,14 @@
|
||||
{
|
||||
'creation': '2010-08-08 17:09:04',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-10-12 13:09:38',
|
||||
'modified': '2012-01-10 15:39:17',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all DocType
|
||||
{
|
||||
'_last_update': '1318404775',
|
||||
'_last_update': '1326190064',
|
||||
'allow_print': 0,
|
||||
'colour': 'White:FFF',
|
||||
'default_print_format': 'Standard',
|
||||
@ -25,7 +25,7 @@
|
||||
'server_code_error': ' ',
|
||||
'show_in_menu': 0,
|
||||
'subject': '%(per_ordered)s% ordered',
|
||||
'version': 188
|
||||
'version': 197
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
@ -235,7 +235,7 @@
|
||||
'fieldname': 'transaction_date',
|
||||
'fieldtype': 'Date',
|
||||
'in_filter': 1,
|
||||
'label': 'Indent Date',
|
||||
'label': 'Transaction Date',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'transaction_date',
|
||||
'oldfieldtype': 'Date',
|
||||
@ -249,7 +249,7 @@
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'description': '% of materials ordered against this Indent',
|
||||
'description': '% of materials ordered against this Purchase Requisition',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'per_ordered',
|
||||
'fieldtype': 'Currency',
|
||||
@ -273,7 +273,7 @@
|
||||
# DocField
|
||||
{
|
||||
'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',
|
||||
'fieldname': 'sales_order_no',
|
||||
'fieldtype': 'Link',
|
||||
@ -302,7 +302,7 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'indent_details',
|
||||
'fieldtype': 'Table',
|
||||
'label': 'Indent Details',
|
||||
'label': 'Purchase Requisition Details',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': 'indent_details',
|
||||
'oldfieldtype': 'Table',
|
||||
@ -314,7 +314,7 @@
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'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',
|
||||
'fieldtype': 'Section Break',
|
||||
'label': 'More Info',
|
||||
@ -362,7 +362,7 @@
|
||||
# DocField
|
||||
{
|
||||
'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',
|
||||
'fieldname': 'requested_by',
|
||||
'fieldtype': 'Data',
|
||||
@ -400,7 +400,7 @@
|
||||
# DocField
|
||||
{
|
||||
'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',
|
||||
'fieldname': 'cancel_reason',
|
||||
'fieldtype': 'Data',
|
||||
@ -443,7 +443,7 @@
|
||||
|
||||
# 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',
|
||||
'fieldtype': 'Section Break',
|
||||
'label': 'Terms',
|
||||
@ -505,7 +505,7 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'terms',
|
||||
'fieldtype': 'Text Editor',
|
||||
'label': 'Terms1',
|
||||
'label': 'Terms Content',
|
||||
'oldfieldname': 'terms',
|
||||
'oldfieldtype': 'Text Editor',
|
||||
'permlevel': 0
|
||||
@ -526,7 +526,7 @@
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Button',
|
||||
'label': 'Repair Indent',
|
||||
'label': 'Repair Purchase Requisition',
|
||||
'oldfieldtype': 'Button',
|
||||
'options': 'repair_indent',
|
||||
'permlevel': 0,
|
||||
|
@ -5,7 +5,7 @@
|
||||
{
|
||||
'creation': '2010-08-08 17:09:12',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-12-14 10:49:46',
|
||||
'modified': '2012-01-10 16:38:21',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
@ -22,7 +22,7 @@
|
||||
'section_style': 'Tray',
|
||||
'server_code_error': ' ',
|
||||
'show_in_menu': 0,
|
||||
'version': 60
|
||||
'version': 61
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
@ -301,7 +301,7 @@
|
||||
'fieldtype': 'Link',
|
||||
'hidden': 0,
|
||||
'in_filter': 1,
|
||||
'label': 'Indent No',
|
||||
'label': 'Purchase Requisition No',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': 'prevdoc_docname',
|
||||
'oldfieldtype': 'Link',
|
||||
@ -319,7 +319,7 @@
|
||||
'fieldtype': 'Date',
|
||||
'hidden': 0,
|
||||
'in_filter': 1,
|
||||
'label': 'Indent Date',
|
||||
'label': 'Purchase Requisition Date',
|
||||
'oldfieldname': 'prevdoc_date',
|
||||
'oldfieldtype': 'Date',
|
||||
'permlevel': 1,
|
||||
@ -335,7 +335,7 @@
|
||||
'fieldtype': 'Data',
|
||||
'hidden': 1,
|
||||
'in_filter': 1,
|
||||
'label': 'Indent Detail No',
|
||||
'label': 'Purchase Requisition Detail No',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': 'prevdoc_detail_docname',
|
||||
'oldfieldtype': 'Data',
|
||||
|
@ -5,15 +5,25 @@
|
||||
{
|
||||
'creation': '2010-08-08 17:09:15',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-05-17 16:29:14',
|
||||
'modified': '2012-01-10 16:19:19',
|
||||
'modified_by': '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
|
||||
{
|
||||
'_last_update': '1306471022',
|
||||
'colour': 'White:FFF',
|
||||
'default_print_format': 'Standard',
|
||||
'doctype': 'DocType',
|
||||
'document_type': 'Transaction',
|
||||
'is_transaction_doc': 1,
|
||||
@ -25,15 +35,15 @@
|
||||
'server_code_error': ' ',
|
||||
'show_in_menu': 0,
|
||||
'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__',
|
||||
'parent': 'Purchase Order',
|
||||
'parentfield': 'fields',
|
||||
'parentfield': 'formats',
|
||||
'parenttype': 'DocType'
|
||||
},
|
||||
|
||||
@ -53,13 +63,24 @@
|
||||
'name': 'Purchase Order'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 1,
|
||||
'cancel': 1,
|
||||
'create': 1,
|
||||
'doctype': 'DocPerm',
|
||||
'permlevel': 0,
|
||||
'role': 'Production Manager',
|
||||
'submit': 0,
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 1,
|
||||
'permlevel': 1,
|
||||
'role': 'Material User',
|
||||
'submit': 0,
|
||||
@ -72,7 +93,6 @@
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 2,
|
||||
'permlevel': 0,
|
||||
'role': 'Material User',
|
||||
'submit': 0,
|
||||
@ -85,7 +105,6 @@
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 3,
|
||||
'permlevel': 1,
|
||||
'role': 'Purchase Manager',
|
||||
'submit': 0,
|
||||
@ -98,7 +117,6 @@
|
||||
'cancel': 1,
|
||||
'create': 1,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 4,
|
||||
'permlevel': 0,
|
||||
'role': 'Purchase Manager',
|
||||
'submit': 1,
|
||||
@ -111,7 +129,6 @@
|
||||
'cancel': 0,
|
||||
'create': 1,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 5,
|
||||
'permlevel': 0,
|
||||
'role': 'Purchase User',
|
||||
'submit': 0,
|
||||
@ -120,37 +137,64 @@
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 6,
|
||||
'permlevel': 1,
|
||||
'role': 'All'
|
||||
'role': 'All',
|
||||
'submit': 0,
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 7,
|
||||
'match': 'supplier',
|
||||
'permlevel': 0,
|
||||
'role': 'Supplier'
|
||||
'role': 'Supplier',
|
||||
'submit': 0,
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 8,
|
||||
'permlevel': 2,
|
||||
'role': 'All',
|
||||
'submit': 0,
|
||||
'write': 1
|
||||
},
|
||||
|
||||
# DocFormat
|
||||
{
|
||||
'doctype': 'DocFormat',
|
||||
'format': 'Purchase Order Classic'
|
||||
},
|
||||
|
||||
# DocFormat
|
||||
{
|
||||
'doctype': 'DocFormat',
|
||||
'format': 'Purchase Order Modern'
|
||||
},
|
||||
|
||||
# DocFormat
|
||||
{
|
||||
'doctype': 'DocFormat',
|
||||
'format': 'Purchase Order Spartan'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': 'White:FFF',
|
||||
'description': 'Enter rates and quantity of items you want to purchase and send the purchase order to your supplier.',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 1,
|
||||
'label': 'Basic Info',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 0,
|
||||
@ -161,7 +205,6 @@
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Column Break',
|
||||
'idx': 2,
|
||||
'oldfieldtype': 'Column Break',
|
||||
'permlevel': 0,
|
||||
'width': '50%'
|
||||
@ -174,7 +217,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'naming_series',
|
||||
'fieldtype': 'Select',
|
||||
'idx': 3,
|
||||
'label': 'Series',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'naming_series',
|
||||
@ -192,7 +234,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'supplier',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 4,
|
||||
'in_filter': 1,
|
||||
'label': 'Supplier',
|
||||
'oldfieldname': 'supplier',
|
||||
@ -210,7 +251,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'supplier_address',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 5,
|
||||
'in_filter': 1,
|
||||
'label': 'Supplier Address',
|
||||
'options': 'Address',
|
||||
@ -223,7 +263,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'contact_person',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 6,
|
||||
'in_filter': 1,
|
||||
'label': 'Contact Person',
|
||||
'options': 'Contact',
|
||||
@ -236,7 +275,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'supplier_name',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 7,
|
||||
'label': 'Name',
|
||||
'permlevel': 1
|
||||
},
|
||||
@ -246,7 +284,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'address_display',
|
||||
'fieldtype': 'Small Text',
|
||||
'idx': 8,
|
||||
'label': 'Address',
|
||||
'permlevel': 1
|
||||
},
|
||||
@ -256,7 +293,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'contact_display',
|
||||
'fieldtype': 'Small Text',
|
||||
'idx': 9,
|
||||
'label': 'Contact',
|
||||
'permlevel': 1
|
||||
},
|
||||
@ -266,7 +302,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'contact_mobile',
|
||||
'fieldtype': 'Text',
|
||||
'idx': 10,
|
||||
'label': 'Mobile No',
|
||||
'permlevel': 1
|
||||
},
|
||||
@ -276,7 +311,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'contact_email',
|
||||
'fieldtype': 'Text',
|
||||
'idx': 11,
|
||||
'label': 'Contact Email',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1
|
||||
@ -286,7 +320,6 @@
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Column Break',
|
||||
'idx': 12,
|
||||
'oldfieldtype': 'Column Break',
|
||||
'permlevel': 0,
|
||||
'print_hide': 0,
|
||||
@ -300,7 +333,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'transaction_date',
|
||||
'fieldtype': 'Date',
|
||||
'idx': 13,
|
||||
'in_filter': 1,
|
||||
'label': 'Purchase Order Date',
|
||||
'oldfieldname': 'transaction_date',
|
||||
@ -317,7 +349,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'status',
|
||||
'fieldtype': 'Select',
|
||||
'idx': 14,
|
||||
'in_filter': 1,
|
||||
'label': 'Status',
|
||||
'no_copy': 1,
|
||||
@ -337,7 +368,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'project_name',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 15,
|
||||
'in_filter': 1,
|
||||
'label': 'Project Name',
|
||||
'oldfieldname': 'project_name',
|
||||
@ -356,7 +386,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'per_received',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 16,
|
||||
'label': '% Received',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'per_received',
|
||||
@ -373,7 +402,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'per_billed',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 17,
|
||||
'label': '% Billed',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'per_billed',
|
||||
@ -387,7 +415,6 @@
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 18,
|
||||
'label': 'Items',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 0
|
||||
@ -396,13 +423,12 @@
|
||||
# DocField
|
||||
{
|
||||
'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',
|
||||
'fieldname': 'indent_no',
|
||||
'fieldtype': 'Link',
|
||||
'hidden': 0,
|
||||
'idx': 19,
|
||||
'label': 'Select Indent',
|
||||
'label': 'Select Purchase Requisition',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'indent_no',
|
||||
'oldfieldtype': 'Link',
|
||||
@ -416,7 +442,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Button',
|
||||
'hidden': 0,
|
||||
'idx': 20,
|
||||
'label': 'Get Items',
|
||||
'oldfieldtype': 'Button',
|
||||
'options': 'get_indent_details',
|
||||
@ -428,7 +453,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'is_subcontracted',
|
||||
'fieldtype': 'Select',
|
||||
'idx': 21,
|
||||
'label': 'Is Subcontracted',
|
||||
'options': '\nYes\nNo',
|
||||
'permlevel': 0,
|
||||
@ -439,7 +463,6 @@
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Column Break',
|
||||
'idx': 22,
|
||||
'permlevel': 0,
|
||||
'width': '50%'
|
||||
},
|
||||
@ -451,7 +474,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'currency',
|
||||
'fieldtype': 'Select',
|
||||
'idx': 23,
|
||||
'label': 'Currency',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': 'currency',
|
||||
@ -471,7 +493,6 @@
|
||||
'fieldname': 'conversion_rate',
|
||||
'fieldtype': 'Currency',
|
||||
'hidden': 0,
|
||||
'idx': 24,
|
||||
'label': 'Conversion Rate',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'conversion_rate',
|
||||
@ -486,7 +507,6 @@
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 25,
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
@ -496,7 +516,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'po_details',
|
||||
'fieldtype': 'Table',
|
||||
'idx': 26,
|
||||
'label': 'PO Details',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': 'po_details',
|
||||
@ -510,7 +529,6 @@
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Button',
|
||||
'idx': 27,
|
||||
'label': 'Get Last Purchase Rate',
|
||||
'oldfieldtype': 'Button',
|
||||
'permlevel': 0,
|
||||
@ -523,7 +541,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'net_total',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 28,
|
||||
'label': 'Net Total*',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'net_total',
|
||||
@ -537,7 +554,6 @@
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Button',
|
||||
'idx': 29,
|
||||
'label': 'Re-Calculate Values',
|
||||
'oldfieldtype': 'Button',
|
||||
'permlevel': 0,
|
||||
@ -549,7 +565,6 @@
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'HTML',
|
||||
'idx': 30,
|
||||
'label': 'Note HTML',
|
||||
'options': '<div style="margin-top:16px"><b>Note :</b> * In Base Currency\n</div>',
|
||||
'permlevel': 1,
|
||||
@ -561,7 +576,6 @@
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 31,
|
||||
'label': 'Taxes',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 0
|
||||
@ -574,7 +588,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'purchase_other_charges',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 32,
|
||||
'label': 'Purchase Other Charges',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'purchase_other_charges',
|
||||
@ -588,7 +601,6 @@
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Button',
|
||||
'idx': 33,
|
||||
'label': 'Get Tax Detail',
|
||||
'oldfieldtype': 'Button',
|
||||
'options': 'get_purchase_tax_details',
|
||||
@ -601,7 +613,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'purchase_tax_details',
|
||||
'fieldtype': 'Table',
|
||||
'idx': 34,
|
||||
'label': 'Purchase Tax Details',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': 'purchase_tax_details',
|
||||
@ -614,7 +625,6 @@
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Button',
|
||||
'idx': 35,
|
||||
'label': 'Calculate Tax',
|
||||
'oldfieldtype': 'Button',
|
||||
'permlevel': 0,
|
||||
@ -626,7 +636,6 @@
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'HTML',
|
||||
'idx': 36,
|
||||
'label': 'Tax Calculation',
|
||||
'no_copy': 1,
|
||||
'oldfieldtype': 'HTML',
|
||||
@ -639,7 +648,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'total_tax',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 37,
|
||||
'label': 'Total Tax*',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'total_tax',
|
||||
@ -653,7 +661,6 @@
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'HTML',
|
||||
'idx': 38,
|
||||
'label': 'Note HTML',
|
||||
'options': '<div style="margin-top:16px"><b>Note :</b> * In Base Currency\n</div>',
|
||||
'permlevel': 1,
|
||||
@ -665,7 +672,6 @@
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 39,
|
||||
'label': 'Totals',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 0
|
||||
@ -676,7 +682,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'grand_total',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 40,
|
||||
'label': 'Grand Total',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'grand_total',
|
||||
@ -690,7 +695,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'rounded_total',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 41,
|
||||
'label': 'Rounded Total',
|
||||
'oldfieldname': 'rounded_total',
|
||||
'oldfieldtype': 'Currency',
|
||||
@ -705,7 +709,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'in_words',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 42,
|
||||
'label': 'In Words',
|
||||
'oldfieldname': 'in_words',
|
||||
'oldfieldtype': 'Data',
|
||||
@ -718,7 +721,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'other_charges_added',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 43,
|
||||
'label': 'Other Charges Added',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': 'other_charges_added',
|
||||
@ -732,7 +734,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'other_charges_deducted',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 44,
|
||||
'label': 'Other Charges Deducted',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': 'other_charges_deducted',
|
||||
@ -745,7 +746,6 @@
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Column Break',
|
||||
'idx': 45,
|
||||
'oldfieldtype': 'Column Break',
|
||||
'permlevel': 0,
|
||||
'print_hide': 0
|
||||
@ -756,7 +756,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'net_total_import',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 46,
|
||||
'label': 'Net Total (Import)',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': 'net_total_import',
|
||||
@ -770,7 +769,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'grand_total_import',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 47,
|
||||
'label': 'Grand Total (Import)',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': 'grand_total_import',
|
||||
@ -787,7 +785,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'in_words_import',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 48,
|
||||
'label': 'In Words(Import)',
|
||||
'oldfieldname': 'in_words_import',
|
||||
'oldfieldtype': 'Data',
|
||||
@ -800,7 +797,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'other_charges_added_import',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 49,
|
||||
'label': 'Other Charges Added (Import)',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': 'other_charges_added_import',
|
||||
@ -815,7 +811,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'other_charges_deducted_import',
|
||||
'fieldtype': 'Currency',
|
||||
'idx': 50,
|
||||
'label': 'Other Charges Deducted (Import)',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': 'other_charges_deducted_import',
|
||||
@ -829,7 +824,6 @@
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 51,
|
||||
'label': 'Terms',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 0
|
||||
@ -841,7 +835,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'letter_head',
|
||||
'fieldtype': 'Select',
|
||||
'idx': 52,
|
||||
'label': 'Letter Head',
|
||||
'oldfieldname': 'letter_head',
|
||||
'oldfieldtype': 'Select',
|
||||
@ -855,7 +848,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'tc_name',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 53,
|
||||
'label': 'Select Terms',
|
||||
'oldfieldname': 'tc_name',
|
||||
'oldfieldtype': 'Link',
|
||||
@ -868,7 +860,6 @@
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Button',
|
||||
'idx': 54,
|
||||
'label': 'Get Terms',
|
||||
'oldfieldtype': 'Button',
|
||||
'options': 'get_tc_details',
|
||||
@ -879,7 +870,6 @@
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'HTML',
|
||||
'idx': 55,
|
||||
'label': 'Terms HTML',
|
||||
'oldfieldtype': 'HTML',
|
||||
'options': 'You can add Terms and Notes that will be printed in the Transaction',
|
||||
@ -892,7 +882,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'terms',
|
||||
'fieldtype': 'Text Editor',
|
||||
'idx': 56,
|
||||
'label': 'Terms1',
|
||||
'oldfieldname': 'terms',
|
||||
'oldfieldtype': 'Text Editor',
|
||||
@ -903,7 +892,6 @@
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 57,
|
||||
'label': 'More Info',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 0
|
||||
@ -915,7 +903,6 @@
|
||||
'fieldname': 'ref_sq',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': 1,
|
||||
'idx': 58,
|
||||
'label': 'Ref SQ',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'ref_sq',
|
||||
@ -930,7 +917,6 @@
|
||||
'fieldname': 'amended_from',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': 0,
|
||||
'idx': 59,
|
||||
'label': 'Amended From',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'amended_from',
|
||||
@ -947,7 +933,6 @@
|
||||
'fieldname': 'amendment_date',
|
||||
'fieldtype': 'Date',
|
||||
'hidden': 0,
|
||||
'idx': 60,
|
||||
'label': 'Amendment Date',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'amendment_date',
|
||||
@ -963,7 +948,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'company',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 61,
|
||||
'in_filter': 1,
|
||||
'label': 'Company',
|
||||
'no_copy': 0,
|
||||
@ -981,7 +965,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'fiscal_year',
|
||||
'fieldtype': 'Select',
|
||||
'idx': 62,
|
||||
'in_filter': 1,
|
||||
'label': 'Fiscal Year',
|
||||
'no_copy': 0,
|
||||
@ -1001,7 +984,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'select_print_heading',
|
||||
'fieldtype': 'Link',
|
||||
'idx': 63,
|
||||
'label': 'Select Print Heading',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'select_print_heading',
|
||||
@ -1017,7 +999,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'instructions',
|
||||
'fieldtype': 'Text',
|
||||
'idx': 64,
|
||||
'label': 'Instructions',
|
||||
'oldfieldname': 'instructions',
|
||||
'oldfieldtype': 'Text',
|
||||
@ -1028,7 +1009,6 @@
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Column Break',
|
||||
'idx': 65,
|
||||
'oldfieldtype': 'Column Break',
|
||||
'permlevel': 0,
|
||||
'width': '50%'
|
||||
@ -1040,7 +1020,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'payment_terms',
|
||||
'fieldtype': 'Text',
|
||||
'idx': 66,
|
||||
'label': 'Payment Terms',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'payment_terms',
|
||||
@ -1054,7 +1033,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'remarks',
|
||||
'fieldtype': 'Text',
|
||||
'idx': 67,
|
||||
'label': 'Remarks',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'remarks',
|
||||
@ -1071,7 +1049,6 @@
|
||||
'fieldname': 'cancel_reason',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': 0,
|
||||
'idx': 68,
|
||||
'label': 'Cancel Reason',
|
||||
'no_copy': 1,
|
||||
'oldfieldname': 'cancel_reason',
|
||||
@ -1086,7 +1063,6 @@
|
||||
'description': 'Required raw materials issued to the supplier for producing a sub - contracted item.',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 69,
|
||||
'label': 'Raw Material Details',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'permlevel': 0
|
||||
@ -1098,7 +1074,6 @@
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'po_raw_material_details',
|
||||
'fieldtype': 'Table',
|
||||
'idx': 70,
|
||||
'label': 'PO Raw Material Details',
|
||||
'no_copy': 0,
|
||||
'oldfieldname': 'po_raw_material_details',
|
||||
@ -1113,7 +1088,6 @@
|
||||
'allow_on_submit': 1,
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Button',
|
||||
'idx': 71,
|
||||
'label': 'Repair Purchase Order',
|
||||
'oldfieldtype': 'Button',
|
||||
'options': 'repair_purchase_order',
|
||||
|
@ -583,7 +583,11 @@ HomeStatusBar = function() {
|
||||
|
||||
this.render = function(r) {
|
||||
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') }
|
||||
|
||||
if(r.unread_messages) {
|
||||
|
@ -48,9 +48,8 @@ pscript.myc_add_user = function() {
|
||||
reqd: 1,
|
||||
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([
|
||||
{
|
||||
fieldtype: 'Data',
|
||||
@ -61,7 +60,6 @@ pscript.myc_add_user = function() {
|
||||
{
|
||||
fieldtype: 'Data',
|
||||
fieldname: 'last_name',
|
||||
reqd: 1,
|
||||
label: 'Last Name'
|
||||
},
|
||||
{
|
||||
@ -78,8 +76,6 @@ pscript.myc_add_user = function() {
|
||||
fieldname: 'add'
|
||||
});
|
||||
|
||||
console.log(fields);
|
||||
|
||||
var d = new wn.widgets.Dialog({
|
||||
title: 'Add User',
|
||||
width: 400,
|
||||
|
@ -34,6 +34,8 @@ def disable_profile(arg=''):
|
||||
return 'Cannot disable Administrator'
|
||||
|
||||
webnotes.conn.sql("update tabProfile set enabled=0 where name=%s", arg)
|
||||
login_manager = LoginManager()
|
||||
login_manager.logout(user=arg)
|
||||
return 0
|
||||
|
||||
#
|
||||
|
@ -36,7 +36,7 @@ MyProfile = function(wrapper) {
|
||||
this.form = new wn.widgets.FieldGroup()
|
||||
this.form.make_fields(div, [
|
||||
{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:'update', fieldtype:'Button',label:'Update'}
|
||||
]);
|
||||
|
@ -386,4 +386,4 @@
|
||||
'oldfieldtype': 'Currency',
|
||||
'permlevel': 1
|
||||
}
|
||||
]
|
||||
]
|
||||
|
@ -106,4 +106,4 @@
|
||||
'oldfieldtype': 'Currency',
|
||||
'permlevel': 1
|
||||
}
|
||||
]
|
||||
]
|
||||
|
0
erpnext/patches/Discount_purchase_cycle.py → erpnext/patches/before_jan_2012/Discount_purchase_cycle.py
Executable file → Normal file
0
erpnext/patches/Discount_purchase_cycle.py → erpnext/patches/before_jan_2012/Discount_purchase_cycle.py
Executable file → Normal file
0
erpnext/patches/before_jan_2012/__init__.py
Normal file
0
erpnext/patches/before_jan_2012/__init__.py
Normal file
0
erpnext/patches/jan_mar_2012/__init__.py
Normal file
0
erpnext/patches/jan_mar_2012/__init__.py
Normal file
20
erpnext/patches/jan_mar_2012/print_hide_totals.py
Normal file
20
erpnext/patches/jan_mar_2012/print_hide_totals.py
Normal 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')
|
||||
""")
|
37
erpnext/patches/jan_mar_2012/rename_doctype_indent.py
Normal file
37
erpnext/patches/jan_mar_2012/rename_doctype_indent.py
Normal 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')
|
38
erpnext/patches/jan_mar_2012/stable_branch_shift_09_01_12.py
Normal file
38
erpnext/patches/jan_mar_2012/stable_branch_shift_09_01_12.py
Normal 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')
|
@ -361,32 +361,6 @@ def execute(patch_no):
|
||||
elif patch_no == 370:
|
||||
sql("update `tabDocField` set `hidden` = 0 where fieldname = 'group_or_ledger' and parent = 'Cost Center'")
|
||||
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
|
||||
|
||||
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)
|
||||
|
||||
get_obj('Features Setup', 'Features Setup').doc.save()
|
||||
|
||||
elif patch_no == 376:
|
||||
elif patch_no == 372:
|
||||
from webnotes.modules.module_manager import reload_doc
|
||||
|
||||
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)
|
||||
|
||||
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 `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")
|
||||
from webnotes.model.code import get_obj
|
||||
m = get_obj('Features Setup')
|
||||
@ -431,15 +404,12 @@ def execute(patch_no):
|
||||
m.doc.fields[d[0]] = 1
|
||||
m.doc.save()
|
||||
m.validate()
|
||||
elif patch_no == 379:
|
||||
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:
|
||||
elif patch_no == 375:
|
||||
from webnotes.session_cache import clear_cache
|
||||
clear_cache(webnotes.session['user'])
|
||||
elif patch_no == 381:
|
||||
elif patch_no == 376:
|
||||
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']
|
||||
|
||||
st = "'"+"', '".join(flds)+"'"
|
||||
@ -448,6 +418,35 @@ def execute(patch_no):
|
||||
|
||||
from webnotes.session_cache import clear_cache
|
||||
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:
|
||||
reload_doc('accounts', 'doctype', 'cost_center')
|
||||
elif patch_no == 384:
|
||||
|
17
erpnext/patches/patch_list.py
Normal file
17
erpnext/patches/patch_list.py
Normal 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'
|
||||
}
|
||||
]
|
@ -115,7 +115,8 @@
|
||||
var to_append = ''
|
||||
if(data_row.adj_rate){
|
||||
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) {
|
||||
data_row.description = data_row.description + to_append;
|
||||
}
|
||||
@ -156,12 +157,14 @@
|
||||
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
|
||||
var rows = '<table width=100%>\n';
|
||||
for(var i=0; i<oc.length; i++) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
if(!oc[i].included_in_print_rate) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
}
|
||||
}
|
||||
return rows + '</table>\n';
|
||||
}
|
||||
|
@ -138,7 +138,8 @@
|
||||
var to_append = ''
|
||||
if(data_row.adj_rate){
|
||||
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) {
|
||||
data_row.description = data_row.description + to_append;
|
||||
}
|
||||
@ -179,12 +180,14 @@
|
||||
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
|
||||
var rows = '<table width=100%>\n';
|
||||
for(var i=0; i<oc.length; i++) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
if(!oc[i].included_in_print_rate) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
}
|
||||
}
|
||||
return rows + '</table>\n';
|
||||
}
|
||||
|
@ -137,7 +137,8 @@
|
||||
var to_append = ''
|
||||
if(data_row.adj_rate){
|
||||
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) {
|
||||
data_row.description = data_row.description + to_append;
|
||||
}
|
||||
@ -178,12 +179,14 @@
|
||||
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
|
||||
var rows = '<table width=100%>\n';
|
||||
for(var i=0; i<oc.length; i++) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
if(!oc[i].included_in_print_rate) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
}
|
||||
}
|
||||
return rows + '</table>\n';
|
||||
}
|
||||
|
@ -114,7 +114,8 @@
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
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) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
@ -146,12 +147,14 @@
|
||||
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
|
||||
var rows = '<table width=100%>\n';
|
||||
for(var i=0; i<oc.length; i++) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
if(!oc[i].included_in_print_rate) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
}
|
||||
}
|
||||
return rows + '</table>\n';
|
||||
}
|
||||
|
@ -137,7 +137,8 @@
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
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) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
@ -169,12 +170,14 @@
|
||||
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
|
||||
var rows = '<table width=100%>\n';
|
||||
for(var i=0; i<oc.length; i++) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
if(!oc[i].included_in_print_rate) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
}
|
||||
}
|
||||
return rows + '</table>\n';
|
||||
}
|
||||
|
@ -136,7 +136,8 @@
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
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) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
@ -168,12 +169,14 @@
|
||||
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
|
||||
var rows = '<table width=100%>\n';
|
||||
for(var i=0; i<oc.length; i++) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
if(!oc[i].included_in_print_rate) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
}
|
||||
}
|
||||
return rows + '</table>\n';
|
||||
}
|
||||
|
@ -114,7 +114,8 @@
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
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) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
@ -146,12 +147,14 @@
|
||||
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
|
||||
var rows = '<table width=100%>\n';
|
||||
for(var i=0; i<oc.length; i++) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
if(!oc[i].included_in_print_rate) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
}
|
||||
}
|
||||
return rows + '</table>\n';
|
||||
}
|
||||
|
@ -137,7 +137,8 @@
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
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) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
@ -169,12 +170,14 @@
|
||||
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
|
||||
var rows = '<table width=100%>\n';
|
||||
for(var i=0; i<oc.length; i++) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
if(!oc[i].included_in_print_rate) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
}
|
||||
}
|
||||
return rows + '</table>\n';
|
||||
}
|
||||
|
@ -136,7 +136,8 @@
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
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) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
@ -168,12 +169,14 @@
|
||||
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
|
||||
var rows = '<table width=100%>\n';
|
||||
for(var i=0; i<oc.length; i++) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
if(!oc[i].included_in_print_rate) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
}
|
||||
}
|
||||
return rows + '</table>\n';
|
||||
}
|
||||
|
@ -114,7 +114,8 @@
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
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) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
@ -146,12 +147,14 @@
|
||||
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
|
||||
var rows = '<table width=100%>\n';
|
||||
for(var i=0; i<oc.length; i++) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
if(!oc[i].included_in_print_rate) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
}
|
||||
}
|
||||
return rows + '</table>\n';
|
||||
}
|
||||
|
@ -137,7 +137,8 @@
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
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) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
@ -169,12 +170,14 @@
|
||||
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
|
||||
var rows = '<table width=100%>\n';
|
||||
for(var i=0; i<oc.length; i++) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
if(!oc[i].included_in_print_rate) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
}
|
||||
}
|
||||
return rows + '</table>\n';
|
||||
}
|
||||
|
@ -136,7 +136,8 @@
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
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) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
@ -168,12 +169,14 @@
|
||||
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
|
||||
var rows = '<table width=100%>\n';
|
||||
for(var i=0; i<oc.length; i++) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\n';
|
||||
if(!oc[i].included_in_print_rate) {
|
||||
rows +=
|
||||
'<tr>\n' +
|
||||
'\t<td>' + oc[i].description + '</td>\n' +
|
||||
'\t<td></td>\n' +
|
||||
'\t<td width=38%>' + fmt_money(oc[i].tax_amount) + '</td>\n' +
|
||||
'</tr>\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
@ -116,7 +116,6 @@ class DocType(TransactionBase):
|
||||
ch.person = d
|
||||
ch.save(1)
|
||||
|
||||
|
||||
#--------------Validation For Last Contact Date-----------------
|
||||
# ====================================================================================================================
|
||||
def set_last_contact_date(self):
|
||||
|
@ -5,7 +5,7 @@
|
||||
{
|
||||
'creation': '2010-08-08 17:09:17',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-12-22 19:03:04',
|
||||
'modified': '2012-01-09 16:52:51',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
# These values are common for all DocType
|
||||
{
|
||||
'_last_update': '1322549700',
|
||||
'_last_update': '1325570646',
|
||||
'allow_attach': 1,
|
||||
'allow_email': 0,
|
||||
'allow_trash': 1,
|
||||
@ -41,7 +41,7 @@
|
||||
'show_in_menu': 0,
|
||||
'subject': 'To %(customer_name)s on %(transaction_date)s worth %(currency)s %(grand_total_export)s',
|
||||
'tag_fields': 'status',
|
||||
'version': 598
|
||||
'version': 599
|
||||
},
|
||||
|
||||
# These values are common for all DocFormat
|
||||
@ -703,7 +703,7 @@
|
||||
'oldfieldname': 'net_total',
|
||||
'oldfieldtype': 'Currency',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1,
|
||||
'print_hide': 0,
|
||||
'reqd': 0,
|
||||
'width': '100px'
|
||||
},
|
||||
@ -902,7 +902,7 @@
|
||||
'oldfieldname': 'grand_total_export',
|
||||
'oldfieldtype': 'Currency',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1,
|
||||
'print_hide': 0,
|
||||
'reqd': 0,
|
||||
'width': '200px'
|
||||
},
|
||||
@ -917,7 +917,7 @@
|
||||
'oldfieldname': 'rounded_total_export',
|
||||
'oldfieldtype': 'Currency',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1,
|
||||
'print_hide': 0,
|
||||
'reqd': 0,
|
||||
'width': '200px'
|
||||
},
|
||||
|
@ -130,26 +130,47 @@ cur_frm.cscript.adj_rate = function(doc, cdt, cdn) { cur_frm.cscript.recalc(doc,
|
||||
|
||||
// ************************ REF RATE ****************************
|
||||
cur_frm.cscript.ref_rate = function(doc, cdt, cdn){
|
||||
var d = locals[cdt][cdn];
|
||||
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);
|
||||
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);
|
||||
}
|
||||
cur_frm.cscript.recalc(doc, 1);
|
||||
}
|
||||
|
||||
// *********************** BASIC RATE **************************
|
||||
cur_frm.cscript.basic_rate = function(doc, cdt, cdn) {
|
||||
var fname = cur_frm.cscript.fname;
|
||||
var d = locals[cdt][cdn];;
|
||||
if(!d.qty)
|
||||
{
|
||||
d.qty = 1;
|
||||
refresh_field('qty', d.name, fname);
|
||||
|
||||
}
|
||||
cur_frm.cscript.recalc(doc, 2);
|
||||
var fname = cur_frm.cscript.fname;
|
||||
var d = locals[cdt][cdn];
|
||||
if(!d.qty) {
|
||||
d.qty = 1;
|
||||
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);
|
||||
} 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 *************************
|
||||
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.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) {
|
||||
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++){
|
||||
net_total += flt(cl[i].amount);
|
||||
}
|
||||
net_total_incl = net_total
|
||||
var d = getchildren('RV Tax Detail', doc.name, other_fname,doc.doctype);
|
||||
for(var j = 0; j<d.length; j++){
|
||||
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.grand_total = flt(flt(net_total) + flt(other_charges_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
|
||||
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_tax_amount = flt(prev_total.toFixed(2)); //stores total amount in virtual field
|
||||
tax[t].tax_amount += flt(tax_amount.toFixed(2));
|
||||
//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].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);
|
||||
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);
|
||||
@ -311,7 +342,8 @@ cur_frm.cscript.check_charge_type_and_get_tax_amount = function( doc, tax, t, cl
|
||||
refresh_field('total_excise_rate');
|
||||
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'){
|
||||
if(flt(print_amt) == 1) {
|
||||
@ -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 ******************************
|
||||
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]
|
||||
var net_total = 0
|
||||
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++) {
|
||||
if(n == 1){
|
||||
if(flt(cl[i].ref_rate) > 0)
|
||||
set_multiple(tname, cl[i].name, {'export_rate': flt(flt(cl[i].ref_rate) * (100 - flt(cl[i].adj_rate)) / 100)}, 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);
|
||||
if(!consider_incl_rate) {
|
||||
if(flt(cl[i].ref_rate) > 0) {
|
||||
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){
|
||||
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, {'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, {'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)
|
||||
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));
|
||||
}
|
||||
doc.net_total = net_total;
|
||||
@ -389,20 +551,31 @@ cur_frm.cscript['Re-Calculate Values'] = function(doc, cdt, cdn) {
|
||||
}
|
||||
|
||||
cur_frm.cscript['Calculate Charges'] = function(doc, cdt, cdn) {
|
||||
var other_fname = cur_frm.cscript.other_fname;
|
||||
var other_fname = cur_frm.cscript.other_fname;
|
||||
|
||||
var cl = getchildren('RV Tax Detail', doc.name, other_fname, doc.doctype);
|
||||
for(var i = 0; i<cl.length; i++){
|
||||
cl[i].total_tax_amount = 0;
|
||||
cl[i].total_amount = 0;
|
||||
cl[i].tax_amount = 0; // this is done to calculate other charges
|
||||
cl[i].total = 0;
|
||||
if(in_list(['On Previous Row Amount','On Previous Row Total'],cl[i].charge_type) && !cl[i].row_id){
|
||||
alert("Please Enter Row on which amount needs to be calculated for row : "+cl[i].idx);
|
||||
validated = false;
|
||||
}
|
||||
}
|
||||
cur_frm.cscript.recalc(doc, 1);
|
||||
var cl = getchildren('RV Tax Detail', doc.name, other_fname, doc.doctype);
|
||||
for(var i = 0; i<cl.length; i++){
|
||||
cl[i].total_tax_amount = 0;
|
||||
cl[i].total_amount = 0;
|
||||
cl[i].tax_amount = 0; // this is done to calculate other charges
|
||||
cl[i].total = 0;
|
||||
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);
|
||||
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);
|
||||
}
|
||||
|
||||
// Get Sales Partner Commission
|
||||
|
@ -52,7 +52,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
|
||||
// indent
|
||||
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
|
||||
if(doc.per_billed < 100)
|
||||
@ -242,7 +242,7 @@ cur_frm.cscript['Make Maintenance Visit'] = function() {
|
||||
|
||||
// make indent
|
||||
// ================================================================================================
|
||||
cur_frm.cscript['Make Indent'] = function() {
|
||||
cur_frm.cscript['Make Purchase Requisition'] = function() {
|
||||
var doc = cur_frm.doc;
|
||||
if (doc.docstatus == 1) {
|
||||
n = createLocal("Indent");
|
||||
|
@ -5,7 +5,7 @@
|
||||
{
|
||||
'creation': '2010-08-08 17:09:21',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-12-22 19:03:25',
|
||||
'modified': '2012-01-09 16:52:34',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
# These values are common for all DocType
|
||||
{
|
||||
'_last_update': '1324295218',
|
||||
'_last_update': '1325570646',
|
||||
'allow_attach': 0,
|
||||
'colour': 'White:FFF',
|
||||
'default_print_format': 'Standard',
|
||||
@ -38,7 +38,7 @@
|
||||
'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',
|
||||
'tag_fields': 'delivery_status,billing_status',
|
||||
'version': 609
|
||||
'version': 610
|
||||
},
|
||||
|
||||
# These values are common for all DocFormat
|
||||
@ -771,7 +771,7 @@
|
||||
'oldfieldname': 'net_total',
|
||||
'oldfieldtype': 'Currency',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1,
|
||||
'print_hide': 0,
|
||||
'reqd': 0,
|
||||
'width': '150px'
|
||||
},
|
||||
@ -951,7 +951,7 @@
|
||||
'oldfieldname': 'grand_total_export',
|
||||
'oldfieldtype': 'Currency',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1,
|
||||
'print_hide': 0,
|
||||
'reqd': 0,
|
||||
'width': '150px'
|
||||
},
|
||||
@ -965,7 +965,7 @@
|
||||
'oldfieldname': 'rounded_total_export',
|
||||
'oldfieldtype': 'Currency',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1,
|
||||
'print_hide': 0,
|
||||
'width': '150px'
|
||||
},
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Please edit this list and import only required elements
|
||||
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.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
|
||||
from webnotes.model.doclist import getlist, copy_doclist
|
||||
@ -88,7 +88,7 @@ class DocType(TransactionBase):
|
||||
if doc_obj:
|
||||
if doc_obj.doc.doctype == 'Receivable Voucher': customer = doc_obj.doc.customer
|
||||
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 doc_obj:
|
||||
for t in getlist(doc_obj.doclist, doc_obj.fname):
|
||||
|
@ -319,4 +319,4 @@
|
||||
'fieldtype': 'Check',
|
||||
'label': 'More Info'
|
||||
}
|
||||
]
|
||||
]
|
||||
|
@ -8,50 +8,80 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
}*/
|
||||
|
||||
// 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){
|
||||
//function to make row of table
|
||||
var make_row = function(title,val,bold){
|
||||
var bstart = '<b>'; var bend = '</b>';
|
||||
return '<tr><td style="width:50%;">'+(bold?bstart:'')+title+(bold?bend:'')+'</td>'
|
||||
+'<td style="width:25%;text-align:right;">'+doc.currency+'</td>'
|
||||
+'<td style="width:25%;text-align:right;">'+val+'</td>'
|
||||
+'</tr>'
|
||||
}
|
||||
var make_row = function(title,val,bold){
|
||||
var bstart = '<b>'; var bend = '</b>';
|
||||
return '<tr><td style="width:50%;">'+(bold?bstart:'')+title+(bold?bend:'')+'</td>'
|
||||
+'<td style="width:25%;text-align:right;">'+doc.currency+'</td>'
|
||||
+'<td style="width:25%;text-align:right;">'+val+'</td>'
|
||||
+'</tr>'
|
||||
}
|
||||
|
||||
function convert_rate(val){
|
||||
var new_val = flt(val)/flt(doc.conversion_rate);
|
||||
return new_val;
|
||||
}
|
||||
out ='';
|
||||
if (!doc.print_without_amount) {
|
||||
var cl = getchildren('RV Tax Detail',doc.name,'other_charges');
|
||||
function convert_rate(val){
|
||||
var new_val = flt(val)/flt(doc.conversion_rate);
|
||||
return new_val;
|
||||
}
|
||||
out ='';
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// outer table
|
||||
var out='<div><table class="noborder" style="width:100%"><tr><td style="width: 60%"></td><td>';
|
||||
|
||||
// main table
|
||||
out +='<table class="noborder" style="width:100%">'+make_row('Net Total',fmt_money(convert_rate(doc.net_total)),1);
|
||||
var cl = getchildren('RV Tax Detail',doc.name,'other_charges');
|
||||
|
||||
// add rows
|
||||
if(cl.length){
|
||||
for(var i=0;i<cl.length;i++){
|
||||
if(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
|
||||
out +=make_row('Grand Total',fmt_money(doc.grand_total_export),1) +make_row('Rounded Total',fmt_money(doc.rounded_total_export),1)
|
||||
if(doc.in_words_export){
|
||||
out +='</table></td></tr>';
|
||||
out += '<tr><td colspan = "2">';
|
||||
out += '<table><tr><td style="width:25%;"><b>In Words</b></td>'
|
||||
out+= '<td style="width:50%;">'+doc.in_words_export+'</td></tr>'
|
||||
}
|
||||
out +='</table></td></tr></table></div>';
|
||||
}
|
||||
return out;
|
||||
// outer table
|
||||
var out='<div><table class="noborder" style="width:100%"><tr><td style="width: 60%"></td><td>';
|
||||
|
||||
// main table
|
||||
|
||||
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
|
||||
if(cl.length){
|
||||
for(var i=0;i<cl.length;i++){
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
// grand total
|
||||
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){
|
||||
out +='</table></td></tr>';
|
||||
out += '<tr><td colspan = "2">';
|
||||
out += '<table><tr><td style="width:25%;"><b>In Words</b></td>'
|
||||
out+= '<td style="width:50%;">'+doc.in_words_export+'</td></tr>'
|
||||
}
|
||||
out +='</table></td></tr></table></div>';
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
cur_frm.cscript.charge_type = function(doc, cdt, cdn) {
|
||||
|
@ -44,6 +44,20 @@ def on_login_post_session(login_manager):
|
||||
if webnotes.form_dict.get('login_from'):
|
||||
webnotes.session['data']['login_from'] = webnotes.form.getvalue('login_from')
|
||||
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()
|
||||
|
||||
@ -53,7 +67,7 @@ def on_login_post_session(login_manager):
|
||||
def on_logout(login_manager):
|
||||
if cint(webnotes.conn.get_value('Control Panel', None, 'sync_with_gateway')):
|
||||
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)
|
||||
@ -81,4 +95,4 @@ def login_as(user, login_manager):
|
||||
p.enabled = 1
|
||||
p.owner = user
|
||||
p.save(1)
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user