@ -2078,13 +2078,15 @@ return lh;},print_style:"\
font - size : 14 px ; \
font - weight : bold ; \
margin : 8 px 0 px ; \
} " , print_std : function ( no_letterhead ) { var docname = cur_frm . docname ; var doctype = cur_frm . doctype ; var data = getchildren ( 'DocField' , doctype , 'fields' , 'DocType' ) ; var layout = _ p . add_layout ( doctype ) ; this . pf_list = [ layout ] ; var me = this ; me . layout = layout ; $ . extend ( this , { build_head : function ( doctype , docname ) { var h1_style = { fontSize : '22px' , marginBottom : '8px' }
var h1 = $a ( me . layout . cur_row . header , 'h1' , '' , h1_style ) ; h1 . innerHTML = cur_frm . pformat [ docname ] ? cur_frm . pformat [ docname ] : get_doctype_label ( doctype ) ; var h2_style = { fontSize : '16px' , color : '#888' , marginBottom : '8px' , paddingBottom : '8px' , borderBottom : ( me . layout . with_border ? '0px' : '1px solid #000' ) }
} " , print_std : function ( no_letterhead ) { var docname = cur_frm . docname ; var doctype = cur_frm . doctype ; var data = getchildren ( 'DocField' , doctype , 'fields' , 'DocType' ) ; var layout = _ p . add_layout ( doctype ) ; this . pf_list = [ layout ] ; var me = this ; me . layout = layout ; $ . extend ( this , { build_head : function ( data , doctype , docname ) { var h1_style = { fontSize : '22px' , marginBottom : '8px' }
var h1 = $a ( me . layout . cur_row . header , 'h1' , '' , h1_style ) ; if ( cur_frm . pformat [ docname ] ) { h1 . innerHTML = cur_frm . pformat [ docname ] ; } else { var val = null ; for ( var i = 0 ; i < data . length ; i ++ ) { if ( data [ i ] . fieldname === 'select_print_heading' ) { val = _ f . get_value ( doctype , docname , data [ i ] . fieldname ) ; break ; } }
h1 . innerHTML = val ? val : get_doctype_label ( doctype ) ; }
var h2_style = { fontSize : '16px' , color : '#888' , marginBottom : '8px' , paddingBottom : '8px' , borderBottom : ( me . layout . with_border ? '0px' : '1px solid #000' ) }
var h2 = $a ( me . layout . cur_row . header , 'div' , '' , h2_style ) ; h2 . innerHTML = docname ; } , build_data : function ( data , doctype , docname ) { if ( data [ 0 ] && data [ 0 ] . fieldtype != "Section Break" ) { me . layout . addrow ( ) ; if ( data [ 0 ] . fieldtype != "Column Break" ) { me . layout . addcell ( ) ; } }
$ . extend ( this , { generate_custom_html : function ( field , doctype , docname ) { var container = $a ( me . layout . cur_cell , 'div' ) ; container . innerHTML = cur_frm . pformat [ field . fieldname ] ( locals [ doctype ] [ docname ] ) ; } , render_normal : function ( field , data , i ) { switch ( field . fieldtype ) { case 'Section Break' : me . layout . addrow ( ) ; if ( data [ i + 1 ] && data [ i + 1 ] . fieldtype != 'Column Break' ) { me . layout . addcell ( ) ; }
break ; case 'Column Break' : me . layout . addcell ( field . width , field . label ) ; break ; case 'Table' : var table = print_table ( doctype , docname , field . fieldname , field . options , null , null , null , null ) ; me . layout = _ p . print_std_add_table ( table , me . layout , me . pf_list , doctype , no_letterhead ) ; break ; case 'HTML' : var div = $a ( me . layout . cur_cell , 'div' ) ; div . innerHTML = field . options ; break ; case 'Code' : var div = $a ( me . layout . cur_cell , 'div' ) ; var val = _ f . get_value ( doctype , docname , field . fieldname ) ; div . innerHTML = '<div>' + field . label + ': </div><pre style="font-family: Courier, Fixed;">' + ( val ? val : '' ) + '</pre>' ; break ; case 'Text Editor' : var div = $a ( me . layout . cur_cell , 'div' ) ; var val = _ f . get_value ( doctype , docname , field . fieldname ) ; div . innerHTML = val ? val : '' ; break ; default : _ p . print_std_add_field ( doctype , docname , field , me . layout ) ; break ; } } } ) ; for ( var i = 0 ; i < data . length ; i ++ ) { var fieldname = data [ i ] . fieldname ? data [ i ] . fieldname : data [ i ] . label ; var field = fieldname ? get_field ( doctype , fieldname , docname ) : data [ i ] ; if ( ! field . print_hide ) { if ( cur_frm . pformat [ field . fieldname ] ) { this . generate_custom_html ( field , doctype , docname ) ; } else { this . render_normal ( field , data , i ) ; } } }
me . layout . close_borders ( ) ; } , build_html : function ( ) { var html = '' ; for ( var i = 0 ; i < me . pf_list . length ; i ++ ) { if ( me . pf_list [ i ] . wrapper ) { html += me . pf_list [ i ] . wrapper . innerHTML ; } else if ( me . pf_list [ i ] . innerHTML ) { html += me . pf_list [ i ] . innerHTML ; } else { html += me . pf_list [ i ] ; } }
this . pf_list = [ ] ; return html ; } } ) ; this . build_head ( doctype , docname ) ; this . build_data ( data , doctype , docname ) ; var html = this . build_html ( ) ; return html ; } , add_layout : function ( doctype ) { var layout = new Layout ( ) ; layout . addrow ( ) ; if ( locals [ 'DocType' ] [ doctype ] . print_outline == 'Yes' ) { layout . with_border = 1 }
this . pf_list = [ ] ; return html ; } } ) ; this . build_head ( data , d octype , docname ) ; this . build_data ( data , doctype , docname ) ; var html = this . build_html ( ) ; return html ; } , add_layout : function ( doctype ) { var layout = new Layout ( ) ; layout . addrow ( ) ; if ( locals [ 'DocType' ] [ doctype ] . print_outline == 'Yes' ) { layout . with_border = 1 }
return layout ; } , print_std_add_table : function ( t , layout , pf_list , dt , no_letterhead ) { if ( t . appendChild ) { layout . cur_cell . appendChild ( t ) ; } else { page_break = ' \ n \
< div style = "page-break-after: always;" \
class = "page_break" > < / d i v > < d i v c l a s s = " p a g e - s e t t i n g s " > < / d i v > ' ; f o r ( v a r i = 0 ; i < t . l e n g t h - 1 ; i + + ) { l a y o u t . c u r _ c e l l . a p p e n d C h i l d ( t [ i ] ) ; l a y o u t . c l o s e _ b o r d e r s ( ) ; p f _ l i s t . p u s h ( p a g e _ b r e a k ) ; l a y o u t = _ p . a d d _ l a y o u t ( d t , n o _ l e t t e r h e a d ) ; p f _ l i s t . p u s h ( l a y o u t ) ; l a y o u t . a d d r o w ( ) ; l a y o u t . a d d c e l l ( ) ; v a r d i v = $ a ( l a y o u t . c u r _ c e l l , ' d i v ' ) ; d i v . i n n e r H T M L = ' C o n t i n u e d f r o m p r e v i o u s p a g e . . . ' ; d i v . s t y l e . p a d d i n g = ' 4 p x ' ; }