Changes in print formats to include selected print heading and discount
appended in description
This commit is contained in:
parent
130ae98675
commit
206df20f36
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -53,7 +53,7 @@ def execute():
|
||||
Install print formats
|
||||
"""
|
||||
from webnotes.modules.module_manager import reload_doc
|
||||
#reload_doc('core', 'doctype', 'print_format')
|
||||
reload_doc('core', 'doctype', 'print_format')
|
||||
|
||||
#copy_doctype_to_pfs()
|
||||
global pf_to_install
|
||||
|
@ -112,17 +112,26 @@
|
||||
null,
|
||||
{
|
||||
'description' : function(data_row) {
|
||||
if(data_row.serial_no) {
|
||||
return (
|
||||
data_row.description +
|
||||
'<div style="padding-left: 15px;"><i>Serial No.:' +
|
||||
((data_row.serial_no.indexOf('\n')>-1)?'<br />':' ') +
|
||||
data_row.serial_no + '</i></div>'
|
||||
);
|
||||
} else {
|
||||
return data_row.description;
|
||||
var to_append = ''
|
||||
if(data_row.adj_rate){
|
||||
to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
|
||||
data_row.adj_rate + '%</i></div>';
|
||||
if(data_row.description.indexOf(to_append)==-1) {
|
||||
data_row.description = data_row.description + to_append;
|
||||
}
|
||||
}
|
||||
|
||||
if(data_row.serial_no) {
|
||||
to_append = '<div style="padding-left: 15px;"><i>Serial No.:' +
|
||||
((data_row.serial_no.indexOf('\n')>-1)?'<br />':' ') +
|
||||
data_row.serial_no + '</i></div>';
|
||||
if(data_row.description.indexOf(to_append)==-1) {
|
||||
data_row.description = data_row.description + to_append;
|
||||
}
|
||||
}
|
||||
|
||||
return data_row.description;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@ -176,7 +185,7 @@
|
||||
-->
|
||||
<table class='header-table' cellspacing=0>
|
||||
<thead>
|
||||
<tr><td><h1>Delivery Note</h1></td></tr>
|
||||
<tr><td><script>'<h1>' + (doc.select_print_heading || 'Delivery Note') + '</h1>'</script></td></tr>
|
||||
<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -135,17 +135,26 @@
|
||||
null,
|
||||
{
|
||||
'description' : function(data_row) {
|
||||
if(data_row.serial_no) {
|
||||
return (
|
||||
data_row.description +
|
||||
'<div style="padding-left: 15px;"><i>Serial No.:' +
|
||||
((data_row.serial_no.indexOf('\n')>-1)?'<br />':' ') +
|
||||
data_row.serial_no + '</i></div>'
|
||||
);
|
||||
} else {
|
||||
return data_row.description;
|
||||
var to_append = ''
|
||||
if(data_row.adj_rate){
|
||||
to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
|
||||
data_row.adj_rate + '%</i></div>';
|
||||
if(data_row.description.indexOf(to_append)==-1) {
|
||||
data_row.description = data_row.description + to_append;
|
||||
}
|
||||
}
|
||||
|
||||
if(data_row.serial_no) {
|
||||
to_append = '<div style="padding-left: 15px;"><i>Serial No.:' +
|
||||
((data_row.serial_no.indexOf('\n')>-1)?'<br />':' ') +
|
||||
data_row.serial_no + '</i></div>';
|
||||
if(data_row.description.indexOf(to_append)==-1) {
|
||||
data_row.description = data_row.description + to_append;
|
||||
}
|
||||
}
|
||||
|
||||
return data_row.description;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@ -199,7 +208,7 @@
|
||||
-->
|
||||
<table class='header-table' cellspacing=0>
|
||||
<thead>
|
||||
<tr><td colspan=2><div><h1>Delivery Note</h1></div></td></tr>
|
||||
<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Delivery Note') + '</h1>'</script></div></td></tr>
|
||||
<tr><td colspan=2><div style="height:15px"></div></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -303,4 +312,3 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -134,17 +134,26 @@
|
||||
null,
|
||||
{
|
||||
'description' : function(data_row) {
|
||||
if(data_row.serial_no) {
|
||||
return (
|
||||
data_row.description +
|
||||
'<div style="padding-left: 15px;"><i>Serial No.:' +
|
||||
((data_row.serial_no.indexOf('\n')>-1)?'<br />':' ') +
|
||||
data_row.serial_no + '</i></div>'
|
||||
);
|
||||
} else {
|
||||
return data_row.description;
|
||||
var to_append = ''
|
||||
if(data_row.adj_rate){
|
||||
to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
|
||||
data_row.adj_rate + '%</i></div>';
|
||||
if(data_row.description.indexOf(to_append)==-1) {
|
||||
data_row.description = data_row.description + to_append;
|
||||
}
|
||||
}
|
||||
|
||||
if(data_row.serial_no) {
|
||||
to_append = '<div style="padding-left: 15px;"><i>Serial No.:' +
|
||||
((data_row.serial_no.indexOf('\n')>-1)?'<br />':' ') +
|
||||
data_row.serial_no + '</i></div>';
|
||||
if(data_row.description.indexOf(to_append)==-1) {
|
||||
data_row.description = data_row.description + to_append;
|
||||
}
|
||||
}
|
||||
|
||||
return data_row.description;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@ -198,7 +207,7 @@
|
||||
-->
|
||||
<table class='header-table' cellspacing=0>
|
||||
<thead>
|
||||
<tr><td colspan=2><h1>Delivery Note</h1></td></tr>
|
||||
<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Delivery Note') + '</h1>'</script></td></tr>
|
||||
<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -298,5 +307,3 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -160,7 +160,7 @@
|
||||
-->
|
||||
<table class='header-table' cellspacing=0>
|
||||
<thead>
|
||||
<tr><td><h1>Purchase Order</h1></td></tr>
|
||||
<tr><td><script>'<h1>' + (doc.select_print_heading || 'Purchase Order') + '</h1>'</script></td></tr>
|
||||
<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -246,4 +246,3 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -183,7 +183,7 @@
|
||||
-->
|
||||
<table class='header-table' cellspacing=0>
|
||||
<thead>
|
||||
<tr><td colspan=2><div><h1>Purchase Order</h1></div></td></tr>
|
||||
<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Purchase Order') + '</h1>'</script></div></td></tr>
|
||||
<tr><td colspan=2><div style="height:15px"></div></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -273,4 +273,3 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -182,7 +182,7 @@
|
||||
-->
|
||||
<table class='header-table' cellspacing=0>
|
||||
<thead>
|
||||
<tr><td colspan=2><h1>Purchase Order</h1></td></tr>
|
||||
<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Purchase Order') + '</h1>'</script></td></tr>
|
||||
<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -268,5 +268,3 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -107,7 +107,22 @@
|
||||
[// Here specify the column widths
|
||||
'3%', '10%', '15%', '32%', '5%',
|
||||
'5%', '15%', '15%'
|
||||
]
|
||||
],
|
||||
null,
|
||||
null,
|
||||
{
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
|
||||
data_row.adj_rate + '%</i></div>';
|
||||
if(data_row.description.indexOf(to_append)==-1) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
} else {
|
||||
return data_row.description;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// This code takes care of page breaks
|
||||
@ -160,7 +175,9 @@
|
||||
-->
|
||||
<table class='header-table' cellspacing=0>
|
||||
<thead>
|
||||
<tr><td><h1>Quotation</h1></td></tr>
|
||||
<tr><td>
|
||||
<script>'<h1>' + (doc.select_print_heading || 'Quotation') + '</h1>'</script>
|
||||
</td></tr>
|
||||
<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -253,4 +270,3 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -130,7 +130,22 @@
|
||||
[// Here specify the column widths
|
||||
'3%', '10%', '15%', '32%', '5%',
|
||||
'5%', '15%', '15%'
|
||||
]
|
||||
],
|
||||
null,
|
||||
null,
|
||||
{
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
|
||||
data_row.adj_rate + '%</i></div>';
|
||||
if(data_row.description.indexOf(to_append)==-1) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
} else {
|
||||
return data_row.description;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// This code takes care of page breaks
|
||||
@ -183,7 +198,7 @@
|
||||
-->
|
||||
<table class='header-table' cellspacing=0>
|
||||
<thead>
|
||||
<tr><td colspan=2><div><h1>Quotation</h1></div></td></tr>
|
||||
<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Quotation') + '</h1>'</script></div></td></tr>
|
||||
<tr><td colspan=2><div style="height:15px"></div></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -280,4 +295,3 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -129,7 +129,22 @@
|
||||
[// Here specify the column widths
|
||||
'3%', '10%', '15%', '32%', '5%',
|
||||
'5%', '15%', '15%'
|
||||
]
|
||||
],
|
||||
null,
|
||||
null,
|
||||
{
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
|
||||
data_row.adj_rate + '%</i></div>';
|
||||
if(data_row.description.indexOf(to_append)==-1) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
} else {
|
||||
return data_row.description;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// This code takes care of page breaks
|
||||
@ -182,7 +197,7 @@
|
||||
-->
|
||||
<table class='header-table' cellspacing=0>
|
||||
<thead>
|
||||
<tr><td colspan=2><h1>Quotation</h1></td></tr>
|
||||
<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Quotation') + '</h1>'</script></td></tr>
|
||||
<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -275,5 +290,3 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -107,7 +107,22 @@
|
||||
[// Here specify the column widths
|
||||
'3%', '20%', '37%', '5%',
|
||||
'5%', '15%', '15%'
|
||||
]
|
||||
],
|
||||
null,
|
||||
null,
|
||||
{
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
|
||||
data_row.adj_rate + '%</i></div>';
|
||||
if(data_row.description.indexOf(to_append)==-1) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
} else {
|
||||
return data_row.description;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// This code takes care of page breaks
|
||||
@ -128,7 +143,6 @@
|
||||
|
||||
|
||||
print_other_charges: function(parent) {
|
||||
console.log(parent);
|
||||
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
|
||||
var rows = '<table width=100%>\n';
|
||||
for(var i=0; i<oc.length; i++) {
|
||||
@ -161,7 +175,7 @@
|
||||
-->
|
||||
<table class='header-table' cellspacing=0>
|
||||
<thead>
|
||||
<tr><td><h1>Invoice</h1></td></tr>
|
||||
<tr><td><script>'<h1>' + (doc.select_print_heading || 'Invoice') + '</h1>'</script></td></tr>
|
||||
<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -258,4 +272,3 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -130,7 +130,22 @@
|
||||
[// Here specify the column widths
|
||||
'3%', '20%', '37%', '5%',
|
||||
'5%', '15%', '15%'
|
||||
]
|
||||
],
|
||||
null,
|
||||
null,
|
||||
{
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
|
||||
data_row.adj_rate + '%</i></div>';
|
||||
if(data_row.description.indexOf(to_append)==-1) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
} else {
|
||||
return data_row.description;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// This code takes care of page breaks
|
||||
@ -151,7 +166,6 @@
|
||||
|
||||
|
||||
print_other_charges: function(parent) {
|
||||
console.log(parent);
|
||||
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
|
||||
var rows = '<table width=100%>\n';
|
||||
for(var i=0; i<oc.length; i++) {
|
||||
@ -184,7 +198,7 @@
|
||||
-->
|
||||
<table class='header-table' cellspacing=0>
|
||||
<thead>
|
||||
<tr><td colspan=2><div><h1>Invoice</h1></div></td></tr>
|
||||
<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Invoice') + '</h1>'</script></div></td></tr>
|
||||
<tr><td colspan=2><div style="height:15px"></div></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -285,4 +299,3 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -129,7 +129,22 @@
|
||||
[// Here specify the column widths
|
||||
'3%', '20%', '37%', '5%',
|
||||
'5%', '15%', '15%'
|
||||
]
|
||||
],
|
||||
null,
|
||||
null,
|
||||
{
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
|
||||
data_row.adj_rate + '%</i></div>';
|
||||
if(data_row.description.indexOf(to_append)==-1) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
} else {
|
||||
return data_row.description;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// This code takes care of page breaks
|
||||
@ -150,7 +165,6 @@
|
||||
|
||||
|
||||
print_other_charges: function(parent) {
|
||||
console.log(parent);
|
||||
var oc = getchildren('RV Tax Detail', doc.name, 'other_charges');
|
||||
var rows = '<table width=100%>\n';
|
||||
for(var i=0; i<oc.length; i++) {
|
||||
@ -183,7 +197,7 @@
|
||||
-->
|
||||
<table class='header-table' cellspacing=0>
|
||||
<thead>
|
||||
<tr><td colspan=2><h1>Invoice</h1></td></tr>
|
||||
<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Invoice') + '</h1>'</script></td></tr>
|
||||
<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -280,5 +294,3 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -107,7 +107,22 @@
|
||||
[// Here specify the column widths
|
||||
'3%', '20%', '37%', '5%',
|
||||
'5%', '15%', '15%'
|
||||
]
|
||||
],
|
||||
null,
|
||||
null,
|
||||
{
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
|
||||
data_row.adj_rate + '%</i></div>';
|
||||
if(data_row.description.indexOf(to_append)==-1) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
} else {
|
||||
return data_row.description;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// This code takes care of page breaks
|
||||
@ -160,7 +175,7 @@
|
||||
-->
|
||||
<table class='header-table' cellspacing=0>
|
||||
<thead>
|
||||
<tr><td><h1>Sales Order</h1></td></tr>
|
||||
<tr><td><script>'<h1>' + (doc.select_print_heading || 'Sales Order') + '</h1>'</script></td></tr>
|
||||
<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -257,4 +272,3 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -130,7 +130,22 @@
|
||||
[// Here specify the column widths
|
||||
'3%', '20%', '37%', '5%',
|
||||
'5%', '15%', '15%'
|
||||
]
|
||||
],
|
||||
null,
|
||||
null,
|
||||
{
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
|
||||
data_row.adj_rate + '%</i></div>';
|
||||
if(data_row.description.indexOf(to_append)==-1) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
} else {
|
||||
return data_row.description;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// This code takes care of page breaks
|
||||
@ -183,7 +198,7 @@
|
||||
-->
|
||||
<table class='header-table' cellspacing=0>
|
||||
<thead>
|
||||
<tr><td colspan=2><div><h1>Sales Order</h1></div></td></tr>
|
||||
<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Sales Order') + '</h1>'</script></div></td></tr>
|
||||
<tr><td colspan=2><div style="height:15px"></div></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -284,4 +299,3 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -129,7 +129,22 @@
|
||||
[// Here specify the column widths
|
||||
'3%', '20%', '37%', '5%',
|
||||
'5%', '15%', '15%'
|
||||
]
|
||||
],
|
||||
null,
|
||||
null,
|
||||
{
|
||||
'description' : function(data_row) {
|
||||
if(data_row.adj_rate) {
|
||||
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
|
||||
data_row.adj_rate + '%</i></div>';
|
||||
if(data_row.description.indexOf(to_append)==-1) {
|
||||
return data_row.description + to_append;
|
||||
} else { return data_row.description; }
|
||||
} else {
|
||||
return data_row.description;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// This code takes care of page breaks
|
||||
@ -182,7 +197,7 @@
|
||||
-->
|
||||
<table class='header-table' cellspacing=0>
|
||||
<thead>
|
||||
<tr><td colspan=2><h1>Sales Order</h1></td></tr>
|
||||
<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Sales Order') + '</h1>'</script></td></tr>
|
||||
<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -279,5 +294,3 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user