<?php $__env->startSection('title','FCR Calculation'); ?>

<?php $__env->startSection('css'); ?>
    <style>
        @page  {
            margin: 10px;
        }
        body {
            font-family: 'Noto Sans Bengali', sans-serif;
            font-size: 10px;
            margin: 0;
            padding: 0;
        }
        .container {
            width: 100%;
            margin: 0 auto;
        }
        .main-table {
            width: 100%;
            border-collapse: collapse;
            table-layout: fixed; /* Crucial for fixed column widths */
        }
        .main-td {
            vertical-align: top;
            padding: 5px;
            width: 33.33%;
            border: none;
        }
        .data-table {
            width: 100%;
            border-collapse: collapse;
            border: 1px solid #000;
        }
        .data-table th, .data-table td {
            border: 1px solid #000;
            padding: 2px 4px; /* Reduced padding */
            font-size: 10px;
        }
        .data-table th {
            background-color: #f2f2f2;
            text-align: center;
            font-weight: bold;
        }
        .text-center {
            text-align: center;
        }
        .text-right {
            text-align: right;
        }
        .signature-box {
            margin-top: 40px; /* Reduced margin */
            text-align: center;
            page-break-inside: avoid;
        }
        .signature-line {
            border-top: 1px solid #000;
            width: 80%;
            margin: 0 auto;
            padding-top: 5px;
            font-weight: bold;
        }
        h3 {
            margin: 5px 0 10px 0;
            font-size: 14px;
        }
    </style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <div class="container">
        <h3 class="text-center">FCR Calculation - <?php echo e($farmer->name); ?> (Batch No - <?php echo e($fcr->batch_number); ?>)</h3>
        
        <table class="main-table">
            <tr>
                <!-- Column 1: Production Info -->
                <td class="main-td">
                    <table class="data-table">
                        <thead>
                            <tr>
                                <th colspan="2">Production Info</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>Given Chicks</td>
                                <td class="text-center"><?php echo e($fcr->given_chicks_quantity); ?> Pc</td>
                            </tr>
                            <tr>
                                <td>Chicks Rate</td>
                                <td class="text-center"><?php echo e($fcr->chicks_rate); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Sold Qty</td>
                                <td class="text-center"><?php echo e($fcr->sold_quantity); ?> Pc</td>
                            </tr>
                            <tr>
                                <td>Sold Kg</td>
                                <td class="text-center"><?php echo e($fcr->sold_kg); ?> Kg</td>
                            </tr>
                            <tr>
                                <td>Avg Weight</td>
                                <td class="text-center"><?php echo e($fcr->average_weight); ?> Kg</td>
                            </tr>
                            <tr>
                                <td>Farm Loose</td>
                                <td class="text-center"><?php echo e($fcr->farm_loose_quantity); ?> Pc</td>
                            </tr>
                            <tr>
                                <td>Loose Kg</td>
                                <td class="text-center"><?php echo e($fcr->farm_loose_kg); ?> Kg</td>
                            </tr>
                            <tr>
                                <td>Farm Stock</td>
                                <td class="text-center"><?php echo e($fcr->farm_stock_quantity); ?> Pc</td>
                            </tr>
                            <tr>
                                <td>Stock Kg</td>
                                <td class="text-center"><?php echo e($fcr->farm_stock_kg); ?> Kg</td>
                            </tr>
                            <tr>
                                <td>Cartoon Dead</td>
                                <td class="text-center"><?php echo e($fcr->cartoon_dead); ?> Pc</td>
                            </tr>
                            <tr>
                                <td>Farm Dead</td>
                                <td class="text-center"><?php echo e($fcr->farm_dead); ?> Pc</td>
                            </tr>
                            <tr>
                                <td>Missing Qty</td>
                                <td class="text-center"><?php echo e($fcr->missing_quantity); ?> Pc</td>
                            </tr>
                            <tr>
                                <td>Missing Kg</td>
                                <td class="text-center"><?php echo e($fcr->missing_kg); ?> Kg</td>
                            </tr>
                            <tr>
                                <td>Bonus Chicks</td>
                                <td class="text-center"><?php echo e($fcr->bonus_chicks); ?> Pc</td>
                            </tr>
                            <tr>
                                <td>Bonus Money</td>
                                <td class="text-center"><?php echo e($fcr->bonus_chicks_money); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Excess Dead</td>
                                <td class="text-center"><?php echo e($fcr->excess_dead); ?> Pc</td>
                            </tr>
                        </tbody>
                    </table>
                </td>

                <!-- Column 2: Deductions -->
                <td class="main-td">
                    <table class="data-table">
                        <thead>
                            <tr>
                                <th colspan="2">Deductions / Cutting</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>Loose Cut</td>
                                <td class="text-center"><?php echo e($fcr->farm_loose_cutting); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Stock Cut</td>
                                <td class="text-center"><?php echo e($fcr->farm_stock_cutting); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Dead Cut</td>
                                <td class="text-center"><?php echo e($fcr->excess_dead_cutting); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Feed Cut</td>
                                <td class="text-center"><?php echo e($fcr->excess_feed_cutting); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Missing Cut</td>
                                <td class="text-center"><?php echo e($fcr->missing_chicks_cutting); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Report Book</td>
                                <td class="text-center"><?php echo e($fcr->report_book_cutting); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Transport</td>
                                <td class="text-center"><?php echo e($fcr->transport_cost); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Stamp</td>
                                <td class="text-center"><?php echo e($fcr->stamp_cost); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Advance</td>
                                <td class="text-center"><?php echo e($fcr->advance_payment); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Prev Due</td>
                                <td class="text-center"><?php echo e($fcr->previous_due); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Others</td>
                                <td class="text-center"><?php echo e($fcr->others_cutting); ?> Tk</td>
                            </tr>
                        </tbody>
                    </table>
                    
                    <div class="signature-box">
                        <div class="signature-line">Authorised Signature</div>
                    </div>
                </td>

                <!-- Column 3: Calculation -->
                <td class="main-td">
                    <table class="data-table">
                        <thead>
                            <tr>
                                <th colspan="2">Final Calculation</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>Feed Eaten</td>
                                <td class="text-center"><?php echo e($fcr->feed_eaten_sacks); ?> Sack</td>
                            </tr>
                            <tr>
                                <td>FCR Point</td>
                                <td class="text-center"><?php echo e($fcr->fcr); ?></td>
                            </tr>
                            <tr>
                                <td>Comm. Rate</td>
                                <td class="text-center"><?php echo e($fcr->commission_rate); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Sell Rate</td>
                                <td class="text-center"><?php echo e($fcr->selling_rate); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Loose Rate</td>
                                <td class="text-center"><?php echo e($fcr->farm_loose_rate); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Sub Total</td>
                                <td class="text-center"><?php echo e(number_format((float) $fcr->sub_total, 2, '.', ',')); ?> Tk</td>
                            </tr>
                            <tr>
                                <td>Total Cut</td>
                                <td class="text-center"><?php echo e(number_format((float) $fcr->total_cutting_amount, 2, '.', ',')); ?> Tk</td>
                            </tr>
                            <tr style="background-color: #ddd;">
                                <td style="font-weight: bold;">Grand Total</td>
                                <td class="text-center" style="font-weight: bold;"><?php echo e(number_format((float) $fcr->grand_total, 2, '.', ',')); ?> Tk</td>
                            </tr>
                        </tbody>
                    </table>
                    
                    <div class="signature-box" style="margin-top: 80px;">
                        <div class="signature-line">Farmer Signature</div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('template.print', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/forazitradersbd/public_html/resources/views/admin/print/fcr.blade.php ENDPATH**/ ?>