From ed021347cfa9bcb7378a77a6d22de805f51d0dd2 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 8 Nov 2015 17:01:41 +0200 Subject: [PATCH] Working on Gmail actions --- app/Ninja/Presenters/InvoicePresenter.php | 10 +--------- resources/views/emails/view_action.blade.php | 10 +++------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/app/Ninja/Presenters/InvoicePresenter.php b/app/Ninja/Presenters/InvoicePresenter.php index 2df32f095b96..5f3cd32270b1 100644 --- a/app/Ninja/Presenters/InvoicePresenter.php +++ b/app/Ninja/Presenters/InvoicePresenter.php @@ -5,7 +5,7 @@ use Laracasts\Presenter\Presenter; class InvoicePresenter extends Presenter { - public function minimumAmountDue() + public function balance_due() { $amount = $this->entity->getRequestedAmount(); $currencyId = $this->entity->client->currency_id; @@ -13,12 +13,4 @@ class InvoicePresenter extends Presenter { return Utils::formatMoney($amount, $currencyId); } - public function totalAmountDue() - { - $amount = $this->entity->balance; - $currencyId = $this->entity->client->currency_id; - - return Utils::formatMoney($amount, $currencyId); - } - } \ No newline at end of file diff --git a/resources/views/emails/view_action.blade.php b/resources/views/emails/view_action.blade.php index bf2f5d12d07f..ac4b145dda66 100644 --- a/resources/views/emails/view_action.blade.php +++ b/resources/views/emails/view_action.blade.php @@ -4,10 +4,6 @@ { "@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", @@ -23,8 +19,8 @@ }, "totalPaymentDue": { "@type": "PriceSpecification", - "price": "{{ $invoice->present()->totalAmountDue }}" - } + "price": "{{ $invoice->present()->balance_due }}" + } }, @endif { @@ -33,7 +29,7 @@ "action": { "@type": "ViewAction", "url": "{!! $link !!}", - "name": "View {{ $entityType }}" + "name": "{{ trans("view_{$entityType}") }}" } } ]