This commit is contained in:
Rushabh Mehta 2012-04-13 11:42:56 +05:30
commit 97ae17eaf7
23 changed files with 445 additions and 549 deletions

View File

@ -450,43 +450,6 @@ class DocType:
if not ret:
msgprint("Payment Entry has been modified after you pulled it. Please pull it again.", raise_exception=1)
######################################################################################################################
# Repair Outstanding Amount
#---------------------------------
def repair_voucher_outstanding(self, voucher_obj):
msg = []
# Get Balance from GL Entries
bal = webnotes.conn.sql("select sum(debit)-sum(credit) from `tabGL Entry` where against_voucher=%s and against_voucher_type=%s", (voucher_obj.doc.name , voucher_obj.doc.doctype))
bal = bal and flt(bal[0][0]) or 0.0
if cstr(voucher_obj.doc.doctype) == 'Purchase Invoice':
bal = -bal
# Check outstanding Amount
if flt(voucher_obj.doc.outstanding_amount) != flt(bal):
msgprint('<div style="color: RED"> Difference found in Outstanding Amount of %s : %s (Before : %s; After : %s) </div>' % (voucher_obj.doc.doctype, voucher_obj.doc.name, voucher_obj.doc.outstanding_amount, bal))
msg.append('<div style="color: RED"> Difference found in Outstanding Amount of %s : %s (Before : %s; After : %s) </div>' % (voucher_obj.doc.doctype, voucher_obj.doc.name, voucher_obj.doc.outstanding_amount, bal))
# set voucher balance
#webnotes.conn.sql("update `tab%s` set outstanding_amount=%s where name='%s'" % (voucher_obj.doc.doctype, bal, voucher_obj.doc.name))
webnotes.conn.set(voucher_obj.doc, 'outstanding_amount', flt(bal))
# Send Mail
if msg:
email_msg = """ Dear Administrator,
In Account := %s User := %s has Repaired Outstanding Amount For %s : %s and following was found:-
%s
""" % (webnotes.conn.get_value('Control Panel', None,'account_id'), session['user'], voucher_obj.doc.doctype, voucher_obj.doc.name, '\n'.join(msg))
sendmail(['support@iwebnotes.com'], subject='Repair Outstanding Amount', parts = [('text/plain', email_msg)])
# Acknowledge User
msgprint(cstr(voucher_obj.doc.doctype) + " : " + cstr(voucher_obj.doc.name) + " has been checked" + cstr(msg and " and repaired successfully." or ". No changes Found."))
def repost_illegal_cancelled(self, after_date='2011-01-01'):
"""

View File

@ -69,10 +69,8 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
cur_frm.add_custom_button('Make Payment Entry', cur_frm.cscript.make_bank_voucher);
if(doc.docstatus==1) {
unhide_field(['repair_outstanding_amt']);
cur_frm.add_custom_button('View Ledger', cur_frm.cscript.view_ledger_entry);
} else hide_field(['repair_outstanding_amt']);
}
cur_frm.cscript.is_opening(doc, dt, dn);
}

View File

@ -558,8 +558,3 @@ class DocType(TransactionBase):
def on_update(self):
pass
########################################################################
# Repair Outstanding
#######################################################################
def repair_pv_outstanding(self):
get_obj(dt = 'GL Control').repair_voucher_outstanding(self)

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-03-27 14:35:45',
'creation': '2012-04-11 13:17:19',
'docstatus': 0,
'modified': '2012-03-27 14:45:49',
'modified': '2012-04-12 18:09:05',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -13,6 +13,7 @@
# These values are common for all DocType
{
'_last_update': u'1330345793',
'allow_attach': 1,
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
@ -25,7 +26,7 @@
'server_code_error': u' ',
'show_in_menu': 0,
'subject': u'From %(supplier_name)s worth %(grand_total)s due on %(due_date)s | %(outstanding_amount)s outstanding',
'version': 521
'version': 522
},
# These values are common for all DocField
@ -53,6 +54,18 @@
'name': u'Purchase Invoice'
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Accounts Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
@ -60,11 +73,23 @@
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Accounts User',
'role': u'Accounts Manager',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Accounts User',
'submit': 0,
'write': 0
},
# DocPerm
{
'doctype': u'DocPerm',
@ -84,26 +109,6 @@
'write': 1
},
# DocPerm
{
'doctype': u'DocPerm',
'match': u'supplier',
'permlevel': 0,
'role': u'Supplier'
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Accounts Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
@ -111,21 +116,17 @@
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Accounts Manager',
'role': u'Accounts User',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Accounts User',
'submit': 0,
'write': 0
'match': u'supplier',
'permlevel': 0,
'role': u'Supplier'
},
# DocField
@ -1101,32 +1102,6 @@
'print_hide': 1
},
# DocField
{
'colour': u'White:FFF',
'depends_on': u'eval:!doc.__islocal',
'doctype': u'DocField',
'fieldname': u'actions',
'fieldtype': u'Section Break',
'label': u'Actions',
'oldfieldtype': u'Section Break',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'allow_on_submit': 1,
'doctype': u'DocField',
'fieldname': u'repair_outstanding_amt',
'fieldtype': u'Button',
'label': u'Repair Outstanding Amt',
'oldfieldtype': u'Button',
'options': u'repair_pv_outstanding',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
@ -1140,5 +1115,17 @@
'permlevel': 0,
'print_hide': 1,
'report_hide': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'file_list',
'fieldtype': u'Text',
'hidden': 1,
'label': u'File List',
'no_copy': 1,
'permlevel': 0,
'print_hide': 1
}
]
]

View File

@ -79,7 +79,7 @@ cur_frm.cscript.hide_fields = function(doc, cdt, cdn) {
'source', 'cancel_reason', 'total_advance', 'gross_profit',
'gross_profit_percent', 'get_advances_received',
'advance_adjustment_details', 'sales_partner', 'commission_rate',
'total_commission', 'repair_outstanding_amt'];
'total_commission'];
item_flds_normal = ['sales_order', 'delivery_note']
item_flds_pos = ['warehouse', 'serial_no', 'batch_no', 'actual_qty', 'delivered_qty']
@ -115,7 +115,6 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
if(doc.docstatus==1) {
cur_frm.add_custom_button('View Ledger', cur_frm.cscript.view_ledger_entry);
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
unhide_field('repair_outstanding_amt');
if(doc.is_pos==1 && doc.update_stock!=1)
cur_frm.add_custom_button('Make Delivery', cur_frm.cscript['Make Delivery Note']);
@ -123,8 +122,6 @@ cur_frm.cscript.refresh = function(doc, dt, dn) {
if(doc.outstanding_amount!=0)
cur_frm.add_custom_button('Make Payment Entry', cur_frm.cscript.make_bank_voucher);
}
else
hide_field('repair_outstanding_amt');
}
//fetch retail transaction related fields

View File

@ -679,13 +679,6 @@ class DocType(TransactionBase):
webnotes.conn.set(self.doc,'outstanding_amount',flt(self.doc.grand_total) - flt(self.doc.total_advance) - flt(self.doc.paid_amount) - flt(self.doc.write_off_amount))
########################################################################
# Repair Outstanding
def repair_rv_outstanding(self):
get_obj(dt = 'GL Control').repair_voucher_outstanding(self)
#-------------------------------------------------------------------------------------
def on_update_after_submit(self):
self.convert_into_recurring()

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-03-27 14:35:47',
'creation': '2012-04-11 13:17:25',
'docstatus': 0,
'modified': '2012-03-27 18:44:28',
'modified': '2012-04-13 11:26:44',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -13,6 +13,7 @@
# These values are common for all DocType
{
'_last_update': u'1330671142',
'allow_attach': 1,
'change_log': u'1. Change in pull_details method dt.-26-06-2009',
'colour': u'White:FFF',
'default_print_format': u'Standard',
@ -26,7 +27,7 @@
'server_code_error': u' ',
'show_in_menu': 0,
'subject': u'To %(customer_name)s worth %(currency)s %(grand_total_export)s due on %(due_date)s | %(outstanding_amount)s outstanding',
'version': 417
'version': 418
},
# These values are common for all DocField
@ -54,6 +55,30 @@
'name': u'Sales Invoice'
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Accounts Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Accounts Manager',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 1,
@ -80,38 +105,10 @@
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'match': u'customer',
'permlevel': 0,
'role': u'Customer',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Accounts Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Accounts Manager',
'submit': 1,
'write': 1
'role': u'Customer'
},
# DocField
@ -1503,14 +1500,13 @@
# DocField
{
'allow_on_submit': 1,
'doctype': u'DocField',
'fieldname': u'repair_outstanding_amt',
'fieldtype': u'Button',
'label': u'Repair Outstanding Amt',
'oldfieldtype': u'Button',
'options': u'repair_rv_outstanding',
'fieldname': u'file_list',
'fieldtype': u'Text',
'hidden': 1,
'label': u'File List',
'no_copy': 1,
'permlevel': 0,
'print_hide': 1
}
]
]

View File

@ -33,6 +33,7 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
if(!doc.currency) doc.currency = sys_defaults.currency;
if(!doc.status) set_multiple(cdt,cdn,{status:'Draft'});
if(!doc.transaction_date) set_multiple(cdt,cdn,{transaction_date:get_today()});
if(!doc.is_subcontracted) set_multiple(cdt, cdn, {is_subcontracted:'No'});
if(doc.__islocal){
hide_field(['supplier_name','supplier_address','contact_person','address_display','contact_display','contact_mobile','contact_email']);
@ -79,9 +80,6 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
if(doc.docstatus == 1 && doc.status == 'Stopped')
cur_frm.add_custom_button('Unstop Purchase Order', cur_frm.cscript['Unstop Purchase Order']);
if(doc.docstatus == 1) unhide_field(['repair_purchase_order']);
else hide_field(['repair_purchase_order']);
}

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-03-27 14:35:51',
'creation': '2012-04-11 13:17:34',
'docstatus': 0,
'modified': '2012-03-27 18:46:29',
'modified': '2012-04-12 18:11:33',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -13,6 +13,7 @@
# These values are common for all DocType
{
'_last_update': u'1330339817',
'allow_attach': 1,
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
@ -27,7 +28,7 @@
'server_code_error': u' ',
'show_in_menu': 0,
'subject': u'To %(supplier_name)s on %(transaction_date)s | %(per_received)s% delivered',
'version': 502
'version': 503
},
# These values are common for all DocField
@ -55,6 +56,54 @@
'name': u'Purchase Order'
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Purchase Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Purchase Manager',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 1,
@ -90,54 +139,6 @@
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Purchase Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Purchase Manager',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material User',
'submit': 0,
'write': 0
},
# DocField
{
'colour': u'White:FFF',
@ -1044,14 +1045,13 @@
# DocField
{
'allow_on_submit': 1,
'doctype': u'DocField',
'fieldname': u'repair_purchase_order',
'fieldtype': u'Button',
'label': u'Repair Purchase Order',
'oldfieldtype': u'Button',
'options': u'repair_purchase_order',
'fieldname': u'file_list',
'fieldtype': u'Text',
'hidden': 1,
'label': u'File List',
'no_copy': 1,
'permlevel': 0,
'print_hide': 1
}
]
]

View File

@ -92,9 +92,9 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.add_custom_button('Unstop', cur_frm.cscript['Unstop Sales Order']);
}
unhide_field(['repair_sales_order', 'Send SMS', 'message', 'customer_mobile_no'])
unhide_field(['Send SMS', 'message', 'customer_mobile_no'])
} else {
hide_field(['repair_sales_order', 'Send SMS', 'message', 'customer_mobile_no'])
hide_field(['Send SMS', 'message', 'customer_mobile_no'])
}
}

View File

@ -509,7 +509,3 @@ class DocType(TransactionBase):
def on_update(self):
pass
# Repair Sales Order
# ===========================================
def repair_sales_order(self):
get_obj('Sales Common', 'Sales Common').repair_curr_doctype_details(self)

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-03-27 14:36:14',
'creation': '2012-04-11 13:18:19',
'docstatus': 0,
'modified': '2012-03-27 18:49:05',
'modified': '2012-04-13 11:32:08',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -13,7 +13,7 @@
# These values are common for all DocType
{
'_last_update': u'1330670942',
'allow_attach': 0,
'allow_attach': 1,
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
@ -30,7 +30,7 @@
'show_in_menu': 0,
'subject': u'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': u'delivery_status,billing_status',
'version': 632
'version': 633
},
# These values are common for all DocField
@ -58,6 +58,30 @@
'name': u'Sales Order'
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Sales Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Sales Manager',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 1,
@ -70,18 +94,6 @@
'write': 1
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Maintenance User',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 0,
@ -89,93 +101,63 @@
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Maintenance Manager',
'role': u'Sales User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'match': u'customer_name',
'permlevel': 0,
'role': u'Maintenance Manager',
'submit': 1,
'write': 1
'role': u'Customer'
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Sales Manager',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Sales Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 2,
'role': u'Accounts User',
'submit': 0,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Customer',
'submit': 0,
'write': 0
'role': u'Maintenance Manager',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Sales User',
'submit': 0,
'write': 0
'role': u'Maintenance Manager'
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 1,
'permlevel': 0,
'role': u'Maintenance User',
'submit': 0,
'write': 0
'submit': 1,
'write': 1
},
# DocPerm
{
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Maintenance User'
},
# DocField
@ -1335,14 +1317,13 @@
# DocField
{
'allow_on_submit': 1,
'doctype': u'DocField',
'fieldname': u'repair_sales_order',
'fieldtype': u'Button',
'label': u'Repair Sales Order',
'oldfieldtype': u'Button',
'options': u'repair_sales_order',
'fieldname': u'file_list',
'fieldtype': u'Text',
'hidden': 1,
'label': u'File List',
'no_copy': 1,
'permlevel': 0,
'print_hide': 1
}
]
]

View File

@ -64,10 +64,10 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
if(doc.per_installed < 100 && doc.docstatus==1) cur_frm.add_custom_button('Make Installation Note', cur_frm.cscript['Make Installation Note']);
if (doc.docstatus!=1) {
hide_field(['SMS', 'Send SMS', 'message', 'customer_mobile_no', 'Repair Delivery Note']);
hide_field(['Send SMS', 'message', 'customer_mobile_no');
} else {
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
unhide_field(['SMS','Send SMS', 'message', 'customer_mobile_no', 'Repair Delivery Note']);
unhide_field(['Send SMS', 'message', 'customer_mobile_no');
}
if(doc.docstatus==0 && !doc.__islocal) {

View File

@ -487,8 +487,4 @@ class DocType(TransactionBase):
self.set_actual_qty()
get_obj('Stock Ledger').scrub_serial_nos(self)
# Repair Delivery Note
# ===========================================
def repair_delivery_note(self):
get_obj('Sales Common', 'Sales Common').repair_curr_doctype_details(self)

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-03-27 14:36:28',
'creation': '2012-04-11 13:18:36',
'docstatus': 0,
'modified': '2012-03-27 18:50:57',
'modified': '2012-04-13 11:02:43',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -13,6 +13,7 @@
# These values are common for all DocType
{
'_last_update': u'1330593645',
'allow_attach': 1,
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
@ -29,7 +30,7 @@
'show_in_menu': 0,
'subject': u'To %(customer_name)s on %(posting_date)s | %(per_billed)s% billed',
'tag_fields': u'billing_status',
'version': 476
'version': 477
},
# These values are common for all DocField
@ -57,6 +58,78 @@
'name': u'Delivery Note'
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material User',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material Manager',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Sales User',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Sales User',
'submit': 0,
'write': 0
},
# DocPerm
{
'cancel': 0,
@ -75,30 +148,6 @@
'role': u'Accounts User'
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Sales User',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Sales User',
'submit': 0,
'write': 0
},
# DocPerm
{
'doctype': u'DocPerm',
@ -115,54 +164,6 @@
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material Manager',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material User',
'submit': 1,
'write': 1
},
# DocField
{
'colour': u'White:FFF',
@ -1368,14 +1369,13 @@
# DocField
{
'allow_on_submit': 1,
'doctype': u'DocField',
'fieldname': u'repair_delivery_note',
'fieldtype': u'Button',
'label': u'Repair Delivery Note',
'oldfieldtype': u'Button',
'options': u'repair_delivery_note',
'fieldname': u'file_list',
'fieldtype': u'Text',
'hidden': 1,
'label': u'File List',
'no_copy': 1,
'permlevel': 0,
'print_hide': 1
}
]
]

View File

@ -71,9 +71,6 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.add_custom_button('Make Purchase Invoice', cur_frm.cscript['Make Purchase Invoice']);
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
}
else{
hide_field(['Repair Purchase Receipt']);
}
}

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-03-27 14:36:34',
'creation': '2012-04-11 13:18:46',
'docstatus': 0,
'modified': '2012-03-27 18:51:48',
'modified': '2012-04-12 17:50:10',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -13,6 +13,7 @@
# These values are common for all DocType
{
'_last_update': u'1330593645',
'allow_attach': 1,
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
@ -27,7 +28,7 @@
'server_code_error': u' ',
'show_in_menu': 0,
'subject': u'From %(supplier_name)s against %(purchase_order)s on %(posting_date)s',
'version': 326
'version': 327
},
# These values are common for all DocField
@ -55,6 +56,54 @@
'name': u'Purchase Receipt'
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material Manager',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material User',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 1,
@ -90,54 +139,6 @@
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material Manager',
'submit': 1,
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 1,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material User',
'submit': 1,
'write': 1
},
# DocField
{
'colour': u'White:FFF',
@ -591,6 +592,18 @@
'width': u'150px'
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'get_current_stock',
'fieldtype': u'Button',
'label': u'Get Current Stock',
'oldfieldtype': u'Button',
'options': u'get_current_stock',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
@ -1130,18 +1143,6 @@
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'get_current_stock',
'fieldtype': u'Button',
'label': u'Get Current Stock',
'oldfieldtype': u'Button',
'options': u'get_current_stock',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
@ -1158,15 +1159,13 @@
# DocField
{
'allow_on_submit': 1,
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'repair_purchase_receipt',
'fieldtype': u'Button',
'label': u'Repair Purchase Receipt',
'oldfieldtype': u'Button',
'options': u'repair_purchase_receipt',
'fieldname': u'file_list',
'fieldtype': u'Text',
'hidden': 1,
'label': u'File List',
'no_copy': 1,
'permlevel': 0,
'print_hide': 1
}
]
]

View File

@ -26,8 +26,8 @@ var cfn_set_fields = function(doc, cdt, cdn) {
hide_field(lst);
if (doc.purpose == 'Production Order' || doc.purpose == 'Other'){
unhide_field('Get Items');
hide_field(['from_warehouse', 'to_warehouse','purchase_receipt_no','delivery_note_no', 'sales_invoice_no','Warehouse HTML', 'transporter', 'is_excisable_goods', 'excisable_goods']);
unhide_field('get_items');
hide_field(['from_warehouse', 'to_warehouse','purchase_receipt_no','delivery_note_no', 'sales_invoice_no','warehouse_html', 'transporter', 'is_excisable_goods', 'excisable_goods']);
if (doc.purpose=='Production Order') unhide_field(['production_order', 'process']);
doc.from_warehouse = '';
@ -42,7 +42,7 @@ var cfn_set_fields = function(doc, cdt, cdn) {
}
else{
unhide_field(['from_warehouse', 'to_warehouse']);
hide_field(['production_order', 'process', 'Get Items', 'fg_completed_qty','purchase_receipt_no','delivery_note_no', 'sales_invoice_no']);
hide_field(['production_order', 'process', 'get_items', 'fg_completed_qty','purchase_receipt_no','delivery_note_no', 'sales_invoice_no']);
doc.production_order = '';
doc.process = '';
doc.fg_completed_qty = 0;

View File

@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
cur_frm.cscript.refresh = function(doc) {
if (doc.docstatus) hide_field('Steps');
if (doc.docstatus) hide_field('steps');
}
cur_frm.cscript.download_template = function(doc, cdt, cdn) {

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-03-27 14:36:40',
'creation': '2012-04-11 13:18:57',
'docstatus': 0,
'modified': '2012-03-27 14:36:40',
'modified': '2012-04-11 17:47:35',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -25,7 +25,7 @@
'section_style': u'Tabbed',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 58
'version': 59
},
# These values are common for all DocField
@ -53,6 +53,78 @@
'name': u'Warehouse'
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 2,
'role': u'Material User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 2,
'role': u'Material Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'doctype': u'DocPerm',
@ -81,91 +153,19 @@
# DocPerm
{
'create': 0,
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 2,
'permlevel': 0,
'role': u'System Manager',
'write': 1
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 2,
'role': u'Material Manager',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Material User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'Material User',
'submit': 0,
'write': 0
},
# DocPerm
{
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 2,
'role': u'Material User',
'submit': 0,
'write': 0
},
# DocPerm
{
'cancel': 1,
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': u'System Manager',
'write': 1
},
@ -268,7 +268,7 @@
{
'doctype': u'DocField',
'fieldname': u'phone_no',
'fieldtype': u'Int',
'fieldtype': u'Data',
'label': u'Phone No',
'oldfieldname': u'phone_no',
'oldfieldtype': u'Int',
@ -280,7 +280,7 @@
{
'doctype': u'DocField',
'fieldname': u'mobile_no',
'fieldtype': u'Int',
'fieldtype': u'Data',
'label': u'Mobile No',
'oldfieldname': u'mobile_no',
'oldfieldtype': u'Int',

View File

@ -22,8 +22,8 @@ cur_frm.cscript.onload = function(doc,cdt,cdn){
}
cur_frm.cscript.refresh = function(doc,ct,cdn){
if(!doc.docstatus) hide_field('Make Maintenance Visit');
else if(doc.docstatus && (doc.status == 'Open' || doc.status == 'Work In Progress')) unhide_field('Make Maintenance Visit');
if(!doc.docstatus) hide_field('make_maintenance_visit');
else if(doc.docstatus && (doc.status == 'Open' || doc.status == 'Work In Progress')) unhide_field('make_maintenance_visit');
}

View File

@ -2025,9 +2025,9 @@ _f.frm_dialog.cur_frm.fields_dict[n].refresh();}else{var g=_f.cur_grid_cell;if(g
cur_frm.fields_dict[n].refresh();}}
set_field_options=function(n,txt){var df=get_field(cur_frm.doctype,n,cur_frm.docname);if(df)df.options=txt;refresh_field(n);}
set_field_permlevel=function(n,level){var df=get_field(cur_frm.doctype,n,cur_frm.docname);if(df)df.permlevel=level;refresh_field(n);}
hide_field=function(n){function _hide_field(n,hidden){var df=get_field(cur_frm.doctype,n,cur_frm.docname);if(df)df.hidden=hidden;refresh_field(n);}
hide_field=function(n){function _hide_field(n,hidden){var df=get_field(cur_frm.doctype,n,cur_frm.docname);if(df)df.hidden=hidden;refresh_field(n);else console.log("hide_field cannot find field "+n);}
if(cur_frm){if(n.substr)_hide_field(n,1);else{for(var i in n)_hide_field(n[i],1)}}}
unhide_field=function(n){function _hide_field(n,hidden){var df=get_field(cur_frm.doctype,n,cur_frm.docname);if(df)df.hidden=hidden;refresh_field(n);}
unhide_field=function(n){function _hide_field(n,hidden){var df=get_field(cur_frm.doctype,n,cur_frm.docname);if(df)df.hidden=hidden;refresh_field(n);else console.log("unhide_field cannot find field "+n);}
if(cur_frm){if(n.substr)_hide_field(n,0);else{for(var i in n)_hide_field(n[i],0)}}}
get_field_obj=function(fn){return cur_frm.fields_dict[fn];}
/*

View File

@ -1 +1 @@
1683
1683