如何解决如何将完整的文档发送到打印机
我使用的是laravel刀片,其中我将数据传递到html标签格式的打印机中,我在单个页面中打开多个发票并将所有标签发送给打印机以立即进行打印,但问题是它查看所有发票,但它仅先发送发票,不打印剩余的发票,这是我的代码,我会在最近的document.getElementById('prnt').innerHTML;
中将id =“ prnt”发送到
这是完整的代码
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head><Meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<Meta http-equiv="X-UA-Compatible" content="IE=edge">
<Meta name="viewport" content="width=device-width,initial-scale=1">
<!-- CSRF Token -->
<Meta name="csrf-token" content="{{ csrf_token() }}">
<title>Order Details</title>
<!-- Bootstrap core css-->
<link href="{{ asset('assets/bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<!-- Custom fonts for this template-->
<link href="{{ asset('assets/font-awesome/css/font-awesome.min.css') }}" rel="stylesheet" type="text/css">
<!-- Latest compiled and minified JavaScript -->
<style>
.border-top{ border-top: 1px solid #eee; } .padding-20px{padding: 20px}
@media print {
.hidden-print { display:none !important; }
}
</style>
</head>
<body>
@foreach($data as $inv_row)
<section class="invoices-section">
<div class="container">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<!--<p class="text-center" align="1">{{ date('d/m/Y h:i:sa') }}</p>-->
<div id="prnt">
<img class="img-fluid" src="{{ asset('images/order DESIGN.bmp') }}" alt="Invoice Header Image" width="470px" height="200px"/>
<table class="table table-bordered table-custom-th" width="100%" cellspacing="0">
<p>Customer Name: {{ strtoupper($inv_row->customer->user->name) }}</p>
<!--@foreach($inv_row['ordertakers'] as $otd)-->
<!--<p>Customer Name: {{ strtoupper($otd->ordertaker->name) }}</p>-->
<!--@endforeach-->
<p>Address: {{ $inv_row->customer->address }}</p>
<p>Phone : {{ $inv_row->customer->phone }}</p>
<p>Date: {{ date('d/m/Y h:i:sa',strtotime($inv_row->created_at)) }} / Bill No: {{ $inv_row['bill_no'] }}</p>
<p class="text-center">*******************************</p>
@foreach($inv_row['order_details'] as $inv_detail)
<tr>
<td>
<p class="text-center" align="1"> --------------</p>
</td>
</tr>
<tr>
<td class="text-center" align="1"><?PHP echo $inv_detail->product->name; ?></td>
</tr>
<tr>
<td>
<p class="text-center" align="1"> --------------</p>
</td>
</tr>
<tr>
<td>Price :{{ $inv_detail->amount / $inv_detail->unit }}</td>
</tr>
<tr>
<td>Unit :{{ $inv_detail->unit }}</td>
</tr>
<tr>
<td>Amount:{{ $inv_detail->amount }} </td>
</tr>
<?PHP $is_c_benefit = App\CustomPrice::where(['customer_id' => $inv_detail->order->customer_id,'product_id' => $d->product_id])->first();?>
@endforeach
</table>
<p class="text-center">*******************************</p>
<table class="table">
<tbody>
<tr>
<td>
Sub Total: {{$inv_row->subtotal }}
</td>
</tr>
<tr>
<td>
discount: {{ $inv_row->discount }}
</td>
</tr>
@if($inv_row['prev_invoices_details']->amount_left>0)
<tr>
<td>
Balance : {{ $inv_row['prev_invoices_details']->amount_left }}
</td>
</tr>
@elseif($inv_row['prev_invoices_details']->amount_left<0)
<tr>
<td>
Prev Advance : {{ $inv_row['prev_invoices_details']->amount_left*-1 }}
</td>
</tr>
@endif
@if($inv_row->amount>0)
<tr>
<td>
Total :{{ $inv_row->amount + $inv_row['prev_invoices_details']->amount_left - $inv_row->discount }}
</td>
</tr>
@if($inv_row->received_amount>0 && $inv_row->amount_left>=0)
<tr>
<td>
Received: {{ $inv_row->received_amount }}
</td>
</tr>
@if($inv_row->discount != 0)
<tr>
<td>
discount: {{ $inv_row->discount }}
</td>
</tr>
@endif
<tr>
<td>
Remaining Balance: {{ $inv_row->amount_left }}
</td>
</tr>
@endif
@if($inv_row->received_amount>0 && $inv_row->amount_left<0)
<tr>
<td>
Received: {{ $inv_row->received_amount }}
</td>
</tr>
<tr>
<td>
Advance: {{ $inv_row->amount_left*-1 }}
</td>
</tr>
@endif
@else($inv_row->amount<0)
<tr>
<td>
Crrent Advance : {{ $inv_row->amount*-1 }}
</td>
</tr>
@endif
<tr>
<td>
Bit : {{ $inv_row->c_benefit }}
</td>
</tr>
<tr>
<td>
<b>PrevIoUs Bill History {{date('d/m/Y h:i:sa',strtotime( $inv_row['prev_invoices_details']->created_at))}}</b>
</td>
</tr>
<tr>
<td>
Subtotal: {{ $inv_row['prev_invoices_details']->subtotal}}
</td>
</tr>
<tr>
<td>
Total : {{ $inv_row['prev_invoices_details']->amount }}
</td>
</tr>
<tr>
<td>
Received: {{ $inv_row['prev_invoices_details']->received_amount }}
</td>
</tr>
@if( $inv_row['prev_invoices_details']->discount != 0)
<tr>
<td>
discount: {{ $inv_row['prev_invoices_details']->discount }}
</td>
</tr>
@endif
@if($inv_row['prev_invoices_details']->amount_left>0)
<tr>
<td>
Remaining Balance: {{ $inv_row['prev_invoices_details']->amount_left }}
</td>
</tr>
@elseif($inv_row['prev_invoices_details']->amount_left <= -1 && $inv_row['prev_invoices_details']->amount_left != 0)
<tr>
<td>
Advance : {{ $inv_row['prev_invoices_details']->amount_left*-1 }}
</td>
</tr>
@endif
</tbody>
</table>
<div class="text-center"><img class="" align="1" src="{{asset('images/qr.bmp') }}" alt="Invoice Header Image" width="auto" height="auto"/></div>
<p class="text-center">--------Thank You--------</p>
</div>
</div>
<div class="col-md-3"></div>
</div>
@if($loop->last)
<br>
@else
<hr>
@endif
</div>
</section>
@endforeach
<div class="border-top ">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="text-center padding-20px">
<button id="btnStatus2" onclick="window.location='printerplus://send?text='+document.getElementById('prnt').innerHTML;" onclick="btnStatus2_Click">
Send to Printer+
</button>
</div>
</div>
</div>
</div>
</div>
@section('scripts')
<script type="text/javascript">
$("tr.statuscheck input,tr.statuscheck select,tr.statuscheck textarea").prop('disabled',true);
</script>
@endsection
</body>
</html>
即时通讯出现了什么错误,或者是否有其他方法可以立即发送所有标签,并希望使用PHP分享一件iam,以便将数据发送到蓝牙打印机,所以任何帮助都将是满满的
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。