@extends('layouts.app') @section('title', isset($invoice) ? 'Redigera '.$invoice->invoice_number : 'Ny faktura') @section('content') @php $tenant = auth()->user()->tenant; $customers = $tenant->customers()->where('is_active',true)->orderBy('name')->get(); $products = $tenant->products()->where('is_active',true)->orderBy('name')->get(); $isEdit = isset($invoice); @endphp
@csrf @if($isEdit)@method('PUT')@endif

{{ $isEdit ? 'Redigera '.$invoice->invoice_number : 'Ny faktura' }}

@if($isEdit){{ $invoice->status_label }}@endif
@if($isEdit)📄 PDF@endif
+ Ny kund
@if($isEdit&&$invoice->customer)
{{ $invoice->customer->name }}
{{ $invoice->customer->email }}
@endif
Fakturarader
@foreach(['Artikel','Beskrivning','Antal','Enhet','À-pris','Rabatt%','Moms%','Summa',''] as $h)
{{ $h }}
@endforeach
@if($isEdit&&$invoice->rows->count()) @foreach($invoice->rows as $i=>$row) @include('invoices._row', ['i'=>$i, 'row'=>$row]) @endforeach @else @include('invoices._row', ['i'=>0, 'row'=>null]) @endif
Datum
Betalning
Summering
Exkl. moms0,00 kr
Total moms0,00 kr
Att betala0,00 kr
@php $rowCount = $isEdit ? $invoice->rows->count() : 1; @endphp @push('scripts') @endpush @endsection