update big migrate
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 4m17s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 20s
Build, Push and Deploy / deploy-staging (push) Successful in 35s
Build, Push and Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-05-05 15:29:32 +07:00
parent e34027132e
commit 30de18d283
24 changed files with 970 additions and 30 deletions

View File

@@ -0,0 +1,59 @@
<?php
namespace Modules\ThermalPrinterAddon\App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* The module namespace to assume when generating URLs to actions.
*/
protected string $moduleNamespace = 'Modules\ThermalPrinterAddon\App\Http\Controllers';
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*/
public function boot(): void
{
parent::boot();
}
/**
* Define the routes for the application.
*/
public function map(): void
{
$this->mapApiRoutes();
$this->mapWebRoutes();
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')
->namespace($this->moduleNamespace)
->group(module_path('ThermalPrinterAddon', '/routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*/
protected function mapApiRoutes(): void
{
Route::prefix('api')
->middleware('api')
->namespace($this->moduleNamespace)
->group(module_path('ThermalPrinterAddon', '/routes/api.php'));
}
}

View File

@@ -0,0 +1,111 @@
<?php
namespace Modules\ThermalPrinterAddon\App\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class ThermalPrinterAddonServiceProvider extends ServiceProvider
{
protected string $moduleName = 'ThermalPrinterAddon';
protected string $moduleNameLower = 'thermalprinteraddon';
/**
* Boot the application events.
*/
public function boot(): void
{
$this->registerCommands();
$this->registerCommandSchedules();
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->moduleName, 'Database/migrations'));
}
/**
* Register the service provider.
*/
public function register(): void
{
$this->app->register(RouteServiceProvider::class);
}
/**
* Register commands in the format of Command::class
*/
protected function registerCommands(): void
{
//
}
/**
* Register command Schedules.
*/
protected function registerCommandSchedules(): void
{
//
}
/**
* Register translations.
*/
public function registerTranslations(): void
{
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
$this->loadJsonTranslationsFrom($langPath);
} else {
$this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower);
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang'));
}
}
/**
* Register config.
*/
protected function registerConfig(): void
{
$this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower . '.php')], 'config');
$this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower);
}
/**
* Register views.
*/
public function registerViews(): void
{
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'resources/views');
$this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower . '-module-views']);
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
$componentNamespace = str_replace('/', '\\', config('modules.namespace') . '\\' . $this->moduleName . '\\' . config('modules.paths.generator.component-class.path'));
Blade::componentNamespace($componentNamespace, $this->moduleNameLower);
}
/**
* Get the services provided by the provider.
*/
public function provides(): array
{
return [];
}
private function getPublishableViewPaths(): array
{
$paths = [];
foreach (config('view.paths') as $path) {
if (is_dir($path . '/modules/' . $this->moduleNameLower)) {
$paths[] = $path . '/modules/' . $this->moduleNameLower;
}
}
return $paths;
}
}

View File

@@ -0,0 +1,31 @@
{
"name": "nwidart/thermalprinteraddon",
"description": "",
"authors": [
{
"name": "Nicolas Widart",
"email": "n.widart@gmail.com"
}
],
"extra": {
"laravel": {
"providers": [],
"aliases": {
}
}
},
"autoload": {
"psr-4": {
"Modules\\ThermalPrinterAddon\\": "",
"Modules\\ThermalPrinterAddon\\App\\": "app/",
"Modules\\ThermalPrinterAddon\\Database\\Factories\\": "database/factories/",
"Modules\\ThermalPrinterAddon\\Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Modules\\ThermalPrinterAddon\\Tests\\": "tests/"
}
}
}

View File

@@ -0,0 +1,5 @@
<?php
return [
'name' => 'ThermalPrinterAddon',
];

View File

@@ -0,0 +1,12 @@
{
"name": "ThermalPrinterAddon",
"alias": "thermalprinteraddon",
"version": "1.0",
"description": "",
"keywords": [],
"priority": 0,
"providers": [
"Modules\\ThermalPrinterAddon\\App\\Providers\\ThermalPrinterAddonServiceProvider"
],
"files": []
}

View File

@@ -0,0 +1,15 @@
{
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"axios": "^1.1.2",
"laravel-vite-plugin": "^0.7.5",
"sass": "^1.69.5",
"postcss": "^8.3.7",
"vite": "^4.0.0"
}
}

View File

@@ -0,0 +1,103 @@
<div class="invoice-container-sm">
<div class="invoice-content invoice-content-size">
<div class="invoice-logo">
<img src="{{ asset(get_business_option('business-settings')['invoice_logo'] ?? 'assets/images/default.svg') ?? '' }}"
alt="">
</div>
<div>
<h4 class="company-name">{{ auth()->user()->business->companyName ?? 'Pos Pro' }}</h4>
<div class="company-info">
<p>Address: {{ auth()->user()->business->address ?? '' }}</p>
<p>Mobile: {{ auth()->user()->business->phoneNumber ?? '' }}</p>
<p>Email: {{ auth()->user()->email ?? '' }}</p>
<p>{{ get_business_option('business-settings')['vat_name'] ?? '' }}: {{ get_business_option('business-settings')['vat_no'] ?? '' }}</p>
</div>
</div>
<h3 class="invoice-title my-1">
invoice
</h3>
<div class="invoice-info">
<div class="">
<p>Invoice : {{ $party->dueCollect->invoiceNumber ?? '' }}</p>
<p>Bill To: {{ $party->name ?? 'Guest' }}</p>
<p>Mobile: {{ $party->phone ?? '' }}</p>
</div>
<div class="">
<p class="text-end date">Date : {{ formatted_date($party->dueCollect->paymentDate ?? '') }}</p>
<p class="text-end time">Time: {{ formatted_time($party->dueCollect->paymentDate ?? '') }}</p>
<p class="text-end">Collected By: {{ $party->dueCollect->business->companyName ?? '' }}</p>
</div>
</div>
<table class="ph-invoice-table">
<thead>
<tr>
<th class="text-start table-sl">SL</th>
<th>Total Due</th>
<th>Payment Amount</th>
<th>Remaining Due</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-start table-sl">1</td>
<td>{{ currency_format($due_collect->totalDue ?? 0, currency: business_currency()) }}</td>
<td class="text-center">
{{ currency_format($due_collect->payDueAmount ?? 0, currency: business_currency()) }}</td>
<td class="text-center">
{{ currency_format($due_collect->dueAmountAfterPay ?? 0, currency: business_currency()) }}
</td>
</tr>
<tr>
<td colspan="2" class="">
<div class="payment-type-container">
<h6 class="text-center">Payment Type:
{{ $due_collect->payment_type_id != null ? $due_collect->payment_type->name ?? '' : $due_collect->paymentType }}
</h6>
<p class="text-center">Product sold will not be Exchanged Without invice</p>
</div>
</td>
<td colspan="3">
<div class="calculate-amount">
<div class="d-flex justify-content-between">
<p>Payable Amount:</p>
<p>{{ currency_format($due_collect->totalDue ?? 0, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between">
<p>Received Amount:</p>
<p>{{ currency_format($due_collect->payDueAmount ?? 0, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between">
<p>Change Amt/Due:</p>
<p>{{ currency_format($due_collect->dueAmountAfterPay ?? 0, currency: business_currency()) }}
</p>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<div class="invoice-footer-sm mt-3">
<h5>{{ get_business_option('business-settings')['gratitude_message'] ?? '' }}</h5>
<div class="scanner">
<img src="{{ asset('assets/images/icons/scanner.svg') }}" alt="">
</div>
<h6>{{ get_option('general')['admin_footer_text'] ?? '' }} <a href="{{ get_option('general')['admin_footer_link'] ?? '#' }}" target="_blank">{{ get_option('general')['admin_footer_link_text'] ?? '' }}</h6>
</div>
</div>
</div>
@push('js')
<script>
$(document).ready(function() {
window.print();
})
</script>
@endpush

View File

@@ -0,0 +1,274 @@
<div class="invoice-container-sm">
<div class="invoice-content invoice-content-size">
<div class="invoice-logo mb-2">
<img src="{{ asset(get_business_option('business-settings')['invoice_logo'] ?? 'assets/images/default.svg') ?? '' }}" alt="Logo">
</div>
<div>
<h4 class="company-name">{{ $purchase->business->companyName ?? 'Pos Pro' }}</h4>
<div class="company-info">
<p> {{__('Address')}} : {{ $purchase->business->address ?? '' }}</p>
<p> {{__('Mobile')}} : {{ $purchase->business->phoneNumber ?? '' }}</p>
<p> {{__('Email')}} : {{ auth()->user()->email ?? '' }}</p>
@if (!empty($purchase->business->vat_name))
<p>{{ $purchase->business->vat_name }} : {{ $purchase->business->vat_no ?? '' }}</p>
@endif
</div>
</div>
<h3 class="invoice-title my-1">
{{__('invoice')}}
</h3>
<div class="invoice-info">
<div class="">
<p> {{__('Invoice')}} : {{ $purchase->invoiceNumber ?? '' }}</p>
<p> {{__('Name')}} : {{ $purchase->party->name ?? '' }}</p>
<p> {{__('Mobile')}} : {{ $purchase->party->phone ?? '' }}</p>
</div>
<div class="">
<p class="text-end date"> {{__('Date')}} : {{ formatted_date($purchase->purchaseDate ?? '') }}</p>
<p class="text-end time"> {{__('Time')}} : {{ formatted_time($purchase->purchaseDate ?? '') }}</p>
<p class="text-end"> {{__('Purchase By')}} : {{ $purchase->user->name }}</p>
</div>
</div>
@if (!$purchase_returns->isEmpty())
<table class="ph-invoice-table">
<thead>
<tr>
<th class="text-start table-sl"> {{__('SL')}}.</th>
<th> {{__('Product')}} </th>
<th> {{__('QTY')}} </th>
<th> {{__('U.Price')}} </th>
<th class="text-end"> {{__('Amount')}} </th>
</tr>
</thead>
@php
$subtotal = 0;
@endphp
<tbody>
@foreach ($purchase->details as $detail)
@php
$productTotal = ($detail->productPurchasePrice ?? 0) * ($detail->quantities ?? 0);
$subtotal += $productTotal;
@endphp
<tr>
<td class="text-start table-sl">{{ $loop->iteration }}</td>
<td>{{ $detail->product->productName ?? '' }}</td>
<td class="text-center">{{ $detail->quantities ?? '' }}</td>
<td class="text-center">
{{ currency_format($detail->productPurchasePrice ?? 0, currency: business_currency()) }}
</td>
<td class="text-end">{{ currency_format($productTotal, currency: business_currency()) }}</td>
</tr>
@endforeach
<tr>
<td colspan="2" class="">
<div class="payment-type-container">
<h6 class="text-start"> {{__('Payment Type')}} :
{{ $purchase->payment_type_id != null ? $purchase->payment_type->name ?? '' : $purchase->paymentType }}
</h6>
</div>
</td>
<td colspan="3">
<div class="calculate-amount">
<div class="d-flex justify-content-between">
<p> {{__('Sub-Total')}} :</p>
<p>{{ currency_format($subtotal, currency: business_currency()) }}</p>
</div>
<div class="d-flex justify-content-between">
<p> {{__('Vat')}} : </p>
<p>{{ currency_format($purchase->vat_amount, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between">
<p> {{__('Discount')}} :</p>
<p>{{ currency_format($purchase->discountAmount, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between ">
<p> {{__('Shipping Charge')}} :</p>
<p>{{ currency_format($purchase->shipping_charge, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between total-amount">
<p> {{__('Net Payable')}} :</p>
<p>{{ currency_format($subtotal + $purchase->vat_amount - ($purchase->discountAmount + $total_discount) + $purchase->shipping_charge, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between paid">
<p> {{__('Paid')}} :</p>
<p>{{ currency_format($purchase->paidAmount, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between">
<p> {{__('Due')}} : </p>
<p>{{ currency_format($purchase->dueAmount, currency: business_currency()) }}
</p>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<table class="ph-invoice-table mt-2">
<thead>
<tr>
<th>{{ __('Date') }}</th>
<th>{{ __('Return Product') }}</th>
<th>{{ __('QTY') }}</th>
<th class="text-end">{{ __('Amount') }}</th>
</tr>
</thead>
@php $total_return_amount = 0; @endphp
<tbody>
@foreach ($purchase_returns as $key => $return)
@foreach ($return->details as $detail)
@php
$total_return_amount += $detail->return_amount ?? 0;
@endphp
<tr>
<td class="text-start">{{ formatted_date($return->return_date) }}</td>
<td>{{ $detail->purchaseDetail->product->productName ?? '' }}</td>
<td class="text-center">{{ $detail->return_qty ?? 0 }}</td>
<td class="text-end"> {{ currency_format($detail->return_amount ?? 0, currency: business_currency()) }}</td>
</tr>
@endforeach
@endforeach
<tr>
<td class="total-due" colspan="2">
<div class="payment-type-container">
<h6 class="text-center">{{ __('Payment Type') }}: {{ $purchase->payment_type_id != null ? $purchase->payment_type->name ?? '' : $purchase->paymentType }}</h6>
</div>
</td>
<td colspan="3">
<div class="calculate-amount">
<div class="d-flex justify-content-between">
<p>{{ __('Total Return') }}:</p>
<p>{{ currency_format($total_return_amount, currency: business_currency()) }}</p>
</div>
<div class="in-border"></div>
<div class="d-flex justify-content-between total-amount">
<p>{{ __('Payable') }}:</p>
<p>{{ currency_format($purchase->totalAmount, currency: business_currency()) }}</p>
</div>
<div class="d-flex justify-content-between paid">
<p>{{ __('Paid') }}:</p>
<p>{{ currency_format($purchase->paidAmount, currency: business_currency()) }}</p>
</div>
<div class="d-flex justify-content-between">
<p>{{ __('Due') }}:</p>
<p>{{ currency_format($purchase->dueAmount, currency: business_currency()) }}</p>
</div>
</div>
</td>
</tr>
</tbody>
</table>
@else
<table class="ph-invoice-table">
<thead>
<tr>
<th class="text-start table-sl"> {{__('SL')}}.</th>
<th> {{__('Product')}} </th>
<th> {{__('QTY')}} </th>
<th> {{__('U.Price')}} </th>
<th class="text-end"> {{__('Amount')}} </th>
</tr>
</thead>
@php
$subtotal = 0;
@endphp
<tbody>
@foreach ($purchase->details as $detail)
@php
$productTotal = ($detail->productPurchasePrice ?? 0) * ($detail->quantities ?? 0);
$subtotal += $productTotal;
@endphp
<tr>
<td class="text-start table-sl">{{ $loop->iteration }}</td>
<td>{{ $detail->product->productName ?? '' }}</td>
<td class="text-center">{{ $detail->quantities ?? '' }}</td>
<td class="text-center">
{{ currency_format($detail->productPurchasePrice ?? 0, currency: business_currency()) }}
</td>
<td class="text-end">{{ currency_format($productTotal, currency: business_currency()) }}</td>
</tr>
@endforeach
<tr>
<td colspan="2" class="">
<div class="payment-type-container">
<h6 class="text-start"> {{__('Payment Type')}} :
{{ $purchase->payment_type_id != null ? $purchase->payment_type->name ?? '' : $purchase->paymentType }}
</h6>
</div>
</td>
<td colspan="3">
<div class="calculate-amount">
<div class="d-flex justify-content-between">
<p> {{__('Sub-Total')}} :</p>
<p>{{ currency_format($subtotal, currency: business_currency()) }}</p>
</div>
<div class="d-flex justify-content-between">
<p> {{__('Vat')}} : </p>
<p>{{ currency_format($purchase->vat_amount, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between">
<p> {{__('Discount')}} :</p>
<p>{{ currency_format($purchase->discountAmount, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between ">
<p> {{__('Shipping Charge')}} :</p>
<p>{{ currency_format($purchase->shipping_charge, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between total-amount">
<p> {{__('Net Payable')}} :</p>
<p>{{ currency_format($subtotal + $purchase->vat_amount - ($purchase->discountAmount + $total_discount) + $purchase->shipping_charge, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between paid">
<p> {{__('Paid')}} :</p>
<p>{{ currency_format($purchase->paidAmount, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between">
<p> {{__('Due')}} : </p>
<p>{{ currency_format($purchase->dueAmount, currency: business_currency()) }}
</p>
</div>
</div>
</td>
</tr>
</tbody>
</table>
@endif
<div class="invoice-footer-sm mt-3">
<h5>{{ get_business_option('business-settings')['gratitude_message'] ?? '' }}</h5>
@if (!empty(get_business_option('business-settings')['note']))
<p class="text-center note-pera"> {{ get_business_option('business-settings')['note_label'] ?? '' }} : {{ get_business_option('business-settings')['note'] ?? '' }}</p>
@endif
<div class="scanner">
<img src="{{ asset(get_business_option('business-settings')['invoice_scanner_logo'] ?? 'assets/images/icons/scanner.svg') }}" alt="">
</div>
<h6>{{ get_option('general')['admin_footer_text'] ?? '' }} <a href="{{ get_option('general')['admin_footer_link'] ?? '#' }}" target="_blank">{{ get_option('general')['admin_footer_link_text'] ?? '' }}</h6>
</div>
</div>
</div>
@push('js')
<script>
$(document).ready(function() {
window.print();
})
</script>
@endpush

View File

@@ -0,0 +1,290 @@
<div class="invoice-container-sm">
<div class="invoice-content invoice-content-size">
<div class="invoice-logo">
<img src="{{ asset(get_business_option('business-settings')['invoice_logo'] ?? 'assets/images/default.svg') ?? '' }}"
alt="Logo">
</div>
<div class="mt-2">
<h4 class="company-name">{{ $sale->business->companyName ?? 'Pos Pro' }}</h4>
<div class="company-info">
<p> {{__('Address')}} : {{ $sale->business->address ?? '' }}</p>
<p> {{__('Mobile')}} : {{ $sale->business->phoneNumber ?? '' }}</p>
<p> {{__('Email')}} : {{ auth()->user()->email ?? '' }}</p>
@if (!empty($sale->business->vat_name))
<p>{{ $sale->business->vat_name }} : {{ $sale->business->vat_no ?? '' }}</p>
@endif
</div>
</div>
<h3 class="invoice-title my-1">
{{__('invoice')}}
</h3>
<div class="invoice-info">
<div class="">
<p> {{__('Invoice')}} : {{ $sale->invoiceNumber ?? '' }}</p>
<p> {{__('Name')}} : {{ $sale->party->name ?? 'Cash' }}</p>
<p> {{__('Mobile')}} : {{ $sale->party->phone ?? '' }}</p>
</div>
<div class="">
<p class="text-end date"> {{__('Date')}} : {{ formatted_date($sale->saleDate ?? '') }}</p>
<p class="text-end time"> {{__('Time')}} : {{ formatted_time($sale->saleDate ?? '') }}</p>
<p class="text-end"> {{__('Sales By')}} : {{ $sale->user->name }}</p>
</div>
</div>
@if (!$sale_returns->isEmpty())
<table class="ph-invoice-table">
<thead>
<tr>
<th class="text-start table-sl">{{ __('SL') }}</th>
<th>{{ __('Product') }}</th>
<th>{{ __('QTY') }}</th>
<th>{{ __('U.Price') }}</th>
<th class="text-end">{{ __('Amount') }}</th>
</tr>
</thead>
@php
$subtotal = 0;
@endphp
<tbody>
@foreach ($sale->details as $detail)
@php
$productTotal = ($detail->price ?? 0) * ($detail->quantities ?? 0);
$subtotal += $productTotal;
@endphp
<tr>
<td class="text-start table-sl">{{ $loop->iteration }}</td>
<td>{{ $detail->product->productName ?? '' }}</td>
<td class="text-center">{{ $detail->quantities ?? '' }}</td>
<td class="text-center">
{{ currency_format($detail->price ?? 0, currency: business_currency()) }}</td>
<td class="text-end">
{{ currency_format($productTotal, currency: business_currency()) }}
</td>
</tr>
@endforeach
<tr>
<td class="total-due" colspan="2">
<div class="payment-type-container">
<h6 class="text-center">{{ __('Payment Type') }}:
{{ $sale->payment_type_id != null ? $sale->payment_type->name ?? '' : $sale->paymentType }}
</h6>
<p class="text-center">{{ $sale->meta['notes'] ?? ($sale->meta['note'] ?? '') }}
</p>
</div>
</td>
<td colspan="3">
<div class="calculate-amount">
<div class="d-flex justify-content-between">
<p>{{ __('Sub-Total') }}:</p>
<p>{{ currency_format($subtotal, currency: business_currency()) }}</p>
</div>
<div class="d-flex justify-content-between">
<p>{{ __('Vat') }}:</p>
<p> {{ currency_format($sale->tax_amount, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between ">
<p>{{ __('Delivery charge') }}:</p>
<p>{{ currency_format($sale->shipping_charge, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between">
<p>{{ __('Discount') }}
@if ($sale->discount_type == 'percent')
({{ $sale->discount_percent }}%)
@endif:
</p>
<p> {{ currency_format($sale->discountAmount + $total_discount, currency: business_currency()) }}
</p>
</div>
<div class="in-border"></div>
<div class="d-flex justify-content-between total-amount">
<p>{{ __('Net Payable') }}:</p>
<p> {{ currency_format($subtotal + $sale->tax_amount - ($sale->discountAmount + $total_discount) + $sale->shipping_charge + $sale->rounding_amount, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between paid">
<p>{{ __('Total Payable') }}:</p>
<p> {{ currency_format($subtotal + $sale->tax_amount - ($sale->discountAmount + $total_discount) + $sale->shipping_charge, currency: business_currency()) }}
</p>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<table class="ph-invoice-table mt-2">
<thead>
<tr>
<th class="invoice-th">{{ __('Date') }}</th>
<th class="invoice-th">{{ __('Return Product') }}</th>
<th class="invoice-th">{{ __('QTY') }}</th>
<th class="invoice-th text-end">{{ __('Amount') }}</th>
</tr>
</thead>
@php $total_return_amount = 0; @endphp
<tbody>
@foreach ($sale_returns as $key => $return)
@foreach ($return->details as $detail)
@php
$total_return_amount += $detail->return_amount ?? 0;
@endphp
<tr>
<td class="text-start">{{ formatted_date($return->return_date) }}</td>
<td>{{ $detail->saleDetail->product->productName ?? '' }}</td>
<td class="text-center">{{ $detail->return_qty ?? 0 }}</td>
<td class="text-end">
{{ currency_format($detail->return_amount ?? 0, currency: business_currency()) }}
</td>
</tr>
@endforeach
@endforeach
<tr>
<td class="total-due" colspan="2">
<div class="payment-type-container">
<h6 class="text-center">{{ __('Payment Type') }}:
{{ $sale->payment_type_id != null ? $sale->payment_type->name ?? '' : $sale->paymentType }}
</h6>
<p class="text-center">{{ $sale->meta['notes'] ?? ($sale->meta['note'] ?? '') }}
</p>
</div>
</td>
<td colspan="3">
<div class="calculate-amount">
<div class="d-flex justify-content-between">
<p>{{ __('Total Return') }}:</p>
<p>{{ currency_format($total_return_amount, currency: business_currency()) }}
</p>
</div>
<div class="in-border"></div>
<div class="d-flex justify-content-between total-amount">
<p>{{ __('Payable') }}:</p>
<p>{{ currency_format($sale->totalAmount, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between paid">
<p>{{ __('Paid') }}:</p>
<p>{{ currency_format($sale->paidAmount, currency: business_currency()) }}</p>
</div>
<div class="d-flex justify-content-between">
<p>{{ __('Due') }}:</p>
<p>{{ currency_format($sale->dueAmount, currency: business_currency()) }}</p>
</div>
</div>
</td>
</tr>
</tbody>
</table>
@else
<table class="ph-invoice-table">
<thead>
<tr>
<th class="text-start table-sl" > {{__('SL')}}.</th>
<th> {{__('Product')}} </th>
<th> {{__('QTY')}} </th>
<th> {{__('U.Price')}} </th>
<th class="text-end"> {{__('Amount')}} </th>
</tr>
</thead>
@php
$subtotal = 0;
@endphp
<tbody>
@foreach ($sale->details as $detail)
@php
$productTotal = ($detail->price ?? 0) * ($detail->quantities ?? 0);
$subtotal += $productTotal;
@endphp
<tr>
<td class="text-start table-sl">{{ $loop->iteration }}</td>
<td>{{ $detail->product->productName ?? '' }}</td>
<td class="text-center">{{ $detail->quantities ?? '' }}</td>
<td class="text-center">
{{ currency_format($detail->price ?? 0, currency: business_currency()) }}
</td>
<td class="text-end">
{{ currency_format($productTotal, currency: business_currency()) }}</td>
</tr>
@endforeach
<tr>
<td colspan="2" class="">
<div class="payment-type-container">
<h6 class="text-start"> {{__('Payment Type')}} :
{{ $sale->payment_type_id != null ? $sale->payment_type->name ?? '' : $sale->paymentType }}
</h6>
</div>
</td>
<td colspan="3">
<div class="calculate-amount">
<div class="d-flex justify-content-between">
<p> {{__('Sub-Total')}} :</p>
<p>{{ currency_format($subtotal, currency: business_currency()) }}</p>
</div>
<div class="d-flex justify-content-between">
<p> {{__('Vat')}} :</p>
<p>{{ currency_format($sale->vat_amount, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between">
<p> {{__('Discount')}} :</p>
<p>{{ currency_format($sale->discountAmount, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between ">
<p> {{__('Shipping Charge')}} :</p>
<p>{{ currency_format($sale->shipping_charge, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between total-amount">
<p> {{__('Net Payable')}} :</p>
<p>{{ currency_format($sale->totalAmount, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between paid">
<p> {{__('Paid')}} :</p>
<p>{{ currency_format($sale->paidAmount, currency: business_currency()) }}
</p>
</div>
<div class="d-flex justify-content-between">
<p> {{__('Due')}} :</p>
<p>{{ currency_format($sale->dueAmount, currency: business_currency()) }}
</p>
</div>
</div>
</td>
</tr>
</tbody>
</table>
@endif
<div class="invoice-footer-sm mt-3">
<h5>{{ get_business_option('business-settings')['gratitude_message'] ?? '' }}</h5>
@if (!empty(get_business_option('business-settings')['note']))
<p class="text-center note-pera">{{ get_business_option('business-settings')['note_label'] ?? '' }} :
{{ get_business_option('business-settings')['note'] ?? '' }}</p>
@endif
<div class="scanner">
<img src="{{ asset(get_business_option('business-settings')['invoice_scanner_logo'] ?? 'assets/images/icons/scanner.svg') }}"
alt="">
</div>
<h6>{{ get_option('general')['admin_footer_text'] ?? '' }} <a href="{{ get_option('general')['admin_footer_link'] ?? '#' }}" target="_blank">{{ get_option('general')['admin_footer_link_text'] ?? '' }}</h6>
</div>
</div>
</div>
@push('js')
<script>
$(document).ready(function() {
window.print();
})
</script>
@endpush

View File

@@ -0,0 +1,4 @@
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

View File

@@ -0,0 +1,3 @@
<?php
use Illuminate\Support\Facades\Route;

View File

@@ -0,0 +1,26 @@
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
build: {
outDir: '../../public/build-thermalprinteraddon',
emptyOutDir: true,
manifest: true,
},
plugins: [
laravel({
publicDirectory: '../../public',
buildDirectory: 'build-thermalprinteraddon',
input: [
__dirname + '/resources/assets/sass/app.scss',
__dirname + '/resources/assets/js/app.js'
],
refresh: true,
}),
],
});
//export const paths = [
// 'Modules/$STUDLY_NAME$/resources/assets/sass/app.scss',
// 'Modules/$STUDLY_NAME$/resources/assets/js/app.js',
//];