@php
$order = $invoice->order;
@endphp
@if (
$order !== null
&& $order->order_type !== null
&& ! in_array($order->order_type->value, [\App\Enums\Payments\OrderType::Wired->value, \App\Enums\Payments\OrderType::Web->value], true)
&& in_array($invoice->status->value, ['open', 'confirmed', 'in-design', 'in_design'], true)
&& ! $order->isPaid()
&& $order->total > 0
)
@endif
@if ($order !== null)
View Invoice
Edit Order
@if ($invoice->sale instanceof \App\Models\Sale)
View Sale Record
@else
Add to Sales
@endif
@if ($order->order_type?->value === \App\Enums\Payments\OrderType::Phone->value)
View Stripe Payments
@endif
@if ($invoice->status === \App\Enums\InvoiceStatus::Completed)
@if ($invoice->flowerRecipe !== null)
View Recipe
Edit Recipe
@else
Log Recipe
@endif
@endif
@if (in_array($order->order_type->value, [\App\Enums\Payments\OrderType::Phone->value, \App\Enums\Payments\OrderType::Email->value], true))
@php
$customer = $order->customer;
$customerName = $customer instanceof \App\Models\Customer ? (string) $customer->name : '';
$customerEmail = $customer instanceof \App\Models\Customer ? (string) $customer->email : '';
@endphp
@if (in_array($invoice->status->value, ['open', 'confirmed', 'in-design', 'in_design'], true) && ! $order->isPaid())
@endif
@endif
@else
Add Order
@endif