Invoice & Clients sorting

This commit is contained in:
Peter Papp
2021-05-11 10:09:50 +02:00
parent 1ea8f2ce60
commit a6db642db7
16 changed files with 195 additions and 98 deletions

View File

@@ -1,5 +1,4 @@
<?php
namespace App\Http\Resources\Oasis;
use Illuminate\Http\Resources\Json\JsonResource;
@@ -16,22 +15,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),
'invoice_number' => $this->invoice_number,
'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'),
'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'),
],
],
];