@extends('layouts.portal')
@php
$rows = old('items', $lines);
$rows = is_array($rows) && count($rows) ? array_values($rows) : [['description' => '', 'quantity' => 1, 'unit_price' => '']];
$eid = old('enrollment_id', $prefill['enrollment_id'] ?? null);
$due = old('due_date', now()->addDays((int) config('infotics.billing.payment_terms_days', 7))->format('Y-m-d'));
@endphp
@section('title', 'New invoice')
@section('subtitle', 'Bill a learner or a company. Link it to an enrollment and the learner\'s access activates automatically once '.rtrim(rtrim(number_format((float) config('infotics.billing.activation_min_percent', 50), 2), '0'), '.').'% is paid.')
@section('actions')