<commit_before>// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
// License: GNU General Public License v3. See license.txt

// 

//--------- ONLOAD -------------
cur_frm.cscript.onload = function(doc, cdt, cdn) {
   
}

cur_frm.cscript.refresh = function(doc, cdt, cdn) {
   cur_frm.set_footnote(wn.markdown(cur_frm.meta.description));
}

cur_frm.pformat.purchase_tax_details= function(doc){
 
  //function to make row of table
  var make_row = function(title,val,bold){
    var bstart = '<b>'; var bend = '</b>';
    return '<tr><td style="width:50%;">'+(bold?bstart:'')+title+(bold?bend:'')+'</td>'
     +'<td style="width:25%;text-align:right;"></td>'
     +'<td style="width:25%;text-align:right;">'+format_currency(val, doc.currency)+'</td>'
     +'</tr>'
  }

  function convert_rate(val){
    var new_val = flt(val)/flt(doc.conversion_rate);
    return new_val;
  }

  var cl = getchildren('Purchase Taxes and Charges',doc.name,'purchase_tax_details');

  // outer table  
  var out='<div><table class="noborder" style="width:100%">\
		<tr><td style="width: 60%"></td><td>';
  
  // main table
  out +='<table class="noborder" style="width:100%">'
  if(!print_hide('net_total')) {
	out += make_row('Net Total', convert_rate(doc.net_total), 1);
  }
  
  // add rows
  if(cl.length){<commit_msg>[fix] [minor] check print hide properties in purchase standard print format<commit_after>// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
// License: GNU General Public License v3. See license.txt

// 

//--------- ONLOAD -------------
cur_frm.cscript.onload = function(doc, cdt, cdn) {
   
}

cur_frm.cscript.refresh = function(doc, cdt, cdn) {
   cur_frm.set_footnote(wn.markdown(cur_frm.meta.description));
}

cur_frm.pformat.purchase_tax_details= function(doc){
 
  //function to make row of table
  var make_row = function(title,val,bold){
    var bstart = '<b>'; var bend = '</b>';
    return '<tr><td style="width:50%;">'+(bold?bstart:'')+title+(bold?bend:'')+'</td>'
     +'<td style="width:25%;text-align:right;"></td>'
     +'<td style="width:25%;text-align:right;">'+format_currency(val, doc.currency)+'</td>'
     +'</tr>'
  }

  function convert_rate(val){
    var new_val = flt(val)/flt(doc.conversion_rate);
    return new_val;
  }
  
  function print_hide(fieldname) {
	var doc_field = wn.meta.get_docfield(doc.doctype, fieldname, doc.name);
	return doc_field.print_hide;
  }

  var cl = getchildren('Purchase Taxes and Charges',doc.name,'purchase_tax_details');

  // outer table  
  var out='<div><table class="noborder" style="width:100%">\
		<tr><td style="width: 60%"></td><td>';
  
  // main table
  out +='<table class="noborder" style="width:100%">'
  if(!print_hide('net_total')) {
	out += make_row('Net Total', convert_rate(doc.net_total), 1);
  }
  
  // add rows
  if(cl.length){
{'fraction_non_alphanumeric': 0.20347394540942929, 'fraction_numerical': 0.014179369018078695, 'mean_word_length': 3.959578207381371, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6893505', 'n_tokens_mistral': 1077, 'n_tokens_neox': 1025, 'n_words': 198}