Deploy Ladill POS / deploy (push) Successful in 36s
Split bills (restaurant tickets): - New pos_payments ledger; a tab is settled across one or more cash/Ladill Pay payments. The ticket shows total / paid / balance, an amount field with Full / ½ / ⅓ / ¼ helpers, and the payments taken. Partial payments keep the tab open; the sale finalises (and frees the table) only when the balance hits zero. Pay splits get their own checkout + callback (pos.payments.callback). Pipe online orders to the KDS: - POST /api/kitchen/orders — a first-party, service-keyed ingest (config pos.kitchen_api_keys, scoped by owner, idempotent by external_ref) that creates a paid, already-fired ticket (order_type=online, lines source=online). - The KDS feed is now payment-agnostic (any kitchen-active sale), so paid online orders sit on the board next to dine-in tabs and bump the same way; they're badged "online". Schema additive: pos_payments, pos_sales.external_ref. Suite green (14). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
45 lines
892 B
PHP
45 lines
892 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class PosPayment extends Model
|
|
{
|
|
public const STATUS_PENDING = 'pending';
|
|
|
|
public const STATUS_PAID = 'paid';
|
|
|
|
public const STATUS_FAILED = 'failed';
|
|
|
|
public const METHOD_CASH = 'cash';
|
|
|
|
public const METHOD_PAY = 'pay';
|
|
|
|
protected $fillable = [
|
|
'pos_sale_id',
|
|
'owner_ref',
|
|
'amount_minor',
|
|
'method',
|
|
'status',
|
|
'pay_order_id',
|
|
'payment_reference',
|
|
'paid_at',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'amount_minor' => 'integer',
|
|
'pay_order_id' => 'integer',
|
|
'paid_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function sale(): BelongsTo
|
|
{
|
|
return $this->belongsTo(PosSale::class, 'pos_sale_id');
|
|
}
|
|
}
|