CasperSecurity
<div class="row">
<div class="card z-auto p-[25px]" style="min-height: 690px;">
<div class="card-body">
<?php if(sizeof($datatable) > 0): ?>
<div class="card-body">
<div class="overflow-x-auto table-scroll">
<div class="card-body table-responsive pt-0" id="Assets">
<?php if($org): ?>
<div class="text-center mb-4">
<div class="font-bold text-2xl"><?php echo e($org['organisation_name']); ?></div>
<div class="font-bold text-xl mt-2">Chart Of Account-Assets</div>
</div>
<?php endif; ?>
<?php $__currentLoopData = $assets; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $accountGroup => $groupedByGroup): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<h2 class="text-lg font-semibold mt-2"><?php echo e($accountGroup); ?></h2>
<ul class="list-disc ml-6">
<?php $__currentLoopData = $groupedByGroup; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li><?php echo e($data->ledger_head_name); ?></li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</ul>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
<div class="overflow-x-auto table-scroll">
<div class="card-body table-responsive pt-0" id="Liabilities">
<?php if($org): ?>
<div class="text-center mb-4">
<div class="font-bold text-2xl"><?php echo e($org['organisation_name']); ?></div>
<div class="font-bold text-xl mt-2">Chart Of Account - Liabilities</div>
</div>
<?php endif; ?>
<?php $__currentLoopData = $liabilities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $accountGroup => $groupedByGroup): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<h2 class="text-lg font-semibold mt-2"><?php echo e($accountGroup); ?></h2>
<ul class="list-disc ml-6">
<?php $__currentLoopData = $groupedByGroup; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li><?php echo e($data->ledger_head_name); ?></li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</ul>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
<div class="overflow-x-auto table-scroll">
<div class="card-body table-responsive pt-0" id="Equity">
<?php if($org): ?>
<div class="text-center mb-4">
<div class="font-bold text-2xl"><?php echo e($org['organisation_name']); ?></div>
<div class="font-bold text-xl mt-2">Chart Of Account - Equity</div>
</div>
<?php endif; ?>
<?php $__currentLoopData = $equity; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $accountGroup => $groupedByGroup): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<h2 class="text-lg font-semibold mt-2"><?php echo e($accountGroup); ?></h2>
<ul class="list-disc ml-6">
<?php $__currentLoopData = $groupedByGroup; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li><?php echo e($data->ledger_head_name); ?></li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</ul>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
<div class="overflow-x-auto table-scroll">
<div class="card-body table-responsive pt-0" id="Income">
<?php if($org): ?>
<div class="text-center mb-4">
<div class="font-bold text-2xl"><?php echo e($org['organisation_name']); ?></div>
<div class="font-bold text-xl mt-2">Chart Of Account - Income</div>
</div>
<?php endif; ?>
<?php $__currentLoopData = $income; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $accountGroup => $groupedByGroup): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<h2 class="text-lg font-semibold mt-2"><?php echo e($accountGroup); ?></h2>
<ul class="list-disc ml-6">
<?php $__currentLoopData = $groupedByGroup; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li><?php echo e($data->ledger_head_name); ?></li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</ul>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
<div class="overflow-x-auto table-scroll">
<div class="card-body table-responsive pt-0" id="Expense">
<?php if($org): ?>
<div class="text-center mb-4">
<div class="font-bold text-2xl"><?php echo e($org['organisation_name']); ?></div>
<div class="font-bold text-xl mt-2">Chart Of Account - Expense</div>
</div>
<?php endif; ?>
<?php $__currentLoopData = $expense; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $accountGroup => $groupedByGroup): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<h2 class="text-lg font-semibold mt-2"><?php echo e($accountGroup); ?></h2>
<ul class="list-disc ml-6">
<?php $__currentLoopData = $groupedByGroup; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<li><?php echo e($data->ledger_head_name); ?></li>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</ul>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</div>
</div>
<div class="flex justify-center mt-4">
<button class="btn xl:py-[0.719rem] mr-4 py-2.5 xl:px-[1.563rem] px-4 duration-300 xl:text-[15px] text-[13px] font-medium rounded text-danger bg-danger-light leading-5 inline-block border border-danger-light btn-danger light hover:text-white hover:bg-danger offcanvas-close" wire:click="closemodalclick">Cancel</button>
<button class="btn btn-primary xl:py-[0.719rem] py-2.5 xl:px-[1.563rem] px-4 duration-300 xl:text-[15px] text-[13px] font-medium rounded text-white bg-primary leading-5 inline-block border border-primary hover:bg-hover-primary" onclick="downloadAllAssets('Assets','Liabilities','Equity','Income','Expense')"><span class="indicator-label">Download</span></button>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php $__env->startSection('externaljs'); ?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.9.2/html2pdf.bundle.min.js"></script>
<script>
function downloadAllAssets(assetsdivid,liabilitiesdivid,equitydivid,incomedivid,expensedivid) {
var divs = ['Assets','Liabilities','Equity','Income','Expense']; // List of div IDs you want to include
var Chart_Of_Account = 'Chart_Of_Account_report.pdf'; // Filename
var opt = {
margin: [0.5, 0.5, 0.5, 0.5],
filename: Chart_Of_Account,
image: { type: 'jpeg', quality: 1 },
html2canvas: { scale: 2 }, // Adjust scale if needed for better resolution
jsPDF: { unit: 'in', format: 'a4', orientation: 'portrait' }
};
// Initialize html2pdf for the first div
var pdf = html2pdf().from(document.getElementById(divs[0])).set(opt).toPdf();
// Loop through the rest of the divs and add them as new pages
for (var i = 1; i < divs.length; i++) {
pdf = pdf.get('pdf').then(function(pdfInstance) {
pdfInstance.addPage(); // Add a new page for each div
}).from(document.getElementById(divs[i])).toContainer().toCanvas().toPdf();
}
// Finalize and save the PDF
pdf.get('pdf').then(function(pdf) {
pdf.save(Chart_Of_Account); // Save the final merged PDF
});
}
</script>
<?php $__env->stopSection(); ?>
<?php /**PATH /var/www/orientalss.com/resources/views/livewire/report/chartaccount-report-livewire.blade.php ENDPATH**/ ?>