invoice backend VAT & discount calculations

This commit is contained in:
Peter Papp
2021-05-04 09:44:55 +02:00
parent fbde515a40
commit 0332f8b1fb
13 changed files with 478 additions and 556 deletions
+2 -1
View File
@@ -15,7 +15,8 @@ class Invoice extends Model
'bag' => 'array',
];
public function getMimetype() {
public function getMimetype()
{
return 'pdf';
}
+1 -2
View File
@@ -63,8 +63,7 @@ class Invoice extends Model
$invoice->delivery_at = $invoice->created_at;
$invoice->due_at = Carbon::parse($invoice->created_at)->addWeeks(2);
$invoice->total_discount = invoice_total_discount($invoice);
$invoice->total_net = invoice_total_net($invoice);
$invoice->total_net = invoice_total($invoice);
$invoice->total_tax = invoice_total_tax($invoice);
$invoice->currency = 'CZK';
+1 -1
View File
@@ -1,7 +1,6 @@
<?php
namespace App\Models;
use App\Notifications\ResetPassword;
use App\Traits\Oasis;
use ByteUnits\Metric;
use Illuminate\Support\Str;
@@ -10,6 +9,7 @@ use App\Services\HelperService;
use App\Services\StripeService;
use Laravel\Sanctum\HasApiTokens;
use Kyslik\ColumnSortable\Sortable;
use App\Notifications\ResetPassword;
use Illuminate\Support\Facades\Storage;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Factories\HasFactory;