<commit_before>wn.pages['voucher-import-tool'].onload = function(wrapper) { 
	wn.ui.make_app_page({
		parent: wrapper,
		title: 'Voucher Import Tool',
		single_column: true
	});
	
	$(wrapper).find('.layout-main').html('\
		<p class="help">Import multiple accounting entries via CSV (spreadsheet) file:</p>\
		<h3>1. Download Template</h3><br>\
		<div style="padding-left: 30px;">\
			<button class="btn btn-default btn-download-two-accounts">Download</button>\
			<p class="help">Import multiple vouchers with one debit and one credit entry</p>\
		</div>\
		<div style="padding-left: 30px;">\
			<button class="btn btn-default btn-download-multiple-accounts">Download</button>\
			<p class="help">Import multiple vouchers with multiple accounts</p>\
		</div>\
		<hr>\
		<h3>2. Upload</h3><br>\
		<div style="padding-left: 30px;">\
			<p class="help">Upload file in CSV format with UTF-8 encoding</p>\
			<div id="voucher-upload"></div>\
		</div><br>\
		<div class="working"></div>\
		<div class="well messages" style="display: none;"></div>');
		
	wn.upload.make({
		parent: $(wrapper).find("#voucher-upload"),
		args: {
			method: "accounts.page.voucher_import_tool.voucher_import_tool.upload"
		},
		callback: function(fid, filename, r) {
			wrapper.waiting.toggle(false);
			$(wrapper).find(".messages").toggle(true).html(
				r.join("<div style='margin:4px; border-top:1px solid #aaa;'></div>"))
		}
	});
	
	wrapper.waiting = wn.messages.waiting($(wrapper).find('.working'), 
		"Importing Vouchers...").toggle(false);

	$(wrapper).find(".btn-download-two-accounts").click(function() {
		window.location.href = wn.request.url + 
			'?cmd=accounts.page.voucher_import_tool.voucher_import_tool.get_template' + 	
			'&type=Two Accounts';
	});

	$(wrapper).find(".btn-download-multiple-accounts").click(function() {
		window.location.href = wn.request.url + 
				'?cmd=accounts.page.voucher_import_tool.voucher_import_tool.get_template' + 
				'&type=Multiple Accounts';
	});<commit_msg>[fix] [minor] error display in voucher import tool<commit_after>wn.pages['voucher-import-tool'].onload = function(wrapper) { 
	wn.ui.make_app_page({
		parent: wrapper,
		title: 'Voucher Import Tool',
		single_column: true
	});
	
	$(wrapper).find('.layout-main').html('\
		<p class="help">Import multiple accounting entries via CSV (spreadsheet) file:</p>\
		<h3>1. Download Template</h3><br>\
		<div style="padding-left: 30px;">\
			<button class="btn btn-default btn-download-two-accounts">Download</button>\
			<p class="help">Import multiple vouchers with one debit and one credit entry</p>\
		</div>\
		<div style="padding-left: 30px;">\
			<button class="btn btn-default btn-download-multiple-accounts">Download</button>\
			<p class="help">Import multiple vouchers with multiple accounts</p>\
		</div>\
		<hr>\
		<h3>2. Upload</h3><br>\
		<div style="padding-left: 30px;">\
			<p class="help">Upload file in CSV format with UTF-8 encoding</p>\
			<div id="voucher-upload"></div>\
		</div><br>\
		<div class="working"></div>\
		<div class="well messages" style="display: none;"></div>');
		
	wn.upload.make({
		parent: $(wrapper).find("#voucher-upload"),
		args: {
			method: "accounts.page.voucher_import_tool.voucher_import_tool.upload"
		},
		callback: function(fid, filename, r) {
			wrapper.waiting.toggle(false);
			$(wrapper).find(".messages").toggle(true).html(
				r.message.join("<div style='margin:4px; border-top:1px solid #aaa;'></div>"))
		}
	});
	
	wrapper.waiting = wn.messages.waiting($(wrapper).find('.working'), 
		"Importing Vouchers...").toggle(false);

	$(wrapper).find(".btn-download-two-accounts").click(function() {
		window.location.href = wn.request.url + 
			'?cmd=accounts.page.voucher_import_tool.voucher_import_tool.get_template' + 	
			'&type=Two Accounts';
	});

	$(wrapper).find(".btn-download-multiple-accounts").click(function() {
		window.location.href = wn.request.url + 
				'?cmd=accounts.page.voucher_import_tool.voucher_import_tool.get_template' + 
				'&type=Multiple Accounts';
	});
{'fraction_non_alphanumeric': 0.19392581528503858, 'fraction_numerical': 0.0074682598954443615, 'mean_word_length': 4.4815825375170535, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5997120', 'n_tokens_mistral': 1551, 'n_tokens_neox': 1381, 'n_words': 239}