Merge branch 'shf_rename' of github.com:webnotes/erpnext into shf_rename
This commit is contained in:
commit
b176e94b92
@ -97,6 +97,7 @@
|
|||||||
"lib/js/legacy/utils/dom.js",
|
"lib/js/legacy/utils/dom.js",
|
||||||
"lib/js/legacy/utils/handler.js",
|
"lib/js/legacy/utils/handler.js",
|
||||||
"lib/js/legacy/utils/msgprint.js",
|
"lib/js/legacy/utils/msgprint.js",
|
||||||
|
"lib/js/wn/ui/appframe.js",
|
||||||
"lib/js/wn/ui/dialog.js",
|
"lib/js/wn/ui/dialog.js",
|
||||||
"lib/js/legacy/widgets/dialog.js",
|
"lib/js/legacy/widgets/dialog.js",
|
||||||
"lib/js/wn/ui/listing.js",
|
"lib/js/wn/ui/listing.js",
|
||||||
@ -131,7 +132,7 @@
|
|||||||
"lib/js/legacy/utils/msgprint.js",
|
"lib/js/legacy/utils/msgprint.js",
|
||||||
"lib/js/legacy/utils/printElement.js",
|
"lib/js/legacy/utils/printElement.js",
|
||||||
"lib/js/legacy/widgets/form/fields.js",
|
"lib/js/legacy/widgets/form/fields.js",
|
||||||
"lib/js/wn/views/appframe.js",
|
"lib/js/wn/ui/appframe.js",
|
||||||
"lib/js/wn/ui/dialog.js",
|
"lib/js/wn/ui/dialog.js",
|
||||||
"lib/js/wn/ui/button.js",
|
"lib/js/wn/ui/button.js",
|
||||||
"lib/js/legacy/widgets/dialog.js",
|
"lib/js/legacy/widgets/dialog.js",
|
||||||
|
@ -330,7 +330,7 @@ div.notice {
|
|||||||
|
|
||||||
div.form-title {
|
div.form-title {
|
||||||
/*background-color: #e0eeff;*/
|
/*background-color: #e0eeff;*/
|
||||||
padding: 5px 11px 15px 11px;
|
padding: 5px 19px 15px 19px;
|
||||||
margin: -15px -15px 0px -15px;
|
margin: -15px -15px 0px -15px;
|
||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid #eee;
|
||||||
}
|
}
|
||||||
@ -338,7 +338,7 @@ div.form-title {
|
|||||||
div.form-section-head {
|
div.form-section-head {
|
||||||
margin: 11px -15px 3px -15px;
|
margin: 11px -15px 3px -15px;
|
||||||
border-top: 1px solid #ccc;
|
border-top: 1px solid #ccc;
|
||||||
padding: 11px 15px 0px 15px;
|
padding: 11px 23px 0px 23px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.form-layout-row:first-child .form-section-head {
|
div.form-layout-row:first-child .form-section-head {
|
||||||
|
@ -450,43 +450,6 @@ class DocType:
|
|||||||
if not ret:
|
if not ret:
|
||||||
msgprint("Payment Entry has been modified after you pulled it. Please pull it again.", raise_exception=1)
|
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'):
|
def repost_illegal_cancelled(self, after_date='2011-01-01'):
|
||||||
"""
|
"""
|
||||||
|
@ -558,8 +558,3 @@ class DocType(TransactionBase):
|
|||||||
def on_update(self):
|
def on_update(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# Repair Outstanding
|
|
||||||
#######################################################################
|
|
||||||
def repair_pv_outstanding(self):
|
|
||||||
get_obj(dt = 'GL Control').repair_voucher_outstanding(self)
|
|
||||||
|
@ -79,7 +79,7 @@ cur_frm.cscript.hide_fields = function(doc, cdt, cdn) {
|
|||||||
'source', 'cancel_reason', 'total_advance', 'gross_profit',
|
'source', 'cancel_reason', 'total_advance', 'gross_profit',
|
||||||
'gross_profit_percent', 'get_advances_received',
|
'gross_profit_percent', 'get_advances_received',
|
||||||
'advance_adjustment_details', 'sales_partner', 'commission_rate',
|
'advance_adjustment_details', 'sales_partner', 'commission_rate',
|
||||||
'total_commission', 'repair_outstanding_amt'];
|
'total_commission'];
|
||||||
|
|
||||||
item_flds_normal = ['sales_order', 'delivery_note']
|
item_flds_normal = ['sales_order', 'delivery_note']
|
||||||
item_flds_pos = ['warehouse', 'serial_no', 'batch_no', 'actual_qty', 'delivered_qty']
|
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) {
|
if(doc.docstatus==1) {
|
||||||
cur_frm.add_custom_button('View Ledger', cur_frm.cscript.view_ledger_entry);
|
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);
|
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)
|
if(doc.is_pos==1 && doc.update_stock!=1)
|
||||||
cur_frm.add_custom_button('Make Delivery', cur_frm.cscript['Make Delivery Note']);
|
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)
|
if(doc.outstanding_amount!=0)
|
||||||
cur_frm.add_custom_button('Make Payment Entry', cur_frm.cscript.make_bank_voucher);
|
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
|
//fetch retail transaction related fields
|
||||||
|
@ -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))
|
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):
|
def on_update_after_submit(self):
|
||||||
self.convert_into_recurring()
|
self.convert_into_recurring()
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
# These values are common in all dictionaries
|
# These values are common in all dictionaries
|
||||||
{
|
{
|
||||||
'creation': '2012-03-27 14:35:47',
|
'creation': '2012-04-11 13:17:25',
|
||||||
'docstatus': 0,
|
'docstatus': 0,
|
||||||
'modified': '2012-03-27 18:44:28',
|
'modified': '2012-04-13 11:26:44',
|
||||||
'modified_by': u'Administrator',
|
'modified_by': u'Administrator',
|
||||||
'owner': u'Administrator'
|
'owner': u'Administrator'
|
||||||
},
|
},
|
||||||
@ -13,6 +13,7 @@
|
|||||||
# These values are common for all DocType
|
# These values are common for all DocType
|
||||||
{
|
{
|
||||||
'_last_update': u'1330671142',
|
'_last_update': u'1330671142',
|
||||||
|
'allow_attach': 1,
|
||||||
'change_log': u'1. Change in pull_details method dt.-26-06-2009',
|
'change_log': u'1. Change in pull_details method dt.-26-06-2009',
|
||||||
'colour': u'White:FFF',
|
'colour': u'White:FFF',
|
||||||
'default_print_format': u'Standard',
|
'default_print_format': u'Standard',
|
||||||
@ -26,7 +27,7 @@
|
|||||||
'server_code_error': u' ',
|
'server_code_error': u' ',
|
||||||
'show_in_menu': 0,
|
'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',
|
'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
|
# These values are common for all DocField
|
||||||
@ -54,6 +55,30 @@
|
|||||||
'name': u'Sales Invoice'
|
'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
|
# DocPerm
|
||||||
{
|
{
|
||||||
'amend': 1,
|
'amend': 1,
|
||||||
@ -80,38 +105,10 @@
|
|||||||
|
|
||||||
# DocPerm
|
# DocPerm
|
||||||
{
|
{
|
||||||
'amend': 0,
|
|
||||||
'cancel': 0,
|
|
||||||
'create': 0,
|
|
||||||
'doctype': u'DocPerm',
|
'doctype': u'DocPerm',
|
||||||
|
'match': u'customer',
|
||||||
'permlevel': 0,
|
'permlevel': 0,
|
||||||
'role': u'Customer',
|
'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
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
@ -1503,14 +1500,13 @@
|
|||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
'allow_on_submit': 1,
|
|
||||||
'doctype': u'DocField',
|
'doctype': u'DocField',
|
||||||
'fieldname': u'repair_outstanding_amt',
|
'fieldname': u'file_list',
|
||||||
'fieldtype': u'Button',
|
'fieldtype': u'Text',
|
||||||
'label': u'Repair Outstanding Amt',
|
'hidden': 1,
|
||||||
'oldfieldtype': u'Button',
|
'label': u'File List',
|
||||||
'options': u'repair_rv_outstanding',
|
'no_copy': 1,
|
||||||
'permlevel': 0,
|
'permlevel': 0,
|
||||||
'print_hide': 1
|
'print_hide': 1
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -1,19 +1,22 @@
|
|||||||
<div class="layout-wrapper layout-wrapper-background">
|
<div class="layout-wrapper layout-wrapper-background">
|
||||||
|
<div class="appframe-area"></div>
|
||||||
<div class="layout-main-section">
|
<div class="layout-main-section">
|
||||||
<a class="close" onclick="window.history.back();">×</a>
|
|
||||||
<h1>Accounts</h1>
|
<h1>Accounts</h1>
|
||||||
<hr>
|
<hr>
|
||||||
<div style="width: 48%; float: left;">
|
<div style="width: 48%; float: left;">
|
||||||
<h4><a href="#!List/Journal Voucher">Journal Voucher</a></h4>
|
<h4><a href="#!List/Journal Voucher">Journal Voucher</a></h4>
|
||||||
<p class="help">General Ledger Entries</p>
|
<p class="help">General Ledger Entries</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Sales Invoice">Sales Invoice</a></h4>
|
<h4><a href="#!List/Sales Invoice">Sales Invoice</a></h4>
|
||||||
<p class="help">Bills raised to Customers</p>
|
<p class="help">Bills raised to Customers</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Purchase Invoice">Purchase Invoice</a></h4>
|
<h4><a href="#!List/Purchase Invoice">Purchase Invoice</a></h4>
|
||||||
<p class="help">Bills raised by Suppliers</p>
|
<p class="help">Bills raised by Suppliers</p>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 48%; float: right;">
|
<div style="width: 48%; float: right;">
|
||||||
<h4><a href="#!Accounts Browser/Account">Chart of Accounts</a></h4>
|
<h4><a href="#!Accounts Browser/Account">Chart of Accounts</a></h4>
|
||||||
<p class="help">Structure of books of accounts</p>
|
<p class="help">Structure of books of accounts</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!Accounts Browser/Cost Center">Chart of Cost Centers</a></h4>
|
<h4><a href="#!Accounts Browser/Cost Center">Chart of Cost Centers</a></h4>
|
||||||
<p class="help">Structure cost centers</p>
|
<p class="help">Structure cost centers</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
pscript['onload_accounts-home'] = function(wrapper) {
|
pscript['onload_accounts-home'] = function(wrapper) {
|
||||||
erpnext.module_page.setup_page('Accounts', wrapper);
|
erpnext.module_page.setup_page('Accounts', wrapper);
|
||||||
|
wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area'));
|
||||||
|
|
||||||
if(wn.control_panel.country!='India') {
|
if(wn.control_panel.country!='India') {
|
||||||
$('.india-specific').toggle(false);
|
$('.india-specific').toggle(false);
|
||||||
}
|
}
|
||||||
|
@ -60,13 +60,13 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
|||||||
}
|
}
|
||||||
if(!is_closed) {
|
if(!is_closed) {
|
||||||
cur_frm.add_custom_button('Make Purchase Order', cur_frm.cscript['Make Purchase Order'])
|
cur_frm.add_custom_button('Make Purchase Order', cur_frm.cscript['Make Purchase Order'])
|
||||||
cur_frm.add_custom_button('Stop Purchase Request', cur_frm.cscript['Stop Purchase Requisition'])
|
cur_frm.add_custom_button('Stop Purchase Request', cur_frm.cscript['Stop Purchase Request'])
|
||||||
}
|
}
|
||||||
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
|
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doc.docstatus == 1 && doc.status == 'Stopped')
|
if(doc.docstatus == 1 && doc.status == 'Stopped')
|
||||||
cur_frm.add_custom_button('Unstop Purchase Request', cur_frm.cscript['Unstop Purchase Requisition'])
|
cur_frm.add_custom_button('Unstop Purchase Request', cur_frm.cscript['Unstop Purchase Request'])
|
||||||
}
|
}
|
||||||
|
|
||||||
//======================= validation ===================================
|
//======================= validation ===================================
|
||||||
@ -108,7 +108,7 @@ cur_frm.cscript['Make Purchase Order'] = function() {
|
|||||||
|
|
||||||
// Stop INDENT
|
// Stop INDENT
|
||||||
// ==================================================================================================
|
// ==================================================================================================
|
||||||
cur_frm.cscript['Stop Purchase Requisition'] = function() {
|
cur_frm.cscript['Stop Purchase Request'] = function() {
|
||||||
var doc = cur_frm.doc;
|
var doc = cur_frm.doc;
|
||||||
var check = confirm("Do you really want to STOP this Purchase Request?");
|
var check = confirm("Do you really want to STOP this Purchase Request?");
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ cur_frm.cscript['Stop Purchase Requisition'] = function() {
|
|||||||
|
|
||||||
// Un Stop INDENT
|
// Un Stop INDENT
|
||||||
//====================================================================================================
|
//====================================================================================================
|
||||||
cur_frm.cscript['Unstop Purchase Requisition'] = function(){
|
cur_frm.cscript['Unstop Purchase Request'] = function(){
|
||||||
var doc = cur_frm.doc
|
var doc = cur_frm.doc
|
||||||
var check = confirm("Do you really want to UNSTOP this Purchase Request?");
|
var check = confirm("Do you really want to UNSTOP this Purchase Request?");
|
||||||
|
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
<div class="layout-wrapper layout-wrapper-background">
|
<div class="layout-wrapper layout-wrapper-background">
|
||||||
|
<div class="appframe-area"></div>
|
||||||
<div class="layout-main-section">
|
<div class="layout-main-section">
|
||||||
<a class="close" onclick="window.history.back();">×</a>
|
|
||||||
<h1>Buying</h1>
|
<h1>Buying</h1>
|
||||||
<hr>
|
<hr>
|
||||||
<div style="width: 48%; float: left;">
|
<div style="width: 48%; float: left;">
|
||||||
<h4><a href="#!List/Purchase Request">Purchase Request</a></h4>
|
<h4><a href="#!List/Purchase Request">Purchase Request</a></h4>
|
||||||
<p class="help">Request for purchase</p>
|
<p class="help">Request for purchase</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Purchase Order">Purchase Order</a></h4>
|
<h4><a href="#!List/Purchase Order">Purchase Order</a></h4>
|
||||||
<p class="help">Purchase Orders given to Suppliers</p>
|
<p class="help">Purchase Orders given to Suppliers</p>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 48%; float: right;">
|
<div style="width: 48%; float: right;">
|
||||||
<h4><a href="#!List/Supplier">Supplier</a></h4>
|
<h4><a href="#!List/Supplier">Supplier</a></h4>
|
||||||
<p class="help">Supplier Master</p>
|
<p class="help">Supplier Master</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Item">Item</a></h4>
|
<h4><a href="#!List/Item">Item</a></h4>
|
||||||
<p class="help">Item Master</p>
|
<p class="help">Item Master</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,5 +15,6 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
pscript['onload_buying-home'] = function(wrapper) {
|
pscript['onload_buying-home'] = function(wrapper) {
|
||||||
|
wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area'));
|
||||||
erpnext.module_page.setup_page('Buying', wrapper);
|
erpnext.module_page.setup_page('Buying', wrapper);
|
||||||
}
|
}
|
@ -1,17 +1,21 @@
|
|||||||
<div class="layout-wrapper layout-wrapper-background">
|
<div class="layout-wrapper layout-wrapper-background">
|
||||||
|
<div class="appframe-area"></div>
|
||||||
<div class="layout-main-section">
|
<div class="layout-main-section">
|
||||||
<a class="close" onclick="window.history.back();">×</a>
|
|
||||||
<h1>Human Resources</h1>
|
<h1>Human Resources</h1>
|
||||||
<hr>
|
<hr>
|
||||||
<div style="width: 48%; float: left;">
|
<div style="width: 48%; float: left;">
|
||||||
<h4><a href="#!List/Attendance">Attendance</a></h4>
|
<h4><a href="#!List/Attendance">Attendance</a></h4>
|
||||||
<p class="help">Attendance Mark</p>
|
<p class="help">Attendance Mark</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Leave Application">Leave Application</a></h4>
|
<h4><a href="#!List/Leave Application">Leave Application</a></h4>
|
||||||
<p class="help">Applications for leave</p>
|
<p class="help">Applications for leave</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Expense Claim">Expense Claim</a></h4>
|
<h4><a href="#!List/Expense Claim">Expense Claim</a></h4>
|
||||||
<p class="help">Claims for expenses</p>
|
<p class="help">Claims for expenses</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Salary Slip">Salary Slip</a></h4>
|
<h4><a href="#!List/Salary Slip">Salary Slip</a></h4>
|
||||||
<p class="help">Monthly salary statement</p>
|
<p class="help">Monthly salary statement</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Appraisal">Appraisal</a></h4>
|
<h4><a href="#!List/Appraisal">Appraisal</a></h4>
|
||||||
<p class="help">Performance appraisal</p>
|
<p class="help">Performance appraisal</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,5 +15,6 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
pscript['onload_hr-home'] = function(wrapper) {
|
pscript['onload_hr-home'] = function(wrapper) {
|
||||||
|
wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area'));
|
||||||
erpnext.module_page.setup_page('HR', wrapper);
|
erpnext.module_page.setup_page('HR', wrapper);
|
||||||
}
|
}
|
@ -1,17 +1,19 @@
|
|||||||
<div class="layout-wrapper layout-wrapper-background">
|
<div class="layout-wrapper layout-wrapper-background">
|
||||||
|
<div class="appframe-area"></div>
|
||||||
<div class="layout-main-section">
|
<div class="layout-main-section">
|
||||||
<a class="close" onclick="window.history.back();">×</a>
|
|
||||||
<h1>Production</h1>
|
<h1>Production</h1>
|
||||||
<hr>
|
<hr>
|
||||||
<div style="width: 48%; float: left;">
|
<div style="width: 48%; float: left;">
|
||||||
<h4><a href="#!List/Production Order">Production Order</a></h4>
|
<h4><a href="#!List/Production Order">Production Order</a></h4>
|
||||||
<p class="help">Orders for manufacturing</p>
|
<p class="help">Orders for manufacturing</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!Form/Production Planning Tool/Production Planning Tool">Production Plan</a></h4>
|
<h4><a href="#!Form/Production Planning Tool/Production Planning Tool">Production Plan</a></h4>
|
||||||
<p class="help">Generate Purchase Requisition (MRP) and Production Orders</p>
|
<p class="help">Generate Purchase Requisition (MRP) and Production Orders</p>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 48%; float: right;">
|
<div style="width: 48%; float: right;">
|
||||||
<h4><a href="#!List/BOM">Bill of Materials</a></h4>
|
<h4><a href="#!List/BOM">Bill of Materials</a></h4>
|
||||||
<p class="help">Bill of Materials (BOM) Master</p>
|
<p class="help">Bill of Materials (BOM) Master</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Item">Item</a></h4>
|
<h4><a href="#!List/Item">Item</a></h4>
|
||||||
<p class="help">Item Master</p>
|
<p class="help">Item Master</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,5 +15,6 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
pscript['onload_production-home'] = function(wrapper) {
|
pscript['onload_production-home'] = function(wrapper) {
|
||||||
|
wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area'));
|
||||||
erpnext.module_page.setup_page('Production', wrapper);
|
erpnext.module_page.setup_page('Production', wrapper);
|
||||||
}
|
}
|
@ -1,13 +1,15 @@
|
|||||||
<div class="layout-wrapper layout-wrapper-background">
|
<div class="layout-wrapper layout-wrapper-background">
|
||||||
|
<div class="appframe-area"></div>
|
||||||
<div class="layout-main-section">
|
<div class="layout-main-section">
|
||||||
<a class="close" onclick="window.history.back();">×</a>
|
|
||||||
<h1>Projects</h1>
|
<h1>Projects</h1>
|
||||||
<hr>
|
<hr>
|
||||||
<div style="width: 48%; float: left;">
|
<div style="width: 48%; float: left;">
|
||||||
<h4><a href="#!List/Project">Project</a></h4>
|
<h4><a href="#!List/Project">Project</a></h4>
|
||||||
<p class="help">Project master</p>
|
<p class="help">Project master</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Task">Task</a></h4>
|
<h4><a href="#!List/Task">Task</a></h4>
|
||||||
<p class="help">Project activity / task</p>
|
<p class="help">Project activity / task</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Timesheet">Timesheet</a></h4>
|
<h4><a href="#!List/Timesheet">Timesheet</a></h4>
|
||||||
<p class="help">Timesheet for tasks</p>
|
<p class="help">Timesheet for tasks</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,5 +15,6 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
pscript['onload_projects-home'] = function(wrapper) {
|
pscript['onload_projects-home'] = function(wrapper) {
|
||||||
|
wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area'));
|
||||||
erpnext.module_page.setup_page('Projects', wrapper);
|
erpnext.module_page.setup_page('Projects', wrapper);
|
||||||
}
|
}
|
@ -77,7 +77,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
|||||||
|
|
||||||
// indent
|
// indent
|
||||||
if(doc.order_type != 'Maintenance')
|
if(doc.order_type != 'Maintenance')
|
||||||
cur_frm.add_custom_button('Make ' + get_doctype_label('Purchase Request'), cur_frm.cscript['Make Purchase Requisition']);
|
cur_frm.add_custom_button('Make ' + get_doctype_label('Purchase Request'), cur_frm.cscript['Make Purchase Request']);
|
||||||
|
|
||||||
// sales invoice
|
// sales invoice
|
||||||
if(doc.per_billed < 100)
|
if(doc.per_billed < 100)
|
||||||
@ -92,9 +92,9 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
|||||||
cur_frm.add_custom_button('Unstop', cur_frm.cscript['Unstop Sales Order']);
|
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 {
|
} else {
|
||||||
hide_field(['repair_sales_order', 'Send SMS', 'message', 'customer_mobile_no'])
|
hide_field(['Send SMS', 'message', 'customer_mobile_no'])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ cur_frm.cscript.make_maintenance_visit = function() {
|
|||||||
|
|
||||||
// make indent
|
// make indent
|
||||||
// ================================================================================================
|
// ================================================================================================
|
||||||
cur_frm.cscript['Make Purchase Requisition'] = function() {
|
cur_frm.cscript['Make Purchase Request'] = function() {
|
||||||
var doc = cur_frm.doc;
|
var doc = cur_frm.doc;
|
||||||
if (doc.docstatus == 1) {
|
if (doc.docstatus == 1) {
|
||||||
n = createLocal("Purchase Request");
|
n = createLocal("Purchase Request");
|
||||||
|
@ -509,7 +509,3 @@ class DocType(TransactionBase):
|
|||||||
def on_update(self):
|
def on_update(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Repair Sales Order
|
|
||||||
# ===========================================
|
|
||||||
def repair_sales_order(self):
|
|
||||||
get_obj('Sales Common', 'Sales Common').repair_curr_doctype_details(self)
|
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
# These values are common in all dictionaries
|
# These values are common in all dictionaries
|
||||||
{
|
{
|
||||||
'creation': '2012-03-27 14:36:14',
|
'creation': '2012-04-11 13:18:19',
|
||||||
'docstatus': 0,
|
'docstatus': 0,
|
||||||
'modified': '2012-03-27 18:49:05',
|
'modified': '2012-04-13 11:32:08',
|
||||||
'modified_by': u'Administrator',
|
'modified_by': u'Administrator',
|
||||||
'owner': u'Administrator'
|
'owner': u'Administrator'
|
||||||
},
|
},
|
||||||
@ -13,7 +13,7 @@
|
|||||||
# These values are common for all DocType
|
# These values are common for all DocType
|
||||||
{
|
{
|
||||||
'_last_update': u'1330670942',
|
'_last_update': u'1330670942',
|
||||||
'allow_attach': 0,
|
'allow_attach': 1,
|
||||||
'colour': u'White:FFF',
|
'colour': u'White:FFF',
|
||||||
'default_print_format': u'Standard',
|
'default_print_format': u'Standard',
|
||||||
'doctype': 'DocType',
|
'doctype': 'DocType',
|
||||||
@ -30,7 +30,7 @@
|
|||||||
'show_in_menu': 0,
|
'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',
|
'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',
|
'tag_fields': u'delivery_status,billing_status',
|
||||||
'version': 632
|
'version': 633
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocField
|
# These values are common for all DocField
|
||||||
@ -58,6 +58,30 @@
|
|||||||
'name': u'Sales Order'
|
'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
|
# DocPerm
|
||||||
{
|
{
|
||||||
'amend': 1,
|
'amend': 1,
|
||||||
@ -70,18 +94,6 @@
|
|||||||
'write': 1
|
'write': 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
|
||||||
'amend': 1,
|
|
||||||
'cancel': 1,
|
|
||||||
'create': 1,
|
|
||||||
'doctype': u'DocPerm',
|
|
||||||
'permlevel': 0,
|
|
||||||
'role': u'Maintenance User',
|
|
||||||
'submit': 1,
|
|
||||||
'write': 1
|
|
||||||
},
|
|
||||||
|
|
||||||
# DocPerm
|
# DocPerm
|
||||||
{
|
{
|
||||||
'amend': 0,
|
'amend': 0,
|
||||||
@ -89,93 +101,63 @@
|
|||||||
'create': 0,
|
'create': 0,
|
||||||
'doctype': u'DocPerm',
|
'doctype': u'DocPerm',
|
||||||
'permlevel': 1,
|
'permlevel': 1,
|
||||||
'role': u'Maintenance Manager',
|
'role': u'Sales User',
|
||||||
'submit': 0,
|
'submit': 0,
|
||||||
'write': 0
|
'write': 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
# DocPerm
|
||||||
{
|
{
|
||||||
'amend': 1,
|
|
||||||
'cancel': 1,
|
|
||||||
'create': 1,
|
|
||||||
'doctype': u'DocPerm',
|
'doctype': u'DocPerm',
|
||||||
|
'match': u'customer_name',
|
||||||
'permlevel': 0,
|
'permlevel': 0,
|
||||||
'role': u'Maintenance Manager',
|
'role': u'Customer'
|
||||||
'submit': 1,
|
|
||||||
'write': 1
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
# 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',
|
'doctype': u'DocPerm',
|
||||||
'permlevel': 2,
|
'permlevel': 2,
|
||||||
'role': u'Accounts User',
|
'role': u'Accounts User',
|
||||||
'submit': 0,
|
|
||||||
'write': 1
|
'write': 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
# DocPerm
|
||||||
{
|
{
|
||||||
'amend': 0,
|
'amend': 1,
|
||||||
'cancel': 0,
|
'cancel': 1,
|
||||||
'create': 0,
|
'create': 1,
|
||||||
'doctype': u'DocPerm',
|
'doctype': u'DocPerm',
|
||||||
'permlevel': 0,
|
'permlevel': 0,
|
||||||
'role': u'Customer',
|
'role': u'Maintenance Manager',
|
||||||
'submit': 0,
|
'submit': 1,
|
||||||
'write': 0
|
'write': 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
# DocPerm
|
||||||
{
|
{
|
||||||
'amend': 0,
|
|
||||||
'cancel': 0,
|
|
||||||
'create': 0,
|
|
||||||
'doctype': u'DocPerm',
|
'doctype': u'DocPerm',
|
||||||
'permlevel': 1,
|
'permlevel': 1,
|
||||||
'role': u'Sales User',
|
'role': u'Maintenance Manager'
|
||||||
'submit': 0,
|
|
||||||
'write': 0
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
# DocPerm
|
||||||
{
|
{
|
||||||
'amend': 0,
|
'amend': 1,
|
||||||
'cancel': 0,
|
'cancel': 1,
|
||||||
'create': 0,
|
'create': 1,
|
||||||
'doctype': u'DocPerm',
|
'doctype': u'DocPerm',
|
||||||
'permlevel': 1,
|
'permlevel': 0,
|
||||||
'role': u'Maintenance User',
|
'role': u'Maintenance User',
|
||||||
'submit': 0,
|
'submit': 1,
|
||||||
'write': 0
|
'write': 1
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocPerm
|
||||||
|
{
|
||||||
|
'doctype': u'DocPerm',
|
||||||
|
'permlevel': 1,
|
||||||
|
'role': u'Maintenance User'
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
@ -1335,14 +1317,13 @@
|
|||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
'allow_on_submit': 1,
|
|
||||||
'doctype': u'DocField',
|
'doctype': u'DocField',
|
||||||
'fieldname': u'repair_sales_order',
|
'fieldname': u'file_list',
|
||||||
'fieldtype': u'Button',
|
'fieldtype': u'Text',
|
||||||
'label': u'Repair Sales Order',
|
'hidden': 1,
|
||||||
'oldfieldtype': u'Button',
|
'label': u'File List',
|
||||||
'options': u'repair_sales_order',
|
'no_copy': 1,
|
||||||
'permlevel': 0,
|
'permlevel': 0,
|
||||||
'print_hide': 1
|
'print_hide': 1
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -1,21 +1,25 @@
|
|||||||
<div class="layout-wrapper layout-wrapper-background">
|
<div class="layout-wrapper layout-wrapper-background">
|
||||||
|
<div class="appframe-area"></div>
|
||||||
<div class="layout-main-section">
|
<div class="layout-main-section">
|
||||||
<a class="close" onclick="window.history.back();">×</a>
|
|
||||||
<h1>Selling</h1>
|
<h1>Selling</h1>
|
||||||
<hr>
|
<hr>
|
||||||
<div style="width: 48%; float: left;">
|
<div style="width: 48%; float: left;">
|
||||||
<h4><a href="#!List/Lead">Lead</a></h4>
|
<h4><a href="#!List/Lead">Lead</a></h4>
|
||||||
<p class="help">Prospective customers</p>
|
<p class="help">Prospective customers</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Opportunity">Opportunity</a></h4>
|
<h4><a href="#!List/Opportunity">Opportunity</a></h4>
|
||||||
<p class="help">Business opportunities</p>
|
<p class="help">Business opportunities</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Quotation">Quotation</a></h4>
|
<h4><a href="#!List/Quotation">Quotation</a></h4>
|
||||||
<p class="help">Quotes sent to Leads / Customers</p>
|
<p class="help">Quotes sent to Leads / Customers</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Sales Order">Sales Order</a></h4>
|
<h4><a href="#!List/Sales Order">Sales Order</a></h4>
|
||||||
<p class="help">Confirmed orders from Customers</p>
|
<p class="help">Confirmed orders from Customers</p>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 48%; float: right;">
|
<div style="width: 48%; float: right;">
|
||||||
<h4><a href="#!List/Customer">Customer</a></h4>
|
<h4><a href="#!List/Customer">Customer</a></h4>
|
||||||
<p class="help">Customer Master</p>
|
<p class="help">Customer Master</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Item">Item</a></h4>
|
<h4><a href="#!List/Item">Item</a></h4>
|
||||||
<p class="help">Item Master</p>
|
<p class="help">Item Master</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,5 +15,6 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
pscript['onload_selling-home'] = function(wrapper) {
|
pscript['onload_selling-home'] = function(wrapper) {
|
||||||
|
wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area'));
|
||||||
erpnext.module_page.setup_page('Selling', wrapper);
|
erpnext.module_page.setup_page('Selling', wrapper);
|
||||||
}
|
}
|
@ -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.per_installed < 100 && doc.docstatus==1) cur_frm.add_custom_button('Make Installation Note', cur_frm.cscript['Make Installation Note']);
|
||||||
|
|
||||||
if (doc.docstatus!=1) {
|
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 {
|
} else {
|
||||||
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
|
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) {
|
if(doc.docstatus==0 && !doc.__islocal) {
|
||||||
|
@ -487,8 +487,4 @@ class DocType(TransactionBase):
|
|||||||
self.set_actual_qty()
|
self.set_actual_qty()
|
||||||
get_obj('Stock Ledger').scrub_serial_nos(self)
|
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)
|
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
# These values are common in all dictionaries
|
# These values are common in all dictionaries
|
||||||
{
|
{
|
||||||
'creation': '2012-03-27 14:36:28',
|
'creation': '2012-04-11 13:18:36',
|
||||||
'docstatus': 0,
|
'docstatus': 0,
|
||||||
'modified': '2012-03-27 18:50:57',
|
'modified': '2012-04-13 11:02:43',
|
||||||
'modified_by': u'Administrator',
|
'modified_by': u'Administrator',
|
||||||
'owner': u'Administrator'
|
'owner': u'Administrator'
|
||||||
},
|
},
|
||||||
@ -13,6 +13,7 @@
|
|||||||
# These values are common for all DocType
|
# These values are common for all DocType
|
||||||
{
|
{
|
||||||
'_last_update': u'1330593645',
|
'_last_update': u'1330593645',
|
||||||
|
'allow_attach': 1,
|
||||||
'colour': u'White:FFF',
|
'colour': u'White:FFF',
|
||||||
'default_print_format': u'Standard',
|
'default_print_format': u'Standard',
|
||||||
'doctype': 'DocType',
|
'doctype': 'DocType',
|
||||||
@ -29,7 +30,7 @@
|
|||||||
'show_in_menu': 0,
|
'show_in_menu': 0,
|
||||||
'subject': u'To %(customer_name)s on %(posting_date)s | %(per_billed)s% billed',
|
'subject': u'To %(customer_name)s on %(posting_date)s | %(per_billed)s% billed',
|
||||||
'tag_fields': u'billing_status',
|
'tag_fields': u'billing_status',
|
||||||
'version': 476
|
'version': 477
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocField
|
# These values are common for all DocField
|
||||||
@ -57,6 +58,78 @@
|
|||||||
'name': u'Delivery Note'
|
'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
|
# DocPerm
|
||||||
{
|
{
|
||||||
'cancel': 0,
|
'cancel': 0,
|
||||||
@ -75,30 +148,6 @@
|
|||||||
'role': u'Accounts User'
|
'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
|
# DocPerm
|
||||||
{
|
{
|
||||||
'doctype': u'DocPerm',
|
'doctype': u'DocPerm',
|
||||||
@ -115,54 +164,6 @@
|
|||||||
'write': 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'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
|
# DocField
|
||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
'colour': u'White:FFF',
|
||||||
@ -1368,14 +1369,13 @@
|
|||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
'allow_on_submit': 1,
|
|
||||||
'doctype': u'DocField',
|
'doctype': u'DocField',
|
||||||
'fieldname': u'repair_delivery_note',
|
'fieldname': u'file_list',
|
||||||
'fieldtype': u'Button',
|
'fieldtype': u'Text',
|
||||||
'label': u'Repair Delivery Note',
|
'hidden': 1,
|
||||||
'oldfieldtype': u'Button',
|
'label': u'File List',
|
||||||
'options': u'repair_delivery_note',
|
'no_copy': 1,
|
||||||
'permlevel': 0,
|
'permlevel': 0,
|
||||||
'print_hide': 1
|
'print_hide': 1
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -26,8 +26,8 @@ var cfn_set_fields = function(doc, cdt, cdn) {
|
|||||||
hide_field(lst);
|
hide_field(lst);
|
||||||
|
|
||||||
if (doc.purpose == 'Production Order' || doc.purpose == 'Other'){
|
if (doc.purpose == 'Production Order' || doc.purpose == 'Other'){
|
||||||
unhide_field('Get Items');
|
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']);
|
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']);
|
if (doc.purpose=='Production Order') unhide_field(['production_order', 'process']);
|
||||||
|
|
||||||
doc.from_warehouse = '';
|
doc.from_warehouse = '';
|
||||||
@ -42,7 +42,7 @@ var cfn_set_fields = function(doc, cdt, cdn) {
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
unhide_field(['from_warehouse', 'to_warehouse']);
|
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.production_order = '';
|
||||||
doc.process = '';
|
doc.process = '';
|
||||||
doc.fg_completed_qty = 0;
|
doc.fg_completed_qty = 0;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
cur_frm.cscript.refresh = function(doc) {
|
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) {
|
cur_frm.cscript.download_template = function(doc, cdt, cdn) {
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
# These values are common in all dictionaries
|
# These values are common in all dictionaries
|
||||||
{
|
{
|
||||||
'creation': '2012-03-27 14:36:40',
|
'creation': '2012-04-11 13:18:57',
|
||||||
'docstatus': 0,
|
'docstatus': 0,
|
||||||
'modified': '2012-03-27 14:36:40',
|
'modified': '2012-04-11 17:47:35',
|
||||||
'modified_by': u'Administrator',
|
'modified_by': u'Administrator',
|
||||||
'owner': u'Administrator'
|
'owner': u'Administrator'
|
||||||
},
|
},
|
||||||
@ -25,7 +25,7 @@
|
|||||||
'section_style': u'Tabbed',
|
'section_style': u'Tabbed',
|
||||||
'server_code_error': u' ',
|
'server_code_error': u' ',
|
||||||
'show_in_menu': 0,
|
'show_in_menu': 0,
|
||||||
'version': 58
|
'version': 59
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocField
|
# These values are common for all DocField
|
||||||
@ -53,6 +53,78 @@
|
|||||||
'name': u'Warehouse'
|
'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
|
# DocPerm
|
||||||
{
|
{
|
||||||
'doctype': u'DocPerm',
|
'doctype': u'DocPerm',
|
||||||
@ -81,91 +153,19 @@
|
|||||||
|
|
||||||
# DocPerm
|
# DocPerm
|
||||||
{
|
{
|
||||||
'create': 0,
|
'cancel': 1,
|
||||||
|
'create': 1,
|
||||||
'doctype': u'DocPerm',
|
'doctype': u'DocPerm',
|
||||||
'permlevel': 2,
|
'permlevel': 0,
|
||||||
'role': u'System Manager',
|
'role': u'System Manager',
|
||||||
'write': 1
|
'write': 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
# 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,
|
'create': 0,
|
||||||
'doctype': u'DocPerm',
|
'doctype': u'DocPerm',
|
||||||
'permlevel': 2,
|
'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',
|
'role': u'System Manager',
|
||||||
'write': 1
|
'write': 1
|
||||||
},
|
},
|
||||||
@ -268,7 +268,7 @@
|
|||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
'doctype': u'DocField',
|
||||||
'fieldname': u'phone_no',
|
'fieldname': u'phone_no',
|
||||||
'fieldtype': u'Int',
|
'fieldtype': u'Data',
|
||||||
'label': u'Phone No',
|
'label': u'Phone No',
|
||||||
'oldfieldname': u'phone_no',
|
'oldfieldname': u'phone_no',
|
||||||
'oldfieldtype': u'Int',
|
'oldfieldtype': u'Int',
|
||||||
@ -280,7 +280,7 @@
|
|||||||
{
|
{
|
||||||
'doctype': u'DocField',
|
'doctype': u'DocField',
|
||||||
'fieldname': u'mobile_no',
|
'fieldname': u'mobile_no',
|
||||||
'fieldtype': u'Int',
|
'fieldtype': u'Data',
|
||||||
'label': u'Mobile No',
|
'label': u'Mobile No',
|
||||||
'oldfieldname': u'mobile_no',
|
'oldfieldname': u'mobile_no',
|
||||||
'oldfieldtype': u'Int',
|
'oldfieldtype': u'Int',
|
||||||
|
@ -1,23 +1,28 @@
|
|||||||
<div class="layout-wrapper layout-wrapper-background">
|
<div class="layout-wrapper layout-wrapper-background">
|
||||||
|
<div class="appframe-area"></div>
|
||||||
<div class="layout-main-section">
|
<div class="layout-main-section">
|
||||||
<a class="close" onclick="window.history.back();">×</a>
|
|
||||||
<h1>Stock</h1>
|
<h1>Stock</h1>
|
||||||
<hr>
|
<hr>
|
||||||
<div style="width: 48%; float: left;">
|
<div style="width: 48%; float: left;">
|
||||||
<h4><a href="#!List/Stock Entry">Stock Entry</a></h4>
|
<h4><a href="#!List/Stock Entry">Stock Entry</a></h4>
|
||||||
<p class="help">Transfer stock from one warehouse to another</p>
|
<p class="help">Transfer stock from one warehouse to another</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Delivery Note">Delivery Note</a></h4>
|
<h4><a href="#!List/Delivery Note">Delivery Note</a></h4>
|
||||||
<p class="help">Delivery (shipment) to customers</p>
|
<p class="help">Delivery (shipment) to customers</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Purchase Receipt">Purchase Receipt</a></h4>
|
<h4><a href="#!List/Purchase Receipt">Purchase Receipt</a></h4>
|
||||||
<p class="help">Goods received from Suppliers</p>
|
<p class="help">Goods received from Suppliers</p>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 48%; float: right;">
|
<div style="width: 48%; float: right;">
|
||||||
<h4><a href="#!List/Item">Item</a></h4>
|
<h4><a href="#!List/Item">Item</a></h4>
|
||||||
<p class="help">Item Master</p>
|
<p class="help">Item Master</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Serial No">Serial No</a></h4>
|
<h4><a href="#!List/Serial No">Serial No</a></h4>
|
||||||
<p class="help">Single unit of an Item</p>
|
<p class="help">Single unit of an Item</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Batch">Batch</a></h4>
|
<h4><a href="#!List/Batch">Batch</a></h4>
|
||||||
<p class="help">Batch of units of an Item</p>
|
<p class="help">Batch of units of an Item</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Warehouse">Warehouse</a></h4>
|
<h4><a href="#!List/Warehouse">Warehouse</a></h4>
|
||||||
<p class="help">Warehouse is where items are stored</p>
|
<p class="help">Warehouse is where items are stored</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,5 +15,6 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
pscript['onload_stock-home'] = function(wrapper) {
|
pscript['onload_stock-home'] = function(wrapper) {
|
||||||
|
wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area'));
|
||||||
erpnext.module_page.setup_page('Stock', wrapper);
|
erpnext.module_page.setup_page('Stock', wrapper);
|
||||||
}
|
}
|
@ -22,8 +22,8 @@ cur_frm.cscript.onload = function(doc,cdt,cdn){
|
|||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.refresh = function(doc,ct,cdn){
|
cur_frm.cscript.refresh = function(doc,ct,cdn){
|
||||||
if(!doc.docstatus) hide_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');
|
else if(doc.docstatus && (doc.status == 'Open' || doc.status == 'Work In Progress')) unhide_field('make_maintenance_visit');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,15 +1,18 @@
|
|||||||
<div class="layout-wrapper layout-wrapper-background">
|
<div class="layout-wrapper layout-wrapper-background">
|
||||||
|
<div class="appframe-area"></div>
|
||||||
<div class="layout-main-section">
|
<div class="layout-main-section">
|
||||||
<a class="close" onclick="window.history.back();">×</a>
|
|
||||||
<h1>Support</h1>
|
<h1>Support</h1>
|
||||||
<hr>
|
<hr>
|
||||||
<div style="width: 48%; float: left;">
|
<div style="width: 48%; float: left;">
|
||||||
<h4><a href="#!List/Support Ticket">Support Ticket</a></h4>
|
<h4><a href="#!List/Support Ticket">Support Ticket</a></h4>
|
||||||
<p class="help">Support queries from customers via email or website</p>
|
<p class="help">Support queries from customers via email or website</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Customer Issue">Customer Issue</a></h4>
|
<h4><a href="#!List/Customer Issue">Customer Issue</a></h4>
|
||||||
<p class="help">Customer Issue against a Serial No (warranty)</p>
|
<p class="help">Customer Issue against a Serial No (warranty)</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Maintenance Schedule">Maintenance Schedule</a></h4>
|
<h4><a href="#!List/Maintenance Schedule">Maintenance Schedule</a></h4>
|
||||||
<p class="help">Plan for scheduled maintenance contracts</p>
|
<p class="help">Plan for scheduled maintenance contracts</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Maintenance Visit">Maintenance Visit</a></h4>
|
<h4><a href="#!List/Maintenance Visit">Maintenance Visit</a></h4>
|
||||||
<p class="help">Visit report for maintenance visit</p>
|
<p class="help">Visit report for maintenance visit</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,5 +15,6 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
pscript['onload_support-home'] = function(wrapper) {
|
pscript['onload_support-home'] = function(wrapper) {
|
||||||
|
wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area'));
|
||||||
erpnext.module_page.setup_page('Support', wrapper);
|
erpnext.module_page.setup_page('Support', wrapper);
|
||||||
}
|
}
|
@ -1,25 +1,25 @@
|
|||||||
<div class="layout-wrapper layout-wrapper-background">
|
<div class="layout-wrapper layout-wrapper-background">
|
||||||
|
<div class="appframe-area"></div>
|
||||||
<div class="layout-main-section">
|
<div class="layout-main-section">
|
||||||
<a class="close" onclick="window.history.back();">×</a>
|
|
||||||
<h1>Website</h1>
|
<h1>Website</h1>
|
||||||
<hr>
|
<hr>
|
||||||
<div style="width: 48%; float: left;">
|
<div style="width: 48%; float: left;">
|
||||||
<h4><a href="#!List/Web Page">Web Page</a></h4>
|
<h4><a href="#!List/Web Page">Web Page</a></h4>
|
||||||
<p class="help">Static (content) web page</p>
|
<p class="help">Static (content) web page</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Product">Product</a></h4>
|
<h4><a href="#!List/Product">Product</a></h4>
|
||||||
<p class="help">Product listed in catolog</p>
|
<p class="help">Product listed in catolog</p>
|
||||||
|
<br>
|
||||||
<h4><a href="#!List/Blog">Blog</a></h4>
|
<h4><a href="#!List/Blog">Blog</a></h4>
|
||||||
<p class="help">Weblog (blog) entry</p>
|
<p class="help">Weblog (blog) entry</p>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 48%; float: right;">
|
<div style="width: 48%; float: right;">
|
||||||
<h4><a href="#!Form/Website Settings/Website Settings">Website Settings</a></h4>
|
<h4><a href="#!Form/Website Settings/Website Settings">Website Settings</a></h4>
|
||||||
<p class="help">Setup of top navigation bar, footer and logo</p>
|
<p class="help">Setup of top navigation bar, footer and logo</p>
|
||||||
</div>
|
<br>
|
||||||
<div style="width: 48%; float: right;">
|
|
||||||
<h4><a href="#!Form/Style Settings/Style Settings">Style Settings</a></h4>
|
<h4><a href="#!Form/Style Settings/Style Settings">Style Settings</a></h4>
|
||||||
<p class="help">Setup of fonts and background</p>
|
<p class="help">Setup of fonts and background</p>
|
||||||
</div>
|
<br>
|
||||||
<div style="width: 48%; float: right;">
|
|
||||||
<h4><a href="#!Form/Products Settings/Products Settings">Products Settings</a></h4>
|
<h4><a href="#!Form/Products Settings/Products Settings">Products Settings</a></h4>
|
||||||
<p class="help">Setup product categories</p>
|
<p class="help">Setup product categories</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,5 +15,6 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
pscript['onload_website-home'] = function(wrapper) {
|
pscript['onload_website-home'] = function(wrapper) {
|
||||||
|
wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area'));
|
||||||
erpnext.module_page.setup_page('Website', wrapper);
|
erpnext.module_page.setup_page('Website', wrapper);
|
||||||
}
|
}
|
@ -263,13 +263,7 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
|
|||||||
</div>\
|
</div>\
|
||||||
\
|
\
|
||||||
<div style="height: 37px; margin-bottom:9px" class="list-toolbar-wrapper">\
|
<div style="height: 37px; margin-bottom:9px" class="list-toolbar-wrapper">\
|
||||||
<div class="list-toolbar btn-group" style="display:inline-block; margin-right: 10px;">\
|
<div class="list-toolbar" style="display:inline-block; margin-right: 10px;">\
|
||||||
<a class="btn btn-small btn-refresh btn-info">\
|
|
||||||
<i class="icon-refresh icon-white"></i> Refresh</a>\
|
|
||||||
<a class="btn btn-small btn-new">\
|
|
||||||
<i class="icon-plus"></i> New</a>\
|
|
||||||
<a class="btn btn-small btn-filter">\
|
|
||||||
<i class="icon-search"></i> Filter</a>\
|
|
||||||
</div>\
|
</div>\
|
||||||
<div style="display:inline-block; width: 24px; margin-left: 4px">\
|
<div style="display:inline-block; width: 24px; margin-left: 4px">\
|
||||||
<img src="lib/images/ui/button-load.gif" \
|
<img src="lib/images/ui/button-load.gif" \
|
||||||
@ -289,11 +283,13 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
|
|||||||
<button class="btn btn-small btn-more hide">More...</div>\
|
<button class="btn btn-small btn-more hide">More...</div>\
|
||||||
</div>\
|
</div>\
|
||||||
</div>\
|
</div>\
|
||||||
',this.opts));this.$w=$(this.parent).find('.wnlist');this.set_events();if(this.show_filters){this.make_filters();}},add_button:function(html,onclick,before){$(html).click(onclick).insertBefore(this.$w.find('.list-toolbar '+before));this.btn_groupify();},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-refresh').click(function(){me.run();});this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
|
',this.opts));this.$w=$(this.parent).find('.wnlist');this.set_events();if(this.appframe){this.$w.find('.list-toolbar-wrapper').toggle(false);}
|
||||||
if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype);})}else{this.$w.find('.btn-new').remove();}
|
if(this.show_filters){this.make_filters();}},add_button:function(label,click,icon){if(this.appframe){return this.appframe.add_button(label,click,icon)}else{$button=$('<button class="btn btn-small"></button>').appendTo(this.$w.find('.list-toolbar'))
|
||||||
if(!me.show_filters){this.$w.find('.btn-filter').remove();}
|
if(icon){$('<i>').addClass(icon).appendTo($button);}
|
||||||
if(this.hide_refresh||this.no_refresh){this.$w.find('.btn-refresh').remove();}
|
$button.html(label).click(click);return $button}},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
|
||||||
this.btn_groupify();},btn_groupify:function(){var nbtns=this.$w.find('.list-toolbar a').length;if(nbtns==0){this.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
|
if(!(this.hide_refresh||this.no_refresh)){this.add_button('Refresh',function(){me.run();},'icon-refresh');}
|
||||||
|
if(this.new_doctype){this.add_button('New '+this.new_doctype,function(){newdoc(me.new_doctype)},'icon-plus');}
|
||||||
|
if(me.show_filters){this.add_button('Show Filters',function(){me.filter_list.show_filters();},'icon-search').addClass('btn-filter');}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
|
||||||
this.onrun=a0;if(a0&&a0.callback)
|
this.onrun=a0;if(a0&&a0.callback)
|
||||||
this.onrun=a0.callback;if(!a1&&!(a0&&a0.append))
|
this.onrun=a0.callback;if(!a1&&!(a0&&a0.append))
|
||||||
this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
|
this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
|
||||||
@ -304,8 +300,8 @@ if(this.get_args){$.extend(args,this.get_args());}
|
|||||||
return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}}
|
return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}}
|
||||||
if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i<m;i++){this.render_row(this.add_row(),values[i],this,i);}
|
if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i<m;i++){this.render_row(this.add_row(),values[i],this,i);}
|
||||||
this.start+=m;if(values.length>=this.page_length)
|
this.start+=m;if(values.length>=this.page_length)
|
||||||
this.$w.find('.btn-more').toggle(true);},add_row:function(){return this.$w.find('.result-list').append('<div class="list-row">').find('.list-row:last').get(0);},refresh:function(){this.run();},add_limits:function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}});wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.listobj.$w.find('.btn-filter').bind('click',function(){me.$w.find('.show_filters').slideToggle();if(!me.filters.length)
|
this.$w.find('.btn-more').toggle(true);},add_row:function(){return this.$w.find('.result-list').append('<div class="list-row">').find('.list-row:last').get(0);},refresh:function(){this.run();},add_limits:function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}});wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},show_filters:function(){this.$w.find('.show_filters').slideToggle();if(!this.filters.length)
|
||||||
me.add_filter();});this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').slideDown();}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
|
this.add_filter();},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').slideDown();}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
|
||||||
values.push(f.get_value());})
|
values.push(f.get_value());})
|
||||||
return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);})
|
return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);})
|
||||||
this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname)
|
this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname)
|
||||||
@ -374,7 +370,7 @@ wn.views.DocListView=wn.ui.Listing.extend({init:function(doctype,page){this.doct
|
|||||||
</div>\
|
</div>\
|
||||||
</div>\
|
</div>\
|
||||||
<div style="clear: both"></div>\
|
<div style="clear: both"></div>\
|
||||||
</div>',{label:this.label}));this.appframe=new wn.views.AppFrame(this.$page.find('.appframe-area'));wn.views.breadcrumbs($('<span>').appendTo(this.appframe.$titlebar),locals.DocType[this.doctype].module);},setup:function(){var me=this;me.can_delete=wn.model.can_delete(me.doctype);me.meta=locals.DocType[me.doctype];me.$page.find('.wnlist-area').empty(),me.setup_docstatus_filter();me.setup_listview();me.init_list();me.init_stats();me.add_delete_option();},setup_docstatus_filter:function(){var me=this;this.can_submit=$.map(locals.DocPerm,function(d){if(d.parent==me.meta.name&&d.submit)return 1
|
</div>',{label:this.label}));this.appframe=new wn.ui.AppFrame(this.$page.find('.appframe-area'));wn.views.breadcrumbs($('<span>').appendTo(this.appframe.$titlebar),locals.DocType[this.doctype].module);},setup:function(){var me=this;me.can_delete=wn.model.can_delete(me.doctype);me.meta=locals.DocType[me.doctype];me.$page.find('.wnlist-area').empty(),me.setup_docstatus_filter();me.setup_listview();me.init_list();me.init_stats();me.add_delete_option();},setup_docstatus_filter:function(){var me=this;this.can_submit=$.map(locals.DocPerm,function(d){if(d.parent==me.meta.name&&d.submit)return 1
|
||||||
else return null;}).length;if(this.can_submit){this.$page.find('.show-docstatus').removeClass('hide');this.$page.find('.show-docstatus input').click(function(){me.run();})}},setup_listview:function(){if(this.meta.__listjs){eval(this.meta.__listjs);this.listview=new wn.doclistviews[this.doctype](this);}else{this.listview=new wn.views.ListView(this);}
|
else return null;}).length;if(this.can_submit){this.$page.find('.show-docstatus').removeClass('hide');this.$page.find('.show-docstatus input').click(function(){me.run();})}},setup_listview:function(){if(this.meta.__listjs){eval(this.meta.__listjs);this.listview=new wn.doclistviews[this.doctype](this);}else{this.listview=new wn.views.ListView(this);}
|
||||||
this.listview.parent=this;},init_list:function(){this.make({method:'webnotes.widgets.doclistview.get',get_args:this.get_args,parent:this.$page.find('.wnlist-area'),start:0,page_length:20,show_filters:true,show_grid:true,new_doctype:this.doctype,allow_delete:true,no_result_message:this.make_no_result(),columns:this.listview.fields});this.run();},make_no_result:function(){return repl('<div class="well"><p>No %(doctype_label)s found</p>\
|
this.listview.parent=this;},init_list:function(){this.make({method:'webnotes.widgets.doclistview.get',get_args:this.get_args,parent:this.$page.find('.wnlist-area'),start:0,page_length:20,show_filters:true,show_grid:true,new_doctype:this.doctype,allow_delete:true,no_result_message:this.make_no_result(),columns:this.listview.fields});this.run();},make_no_result:function(){return repl('<div class="well"><p>No %(doctype_label)s found</p>\
|
||||||
%(description)s\
|
%(description)s\
|
||||||
@ -382,8 +378,7 @@ this.listview.parent=this;},init_list:function(){this.make({method:'webnotes.wid
|
|||||||
<p><button class="btn btn-info btn-small"\
|
<p><button class="btn btn-info btn-small"\
|
||||||
onclick="wn.set_route(\'Form\', \'%(doctype)s\', \'New %(doctype)s\');"\
|
onclick="wn.set_route(\'Form\', \'%(doctype)s\', \'New %(doctype)s\');"\
|
||||||
>Make a new %(doctype_label)s</button>\
|
>Make a new %(doctype_label)s</button>\
|
||||||
</p></div>',{doctype_label:get_doctype_label(this.doctype),doctype:this.doctype,description:wn.markdown(locals.DocType[this.doctype].description||'')});},render_row:function(row,data){data.doctype=this.doctype;this.listview.render(row,data,this);},get_query_fields:function(){return this.listview.fields;},get_args:function(){return{doctype:this.doctype,fields:this.get_query_fields(),filters:this.filter_list.get_filters(),docstatus:this.can_submit?$.map(this.$page.find('.show-docstatus :checked'),function(inp){return $(inp).attr('data-docstatus')}):[]}},add_delete_option:function(){var me=this;if(this.can_delete){this.add_button('<a class="btn btn-small btn-delete">\
|
</p></div>',{doctype_label:get_doctype_label(this.doctype),doctype:this.doctype,description:wn.markdown(locals.DocType[this.doctype].description||'')});},render_row:function(row,data){data.doctype=this.doctype;this.listview.render(row,data,this);},get_query_fields:function(){return this.listview.fields;},get_args:function(){return{doctype:this.doctype,fields:this.get_query_fields(),filters:this.filter_list.get_filters(),docstatus:this.can_submit?$.map(this.$page.find('.show-docstatus :checked'),function(inp){return $(inp).attr('data-docstatus')}):[]}},add_delete_option:function(){var me=this;if(this.can_delete){this.add_button('Delete',function(){me.delete_items();},'icon-remove')}},delete_items:function(){var me=this;var dl=$.map(me.$page.find('.list-delete:checked'),function(e){return $(e).data('name');});if(!dl.length)
|
||||||
<i class="icon-remove"></i> Delete</a>',function(){me.delete_items();},'.btn-filter')}},delete_items:function(){var me=this;var dl=$.map(me.$page.find('.list-delete:checked'),function(e){return $(e).data('name');});if(!dl.length)
|
|
||||||
return;if(!confirm('This is PERMANENT action and you cannot undo. Continue?')){return;}
|
return;if(!confirm('This is PERMANENT action and you cannot undo. Continue?')){return;}
|
||||||
me.set_working(true);wn.call({method:'webnotes.widgets.doclistview.delete_items',args:{items:dl,doctype:me.doctype},callback:function(){me.set_working(false);me.refresh();}})},init_stats:function(){var me=this
|
me.set_working(true);wn.call({method:'webnotes.widgets.doclistview.delete_items',args:{items:dl,doctype:me.doctype},callback:function(){me.set_working(false);me.refresh();}})},init_stats:function(){var me=this
|
||||||
wn.call({method:'webnotes.widgets.doclistview.get_stats',args:{stats:me.listview.stats,doctype:me.doctype},callback:function(r){$.each(me.listview.stats,function(i,v){me.render_stat(v,r.message[v]);});}});},render_stat:function(field,stat){var me=this;if(!stat||!stat.length){if(field=='_user_tags'){this.$page.find('.layout-side-section').append('<div class="stat-wrapper"><h4>Tags</h4>\
|
wn.call({method:'webnotes.widgets.doclistview.get_stats',args:{stats:me.listview.stats,doctype:me.doctype},callback:function(r){$.each(me.listview.stats,function(i,v){me.render_stat(v,r.message[v]);});}});},render_stat:function(field,stat){var me=this;if(!stat||!stat.length){if(field=='_user_tags'){this.$page.find('.layout-side-section').append('<div class="stat-wrapper"><h4>Tags</h4>\
|
||||||
@ -913,15 +908,15 @@ if(frm){f.frm=frm;if(parent)
|
|||||||
f.layout_cell=parent.parentNode;}
|
f.layout_cell=parent.parentNode;}
|
||||||
if(f.init)f.init();f.make_body();return f;}
|
if(f.init)f.init();f.make_body();return f;}
|
||||||
/*
|
/*
|
||||||
* lib/js/wn/views/appframe.js
|
* lib/js/wn/ui/appframe.js
|
||||||
*/
|
*/
|
||||||
wn.views.AppFrame=Class.extend({init:function(parent){this.buttons={};this.$w=$('<div></div>').appendTo(parent);this.$titlebar=$('<div class="appframe-titlebar">\
|
wn.ui.AppFrame=Class.extend({init:function(parent){this.buttons={};this.$w=$('<div></div>').appendTo(parent);this.$titlebar=$('<div class="appframe-titlebar">\
|
||||||
<span class="appframe-title"></span>\
|
<span class="appframe-title"></span>\
|
||||||
<span class="close">×</span>\
|
<span class="close">×</span>\
|
||||||
</div>').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();})},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length)
|
</div>').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();})},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length)
|
||||||
this.$w.append('<div class="appframe-toolbar"></div>');args={label:label,icon:''};if(icon){args.icon='<i class="'+icon+'"></i>';}
|
this.$w.append('<div class="appframe-toolbar"></div>');args={label:label,icon:''};if(icon){args.icon='<i class="'+icon+'"></i>';}
|
||||||
this.buttons[label]=$(repl('<button class="btn btn-small">\
|
this.buttons[label]=$(repl('<button class="btn btn-small">\
|
||||||
%(icon)s %(label)s</button>',args)).click(click).appendTo(this.$w.find('.appframe-toolbar'));},clear_buttons:function(){this.$w.find('.appframe-toolbar').empty();}})
|
%(icon)s %(label)s</button>',args)).click(click).appendTo(this.$w.find('.appframe-toolbar'));return this.buttons[label];},clear_buttons:function(){this.$w.find('.appframe-toolbar').empty();}})
|
||||||
/*
|
/*
|
||||||
* lib/js/wn/ui/dialog.js
|
* lib/js/wn/ui/dialog.js
|
||||||
*/
|
*/
|
||||||
@ -939,7 +934,7 @@ wn.widgets.Dialog=function(opts){this.opts=opts;this.display=false;this.make=fun
|
|||||||
this.opts=opts;if(!this.opts.width)this.opts.width=480;this.wrapper=$a(popup_cont,'div','dialog_wrapper');if(this.opts.width)
|
this.opts=opts;if(!this.opts.width)this.opts.width=480;this.wrapper=$a(popup_cont,'div','dialog_wrapper');if(this.opts.width)
|
||||||
this.wrapper.style.width=this.opts.width+'px';this.make_head();this.body=$a(this.wrapper,'div','dialog_body');if(this.opts.fields)
|
this.wrapper.style.width=this.opts.width+'px';this.make_head();this.body=$a(this.wrapper,'div','dialog_body');if(this.opts.fields)
|
||||||
this.make_fields(this.body,this.opts.fields);}
|
this.make_fields(this.body,this.opts.fields);}
|
||||||
this.make_head=function(){var me=this;this.appframe=new wn.views.AppFrame(this.wrapper);this.appframe.$titlebar.find('.close').unbind('click').click(function(){if(me.oncancel)me.oncancel();me.hide();});this.set_title(this.opts.title);}
|
this.make_head=function(){var me=this;this.appframe=new wn.ui.AppFrame(this.wrapper);this.appframe.$titlebar.find('.close').unbind('click').click(function(){if(me.oncancel)me.oncancel();me.hide();});this.set_title(this.opts.title);}
|
||||||
this.set_title=function(t){this.appframe.$titlebar.find('.appframe-title').html(t||'');}
|
this.set_title=function(t){this.appframe.$titlebar.find('.appframe-title').html(t||'');}
|
||||||
this.set_postion=function(){var d=get_screen_dims();this.wrapper.style.left=((d.w-cint(this.wrapper.style.width))/2)+'px';this.wrapper.style.top=(get_scroll_top()+60)+'px';top_index++;$y(this.wrapper,{zIndex:top_index});}
|
this.set_postion=function(){var d=get_screen_dims();this.wrapper.style.left=((d.w-cint(this.wrapper.style.width))/2)+'px';this.wrapper.style.top=(get_scroll_top()+60)+'px';top_index++;$y(this.wrapper,{zIndex:top_index});}
|
||||||
this.show=function(){if(this.display)return;this.set_postion()
|
this.show=function(){if(this.display)return;this.set_postion()
|
||||||
@ -1612,7 +1607,7 @@ d.cur_frm=f;d.dn=dn;d.table_form=f.meta.istable;f.refresh(dn);$(f.page_layout.wr
|
|||||||
/*
|
/*
|
||||||
* lib/js/legacy/widgets/form/form_header.js
|
* lib/js/legacy/widgets/form/form_header.js
|
||||||
*/
|
*/
|
||||||
_f.FrmHeader=Class.extend({init:function(parent,frm){this.appframe=new wn.views.AppFrame(parent)
|
_f.FrmHeader=Class.extend({init:function(parent,frm){this.appframe=new wn.ui.AppFrame(parent)
|
||||||
this.appframe.$titlebar.append('<span class="label-area"></span>\
|
this.appframe.$titlebar.append('<span class="label-area"></span>\
|
||||||
<span class="breadcrumb-area"></span>');this.$w=this.appframe.$w;},refresh:function(){wn.views.breadcrumbs($(this.$w.find('.breadcrumb-area')),cur_frm.meta.module,cur_frm.meta.name,cur_frm.docname);this.refresh_labels();this.refresh_toolbar();},refresh_labels:function(){var labinfo={0:['Draft',''],1:['Submitted','label-info'],2:['Cancelled','label-important']}[cint(cur_frm.doc.docstatus)];if(cur_frm.doc.__unsaved){labinfo[1]='label-warning'}
|
<span class="breadcrumb-area"></span>');this.$w=this.appframe.$w;},refresh:function(){wn.views.breadcrumbs($(this.$w.find('.breadcrumb-area')),cur_frm.meta.module,cur_frm.meta.name,cur_frm.docname);this.refresh_labels();this.refresh_toolbar();},refresh_labels:function(){var labinfo={0:['Draft',''],1:['Submitted','label-info'],2:['Cancelled','label-important']}[cint(cur_frm.doc.docstatus)];if(cur_frm.doc.__unsaved){labinfo[1]='label-warning'}
|
||||||
this.$w.find('.label-area').html(repl('<span class="label %(lab_class)s">\
|
this.$w.find('.label-area').html(repl('<span class="label %(lab_class)s">\
|
||||||
@ -1781,8 +1776,7 @@ this.section_collapse=function(){$(me.row.main_head).find('.head').html('<i clas
|
|||||||
this.section_expand=function(no_animation){$(me.row.main_head).find('.head').html('<h3><i class="icon-chevron-down" style="vertical-align: middle; margin-bottom: 2px"></i> '
|
this.section_expand=function(no_animation){$(me.row.main_head).find('.head').html('<h3><i class="icon-chevron-down" style="vertical-align: middle; margin-bottom: 2px"></i> '
|
||||||
+me.df.label+'</h3>');if(no_animation)
|
+me.df.label+'</h3>');if(no_animation)
|
||||||
$(me.row.main_body).toggle(true);else
|
$(me.row.main_body).toggle(true);else
|
||||||
$(me.row.main_body).slideDown();}
|
$(me.row.main_body).slideDown();}}
|
||||||
$y(this.row.body,{marginLeft:'17px'});}
|
|
||||||
_f.SectionBreak.prototype.has_data=function(){var me=this;for(var i in me.fields){var f=me.fields[i];var v=f.get_value?f.get_value():null;defaultval=f.df['default']||sys_defaults[f.fieldname]||user_defaults[f.fieldname];if(v&&v!=defaultval){return true;}
|
_f.SectionBreak.prototype.has_data=function(){var me=this;for(var i in me.fields){var f=me.fields[i];var v=f.get_value?f.get_value():null;defaultval=f.df['default']||sys_defaults[f.fieldname]||user_defaults[f.fieldname];if(v&&v!=defaultval){return true;}
|
||||||
if(f.df.reqd&&!v){return true;}
|
if(f.df.reqd&&!v){return true;}
|
||||||
if(f.df.fieldtype=='Table'){if(f.grid.get_children().length||f.df.reqd){return true;}}}
|
if(f.df.fieldtype=='Table'){if(f.grid.get_children().length||f.df.reqd){return true;}}}
|
||||||
@ -1891,7 +1885,7 @@ _f.FormGrid.prototype.set_column_label=function(fieldname,label){for(var i=0;i<t
|
|||||||
_f.FormGrid.prototype.get_children=function(){return getchildren(this.doctype,this.field.frm.docname,this.field.df.fieldname,this.field.frm.doctype);}
|
_f.FormGrid.prototype.get_children=function(){return getchildren(this.doctype,this.field.frm.docname,this.field.df.fieldname,this.field.frm.doctype);}
|
||||||
_f.FormGrid.prototype.refresh=function(){var docset=this.get_children();var data=[];for(var i=0;i<docset.length;i++){locals[this.doctype][docset[i].name].idx=i+1;data[data.length]=docset[i].name;}
|
_f.FormGrid.prototype.refresh=function(){var docset=this.get_children();var data=[];for(var i=0;i<docset.length;i++){locals[this.doctype][docset[i].name].idx=i+1;data[data.length]=docset[i].name;}
|
||||||
this.set_data(data);if(_f.frm_dialog&&_f.frm_dialog.dialog.display&&_f.frm_dialog.cur_frm){_f.frm_dialog.cur_frm.refresh();}}
|
this.set_data(data);if(_f.frm_dialog&&_f.frm_dialog.dialog.display&&_f.frm_dialog.cur_frm){_f.frm_dialog.cur_frm.refresh();}}
|
||||||
_f.FormGrid.prototype.set_unsaved=function(){locals[cur_frm.doctype][cur_frm.docname].__unsaved=1;cur_frm.set_heading();}
|
_f.FormGrid.prototype.set_unsaved=function(){locals[cur_frm.doctype][cur_frm.docname].__unsaved=1;cur_frm.frm_head&&cur_frm.frm_head.refresh_labels();}
|
||||||
_f.FormGrid.prototype.insert_row=function(){var d=this.new_row_doc();var ci=_f.cur_grid_cell.cellIndex;var row_idx=_f.cur_grid_cell.row.rowIndex;d.idx=row_idx+1;for(var ri=row_idx;ri<this.tab.rows.length;ri++){var r=this.tab.rows[ri];if(r.docname)
|
_f.FormGrid.prototype.insert_row=function(){var d=this.new_row_doc();var ci=_f.cur_grid_cell.cellIndex;var row_idx=_f.cur_grid_cell.row.rowIndex;d.idx=row_idx+1;for(var ri=row_idx;ri<this.tab.rows.length;ri++){var r=this.tab.rows[ri];if(r.docname)
|
||||||
locals[this.doctype][r.docname].idx++;}
|
locals[this.doctype][r.docname].idx++;}
|
||||||
this.refresh();this.cell_select('',row_idx,ci);this.set_unsaved();}
|
this.refresh();this.cell_select('',row_idx,ci);this.set_unsaved();}
|
||||||
@ -2031,9 +2025,11 @@ _f.frm_dialog.cur_frm.fields_dict[n].refresh();}else{var g=_f.cur_grid_cell;if(g
|
|||||||
cur_frm.fields_dict[n].refresh();}}
|
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_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);}
|
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)}}}
|
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)}}}
|
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];}
|
get_field_obj=function(fn){return cur_frm.fields_dict[fn];}
|
||||||
/*
|
/*
|
||||||
|
@ -150,13 +150,7 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
|
|||||||
</div>\
|
</div>\
|
||||||
\
|
\
|
||||||
<div style="height: 37px; margin-bottom:9px" class="list-toolbar-wrapper">\
|
<div style="height: 37px; margin-bottom:9px" class="list-toolbar-wrapper">\
|
||||||
<div class="list-toolbar btn-group" style="display:inline-block; margin-right: 10px;">\
|
<div class="list-toolbar" style="display:inline-block; margin-right: 10px;">\
|
||||||
<a class="btn btn-small btn-refresh btn-info">\
|
|
||||||
<i class="icon-refresh icon-white"></i> Refresh</a>\
|
|
||||||
<a class="btn btn-small btn-new">\
|
|
||||||
<i class="icon-plus"></i> New</a>\
|
|
||||||
<a class="btn btn-small btn-filter">\
|
|
||||||
<i class="icon-search"></i> Filter</a>\
|
|
||||||
</div>\
|
</div>\
|
||||||
<div style="display:inline-block; width: 24px; margin-left: 4px">\
|
<div style="display:inline-block; width: 24px; margin-left: 4px">\
|
||||||
<img src="lib/images/ui/button-load.gif" \
|
<img src="lib/images/ui/button-load.gif" \
|
||||||
@ -176,11 +170,13 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
|
|||||||
<button class="btn btn-small btn-more hide">More...</div>\
|
<button class="btn btn-small btn-more hide">More...</div>\
|
||||||
</div>\
|
</div>\
|
||||||
</div>\
|
</div>\
|
||||||
',this.opts));this.$w=$(this.parent).find('.wnlist');this.set_events();if(this.show_filters){this.make_filters();}},add_button:function(html,onclick,before){$(html).click(onclick).insertBefore(this.$w.find('.list-toolbar '+before));this.btn_groupify();},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-refresh').click(function(){me.run();});this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
|
',this.opts));this.$w=$(this.parent).find('.wnlist');this.set_events();if(this.appframe){this.$w.find('.list-toolbar-wrapper').toggle(false);}
|
||||||
if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype);})}else{this.$w.find('.btn-new').remove();}
|
if(this.show_filters){this.make_filters();}},add_button:function(label,click,icon){if(this.appframe){return this.appframe.add_button(label,click,icon)}else{$button=$('<button class="btn btn-small"></button>').appendTo(this.$w.find('.list-toolbar'))
|
||||||
if(!me.show_filters){this.$w.find('.btn-filter').remove();}
|
if(icon){$('<i>').addClass(icon).appendTo($button);}
|
||||||
if(this.hide_refresh||this.no_refresh){this.$w.find('.btn-refresh').remove();}
|
$button.html(label).click(click);return $button}},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
|
||||||
this.btn_groupify();},btn_groupify:function(){var nbtns=this.$w.find('.list-toolbar a').length;if(nbtns==0){this.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
|
if(!(this.hide_refresh||this.no_refresh)){this.add_button('Refresh',function(){me.run();},'icon-refresh');}
|
||||||
|
if(this.new_doctype){this.add_button('New '+this.new_doctype,function(){newdoc(me.new_doctype)},'icon-plus');}
|
||||||
|
if(me.show_filters){this.add_button('Show Filters',function(){me.filter_list.show_filters();},'icon-search').addClass('btn-filter');}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
|
||||||
this.onrun=a0;if(a0&&a0.callback)
|
this.onrun=a0;if(a0&&a0.callback)
|
||||||
this.onrun=a0.callback;if(!a1&&!(a0&&a0.append))
|
this.onrun=a0.callback;if(!a1&&!(a0&&a0.append))
|
||||||
this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
|
this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
|
||||||
@ -191,8 +187,8 @@ if(this.get_args){$.extend(args,this.get_args());}
|
|||||||
return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}}
|
return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}}
|
||||||
if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i<m;i++){this.render_row(this.add_row(),values[i],this,i);}
|
if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i<m;i++){this.render_row(this.add_row(),values[i],this,i);}
|
||||||
this.start+=m;if(values.length>=this.page_length)
|
this.start+=m;if(values.length>=this.page_length)
|
||||||
this.$w.find('.btn-more').toggle(true);},add_row:function(){return this.$w.find('.result-list').append('<div class="list-row">').find('.list-row:last').get(0);},refresh:function(){this.run();},add_limits:function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}});wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.listobj.$w.find('.btn-filter').bind('click',function(){me.$w.find('.show_filters').slideToggle();if(!me.filters.length)
|
this.$w.find('.btn-more').toggle(true);},add_row:function(){return this.$w.find('.result-list').append('<div class="list-row">').find('.list-row:last').get(0);},refresh:function(){this.run();},add_limits:function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}});wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},show_filters:function(){this.$w.find('.show_filters').slideToggle();if(!this.filters.length)
|
||||||
me.add_filter();});this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').slideDown();}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
|
this.add_filter();},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').slideDown();}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
|
||||||
values.push(f.get_value());})
|
values.push(f.get_value());})
|
||||||
return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);})
|
return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);})
|
||||||
this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname)
|
this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname)
|
||||||
@ -261,7 +257,7 @@ wn.views.DocListView=wn.ui.Listing.extend({init:function(doctype,page){this.doct
|
|||||||
</div>\
|
</div>\
|
||||||
</div>\
|
</div>\
|
||||||
<div style="clear: both"></div>\
|
<div style="clear: both"></div>\
|
||||||
</div>',{label:this.label}));this.appframe=new wn.views.AppFrame(this.$page.find('.appframe-area'));wn.views.breadcrumbs($('<span>').appendTo(this.appframe.$titlebar),locals.DocType[this.doctype].module);},setup:function(){var me=this;me.can_delete=wn.model.can_delete(me.doctype);me.meta=locals.DocType[me.doctype];me.$page.find('.wnlist-area').empty(),me.setup_docstatus_filter();me.setup_listview();me.init_list();me.init_stats();me.add_delete_option();},setup_docstatus_filter:function(){var me=this;this.can_submit=$.map(locals.DocPerm,function(d){if(d.parent==me.meta.name&&d.submit)return 1
|
</div>',{label:this.label}));this.appframe=new wn.ui.AppFrame(this.$page.find('.appframe-area'));wn.views.breadcrumbs($('<span>').appendTo(this.appframe.$titlebar),locals.DocType[this.doctype].module);},setup:function(){var me=this;me.can_delete=wn.model.can_delete(me.doctype);me.meta=locals.DocType[me.doctype];me.$page.find('.wnlist-area').empty(),me.setup_docstatus_filter();me.setup_listview();me.init_list();me.init_stats();me.add_delete_option();},setup_docstatus_filter:function(){var me=this;this.can_submit=$.map(locals.DocPerm,function(d){if(d.parent==me.meta.name&&d.submit)return 1
|
||||||
else return null;}).length;if(this.can_submit){this.$page.find('.show-docstatus').removeClass('hide');this.$page.find('.show-docstatus input').click(function(){me.run();})}},setup_listview:function(){if(this.meta.__listjs){eval(this.meta.__listjs);this.listview=new wn.doclistviews[this.doctype](this);}else{this.listview=new wn.views.ListView(this);}
|
else return null;}).length;if(this.can_submit){this.$page.find('.show-docstatus').removeClass('hide');this.$page.find('.show-docstatus input').click(function(){me.run();})}},setup_listview:function(){if(this.meta.__listjs){eval(this.meta.__listjs);this.listview=new wn.doclistviews[this.doctype](this);}else{this.listview=new wn.views.ListView(this);}
|
||||||
this.listview.parent=this;},init_list:function(){this.make({method:'webnotes.widgets.doclistview.get',get_args:this.get_args,parent:this.$page.find('.wnlist-area'),start:0,page_length:20,show_filters:true,show_grid:true,new_doctype:this.doctype,allow_delete:true,no_result_message:this.make_no_result(),columns:this.listview.fields});this.run();},make_no_result:function(){return repl('<div class="well"><p>No %(doctype_label)s found</p>\
|
this.listview.parent=this;},init_list:function(){this.make({method:'webnotes.widgets.doclistview.get',get_args:this.get_args,parent:this.$page.find('.wnlist-area'),start:0,page_length:20,show_filters:true,show_grid:true,new_doctype:this.doctype,allow_delete:true,no_result_message:this.make_no_result(),columns:this.listview.fields});this.run();},make_no_result:function(){return repl('<div class="well"><p>No %(doctype_label)s found</p>\
|
||||||
%(description)s\
|
%(description)s\
|
||||||
@ -269,8 +265,7 @@ this.listview.parent=this;},init_list:function(){this.make({method:'webnotes.wid
|
|||||||
<p><button class="btn btn-info btn-small"\
|
<p><button class="btn btn-info btn-small"\
|
||||||
onclick="wn.set_route(\'Form\', \'%(doctype)s\', \'New %(doctype)s\');"\
|
onclick="wn.set_route(\'Form\', \'%(doctype)s\', \'New %(doctype)s\');"\
|
||||||
>Make a new %(doctype_label)s</button>\
|
>Make a new %(doctype_label)s</button>\
|
||||||
</p></div>',{doctype_label:get_doctype_label(this.doctype),doctype:this.doctype,description:wn.markdown(locals.DocType[this.doctype].description||'')});},render_row:function(row,data){data.doctype=this.doctype;this.listview.render(row,data,this);},get_query_fields:function(){return this.listview.fields;},get_args:function(){return{doctype:this.doctype,fields:this.get_query_fields(),filters:this.filter_list.get_filters(),docstatus:this.can_submit?$.map(this.$page.find('.show-docstatus :checked'),function(inp){return $(inp).attr('data-docstatus')}):[]}},add_delete_option:function(){var me=this;if(this.can_delete){this.add_button('<a class="btn btn-small btn-delete">\
|
</p></div>',{doctype_label:get_doctype_label(this.doctype),doctype:this.doctype,description:wn.markdown(locals.DocType[this.doctype].description||'')});},render_row:function(row,data){data.doctype=this.doctype;this.listview.render(row,data,this);},get_query_fields:function(){return this.listview.fields;},get_args:function(){return{doctype:this.doctype,fields:this.get_query_fields(),filters:this.filter_list.get_filters(),docstatus:this.can_submit?$.map(this.$page.find('.show-docstatus :checked'),function(inp){return $(inp).attr('data-docstatus')}):[]}},add_delete_option:function(){var me=this;if(this.can_delete){this.add_button('Delete',function(){me.delete_items();},'icon-remove')}},delete_items:function(){var me=this;var dl=$.map(me.$page.find('.list-delete:checked'),function(e){return $(e).data('name');});if(!dl.length)
|
||||||
<i class="icon-remove"></i> Delete</a>',function(){me.delete_items();},'.btn-filter')}},delete_items:function(){var me=this;var dl=$.map(me.$page.find('.list-delete:checked'),function(e){return $(e).data('name');});if(!dl.length)
|
|
||||||
return;if(!confirm('This is PERMANENT action and you cannot undo. Continue?')){return;}
|
return;if(!confirm('This is PERMANENT action and you cannot undo. Continue?')){return;}
|
||||||
me.set_working(true);wn.call({method:'webnotes.widgets.doclistview.delete_items',args:{items:dl,doctype:me.doctype},callback:function(){me.set_working(false);me.refresh();}})},init_stats:function(){var me=this
|
me.set_working(true);wn.call({method:'webnotes.widgets.doclistview.delete_items',args:{items:dl,doctype:me.doctype},callback:function(){me.set_working(false);me.refresh();}})},init_stats:function(){var me=this
|
||||||
wn.call({method:'webnotes.widgets.doclistview.get_stats',args:{stats:me.listview.stats,doctype:me.doctype},callback:function(r){$.each(me.listview.stats,function(i,v){me.render_stat(v,r.message[v]);});}});},render_stat:function(field,stat){var me=this;if(!stat||!stat.length){if(field=='_user_tags'){this.$page.find('.layout-side-section').append('<div class="stat-wrapper"><h4>Tags</h4>\
|
wn.call({method:'webnotes.widgets.doclistview.get_stats',args:{stats:me.listview.stats,doctype:me.doctype},callback:function(r){$.each(me.listview.stats,function(i,v){me.render_stat(v,r.message[v]);});}});},render_stat:function(field,stat){var me=this;if(!stat||!stat.length){if(field=='_user_tags'){this.$page.find('.layout-side-section').append('<div class="stat-wrapper"><h4>Tags</h4>\
|
||||||
@ -572,6 +567,16 @@ msg_dialog.custom_onhide=callback;}
|
|||||||
var growl_area;function show_alert(txt,id){if(!growl_area){growl_area=$a(popup_cont,'div','',{position:'fixed',bottom:'8px',right:'8px',width:'320px',zIndex:10});}
|
var growl_area;function show_alert(txt,id){if(!growl_area){growl_area=$a(popup_cont,'div','',{position:'fixed',bottom:'8px',right:'8px',width:'320px',zIndex:10});}
|
||||||
var wrapper=$a(growl_area,'div','',{position:'relative'});var body=$a(wrapper,'div','notice');var c=$a(body,'i','icon-remove-sign',{cssFloat:'right',cursor:'pointer'});$(c).click(function(){$dh(this.wrapper)});c.wrapper=wrapper;var t=$a(body,'div','',{color:'#FFF'});$(t).html(txt);if(id){$(t).attr('id',id);}
|
var wrapper=$a(growl_area,'div','',{position:'relative'});var body=$a(wrapper,'div','notice');var c=$a(body,'i','icon-remove-sign',{cssFloat:'right',cursor:'pointer'});$(c).click(function(){$dh(this.wrapper)});c.wrapper=wrapper;var t=$a(body,'div','',{color:'#FFF'});$(t).html(txt);if(id){$(t).attr('id',id);}
|
||||||
$(wrapper).hide().fadeIn(1000);}
|
$(wrapper).hide().fadeIn(1000);}
|
||||||
|
/*
|
||||||
|
* lib/js/wn/ui/appframe.js
|
||||||
|
*/
|
||||||
|
wn.ui.AppFrame=Class.extend({init:function(parent){this.buttons={};this.$w=$('<div></div>').appendTo(parent);this.$titlebar=$('<div class="appframe-titlebar">\
|
||||||
|
<span class="appframe-title"></span>\
|
||||||
|
<span class="close">×</span>\
|
||||||
|
</div>').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();})},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length)
|
||||||
|
this.$w.append('<div class="appframe-toolbar"></div>');args={label:label,icon:''};if(icon){args.icon='<i class="'+icon+'"></i>';}
|
||||||
|
this.buttons[label]=$(repl('<button class="btn btn-small">\
|
||||||
|
%(icon)s %(label)s</button>',args)).click(click).appendTo(this.$w.find('.appframe-toolbar'));return this.buttons[label];},clear_buttons:function(){this.$w.find('.appframe-toolbar').empty();}})
|
||||||
/*
|
/*
|
||||||
* lib/js/wn/ui/dialog.js
|
* lib/js/wn/ui/dialog.js
|
||||||
*/
|
*/
|
||||||
@ -589,7 +594,7 @@ wn.widgets.Dialog=function(opts){this.opts=opts;this.display=false;this.make=fun
|
|||||||
this.opts=opts;if(!this.opts.width)this.opts.width=480;this.wrapper=$a(popup_cont,'div','dialog_wrapper');if(this.opts.width)
|
this.opts=opts;if(!this.opts.width)this.opts.width=480;this.wrapper=$a(popup_cont,'div','dialog_wrapper');if(this.opts.width)
|
||||||
this.wrapper.style.width=this.opts.width+'px';this.make_head();this.body=$a(this.wrapper,'div','dialog_body');if(this.opts.fields)
|
this.wrapper.style.width=this.opts.width+'px';this.make_head();this.body=$a(this.wrapper,'div','dialog_body');if(this.opts.fields)
|
||||||
this.make_fields(this.body,this.opts.fields);}
|
this.make_fields(this.body,this.opts.fields);}
|
||||||
this.make_head=function(){var me=this;this.appframe=new wn.views.AppFrame(this.wrapper);this.appframe.$titlebar.find('.close').unbind('click').click(function(){if(me.oncancel)me.oncancel();me.hide();});this.set_title(this.opts.title);}
|
this.make_head=function(){var me=this;this.appframe=new wn.ui.AppFrame(this.wrapper);this.appframe.$titlebar.find('.close').unbind('click').click(function(){if(me.oncancel)me.oncancel();me.hide();});this.set_title(this.opts.title);}
|
||||||
this.set_title=function(t){this.appframe.$titlebar.find('.appframe-title').html(t||'');}
|
this.set_title=function(t){this.appframe.$titlebar.find('.appframe-title').html(t||'');}
|
||||||
this.set_postion=function(){var d=get_screen_dims();this.wrapper.style.left=((d.w-cint(this.wrapper.style.width))/2)+'px';this.wrapper.style.top=(get_scroll_top()+60)+'px';top_index++;$y(this.wrapper,{zIndex:top_index});}
|
this.set_postion=function(){var d=get_screen_dims();this.wrapper.style.left=((d.w-cint(this.wrapper.style.width))/2)+'px';this.wrapper.style.top=(get_scroll_top()+60)+'px';top_index++;$y(this.wrapper,{zIndex:top_index});}
|
||||||
this.show=function(){if(this.display)return;this.set_postion()
|
this.show=function(){if(this.display)return;this.set_postion()
|
||||||
@ -639,13 +644,7 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
|
|||||||
</div>\
|
</div>\
|
||||||
\
|
\
|
||||||
<div style="height: 37px; margin-bottom:9px" class="list-toolbar-wrapper">\
|
<div style="height: 37px; margin-bottom:9px" class="list-toolbar-wrapper">\
|
||||||
<div class="list-toolbar btn-group" style="display:inline-block; margin-right: 10px;">\
|
<div class="list-toolbar" style="display:inline-block; margin-right: 10px;">\
|
||||||
<a class="btn btn-small btn-refresh btn-info">\
|
|
||||||
<i class="icon-refresh icon-white"></i> Refresh</a>\
|
|
||||||
<a class="btn btn-small btn-new">\
|
|
||||||
<i class="icon-plus"></i> New</a>\
|
|
||||||
<a class="btn btn-small btn-filter">\
|
|
||||||
<i class="icon-search"></i> Filter</a>\
|
|
||||||
</div>\
|
</div>\
|
||||||
<div style="display:inline-block; width: 24px; margin-left: 4px">\
|
<div style="display:inline-block; width: 24px; margin-left: 4px">\
|
||||||
<img src="lib/images/ui/button-load.gif" \
|
<img src="lib/images/ui/button-load.gif" \
|
||||||
@ -665,11 +664,13 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
|
|||||||
<button class="btn btn-small btn-more hide">More...</div>\
|
<button class="btn btn-small btn-more hide">More...</div>\
|
||||||
</div>\
|
</div>\
|
||||||
</div>\
|
</div>\
|
||||||
',this.opts));this.$w=$(this.parent).find('.wnlist');this.set_events();if(this.show_filters){this.make_filters();}},add_button:function(html,onclick,before){$(html).click(onclick).insertBefore(this.$w.find('.list-toolbar '+before));this.btn_groupify();},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-refresh').click(function(){me.run();});this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
|
',this.opts));this.$w=$(this.parent).find('.wnlist');this.set_events();if(this.appframe){this.$w.find('.list-toolbar-wrapper').toggle(false);}
|
||||||
if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype);})}else{this.$w.find('.btn-new').remove();}
|
if(this.show_filters){this.make_filters();}},add_button:function(label,click,icon){if(this.appframe){return this.appframe.add_button(label,click,icon)}else{$button=$('<button class="btn btn-small"></button>').appendTo(this.$w.find('.list-toolbar'))
|
||||||
if(!me.show_filters){this.$w.find('.btn-filter').remove();}
|
if(icon){$('<i>').addClass(icon).appendTo($button);}
|
||||||
if(this.hide_refresh||this.no_refresh){this.$w.find('.btn-refresh').remove();}
|
$button.html(label).click(click);return $button}},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
|
||||||
this.btn_groupify();},btn_groupify:function(){var nbtns=this.$w.find('.list-toolbar a').length;if(nbtns==0){this.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
|
if(!(this.hide_refresh||this.no_refresh)){this.add_button('Refresh',function(){me.run();},'icon-refresh');}
|
||||||
|
if(this.new_doctype){this.add_button('New '+this.new_doctype,function(){newdoc(me.new_doctype)},'icon-plus');}
|
||||||
|
if(me.show_filters){this.add_button('Show Filters',function(){me.filter_list.show_filters();},'icon-search').addClass('btn-filter');}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
|
||||||
this.onrun=a0;if(a0&&a0.callback)
|
this.onrun=a0;if(a0&&a0.callback)
|
||||||
this.onrun=a0.callback;if(!a1&&!(a0&&a0.append))
|
this.onrun=a0.callback;if(!a1&&!(a0&&a0.append))
|
||||||
this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
|
this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
|
||||||
@ -680,8 +681,8 @@ if(this.get_args){$.extend(args,this.get_args());}
|
|||||||
return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}}
|
return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}}
|
||||||
if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i<m;i++){this.render_row(this.add_row(),values[i],this,i);}
|
if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i<m;i++){this.render_row(this.add_row(),values[i],this,i);}
|
||||||
this.start+=m;if(values.length>=this.page_length)
|
this.start+=m;if(values.length>=this.page_length)
|
||||||
this.$w.find('.btn-more').toggle(true);},add_row:function(){return this.$w.find('.result-list').append('<div class="list-row">').find('.list-row:last').get(0);},refresh:function(){this.run();},add_limits:function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}});wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.listobj.$w.find('.btn-filter').bind('click',function(){me.$w.find('.show_filters').slideToggle();if(!me.filters.length)
|
this.$w.find('.btn-more').toggle(true);},add_row:function(){return this.$w.find('.result-list').append('<div class="list-row">').find('.list-row:last').get(0);},refresh:function(){this.run();},add_limits:function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}});wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},show_filters:function(){this.$w.find('.show_filters').slideToggle();if(!this.filters.length)
|
||||||
me.add_filter();});this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').slideDown();}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
|
this.add_filter();},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').slideDown();}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
|
||||||
values.push(f.get_value());})
|
values.push(f.get_value());})
|
||||||
return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);})
|
return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);})
|
||||||
this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname)
|
this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname)
|
||||||
|
@ -1 +1 @@
|
|||||||
1671
|
1683
|
||||||
|
Loading…
x
Reference in New Issue
Block a user