This commit is contained in:
Rushabh Mehta 2012-03-06 18:41:11 +05:30
parent 60871c3f54
commit 15da133de9
21 changed files with 90 additions and 62 deletions

View File

@ -17,8 +17,8 @@
cur_frm.cscript.tname = "PV Detail";
cur_frm.cscript.fname = "entries";
cur_frm.cscript.other_fname = "purchase_tax_details";
$import(Purchase Other Charges)
$import(Purchase Common)
wn.require('erpnext/buying/doctype/purchase_other_charges/purchase_other_charges.js');
wn.require('erpnext/buying/doctype/purchase_common/purchase_common.js');
// On Load
// --------

View File

@ -22,9 +22,10 @@ cur_frm.cscript.sales_team_fname = "sales_team";
// print heading
cur_frm.pformat.print_heading = 'Invoice';
$import(Sales Common)
$import(Other Charges)
$import(SMS Control)
wn.require('erpnext/selling/doctype/sales_common/sales_common.js');
wn.require('erpnext/setup/doctype/other_charges/other_charges.js');
wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
// On Load
// -------
@ -476,7 +477,6 @@ cur_frm.cscript.convert_into_recurring_invoice = function(doc) {
}
}
$import(Notification Control)
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
var args = {
type: 'Sales Invoice',

View File

@ -17,8 +17,8 @@
cur_frm.cscript.tname = "Indent Detail";
cur_frm.cscript.fname = "indent_details";
$import(Purchase Common)
$import(SMS Control)
wn.require('erpnext/buying/doctype/purchase_common/purchase_common.js');
wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
cur_frm.cscript.indent_doctype_label = get_doctype_label('Indent');
//========================== On Load =================================================

View File

@ -71,9 +71,9 @@ cur_frm.cscript.update_item_details = function(doc, dt, dn, callback) {
var set_dynamic_label_par = function(doc, cdt, cdn, base_curr) {
//parent flds
par_cols_base = {'net_total': 'Net Total', 'total_tax': 'Total Tax', 'grand_total': 'Grand Total', /*'rounded_total': 'Rounded Total',*/
'in_words': 'In Words', 'other_charges_added': 'Other Charges Added', 'other_charges_deducted': 'Other Charges Deducted'}
'in_words': 'In Words', 'other_charges_added': 'wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); Added', 'other_charges_deducted': 'wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); Deducted'}
par_cols_import = {'net_total_import': 'Net Total', 'grand_total_import': 'Grand Total', 'in_words_import': 'In Words',
'other_charges_added_import': 'Other Charges Added', 'other_charges_deducted_import': 'Other Charges Deducted'};
'other_charges_added_import': 'wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); Added', 'other_charges_deducted_import': 'wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); Deducted'};
for (d in par_cols_base) cur_frm.fields_dict[d].label_area.innerHTML = par_cols_base[d]+' (' + base_curr + ')';
for (d in par_cols_import) cur_frm.fields_dict[d].label_area.innerHTML = par_cols_import[d]+' (' + doc.currency + ')';
@ -430,7 +430,7 @@ cur_frm.cscript.calc_other_charges = function(doc , tname , fname , other_fname)
// ------------------
cur_frm.fields_dict['Tax Calculation'].disp_area.innerHTML = '<b style="padding: 8px 0px;">Calculation Details for Other Charges and Landed cost:</b>';
cur_frm.fields_dict['Tax Calculation'].disp_area.innerHTML = '<b style="padding: 8px 0px;">Calculation Details for wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); and Landed cost:</b>';
var cl = getchildren(tname, doc.name, fname);
var tax = getchildren('Purchase Tax Detail', doc.name, other_fname,doc.doctype);
// make display table

View File

@ -17,9 +17,11 @@
cur_frm.cscript.tname = "PO Detail";
cur_frm.cscript.fname = "po_details";
cur_frm.cscript.other_fname = "purchase_tax_details";
$import(Purchase Common)
$import(Purchase Other Charges)
$import(SMS Control)
wn.require('erpnext/buying/doctype/purchase_other_charges/purchase_other_charges.js');
wn.require('erpnext/buying/doctype/purchase_common/purchase_common.js');
wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
//========================== On Load =================================================
cur_frm.cscript.onload = function(doc, cdt, cdn) {
@ -270,7 +272,6 @@ cur_frm.pformat.indent_no = function(doc, cdt, cdn){
return out;
}
$import(Notification Control)
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
var args = {
type: 'Purchase Order',

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
$import(Contact Control)
wn.require('erpnext/setup/doctype/contact_control/contact_control.js');
cur_frm.cscript.onload = function(doc,dt,dn){

View File

@ -100,7 +100,7 @@ cur_frm.cscript.sanctioned_amount = function(doc,cdt,cdn){
cur_frm.cscript.calculate_total(doc,cdt,cdn);
}
$import(Notification Control);
wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
cur_frm.cscript['Approve'] = function(doc,cdt,cdn){
@ -244,7 +244,6 @@ cur_frm.cscript['Update Voucher'] = function(doc){
});
}
$import(Notification Control)
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
var args = {
type: 'Expense Voucher',

View File

@ -185,4 +185,4 @@ KBAnswer = function(body, data, ans_list) {
}
$import(knowledge_base/page/kb_common/kb_common.js);
wn.require('erpnext/knowledge_base/page/kb_common/kb_common.js');

View File

@ -215,4 +215,4 @@ KBQuestion = function(parent, det, kb) {
this.make()
}
$import(knowledge_base/page/kb_common/kb_common.js);
wn.require('erpnext/knowledge_base/page/kb_common/kb_common.js');

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
$import(Contact Control)
wn.require('erpnext/setup/doctype/contact_control/contact_control.js');
/* ********************************* onload ********************************************* */

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
$import(SMS Control)
wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
cur_frm.cscript.refresh = function(doc, cdt, cdn){

View File

@ -16,7 +16,7 @@
// Module CRM
$import(SMS Control)
wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
cur_frm.cscript.onload = function(doc, cdt, cdn) {
if(user =='Guest'){

View File

@ -21,9 +21,10 @@ cur_frm.cscript.other_fname = "other_charges";
cur_frm.cscript.sales_team_fname = "sales_team";
// =====================================================================================
$import(Sales Common)
$import(Other Charges)
$import(SMS Control)
wn.require('erpnext/selling/doctype/sales_common/sales_common.js');
wn.require('erpnext/setup/doctype/other_charges/other_charges.js');
wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
// ONLOAD
// ===================================================================================
@ -326,7 +327,6 @@ cur_frm.fields_dict['quotation_details'].grid.get_field('item_code').get_query=
return repl("SELECT name, item_name, description FROM tabItem WHERE `tabItem`.%(key)s LIKE '%s' %(cond)s ORDER BY tabItem.item_code DESC LIMIT 50", {cond:cond});
}
$import(Notification Control)
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
var args = {
type: 'Quotation',

View File

@ -18,7 +18,7 @@
// ------
// cur_frm.cscript.tname - Details table name
// cur_frm.cscript.fname - Details fieldname
// cur_frm.cscript.other_fname - Other Charges fieldname
// cur_frm.cscript.other_fname - wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); fieldname
// cur_frm.cscript.sales_team_fname - Sales Team fieldname
// ============== Load Default Taxes ===================
@ -96,7 +96,7 @@ cur_frm.cscript.customer = function(doc, cdt, cdn) {
var set_dynamic_label_par = function(doc, cdt, cdn, base_curr) {
//parent flds
par_cols_base = {'net_total': 'Net Total', 'other_charges_total': 'Other Charges Total',
par_cols_base = {'net_total': 'Net Total', 'other_charges_total': 'wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); Total',
'grand_total': 'Grand Total', 'rounded_total': 'Rounded Total', 'in_words': 'In Words'}
par_cols_export = {'grand_total_export': 'Grand Total', 'rounded_total_export': 'Rounded Total', 'in_words_export': 'In Words'};
@ -339,7 +339,7 @@ cur_frm.cscript.export_rate = function(doc,cdt,cdn) {
// ************* GET OTHER CHARGES BASED ON COMPANY *************
cur_frm.fields_dict.charge.get_query = function(doc) {
return 'SELECT DISTINCT `tabOther Charges`.name FROM `tabOther Charges` WHERE `tabOther Charges`.company = "'+doc.company+'" AND `tabOther Charges`.company is not NULL AND `tabOther Charges`.docstatus != 2 AND `tabOther Charges`.%(key)s LIKE "%s" ORDER BY `tabOther Charges`.name LIMIT 50';
return 'SELECT DISTINCT `tabwn.require('erpnext/setup/doctype/other_charges/other_charges.js');`.name FROM `tabwn.require('erpnext/setup/doctype/other_charges/other_charges.js');` WHERE `tabwn.require('erpnext/setup/doctype/other_charges/other_charges.js');`.company = "'+doc.company+'" AND `tabwn.require('erpnext/setup/doctype/other_charges/other_charges.js');`.company is not NULL AND `tabwn.require('erpnext/setup/doctype/other_charges/other_charges.js');`.docstatus != 2 AND `tabwn.require('erpnext/setup/doctype/other_charges/other_charges.js');`.%(key)s LIKE "%s" ORDER BY `tabwn.require('erpnext/setup/doctype/other_charges/other_charges.js');`.name LIMIT 50';
}
// ********************* Get Charges ****************************
@ -433,14 +433,14 @@ cur_frm.cscript.calc_other_charges = function(doc , tname , fname , other_fname)
doc = locals[doc.doctype][doc.name];
// Make Display Area
cur_frm.fields_dict['Other Charges Calculation'].disp_area.innerHTML =
'<b style="padding: 8px 0px;">Calculation Details for Other Charges:</b>';
cur_frm.fields_dict['wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); Calculation'].disp_area.innerHTML =
'<b style="padding: 8px 0px;">Calculation Details for wn.require('erpnext/setup/doctype/other_charges/other_charges.js');:</b>';
var cl = getchildren(tname, doc.name, fname);
var tax = getchildren('RV Tax Detail', doc.name, other_fname,doc.doctype);
// Make display table
var otc = make_table(cur_frm.fields_dict['Other Charges Calculation'].disp_area,
var otc = make_table(cur_frm.fields_dict['wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); Calculation'].disp_area,
cl.length + 1, tax.length + 1, '90%', [], { border:'1px solid #AAA', padding:'2px' });
$y(otc,{marginTop:'8px'});
@ -795,10 +795,10 @@ cur_frm.cscript.allocated_percentage = function(doc, cdt, cdn) {
// =================================================================================
cur_frm.cscript.validate = function(doc, cdt, cdn) {
cur_frm.cscript.validate_items(doc);
var cl = getchildren('Other Charges', doc.name, 'other_charges');
var cl = getchildren('wn.require('erpnext/setup/doctype/other_charges/other_charges.js');', doc.name, 'other_charges');
for(var i =0;i<cl.length;i++) {
if(!cl[i].amount) {
alert("Please Enter Amount in Row no. "+cl[i].idx+" in Other Charges table");
alert("Please Enter Amount in Row no. "+cl[i].idx+" in wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); table");
validated = false;
}
}

View File

@ -1,13 +1,41 @@
fields = ["customer_name, per_delivered, per_billed, currency, grand_total_export"]
// render
wn.provide('wn.pages.doclistview.renderfn');
wn.pages.doclistview.renderfn['Sales Order'] = function(parent, data) {
$(parent).html(repl('<span class="avatar-small"><img src="%(imgsrc)s" /></span>\
<a href="#!Form/Sales Order/%(name)s">%(name)s</a>\
<span style="display: inline-block; width: 50%%">%(customer_name)s</span>\
<span style="display: inline-block; width: 10%%; height: 12px; \
border: 2px solid #aaa;"><span style="display: inline-block; width: %(per_delivered)s;></span>
', data))
}
wn.doclistviews['Sales Order'] = {
fields: ["name", "owner", "modified", "customer_name",
"ifnull(per_delivered,0) as per_delivered",
"ifnull(per_billed,0) as per_billed", "currency",
"ifnull(grand_total_export,0) as grand_total_export",
"docstatus"],
render: function(row, data, listobj) {
data.modified_date = dateutil.str_to_user(data.modified).split(' ')[0];
// bar color for billed
data.bar_class_delivered = ''; data.bar_class_billed = '';
if(data.per_delivered == 100) data.bar_class_delivered = 'bar-complete';
if(data.per_billed == 100) data.bar_class_billed = 'bar-complete';
// lock for docstatus
data.icon = '';
if(data.docstatus==1) {
data.icon = ' <i class="icon-lock" title="Submitted"></i>';
}
$(row).html(repl('<span class="avatar-small"><img src="%(avatar)s" /></span>\
<a href="#!Form/%(doctype)s/%(name)s">%(name)s</a>\
%(icon)s\
<span style="color:#444">%(customer_name)s</span>\
<span class="bar-outer" style="width: 30px; float: right" \
title="%(per_delivered)s% Delivered">\
<span class="bar-inner %(bar_class_delivered)s" \
style="width: %(per_delivered)s%;"></span>\
</span>\
<span class="bar-outer" style="width: 30px; float: right" \
title="%(per_billed)s% Billed">\
<span class="bar-inner %(bar_class_billed)s" \
style="width: %(per_billed)s%;"></span>\
</span>\
<span style="float:right; font-size: 11px; color: #888;\
margin-left: 7px;">%(modified_date)s</span>\
<span style="color:#444; float: right;">%(currency)s %(grand_total_export)s</span>\
', data)).addClass('list-row');
}
}

View File

@ -22,9 +22,10 @@ cur_frm.cscript.other_fname = "other_charges";
cur_frm.cscript.sales_team_fname = "sales_team";
$import(Sales Common)
$import(Other Charges)
$import(SMS Control)
wn.require('erpnext/selling/doctype/sales_common/sales_common.js');
wn.require('erpnext/setup/doctype/other_charges/other_charges.js');
wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
// ONLOAD
@ -352,7 +353,6 @@ cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
}
$import(Notification Control)
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
var args = {
type: 'Sales Order',

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
$import(Contact Control)
wn.require('erpnext/setup/doctype/contact_control/contact_control.js');
cur_frm.cscript.onload = function(doc,dt,dn){
// history doctypes and scripts

View File

@ -20,9 +20,10 @@ cur_frm.cscript.fname = "delivery_note_details";
cur_frm.cscript.other_fname = "other_charges";
cur_frm.cscript.sales_team_fname = "sales_team";
$import(Sales Common)
$import(Other Charges)
$import(SMS Control)
wn.require('erpnext/selling/doctype/sales_common/sales_common.js');
wn.require('erpnext/setup/doctype/other_charges/other_charges.js');
wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
// ONLOAD
// ================================================================================================
@ -322,7 +323,6 @@ cur_frm.pformat.sales_order_no= function(doc, cdt, cdn){
return out;
}
$import(Notification Control)
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
var args = {
type: 'Delivery Note',

View File

@ -18,9 +18,10 @@ cur_frm.cscript.tname = "Purchase Receipt Detail";
cur_frm.cscript.fname = "purchase_receipt_details";
cur_frm.cscript.other_fname = "purchase_tax_details";
$import(Purchase Common)
$import(Purchase Other Charges)
$import(SMS Control)
wn.require('erpnext/buying/doctype/purchase_other_charges/purchase_other_charges.js');
wn.require('erpnext/buying/doctype/purchase_common/purchase_common.js');
wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
//========================== On Load ================================================================
cur_frm.cscript.onload = function(doc, cdt, cdn) {
@ -315,7 +316,6 @@ cur_frm.pformat.purchase_order_no = function(doc, cdt, cdn){
return out;
}
$import(Notification Control)
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
var args = {
type: 'Purchase Receipt',

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
868
881