<?php $__env->startSection('content'); ?>
<div class="main-content-wrapper">
	<div class="main-box">
		<div class="main-content">
			<div class="container">
				<div class="page">
					<div class="row">
						<div class="report-capital layout-print">
							<div class="header">
								<div class="logo">
									<img src="<?php echo e(asset('assets/images/resize')); ?>/<?php echo e($branch->branch_img); ?>" alt="" width="200px">
								</div>
								<div class="title">
									<h2><?php echo e($branch->branch_kh); ?></h2>
									<h2><?php echo e($branch->branch_en); ?></h2>
									<h3>របាយការណ៍ពីការបង់ប្រាក់ដែលបានប្រមូល​​​</h3>
								</div>
								<div class="clear"></div>
								<div class="border-bottom"></div>
								<div class="table">
									<table>
										<thead>
											<tr>
												<th>No</th>
												<th>Due Date</th>
												<th>Project</th>
												<th>Item</th>
												<th>Client Name</th>
												<th>Contact</th>
												<th>Principle</th>
												<th>Interest</th>
												<th>Penalty</th>
												<th>Total</th>
											</tr>
										</thead>
										<tbody>
											<?php

											use App\SaleStockModel;

											$total_interest 	= 0;
											$total_payment		= 0;
											$total_principle	= 0;
											$total_penalty 		= 0;
											?>
											<?php $__currentLoopData = $collected; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
											<?php
											$total_principle 	+= $value->principle;
											$total_interest 	+= $value->interest;
											$total_payment 		+= $value->payment;
											$total_penalty		+= $value->penalty;
											$itemname 			= SaleStockModel::find($value->sale_id)->itemhouse();
											?>
											<tr>
												<td><?php echo e($key+1); ?></td>
												<td><?php echo e(date('d-m-Y',strtotime($value->do_date))); ?></td>
												<td><?php echo e($value->project_name); ?></td>
												<td><?php echo e($itemname); ?></td>
												<td><?php echo e($value->client_name); ?></td>
												<td><?php echo e($value->client_contact); ?></td>
												<td>$<?php echo e(number_format($value->principle,2)); ?></td>
												<td>$<?php echo e(number_format($value->interest,2)); ?></td>
												<td>$<?php echo e(number_format($value->penalty,2)); ?></td>
												<td>$<?php echo e(number_format($value->payment,2)); ?></td>
											</tr>
											<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
										</tbody>
										<tfoot>
											<tr>
												<th colspan="6">Total</th>
												<th>$<?php echo e(number_format($total_principle,2)); ?></th>
												<th>$<?php echo e(number_format($total_interest,2)); ?></th>
												<th>$<?php echo e(number_format($total_penalty,2)); ?></th>
												<th>$<?php echo e(number_format($total_payment,2)); ?></th>
											</tr>
										</tfoot>
									</table>
									<div class="make-date">
										<p>ធ្វើនៅ​ <strong>ភ្នំពេញ</strong> ថ្ងៃទី <strong><?php echo e(\Globals::date_khmers(date('Y-m-d'))); ?></strong></p>
									</div>
									<div class="sign">
										<h3>ហត្ថលេខា</h3>
										<p>_________________</p>
									</div>
								</div>
							</div>
						</div>


					</div>


				</div>
			</div>
		</div>
	</div>
</div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.print', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>