Deploy Ladill POS / deploy (push) Successful in 1m42s
Register supports USB keyboard-wedge scanners with SKU lookup (local catalog and CRM in retail mode). Sales get a thermal receipt print template (58/80mm) with configurable header/footer, plus optional auto-print after cash sales. Co-authored-by: Cursor <cursoragent@cursor.com>
59 lines
1.3 KiB
PHP
59 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class PosLocation extends Model
|
|
{
|
|
public const STYLE_RETAIL = 'retail';
|
|
|
|
public const STYLE_RESTAURANT = 'restaurant';
|
|
|
|
protected $fillable = [
|
|
'owner_ref',
|
|
'name',
|
|
'currency',
|
|
'service_style',
|
|
'receipt_footer',
|
|
'receipt_header',
|
|
'printer_paper_mm',
|
|
'printer_auto_print',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'printer_paper_mm' => 'integer',
|
|
'printer_auto_print' => 'boolean',
|
|
];
|
|
}
|
|
|
|
public function isRestaurant(): bool
|
|
{
|
|
return $this->service_style === self::STYLE_RESTAURANT;
|
|
}
|
|
|
|
public function products(): HasMany
|
|
{
|
|
return $this->hasMany(PosProduct::class, 'location_id');
|
|
}
|
|
|
|
public function tables(): HasMany
|
|
{
|
|
return $this->hasMany(PosTable::class, 'location_id');
|
|
}
|
|
|
|
public function sales(): HasMany
|
|
{
|
|
return $this->hasMany(PosSale::class, 'location_id');
|
|
}
|
|
|
|
public function scopeOwned(Builder $query, string $ownerRef): Builder
|
|
{
|
|
return $query->where('owner_ref', $ownerRef);
|
|
}
|
|
}
|