On Print Hide, hide net_total, rounded_total_export and grand_total_export

This commit is contained in:
Anand Doshi
2012-01-09 16:55:30 +05:30
parent 322d8fed74
commit a9df960494
54 changed files with 161 additions and 63 deletions

View File

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

View File

View File

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

View File

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

View File

@@ -7,5 +7,15 @@ patch_list = [
'patch_module': 'patches', 'patch_module': 'patches',
'patch_file': 'reload_project_task', 'patch_file': 'reload_project_task',
'description': 'Reload doctype task of project module' 'description': 'Reload doctype task of project module'
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'stable_branch_shift_09_01_12',
'description': 'Various Reloads for shifting branch from master to stable'
},
{
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'print_hide_totals',
'description': 'Uncheck print_hide for RV, SO, DN and Quotation'
} }
] ]

View File

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

View File

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

View File

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

View File

@@ -5,7 +5,7 @@
{ {
'creation': '2011-04-18 15:58:20', 'creation': '2011-04-18 15:58:20',
'docstatus': 0, 'docstatus': 0,
'modified': '2011-12-22 19:03:44', 'modified': '2012-01-09 16:52:43',
'modified_by': 'Administrator', 'modified_by': 'Administrator',
'owner': 'Administrator' 'owner': 'Administrator'
}, },
@@ -21,7 +21,7 @@
# These values are common for all DocType # These values are common for all DocType
{ {
'_last_update': '1324367019', '_last_update': '1326105502',
'colour': 'White:FFF', 'colour': 'White:FFF',
'default_print_format': 'Standard', 'default_print_format': 'Standard',
'doctype': 'DocType', 'doctype': 'DocType',
@@ -37,7 +37,7 @@
'show_in_menu': 0, 'show_in_menu': 0,
'subject': 'To %(customer_name)s on %(transaction_date)s | %(per_billed)s% billed', 'subject': 'To %(customer_name)s on %(transaction_date)s | %(per_billed)s% billed',
'tag_fields': 'billing_status', 'tag_fields': 'billing_status',
'version': 460 'version': 463
}, },
# These values are common for all DocFormat # These values are common for all DocFormat
@@ -703,7 +703,7 @@
'oldfieldname': 'net_total', 'oldfieldname': 'net_total',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 0,
'reqd': 0, 'reqd': 0,
'width': '150px' 'width': '150px'
}, },
@@ -885,7 +885,7 @@
'oldfieldname': 'grand_total_export', 'oldfieldname': 'grand_total_export',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 0,
'reqd': 0, 'reqd': 0,
'width': '150px' 'width': '150px'
}, },
@@ -900,7 +900,7 @@
'oldfieldname': 'rounded_total_export', 'oldfieldname': 'rounded_total_export',
'oldfieldtype': 'Currency', 'oldfieldtype': 'Currency',
'permlevel': 1, 'permlevel': 1,
'print_hide': 1, 'print_hide': 0,
'width': '150px' 'width': '150px'
}, },

View File

@@ -3,7 +3,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>ERPNext</title> <title>ERPNext</title>
<meta name="author" content=""> <meta name="author" content="">
<script type="text/javascript">window._version_number="368" <script type="text/javascript">window._version_number="370"
wn={} wn={}
wn.provide=function(namespace){var nsl=namespace.split('.');var l=nsl.length;var parent=window;for(var i=0;i<l;i++){var n=nsl[i];if(!parent[n]){parent[n]={}} wn.provide=function(namespace){var nsl=namespace.split('.');var l=nsl.length;var parent=window;for(var i=0;i<l;i++){var n=nsl[i];if(!parent[n]){parent[n]={}}

Binary file not shown.