mirror of https://github.com/4xmen/xshop.git
added Liana theme part to invoice
parent
925437ac3c
commit
a0bd025b7e
@ -0,0 +1,29 @@
|
||||
@extends('website.inc.website-layout')
|
||||
|
||||
@section('title')
|
||||
{{$title}} - {{config('app.name')}}
|
||||
@endsection
|
||||
@section('content')
|
||||
<main>
|
||||
<div class="no-print">
|
||||
@if(\App\Models\Area::where('name',$area)->first()->use_default)
|
||||
@foreach(getParts('default_header') as $part)
|
||||
@php($p = $part->getBladeWithData())
|
||||
@include($p['blade'],['data' => $p['data']])
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
@foreach(getParts($area) as $part)
|
||||
@php($p = $part->getBladeWithData())
|
||||
@include($p['blade'],['data' => $p['data']])
|
||||
@endforeach
|
||||
<div class="no-print">
|
||||
@if(\App\Models\Area::where('name',$area)->first()->use_default)
|
||||
@foreach(getParts('default_footer') as $part)
|
||||
@php($p = $part->getBladeWithData())
|
||||
@include($p['blade'],['data' => $p['data']])
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</main>
|
||||
@endsection
|
@ -0,0 +1,118 @@
|
||||
<section class='LianaInvoice'>
|
||||
<div class="p-3">
|
||||
|
||||
<div class="row mb-4">
|
||||
<div class="col-10">
|
||||
<div class="overflow-hidden">
|
||||
<img src="{{asset('upload/images/logo.png')}}" class="float-end liana-logo" alt="">
|
||||
|
||||
<h3 class="mt-3">
|
||||
{{config('app.name')}}
|
||||
</h3>
|
||||
</div>
|
||||
{{-- @php($invoice == \App\Models\Invoice::first())--}}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{{__("Date")}}: {{$invoice->created_at->ldate('Y-m-d')}}
|
||||
</div>
|
||||
<div class="col-7 text-center">
|
||||
{{__("Customer")}}: {{$invoice->customer->name}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{{__("ID")}}: {{$invoice->hash}} ({{$invoice->status}})
|
||||
</div>
|
||||
<div class="col-7 text-center">
|
||||
{{__("Customer mobile")}}: {{$invoice->customer->mobile}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2 text-center">
|
||||
<img src="{{$qr->render(route('client.invoice',$invoice->hash))}}" alt="qr code"
|
||||
class="qr-code">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped align-middle table-bordered text-center">
|
||||
<tr>
|
||||
<th>
|
||||
#
|
||||
</th>
|
||||
<th>
|
||||
{{__("Product")}}
|
||||
</th>
|
||||
<th>
|
||||
{{__("Count")}}
|
||||
</th>
|
||||
<th>
|
||||
{{__("Quantity")}}
|
||||
</th>
|
||||
<th>
|
||||
{{__("Price")}}
|
||||
</th>
|
||||
</tr>
|
||||
@foreach($invoice->orders as $k => $order)
|
||||
<tr>
|
||||
<td>
|
||||
{{$k + 1}}
|
||||
</td>
|
||||
<td>
|
||||
{{$order->product->name}}
|
||||
</td>
|
||||
<td>
|
||||
{{number_format($order->count)}}
|
||||
</td>
|
||||
<td>
|
||||
@if( ($order->quantity->meta??null) == null)
|
||||
-
|
||||
@else
|
||||
@foreach($order->quantity->meta as $m)
|
||||
<span>
|
||||
{{$m->human_value}}
|
||||
</span>
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{number_format($order->price_total)}}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
-
|
||||
</td>
|
||||
<td>
|
||||
{{__("Transport")}}
|
||||
{{number_format($invoice->transport_price)}}
|
||||
</td>
|
||||
<td colspan="2">
|
||||
{{__("Total price")}}
|
||||
{{number_format($invoice->total_price)}}
|
||||
</td>
|
||||
<td colspan="2">
|
||||
{{__("Orders count")}}: ({{number_format($invoice->count)}})
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="inv-footer">
|
||||
<p>
|
||||
{{$invoice->desc}}
|
||||
</p>
|
||||
<hr>
|
||||
{{__("Address")}}:
|
||||
{{$invoice->address->state->name}}, {{$invoice->address->city->name}}, {{$invoice->address->address}}
|
||||
, {{$invoice->address->zip}}
|
||||
@if(trim(getSetting($data->area->name.'_'.$data->part.'_desc')) != '')
|
||||
<hr>
|
||||
{!! getSetting($data->area->name.'_'.$data->part.'_desc') !!}
|
||||
@endif
|
||||
</div>
|
||||
<div class="no-print btn btn-primary mt-2 w-100" onclick="window.print()">
|
||||
{{__("Print")}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "LianaInvoice",
|
||||
"version": "1.0",
|
||||
"author": "xStack",
|
||||
"email": "xshop@xstack.ir",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"url": "https:\/\/xstack.ir",
|
||||
"author_url": "https:\/\/4xmen.ir",
|
||||
"packages": []
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Resources\Views\Segments;
|
||||
|
||||
use App\Models\Part;
|
||||
use App\Models\Setting;
|
||||
|
||||
class LianaInvoice
|
||||
{
|
||||
public static function onAdd(Part $part = null)
|
||||
{
|
||||
|
||||
$setting = new Setting();
|
||||
$setting->section = 'theme';
|
||||
$setting->key = $part->area->name . '_' . $part->part.'_desc';
|
||||
$setting->value = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus aliquid consequuntur culpa cupiditate dignissimos dolor doloremque error facilis ipsum iure officia quam qui, tempora! Fuga harum impedit iusto magnam veniam.';
|
||||
$setting->size = 12;
|
||||
$setting->title = $part->area->name . ' ' . $part->part. ' invoice footer description';
|
||||
$setting->type = 'EDITOR';
|
||||
$setting->save();
|
||||
}
|
||||
public static function onRemove(Part $part = null)
|
||||
{
|
||||
Setting::where('key',$part->area->name . '_' . $part->part.'_desc')->first()?->delete();
|
||||
}
|
||||
public static function onMount(Part $part = null)
|
||||
{
|
||||
return $part;
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
.LianaInvoice {
|
||||
.inv-footer{
|
||||
border: 1px solid gray;
|
||||
padding: 1rem;
|
||||
border-radius: var(--xshop-border-radius);
|
||||
}
|
||||
|
||||
|
||||
.liana-logo{
|
||||
height: 64px;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
|
||||
.qr-code{
|
||||
max-width: 150px;
|
||||
}
|
||||
@media print {
|
||||
&{
|
||||
font-size: 90%;
|
||||
}
|
||||
.qr-code{
|
||||
max-width: 100%;
|
||||
}
|
||||
.liana-logo{
|
||||
width: 64px;
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 149 KiB |
Loading…
Reference in New Issue