@extends('layouts.app') @section('title',($document->exists?'Edit':'Create').' '.ucfirst($type).' | BASCORE') @section('content') @php $isQuote = $type === 'quotation'; $route = $document->exists ? route($isQuote ? 'quotations.update' : 'invoices.update',$document) : route($isQuote ? 'quotations.store' : 'invoices.store'); $lines = old('items', $document->exists ? $document->items->toArray() : [['description'=>'','quantity'=>1,'unit_price'=>0,'discount'=>0,'by_others'=>false,'vat_rate'=>$setting->default_vat_percentage]]); @endphp

{{ $document->exists ? 'Edit' : 'Create' }} {{ $isQuote ? 'Quotation' : 'Tax Invoice' }}

Build a clean client-ready document with automatic VAT totals.
@csrf @if($document->exists) @method('put') @endif

Line Items

@foreach($lines as $i => $line) @endforeach
ItemDescriptionQtyUnit PriceDiscountBy OthersVAT %Total
0.00
@endsection