Edit invoice

This commit is contained in:
Peter Papp
2021-05-05 17:07:36 +02:00
parent bdfd92872e
commit 599b238ab4
22 changed files with 976 additions and 162 deletions

View File

@@ -1,4 +1,5 @@
<?php
namespace App\Http\Resources\Oasis;
use Illuminate\Http\Resources\Json\JsonResource;
@@ -15,15 +16,22 @@ class OasisInvoiceResource extends JsonResource
{
return [
'data' => [
'id' => $this->id,
'type' => 'invoice',
'id' => $this->id,
'type' => 'invoice',
'attributes' => [
'name' => $this->client['name'] . ' ' . format_to_currency($this->total_net, $this->currency),
'invoiceNumber' => $this->invoice_number,
'total' => format_to_currency($this->total_net, $this->currency),
'file_url' => "/oasis/invoice/$this->id",
'mimetype' => 'pdf',
'created_at' => format_date($this->created_at, '%d. %B. %Y'),
'name' => $this->client['name'] . ' ' . format_to_currency($this->total_net, $this->currency),
'invoice_number' => $this->invoice_number,
'variable_number' => $this->variable_number,
'invoice_type' => $this->invoice_type,
'delivery_at' => $this->delivery_at,
'items' => $this->items,
'discount_type' => $this->discount_type,
'discount_rate' => $this->discount_rate,
'client' => $this->client,
'total' => format_to_currency($this->total_net, $this->currency),
'file_url' => "/oasis/invoice/$this->id",
'mimetype' => 'pdf',
'created_at' => format_date($this->created_at, '%d. %B. %Y'),
],
],
];