mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 13:20:57 -04:00
Working on gmail actions
This commit is contained in:
parent
df8fb6f459
commit
bef7454b73
@ -2,9 +2,9 @@
|
||||
|
||||
use Utils;
|
||||
use DateTime;
|
||||
use App\Models\BalanceAffecting;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
use Laracasts\Presenter\PresentableTrait;
|
||||
use App\Models\BalanceAffecting;
|
||||
use App\Events\QuoteWasCreated;
|
||||
use App\Events\QuoteWasUpdated;
|
||||
use App\Events\InvoiceWasCreated;
|
||||
@ -14,10 +14,12 @@ use App\Events\QuoteInvitationWasEmailed;
|
||||
|
||||
class Invoice extends EntityModel implements BalanceAffecting
|
||||
{
|
||||
use PresentableTrait;
|
||||
use SoftDeletes {
|
||||
SoftDeletes::trashed as parentTrashed;
|
||||
}
|
||||
|
||||
protected $presenter = 'App\Ninja\Presenters\InvoicePresenter';
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
protected $casts = [
|
||||
|
@ -92,6 +92,7 @@ class ContactMailer extends Mailer
|
||||
'invoiceId' => $invoice->id,
|
||||
'invitation' => $invitation,
|
||||
'account' => $account,
|
||||
'invoice' => $invoice,
|
||||
];
|
||||
|
||||
if ($account->attatchPDF()) {
|
||||
|
24
app/Ninja/Presenters/InvoicePresenter.php
Normal file
24
app/Ninja/Presenters/InvoicePresenter.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php namespace App\Ninja\Presenters;
|
||||
|
||||
use Utils;
|
||||
use Laracasts\Presenter\Presenter;
|
||||
|
||||
class InvoicePresenter extends Presenter {
|
||||
|
||||
public function minimumAmountDue()
|
||||
{
|
||||
$amount = $this->entity->getRequestedAmount();
|
||||
$currencyId = $this->entity->client->currency_id;
|
||||
|
||||
return Utils::formatMoney($amount, $currencyId);
|
||||
}
|
||||
|
||||
public function totalAmountDue()
|
||||
{
|
||||
$amount = $this->entity->balance;
|
||||
$currencyId = $this->entity->client->currency_id;
|
||||
|
||||
return Utils::formatMoney($amount, $currencyId);
|
||||
}
|
||||
|
||||
}
|
8386
composer.lock
generated
Normal file
8386
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,7 @@
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
@if (false)
|
||||
@if (Utils::isNinjaDev())
|
||||
@include('emails.view_action', ['link' => $link, 'entityType' => $entityType])
|
||||
@endif
|
||||
{!! $body !!}
|
||||
|
@ -1,17 +1,40 @@
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context":"http://schema.org",
|
||||
"@type":"EmailMessage",
|
||||
"description":"View your {{ $entityType }}",
|
||||
"action": {
|
||||
"@type": "ViewAction",
|
||||
"url": "{!! $link !!}",
|
||||
"name": "View {{ $entityType }}"
|
||||
},
|
||||
"publisher": {
|
||||
"@type": "Organization",
|
||||
"name": "Invoice Ninja",
|
||||
"url": "{!! NINJA_WEB_URL !!}"
|
||||
}
|
||||
}
|
||||
[
|
||||
@if ($entityType == ENTITY_INVOICE)
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "Invoice",
|
||||
"minimumPaymentDue": {
|
||||
"@type": "PriceSpecification",
|
||||
"price": "{{ $invoice->present()->minimumAmountDue }}"
|
||||
},
|
||||
"paymentStatus": "PaymentDue",
|
||||
@if ($invoice->due_date)
|
||||
"paymentDue": "{{ $invoice->due_date }}T00:00:00+00:00",
|
||||
@endif
|
||||
"provider": {
|
||||
"@type": "Organization",
|
||||
"name": "{{ $account->getDisplayName() }}"
|
||||
},
|
||||
"broker": {
|
||||
"@type": "Organization",
|
||||
"name": "Invoice Ninja",
|
||||
"url": "{!! NINJA_WEB_URL !!}"
|
||||
},
|
||||
"totalPaymentDue": {
|
||||
"@type": "PriceSpecification",
|
||||
"price": "{{ $invoice->present()->totalAmountDue }}"
|
||||
}
|
||||
},
|
||||
@endif
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "EmailMessage",
|
||||
"action": {
|
||||
"@type": "ViewAction",
|
||||
"url": "{!! $link !!}",
|
||||
"name": "View {{ $entityType }}"
|
||||
}
|
||||
}
|
||||
]
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user