<?php
use App\Models\OrderProducts;
use App\Models\User;
use App\Models\CustomerDetails;
use App\Models\Products;
use App\Models\AdminDetails;
use App\Models\ManagerDetails;
use App\Models\CashierDetails;
use App\Models\Settings;


$user_details=User::withTrashed()->where('id', $expense->cashier)->first();
$other_details=CustomerDetails::withTrashed()->where('user_id', $expense->cashier)->first();

$cashier_role=User::withTrashed()->where('id', $expense->cashier)->value('user_role');
if($cashier_role == 1){
    $cashier_name=AdminDetails::withTrashed()->where('user_id', $expense->cashier)->value('name');
}
if($cashier_role == 3){
    $cashier_name=ManagerDetails::withTrashed()->where('user_id', $expense->cashier)->value('name');
}
if($cashier_role == 4){
    $cashier_name=CashierDetails::withTrashed()->where('user_id', $expense->cashier)->value('name');
}

$source = request()->query('source');
?>
<html lang="en">

<style type="text/css">
body {
    margin: 0px;
    padding: 15px;
    width: 88mm;
}

div, p {
    margin: 0;
    padding: 0;
}

</style>

<body>
<div style="text-align: center;
    font-size: 18px;
    font-weight: 500;
    padding-top: 5px;
    padding-bottom: 5px;
    border-top: 1px dashed;
    border-bottom: 1px dashed;">
CASH OUT / EXPENSE SLIP
</div>

<table style="width:100%;margin-top:15px;">
     <tr>
        <td style="width:30%; text-align:left;">
        <p style="margin:0;">Date :</p>
        </td>
        <td style="width:70%; text-align:left;">
        <p style="margin:0;"><?php echo e($expense->created_at->format('Y/m/d \T\i\m\e:H:i:s')); ?></p>
        </td>
    </tr>
    <tr>
        <td style="width:30%; text-align:left;">
        <p style="margin:0;">Shift ID :</p>
        </td>
        <td style="width:70%; text-align:left;">
        <p style="margin:0;">SHFT-000<?php echo e(Auth::user()->active_shift_id); ?></p>
        </td>
    </tr>
    <tr>
        <td style="width:30%; text-align:left;">
        <p style="margin:0;">Cashier :</p>
        </td>
        <td style="width:70%; text-align:left;">
        <p style="margin:0;"><?php echo e($cashier_name); ?></p>
        </td>
    </tr>
</table>

<table style="width:100%;margin-top:15px;">
     <tr>
        <td style="width:30%; text-align:left;">
        <p style="margin:0;">Category :</p>
        </td>
        <td style="width:70%; text-align:left;">
        <p style="margin:0;"><?php echo e($expense->expense_category); ?></p>
        </td>
    </tr>
    <tr>
        <td style="width:30%; text-align:left;">
        <p style="margin:0;">Amount :</p>
        </td>
        <td style="width:70%; text-align:left;">
        <p style="margin:0;">LKR<?php echo e(number_format($expense->amount)); ?></p>
        </td>
    </tr>

</table>

<table style="width:100%;margin-top:15px;margin-bottom:15px;">
    <tr>
        <td style="width:30%; text-align:left;">
        <p style="margin:0;">Reason :</p>
        </td>
        <td style="width:70%; text-align:left;">
        <p style="margin:0;"><?php echo e($expense->remark); ?></p>
        </td>
    </tr>
    <tr>
        <td style="width:30%; text-align:left;">
        <p style="margin:0;">Receiver :</p>
        </td>
        <td style="width:70%; text-align:left;">
        <p style="margin:0;"></p>
        </td>
    </tr>
</table>

<div style="text-align: left;
    font-size: 18px;
    font-weight: 500;
    padding-top: 5px;
    padding-bottom: 5px;
    border-top: 1px dashed;
    border-bottom: 1px dashed;">
<p style="margin:0;">Receiver Signature :</p>
<p style="margin:0;">Approved By :</p>
</div>
</body>

<script>
    window.onload = function() {
        window.print();
    }
</script>
<?php /**PATH D:\Part Time Work\erp-resturant\resources\views/expense_bill.blade.php ENDPATH**/ ?>