/
home
/
sjslayjy
/
public_html
/
mosaram
/
resources
/
views
/
voice
/
Upload File
HOME
@extends('dashboard.layouts.app') @section('title','Direct-Labour-Payment') @section('content') @section('style') {{Html::style("assets/css/bootstrap-datepicker3.min.css")}} <style> /* Voice Command Section Styles */ .voice-command-container { text-align: center; background: #EFF3F8; color: #18634b; padding: 30px; border-radius: 10px; box-shadow: 12px 12px 6px #b8b9be, -12px -12px 6px #fff !important; margin: 20px auto; max-width: 500px; } .voice-command-title { font-size: 20px; font-weight: bold; margin:10px 0px 20px 0px; color: #7e7e7e!important; } /* Pulse Effect for Microphone */ .voice-command-microphone { position: relative; width: 120px; height: 120px; margin: 0 auto 20px; cursor: pointer; display: flex; justify-content: center; align-items: center; border-color: #d1d9e6; box-shadow: 3px 3px 6px #b8b9be, -3px -3px 6px #fff; transition: all .2s ease; border-radius:50%; background-image: radial-gradient(#7e7e7e 1px, transparent 0); background-size: 10px 10px; } .voice-command-microphone::before { content: ''; position: absolute; width: 100%; height: 100%; background: #FFF; border-radius: 50%; animation: pulse 1.8s infinite; } @keyframes pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } } .voice-command-icon { font-size: 50px; color: #007bff; position: relative; z-index: 1; } .voice-command-input-group { margin-top: 20px; display: flex; justify-content: center; align-items: center; gap: 10px; } .voice-command-input { flex: 1; max-width: 300px; padding: 10px; box-shadow: inset 2px 2px 5px #b8b9be, inset -3px -3px 7px #fff !important; border-radius: 5px; font-size: 16px; } .voice-command-button { background-color: #044FAB!important; color: #fff; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; font-size: 16px; transition: background-color 0.3s; } .voice-command-button:hover { background-color: rgba(0, 191, 255, 0.3); } .voice-command-status { margin-top: 20px; color: #18634b; font-weight: bold; font-size: 1.2em; } .voice-command-display { margin-top: 10px; color: #555; } .shadow-soft { box-shadow: 12px 12px 6px #b8b9be, -12px -12px 6px #fff !important; } .alert-success { background: #EFF3F8; color: #18634b; text-align:center; font-size:15px; } .status-listening { margin-top: 20px; color: green; font-weight: bold; font-size: 1.2em; font-family: 'Arial, Helvetica, sans-serif'; } .status-error { margin-top: 20px; color: red; font-weight: bold; font-size: 1.2em; font-family: 'Arial, Helvetica, sans-serif'; } .status-not-listening { margin-top: 20px; color: red; font-weight: bold; font-size: 1.2em; font-family: 'Arial, Helvetica, sans-serif'; } @keyframes blinking-dot { 0% { content: '.'; opacity: 1; } 50% { content: '.'; opacity: 0; } 100% { content: '.'; opacity: 1; } } </style> @endsection <div class="main-content"> <div class="main-content-inner"> <div class="breadcrumbs ace-save-state" id="breadcrumbs"> <ul class="breadcrumb"> <lui> <i class="ace-icon fa fa-home home-icon"></i> <a href="#"></a> </lui> <li class="active"> Voice Command Based Reports </li> </ul> </div> <div class="page-content"> <div class="row"> <div class="col-xs-12"> <h3 class="header smaller lighter blue"> Voice Command Based Reports </h3> </div> </div> <div class="voice-command-container"> <h1 class="voice-command-title">Click on the microphone to give a command!</h1> <div id="startVoice" class="voice-command-microphone"> <span class="voice-command-icon"><i class="fa fa-microphone" aria-hidden="true"></i></span> </div> <div class="voice-command-input-group"> <input type="text" id="commandInput" class="voice-command-input" placeholder="Type your command here"> <button id="submitCommand" class="voice-command-button">Submit</button> </div> <p id="status" class="voice-command-status">Status: Not Listening!</p> <p id="displayCommand" class="voice-command-display">Command: None!</p> </div> </div> <!--Exclude File Start Here------------------> <div class="page-content"> <div class="row"> <div class="col-xs-12"> <div class="clearfix"> <div class="pull-right tableTools-container"></div> </div> @if (session('success')) <div class="alert alert-success"> {{ session('success') }} </div> @endif @if (session('error')) <div class="alert alert-danger"> {{ session('error') }} </div> @endif <div class="table-responsive"> <div class="dataTables_borderWrap"> @if(Request::is('voice/total-master-rake-summary')) <table id="" class="table table-striped table-bordered table-hover"> @else <table id="dynamic-table" class="table table-striped table-bordered table-hover"> @endif <!-- Check if a command is passed --> @if (Request::is('voice/direct-labour-payment-report')) <!-- tbody to show when direct labour payment report command is passed --> <div class="alert alert-success shadow-soft">Latest Results:</div> <thead> <tr> <th>#</th> <th>Master Rake</th> <th>WareHouse</th> <th>Labour Name</th> <th>Amount</th> <th>Description</th> </tr> </thead> <tbody> @foreach($direct_labour_payments as $labour_payment) @php $masterRake = getModelById('MasterRake', $labour_payment->master_rake_id); $warehouse = getModelById('Warehouse', $labour_payment->warehouse_id); @endphp <tr id="tr_{{$labour_payment->id}}"> <td>{{$labour_payment->id}}</td> <td>{{ $masterRake ? $masterRake->name : 'No Data' }}</td> <td>{{ $warehouse ? $warehouse->name : 'No Data' }}</td> <td>{{$labour_payment->labour_name}}</td> <td>{{$labour_payment->amount}}</td> <td>{{$labour_payment->description}}</td> </tr> @endforeach </tbody> @elseif (Request::is('voice/total-user-report')) <div class="alert alert-success shadow-soft"><span><strong>Total Users : </strong> {{$totalUserCount}}</span></div> <thead> <tr> <th>#</th> <th>Name</th> <th>Email</th> <th>Role</th> </tr> </thead> <tbody> @foreach($users as $user) <tr id="tr_{{$user->id}}"> <td>{{$user->id}}</td> <td>{{$user->name}}</td> <td>{{$user->email}}</td> <td>{{$user->role->role}}</td> </tr> @endforeach </tbody> @elseif (Request::has('rake_name')) <div class="alert alert-success shadow-soft"> <span><strong>Total Labour Count:</strong> {{ $unique_labour_names_count }} | <strong>Unique Product Name(s):</strong> {{ $unique_product_names }} | <strong>Total Quantity:</strong> {{ number_format($total_quantity, 0) }} | <strong>Total Paid Amount:</strong> {{ number_format($total_paid_amount, 2) }}</span> </div> <thead> <tr> <th>{{__('messages.Token')}}</th> <th>{{__('messages.LoadingSlip')}}#</th> <th>{{__('messages.Rake')}}</th> <th>{{__('messages.Labour')}} </th> <th>{{__('messages.Product')}} </th> <th>{{__('messages.Quantity')}}</th> <th>{{__('messages.Rate')}}</th> <th>{{__('messages.TruckNumber')}} </th> <th>{{__('messages.PaymentStatus')}}</th> <th>{{__('messages.PaidBy')}}</th> <th>{{__('messages.PaidAmount')}}</th> <th>{{__('messages.Payment')}}<br>{{__('messages.Date')}}</th> </tr> </thead> <tbody> @php $total_to_pay = 0; $total_paid = 0; @endphp @foreach($labour_payments as $labour_payment) <tr id="tr_{{$labour_payment->id}}"> <td> @if(!is_null($labour_payment->token_id)) {{ getModelById('Token',$labour_payment->token_id)->unique_id}} @else @endif </td> <td>{{$labour_payment->product_loading_id}}</td> <td> @if(!is_null(getModelById('MasterRake',$labour_payment->master_rake_id))) {{ getModelById('MasterRake',$labour_payment->master_rake_id)->name}} @else @endif </td> <td>{{$labour_payment->labour_name}}</td> <td>{{ $labour_payment->product_name}}</td> <td>{{$labour_payment->quantity}} {{$labour_payment->unit_name}}</td> <td>{{$labour_payment->rate}}</td> <td>{{$labour_payment->truck_number}}</td> <td> @if($labour_payment->is_paid == 0) <span class="label label-warning">Not Paid</span> @else <span class="label label-success">Paid</span> @endif </td> <td> @if($labour_payment->is_paid == 1) {{ getModelById('User',$labour_payment->paid_by)->name}} @else -- @endif </td> <td> @if($labour_payment->is_paid == 1) {{$labour_payment->paid_amount}} @else -- @endif </td> <td> @if($labour_payment->is_paid == 1) {{date('d/m/Y',strtotime($labour_payment->payment_date))}} @else -- @endif </td> @php if($labour_payment->is_paid == 1){ $total_paid = $total_paid + ($labour_payment->paid_amount); } $total_to_pay = $total_to_pay + ($labour_payment->quantity * $labour_payment->rate); @endphp </tr> @endforeach <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td>{{$total_paid}}/{{$total_to_pay}}</td> <td></td> </tr> </tbody> @elseif (Request::is('voice/total-stock-report')) <div class="alert alert-success shadow-soft"> <strong>Total Available Stock:</strong> {{ number_format($total_stock_quantity, 0) }} </div> <thead> <tr> <th>Dealer</th> <th>Product</th> <th>Warehouse</th> <th>Quantity</th> </tr> </thead> <tbody> @if (!empty($stock) && count($stock) > 0) @foreach ($stock as $item) <tr> <td>{{ $item['dealer'] }}</td> <td>{{ $item['product'] }}</td> <td>{{ $item['warehouse'] }}</td> <td>{{ $item['quantity'] }}</td> </tr> @endforeach @else <tr> <td colspan="4" class="text-center">No data available! Please provide a valid product name to view stock records.</td> </tr> @endif </tbody> @elseif (Request::is('voice/total-sale-report')) <div class="alert alert-success shadow-soft"><strong>Total Sale Qty of Product :</strong> {{ number_format($total_amount, 2) }} | <strong>Total Sale of Amount of Product :</strong> {{ number_format($total_sale_quantity, 2) }} </div> <thead> <tr> <th>Dealer</th> <th>Product</th> <th>Invoice Type</th> <th>Invoice Number</th> <th>Quantity</th> <th>Rate</th> <th>Freight Discount</th> <th>Total</th> </tr> </thead> <tbody> @if (!empty($saleData) && count($saleData) > 0) @foreach ($saleData as $item) <tr> <td>{{ $item['dealer'] }}</td> <td>{{ $item['product'] }}</td> <td>{{ $item['invoice_type'] }}</td> <td>{{ $item['invoice_number'] }}</td> <td>{{ $item['quantity'] }}</td> <td>{{ $item['rate'] }}</td> <td>{{ $item['rate'] * $item['quantity']}}</td> <td>{{ $item['freight_discount'] }}</td> </tr> @endforeach @else <tr> <td colspan="7" class="text-center">No sales data available! Please provide a valid products to view sale records.</td> </tr> @endif </tbody> @elseif (Request::is('voice/total-purchase-report')) <div class="alert alert-success shadow-soft"><strong>Total Purchase Data : </strong></div> <thead> <tr> <th>Product</th> <th>Quantity</th> <th>Amount</th> </tr> </thead> <tbody> @if (!empty($purchaseData) && count($purchaseData) > 0) @foreach ($purchaseData as $purchase) <tr> <td>{{ $purchase['product'] }}</td> <td>{{ $purchase['quantity'] }}</td> <td>{{ $purchase['amount'] }}</td> </tr> @endforeach @else <tr> <td colspan="7" class="text-center">No sales data available! Please provide a valid products to view purchase records.</td> </tr> @endif </tbody> @elseif (Request::is('voice/total-invoice-report')) <div class="alert alert-success shadow-soft"> <strong>Total Generated Invoices:</strong> {{ $total }} | <strong>Total Generated Invoice Amount:</strong> {{ number_format($total_amount, 2) }} </div> <thead> <tr> <th>Invoice</th> <th>Retailer Name</th> <th>Of Amount</th> </tr> </thead> <tbody> @if (!empty($invoices) && count($invoices) > 0) @foreach ($invoices as $invoice) <tr> <td>{{ $invoice['invoice_number'] }}</td> <td>{{ $invoice['retailer_name'] }}</td> <td>{{ $invoice['amount'] }}</td> </tr> @endforeach @else <tr> <td colspan="7" class="text-center">No sales data available! Please provide a valid products to view purchase records.</td> </tr> @endif </tbody> @elseif (Request::is('voice/product-wise-detailed-data')) <div class="alert alert-success shadow-soft"><strong>Detailed Data of Product : </strong></div <thead> <tr> <th>Total Stock Count</th> <th>Total Stock Amount</th> <th>Total Sale Count</th> <th>Total Sale Amount</th> <th>Purchase Total Count</th> <th>Purchase Total Amount</th> <th>Token Total Count</th> <th>Token Amount</th> <th>Invoice Total Cont</th> <th>Invoice Total Amount</th> </tr> </thead> <tbody> @if(isset($response) && count($response) > 0) <tr> <td>{{ $response['stockTotal'] ?? 0 }}</td> <td>{{ $response['totalStockAmount'] ?? 0 }}</td> <td>{{ $response['saleTotal'] ?? 0 }}</td> <td>{{ $response['totalSaleAmount'] ?? 0 }}</td> <td>{{ $response['purchaseTotal'] ?? 0 }}</td> <td>{{ $response['purchaseAmountTotal'] ?? 0 }}</td> <td>{{ $response['tokenTotal'] ?? 0 }}</td> <td>{{ $response['invoiceTokanAmount'] ?? 0 }}</td> <td>{{ $response['invoiceTotal'] ?? 0 }}</td> <td>{{ $response['invoiceTotalAmount'] ?? 0 }}</td> </tr> @else <tr> <td colspan="5" class="text-center">No data available! Please provide a valid product to view detailed records.</td> </tr> @endif </tbody> @elseif (Request::is('voice/log-details')) <div class="alert alert-success shadow-soft">Latest Results:</div> <thead> <tr> <th>User</th> <th>Module</th> <th>Error</th> <th>Date</th> </tr> </thead> <tbody> @foreach($logs as $log) <tr> <td>{{getModelById('User',$log->user_id)->name}}</td> <td>{{$log->module}}</td> <td>{{$log->error}}</td> <td>{{ $log->created_at->format('Y-m-d H:i:s') ?? 'NA' }}</td> </tr> @endforeach </tbody> @elseif (Request::is('voice/user-log-details')) <div class="alert alert-success shadow-soft"> <marquee><strong>Latest Results: </strong> @foreach($logs as $log) <span>{{ $log->error ?? 'NA' }}</span><span>on date : {{ $log->created_at->format('Y-m-d H:i:s') ?? 'NA' }}</span> | @endforeach </marquee> </div> <thead> <tr> <th>User</th> <th>Module</th> <th>Error</th> <th>Date</th> </tr> </thead> <tbody> @if(isset($logs) && count($logs) > 0) @foreach($logs as $log) <tr> <td>{{ getModelById('User',$log->user_id)->name ?? 'NA' }}</td> <td>{{ $log->module ?? 'NA' }}</td> <td>{{ $log->error ?? 'NA' }}</td> <td>{{ $log->created_at->format('Y-m-d H:i:s') ?? 'NA' }}</td> </tr> @endforeach @else <tr> <td colspan="4" class="text-center">No logs found for the specified User!</td> </tr> @endif </tbody> @elseif (Request::is('voice/user-status')) <div class="alert alert-success shadow-soft"> <span><strong>Total User Count: </strong>{{ $total_users_count }}</span> | <span><strong>User(s) Online: </strong> @if($online_users->isEmpty()) <span>No users online found!</span> @else @foreach($online_users as $user) <span>{{ $user }}</span> @endforeach @endif </span> </div> <thead> <tr> <th>User Id</th> <th>User Name</th> <th>Status</th> <th>Battery Level</th> <th>Version</th> <th>Last GPS Time</th> </tr> </thead> <tbody> @foreach($user_status as $key=>$value) <tr> <td>{{$value->user_id}}</td> <td>{{getModelById('User',$value->user_id)->name}}</td> <td> <?php date_default_timezone_set("Asia/Kolkata"); $updatedDate=date_create($value->updated_at); $currentDate=date_create(date('Y-m-d H:i:s')); $diff=date_diff($updatedDate,$currentDate); $diffDay = $diff->format("%a"); $diffHour = $diff->format("%h"); $diffMin = $diff->format("%i"); ?> @if(($diffDay == 0) && ($diffHour==0) &&($diffMin<=30) && ($value->status=='On')) <span class="badge badge-success">Online</span> @elseif($value->status=='Off') <span class="badge badge-danger">Offline</span> @else <span class="badge badge-danger">Offline</span> @endif</td> <td>{{$value->batterylevel}}%</td> <td>{{getModelById('User',$value->user_id)->version}}</td> <td>{{date('d-M-Y h:i:s A',strtotime($value->updated_at))}}</td> </tr> @endforeach </tbody> @elseif (Request::is('voice/attendance-chart')) <div class="alert alert-success shadow-soft">Latest Results:</div> <thead> <tr> <th colspan="2"></th> <th colspan="31" style="background-color: gray; color: white; "><center>Days(<?php if(empty($month)){ echo $month = date('m'); }else{echo $month;}?>-<?php if(empty($year)){ echo $year = date('Y'); }else{echo $year;} ?>)</center></th> </tr> <th>#</th> <?php if(empty($month)){ $month = date('m'); }?> <?php if(empty($year)){ $year = date('Y'); }?> <th>Emp Name</th> <?php for($i=01;$i<=28;$i++){?> <th><?php echo $i ;?></th> <?php } ?> <?php if($month != '02'){ ?> <?php if($year % 4 == 0 && $month == '02') { ?> <th>29</th> <?php }elseif($year % 4 != 0 && $month != '02' || $year % 4 == 0 && $month != '02') { ?> <th>29</th> <th>30</th> <?php $month30days = array("04","11","06","09"); if(!in_array($month,$month30days)){ ?> <th>31</th> <?php $days=31; }else{ $days=30; } } }elseif($month == '02' && $year % 4 == 0){?> <th>29</th> <?php $days=29; }elseif($month == '02' && $year % 4 != 0){ $days=28; } ?> </thead> <tbody> <?php $i = 1; foreach($users as $val){ ?> <tr> <td><?php echo $i; ?></td> <td>{{ getUserById($val['user_id'])->name }}</td> <?php for($j=01; $j<=$days;$j++){ $date = $year.'-'.$month.'-'.$j; // dd($date); if(strtotime($date) > strtotime(date('Y-m-d'))){ echo "<td style='background-color:gray; color:black'></td>"; }else{ $getreport = getReport($val['user_id'],$date); if(!empty($getreport)){ // $status = $getreport['in_count']; echo"<td style='background-color:#4BB543; color:black'><b>P</b></br>(".date('H:i', strtotime($getreport['in_time'])).")</td>"; }else{ echo "<td style='background-color:#f46736; color:black'><b>A</b></td>"; } } }?> </tr> <?php $i++; }?> </tbody> @elseif (Request::is('voice/warehouse-transfer-product')) <div class="alert alert-success shadow-soft">Latest Results:</div> <thead> <tr> <th>#</th> <th>From Warehouse</th> <th>To Warehouse</th> <th>Brand</th> <th>Product</th> <th>Quantity</th> <th>Transporter</th> <th>Truck #</th> <th>Freight</th> <th>Freight Payment <br>Status</th> <th>Freight <br>Paid <br>Amount</th> <th>Freight <br>Payment<br>Date</th> <th>Labour<br>Name</br></th> <th>Labour <br>Rate</th> <th>Labour <br>Payment<br>Date</th> <th>Labour Payment <br>Status</th> <th>Labour <br>Paid <br>Amount</th> <th>Transfer<br>Date</th> <th></th> </tr> </thead> <tbody> @foreach($warehouse_transfer_loadings as $warehouse_transfer_loading) <tr> <td>{{$warehouse_transfer_loading->id}}</td> <td>{{$warehouse_transfer_loading->from_warehouse->name}}</td> <td>{{$warehouse_transfer_loading->to_warehouse->name}}</td> <td>{{$warehouse_transfer_loading->product_brand->name}}</td> <td>{{$warehouse_transfer_loading->product->name}}</td> <td>{{$warehouse_transfer_loading->quantity}} {{$warehouse_transfer_loading->unit->unit_name}}</td> <td> @if(!is_null($warehouse_transfer_loading->transporter)) {{$warehouse_transfer_loading->transporter->name}} @else -- @endif </td> <td>{{$warehouse_transfer_loading->truck_number}}</td> <td>{{$warehouse_transfer_loading->freight}}</td> <td> @if($warehouse_transfer_loading->is_freight_paid) <span class="label label-success">Paid</span> @else <span class="label label-warning">Not Paid</span> @endif </td> <td>{{$warehouse_transfer_loading->freight_amount_paid}}</td> <td>{{$warehouse_transfer_loading->freight_payment_date}}</td> <td>{{$warehouse_transfer_loading->labour_name}}</td> <td>{{$warehouse_transfer_loading->labour_rate}}</td> <td>{{$warehouse_transfer_loading->labour_payment_date}}</td> <td> @if($warehouse_transfer_loading->is_labour_paid) <span class="label label-success">Paid</span> @else <span class="label label-warning">Not Paid</span> @endif </td> <td>{{$warehouse_transfer_loading->labour_paid_amount}}</td> <td>{{date('d/m/Y',strtotime($warehouse_transfer_loading->created_at))}}</td> <td><a href="{{URL('/user/print-warehouse-transfer-loading-slip/'.$warehouse_transfer_loading->id)}}"><i class="fa fa-print fa-2x"></i></a></td> </tr> @endforeach </tbody> @elseif (Request::is('voice/restore-product')) <div class="alert alert-success shadow-soft">Latest Results:</div> <thead> <tr> <th>Return Date</th> <th>Retailer</th> <th>Receiving <br> Warehouse</th> <th>Brand</th> <th>Product</th> <th>Quantity</th> <th>Transporter</th> <th>Truck #</th> <th>Freight</th> <th>Freight Payment <br>Status</th> <th>Freight <br>Paid <br>Amount</th> <th>Freight <br>Paid <br>Date</th> <th>Labour</th> <th>Labour <br>Rate</th> <th>Labour Payment <br>Status</th> <th>Labour <br>Paid <br>Amount</th> <th>Labour <br>Paid <br>Date</th> <th></th> </tr> </thead> <tbody> @foreach($returned_products as $returned_product) <tr> <td>{{date('d/m/Y',strtotime($returned_product->created_at))}}</td> <td>{{getModelById('Retailer',$returned_product->retailer_id)->name}} <br> <b>{{getModelById('Dealer',$returned_product->dealer_id)->name}}</b> </td> <td>{{$returned_product->warehouse->name}}</td> <td>{{$returned_product->product_brand->name}}</td> <td>{{$returned_product->product->name}}</td> <td>{{$returned_product->returned_quantity}} {{$returned_product->unit->unit_name}}</td> <td>@if(!is_null($returned_product->transporter)) {{$returned_product->transporter->name}} @endif </td> <td>{{$returned_product->vehicle_number}}</td> <td>{{$returned_product->freight}}</td> <td> @if($returned_product->is_freight_paid) <span class="label label-success">Paid</span> @else <span class="label label-warning">Not Paid</span> @endif </td> <td>{{$returned_product->freight * $returned_product->returned_quantity}}</td> <td> @if($returned_product->is_freight_paid) {{date('d/m/Y',strtotime($returned_product->freight_payment_date))}} @endif </td> <td>{{$returned_product->labour_name}}</td> <td>{{$returned_product->labour_rate}}</td> <td> @if($returned_product->is_labour_paid) <span class="label label-success">Paid</span> @else <span class="label label-warning">Not Paid</span> @endif </td> <td>{{$returned_product->paid_labour_amount}}</td> <td> @if($returned_product->is_labour_paid) {{date('d/m/Y',strtotime($returned_product->labour_payment_date))}} @endif </td> <td><a href="{{URL('/user/print-returned-product-slip/'.$returned_product->id)}}"><i class="fa fa-print fa-2x"></i></a></td> </tr> @endforeach </tbody> @elseif (Request::is('voice/standard-labour-payments')) <div class="alert alert-success shadow-soft">Latest Results:</div> <thead> <tr> <th>#</th> <th> {{__('messages.Date')}}</th> <th> {{__('messages.Warehouse')}}</th> <th> Party</th> <th>Open {{__('messages.Product')}} Brand</th> <th>Closed {{__('messages.Product')}} Brand</th> <th>Open {{__('messages.Product')}}</th> <th>Closed {{__('messages.Product')}}</th> <th> Open <br>Quantity</th> <th> Packed <br>Quantity</th> <th> Sweeping <br>Quantity</th> <th> Excess <br>Quantity</th> <th> Shortage <br>Quantity</th> <th> {{__('messages.Labour')}} </th> <th> Labour <br>Rate </th> <th>Amount</th> <th>{{__('messages.PaymentStatus')}}</th> <th>{{__('messages.PaidBy')}}</th> <th>{{__('messages.PaidAmount')}}</th> <th>{{__('messages.Payment')}}<br>{{__('messages.Date')}}</th> <th></th> </tr> </thead> <tbody> @php $total_to_pay = 0; $total_paid = 0; @endphp @foreach($standardizations as $standardization) <tr> <td>{{$standardization->id}}</td> <td>{{date('d/m/Y',strtotime($standardization->created_at))}}</td> <td> @if(!is_null(getModelById('Warehouse',$standardization->warehouse_id))) {{ getModelById('Warehouse',$standardization->warehouse_id)->name}} @endif </td> <td> @if(!is_null(getModelById('Dealer',$standardization->dealer_id))) {{ getModelById('Dealer',$standardization->dealer_id)->name}} <br> ( {{ getModelById('Dealer',$standardization->dealer_id)->address1}}) <br> <b>Dealer</b> @else {{ getModelById('ProductCompany',$standardization->product_company_id)->name}} <br> <b>Product Company</b> @endif </td> <td> @if(!is_null(getModelById('ProductCompany',$standardization->open_product_brand_id))) {{ getModelById('ProductCompany',$standardization->open_product_brand_id)->name}} @endif </td> <td> @if(!is_null(getModelById('ProductCompany',$standardization->closed_product_brand_id))) {{ getModelById('ProductCompany',$standardization->closed_product_brand_id)->name}} @endif </td> <td> @if(!is_null(getModelById('Product',$standardization->open_product_id))) {{ getModelById('Product',$standardization->open_product_id)->name}} @endif </td> <td> @if(!is_null(getModelById('Product',$standardization->closed_product_id))) {{ getModelById('Product',$standardization->closed_product_id)->name}} @endif </td> <td>{{$standardization->open_quantity}}</td> <td>{{$standardization->packed_quantity}}</td> <td>{{$standardization->shooping_quantity}}</td> @php $shortage = $standardization->open_quantity - $standardization->packed_quantity-$standardization->shooping_quantity; @endphp <td> {{ abs($shortage) }} </td> <td> @if($shortage >= 0 ) {{ $shortage }} @endif </td> <td>{{$standardization->labour_name}}</td> <td>{{$standardization->labour_rate}}</td> <td>{{$standardization->packed_quantity * $standardization->labour_rate}}</td> <td> @if($standardization->is_paid == 0) <span class="label label-warning">Not Paid</span> @else <span class="label label-success">Paid</span> @endif </td> <td> @if($standardization->is_paid == 1) {{ getModelById('User',$standardization->paid_by)->name}} @else -- @endif </td> <td> @if($standardization->is_paid == 1) {{$standardization->payment_amount}} @else -- @endif </td> <td> @if($standardization->is_paid == 1) {{date('d/m/Y',strtotime($standardization->payment_date))}} @else -- @endif </td> <td><a href="{{URL('/user/print-standardization-slip/'.$standardization->id)}}"><i class="fa fa-print fa-2x"></i></a></td> </tr> @php if($standardization->is_paid == 1){ $total_paid = $total_paid + ($standardization->payment_amount); } $total_to_pay = $total_to_pay + ($standardization->packed_quantity * $standardization->labour_rate); @endphp @endforeach <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td>{{$total_paid}}/{{$total_to_pay}}</td> <td></td> </tr> </tbody> @elseif (Request::is('voice/rake-payment')) <div class="alert alert-success shadow-soft">Latest Results:</div> <thead> <tr> <th>Freight Payments</th> <th>Date</th> <th>Loading Labour <br>Payments</th> <th>Unloading Labour <br>Payments</th> <th>Direct Labour <br>Payments</th> <th>Wagon Unloading <br>Payments</th> <th>Total</th> </tr> </thead> <tbody> <tr> <td>{{isset($total_freight_payments) ? $total_freight_payments:"0"}}</td> <td>{{isset($date) ? $date:"0"}}</td> <td>{{isset($total_labour_payments) ? $total_labour_payments:"0"}}</td> <td>{{isset($total_unloading_labour_payments) ? $total_unloading_labour_payments:"0"}}</td> <td>{{isset($total_direct_labour_payments) ? $total_direct_labour_payments:"0"}}</td> <td>{{isset($total_wagon_unloadings) ? $total_wagon_unloadings:"0"}}</td> <td>{{isset($total) ? $total:"0"}}</td> </tr> </tbody> @elseif (Request::is('voice/total-master-rakes')) <div class="alert alert-success shadow-soft"><strong>Total Master Rakes</strong> : {{ $master_rakes_count }}</div> <thead> <tr> <th>Name</th> <th>Session</th> <th>Rake Point</th> <th>Product Company</th> <th>Placement Time</th> <th>Unloading Time</th> <th>Date</th> <th>RR Document</th> <th></th> </tr> </thead> <tbody> @foreach($master_rakes as $master_rake) <tr id="tr_{{$master_rake->id}}"> <td>{{$master_rake->name}}</td> <td>{{ getModelById('Session',$master_rake->session_id)->session}}</td> <td>{{ getModelById('RakePoint',$master_rake->rake_point_id)->rake_point}}</td> <td>{{ getModelById('ProductCompany',$master_rake->product_company_id)->name }}</td> <td>{{$master_rake->loading_time}}</td> <td>{{$master_rake->unloading_time}}</td> <td>{{date('d-m-Y',strtotime($master_rake->date))}}</td> <td>@if(!is_null($master_rake->rr_document) || $master_rake->rr_document != "") <a href="{{URL('/').$master_rake->rr_document}}" download="download"><i class="fa fa-download"></i></a> @endif</td> <td> @if($master_rake->is_closed==0) <div class="hidden-sm hidden-xs btn-group"> <a class="btn btn-xs btn-info" onclick="getEdit({{$master_rake->id}})" title="Edit"> <i class="ace-icon fa fa-pencil bigger-120"></i> </a> <button class="btn btn-xs btn-danger" onclick="deleteMasterRake({{$master_rake->id}})" title="Delete"> <i class="ace-icon fa fa-trash-o bigger-120"></i> </button> <button class="btn btn-xs btn-alert" onclick="lockMasterRake({{$master_rake->id}})" title="Lock"> <i class="ace-icon fa fa-ban bigger-120"></i> </button> </div> @endif </td> </tr> @endforeach </tbody> @elseif (Request::is('voice/total-master-rake-summary')) <div class="alert alert-success shadow-soft">Generated Results :</div> <thead> <tr> <th> {{__('messages.Party')}} {{__('messages.Name')}}</th> <th> {{__('messages.Product')}}</th> <th> {{__('messages.Allotment')}} {{__('messages.From')}}<br/> {{__('messages.ProductCompany')}}</th> @if(isset($allotments)) @foreach($date_range as $key=>$date) @php $total_datewise_quantity[$date] = array(); @endphp <th>{{date('d-m-y',strtotime($date))}}</th> @endforeach @endif <th> {{__('messages.Total')}}</th> <th> {{__('messages.Pending')}} {{__('messages.Quantity')}}</th> </tr> </thead> <tbody> @if(isset($allotments)) @php $total_company_allotment = array(); $total_loading_allotment = array(); $pending_allotment = array(); @endphp @foreach($allotments as $allotment) <tr id="tr_{{$allotment->id}}"> <td style="word-wrap: break-word; width:350px; padding: 10px;">{{getModelById('Dealer',$allotment->dealer_id)->name}}({{getModelById('Dealer',$allotment->dealer_id)->address1}})</td> <td> {{getModelById('Product',$allotment->product_id)->name}} </td> <td>{{$allotment->alloted_quantity}}</td> @if(isset($allotments)) @php @array_push($total_company_allotment, $allotment->alloted_quantity); $total = 0; @endphp @foreach($date_range as $key=>$date) <td> @php $dates = $date; $date = date('Y-m-d',strtotime($date)); $product_loadings = \App\ProductLoading::where('dealer_id',$allotment->dealer_id) ->where('product_id',$allotment->product_id) ->where('master_rake_id',$allotment->master_rake_id) ->where('from_warehouse_id',null) ->whereRaw('DATE(created_at) = ?', [$date]) ->sum('quantity'); $total_amt = $product_loadings; $total = $total + $product_loadings; array_push($total_datewise_quantity[$dates], $total_amt); @endphp {{$product_loadings}} </td> @endforeach @endif <td>{{$total}}</td> <td>{{$allotment->alloted_quantity-$total}}</td> </tr> @php @array_push($total_loading_allotment, $total); @array_push($pending_allotment, $allotment->alloted_quantity-$total); @endphp @endforeach <tr> <th> {{__('messages.Total')}} ({{__('messages.with')}} {{__('messages.Allotment')}})</th> <th></th> <th>{{array_sum($total_company_allotment)}}</th> @if(isset($allotments)) @foreach($date_range as $key=>$date) <th>{{array_sum($total_datewise_quantity[$date])}}</th> @endforeach @endif <th>{{array_sum($total_loading_allotment)}}</th> <th>{{array_sum($pending_allotment)}}</th> </tr> @foreach($warehouse_allotments as $warehouse_allotment) <tr> <td style="word-wrap: break-word; width:350px; padding: 10px;">{{getModelById('Warehouse',$warehouse_allotment->warehouse_id)->name}}({{getModelById('Warehouse',$warehouse_allotment->warehouse_id)->location}})</td> <td></td> <td></td> @php $warehouse_total = 0; @endphp @foreach($date_range as $key=>$date) <td> @php $dates = $date; $date = date('Y-m-d',strtotime($date)); if(isset($product_id) && $product_id != ""){ $product_loadings = \App\ProductLoading::where('warehouse_id',$warehouse_allotment->warehouse_id) ->where('product_id',$product_id) ->where('master_rake_id',$master_rake_id) ->whereRaw('DATE(created_at) = ?', [$date]) ->where('loading_slip_type',2) ->sum('quantity'); }else{ $product_loadings = \App\ProductLoading::where('warehouse_id',$warehouse_allotment->warehouse_id) ->whereRaw('DATE(created_at) = ?', [$date]) ->where('master_rake_id',$master_rake_id) ->where('loading_slip_type',2) ->sum('quantity'); } $total_amt = $product_loadings; $warehouse_total = $warehouse_total + $product_loadings; array_push($total_datewise_quantity[$dates], $total_amt); @endphp {{$product_loadings}} </td> @endforeach <td>{{$warehouse_total}}</td> <td></td> </tr> @php @array_push($total_loading_allotment, $warehouse_total); @endphp @endforeach <tr> <th>{{__('messages.Total')}} ({{__('messages.Allotment')}} {{__('messages.with')}}/{{__('messages.without')}})</th> <th></th> <th>{{array_sum($total_company_allotment)}}</th> @if(isset($allotments)) @foreach($date_range as $key=>$date) <th>{{array_sum($total_datewise_quantity[$date])}}</th> @endforeach @endif <th>{{array_sum($total_loading_allotment)}}</th> <th>{{array_sum($pending_allotment)}}</th> </tr> <tr> <td>RR {{__('messages.Quantity')}}</td> <td></td> <td></td> <td></td> <td></td> <td> @if(isset($product_id) && $product_id != "") @php $master_rake_product = \App\MasterRakeProduct::where('master_rake_id',$master_rake_id)->where('product_id',$product_id)->first(); echo $master_rake_product->quantity; @endphp @else @php $total_rr = \App\MasterRakeProduct::where('master_rake_id',$master_rake_id)->sum('quantity'); echo $total_rr; @endphp @endif </td> </tr> <tr> <td>Rake Shortage</td> <td></td> <td></td> <td></td> <td></td> <td> @if(isset($product_id) && $product_id != "") @php $master_rake_product = \App\MasterRakeProduct::where('master_rake_id',$master_rake_id)->where('product_id',$product_id)->first(); echo $master_rake_product->shortage_from_company; @endphp @endif </td> </tr> <tr> <td>Net Received RR</td> <td></td> <td></td> <td></td> <td></td> <td> @if(isset($product_id) && $product_id != "") @php $master_rake_product = \App\MasterRakeProduct::where('master_rake_id',$master_rake_id)->where('product_id',$product_id)->first(); echo ($master_rake_product->quantity - $master_rake_product->shortage_from_company); @endphp @else @php $total_rr = \App\MasterRakeProduct::where('master_rake_id',$master_rake_id)->sum('quantity'); echo $total_rr; @endphp @endif </td> </tr> @php $returned = 0; @endphp <tr> <td>Returned</td> <td></td> <td></td> <td></td> <td></td> <td> @if(isset($product_id) && $product_id != "") @php $returned = \App\ProductLoading::where('master_rake_id',$master_rake_id)->where('product_id',$product_id)->where('loading_slip_type',1)->where('recieved_quantity','>',0)->sum('recieved_quantity'); echo $returned; @endphp @else @php $returned = \App\ProductLoading::where('master_rake_id',$master_rake_id)->where('loading_slip_type',1)->where('recieved_quantity','>',0)->sum('recieved_quantity'); echo $returned; @endphp @endif </td> </tr> <tr> @if(isset($product_id) && $product_id != "") @php $master_rake_product = \App\MasterRakeProduct::where('master_rake_id',$master_rake_id)->where('product_id',$product_id)->first(); $excess_shortage = array_sum($total_loading_allotment) - ($master_rake_product->quantity - $master_rake_product->shortage_from_company); @endphp @else @php $total_rr = \App\MasterRakeProduct::where('master_rake_id',$master_rake_id)->sum('quantity'); $excess_shortage = array_sum($total_loading_allotment) - $total_rr @endphp @endif <td> @if($excess_shortage > 0) {{__('messages.Excess')}} @else Shortage @endif </td> <td></td> <td></td> <td></td> <td></td> <td> {{$excess_shortage}} </td> </tr> @endif </tbody> @elseif (Request::is('voice/total-warehouse-token')) <div class="alert alert-success shadow-soft d-flex flex-wrap justify-content-start"> <span class="p-2 m-1 bg-light border rounded"> <strong>Total Number of Generated Tokens No:</strong> {{ $tokens->count() }} </span> | <span class="p-2 m-1 bg-light border rounded"> <strong>Total Generated Tokens Qty:</strong> {{ $total_quantity }} </span> | <span class="p-2 m-1 bg-light border rounded"> <strong>Total Remaining Tokens Qty:</strong> {{ $total_remaining_quantity }} </span> | <span class="p-2 m-1 bg-light border rounded"> <strong>Total Products:</strong> @if ($tokens->isEmpty()) No products found. @else @php $uniqueProducts = $tokens->pluck('product_id')->unique(); @endphp {{ $uniqueProducts->map(fn($id) => getModelById('Product', $id)->name)->implode(', ') }} @endif </span> </div> <thead> <tr> <th>{{__('messages.Date')}}</th> <th>{{__('messages.TokenNumber')}}</th> <th>{{__('messages.Rake')}} / {{__('messages.Warehouses')}}</th> <th>{{__('messages.company')}}</th> <th>{{__('messages.ProductCompany')}}</th> <th>{{__('messages.To')}}</th> <th>{{__('messages.Product')}}</th> <th>{{__('messages.Quantity')}}</th> <th>Remaining <br>Loading <br> {{__('messages.Quantity')}}</th> <th>{{__('messages.Unit')}}</th> <th>{{__('messages.Rate')}}</th> <th>Freight <br>Payment <br>Mode</th> <th>{{__('messages.Transporter')}}</th> <th>{{__('messages.WarehouseKeeper')}}</th> <th></th> </tr> </thead> <tbody> @foreach($tokens as $token) <tr id="tr_{{$token->id}}"> <td>{{date('d/m/Y',strtotime($token->created_at))}}</td> <td>{{$token->unique_id}}</td> <td> <b> @if(is_null($token->master_rake_id)) {{getModelById('Warehouse',$token->from_warehouse_id)->name}} @else {{getModelById('MasterRake',$token->master_rake_id)->name}} @endif </b> </td> <td>{{getModelById('Company',$token->company_id)->name}}</td> <td>{{getModelById('ProductCompany',$token->product_company_id)->name}}</td> <td> @php if($token->to_type == 1){ echo "<b>Warehouse </b><br>".getModelById('Warehouse',$token->warehouse_id)->name."(".getModelById('Warehouse',$token->warehouse_id)->location.")"; }else if($token->to_type == 2){ echo "<b>Retailer </b><br>".getModelById('Retailer',$token->retailer_id)->name."(".getModelById('Retailer',$token->retailer_id)->address.")"; echo "<br><b>"; echo getModelById('Dealer',$token->account_from_id)->name."(".getModelById('Dealer',$token->account_from_id)->address1.")"."</b>"; }else if($token->to_type == 3){ echo "<b>Dealer </b><br>".getModelById('Dealer',$token->dealer_id)->name."(".getModelById('Dealer',$token->dealer_id)->address1.")"; } @endphp </td> <td>{{getModelById('Product',$token->product_id)->name}}</td> <td>{{$token->quantity}}</td> <td>{{$token->quantity - totalTokenLoading($token->id)}}</td> <td>{{getModelById('Unit',$token->unit_id)->unit}}</td> <td>{{$token->rate}}</td> <td>{{$token->delivery_payment_mode}}</td> <td>{{is_null(getModelById('Transporter',$token->transporter_id)) ? "":getModelById('Transporter',$token->transporter_id)->name}}</td> <td>{{is_null(getModelById('User',$token->warehouse_keeper_id)) ? "":getModelById('User',$token->warehouse_keeper_id)->name}}</td> <td> <a href="/user/edit-token/{{$token->id}}" class="btn btn-xs btn-info"> <i class="ace-icon fa fa-pencil bigger-120"></i> </a> <a href="/user/print-token/{{$token->id}}" class="btn btn-xs btn-info" > <i class="ace-icon fa fa-print bigger-120"></i> </a> </td> </tr> @endforeach </tbody> @elseif (Request::is('voice/direct-labour-payment-warehouse')) <div class="alert alert-success shadow-soft d-flex flex-column"> @foreach($unique_descriptions as $description) <span><strong>Total Payment Type:</strong> {{ $description->description }}</span> <span>(Total Amount: ₹{{ number_format($description->total_amount, 2) }})</span> | @endforeach </div> <thead> <tr> <th>#</th> <th>Master Rake</th> <th>WareHouse</th> <th>Labour Name</th> <th>Amount</th> <th>Description</th> </tr> </thead> <tbody> @foreach($direct_labour_payments as $labour_payment) @php $masterRake = getModelById('MasterRake', $labour_payment->master_rake_id); $warehouse = getModelById('Warehouse', $labour_payment->warehouse_id); @endphp <tr id="tr_{{$labour_payment->id}}"> <td>{{$labour_payment->id}}</td> <td>{{ $masterRake ? $masterRake->name : 'No Data' }}</td> <td>{{ $warehouse ? $warehouse->name : 'No Data' }}</td> <td>{{$labour_payment->labour_name}}</td> <td>{{$labour_payment->amount}}</td> <td>{{$labour_payment->description}}</td> </tr> @endforeach </tbody> @else <div class="alert alert-success shadow-soft">Latest Results:</div> <thead> <tr> <th></th> <th></th> <th></th> <th></th> <th></th> <th></th> </tr> </thead> <tbody> <tr> <td colspan="6" class="text-center">No data available! Please provide a valid command to view records.</td> </tr> </tbody> @endif </table> </div> </div> </div> </div> </div> </div> </div><!-- /.main-content --> @section('script') {{ Html::script("assets/js/jquery.dataTables.min.js")}} {{ Html::script("assets/js/jquery.dataTables.bootstrap.min.js")}} {{ Html::script("assets/js/dataTables.buttons.min.js")}} {{ Html::script("assets/js/buttons.flash.min.js")}} {{ Html::script("assets/js/buttons.html5.min.js")}} {{ Html::script("assets/js/buttons.print.min.js")}} {{ Html::script("assets/js/buttons.colVis.min.js")}} {{ Html::script("assets/js/dataTables.select.min.js")}} {{ Html::script("assets/js/ace-elements.min.js")}} {{ Html::script("assets/js/ace.min.js")}} <script type="text/javascript"> jQuery(function($) { //initiate dataTables plugin var myTable = $('#dynamic-table').DataTable( { bAutoWidth: false, "aaSorting": [], } ); $.fn.dataTable.Buttons.defaults.dom.container.className = 'dt-buttons btn-overlap btn-group btn-overlap'; new $.fn.dataTable.Buttons( myTable, { buttons: [ { "extend": "colvis", "text": "<i class='fa fa-search bigger-110 blue'></i> <span class='hidden'>Show/hide columns</span>", "className": "btn btn-white btn-primary btn-bold", columns: ':not(:first):not(:last)' }, { "extend": "copy", "text": "<i class='fa fa-copy bigger-110 pink'></i> <span class='hidden'>Copy to clipboard</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "csv", "text": "<i class='fa fa-database bigger-110 orange'></i> <span class='hidden'>Export to CSV</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "excel", "text": "<i class='fa fa-file-excel-o bigger-110 green'></i> <span class='hidden'>Export to Excel</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "pdf", "text": "<i class='fa fa-file-pdf-o bigger-110 red'></i> <span class='hidden'>Export to PDF</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "print", "text": "<i class='fa fa-print bigger-110 grey'></i> <span class='hidden'>Print</span>", "className": "btn btn-white btn-primary btn-bold", autoPrint: true, message: 'IManager', exportOptions: { columns: ':visible' } } ] } ); myTable.buttons().container().appendTo( $('.tableTools-container') ); //style the message box var defaultCopyAction = myTable.button(1).action(); myTable.button(1).action(function (e, dt, button, config) { defaultCopyAction(e, dt, button, config); $('.dt-button-info').addClass('gritter-item-wrapper gritter-info gritter-center white'); }); var defaultColvisAction = myTable.button(0).action(); myTable.button(0).action(function (e, dt, button, config) { defaultColvisAction(e, dt, button, config); if($('.dt-button-collection > .dropdown-menu').length == 0) { $('.dt-button-collection') .wrapInner('<ul class="dropdown-menu dropdown-light dropdown-caret dropdown-caret" />') .find('a').attr('href', '#').wrap("<li />") } $('.dt-button-collection').appendTo('.tableTools-container .dt-buttons') }); }) </script> <script type="text/javascript"> const commands = { "show me total master rakes": "/voice/total-master-rakes", "show me rake summary of": "/voice/total-master-rake-summary", "show me total generated token for the warehouse of": "/voice/total-warehouse-token", "direct labour payment report": "/voice/direct-labour-payment-report", "show me direct labour payment of warehouse": "/voice/direct-labour-payment-warehouse", "total user report": "/voice/total-user-report", "show me log details": "/voice/log-details", "show me log details of": "/voice/user-log-details", "labour payment report of master rake": "/voice/labour-payment-report", "show me total stock of report of": "/voice/total-stock-report", "show me total sale of": "/voice/total-sale-report", "show me total purchase of": "/voice/total-purchase-report", "show me total invoice of": "/voice/total-invoice-report", "show me detailed data of": "/voice/product-wise-detailed-data", "show me user status": "/voice/user-status", "show me attendence chart": "/voice/attendance-chart", "show me warehouse transfer of": "/voice/warehouse-transfer-product", "show me restore of": "/voice/restore-product", "show me standard labour payments of": "/voice/standard-labour-payments", "show me rake payment of": "/voice/rake-payment", }; // Function to handle command submission (both text and voice) function handleCommand(spokenCommand) { const command = spokenCommand.toLowerCase(); document.getElementById('displayCommand').innerText = `Command: ${command}`; const baseCommand = "labour payment report of master rake"; const stockCommandBase = "show me total stock of report of"; const saleCommandBase = "show me total sale of"; const purchaseCommandBase = "show me total purchase of"; const invoiceCommandBase = "show me total invoice of"; const detailedDataCommandBase = "show me detailed data of"; const logStatusCommandBase = "show me log details of"; const warehouseTransferCommandBase = "show me warehouse transfer of"; const restoreProductCommandBase = "show me restore of"; const satndardPaymentCommandBase = "show me standard labour payments of"; const rakePaymentCommandBase = "show me rake payment of"; const masterRakeSummaryCommandBase = "show me rake summary of"; const warehouseTokenCommandBase = "show me total generated token for the warehouse of"; const labourPaymentWarehouseCommandBase = "show me direct labour payment of warehouse"; if (command.startsWith(baseCommand)) { // Existing logic for "labour payment report of master rake" const rakeName = command.replace(baseCommand, "").trim(); if (rakeName) { const url = `${commands[baseCommand]}?rake_name=${encodeURIComponent(rakeName)}`; window.location.href = url; // Redirect to the URL for rake report } else { alert("Please specify the master rake name."); } } else if (command.startsWith(stockCommandBase)) { // New logic for "show me total stock of report of" const productName = command.replace(stockCommandBase, "").trim(); if (productName) { const url = `${commands[stockCommandBase]}?command=${encodeURIComponent(command)}`; window.location.href = url; // Redirect to the stock report URL } else { alert("Please specify the product name."); } }else if (command.startsWith(saleCommandBase)) { const saleProductName = command.replace(saleCommandBase, "").trim(); if (saleProductName) { const url = `${commands[saleCommandBase]}?command=${encodeURIComponent(command)}`; window.location.href = url; } else { alert("Please specify the product name to get sale data."); } }else if (command.startsWith(purchaseCommandBase)) { const purchaseProductName = command.replace(purchaseCommandBase, "").trim(); if (purchaseProductName) { const url = `${commands[purchaseCommandBase]}?command=${encodeURIComponent(command)}`; window.location.href = url; } else { alert("Please specify the product name to get product data."); } }else if (command.startsWith(invoiceCommandBase)) { const invoiceProductName = command.replace(invoiceCommandBase, "").trim(); if (invoiceProductName) { const url = `${commands[invoiceCommandBase]}?command=${encodeURIComponent(command)}`; window.location.href = url; } else { alert("Please specify the product name to get product invoice data."); } }else if (command.startsWith(detailedDataCommandBase)) { const detailedProductName = command.replace(detailedDataCommandBase, "").trim(); if (detailedProductName) { const url = `${commands[detailedDataCommandBase]}?command=${encodeURIComponent(command)}`; window.location.href = url; } else { alert("Please specify the product name to get product detailed data."); } }else if (command.startsWith(logStatusCommandBase)) { const logUserName = command.replace(logStatusCommandBase, "").trim(); if (logUserName) { const url = `${commands[logStatusCommandBase]}?command=${encodeURIComponent(command)}`; window.location.href = url; } else { alert("Please specify the user name to get user log detailed data."); } }else if (command.startsWith(warehouseTransferCommandBase)) { const warehouseTransferProductName = command.replace(warehouseTransferCommandBase, "").trim(); if (warehouseTransferProductName) { const url = `${commands[warehouseTransferCommandBase]}?command=${encodeURIComponent(command)}`; window.location.href = url; } else { alert("Please specify the product name to get warehouse transfer data."); } }else if (command.startsWith(restoreProductCommandBase)) { const restoreProductName = command.replace(restoreProductCommandBase, "").trim(); if (restoreProductName) { const url = `${commands[restoreProductCommandBase]}?command=${encodeURIComponent(command)}`; window.location.href = url; } else { alert("Please specify the product name to get restore data."); } }else if (command.startsWith(satndardPaymentCommandBase)) { const standardWarehouseName = command.replace(satndardPaymentCommandBase, "").trim(); if (standardWarehouseName) { const url = `${commands[satndardPaymentCommandBase]}?command=${encodeURIComponent(command)}`; window.location.href = url; } else { alert("Please specify the warehouse name to get standerdization payment data."); } }else if (command.startsWith(rakePaymentCommandBase)) { const rakeName = command.replace(rakePaymentCommandBase, "").trim(); if (rakeName) { const url = `${commands[rakePaymentCommandBase]}?command=${encodeURIComponent(command)}`; window.location.href = url; } else { alert("Please specify the warehouse name to get rake payment data."); } }else if (command.startsWith(masterRakeSummaryCommandBase)) { const rakeSummaryName = command.replace(masterRakeSummaryCommandBase, "").trim(); if (rakeSummaryName) { const url = `${commands[masterRakeSummaryCommandBase]}?command=${encodeURIComponent(command)}`; window.location.href = url; } else { alert("Please specify the rake name to get rake summary data."); } }else if (command.startsWith(warehouseTokenCommandBase)) { const warehouseName = command.replace(warehouseTokenCommandBase, "").trim(); if (warehouseTokenCommandBase) { const url = `${commands[warehouseTokenCommandBase]}?command=${encodeURIComponent(command)}`; window.location.href = url; } else { alert("Please specify the warehouse name to get warehouse token data."); } }else if (command.startsWith(labourPaymentWarehouseCommandBase)) { const warehouseNamePayment = command.replace(labourPaymentWarehouseCommandBase, "").trim(); if (warehouseNamePayment) { const url = `${commands[labourPaymentWarehouseCommandBase]}?command=${encodeURIComponent(command)}`; window.location.href = url; } else { alert("Please specify the warehouse name to get direct payment data."); } }else if (commands[command]) { // Logic for fixed commands in the commands object window.location.href = commands[command]; // Handle other fixed commands } else { document.getElementById('status').innerText = 'Command not recognized!'; } } // Voice Command Handling document.getElementById('startVoice').addEventListener('click', () => { const recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)(); recognition.lang = 'en-US'; recognition.start(); const statusElement = document.getElementById('status'); // Listening Status statusElement.innerText = 'Status: Listening...'; statusElement.className = 'status-listening'; // Apply listening class recognition.onresult = (event) => { const spokenCommand = event.results[0][0].transcript; handleCommand(spokenCommand); }; recognition.onerror = (event) => { // Error Status statusElement.innerText = 'An error occurred while processing your command!'; statusElement.className = 'status-error'; // Apply error class console.error('Error occurred:', event.error); }; recognition.onend = () => { // Not Listening Status statusElement.innerText = 'Status: Not Listening!'; statusElement.className = 'status-not-listening'; // Apply not listening class }; }); // Text Command Handling document.getElementById('submitCommand').addEventListener('click', () => { const typedCommand = document.getElementById('commandInput').value; if (typedCommand.trim() !== "") { handleCommand(typedCommand); } else { alert("Please enter a valid command."); } }); </script> @endsection @endsection