From b6d67581690a4f53c58400ae40fa0b5f81311fc0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 7 Dec 2014 10:47:58 +0200 Subject: [PATCH] Minor bug fixes --- app/commands/SendRecurringInvoices.php | 5 +++++ app/controllers/AccountController.php | 2 +- app/controllers/AppController.php | 2 +- app/controllers/InvoiceController.php | 16 ++++++++++++++-- app/routes.php | 2 +- app/views/invoices/edit.blade.php | 19 ++++++++++++++----- 6 files changed, 36 insertions(+), 10 deletions(-) diff --git a/app/commands/SendRecurringInvoices.php b/app/commands/SendRecurringInvoices.php index ef54921372b0..a3e86af027c9 100755 --- a/app/commands/SendRecurringInvoices.php +++ b/app/commands/SendRecurringInvoices.php @@ -57,6 +57,11 @@ class SendRecurringInvoices extends Command { $invoice->tax_name = $recurInvoice->tax_name; $invoice->tax_rate = $recurInvoice->tax_rate; $invoice->invoice_design_id = $recurInvoice->invoice_design_id; + $invoice->custom_value1 = $recurInvoice->custom_value1; + $invoice->custom_value2 = $recurInvoice->custom_value2; + $invoice->custom_taxes1 = $recurInvoice->custom_taxes1; + $invoice->custom_taxes2 = $recurInvoice->custom_taxes2; + $invoice->is_amount_discount = $recurInvoice->is_amount_discount; if ($invoice->client->payment_terms) { diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index 6adc64e32de2..e6f27e4a3cf4 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -878,7 +878,7 @@ class AccountController extends \BaseController { } else { - //$this->accountRepo->registerUser($user); + $this->accountRepo->registerUser($user); } $activities = Activity::scope()->get(); diff --git a/app/controllers/AppController.php b/app/controllers/AppController.php index 02a99da975be..d9ffff476fe5 100644 --- a/app/controllers/AppController.php +++ b/app/controllers/AppController.php @@ -99,7 +99,7 @@ class AppController extends BaseController { $user->amend(); //Auth::login($user, true); - //$this->accountRepo->registerUser($user); + $this->accountRepo->registerUser($user); return Redirect::to('/invoices/create'); } diff --git a/app/controllers/InvoiceController.php b/app/controllers/InvoiceController.php index 34a71dab38e5..69c8d84266c4 100755 --- a/app/controllers/InvoiceController.php +++ b/app/controllers/InvoiceController.php @@ -310,6 +310,17 @@ class InvoiceController extends \BaseController { private static function getViewModel() { + $recurringHelp = ''; + foreach(preg_split("/((\r?\n)|(\r\n?))/", trans('texts.recurring_help')) as $line){ + $parts = explode("=>", $line); + if (count($parts) > 1) { + $line = $parts[0] . ' => ' . Utils::processVariables($parts[0]); + $recurringHelp .= '
  • ' . strip_tags($line) . '
  • '; + } else { + $recurringHelp .= $line; + } + } + return [ 'account' => Auth::user()->account, 'products' => Product::scope()->orderBy('id')->get(array('product_key','notes','cost','qty')), @@ -330,7 +341,8 @@ class InvoiceController extends \BaseController { 5 => 'Three months', 6 => 'Six months', 7 => 'Annually' - ) + ), + 'recurringHelp' => $recurringHelp ]; } @@ -490,7 +502,7 @@ class InvoiceController extends \BaseController { public function bulk($entityType = ENTITY_INVOICE) { $action = Input::get('action'); - $statusId = Input::get('statusId'); + $statusId = Input::get('statusId', INVOICE_STATUS_SENT); $ids = Input::get('id') ? Input::get('id') : Input::get('ids'); $count = $this->invoiceRepo->bulk($ids, $action, $statusId); diff --git a/app/routes.php b/app/routes.php index f3dd2b23bc4d..4d7e329025d7 100755 --- a/app/routes.php +++ b/app/routes.php @@ -257,7 +257,7 @@ define('NINJA_GATEWAY_ID', GATEWAY_AUTHORIZE_NET); define('NINJA_GATEWAY_CONFIG', '{"apiLoginId":"626vWcD5","transactionKey":"4bn26TgL9r4Br4qJ","testMode":"","developerMode":""}'); define('NINJA_WEB_URL', 'https://www.invoiceninja.com'); define('NINJA_APP_URL', 'https://app.invoiceninja.com'); -define('NINJA_VERSION', '1.5.2'); +define('NINJA_VERSION', '1.6.0'); define('NINJA_DATE', '2000-01-01'); define('NINJA_FROM_EMAIL', 'maildelivery@invoiceninja.com'); define('RELEASES_URL', 'https://github.com/hillelcoren/invoice-ninja/releases/'); diff --git a/app/views/invoices/edit.blade.php b/app/views/invoices/edit.blade.php index 5f1d72accb64..ef9e2e4bca61 100755 --- a/app/views/invoices/edit.blade.php +++ b/app/views/invoices/edit.blade.php @@ -303,6 +303,11 @@ @endif @endif + @if ($invoice->invoice_status_id < INVOICE_STATUS_SENT) +
  • +
  • {{ trans("texts.mark_sent") }}
  • + @endif +
  • {{ trans("texts.archive_{$entityType}") }}
  • {{ trans("texts.delete_{$entityType}") }}
  • @@ -487,7 +492,7 @@
    -   {{ trans('texts.recurring_help') }}   +   {{ $recurringHelp }}