fix pdf prints on all options

This commit is contained in:
Josh North 2021-06-17 20:03:13 -04:00
parent 0ae876cf34
commit 0fd989f726
6 changed files with 50506 additions and 14 deletions

View File

@ -120,8 +120,8 @@
<script src="js/buttons.print.min.js?v3"></script>
<script src="js/dataTables.buttons.min.js?v3"></script>
<script src="js/jszip.min.js?v3"></script>
<script src="js/pdfmake.min.js?v3"></script>
<script src="js/vfs_fonts.js?v3"></script>
<script src="js/pdfmake.min.js?v4"></script>
<script src="js/vfs_fonts.js?v4"></script>
<script src="js/moment.min.js?v3"></script>
<script src="js/tempusdominus-bootstrap-4.min.js?v3"></script>
<script src="js/jSignature.min.js?v3"></script>

50468
js/pdfmake.js Normal file

File diff suppressed because one or more lines are too long

2
js/pdfmake.min.js vendored Executable file → Normal file

File diff suppressed because one or more lines are too long

1
js/pdfmake.min.js.map Normal file

File diff suppressed because one or more lines are too long

0
js/vfs_fonts.js Executable file → Normal file
View File

View File

@ -172,7 +172,8 @@ $form_data = filter_input_array(INPUT_POST, [
<hr />
<!-- REPORT RUNNER END -->
<?php if (isset($form_data['reporttype'])): ?>
<?php if (isset($form_data['reporttype'])) { ?>
<?php if ($form_data['reporttype'] == "Default") { ?>
<!-- DEFAULT REPORT -->
<?php
@ -242,10 +243,9 @@ $form_data = filter_input_array(INPUT_POST, [
</table>
</div>
<!-- DEFAULT REPORT END -->
<?php } ?>
<?php if (isset($form_data['reporttype'])): ?>
<?php if ($form_data['reporttype'] == "Vendors") { ?>
<?php } elseif ($form_data['reporttype'] == "Vendors") {?>
<!-- DEFAULT REPORT -->
<?php
$approval = "2";
@ -371,16 +371,15 @@ $form_data = filter_input_array(INPUT_POST, [
<!-- DEFAULT REPORT END -->
<?php } ?>
<?php endif; ?>
<?php } else { ?>
<?php else: ?>
<div class="container">
<div class="row">
<p>- - - - - - - - - - -</p>
</div>
</div>
<?php endif; ?>
<?php } ?>
<script>
$(document).ready(function() {
$('#report').DataTable( {
@ -409,12 +408,36 @@ $form_data = filter_input_array(INPUT_POST, [
exportOptions: {
stripNewlines: false,
//pageSize : 'A5',
<?php if($selsite=="%" && $form_data['reporttype'] == "Default") { ?>
columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ],
<?php } elseif($selsite=="%" && $form_data['reporttype'] == "Vendors") { ?>
columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ],
<?php } elseif($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA" && $form_data['reporttype'] == "Default") { ?>
columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ],
<?php } elseif($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US" && $form_data['reporttype'] == "Default") { ?>
columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ],
<?php } elseif($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA" && $form_data['reporttype'] == "Vendors") { ?>
columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ],
<?php } elseif($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US" && $form_data['reporttype'] == "Vendors") { ?>
columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ],
<?php } ?>
},
customize: function (doc) {
doc.defaultStyle.fontSize = '6'; //<-- set fontsize to 16 instead of 10
doc['content']['1'].layout = 'lightHorizontalLines';
doc.content[1].table.widths = ["5%", "5%", "4%", "10%", "15%", "10%","10%", "6%", "10%", "6%", "5%", "14%"];
// Array(doc.content[1].table.body[0].length + 1).join('*').split('');
<?php if($selsite=="%" && $form_data['reporttype'] == "Default") { ?>
doc.content[1].table.widths = ["5%", "5%", "4%", "10%", "15%", "8%","8%", "7%", "5%", "4%", "4%", "6%", "5%", "9%", "6%"];
<?php } elseif($selsite=="%" && $form_data['reporttype'] == "Vendors") { ?>
doc.content[1].table.widths = ["5%", "5%", "4%", "10%", "15%", "8%","8%", "7%", "6%", "5%", "5%", "7%", "6%", "9%"];
<?php } elseif($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA" && $form_data['reporttype'] == "Default") { ?>
doc.content[1].table.widths = ["5%", "5%", "4%", "10%", "15%", "8%","8%", "7%", "5%", "4%", "4%", "6%", "5%", "14%"];
<?php } elseif($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US" && $form_data['reporttype'] == "Default") { ?>
doc.content[1].table.widths = ["5%", "5%", "4%", "10%", "15%", "8%","8%", "7%", "6%", "7%", "6%", "5%", "14%"];
<?php } elseif($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "EMEA" && $form_data['reporttype'] == "Vendors") { ?>
doc.content[1].table.widths = ["6%", "6%", "5%", "11%", "16%", "9%","9%", "8%", "6%", "6%", "5%", "7%", "5%"];
<?php } elseif($SiteInfo->getSite($siteid, $uid, "0", "0")[0]["sites_region"] == "US" && $form_data['reporttype'] == "Vendors") { ?>
doc.content[1].table.widths = ["6%", "6%", "6%", "12%", "16%", "9%","9%", "8%", "7%", "8%", "7%", "5%"];
<?php } ?>
},
},
{