diff --git a/app/controllers/InvoiceController.php b/app/controllers/InvoiceController.php index 1494c07714..ec66c426a5 100755 --- a/app/controllers/InvoiceController.php +++ b/app/controllers/InvoiceController.php @@ -356,6 +356,8 @@ class InvoiceController extends \BaseController { */ public function show($publicId) { + Session::reflash(); + return Redirect::to('invoices/'.$publicId.'/edit'); } diff --git a/app/database/migrations/2014_03_19_201454_add_language_support.php b/app/database/migrations/2014_03_19_201454_add_language_support.php index b48683073e..6acc56e2d4 100644 --- a/app/database/migrations/2014_03_19_201454_add_language_support.php +++ b/app/database/migrations/2014_03_19_201454_add_language_support.php @@ -24,6 +24,8 @@ class AddLanguageSupport extends Migration { DB::table('languages')->insert(['name' => 'German', 'locale' => 'de']); DB::table('languages')->insert(['name' => 'French', 'locale' => 'fr']); DB::table('languages')->insert(['name' => 'Brazilian Portuguese', 'locale' => 'pt_BR']); + DB::table('languages')->insert(['name' => 'Dutch', 'locale' => 'nl']); + DB::table('languages')->insert(['name' => 'Spanish', 'locale' => 'es']); Schema::table('accounts', function($table) { diff --git a/app/lang/de/texts.php b/app/lang/de/texts.php index d3134fcfc9..fb3de4111d 100644 --- a/app/lang/de/texts.php +++ b/app/lang/de/texts.php @@ -253,7 +253,7 @@ return array( 'confirmation_header' => 'Konto Bestätigung', 'confirmation_message' => 'Bitte klicke auf den folgenden Link um dein Konto zu bestätigen.', 'invoice_message' => 'Um Ihre Rechnung über :amount einzusehen, klicken Sie bitte auf den folgenden Link.', - 'payment_subject' => 'Zahlungseingang :invoice', + 'payment_subject' => 'Zahlungseingang', 'payment_message' => 'Vielen Dank für Ihre Zahlung von :amount.', 'email_salutation' => 'Sehr geehrte/r :name,', 'email_signature' => 'Freundliche Grüße,', @@ -304,6 +304,6 @@ return array( 'erase_data' => 'This will permanently erase your data.', 'password' => 'Password', 'invoice_subject' => 'New invoice from :account', - + 'close' => 'Close', ); diff --git a/app/lang/en/texts.php b/app/lang/en/texts.php index 68a11ea708..52c3eab51e 100644 --- a/app/lang/en/texts.php +++ b/app/lang/en/texts.php @@ -96,6 +96,7 @@ return array( 'import' => 'Import', 'download' => 'Download', 'cancel' => 'Cancel', + 'close' => 'Close', 'provide_email' => 'Please provide a valid email address', 'powered_by' => 'Powered by', 'no_items' => 'No items', @@ -254,7 +255,7 @@ return array( 'confirmation_message' => 'Please access the link below to confirm your account.', 'invoice_subject' => 'New invoice from :account', 'invoice_message' => 'To view your invoice for :amount, click the link below.', - 'payment_subject' => 'Payment Received :invoice', + 'payment_subject' => 'Payment Received', 'payment_message' => 'Thank you for your payment of :amount.', 'email_salutation' => 'Dear :name,', 'email_signature' => 'Regards,', diff --git a/app/lang/es/texts.php b/app/lang/es/texts.php index 557487330d..04c9875638 100644 --- a/app/lang/es/texts.php +++ b/app/lang/es/texts.php @@ -95,6 +95,7 @@ return array( 'import' => 'Import', 'download' => 'Download', 'cancel' => 'Cancel', + 'close' => 'Close', 'provide_email' => 'Please provide a valid email address', 'powered_by' => 'Powered by', 'no_items' => 'No items', @@ -253,7 +254,7 @@ return array( 'confirmation_message' => 'Please access the link below to confirm your account.', 'invoice_subject' => 'New invoice from :account', 'invoice_message' => 'To view your invoice for :amount, click the link below.', - 'payment_subject' => 'Payment Received :invoice', + 'payment_subject' => 'Payment Received', 'payment_message' => 'Thank you for your payment of :amount.', 'email_salutation' => 'Dear :name,', 'email_signature' => 'Regards,', @@ -303,6 +304,6 @@ return array( 'success_message' => 'You have succesfully registered. Please visit the link in the account confirmation email to verify your email address.', 'erase_data' => 'This will permanently erase your data.', 'password' => 'Password', - + ); diff --git a/app/lang/fr/texts.php b/app/lang/fr/texts.php index 722c5064b0..a9fe84daa5 100644 --- a/app/lang/fr/texts.php +++ b/app/lang/fr/texts.php @@ -96,6 +96,7 @@ return array( 'import' => 'Import', 'download' => 'Download', 'cancel' => 'Cancel', + 'close' => 'Close', 'provide_email' => 'Please provide a valid email address', 'powered_by' => 'Powered by', 'no_items' => 'No items', @@ -254,7 +255,7 @@ return array( 'confirmation_message' => 'Please access the link below to confirm your account.', 'invoice_subject' => 'New invoice from :account', 'invoice_message' => 'To view your invoice for :amount, click the link below.', - 'payment_subject' => 'Payment Received :invoice', + 'payment_subject' => 'Payment Received', 'payment_message' => 'Thank you for your payment of :amount.', 'email_salutation' => 'Dear :name,', 'email_signature' => 'Regards,', diff --git a/app/lang/it/texts.php b/app/lang/it/texts.php index 14490fe17c..3eac655a4d 100644 --- a/app/lang/it/texts.php +++ b/app/lang/it/texts.php @@ -96,6 +96,7 @@ return array( 'import' => 'Import', 'download' => 'Download', 'cancel' => 'Cancel', + 'close' => 'Close', 'provide_email' => 'Please provide a valid email address', 'powered_by' => 'Powered by', 'no_items' => 'No items', @@ -254,7 +255,7 @@ return array( 'confirmation_message' => 'Please access the link below to confirm your account.', 'invoice_subject' => 'New invoice from :account', 'invoice_message' => 'To view your invoice for :amount, click the link below.', - 'payment_subject' => 'Payment Received :invoice', + 'payment_subject' => 'Payment Received', 'payment_message' => 'Thank you for your payment of :amount.', 'email_salutation' => 'Dear :name,', 'email_signature' => 'Regards,', diff --git a/app/lang/nl/texts.php b/app/lang/nl/texts.php index 8924bee0a3..5bdec85af3 100644 --- a/app/lang/nl/texts.php +++ b/app/lang/nl/texts.php @@ -253,7 +253,7 @@ return array( 'confirmation_header' => 'Bevestiging Account', 'confirmation_message' => 'Ga alstublieft naar onderstaande link om je account te bevestiging.', 'invoice_message' => 'Om je factuur voor :amount te bekijken, klik op onderstaande link.', - 'payment_subject' => 'Betaling ontvangen :invoice', + 'payment_subject' => 'Betaling ontvangen', 'payment_message' => 'Bedankt voor je betaling van :amount.', 'email_salutation' => 'Beste :name,', 'email_signature' => 'Met vriendelijke groeten,', @@ -304,5 +304,6 @@ return array( 'erase_data' => 'This will permanently erase your data.', 'password' => 'Password', 'invoice_subject' => 'New invoice from :account', + 'close' => 'Close', ); diff --git a/app/lang/pt_BR/texts.php b/app/lang/pt_BR/texts.php index fa6fc1a68b..08407c46c5 100644 --- a/app/lang/pt_BR/texts.php +++ b/app/lang/pt_BR/texts.php @@ -252,7 +252,6 @@ return array( 'confirmation_header' => 'Confirmação de Conta', 'confirmation_message' => 'Favor acessar o link abaixo para confirmar a sua conta.', 'invoice_message' => 'Para visualizar a sua fatura de :amount, clique no link abaixo.', - 'payment_subject' => 'Recebido Pagamento de :invoice', 'payment_message' => 'Obrigado pelo seu pagamento de :amount.', 'email_salutation' => 'Caro :name,', 'email_signature' => 'Até mais,', @@ -291,6 +290,8 @@ return array( 'success_message' => 'You have succesfully registered. Please visit the link in the account confirmation email to verify your email address.', 'erase_data' => 'This will permanently erase your data.', 'password' => 'Password', + 'close' => 'Close', 'invoice_subject' => 'New invoice from :account', - + 'payment_subject' => 'Recebido Pagamento de', // I remove the invoice number, is it still correct? Thanks! + ); diff --git a/app/models/Invoice.php b/app/models/Invoice.php index 7e73122f86..4fda510865 100755 --- a/app/models/Invoice.php +++ b/app/models/Invoice.php @@ -52,6 +52,13 @@ class Invoice extends EntityModel return $this->invoice_status_id >= INVOICE_STATUS_VIEWED; } + public function isPaid() + { + return $this->invoice_status_id >= INVOICE_STATUS_PAID; + } + + + public function hidePrivateFields() { $this->setVisible(['invoice_number', 'discount', 'po_number', 'invoice_date', 'due_date', 'terms', 'public_notes', 'amount', 'balance', 'invoice_items', 'client', 'tax_name', 'tax_rate', 'account', 'invoice_design_id']); diff --git a/app/views/header.blade.php b/app/views/header.blade.php index f37fd99d17..75460051c7 100755 --- a/app/views/header.blade.php +++ b/app/views/header.blade.php @@ -261,15 +261,13 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice {{ Former::text('new_last_name')->label(trans('texts.last_name')) }} {{ Former::text('new_email')->label(trans('texts.email')) }} {{ Former::password('new_password')->label(trans('texts.password')) }} - {{ Former::checkbox('terms_checkbox')->label(' ')->text(trans('texts.agree_to_terms').' '.trans('texts.terms_of_service').'') }} + {{ Former::checkbox('terms_checkbox')->label(' ')->text(trans('texts.agree_to_terms', ['terms' => ''.trans('texts.terms_of_service').''])) }} {{ Former::close() }}

- - diff --git a/app/views/invoices/view.blade.php b/app/views/invoices/view.blade.php index 75baab8850..b717752393 100755 --- a/app/views/invoices/view.blade.php +++ b/app/views/invoices/view.blade.php @@ -9,7 +9,7 @@ @section('content') - @if ($invoice->client->account->isGatewayConfigured()) + @if ($invoice->client->account->isGatewayConfigured() && !$invoice->isPaid())
{{ Button::normal(trans('texts.download_pdf'), array('onclick' => 'onDownloadClick()', 'class' => 'btn-lg')) }} {{ Button::primary_link(URL::to('payment/' . $invitation->invitation_key), trans('texts.pay_now'), array('class' => 'btn-lg pull-right')) }}